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 Thu, 04 Jun 2009 13:37:45 +0000, pataphor wrote: > This probably has a snowballs change in hell of ending up in builtins or > even some in some module, but such things should not prevent one to try > and present the arguments for what one thinks is right. Else one would > end up with consequentialism and that way lies madness and hyperreality. It would be cruel of me to say "Too late", so I shall merely ask, what on earth are you going on about? > So here is my proposed suggestion for a once and for all reconciliation > of various functions in itertools that can not stand on their own and > keep a straight face. Because of backwards compatibility issues we > cannot remove them but we can boldly jump forward and include the right > repeat in the builtin namespace, which I think would be the best thing. What is "the right repeat"? What's wrong with the old one? If you're going to make a proposal, you have to actually *make the proposal* and not just say "Here, have some code, now put it in the builtins because the rest of itertools is teh suxor!!!". That rarely goes down well. (I don't know if that's exactly what you're trying to say, but it seems that way to me.) I've run your test code, and I don't know what I'm supposed to be impressed by. -- Steven
https://mail.python.org/pipermail/python-list/2009-June/539245.html
CC-MAIN-2014-15
refinedweb
243
75.34
I have posted an initial copy of my patch for machine detection, namespace cleanup, and promlib abstraction at. This is against 2.4.2 CURRENT oss. It currently passes my regression testsuite which unfortunately does not include an ip27 boot test. There are several goals to this patch: to be able to support multiple machines with a single kernel binary; to reduce code duplication among the various machines, and to provide a well-defined architecture for a future increase in the number and diversity of systems we support. This patch affects mips64 only at this time. However, it will be ported to the 32-bit mips tree following comment. It is also incomplete - I know for a fact that certain pci functions need this kind of abstraction as well, and the promlib support is fairly minimal. The accompanying documentation, while useful especially for new porters, is slightly out of date already. For those (embedded systems people) who think the ability to support multiple machines in a single kernel is useless bloat, consider instead that you will have significantly less code to maintain and to write, since more functionality will be provided by generic functions. No more copying the generic files, changing three lines, and having to maintain the copies forever. This patch as written adds less than 300 net lines of code to the kernel (the entire difference is contained in __init functions), and when finished will probably result in single-machine kernels which are approximately the same size as current versions. Please offer your comments. Barring a shockingly brutal rejection of the fundamental principles, I fully expect this to be integrated by 2.5.x for mips and mips64. Speak now or forever hold your peace. If you are interested, this code is also being maintained in cvs at cvs.foobazco.org, username cvs, password cvs, repository linux. This is not a fork; the patches will either be put into oss or dropped. This tree also has early 64-bit SGI O2 support based on work by Harald Koerfgen, nick@snowman.net, and me. -- Keith M Wesolowski <wesolows@foobazco.org> ------(( Project Foobazco Coordinator and Network Administrator ))------ "I should have crushed his marketing-addled skull with a fucking bat."
http://www.linux-mips.org/archives/linux-mips/2001-04/msg00005.html
CC-MAIN-2015-18
refinedweb
369
55.84
Help please! I've been trying to make this work for a while. The problem is such: Write a program that allows the user to enter eight judges' scores and then outputs the points received by the contestant. Format your output with two decimal places. A judge awards points between 1 and 10, with 1 being the lowest and 10 being the highest. For example, if the scores are 9.2, 9.3, 9.0, 9.9, 9.5, 9.5, 9.6, and 9.8, the contestant receives a total of 56.90. I believe that I have nearly completed everything correctly. What I can't figure out is how to calculate the sum of the remaining 6 numbers of the Array which is assigned the variable total in the calculateScore method and retrieve the variable. My last print statement is supposed to read ("The score of "+contestant+" is "+total+":"). Not sure how to correctly call the method calculateScore or where to put the print message without receiving the error:cannot find symbol - variable contestant Code : import java.util.Scanner; import javax.swing.*; public class Judging { public static void main(String[]args)//void, returns nothing { Scanner console = new Scanner (System.in); String contestant; double []scores = new double[8]; int n = 8; do { System.out.println("What is the name of the contestant? "); contestant= console.nextLine(); getData(scores,n,console); } while(true); } private static void getData(double []scores, int n, Scanner console) { double judge; for(int i=0;i<n;i++) { do { System.out.print("Give the score for the judge number "+(i+1)+": "); judge = console.nextDouble(); if (judge < 1 || judge > 10) System.out.println("Sorry! The score must be between 1 and 10"); else scores[i] = judge; } while (judge < 1 || judge > 10); } console.nextLine(); } private static double calculateScore(double []scores, int n) { double minValue = scores[0]; double maxValue = scores[0]; double total = 0.00; if (scores[n] < minValue) { minValue = scores[n]; } if (scores[n] > maxValue) { maxValue = scores[n]; } for (int i = 0; i < 8; i++) { if (scores[n] != minValue && scores[n] != maxValue) { total = total + scores[n]; //System.out.println("The score of "+contestant+"is "+total+":");????? } } return total; } }
http://www.javaprogrammingforums.com/%20whats-wrong-my-code/4088-judging-printingthethread.html
CC-MAIN-2016-18
refinedweb
358
66.74
FAQs about Skimmer Operation/Maintenance 4 Amiracle SL-15 Skimmer 1/26/08 First off, you guys have an awesome site. <Happy you have found it useful.> Next, here's the problem, I have a 60 gallon FOWLR with a emperor 400 and an Amiracle sl-15 Slimline hang on trickle filter. The tank has been up for about 4 months now and it only has 25 lbs of live rock, two cleaner shrimp and a chocolate chip starfish. <Careful with the chocolate chip.> The skimmer that came with the filter has yet to produce any kind of foam, I have adjusted the air flow to the pump ( rio 800) and when that didn't work I adjusted the water flow as well. <After four months, no skimmate?> Doesn't matter what I do I still get no foam. People have told me that I just have too little bio load, or that the skimmer just needs to go through some sort of break in cycle. <You have enough bioload to produce something. Skimmers do require a break in…usually measured in days or a week.> Is either of these true, or is this skimmer just junk? Just to clarify, I have no idea what kind of skimmer this is, no paperwork from store. I would appreciate any help you guys can give me. Thanks Brandon <I am familiar with these units, they are not too great, although I am surprised you have gotten nothing after so long. Adding a limewood air diffuser will probably produce some skimmate for you, but it will require maintenance. Ultimately I would look into a new skimmer if I were you. The AquaC Remora is a very nice hang on unit. Best of luck, Scott V.> Upgrading a Skimmer Hi, first of all thanks for the valuable information one can gain from your site. I had my Aquaclear Aquatics Pro 150 W/D running for about 7 months. It runs a 125 FOWLR tank with five medium sized fish. This certain W/D came with an attached skimmer. The problem is that in the last 7 months the skimmer probably produced a quart of scum which isn't that dark at all. I've tried adjusting the air valve, adjusting the pump (CAP) still no scum. I know that the skimmer isn't top quality, but shouldn't it produce something? <Not necessarily.> Is there something you can suggest before I start researching the Turboflotor 1000. <It sounds like you have tried most things to improve performance; adjusting air and adjusting water flow. Have you tried cleaning the pump in hot water and vinegar to remove deposits? This is something I do every six months and highly recommend it.> Will this T/B 1000 fit in the skimmer section of my W/D (9"x5")? Jim <Do check the Aqua-Medic web page for dimensions on the footprint. Also research the Euro-Reef and Aqua-C models. -Steven Pro> Turboflotor1000 For a T1000 should I use the needle wheel that came with it or keep the impeller from the rio2100 on? My T1000 came with 2 needle wheels, one with spikes on it. Which one should I use? I am looking for the best skimmer production from it. Thanks <definitely inclined to use the aspirating needle impeller, but you simply have to experiment to see what your system responds to best. So many aspects of hardware and husbandry can affect skimmate production, you will simply have to experiment and make an intelligent decision based on the performance of each over time. For the record... I like the spiky one.> Successful Skimming Thanks, Anthony. I hadn't thought of skimmate removal as a nutrient issue, so have been removing it only once or twice a week (maybe 4 ounces at a time.) I will jump to a daily clean-out. Thanks for the tip. <Ev... quite welcome. It is an easily overlooked dimension of the nutrient dynamic in aquaria. But given thought, when you look at how foul the skimmate is on weekly collections and then succeed in collected similar product daily... you realize that to not remove it daily means that it accumulates and concentrates. Although a bit slow to effect a cure, well run skimmers are perhaps the best and easiest way to correct nuisance algae growths in marine aquaria. Best regards, Anthony> Ev Newton Protein Skimmer Hi advise. <I rig a "tee" and a valve on the submersed part of the intake line beyond it, and adjust the plastic valve to mix the amount of air/water being pulled into the pump. Bob Fenner> Regards, David Chow Zero nitrates w/ refugium vs. giant clam Hello Mr. Fenner- I have read all the refugium notes/Faq's> RE: Turboflotor Needle Wheel Impellers Thanks Bob, I am grateful for your advice - and so is my Tang, he seems to be recovering. I need to get a good "Picture Book" of Marine aquarium fish so I used the paddle wheel that came with the 2500 in the 2100 (2500 was too much with the paddle wheel) instead of the Turboflotor's needle wheel device. <Thanks for this input> I screwed this up though when I put conditioner in the water for the remaining livestock after I took the Tang out. More frustrating than Golf! I pulled the damn. <No... elsewhere, putting in flooring with Uncle Frank in NJ. Bob Fenner> -Dave Re: Protein Skimmer I> Turboflotor Multi Hi.com Bob Fenner> RE: Turboflotor Multi Thanks for your prompt answer Bob. I was very tempted to just leave it alone, but after losing 3 fish during the time it was off (Flame Angel, Powder Blue and Red Hawk), I almost convinced myself that the pollutants in the tank killed them. Especially as whilst the water was "reef clear" all tank mates were visually happy and eating., Kevin <Be chatting, Bob Fenner> Turboflotor 1000 Multi Bob,. Thanks <Mmm, I would check with the people who chatted this modification up on Reefs.org. The times, places I've used Aqua-Medic's skimmers I have not injected more air... Bob Fenner> Skimmer Operation Hi!> Turboflotor setup Hi Bob, It's me again. I was reading through the skimmer FAQs again and noticed a lot of people were still having trouble with the Turboflotor setup. I just wanted one Rio 2100. Hope this helps. We can hop on the forum if I wasn't clear enough. Hope you have a good day. <Ah, another lesson (for me) in personal "arrogance"... I would have sworn most everyone would have known of this modification... Thank you. Bob Fenner> Protein skimmer I just put a Bak-Pak 2R skimmer on my 37 gal. tank... I am getting a lot of tiny bubbles in my tank ( I know that is good oxygen, but it has gotten... <Ofttimes> TF1000 in Rubbermaid sump Hello yet again! I get a semi noisy vibration sound from my TF1000. It's somewhat related to vibrating against the Rubbermaid, but even if I suspend it in the sump, there is considerable vibration noise. Regarding the vibrating between the s amount of water into the main chamber? <A mix of the two is actually best... Bob Fenner> Thanks in advance.- Eugene Turboflotor T100 Dear Mr. Fenner: After reading the archives here about protein skimmers, I decided to buy the T1000 for my 75 gallon FOWLR tank. I have been fiddling with this thing> Skimmer I>> Skimmer Hi. Love your column. I had a small problem with red slime recently, so I added some of Ultralife> Tunze Skimmer, Cyanobacteria Bloom, need help. Hi, <<Good day'>> I have been fighting a Cyanobacteria bloom for the better part of two months now. My water parameters look reasonable Salinity = 1.023, Nitrates/Nitrites near 0, PH = 8.2, dKH = 10. The fish and the few corals I have in this tank look good and are growing. My problem is that the substrate is nearly completely covered with Cyano (brown, slimy, forms strands). I suspect that the nutrient levels in my tank are extremely high. <<This tank is two months old? Ammonia/nitrites/nitrates should be zero, not low. My money is not on Cyano but diatom algae. Silicates + nitrates = diatoms, a brown algae that covers your substrate, sometimes floats, etc. No matter, high nutrients/overfeeding/low current/poor skimming will invite either.>> The reason I suspect this is because my skimmer (Tunze 240) does not seem to able to pull anything out of the tank. I've tried adjusting it till the cows come home with no luck. From all accounts, the Tunze skimmers are among the best but I can't get this one to work. My $65.00 Prism skimmer running on a 29 Gal tank is doing a much better job. I do get a lot of scum sticking to the walls of the column but I can't get foam to overflow into the collection cup. I've tried adjusting it from one extreme to the other (venturi fully closed to fully open) and everything in between. The tank is about 6mo old and I had hoped to move the inhabitants from my 29 gal. tank to this new setup someday. But until I can resolve this current issue these no way I'm gonna risk some corals that I've had for going on three years now. <<Do contact the manufacturer or dealer on how to adjust your skimmer or replace it with something easier for you to use. See:>> My setup is as follows: 75 Gal Reef tank. 20 Gal Sump 50lbs of live rock no deep sand bed or plenum 3 Maxi Jet 1200 powerheads <<Would ideally like to see 1.5 lbs rock per Gal. the more the better, DSB in tank and or sump, and ten times volume circulation per hour>> Eheim return pump Bioload: 6 Juvenal fish (largest being a Yellow Tang at about 3"), crabs, snails, 2 brittle stars. Since the outbreak I have been running carbon 24/7 (Probably stripping out the essential elements instead of helping) <<Doubtful at this point, change it out often enough though.>> It's my understanding that low dissolved nutrients and low levels of Nitrogen based molecules (NO3, NH4+, etc) are required for Cyano control. Since my tests indicate low levels of Nitrites and Ammonia, it must be the nutrients right? Any ideas would be helpful. <<for diatoms or Cyano my friend. Advise using RO/DI for top off, repair or replace skimmer, increase circulation, keep up carbon and perhaps Polyfilter, and increase incapacity with additional live rock and sand.>> Thanks, John L. Allen <<Good luck! Craig>> Skimmer question part 2 (operation) Hello, in response to your response (thank you), if I purchase an Aqua C Remora protein skimmer and position it so the pump portion sits in the first chamber, and the water return portion into the second chamber (they are separated> Re: Skimmer Arrangement (operation) Thanks for such a quick response. I usually don't change/clean the micron bag until it is clogged and overflowing. Not good huh? <Not the best use of this piece of filtration.> I meant to ask another question. The skimmate I do collect isn't tea colored. It is medium to light green, kind of lumpy and slimy. Is this just probably algae? <Possible> Got any thoughts? <Start cleaning the micron bag or forget about it and see if that affects your skimmer's performance.> Thanks again and a nice weekend to you also. <Thank you! -Steven Pro>> Protein skimmer question Hello, I have read numerous posts about converting from a wet/dry system to a live rock and live sand system, and I am convinced that is the way to go. <yes... many merits to it> However, I have a question that I am looking for an answer. I have a 10 yr old wet/dry TruVu Aquasystem tank. It has three chambers in the back starting from left to right. The first chamber (4" wide) is where the water comes in, the second chamber (10" wide) has the trickle filter and the bioballs underneath the tray, and the third chamber (8" wide) that houses my RIO 1700 pump. I have never had live rock or live sand, and it has always been a fish only tank. I want to convert it to a reef tank (with a few fish, etc.) with the live rock/sand and add a CPR BakPak2r protein skimmer. Here is my problem. The only place I can put the hang on skimmer is in the middle chamber due to the width of the skimmer. If I understand the skimmer's operation, it sucks in water from the small pump on the right, skims off the excess matter into a collection cup, and returns the skimmed water back into the tank through the left plastic pipe. If the pump and the return pipe are in the same (middle) chamber, won't the water that has just been skimmed and returned be sucked back into the pump, thereby skimming the same water over and over again and not thoroughly skimming the entire 55 gallons? <not exactly... while some water will be recycled this way... so much more water is run through this chamber many times over per hour. Still... with that said... it is best to draw raw surface water first. Placement in the second chamber risks the stratification of proteins that were formerly concentrated by the overflow. For a reef tank skimmer performance can be critical and you may find that even a good skimmer might have trouble in the second chamber here. Let me suggest that you consider putting this or another skimmer on the back of the tank separate from the wet/dry. Perhaps an Aqua C Remora which has the slimmest profile in the industry> I am hopeful this is not the case, or there is a solution I am not aware of. I have a lot of money invested in the tank, stand, canopy, etc. and hope there is something I can do short of buying a new tank which is not an option. Thanks for any assistance you can provide. Steve. <no worries here... and you may want to consider by passing the integrated W/D altogether. Seal off overflow and have tank drilled and drained to a simply 20 gallon sump underneath with plenty of room/options. Many possibilities. Best regards, Anthony> ETSS Skimmer Set-up, Operation Just purchased an ETSS Evolution 500 for my 75 gallon fish-only tank, big upgrade from my Seaclone 100. <I agree wholeheartedly.> It had been sitting on the shelf at the store for a few years, store decided to dump it for $100 bucks, how could I say no? <A good deal!> Unfortunately, no box or instructions and the sales person wasn't much help either, basically told me how it should be set up in my system. Having problems setting it up though I think? I have a SeaLife systems wet dry underneath in stand, with a lifeguard quite-one 700 plumbed as the main pump. I drilled a hole in my wet dry and plumbed the Skimmer next to the main pump bulkhead, using another 1 inch bulkhead. No runs, no drips, no errors (I think). I ordered a Mag-Drive 9.5 to power the skimmer, should be here next week. However, I do have a Mag-Drive 5, and decided to try it out, knowing it is not nearly strong enough to run the skimmer properly. What I'm finding is that the skimmer is returning massive amounts of bubbles back into the sump, then the lifeguard is pushing these bubbles back into the tank. Is this the result of the undersized pump? <I am not sure. Could be from improper operation or installation.> Seems even if I had the bigger pump, I would have the same problem but probably worse!?!?! I have toyed around with the exit valve and notice the water level raising or lowering depending on how closed it is. Doesn't seem to make a difference with the amount of bubbles though!?!?! How should the valve be set, and should the bubble problem just go away or will the larger pump remove the problem? <Take a look at A.E. Tech's (manufacturer of the ETS line) website here for instructions and perhaps technical support.> Thanks a lot for your help, John <Good luck to you! -Steven Pro> Skimmer Arrangement Hello WWM crew, I have a question regarding my sump and skimmer setup. Where the water enters my sump from the overflow, there is a bracket designed to hold a micron filter bag, which I have been using. After reading on your website, it sounds to me that I may be better off not using the bag before the skimmer, so the skimmer can get the raw water. So would I be better off not using it? <That depends. The bag will interfere with your skimmer's performance, but if you are willing and able to rinse the bag daily, I would keep it. The amount of exportation rinsing the bag of detritus, uneaten food, etc. would be worth the loss in skimmate to me.> Should I expect a little better performance from my skimmer (Turboflotor) this way? One more question, please? I have to clean the nozzle on my skimmer's pump (AquaBee) where the air enters the needle wheel every two to three weeks or my bubble production drops off. Looks like calcium, sometimes hard to clean out. Is this normal? <It does not sound normal to me. I have to clean my skimmer air intake every couple of months.> Do the EuroReef's or Aqua-C's have the same problem? <Not that I have heard of.> Thinking about purchasing one of those. Your opinions would be greatly appreciated. <Perhaps you are not getting the airline clean enough and the buildup is reappearing because it has a head start. Try soaking the line in vinegar to remove any calcium deposits. You might as well do the pump at the same time. If this does not work, I would change the airline next.> Thanks in advance, Steve <Have a nice weekend! -Steven opposed> CPR Bak-Pak 2R Hi: Mexican Turbo Snails, Skimmer Production No> Stress Coat Hi Crew, Sitting here in Silicon Valley waiting to be laid off. Figured I might as well be productive and email you <grin>. <How about an exciting career change to aquarium install and maintenance?> Here's a question I've been mulling over off and on for a while....there's another FAQ on the site today asking about the use of stress coat and how it made his skimmer go crazy. Is this a good thing or a bad thing? <Mmm, well... more bad than good... as in overflowing collector cups, throwing water away...> Is it possible to increase skimmer performance by adding stress coats or some other additive to increase surface tension? <Yes... actually done in some aquaculture applications. Not of practical consequence in captive systems in my estimation... the water won't/wouldn't really be any "cleaner" by doing so> I was going to dump a bunch of Palmolive in to get rid of that fish smell anyway :-D. Wes <Hope you're joking. Bob Fenner> Skimmer q.. Hey gang, when I set up my tank (130g FOWLR), I had my store manager do it (can't get hold of him). We setup a used skimmer we had, which is apparently good, looks like an old Kent type, have an aquaclear802 powerhead pumping thru a hose going into the side of the skimmer, the hose has a valve in the middle of it which he had set to what I guess he wanted for flow. Over the past 8 or so months, noticed my skimmer producing less, struggling to get the foam up to the top (getting an inch or so in the cup every few days, <You pump may need cleaning now.> been told by Bob or Steve that with my load I should be getting a cup a day) and into the cup, so I adjusted the valve and now its a foaming like crazy and filling a cup a day. It's not that real dark crap it used to be, its a much lighter color, do you suspect that I have it set to high now <Yes> and this cup full is not the stuff I want out, or the more in the cup (whatever the color) the better? Thanks guys......riot <Dark is best. -Steven Pro> DIY skimmer I have recently built a DIY counter-current skimmer and it does not seem to be working right. I would like to ask a few questions to help me with my problem. First of all my skimmer is PVC with reaction tube being 16" tall and 4" diameter. Does it need to be taller to work effectively (I have read of varying heights of this tube)? <This really depends on your flow and size of the tank, but maybe a bit short.> I would like to know if there is a certain amount of water that should be entering the reaction tube for maximum bubble contact? <A slow flow is best.> My flow rate at the water input is about 200-225 gph. Is this too fast or slow? <A bit too fast for me.> Also a lot of the bubbles are going into sump through exit hole at bottom. Is this normal? <If you slow the flow down, the bubbles should quit escaping.> What should the water level inside the reaction tube be (mine is about 3/4 full)? <This depends on the design.> Should it be higher or lower? I have tried different levels but no difference in skimming. I am running a Tetra DW18 deepwater air pump (made just for skimmers) and 2 ceramic airstones instead of regular as they produce finer bubbles, which I have read is better. <I prefer wood airstones and this pump seems way too small to me. I use Tetra's Luft Air pump, now marketed under the Coralife brand name.> Is this a big enough air pump? <I would prefer larger.> My problem is that the bubbles are just rising to top with no, skimmate as they call it, rising with it. The bubbles just rise and pop that's it. It has only been running a day so don't know if that is reason for no skimmate or not. Any help or advice you could give me I would appreciate it, thank you. <Take a look on our webpage here for a nice DIY design to compare yours to. We also have a DIY skimmer FAQ page here -Steven Pro> Aquasafe and skimmers Hello again, I added some Aquasafe similar to StressCoat because my algae blenny was attacked, probably by my banded moray eel, and I wasn't thinking when I added it. Over night my skimmer went crazy and overflowed. I did a water change and added about 1/2 lb of carbon trying to get it out of my tank. Do you have any ideas on how I can get rid of it or will it go away on it own? Thanks for your time yet again <The chemical will indeed "cycle out"... and likely has largely done so by now. I would wait it out at this point. Bob Fenner> Protein skimmer troubles Hi. Maybe you could help me out. I have a Red Sea Berlin Turbo hang on protein skimmer. I pulled out the innermost tube of the skimmer to clean it and noticed that there was a square piece of plastic, the width of the inner diameter of the tube, sitting loosely in the end of the tube where it inserts into the base of the skimmer. Follow me so far? <I think.> I wasn't sure what to do with it so I just put it back as untouched as possible, at which point it promptly fell into the base of the skimmer and I had to tear the whole thing apart again. My owners manual does not mention this square of plastic nor is it shown in any diagram I could find. Needless to say it's not working right now and I'm open to suggestions. <I believe the piece you are talking about should be attached to the inner tube. It goes on the bottom, across the middle, arranged vertically (if you follow me). You may want to contact Red Sea tech support to confirm. There website is here> Thanks, Dave. <Good luck! -Steven Pro> Microbubbles I did move the plate coral down to the sand like you said, it appears to be more pleasant there. I recently read several post on aeration and you don't need air stones or powerheads with bubbles if you have a good skimmer. <mostly true> My question is what about micro bubbles? I hear that micro bubbles are bad for the fishes gills. <a weak argument but there is concern that the mechanism for causing the microbubbles (a pinhole leak in plumbing that aspirates air) can cause a supersaturation of oxygen that produces symptoms in fishes like the "bends" in humans.> Is there any truth to micro bubbles being bad, and if so why? <as per above and not possible from the skimmer. Dangerous microbubbles are produced with pressurized pumps... not simple venturis> thanks again!! <best regards, Anthony> Skimmer Connection Hi Bob, I have a few questions to ask. 1 my skimmer has to now be sat in my larger sump/trickle filter I've built and the inlet will be under water now (the skimmer is a beast millennium) what do you recommend clamping the pump pipe to the inlet of skimmer with? <Nothing, just get tight fitting vinyl tubing and hose barb connections.> 2 the tower on the trickle side has 2" below water and 15" above water in the submerged bit I was going to use coral gravel and in trickle area Eheim substrate will this be ok as I've read many places bio balls increase nitrates 1 LFS said use Alfa grog but I've read this is a pond filter media really not suitable for salt water aquariums what do you recommend as media in tower? <Any artificial media (bioballs, crushed coral, foam blocks, etc.) in a trickle filter or Wet/Dry will produce nitrates.> 3 I've just purchased a t-5 lighting sys and would like to use live rock in main tank for decoration will it survive ok in FO tank and under this light also do I need any additives in tank <You should maintain appropriate levels for pH, alkalinity, and calcium if you want to maintain your coralline algae.> 4 previously I've used Cuprazin about 9 months ago for a whitespot outbreak will copper still be present in tank. I used coral sand for bed and coral skeletons and Tufa/ocean rock for decoration if copper is present shall I use poly filter to remove all traces thanks for the help. Craig brown <The copper has bonded to the calcium based media (everything you mentioned above) and will continue to leach out. Particularly susceptible animals would be any encrusting corals (mushrooms, polyps, and any soft or hard corals attempting to attach to the contaminated substrate) or crawling inverts (snails particularly). -Steven Pro> Skimmer and Coral Placement Mr. Fenner <Anthony Calfo in your service> Thanks for all your help! I ordered the Remora Pro w/mag3 pump and the prefilter. It should come in today or Monday. I put in a Rio 1700 to get more surface agitation. This seems to be helping a lot and I don't have the need to have my to Hagen 301's running now. The Rio puts out enough gph to have my whole tank circulating well. I see your point about not needing the Magnum 350, but I like having it going for the carbon media. I have a new question. The Remora Pro's intake is on the left side, being that my circulation is going from top left to right, will the right side me a good spot for the skimmer? Or should I put the Rio on the other side as to get the surface organics pushed to the left of the tank where the Remora would pick all the organics up in the corner? <the placement of the skimmer should not be critical for skimmer performance... as for water circulation... one cannot fairly say left or right alignment without watching how the flow runs in your particular system with the dynamic of the rock scape and tank size. Simply aim for random turbulent flow and no dead spots> At this point my tank has been going for about 2 months. The branch coral has the most coralline algae growing on it. I'm still waiting for the large rocks to take off well. Thanks again!! I just spent 3 hours on your site last night reading. I've enclosed a picture for any comments or suggestions. thanks, ART <thanks for the picture.... I noticed that you have your green long tentacle Heliofungia placed upon the rocks. Please remove it to the sand bottom ASAP!!! They never occur on rock in the wild and will inevitably die from the abrasion of polyps cycles when placed on a hard surface. This coral will die within 6-12 months if left in place here. Else, all looks well. Best regards, Anthony> Prizm Skimmer Hello, <<Hello, JasonC here...>> I just bought my first skimmer and it is a Prizm (Red Sea product) I'm having a bit of trouble adjusting the flow just right it seems to either make a lot of wet foam, thus wasting a lot of water, or producing no foam, thus behaving much like an expensive boat anchor. <<I'm glad you said that and I didn't - unfortunately, this skimmer doesn't have a stellar performance record. With some luck it may improve given a little time to break in.>> The difference in settings is like one millimeter. Any advice? <<Be patient and if that doesn't work, perhaps return it and try an AquaC Remora. Cheers, J -- >> Water pump to skimmer Hello, <<Hello to you - JasonC here.>> First, I love this site. I'm new to reef keeping and all this info is greatly appreciated. <<I'm glad you find it useful.>> Specs 75 gallon glass 18 gallon sump Turboflotor 1000 skimmer I'm still in the process of buying the rest of my equipment, I really don't want to buy anything I will later be disappointed with. I plan to (eventually ) have a reef tank. My question is what size pump should I use to pump water into the skimmer from the sump. <<What does Aqua Medic recommend? That's what I would use/approximate.>> I have been told to use Rio 600 by some and Rio 2100 by others. <<Wow... that's a pretty diverse range. If those were my choices, I'd definitely use the 2100. The 600 is anemic by comparison.>> Can you help? <<I don't know, you tell me - was that helpful? ;-) >> Also do you think a Mag 7 is enough on the return (4 " )? <<Yes, would work fine and in fact is the exact same pump I run on my 75, although I will just add that I have another three Maxijet 1200's in the tank to aid with circulation. Just something you might want to consider - when it comes to circulation, it's really hard to have too much.>> Thanks, Christie <<Cheers, J -- >> Skimmers, Plumbing I am a saltwater newbie setting up a fish only system. <Allow me to welcome you into this great hobby. Please peruse our website,, and think about buying a book or two. Mike Paletta's "The New Marine Aquarium" is an excellent first book.> I purchased a bunch of unused 2 year old stuff that has never been wet. Oceanic R/R 120 tank 4'x2'x2' with stand. The primary filtration is an AS9000D Aquaricare™ Algae Scrubber™. And a bunch of neat things that do not come into play for this question. (U.V. sterilizer, pumps, heaters etc. etc.) I am in the plumbing (mock up) stage now. The Algae Scrubber and sump take up a LOT of my under-tank stand space and I want to keep all my equipment down there. Due to space requirements and what I've read about them I'm considering buying an Aqua-C Remora Pro Protein Skimmer w/ Mag3 pump, maybe a 3 month old used one. <Ok> It, and the Prism Pro would fit where I want to put them but I've read enough about the Prism Pro to avoid it. <I have never used the Prizm Pro model, but did not particularly care for the regular Prizm for all but the smallest of tanks.> Ok, here are my questions. 1) Do we like this skimmer? (Remora Pro) <Sure> 2) Any hidden reason not to buy it used? <It will depend on the seller.> 3) Someone said that that a skimmer input should NOT be drawn from the filter output water, which in this case, it would be. Is this true? <Yes> And why? <Because skimmers work most effectively removing compounds from the water before your other filters have a chance to break them down.> Is that not essentially what's being done in a system where live rock and a Protein Skimmer are used? <No, not really.> I guess I could plumb it from the unfiltered water line, but I would really like to know why. <The Remora is a hang-on unit and does not need to be plumbed in at all. You just hang it on the back of your tank and you are done. It is completely separate from the rest of your filtration.> I thank you in advance for your input. <I hope I have been helpful. -Steven Pro> RE: Protein Skimmer and Bubbles Dear Anthony, Thanks for the reply. <quite welcome> I have fixed my Aqua C Remora Pro skimmer problem by adjusting the height of the collection cup through the "O Ring" provided. It is working very well now. However the bubbles are still there, according to Aqua C's Q&A, bubbles are created by stress coats caused by mixing water with chemical addictives or high organic waste. <agreed...colloidal material> I don't think my problem is the latter as I don't over feed my fishes. <it can be the types of food fed just the same... heavy gelatin based frozen foods or rather oily fishes (silversides)> I will not use any chemical addictives for mixing synthetic sea water the next time since I used filtered water to mix with the salt. <indeed for most they are not necessary when the new seawater is properly mixed and aerated for a day or so in advance> I stored my premixed water after they have been aerated for at least 48 hours. <excellent> I suppose I just have to monitor and experiment a little. <alas, yes my friend> Thank you. Regards, Daniel <best regards, Anthony>
https://www.wetwebmedia.com/skimopfaq4.htm
CC-MAIN-2021-31
refinedweb
5,903
81.53
Hello, I'm working on a small project to acquire information from regulations.gov using their API. It's fairly simple (codewise) what I'm trying to do. However, I get stuck with a "HTTP error 403: Forbidden". It means I'm connecting, but something seems to be the matter. I've been in contact with the people working on the API. They said that my API and Accept header call are fine. I don't know what the problem is. Here is the code: import urllib2 from json import load url = '' request = Request(url, headers={"Accept":"application/json;charset=UTF-8"}) response = urlopen(request) json_obj = load(response) In essence, the problem is at the urlopen() request. Any pointers would be a great help. Also, you can go here to acquire an API key:
https://www.daniweb.com/programming/software-development/threads/489920/regulations-gov-api-help
CC-MAIN-2018-13
refinedweb
134
69.07
How can i show an image in opencv. How can I view the photo (from the database) knowing the label. opencv and facerecognizer. Sory for my English ... How can I view the photo (from the database) knowing the label. opencv and facerecognizer. Sory for my English ... answered 2013-08-09 05:20:11 -0500 i'm afraid, the current facerecognizer interface does not allow you to see, which image was the best match for your test-img ( as you only get the label, not the index ). you could search the labels list for the returned label, stop at the 1st found , and get the image at the same index, but that's just one image of that person, not the actual match image. you could also go and hack it, first the interface, then all 3 impls, and add an additional index(ref) into the images, but hmmm // contrib.hpp: class CV_EXPORTS_W FaceRecognizer : public Algorithm { public: // .... // Predicts the label and confidence for a given sample. CV_WRAP virtual void predict(InputArray src, CV_OUT int &label, CV_OUT double &confidence, CV_OUT int & matchImageId) const = 0; // facerec.cpp: class Eigenfaces : public FaceRecognizer { // .... // Predicts the label and confidence for a given sample. void predict(InputArray _src, int &label, double &dist, int &matchImgId) const; int Eigenfaces::predict(InputArray _src) const { int label; double dummy; int dummyImg; predict(_src, label, dummy, dummyImg); return label; } void Eigenfaces::predict(InputArray _src, int &minClass, double &minDist, int &matchImgId) const { // ... minDist = DBL_MAX; minClass = -1; matchImgId = -1; for(size_t sampleIdx = 0; sampleIdx < _projections.size(); sampleIdx++) { double dist = norm(_projections[sampleIdx], q, NORM_L2); if((dist < minDist) && (dist < _threshold)) { minDist = dist; minClass = _labels.at<int>((int)sampleIdx); matchImgId = sampleIdx; } } } and similar for lbph and fisher please try the following Python code: import cv2 im=cv2.imread('image file name') # please put the actual image file name in the quothes cv2.imshow('image', im) cv2.waitKey(0) Asked: 2013-08-09 05:01:48 -0500 Seen: 267 times Last updated: Aug 09 '13 Video Recording is too fast How to check opencv libs in image? Error: Couldn't load opencv_java from loader... Cannot view 16-bit grey level Images. augmented reality using java and opencv 2.4.5 Face recognition - Get distance for all trained images To process multiple columns [closed] your english is no problem. but please don't be sloppy ( and remove that garbage from your title )
https://answers.opencv.org/question/18504/how-can-i-show-an-image-in-opencv/?sort=votes
CC-MAIN-2019-43
refinedweb
394
58.28
Technical Support On-Line Manuals RL-ARM User's Guide (MDK v4) #include <rtl.h> BOOL snmp_trap ( U8* man_ip, /* Pointer to the IP address of Trap Manager. */ U8 gen_trap, /* Generic Trap value. */ U8 spec_trap, /* Specific Trap value. */ U16* obj_list ); /* Pointer to the list of objects. */ The snmp_trap function sends a trap message to the Trap Manager. Parameter man_ip specifies the IP address of the Trap server, where the trap message is destined to. If the IP address of the Trap Manager is not specified (parameter man_ip is NULL), the IP address of Trap Server configured in Net_Config.c is used instead. Parameter gen_trap specifies the generic trap type: Parameter spec_trap specifies the specific trap type. It must be set to 0 for all generic traps from 0 to 5. It defines a specific trap type for generic enterpriseSpecific trap. Parameter obj_list specifies the objects from the MIB table, which will be included in the trap message variable-bindings. This parameter is a pointer to the object list array. This array is of variable size. The first element specifies the count of objects in the object list array, followed by the object MIB index values. If obj_list parameter is NULL, or obj[0] = 0, no object values will be binded to the trap message. The snmp_trap function is a system function that is in the RL-TCPnet library. The prototype is defined in net_config.h. The snmp_trap function returns __TRUE when the SNMP trap message has been sent successfully. On error, this function returns __FALSE. snmp_set_community void send_alarm (void) { /* Send a trap message when alarm input is activated.*/ U16 obj[2]; /* Add "KeyIn" value to trap message. */ obj[0] = 1; obj[1] = 8; /* Index of "KeyIn" entry in MIB table. */ snmp_trap (NULL, 6, 1, obj); }.
http://www.keil.com/support/man/docs/rlarm/rlarm_snmp_trap.htm
CC-MAIN-2019-30
refinedweb
294
60.01
Step 1: JAVA - Getting the Tools STEP #1) Go to the website here and click the green download button STEP #2) Save it to your desktop and click "OK" STEP #3) When it finishes downloading, right click the file and select "Extract all" STEP #4) You should see a new folder appear on your desktop, and make sure it has the file "eclipse.exe" in it. Now double click on the eclipse.exe file with the icon of a solar eclipse. It will ask you to create a workspace when it opens. Enter "myWork" in the name bar, and click OK. You should then see a welcome screen, and in the top right corner click the "workbench" button.Now you should see something like the 1st image at the bottom. After that click "File" > "New" > "Java Project". In the name box, type "myProj", and click next, and then finish. Now, in the project explorer(left of screen) you should see a folder called "myProj". The project explorer is where you can see all of your files.The area in the middle is the mainstage(coding section) and the right part is the Library, which gives us a list of functions and classes.(Will talk about classes and functions later). The bottom part is the error list, if we have any run-time or code problems, they will be there. It is also the console window where output is displayed. Finaly, right-click the "myProj" folder we created and go to "New" > "Class". In the name bar type "myFirst". Click finish. You should see the 2nd picture at the bottom for a closer look. Now you are ready to start writing code in JAVA. In the next step we will write your first program, and discuss some JAVA elements. Step 2: JAVA - Getting to Work With JAVA In JAVA, everything is based on classes, sections of code with commands to execute. There are also these things called methods,smaller sections of code that contain functions too.Usually there are multiple methods in a class,that interact with each other based on values of certain variables and return a value. Those methods are packed into a class, and then classes with methods can interact with other classes and print the return value on the screen. There is also something called a main method, the method the compiler searches for first. Based on the instructions the main method gives, the compiler can move to different classes to execute different methods,or just stay in the main method. For now lets just create a main method. In your "myFirst" class type the code in bold: public class myFirst { public static void main(String[] args) { } } Now lets discuss this code. Each method is based on the following syntax: [accessSpecifier] [returnType] [methodName] ( [parameters] ) { [methodBody] } The access specifiers in this case are "public" and "static". Any method can be "public" or "private". "Public" means the method can be accessed by any class. "Private" means that the method can be accessed by only the class it belongs to. I will explain the "Static" key word later.Here we made a public static main method with the name main, and parameters of "String[] args"(I won't explain the parameters now). In the method body we type all of the commands we wan't to execute. The method body's and class body's are always located between the curly braces. NOTE: JAVA is a case sensitive language, so when you type commands, you must type them exactly as specified, or you will get an error!!!!!! Now type the code in bold into your main method: public class myFirst { public static void main(String[] args) { System.out.println("Hello world!"); } } By now you should have the code in the 1st picture. Now go to "Run" > "Run", and click "OK" when the dialog box appears, and at the bottom(console window) you should see the text "Hello world!" printed. Check the second image for reference. Here we used the command System.out.println to print a line on the screen. The "System", is a class containing many functions. The "out" was that we wanted to print OUT to the screen(or output) and the method "println" means; print line. Then in brackets, and in quotation marks(because this is a string value(value containing words)) we included the text we wanted to print,and ended the line with a semi-colon(;). NOTE: All lines in JAVA must end in semi-colons, except lines when we declare classes or methods. We can also use "print", but the difference between "print" and "println" is that "print" prints text on a line, but "println" means to print the text, and end the line, meaning that if the next command is "print", the text will be printed on a new line. At this point, I would like to apologize for the bad quality of my images.I have included some SELF-CHECK questions at the bottom. In the next step I will include the answers to them.In the next step I will also introduce you to the basic value types. SELF-CHECK: #1) Write a program to print the word "cheese" letter by letter. HINT: Use the "print" command #2) Use the "print" and "println" commands to experiment. #3) What is wrong with this line of code: System.out.println(Hello world!); #4) What will you get if you run these lines of code: System.out.print("h"); System.out.print("i"); System.out.println("per-"); System.out.print("son"); Step 3: JAVA - Basic Variable Types #1) System.out.print("c"); System.out.print("h"); System.out.print("e"); System.out.print("e"); System.out.print("s"); System.out.print("e"); #2) No definite answer. #3) The text in brackets was not in quotation marks. #4) hi per- son There will also be self check questions at the end of this step. There are many data types. In this instructable we will go over only the basic ones, and it will still take a couple of steps. All variables work on the syntax below. [dataType] [variableName] = [value]; ex. int myNum = 8; int type: The "int" type, means integer. Works on the same syntax as above. There are no quotes needed to hold the value for any numerical type. Any int variables range from a minimum of -2,147,483,648 to a maximum value of 2,147,483,647. Most common integers will fit in this range, but if they don't use "long" instead. ex. int nine = 9; long type: The "long" type is a long version of the "int" command. Ranges from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. float type: The "float" type is a floating-point number, which means it contains a decimal value. double type: The "double" type is a floating-point number, which can hold a bigger value. string type: The "string" type holds a text value. The text(value) must be inclosed in double quotes. ex. String greeting = "Hi blank"; Those were the basic data types. To print any of them just write the variable name in the parameters of the "println" method without quotes. ex. int myNum = 52930; System.out.println(myNum + "Is the value of myNum"); The code above would print "52930 Is the value of myNum" on the screen. And by the way we used there a plus sign to combine a String to the line we were printing, so it would print a String value after the value of myNum. You can use the plus sign to add variables in the "println" command and add string values. Check out the two pictures at the bottom to see what I did. This is section 1/2 of the number types, in the next section I will teach you some simple mathematical operators you can use on the variables. Step 4: JAVA - Mathematical Operators ex. int sum = 5 + 579; It is also used to combine strings in the "println" method. ex. System.out.println("This is " + "three strings " + "combined."); Notice that before adding another string on the first and second strings I used a space at the end to make it look normal. There is also the "-" sign as you have guessed, and it is used only to subtract numbers. ex. int subtraction = 9 - 6; Also there is the multiplication operator, which is represented by a "*" in java(asterisk). It is used to multiply numbers. ex. int multiplication = 756 * 15; And there is the division operator, which is represented by the "/"(slash). It is used to divide numbers. ex. int division = 50 / 5 Also there is a modulo operator, which is represented by the "%". Modulo is used to focus on the remainder of two numbers, if there is any. ex. int modulo = 10 % 9; You do not need to add quotes for the numbers if you use the numbers in the "println" method, or they will be interpreted as string values. ex. System.out.println(6 + 7); COMMON ERROR 1: System.out.println("6" + "7" ); The code above returns 67, not 13. To avoid this delete the quotes. The variable names can be used to identify values. Such as: int myNum = 9; System.out.println("The value of myNum is " + myNum); As long as "myNum" doesn't have any variables around it, the program will print "The value of myNum is 9". You can also use the operators to perform operations in the "println" method to return quick results. ex. System.out.println(8 * 10); My pictures will be basicly on everything we covered in this section, but don't forget to check them out. In the next step there will be little new material, but there will be a test that covers everything we learned so far. Here are the self check questions: SELF-CHECK #1: Write a program to calculate the modulo of 789 to 2, and print the result on the screen. SELF-CHECK #2: Describe the "int" data type, with at least the basic characteristic. SELF-CHECK #3: Create a string variable called "greeting" with a friendly message in it leaving out the name(ex. Hello _______). Then create a string called "name" with the value of your name. Then combine these variables and you should get your final message. SELF-CHECK #4: How do you represent multiplication in JAVA?(What sign do you use) Step 5: JAVA - 1st Test / Commenting #1) System.out.println(789 % 2); #2) The "int" data type holds an integer. #3) String greeting = "Hello "; String name = "JAVA Teacher" System.out.println(greeting + name); #4) You use an "*"(asterisk) OK, now for this instructable I will only include a little new material, and the link to my test. In JAVA there is something called "commenting". That means to comment your work. There are 2 types of comments you can make a single-line comment(see ex. 1) and a multi-line comment(see ex. 2) . The examples for these comments are included. For a single-line comment you have to put 2 slashes before the text, everything to the right of the slashes is considered a comment, and ignored by the JAVA compiler. A simple multi-line comment is in between the slash and 2 asterisks, and ends with the asterisk and a slash. An advanced multi-line comment discribes a method, we will go over this later. JAVA ADVICE: I suggest you to comment everything, even the simplest things. Because if someone is going through your work and may have trouble understanding your code. It might not be obvious that the variable d stands for dollars . And I also suggest you to save your work frequently.(I lost a lot of code because of this once) ex. 1 int num2 = 78; //Create an integer, "num2" with the value of 78 ex. 2 /** Create an integer, "num2" with the value of 78 */ int num2 = 78; OK, good luck on the test. :-) (LINK AT BOTTOM, READ NOTE) NOTE: I really rushed through making the quiz, so on #2 I marked the wrong answer as right. The correct answer for that one was the last option. I am very sorry for this inconvenience. The link to the test is here. There's a picture at the bottom of the welcome screen of the test too.Good luck and don't forget to read my next tutorial! :-)
http://www.instructables.com/id/JAVA-Introduction/
CC-MAIN-2017-22
refinedweb
2,076
73.88
User Name: Published: 20 Aug 2007 By: Granville Barnett Download Sample Code .NET 3.5 and ASP.NET Futures have a ton of goodies in store for the ASP.NET developer. As we edge closer to the release of .NET 3.5, we get ever closer to a technology wave that has caused a major viral campaign throughout the internet. This is especially true for LINQ and Silverlight 1.0 (not in the Orcas timeframe, but even before!). Both LINQ and Silverlight address complex problems. On one side we have a set of new language constructs and API that blur the lines between data and objects. On the other hand we have a technology which breaks the boundaries of the presentation layer used for internet applications. Some of the features that I cover in this article are part of the ASP.NET Futures July CTP. I start under the heading that Anders Hejlsberg has used as his starting slide for years when talking about the LINQ project. Previously in ASP.NET 2.0 there was a control called ObjectDataSource which blew the doors open with regards to plugging into a data access layer, whether we were dealing with a typed DataSet or some custom O/R mapping. ObjectDataSource In part 4 of my "Introducing LINQ" series I used the ObjectDataSource to plug into a LINQ to SQL data access layer (DAL). This worked fine but in order to support, for example, sorting; it required some boilerplate code. The LinqDataSource control promises to eliminate such code. LinqDataSource It is my estimation that web developers will consume LINQ quickly. It offers the developer an easy, quick and powerful way to interact with several data stores, providing rapid application development in a space that is typically associated with repetitive, non-flexible O/R mapping boilerplate code that is a mere formality of an application that consumes some data from an external source. The LinqDataSource has stalked the web for months and months but the public haven't been able to use it until the release of .NET 3.5 Beta 2 - well now it's here! Coupled with the go live license with .NET 3.5 Beta 2 this could be a great time for early adoption. The first step towards using a LinqDataSource control is to go ahead and create a view of your database. You can do this in a few different ways. The first is by using the LINQ to SQL designer; the second is by using the SqlMetal command line tool (I believe that this is now used by the LINQ to SQL designer under the covers as of Beta 2). Finally, you can go ahead and manually create a class that derives from the System.Data.Linq.DataContext class; and implement your database view from there. SqlMetal System.Data.Linq.DataContext In this article, I'm going to use the LINQ to SQL class designer to create an application view of my database. This is great for me to see! After 14 months of playing with LINQ, the code that I am about to show you really encompasses what LINQ is all about - accessing data quickly, simply and flexibly. In the previous listing, we select all the customers from our NorthwindDataContext class (I'm using this all within a file based web site. If you're dealing with a web application project remember to prefix the name of the DataContext class with the projects namespace). NorthwindDataContext DataContext At the moment, we are dragging everything back. This time I want to only display the ContactName, CompanyName and City of each customer. ContactName CompanyName City I'm going to be a little pickier now and select only those contacts that are from London. I'm not too happy about the ordering of the names and titles of the columns of the GridView control, so I'm going to change them now. The LinqDataSource control is simply awesome. I invite you to play with it yourself and harness the great functionality that you can leverage by combining LINQ to SQL with the LinqDataSource control. This control is contained in the ASP.NET Futures CTP. Thus, you will have to register the Microsof.Web.Preview assembly either with a Register directive or in the web.config file. In the upcoming section I will use the designer, since the designer integration here is really nice. After you have registered the control, you simply use the asp:Media control. asp:Media Looks pretty nice, doesn't it? With regards to the skin of the player, there are quite a few you can choose from. I'll let you look at those in your own time. The significant thing about the media control is not the way it looks, but the ability to do great stuff pragmatically using your favored language and a nice API. This control makes it very easy for us to go ahead and embed video into a web form using Silverlight 1.0 as the presentation platform. In the above example I pointed the Media control at a video hosted on Channel9. The simplicity of the Media control is probably its greatest asset. The above example only took a few lines of ASP.NET markup and I got a great looking UI which encapsulated streaming logic and visuals to boot. I see this control being very popular. Media The ListView control allows you to define a standard template that all your data will use when rendered. ListView In the previous listing we have a ListView that is bound to the data coming from the LinqDataSource. The ListView defines a LayoutTemplate that can be thought of as a parent to the actual containing element, which in this case is a div (asp:Panel) with the special ID of itemContainer. The control that holds your item template must be given the ID of itemContainer. The ItemContainer simply defines the visuals of each item that our ListView will show. LayoutTemplate div asp:Panel ID itemContainer ItemContainer You will notice that in Figure 6 I have used some CSS to make each contact look like a contact card (well, a very primitive one!). The ListView provides a great way to generate well defined HTML when working with data. It's a control that encourages the embracing of CSS to make it easier for the developer to quickly create great looking data-oriented applications. We have already seen the DataPager control in the previous ListView section. It allows us to provide custom paging to the ListView control. It's more than a "next and back" control; it allows for a very fine level of customization-just like the ListView does-so you can be as expressive as you want with your ListView and then mould a DataPager that has a similar look and feel as well as textual labels. DataPager In the previous listing we have created a really smooth way to view the contacts from our database. If you download the sample code and give the demo a go, you will see that the ListView and DataPager are really made for each other. When you take that visual refresh away you can create a pretty compelling UX. I think I've touched on some of the big new controls coming our way in the future, both in the Orcas timeframe and with ASP.NET Futures. There is stuff that I have missed; maybe in the coming weeks I will do one big article about the ASP.NET Futures. In the ASP.NET Futures there are many new controls, like the SearchDataSource (that allows you to plug into Live search really easily), as well as support for dynamic languages including new dynamic controls. SearchDataSource In the Orcas release, ASP.NET AJAX will support WCF services. Actually, it does now in .NET 3.5 Beta 2! This is a great new addition to ASP.NET AJAX. As always, I encourage you to download the .NET 3.5 and ASP.NET Futures July CTP bits and take the new controls and functionality for a test spin! This author has published 32
http://dotnetslackers.com/articles/aspnet/onthehorizonforaspnetandbeyond.aspx
crawl-003
refinedweb
1,353
64.2
Question: class << self attr_accessor :n, :totalX, :totalY end The syntax above is used for defining class instance variables. But when I think about what syntax implies, it doesn't make any sense to me, so I'm wondering if this type of syntax is used for any other types of definitions. My point of confusion here is this: class << self The append operator normally means "add what's on the right to the object on the left". But in the context of this block, how does that add up to "put the contents of this block into the definition of the class instance rather than the instance"? For the same reason I'm confused as to why in one context class << self can define class instance variables while in another it seems to create class variables such as here: class Point # Instance methods go here class << self # Class methods go here end end Solution:1 in Ruby you can reopen existing classes and add methods. That is, you can say: class Foo def bob return "hello from bob" end end these methods get stored somewhere in an internal dictionary (maybe an instance variable) of the Foo-class (which is just an instance of the Class-class and therefore has instance variables) But the suprising thing is, that you can also add methods to instances of existing objects foo = Foo.new foo2 = Foo.new def foo.fred return "I am fred" end foo.fred #=> "I am fred" foo2.fred #=> NoMethodError but Where is this method actually stored? Turns out Ruby creates a new class behind the scenes (sometimes called singleton class, metaclass or eigenclass) which gets inserted in the inheritance heirarchy between the Foo-class and its instance. So the inheritance relationship looks like that: foo < (eigenclass of foo) < Foo < Class (if you say foo.superclass you will not see the singleton class) the class << X-syntax is a way to get to this special class, so that you can manipulate it directly. The following code blocks are exactly equivalent: def foo.bar return "xy" end # is exactly the same as class << foo def bar return "xy" end end So the similarity between class Foo < Bar and class << Foo is not accidental, there is inheritance going on in both. Think of class << X as "open up the metaclass of X" The thing to remember in Ruby is that classes themselves are just objects. (Instances of the class Class) so if you say: class Foo class << self def k return "x" end end end ( self is bound to Foo in this code block) so k is an instance method of the eigenclass of Foo, which makes it a class method for Foo all this is explained more clearly in the chapter about classes of the Pickaxe (the web version does not contain the diagrams, unfortunately) and _whys Seeing Metaclasses Clearly Solution:2 Think of the class as containing a dictionary of members including all the accessors and instance variables. When you tell the class to "append" to "itself", you're saying "add these to the dictionary of class members." I'll grant the notation is a little hinky, though. Solution:3 it's actually confusing to think of it in terms of an "append" operator. a better way to look at it is that just as class Foo opens up class Foo, that is, it sets 'self' to the class object Foo, creating it if necessary, so class << self opens up the eigenclass of the current 'self' object. note that it is not limited to self - for any object bar, you can say class << bar to open up the eigenclass of that object. class A def hello print "hello world" end end a = A.new b = A.new class << a def goodbye print "goodbye cruel world" end end a.hello b.hello a.goodbye b.goodbye Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com EmoticonEmoticon
http://www.toontricks.com/2018/05/tutorial-in-ruby-are-there-any-related.html
CC-MAIN-2018-34
refinedweb
664
64.54
Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode. Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript). Hi I want to print PoseMorphTag Values(like point relative position),but seem to have some problems。 code: def main(): m_tag = op.GetTag(c4d.Tposemorph) mor = m_tag.GetMorph(1) node = mor.GetFirst() cnt = node.GetPointCount() print cnt for i in xrange(cnt): print i,":",node.GetPoint(i) I want to get point(index: 167 or >12),but i don't know how to get? Thanks for anyone help! Hi @chuanzhen, In its "normal" state, a CAMorphNode only store modified point and not all the points. So if you want to access all the points, you should call SetMode with flags c4d.CAMORPH_MODE_FLAGS_ALL | c4d.CAMORPH_MODE_FLAGS_EXPAND, do not forget to collapse it after any usage. I know you are developing in Python, but the C++ document is way more relevant in this regards, so please take a look at the CAMorphNode::SetMode or even the CAMorphNode Manual. Improvement of the python doc will be done. Cheers, Maxime. @m_adam Thanks for your help and look forward to the improvement of python doc @m_adam Hello thank you for the quick fix, but do you have any further explanation about what the flags and modes specify? The documentation still has no information. Thank you in advance for "expanding" on this topic. The mode specifies how data can be read from the Morph Tag. By default, they are presented in a compact way (aka only modified points are stored for some internal optimization). But if you SetMode with c4d.CAMORPH_MODE_FLAGS_ALL | c4d.CAMORPH_MODE_FLAGS_EXPAND then all the points are then readable from outside of the morph Tag. I adapted the Python documentation to match the C++ documentation so it will be available in the next documentation update. But I would say the C++ documentation for SetMode is pretty self-explanatory, what is the part you don't understand? Cheers, Maxime.
https://plugincafe.maxon.net/topic/11322/posemorph-tag-question/2
CC-MAIN-2022-21
refinedweb
345
66.44
Does it matter which one I use to write C++? Printable View Does it matter which one I use to write C++? .NET, Visual Studio 6 had tons of errors and silly bugs that were fixed with .NET. Programming is hard enough without the compiler making it harder for you. :-) Are you limited in any way by using .NET? >>Are you limited in any way by using .NET? The compiler has to conform to the standard or no one would use it. So if you use C++ like normal then you're not restricted at all. The client doesn't need the .NET framework installed? Not unless you use .NET features in your program. .NET has some major VC++ 6.0 fixes that alone that make it worth switching over for, Like problems with namespaces. There is no reason why you shouldn't go get .NET. Its the future, 6.0 is old (well not really). If you're a C++ programmer, which you most likely are, .NET is for you because you can choose (or mix) managed and unmanged code. Managed being the Managed Language Extensions which makes your C++ compile to .NET. Unmanaged is normal, native code. BTW: You can get the .NET compilers for FREE. Microsoft gives them to you. Go to their site, find the .NET Framework SDK (full: over 160 Mb) and download it. It contains all the compilers and tools you'll need, all accesible from command prompt. You can then make your own IDE to make things easier. But, I'd recommend going and buying VS.NET, its worth every penny and easier to use than any other IDE ever made. Oh yea, the .NET Framework end-user edition is only 20 Mb. One thing i should add is that .NET, at least the IDE, is much more heavier then 6.0. You'll need a strong harddrive and CPU.
https://cboard.cprogramming.com/cplusplus-programming/33166-msvcplusplus-6-0-visual-studio-net-printable-thread.html
CC-MAIN-2017-17
refinedweb
317
88.02
/* Program for transmitting a string serially at 9600 baud rate continously, using 8 data bit, 1 stop bit , XTAL = 8MHz */ #define F_CPU 8000000UL #define BAUD 9600 #define MYUBRR F_CPU/16/BAUD-1 #include <avr/io.h> #include <util/setbaud.h> #include <util/delay.h> void USART_Init( unsigned int ubrr); void USART_Transmit( unsigned char data ); unsigned char USART_receive(void); void USART_putstring(char* StringPtr); int main( void ) { USART_Init(MYUBRR); while(1) { // Chose an arbitrary character to test. //char String[]="Hello world!!"; //USART_putstring(String); USART_Transmit('1') ; _delay_ms(1000); } } void USART_Init( unsigned int ubrr) { /*Set baud rate */ /* UBRR0H contains the 4 most significant bits of the baud rate. UBRR0L contains the 8 least significant bits.*/ UBRR0H = (unsigned char)(ubrr>>8); UBRR0L = (unsigned char)ubrr; /*Enable transmitter */ UCSR0B = (1<<RXEN0) | (1<<TXEN0) ; /* Set frame format: 8data */ UCSR0C = (1<<UCSZ01)|(1<<UCSZ00); } void USART_Transmit( unsigned char data ) { /* Wait for empty transmit buffer */ while ( !( UCSR0A & (1<<UDRE0)) ); /* Put data into buffer, sends the data */ UDR0 = data; } unsigned char USART_receive(void){ while(!(UCSR0A & (1<<RXC0))); return UDR0; } void USART_putstring(char* StringPtr){ while(*StringPtr != 0x00){ USART_Transmit(*StringPtr); StringPtr++;} } when I try to run this code & see the received string using Teraterm terminal , the terminal shows different kind of characters ? Is you CPU really running at 8MHz? How have you proved that? Are you using the internal RC oscill see you include my setbaud.h but then you define MYUBRR yourself? Top - Log in or register to post comments I am using calibrated internal RC oscillator i.e 8Mhz . First Fail & then succeed, this is what Engineering teach me. Top - Log in or register to post comments There is no change after removing setbaud.h . First Fail & then succeed, this is what Engineering teach me. Top - Log in or register to post comments How is it "calibrated"? I see nothing in the code that represents a calibration process. The internal RC oscillator is really inadequate for timing a UART unless you do a genuine calibration. This is often done with an external 32.768KHz crystal. Even better is an 8MHz crystal. Jim Until Black Lives Matter, we do not have "All Lives Matter"! Top - Log in or register to post comments Thank you for the information. I made the fuse bits to its default settings of CKSEL3..0 which results in internal RC oscillator @ 8 Mhz . As a result of which I get the proper result on terminal. First Fail & then succeed, this is what Engineering teach me. Top - Log in or register to post comments
https://www.avrfreaks.net/forum/usart-programming-atmega328
CC-MAIN-2020-40
refinedweb
416
59.09
NCast Telepresenter Reference Manual NCast Product Specification Telepresenter M4 Reference Manual Revision 2.2 March 1st, 2010 M4 Software Release 5.2.0 M3 Series 2 Software Release 5.2.0 Copyright © NCast Corporation, 2010 NCast Corporation Revision 2.2 Page 1 NCast Telepresenter Reference Manual Table of Contents 1. Introduction................................................................................................................................... 6 1.1. Purpose.................................................................................................................................................. 6 1.2. Document Overview............................................................................................................................... 6 1.3. Terms and Definitions............................................................................................................................. 6 1.4. Telepresenter Units................................................................................................................................ 7 1.5. Telepresenter Modes of Operation......................................................................................................... 7 1.6. Startup................................................................................................................................................. 10 2. Theory of Operation...................................................................................................................... 12 2.1. Telepresenter Component Block Diagram ........................................................................................... 12 2.2. Digitizer Capture Function.................................................................................................................... 13 2.3. Compression........................................................................................................................................ 13 2.4. Transmission........................................................................................................................................ 13 2.5. Decompression.................................................................................................................................... 13 2.6. Display Function................................................................................................................................... 13 2.7. Audio Subsystem................................................................................................................................. 13 2.8. Archive Disk......................................................................................................................................... 14 3. Configuration Settings and Parameters Reference....................................................................... 15 3.1. Unit Options Settings........................................................................................................................... 15 3.2. Passwords............................................................................................................................................ 17 3.3. Web Control......................................................................................................................................... 18 3.4. Display Settings................................................................................................................................... 19 3.5. Custom Settings................................................................................................................................... 21 3.6. Network Settings.................................................................................................................................. 26 3.7. Telnet Settings...................................................................................................................................... 28 3.8. N-Way.................................................................................................................................................. 29 3.9. Scheduler............................................................................................................................................. 30 3.10. Notifications........................................................................................................................................ 36 3.11. Logs.................................................................................................................................................... 38 3.12. Update Tool........................................................................................................................................ 40 4. The Channel Table........................................................................................................................ 42 4.1. Channel Settings.................................................................................................................................. 42 4.2. Channel Settings - General.................................................................................................................. 43 4.3. Channel Settings - Recording.............................................................................................................. 51 4.4. Channel Settings - Layout.................................................................................................................... 54 4.5. Channel Settings – Image Overlays..................................................................................................... 59 NCast Corporation Revision 2.2 Page 2 NCast Telepresenter Reference Manual 4.6. Channel Settings – Text Overlays........................................................................................................ 59 4.7. Channel Settings – Upload................................................................................................................... 62 4.8. Channel Settings – Notifications.......................................................................................................... 64 5. Archive Page................................................................................................................................. 66 5.1. Archive Settings................................................................................................................................... 66 6. Sources Page............................................................................................................................... 70 6.1. Sources Settings.................................................................................................................................. 70 7. Information Pages Reference....................................................................................................... 75 7.1. Session Page....................................................................................................................................... 75 7.2. Viewers Page....................................................................................................................................... 76 7.3. View Page............................................................................................................................................ 77 7.4. VLC Media Player................................................................................................................................ 79 7.5. Media Players...................................................................................................................................... 79 7.6. Closed-Caption Support....................................................................................................................... 80 8. Custom Layouts............................................................................................................................ 83 8.1. Frame Layouts and Presets................................................................................................................. 83 9. Telepresenter Interfaces................................................................................................................ 88 9.1. Serial Interface..................................................................................................................................... 88 9.2. Telnet Interface..................................................................................................................................... 88 9.3. HTTP Interface – Archive Download.................................................................................................... 89 9.4. HTTP Interface – Image and Thumbnail Capture................................................................................. 95 9.5. HTTP Interface – Graphics Overlay Upload......................................................................................... 96 10. Techniques for Presentation Capture....................................................................................... 99 10.1. Webcasting, Podcasting and Archiving.............................................................................................. 99 10.2. Capturing Graphics, Video and Audio................................................................................................ 99 10.3. Conference Day Problems and Issues............................................................................................. 101 10.4. Video Post-Production...................................................................................................................... 102 11. References.................................................................................................................................. 105 11.1. MPEG Compression......................................................................................................................... 105 11.2. Packet Transmission........................................................................................................................ 105 11.3. Multicast........................................................................................................................................... 105 12. Revision History.......................................................................................................................... 106 NCast Corporation Revision 2.2 Page 3 NCast Telepresenter Reference Manual Regulatory Compliance Information Equipment Label The Telepresenter meets all applicable FCC, CE and ICAN radiation and emission standards: NCast Corporation This device complies with Part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) this device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. This Product Certified to meet the Standards in the categories listed on the label by: Pulver Laboratories Inc. NRTL Control Number 5424X (1) Information Technology Equipment including Electrical Business Equipment (2) Low-Voltage Video Product (3) Professional Audio and Video Equipment EMI: FCC Part 15 Class B; ICAN ICES-003 Class B; EN55022 Class B This Class B digital apparatus complies with Canadian ICES-003. Cet appareil numérique de la classe B est conforme à la norme NMB-003 du Canada. Cautions (1) Use a shielded data cable connection between the parallel ports and peripherals of this equipment. (2) Other connections between peripherals of this equipment may be made with low voltage non-shielded computer data cables. (3) Network connections may consist of non-shielded CAT 5 cable. Warnings (1) A non-shielded power cord may be used to connect AC power to every component and peripheral of the system. FCC NOTICE This device complies with Part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) this device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. FCC NOTICE – INFORMATION. The user may find the following publication prepared by the Federal Communications Commission helpful: NCast Corporation Revision 2.2 Page 4 NCast Telepresenter Reference Manual “How to Identify and Resolve Radio-TV Interference Problems” Stock Number 004-000-00345-4, available exclusively from the Superintendent of Documents, Government Printing Office, Washington, DC 20402 (telephone +1-202-512-1800). FCC WARNING Changes or modification not expressly approved by the party responsible for compliance to Part 15 of the FCC Rules could void the user’s authority to operate the equipment. CE NOTICE – INFORMATION FOR THE USER This equipment has been tested and found to comply with the limits for a Class B or Class 2 digital device, pursuant to EN 55022 the expense of the user. The user may find the following publication prepared by the Federal Communication Commission helpful: “How to Identify and Resolve Radio-TV Interference Problems” Stock Number 004-000-00345-4, available exclusively from the Superintendent of Documents, Government Printing Office, Washington, DC 20402 (telephone +1-202-512-1800). WARNING Changes or modifications not expressly approved by the party responsible for compliance to EN 55022 Rules could void the user’s authority to operate the equipment. ICAN Class B Digital Equipment This Class B digital apparatus meets all requirements of the Canadian Interference-Causing Equipment Regulations. Cet appareil numérique de la classe B respecte toutes les exigencies due Réglement sur le matériel brouilleur du Canada. NCast Corporation Revision 2.2 Page 5 NCast Telepresenter Reference Manual 1. Introduction 1.1. PURPOSE The NCast Telepresenter Reference Manual is intended for the Audio/Video or Network engineer who will be tasked with the job of installing and setting up a Telepresenter or a system of multiple Telepresenters. The Quick Start Manual should be consulted for basic setup, power-on of a unit and troubleshooting. This guide is designed to cover topics in greater depth and to assist in optimizing the performance of a Telepresenter. 1.2. DOCUMENT OVERVIEW This document is divided into two major sections: the theory of operation and a discussion of parameter settings. 1.3. TERMS AND DEFINITIONS A complete discussion of MPEG compression, Internet streaming, webcasting protocols and related topics is beyond the scope of this document. Other sources cover this material in great detail. The following are brief definitions of some of the terms used throughout this manual. AAC – Advanced Audio Coding, a wideband audio encoding and compression algorithm. Auto-detect – A capability to automatically sense if an input signal (graphics or video) is present and to lock onto that signal without further manual intervention. CIF - Describes an image or display surface with a resolution of 352x288 pixels. DVI – Digital Visual Interface, a digital interface standard which provides for connection to LCD panels and displays. H.264 – A compression format that delivers very high quality video at low bit rates. MPEG-4 Part 10 utilizes the H.264 codec for transmission. IETF – Internet Engineering Task Force, the standards body for Internet protocols. ISO – International Standards Organization Latency – The end-to-end time delay between a change in the source image and the corresponding change in the remotely displayed image. Line-Level – Sound level signals typically in the range of –10 dBu to +30 dBu. Lip-sync – The synchronization of independent audio and video streams at a receiving decoder so that the presentation is in the same time relationship as the source. Mic-Level – Sound level signals typically in the range of –70 dBu to –30 dBu. MPEG Compression – MPEG is an acronym for Motion Picture Experts Group, an industrywide committee which has defined a series of standards for the compression of audio and video source material. MTU – The maximum transmission unit is the maximum number of bytes permitted in a transmitted packet. Multicast – A family of computer transmission protocols where multiple receivers access a single transmitted packet stream. NCCP – NCast Conference Control Protocol provides coordination, control and identification of participants in a multi-way collaborative conference session. N-Way – An NCast proprietary service for multicast bridging and webcasting. NCast Corporation Revision 2.2 Page 6 NCast Telepresenter Reference Manual PIP – A picture-in-picture function overlays one video or graphics image with a reduced-sized version of another video image. RFC – Request for Comments, an Internet protocol standard. RTSP – Real-Time Streaming Protocol is an IETF approved protocol for control of real-time streaming on the Internet. S-Video – A video connector (usually DIN style) where luminance and chroma information are transmitted on separate wires or cable pairs. Provides for a higher fidelity image than a composite connection. SDP – Session Description Protocol, for describing streaming media transmissions SIF - Describes an image or display surface with a resolution of 320x240 pixels. SVGA – Describes an image or display surface with a resolution of 800x600 pixels. SXGA – Describes an image or display surface with a resolution of 1280x1024 pixels. The aspect ratio for SXGA is 5:4. Support for a 4:3 aspect ratio is accomplished by utilizing a 1280×960 subset of the display surface. Telnet – An IP network based protocol, which was originally used to connect remote consoles and terminals to mainframes, but is now used as a general, bi-directional, byte oriented communications facility. See RFC’s 854 and 855. Unicast – Refers to a point-to-point connection between two Internet host machines. UXGA – Describes an image or display surface with a resolution of 1600x1200 pixels. VGA – Describes an image or display surface with a resolution of 640x480 pixels. WUXGA - Describes an image or display surface with a resolution of 1920x1200 pixels. WXGA – Describes an image or display surface with a resolution of 1366x768 pixels. Some projectors use WXGA to refer to 1280x720 as well. This display size implements a 16:9 aspect ratio, as compared to a normal 4:3 monitor. XGA – Describes an image or display surface with a resolution of 1024x768 pixels. 1.4. TELEPRESENTER UNITS The Telepresenter is a stand-alone network communications appliance which captures RGB (VGA) or DVI signals from a desktop or laptop, compresses the image with an industry standard compression algorithm, packetizes and transmits the imagery as an internet media stream, receives a media stream from the internet, decompresses the imagery, and presents the received information to a viewing audience through use of a large-screen computer (VGA) monitor or via a room projector. Telepresenters are able to archive the media stream in real-time while simultaneously webcasting, allowing for playback by the recipient at a later date. The following Telepresenter models are covered by this documentation: Telepresenter M3 Series 2 – A rack-mounted unit with streaming, archiving, collaboration, capabilities at WUXGA (1920x1200) and 1080p resolutions. Includes PIP and overlays. The M3 Series 2 must have been upgraded to the Revision 5.0 software level. Telepresenter M4, M4W – A rack-mounted unit with streaming, archiving, collaboration, capabilities at WUXGA (1920x1200) and 1080p resolutions. Includes PIP and overlays. All Telepresenter models share a core operating system and base set of features. 1.5. TELEPRESENTER MODES OF OPERATION The Telepresenters have three major modes of operation: NCast Corporation Revision 2.2 Page 7 NCast Telepresenter Reference Manual One-to-Many Streaming – In this mode of operation one of the Telepresenters is designated as the “Sender” and all of the other units are designated as “Receivers”. The media streams originate from the Sender and are decoded by one or more Receivers. The transmission is strictly one-way, and no feedback or interactivity is provided for. The one-to-many operation is enabled via use of multicast connected networks. Full-Duplex Streaming – Two Telepresenters can be connected via a point-to-point unicast or multicast link. Each endpoint will be transmitting to the other endpoint and simultaneously receiving a stream from the remote unit. Collaboration Mode – Two or more Telepresenters can be engaged in NCast’s proprietary Collaboration Mode. In this mode, one unit is designated as “Conference Coordinator” and all other units are designated as “Conference Participants”. The Coordinator is the master controller for the conference, and is allowed to pass control to any participant in the conference at any time. When a participant receives control, the participant’s unit begins transmission and the coordinator’s unit stops transmission. All other units are then “tuned in” to the media stream being generated by the participant unit which was granted control. When the participant’s presentation is done, the coordinator takes back floor control and continues the conference as before. In this mode the audio from each unit transmits continuously, and at each receiver all audio streams are combined or mixed to allow real-time interactive discussion amongst all participants. Use of collaboration mode audio requires external echo-canceling microphones or amplifiers to avoid problems with echo and feedback. Equipment made by companies such as ClearOne (was Gentner), PolyCom or others is a must for quality audio-conferencing results. Collaboration mode requires units to be situated on a multicast-enabled network, or to use NWay bridging technology. NCast Corporation Revision 2.2 Page 8 NCast Telepresenter Reference Manual In addition to these three modes of operation there is the following additional functionality: Webcasting to Desktops – The Telepresenters can generate RTSP media streams which may be unicast to desktops or laptops that wish to join a conference. Commonly available client players allow these presentations to be displayed either full-screen or in a window on an individual’s monitor or LCD display. In addition to the Desktops using RTSP, remote Telepresenters connected via multicast can receive the media streams. For optimum performance consideration must be given to the bandwidth requirements for all senders and receivers. In this mode of operation questions and comments from students or the audience may be enabled through use of any number of popular instant messaging applications (e.g. Jabber, Yahoo Messenger, Google Talk, etc.). Multicast Bridging – Through the use of N-Way technology and services, multiple Telepresenters, which are not situated on a native multicast network, can participate in a conference through the use of a bridge. The N-Way bridge can also serve as a distribution point for RTSP unicasts to desktops. NCast Corporation Revision 2.2 Page 9 NCast Telepresenter Reference Manual N-Way functionality and services are described in the N-Way Reference Manual. Contact NCast Corporation for more information on N-Way Servers and Services. 1.6. STARTUP 1.6.1. Really, Really Quick Start Here’s a really short description on how to get started: 1. Plug the unit into a network with DHCP, and plug in an LCD Display to the VGA Out, your laptop into the VGA In, a camera into a video connector (if you have one) and turn on the power. 2. When you see the bootup screen with the IP network address, log into the unit at using “admin” as the user and “ncast” as the password. 3. On the Sources page select your input feeds from the top two rows of buttons and then on the Channels page click the Channel Start button “1” on the left. 4. Go to the View page, click on “Quicktime RTSP” and you’re done! 1.6.2. Mini Start This is a short introduction on how to get started with a Telepresenter: 1. Plug the unit into a network and plug in an LCD Display to the VGA Out, your laptop into the VGA In, a camera into a video connector (if you have one) and turn on the power. If you aren’t using DHCP and need to enter static IP addresses, edit a “ntwkconf.txt” file onto a USB stick and plug it into a USB port. See the Network Settings section for details on this file. 2. When you see the bootup screen with the IP network address, log into the unit at using “admin” as the user and “ncast” as the password. 3. Go to the Configuration/Unit Options page and fill in all the information required. 4. Go to the Display page and setup your local loopback display parameters. 5. On the Sources page select your input feeds from the top two rows of buttons. Select your Audio Input source. Also select the Main and PIP Window settings. Turn the audio meter on. You should see your captured graphics and video on the local display screen. Check your audio levels on the meter. 6. On the Channels page modify a Channel for the transmission rates and multicast or unicast addresses you wish to use. Use the Layout tab to specify the resolution and window placement desired. Review the Recording options. Update the Channel information. Click the Channel Start button on the left for the Channel you have modified. 7. You will see a Session Start page come up with details about your ongoing transmission. If you wish to start recording the Session, press the Record button. NCast Corporation Revision 2.2 Page 10 NCast Telepresenter Reference Manual 8. Go to the View page. This page allows you to connect different media desktop players using either multicast or RTSP (unicast) protocol. If you have Quicktime installed on your PC, click on “Quicktime Multicast” if you have multicast on your network or “Quicktime RTSP” for unicast. Your client player should launch and you should see your captured graphics and video. For other client players, try clicking on the “SDP” link. You’re done! 1.6.3. Long Start Read this whole manual from cover to cover (RTFM). There are hundreds of different configuration options for a Telepresenter, allowing the setup and composition of many different formats, resolutions, PIP options, layouts, bit-rates, frame-rates, start and stop and scheduling options and the like. You can automatically upload your archives to a video-server. You can tag your archives automatically with course numbers and notes. You can add your own customized graphic overlays to the captured graphics and video. Transmission can be automated so that all that is required is to press the poweron button. Please feel free to contact NCast Corporation if you have any questions about the use or configuration of the Telepresenter. NCast Corporation Revision 2.2 Page 11 NCast Telepresenter Reference Manual 2. Theory of Operation 2.1. TELEPRESENTER COMPONENT BLOCK DIAGRAM The Telepresenter consists of these main hardware functions: Digitizer Capture Hardware – A specially designed, high-performance PCI card is used to grab and digitize the RGB or video signals created by the presenter or media source. This card accepts VGA, DVI, PAL/NTSC composite or PAL/NTSC S-Video connections and converts those signals to RGB or YUV digital format. With the introduction of the Digitizer-3 PCI card, two of these inputs may be active simultaneously for generation of a picture-in-picture (PIP) display. Central CPU – A general-purpose, high performance processor is used to compress and decompress media streams, to encapsulate and decapsulate outgoing and incoming packets streams, to enable the web interface, serial interface and telnet interface, and to prepare data for display on the attached monitor. A highly secure open-source operating system underlies and supports all of this functionality. Display Output Sub-system – Media streams, which are received and decoded, are presented on the attached display for viewing. Audio Sub-system – A sound system with stereo input-output capabilities and with support for microphone and line-level inputs and line-level outputs is used to create the AAC audio streams transmitted in conjunction with the associated graphics or video imagery. Ethernet Interface – Industry-standard Gigabit ethernet connectors are used to connect the Telepresenter with the Internet network used for communications. NCast Corporation Revision 2.2 Page 12 NCast Telepresenter Reference Manual 2.2. DIGITIZER CAPTURE FUNCTION The digitizer capture card selects one of the available four inputs (VGA, DVI, Composite, S-Video) and locks onto the signal. The signal is converted into the appropriate digital formats, and each pixel in the image is stored in a local memory buffer on the card. At an appropriate time the pixels in memory are transferred over the PCI bus to the memory of the main CPU where they are pre-processed and compressed. If PIP mode is enabled, two signals may be selected (exception: Composite and S-video share one video decoding chip). 2.3. COMPRESSION The digitized RGB signals are converted in format from an {R,G,B} representation to {Y,U,V}. Industrystandard compression algorithms are then used to reduce the source data to a more manageable size, and to generate sequences of I-P-B frames found in MPEG media streams. 2.4. TRANSMISSION The MPEG media stream is split into segments, which are then encapsulated into RTP packets according to the protocol standards set forth in IETF RFC 3016 or RFC 3984 (H.264). These packets are presented to the Ethernet hardware interface for subsequent transmission on the attached IP network. 2.5. DECOMPRESSION The received packet stream is decompressed and the resulting image is placed into a video frame buffer. At that instant it will become visible to the receiving viewers. 2.6. DISPLAY FUNCTION The display will output imagery from two different sources. If the unit is configured as the sending unit, a local copy of the captured image (prior to compression, but after capture and conversion to digital format) will be displayed. If the unit is a receiving unit, the displayed image will be from the remote sender. 2.7. AUDIO SUBSYSTEM Each Telepresenter supports an audio subsystem consisting of an AC ’97 codec and associated input/output connectors. The unit has microphone and line-level input signals, and a line-level output signal. Each linelevel connector supports stereo signals. NCast Corporation Revision 2.2 Page 13 NCast Telepresenter Reference Manual 2.8. ARCHIVE DISK A local hard-drive in the Telepresenter is available for recording transmitted sessions. The file format is standard MPEG-4 (.mp4), which can be played on a variety of desktop client players, or these same files can be installed on a video-streaming server for on-demand playback over the Internet. An optional license may be purchased to convert to Windows Media Advanced Streaming Format, ASF, for creation of .wmv files (M4W Product). NCast Corporation Revision 2.2 Page 14 NCast Telepresenter Reference Manual 3. Configuration Settings and Parameters Reference 3.1. UNIT OPTIONS SETTINGS The Unit Options page gives the Telepresenter its unique ID and provides a place to enter system-wide settings. The ID and contact information are transmitted over the Internet to identify this Telepresenter as a member of an ongoing conference session. 3.1.1. Unit ID The Unit ID uniquely identifies a Telepresenter within a conference. The Unit ID can be descriptive of the location of the unit, or it can reflect the departmental ownership, or any other characteristic that clearly differentiates it from its peers. Examples: M4 West Campus M4 Engineering The Unit ID is written to the XML meta-data file which accompanies each recording, and may be used to index the recorded file based on information about which unit sourced the recording. 3.1.2. Contact name The Contact name is typically the name of the owner or administrator of the unit responsible for being the source of the generated media stream. It could also be the name of the person in charge of the course material being webcast. This item is transmitted in real-time over the network as an SDES element in the RTP protocol (see IETF RFC 1889 for a more detailed description of the Real-Time Protocol). Other SDES items include the Contact e-mail, Contact phone, Contact location, and Contact web page. 3.1.3. Contact e-mail NCast Corporation Revision 2.2 Page 15 NCast Telepresenter Reference Manual The Contact e-mail should be the address of the owner/administrator of the unit or an address where questions or service requests concerning the unit are sent. The email address should be formatted according to RFC 822, for example, [email protected] 3.1.4. Contact phone The Contact phone should be the number of the owner/administrator of the unit or a number of a service desk, which a user could contact for help with regards to the media stream being generated. The phone number should be formatted with a + sign replacing the international access code. For example, a phone number in the United States would appear as “+1-800-555-1212”. 3.1.5. Contact location The location of the unit. The degree of precision of the location is at the discretion of the systems administrator. For example, one might enter “Sunnyvale, CA” or “Room 23B, Building 5, San Jose Campus, 2050 Tasman Drive, San Jose, CA”. 3.1.6. Contact web page The Contact web page can be the URL of the Contact name’s personal web page, department, service group, help page or course material outline. 3.1.7. Time zone The Time zone setting is required so that the timestamp information embedded in the archive filenames correctly matches the local time-of-day. 3.1.8. Network Time Protocol When enabled the unit’s system time is synchronized with public or private NTP servers. When disabled the system time is not synchronized and may drift over longer time periods. This option takes effect immediately. If the NTP client is disabled an additional setting for manual time and date setup shows up. The NTP client requires a proper DNS configuration to work correctly. Selection of this option requires that the network in use allows the Telepresenter to access external, publicly available time servers. If you are on a private or closed network, local NTP servers may be listed in the “NTP server N” fields. Disable this selection if access to the network time servers is not available (closed network) or if the unit is being used in a temporary location with a standalone hub or router (e.g. a tradeshow, conference or demo). Bootup time will be substantially reduced if the system does not wait for a response from non-existent time servers. 3.1.9. Serial Number and Revision Information At the bottom of the Unit Options page internal system information is listed including: • Serial number of the hardware unit • System ID – Required for entry of license information • Options – Software configuration options valid for this unit • Hardware architecture in use and firmware revision numbers • Software release revision and date • System date and time 3.1.10.Configuration/Reset Buttons On the right side of the web page are seven buttons which may be used to configure, restart or reset the unit: • Shutdown – Powers down the unit and is recommended as the proper means to turn off a Telepresenter if it will be idle for some time or is to be moved or reconfigured. All operating parameters will be properly saved and restored. NCast Corporation Revision 2.2 Page 16 NCast Telepresenter Reference Manual • Reboot – Shuts down and then restarts the unit. This operation may be needed to clear problems after a power brownout or other unexpected glitch. • Factory Defaults – All operating parameters are reset to the Telepresenter’s initial factory configuration. Nothing is saved and the reset is irreversible. • Export Settings/Import Settings – Export or Import ALL configuration settings for this unit • Install License/Remove License – Install license keys for additional purchased software options 3.2. PASSWORDS The Passwords page provides for entry of four different password types to control access to the Telepresenter. 3.2.1. Admin password The Admin password grants rights to all configuration and setup options for the Telepresenter. This password should be chosen carefully and with security in mind. Avoid use of common names, dictionary words and the like. A randomly chosen string greater than 8 characters in length is suggested. 3.2.2. Coordinator password The Coordinator password allows the Conference Coordinator to control the conference session and to pass control to the participating units. The Coordinator also has access to Archive files. 3.2.3. Viewer passwords The View page allows desktop or laptop users to access the live media streams being encoded by the Telepresenter. This access may or may not be restricted, depending on the content and needs of the installation and/or organization. If the “Verify viewer password” checkbox is enabled, then access is restricted and a viewer needs to enter a password to see the media stream. There is provision for four different viewer names and passwords. 3.2.4. HTTP API password NCast Corporation Revision 2.2 Page 17 NCast Telepresenter Reference Manual The HTTP API password allows access to archived files. This password permits HTTP access to the archive list, allows downloading of the archive and details file and the removal of one or more archived files. All of these operations utilize special HTTP URLs described in Section 9.3. Commonly available programs such as “wget” may be executed from shell scripts to automate this archive download function. There is no login page for a backup operator using the web interface. 3.3. WEB CONTROL The Web Control page allows configuration of security settings related to use and access of the web administrative interface. 3.3.1. HTTP/HTTPS Access Normal web access, which is unprotected and insecure, is accomplished through use of the HTTP protocol typically utilizing port 80. Secure access using HTTPS (the SSL protocol) utilizes port 443. Administration of the Telepresenter in open and insecure networks without the use of HTTPS presents a security risk and should be avoided. The Web Control page allows three different options related to Viewer and Administrative access. • All HTTP – Utilizes HTTP for Viewer and Administrative access. • Viewer HTTP/Admin HTTPS – Utilizes HTTPS for Administrative access • All HTTPS – Viewers and Administrators must use HTTPS The downside of using HTTPS is that SSL Certificates (which usually require an annual fee or license payment) are required for each Telepresenter unit. Non-authoritative certificates may be used, but Viewers will see ominous warning notices in their browsers about the certificate, asking the user to accept the validity of the connection. Also, client players such as Quicktime, which need to download .sdp files using HTTPS protocol, may not function correctly if the certificate is not valid. Consult with your network administrator about certificate availability for your organization. Access using HTTPS is straightforward. Simply use the “https” prefix: NCast Corporation Revision 2.2 Page 18 NCast Telepresenter Reference Manual This will automatically direct the request to port 443, the standard for HTTPS access. 3.3.2. Certificates and RSA Keys If an organization has purchased an official SSL Certificate, or has created a non-authoritative one (which can be done with many different SSL tools) this new certificate may be uploaded and installed on the Web Control page. When HTTPS is turned on, the Apache server requires that the certificate be authenticated with a password. Since this is not possible inside the Telepresenter, a private RSA key may be used instead of a password. If there is not a valid private RSA key available, then Apache will not start. This is used to disable third parties launching HTTPS with stolen certificates. More information on this topic is at. The pass-phrase should be removed from the private key before upload. 3.4. DISPLAY SETTINGS The Display settings control activity relative to the local display attached to the Telepresenter. If activated this display normally loops back the graphics or video signals selected on the input connectors (after digitization of the signal). The displayed material shows the final-form composition of what will be compressed and recorded (except for the audio-meter, if present). However, in the case of full-duplex streaming or collaboration mode, the display will be showing graphics or video that is being generated at some remote site. Also, if graphic overlays are being used, these will appear on the local loopback display. 3.4.1. Display Mode The Telepresenter auto-detects the attached monitor's native resolution and aspect ratio. Auto-detection works only if the monitor has EDID and the DDC link is available. Otherwise, the unit will fall back to a default resolution (1280x1024) and a default aspect ratio (4x3). Auto-detection is done only once during startup - if you switch your monitor later it will be auto-detected on the next startup. Auto-detected resolution and display aspect ratio are reported in the Display tab on web-page. If Auto-detection mode is not used, the output resolution size may be set to some fixed value (VGA, SVGA, XGA, ...). This is sometimes needed when the EDID connection is broken due to use of a matrix switch, VGA distribution amp, splitter or some other equipment which does not properly transport the required EDID information to the graphics connector. Also, some older CRT displays may not support EDID at all. In these NCast Corporation Revision 2.2 Page 19 NCast Telepresenter Reference Manual cases the required output resolution size must be set with the pull-down tab. All incoming media streams are scaled to this fixed resolution. There may be a loss of quality if, for example, an incoming XGA image is scaled to SVGA size. There are five different timings standards available: • DMT - VESA Display Monitor Timing • GTF - VESA Generalized Timing Formula • CVT - VESA Coordinated Video Timings • CVT-RB - VESA Coordinated Video Timings with Reduced Blanking • 861B – CEA/EIA-861B Consult the technical specifications of your CRT or LCD display to determine which of these settings is appropriate. Or, plug the display directly into the graphics connector to determine which setting is reported without the use of any distribution amps, splitters or intervening equipment. 3.4.2. Display Aspect Ratio The display aspect ratio will normally be auto-detected (as above) through the use of EDID information. If not correctly detected it may be set through the use of this pull-down menu. 3.4.3. Display Loopback Turns on and off the loopback of locally generated graphics or video input. If local loopback is not being used in an installation this setting should be set to “Disabled” as that will free up CPU cycles which are required to generate the loopbacked image. 3.4.4. Display Loopback Framerate If local loopback has been selected, the CPU will maintain on the local screen a copy of the material which is being digitized and sent out as a webcast or recorded as an archive. The process of refreshing this screen consumes CPU cycles, especially if large resolutions and fast framerates are involved. Excessive CPU utilization can negatively impact maximum outbound framerates. NCast Corporation Revision 2.2 Page 20 NCast Telepresenter Reference Manual This parameter allows the operator to decrease the local loopback refresh loading. The local screen will still be updated, but at a rate which provides some relief from excessive use. Reduce the setting from the “Full” value if needed to maximize outbound transmission performance. Obviously, a very low setting will impair the visual quality (in terms of motion) of the local display. The Telepresenter supports standard VGA output and optionally (with an additional graphics card) DVI output. 3.5. CUSTOM SETTINGS The Custom Settings page allows users of the Telepresenter to define unique dimensions for the Frame Size (capture window), Aspect Ratios, Main and PIP windows, and Graphics and Text Overlay images. These custom definitions are used in conjunction with Layout options in the Channel Table (see Section 4.4) and settings on the Sources page(see Section 6.1), so it is necessary to understand Channel Layout options and Source selections first to fully appreciate the custom definitions which are entered here. NCast Corporation Revision 2.2 Page 21 NCast Telepresenter Reference Manual 3.5.1. Custom Frame Sizes The Channel Table permits the selection of many common, industry standard frame sizes. However, if a special composite image is desired (some combination of Main, PIP and Overlay windows) then the user would probably have to define a custom Frame Size. The two entry fields define, in pixels, the width and height of the frame. The width must be in the range 1281920, and the height must be in the range 128-1200. NCast Corporation Revision 2.2 Page 22 NCast Telepresenter Reference Manual 3.5.2. Custom Aspect Ratios The aspect ratio defines the visual geometry of the Frame (capture surface). If the frame width (in pixels) divided by the frame height (in pixels) is the same as the aspect ratio, then square pixels will be displayed. Otherwise the pixels will be non-square, which is common in many video systems. The values entered for W,H are integers in the range 1-1000. 3.5.3. Custom Windows The Main and PIP input streams must be associated with a Window to define their placement and size on the frame surface area. The Channel and Sources page defines common settings (such as Full-screen and Top-right corner), but for custom compositions ten new Windows may be defined. NCast Corporation Revision 2.2 Page 23 NCast Telepresenter Reference Manual The values for X,Y,W,H may be entered as integers or percents. If integers are used then these are pixel widths and heights or pixel offsets from the upper left corner of the frame. If percents are used, then the dimensions are scaled to the current size of the frame area (e.g. if the frame area is 1024x768, then a 50% window width would be equivalent to entering a value of 512 pixels). The use of percents is convenient when the frame changes in dimension. The top-left corner is the origin and has an (X,Y) value of (0,0). 3.5.4. Custom Image Overlays Customized images may be added to the media stream being created. These images would typically be corporate or organizational logos, trademarks or watermarks, copyright statements, media content or date annotation, or descriptive information on the course or presentation being viewed (speaker, topic, etc.). These images must be created in .jpg, .png, .gif or animated .gif format (up to 1920x1200 pixels) and may use transparency to limit the amount of underlying graphical material which is blocked. Images must be less than 4 MB in size. The X,Y entries in these fields are integers or percents. ENTRIES ON THIS PAGE ARE OVERWRITTEN BY CHANNEL TABLE VALUES WHEN A SESSION IS STARTED! The corresponding Channel Table Image Overlays are transferred to the operating Session parameters and thus initialize the image overlays used during Channel startup. This page may be used to alter Session image overlays being displayed after a Session has started. For example, if Image Overlay 4 contains the presenter's name and topic in a multi-presentation recording, Overlay 4 on this page can be uploaded and enabled when that presenter begins his/her delivery. 3.5.5. Overlay n to upload Use the “Browse …” button to select the image file to be uploaded and then press the “Upload Files” button. NCast Corporation Revision 2.2 Page 24 NCast Telepresenter Reference Manual Overlay graphics can be uploaded dynamically, allowing scheduling tools and scripts to automatically change the presentation graphics and layouts at prescribed times (e.g. to conform to speaker times and track changes at a conference). See Section Error: Reference source not found for details on dynamic upload. 3.5.6. Custom Text Overlays Text Overlays are windows which contain text to be displayed on the frame. The text can be inserted from fields on administration web pages (Channel settings and the Configuration menu), or can be sent via serial RS-232 or Serial Telnet IP commands. See the Telepresenter Serial Reference Manual for details on these commands. NCast Corporation Revision 2.2 Page 25 NCast Telepresenter Reference Manual Text overlays can implement dynamically displayed text such a news tapes, stock tickers, closed captions, and for other purposes such as changing the name of the speaker for a presentation due to a last-minute change of presenters or participants Details of using Custom Text Overlays are discussed in Channel Table setup (Section 4.6). THE ENTRIES ON THIS PAGE ARE OVERWRITTEN BY CHANNEL TABLE VALUES WHEN A SESSION IS STARTED! Use this page when a Text Overlay needs to be modified after Session start. 3.6. NETWORK SETTINGS The Network Configuration page is used to set and report parameters related to the IP address of the unit and its behavior on an Internet network. The network parameters are normally set using this page, but alternatively, they may be entered through the use of commonly available USB memory sticks. When shipped the units are setup with DHCP enabled. The DHCP setting means that any network or router which provides DHCP services will automatically assign an IP address to the unit. This address is reported on the display screen during initial bootup. Once that address is noted, the installer may use the web interface and Network Configuration page to assign the unit to any statically desired IP address, which will take effect on the next power-on cycle. If this method does not work, use the USB stick method discussed below. The following parameters may be configured on the Network page: 3.6.1. DHCP If DHCP is enabled the unit will automatically receive an IP address from the network’s DHCP server. Some networks require MAC address registration with the DHCP server before an IP address can be allocated. The MAC address is on a label on the bottom of the chassis, and is also reported on the Network Configuration page. If DHCP is disabled, a static IP address must be provided by the installer. Consult with the IT staff or network management to obtain the IP address allocated for the unit. 3.6.2. IP Address NCast Corporation Revision 2.2 Page 26 NCast Telepresenter Reference Manual The static IP address to be used by the unit in numeric form (). Not required if DHCP is enabled. 3.6.3. Netmask The IP netmask in use for this LAN segment (e.g. 255.255.255.0). 3.6.4. Gateway The numeric IP address of the gateway host on this LAN segment (e.g.). 3.6.5. Primary DNS The numeric IP address of the primary Domain Name Server (DNS) for this LAN segment (e.g.). Domain name servers translate symbolic domain names to numeric IP addresses. Various processes within the Telepresenter may, on occasion, require contact with a valid name server. 3.6.6. Secondary DNS The numeric IP address of the secondary (or backup) Domain Name Server. 3.6.7. Ethernet Mode Adjusts the hardware link level settings for the connection between the Telepresenter and its network switch. Normally Auto-negotiation will be sufficient to establish the correct settings, but under special circumstances the installer may wish to force the Ethernet hardware to assume a different configuration. The link speed and full/half duplex settings are adjusted through use of the pulldown menu tab. 3.6.8. MAC Address The Ethernet address of the Telepresenter. There is no provision for changing this address. Some networks may require registration of the MAC address for proper operation. 3.6.9. Use HTTP proxy Software updates for the Telepresenter are achieved through use of HTTP protocol. If the network being used is firewalled and requires the use of HTTP Proxy services, then this checkbox must be enabled for proper downloads of new software updates. 3.6.10. Proxy server The IP address (symbolic or numeric) of the network’s proxy server. 3.6.11. Proxy port The proxy server port (e.g. 80). 3.6.12. Proxy user If the proxy server requires a username and password for access, enter the username. 3.6.13. Proxy password If the proxy server requires a username and password for access, enter the password. All changes to these network settings require a reboot of the unit. Press the “Update & Reboot” button when all entries are complete and you have double-checked the correctness of these entries. 3.6.14. USB Stick Network Settings An alternative way to configure network parameters for the unit is to edit a special text file on a USB memory stick and to insert that memory stick into any USB slot in the unit during power-on. The operating software looks for the presence of a USB memory and searches for the presence of a specially named file. If this file is found, the network parameters are read from the file, installed into unit and used during the network boot process. Once the unit has booted, the USB memory may be removed and is not required again. The network settings from the file will be reflected as permanent entries shown on the Network Configuration page. The file on the USB stick must be named “ntwkconf.txt” and has the following lines of information: NCast Corporation Revision 2.2 Page 27 NCast Telepresenter Reference Manual dhcp=(bool)0 dns_1=(string)204.89.223.4 dns_2=(string)204.89.223.44 ethernet=(string)auto gateway=(string)204.89.223.1 ipaddress=(string)204.89.223.25 netmask=(string)255.255.255.0 ntp=(bool)1 The “dhcp” keyword accepts two values: 0 which means disabled (no dhcp, use static addresses) or 1 which means enabled (use dhcp, dynamic addresses). The “dns” values identify the domain name servers. The “ethernet” keyword accepts these link-level values: auto, 10fd, 10hd, 100fd, 100hd, 1000fd, 1000hd (auto negotiation, 10, 100, 1000 Mbps, Full or Half Duplex). These values are case sensitive. The other keywords require numeric IP addresses or netmasks as shown above. The “ntp” parameter enables or disables network time protocol within the unit. If enabled, the Telepresenter must be on a network where access to public network time servers is available. Disable (ntp=(bool)0”) this parameter if the unit is on a closed network. Setting this parameter to 0 is useful when the Telepresenter is being used with a simple hub or switch. Long bootup times will be shortened as the box is no longer searching for network time servers. The previous version of this file was named “g2_conf.txt”. If both the new file and the old file are present on the USB disk, only the new one will be used. This file should be created/edited with any simple ASCII text editor (e.g. Notepad, Teachtext). Do not use an advanced word-processing editor to alter this file. Each key=value pair must be on a separate line with no whitespace prior to the key, and no blank lines in the file. 3.6.15.IP Address Display If the audio meter is displayed (on the local loopback screen) the current IP address of the unit will be shown with the meter, allowing verification of the unit’s address. 3.7. TELNET SETTINGS The Telnet Configuration page is used to enable the Telnet Serial Interface to the unit, an interface, which may be used to send and receive command and control, strings over IP-based networks. See the Serial Interface Specification Manual for complete information on the serial command interfaces. If the interface is enabled, secure the interface with a unique and non-dictionary password, and configure the IP restriction field to only allow the IP address of the controller unit to command the Telepresenter. Note that for security reasons the default Telnet port is not utilized. 3.7.1. Telnet Access Disable access if the serial command interface is not in use. 3.7.2. Password Choose a password, which has random characters and numbers and is at least 8 characters in length. Unfortunately, Telnet protocol sends this password in clear-text, so network sniffers may be able to compromise this entry. NCast Corporation Revision 2.2 Page 28 NCast Telepresenter Reference Manual 3.7.3. IP restriction This limits the valid IP addresses, which may send commands to the Telepresenter. Normally this field should contain a single IP address, which is the IP of the controller in charge of the Telepresenter. Thus, if the password is compromised an attacker will still not gain access to the unit. This field may contain: A single address.* An address range A subset of a network (CIDR notation) A comma-separated list of addresses.* A comma-separated list of addresses and ranges Standard CIDR notation is documented in IETF RFC 4632. 3.8. N-WAY The N-Way tab is used on Telepresenters which are configured for service with an N-Way Server. See the “NWay Reference Manual” for further information on the settings of this tab. NCast Corporation Revision 2.2 Page 29 NCast Telepresenter Reference Manual 3.9. SCHEDULER 3.9.1. Overview The Telepresenter Scheduler is a feature that allows the manager of one or more Telepresenters to schedule these appliances through use of a Google calendar or through use of industry-standard iCalendar files. The manager can start and stop each Telepresenter at a predetermined time, load unique settings for each individual presentation, send serial control commands to each Telepresenter to provide additional functionality, and specify how and where the Telepresenter sends its output, all without touching the actual Telepresenter user interface. All that is required is one or more Telepresenters, each with a connection to the Internet, and access to a Google calendar or an iCalendar file, no matter where in the world the equipment is located. 3.9.2. Components of the Solution The Scheduler Implementation uses three components to allow automatic start/stop scheduling of one or more Telepresenters in a network. These components are: • An administrative interface based on Google Calendar or other Calendar system using iCalendar • A scheduler process which queries the calendar information and activates the Telepresenter. • The Telepresenter IP serial command interface, which receives commands at the scheduled times. 3.9.3. Scheduler Overview The following sections describe how to use a Google Calendar account or an iCalendar file to setup a schedule for one or more Telepresenters and how to use the Scheduler web page. Complete documentation for the serial command set is in the “Telepresenter Serial Interface Specification”. Please refer to this manual for a more complete description of commands which may be used. This guide lists a few basic commands which allow the user to start and stop a unit from the Scheduler interface. 3.9.4. Google Calendar Events NCast Corporation Revision 2.2 Page 30 NCast Telepresenter Reference Manual Google Calendar is a web-based interface used to enter calendar events such as meetings and appointments. It allows multiple personal calendars (e.g. business and home) and allows sharing of public and private calendars with friends and associates. One interesting and important aspect of this calendaring system is that Google has defined a standardsbased software API (called “gdata” for many of their services) which allows programmatic access to the calendars and the events contained within them. The API is implemented in Java and several other languages, and allows outside programs (e.g. clock widgets, PDA’s, other calendar systems) to access and create events within a Google calendar. NCast has taken advantage of this programmable API to implement a scheduling system for Telepresenters where the web-based Google Calendar is the administrative interface for defining session start/stop times for one or more Telepresenters within a customer’s network. The process works in three steps: 1. An administrator enters one or more scheduled events for a Telepresenter 2. The scheduling process queries the calendar at regular intervals and captures these events. 3. Commands sent to the IP Serial Interface of a Telepresenter starts and stops the unit. The calendar interface allows an administrator to setup single or repeating events. The example below shows a single event scheduled for Tuesday, a Monday-Wednesday-Friday repeating event, and a Mondayto-Friday repeating event. An event is associated with a single Telepresenter listed in the “Where” field. Two events with the same start/stop times on the same day can be directed to two different Telepresenters simply by changing the contents of the “Where” field. The “Description” field (discussed below) allows customization of the actions executed at scheduled start time. So to get started, and administrator must establish a Google Calendar account (different from a Google mail account) and provide a password for this account. Multiple accounts can be established for multiple Telepresenters if that is easier to administer. Only the primary or default user calendar is processed. The program is not able to deal with secondary calendars at this time. NCast Corporation Revision 2.2 Page 31 NCast Telepresenter Reference Manual 3.9.5. Creating Scheduled Events To create an event click on a time-slot and fill in the following fields: The "What" field must contain (anywhere in the field) the letters “M3” to identify this as a Telepresenter event. Additional words can further describe the nature of this entry (e.g., “Chem 101”, “Weekly Staff”, etc.). The "When" field is used to delimit the start/stop times for the event. The drop-down menu only shows hour/half-hour entries, but by clicking again on the time field arbitrary times may be entered. The repeat options allow multiple occurrences of this event. If a stop time of 11:00 am is listed, the program uses 10:59:59 as the actual stop time. Thus, events may be scheduled back-to-back. The "Where" field is the DNS name or IP address of the Telepresenter to be controlled. Only one Telepresenter may be listed. This allows one calendar to control many different units. The “Calendar” field must be the primary or default calendar for this account. The “Description” field is a series of serial IP commands to be issued to the Telepresenter at the time of the Start event (see below). In the example above, “C1” starts the Telepresenter session on Channel 1. 3.9.6. Scheduled Event Commands The “Description” or content field is a series of serial IP commands to be issued to the Telepresenter at the time the Start event is processed. Each command is terminated with a ";" character. For example: C10; This is the only command needed to start a Telepresenter ("Start on Channel 10 with all other settings unchanged"). A more complicated example: G3; V1; p1; C88; R1; RP,The CEO; RT,Weekly Performance Review; where: G3 Set the Main input to the VGA input connector V1 Set the PIP input to the Composite video input connector p1 Turn PIP on C88 Start session on Channel 88 R1 Turn recording on RP Set presenter information to "The CEO" NCast Corporation Revision 2.2 Page 32 NCast Telepresenter Reference Manual RT Set title information to "Weekly Performance Review" Commands are case-sensitive and must be written exactly as shown. The commands are processed in the order given. The presenter and title information are stored by the Telepresenter in an XML file associated with archived MPEG-4 file. This XML file will normally be uploaded to the content server and can be used to provide additional details about the content for archiving and indexing. The "Telepresenter Serial Interface Manual" lists all the commands available on the serial IP interface. Please check that document for additional setup commands that might be issued. At the end of the event period, the program issues the "End Session" command "PE". No other commands are sent. The scheduler program queries the calendar every few minutes. Changes to the schedule may be entered prior to this query. Once an event has started the event can only be stopped by going directly to the Web interface of the Telepresenter and stopping it manually or waiting for the scheduled stop. The scheduler program does not check for conflicts or overlapping events. If times overlap for a given Telepresenter the results will occur in the order scheduled 3.9.7. iCalendar Overview There are many different calendar applications in use, both PC based and Web based. NCast provides a facility to utilize these other calendar applications to generate schedules through a file interchange standard known as “iCalendar”. Another situation where use of an iCalendar file would be needed is when immediate access to Google Calendar is not available. For example, if Telepresenters are being utilized to record a conference on a closed network at a hotel without Internet access, the scheduler file can be created for all tracks of the conference and used to run all machines during the event. 3.9.8. The iCalendar Standard iCalendar is the name for an Internet industry standard from the Internet Engineering Task Force (IETF): • RFC 2445: Internet Calendaring and Scheduling Core Object • RFC 2446: iCalendar Transport-Independent Interoperability These standards specify the format and contents of a file (usually a “.ics” file) which contains text strings describing calendar events. The sample below is a small portion of a typical iCalendar file: BEGIN:VCALENDAR PRODID:-//Google Inc//Google Calendar 70.9054//EN VERSION:2.0 CALSCALE:GREGORIAN METHOD:PUBLISH X-WR-CALNAME:NCast Corporation X-WR-TIMEZONE:America/Los_Angeles The iCalendar file interchange standards are not associated with the popular Macintosh program “iCal” or any other specific calendar application. The files provide a standard way to export, import and exchange calendar events, ToDo’s, meeting invitations and blog entries between different computer applications, and indeed, many different programs now support this standard (including Google Calendar). NCast Corporation Revision 2.2 Page 33 NCast Telepresenter Reference Manual The NCast Scheduler can read standard iCalendar (.ics) files containing scheduled events, and can control Telepresenters based on the contents of these events. 3.9.9. Using an iCalendar File There are three basic steps to use an iCalendar file with the NCast Scheduler: 1. Create the schedule in a calendar application 2. Export a “.ics” file with the event information 3. Start the scheduler program with this file. It is possible to use both iCalendar and Google Calendar at the same time. The scheduler program reads the file first and extracts up to one month’s worth of events from the file, then checks for a Google Calendar account and utilizes any additional event information coming from Google Calendar. Overlapping or conflicting event information is not checked for and could cause scheduling errors. Entering the event information is similar to the process described above using Google Calendar: • Summary field – must contain “M3” somewhere in the field • Location field – must contain the IP address of the Telepresenter • Description field – contains serial commands to be sent to a Telepresenter 3.9.10.Importing iCalendar Files An alternate way of utilizing iCalendar files is to first import them into a Google Calendar account, and then use the Scheduler program only with Google Calendar. To import an iCalendar file into Google: 1. Go to the “Settings” link (upper right corner) and click on it. 2. Select the “Import Calendar” tab and click on it. 3. Browse for the “.ics” file on the PC and select it. 4. Choose the default or primary calendar for the account. 5. Click “Import” 6. Verify that the events have been properly imported and that all required fields are present. This facility allows Telepresenter scheduling from almost any calendar application in use. 3.9.11. Exporting iCalendar Files Each calendar application should have an “Export” or “Save” command to create an “.ics” file for backup or use by other applications. To do this in Google Calendar: 1. In the “Calendars” sidebar/block on the left side, click on the menu pop-up for the primary calendar. 2. Select “Calendar settings”. 3. In the “Private Address:” details, click on the green “ICAL” button. A pop-up window should come up. 4. Right click on the “basic.ics” and do a “Save as …” function in your browser, saving the .ics file to a known location in your PC. If you simply click on the link, your calendar application will probably come up, and that is not the way to save the file. It will, however, allow you to import the file into your calendar and look at the contents locally. NCast Corporation Revision 2.2 Page 34 NCast Telepresenter Reference Manual 3.9.12.Configuration These parameters control scheduler process: • Google calendar – Enables or disables scheduling using Google Calendar data. • Google username – The account containing the calendar to be used. • Google password – Password for the above account • iCalendar – Enables or disables scheduling using an iCalendar file. • iCalendar to upload – Use this item to enter the filename of the iCalendar scheduling file which will be used. 3.9.13.View Buttons These buttons allows the operator to check on scheduled events: • View Google – Check on activities scheduled by Google calendar entries. • View iCalendar – Check on activities scheduled by iCalendar entries. 3.9.14.Activating the Serial Interface The IP serial interface on a Telepresenter must be enabled to receive the session start/stop commands from the scheduler process. By default this interface is “Disabled” (See Section 3.7). To enable the IP serial interface, bring up the web interface, log into the Telepresenter under the “admin” administrative account and go to the Configuration/Telnet screen tab. The fields on this page are set as follows: Telnet access - Must be “Enabled” for IP access Password - Set a password to allow Telnet access IP restriction - Set this to the IP address of this unit Port number - The given port “7474” is a non-standard port for telnet protocol access NCast Corporation Revision 2.2 Page 35 NCast Telepresenter Reference Manual When all fields are filled, click on the “Update” button. 3.9.15.Viewing Scheduler Activity The Logs page (See Section 3.11) permits viewing the scheduler activity logs for possible error messages, reports on scheduled events and other actions. The Serial log contains information on serial command activity. 3.9.16.External Scheduler Program There is an external utility program available (in the Python programming language) which may be used to schedule multiple Telepresenters from a single, central location. Check the download area of the NCast website for this utility. 3.10. NOTIFICATIONS The Telepresenter has an extensive system of notifications by e-mail for routine and extraordinary events during its operation. Events can be informational, like “Archive uploaded”, or they can be error reports such as “Disk full”. Event are categorized by their severity level (Info, Warning, Error and Critical), and by their specific action or type (e.g. Session start, Recording start, etc.). Events can be system-wide (e-mails are sent to the system administrator) or Channel specific (a subset of events is associated with a single Channel and sent to an email address associated with that Channel). System-wide events are configured in the Configuration → Notifications → Select Events Menu, and Channel related events are configured in the Channel → Modify → Notifications → Select Events Menu (see Section 4.8.). The rules controlling event reporting are the same in both cases, except for the system or Channel orientation of the activity. In summary, there is a comprehensive e-mail notification system in place to inform the administrator that “The disk is full!” or the Channel owner that “Your recording is ready” and many other notices. 3.10.1.Notifications NCast Corporation Revision 2.2 Page 36 NCast Telepresenter Reference Manual This dropdown menu selection enables or disables the system-wide e-mail notification service. It does not affect Channel notification activity. 3.10.2.E-mail address Enter the e-mail address of the administrator to be informed about system-wide events. 3.10.3.E-mail from address Enter the e-mail address denoting the source of this email (this unit). Something like [email protected] would instantly identify the source of the e-mail. 3.10.4.SMTP Server Enter the DNS address or IP number of your mail server. 3.10.5.SMTP Port Enter the port number needed to contact your SMTP (outbound) server. Normally port 25, the port number might be non-standard due to firewall rules, ISP restrictions or other requirements. 3.10.6.SMTP Authentication Check this box if your SMTP server requires authentication. 3.10.7.SMTP Username The username required for authenticated e-mails. 3.10.8.SMTP Password The password required for authenticated e-mails. 3.10.9.SSL/TLS Check this box if your SMTP server utilizes secure SSL or TLS connections. 3.10.10. Connection Test Clicking this button will send a test message to the account listed on this page. 3.10.11. Select Events This button brings up a checkbox menu which allows selection of notifications by severity level or by type. NCast Corporation Revision 2.2 Page 37 NCast Telepresenter Reference Manual There are two methods by which to choose a notification to be reported: • Select by event type – Any event which is assigned the selected severity level is reported. Selecting “Info” will report Info level events, but not others. You must also select “Critical” and “Error” to be informed about events classified as Critical and Error. • Select by event name – Any activity identified by the given name is reported. It does not matter if the “type” box is checked or not, the report is issued. So a typical strategy for using this selection page is as follows: First, select the severity level desired for reporting. Typically this would be “Critical” and “Error” unless there is an interest in the more frequent and less interesting “Warning” and “Info” messages. Next, select particular events of interest to be reported. Perhaps “Session start” and “Recording start” are required. The net result is that all “Critical” and “Error” messages will be generated, and “Info” level messages about “Session start” and “Recording start” will be sent as well. 3.11. LOGS Several run-time logs are maintained by the Telepresenter and are accessed via the Logs page: NCast Corporation Revision 2.2 Page 38 NCast Telepresenter Reference Manual 3.11.1. View Event Logs Many events during the operation of the Telepresenter are recorded in the Event Logs. These Logs are part of the Event Notification System discussed in Section 3.10. 3.11.2. View Serial Logs Serial command activity can be initiated from the RS-232 connector or the Telnet interface. Serial commands are also used with the Scheduler interface. This screen allows inspection of recent activity for the Serial link. NCast Corporation Revision 2.2 Page 39 NCast Telepresenter Reference Manual 3.11.3. Download Logs Log reporting is an important tool which NCast uses to diagnose any problems, whether they hardware or software, bugs or operational issues. When reporting a problem, please click on the “Download Logs” button which will create a .zip file of recently logged activity. Make a note of the time of the incident (if known) and forward this information to NCast for analysis. 3.12. UPDATE TOOL The Update Tool page lists the current release(s) of software available for this Telepresenter. If no information is listed then there is a problem reaching the update server. The Update Tool requires HTTP access to the external Internet to function correctly. If this access is firewalled or if the HTTP proxy settings are not correctly employed, then update listings and software updates are not available. There may also be a problem with the settings for the DNS servers as well. NCast Corporation Revision 2.2 Page 40 NCast Telepresenter Reference Manual Once the “Update” button is pressed the Telepresenter downloads a list of required files and their timestamps. Files which are missing or out-of-date are downloaded and installed. The unit will then reboot and becomes ready for service again with the new software release. Configuration files are not altered during this process. All Unit, Channel, Source and other settings should remain intact through this update. NCast Corporation Revision 2.2 Page 41 NCast Telepresenter Reference Manual 4. The Channel Table 4.1. CHANNEL SETTINGS A channel is a collection of parameter settings that defines the operating characteristics for a streaming, webcast or collaborative session. Just as Channel 2 on your TV defines the video carrier to be “55.25 MHz.”, Channel 2 on a Telepresenter might define the graphics multicast address to be “239.192.0.1”. There are many parameters associated with a channel, items like the video and audio multicast or unicast addresses, port numbers, MTU’s, codecs, bit rates, layouts, overlays and modes of operation. Think of a channel as a type of “preset” for all of those parameters. There are 100 channels allowed, so 100 different presets are available for definition. Once the channel settings have been established, typically by the administrator of the Telepresenter, or maybe the IT or Network department within an organization, they will not be changed by ordinary users of the Telepresenter. The user is instructed to “Use Channel 2” and no further detailed instructions are required. When a Channel is started the Telepresenter begins its broadcast or recording Session. All of the many Channel parameters are transferred to the working Session parameters and the encoding and layout parameters defined by the Channel become the current encoding mode and layout of the Telepresenter. Any changes or updates to the Channel Table have no effect on the Session until the next Session start. Session parameters which may be changed or updated appear on the Sources page and on the Custom page. Windows and Overlays may be altered during a Session, but the initial Frame size and aspect ratio may not change. The Frame size MUST remain fixed during a Session. 4.1.1. Channel Initiation At the left edge of each channel listed is an activation button. Pressing this button activates all the parameters for the Channel and a new Session based on these settings is started. 4.1.2. Channel Modification Setup of a Channel is divided into seven parts: • General – Channel name and network parameters NCast Corporation Revision 2.2 Page 42 NCast Telepresenter Reference Manual • Recording – Recording options and archive naming • Layout – Frame size and placement of the Main and PIP windows • Image Overlays – Definition of graphical overlay images to be used • Text Overlays – Definition of text overlays to be used • Upload – FTP or Secure FTP server names and passwords • Notifications – E-mail reports of important Channel events The paragraphs which follow describe in detail each of these parts. 4.1.3. Channel Export/Import A Channel's setup with all required parameters and settings may be exported to a .zip file. This provides for off-line backup. Use of the Import button allows restoration of the channel, or copying of the parameters from one channel to another. 4.2. CHANNEL SETTINGS - GENERAL 4.2.1. Channel Name Each channel can be assigned a name, and these names can reflect the functional use of the channel. For example, “International Sales Team Update” for corporate usage, “Engineering Collaboration” in the case of departmental usage, “M4 San Francisco” designating some geographical assignments, or “Chemistry 101” designating course related usage. As a specific example, if there are three Telepresenters in an organization, the following 6 channel assignments might be made for Telepresenter “A”: Channel 1 – Telepresenter A transmits using multicast address 239.192.0.0 Channel 2 – Telepresenter A receives using multicast address 239.192.0.0 Channel 3 – Telepresenter A coordinates a collaborative session on multicast address 239.192.2.0 NCast Corporation Revision 2.2 Page 43 NCast Telepresenter Reference Manual Channel 4 – Telepresenter A participates in a collaborative session on multicast address 239.192.2.0 Channel 5 – Telepresenter A establishes a full-duplex session to B using unicast point-to-point Channel 6 – Telepresenter A establishes a full-duplex session to C using unicast point-to-point The channel tables in units B and C are setup to complement these assignments. Enter a descriptive name for the channel. This could be by department “Engineering”, by location “Sunnyvale”, by content “HR Training”, by bit-rate “High Resolution Webcast”, by arbitrary token “Red”, or any other scheme that makes sense to the administrators or users. 4.2.2. Channel Type The Telepresenter has six basic modes of operation: • Streaming Send – The unit will be transmitting in a one-way, one-to-many session to other units or remote desktops. • Streaming Receive – The unit will be receiving a transmission from some other source on this address. • Streaming Full Duplex – The unit will be engaged in a two-way, simultaneous connection with one other Telepresenter. Graphics and Audio generated on one unit will be received at the other unit. • Automatic Unicast – The unit will utilize the services of a streaming server for rebroadcast (reflection) of the incoming stream. Through use of the RTSP protocol an announcement is sent to the server indicating a new streaming session is starting. • Conference Coordinator – The unit will be the conference coordinator for a multi-unit collaborative session (2 or more units). This unit will transmit on the channel until the “floor control” is handed off to one of the remote units by the Coordinator. Upon completion of the remote presentation “floor control” is returned to the Coordinator who resumes transmission. The Coordinator always retains the right to pass control to any of the units. • Conference Participant – The unit will participate in a collaborative conference, but will not transmit until “handed the floor” by the Coordinator. NCast Corporation Revision 2.2 Page 44 NCast Telepresenter Reference Manual The passing of “floor control” triggers two important events for the participants in the conference. First, the media stream being generated by the Coordinator is shut down, and a new media stream being generated by one of the participants starts up. Only one graphics media stream is present on the network, leading to constant network utilization in terms of traffic load or bandwidth used. The total bandwidth utilized remains flat, independent of how many participants are in the conference. The second event occurring when the floor is passed is a signal that is sent to all units which tells them to look for and display the new media stream being generated by a participant. The content being displayed to conference viewers automatically switches from one source to another, that is, from one site to another site. When the Coordinator retakes control, another signal is sent and the units relock on the Coordinators media stream. In Collaboration mode, audio from all sites is mixed and presented as one combined stream. Everyone can hear everyone else. Echo-canceling microphones or equipment are required for this type of usage. The bandwidth used for audio increases linearly as the number of units in the conference increases. For a two-unit conference there is a subtle difference between Full-Duplex streaming and Collaboration Mode. In Full-Duplex streaming two graphics streams are occupying the network bandwidth, so the total bandwidth used is 2B+2A where B is the graphics bandwidth used and A is the audio bandwidth used. In Collaboration Mode, the total bandwidth used is 1B+2A, that is, roughly half the utilization of Full-Duplex. 4.2.3. Video Format Select the type of compression encoding desired. The two choices: 4.2.4. ▪ MPEG-4 (MPEG-4 Part 2 encoding, original MPEG standard) ▪ H.264 (MPEG-4 Part 10 encoding, latest industry standard) Video Address An address entered for Video (the Video or Graphics media stream) will be either a valid multicast address, or the numeric host IP address of the remote unit if a point-to-point connection is being established. A full discussion of multicast addressing is beyond the scope of this document, but briefly summarized, there are three classes of multicast addresses typically used by multicast applications: • Global Addresses – The range of multicast addresses 224.0.1.0-238.255.255.255 are used for global communications. These addresses are dynamically allocated and not statically reserved. These addresses are unsuited for static assignment in the Channel Table. • GLOP Addresses – A document, IETF RFC 3180, describes a mechanism for statically assigned multicast addresses in the address space 233/8 based on a formula that incorporates the Autonomous System (AS) number in the middle two octets. The AS number is owned by the ISP providing service to the account and use of a GLOP address must be coordinated with that ISP. • Administratively Scoped Addresses – The multicast address range of 239.0.0.0 to 239.255.255.255 has been defined to be a range of administratively scoped multicast addresses in IETF RFC 2365. These addresses may be statically assigned by the administrator of an organization’s network, and there will be no conflict with other organization’s use of these addresses because border routers on the edge of an organization’s network enforce policies to stop multicast traffic flow for addresses within this range. Further, these same border routers can enforce policies so that subsets of these addresses are contained within administrative boundaries, such as a local LAN, a building, a campus or a region. These are safe addresses to use in setting up an organization’s multicast network and ideal entries for use in the Channel Table. Consult with the Network Administrator for the particular address ranges in use on the network hosting the Telepresenter. All units in one session use the same multicast address. The Video,). NCast Corporation Revision 2.2 Page 45 NCast Telepresenter Reference Manual The default settings for a Telepresenter use Administratively-Scoped multicast addresses. This implies that streams created using these addresses will not exit the organization’s network..5. Video Port In addition to a multicast address, each media stream requires a unique port to be assigned. Ports must be even-numbered (the succeeding odd number is used for control purposes and must be available). Port numbers range from 1024 to 65,535 and this range is divided into two parts: the Registered Ports are those from 1024 through 49151 and Dynamic and/or Private Ports are those from 49152 through 65535. In practice, multicast applications assign port numbers in the range of 5002 and up. The port range 10245000 is typically used by a Unix system to assign ports to applications desiring an automatically generated port number. Even if different multicast addresses are being used, it is recommended that different port numbers be used for the different media streams (graphics, audio and collaboration). On some system implementations, use of the same port number will cause errors. For multicast traffic to get through a firewall, the even-odd pair defined in this entry must be opened by the firewall administrator. 4.2.6. Video Bit-rate The video bit-rate in kilobits-per-second defines the maximum bit-rate that the encoders may utilize in creating the media stream. For static images the bit-rate may decrease from this peak level. The following table lists the absolute minimum recommended bit-rates for high frame-rates: Resolution Minimum Bit-rate Preferred Bit-rate QVGA (320x240) 128 kbps 192 kbps VGA (640x480) 220 kbps 330 kbps SVGA (800x600) 310 kbps 465 kbps XGA (1024x768) 500 kbps 750 kbps SXGA (1280x1024) 1250 kbps 1875 kbps UXGA (1600x1200) 1850 kbps 2775 kbps Settings below these values will generate pixelation and other visual artifacts in the received image. Also, use of the minimum bit-rates will increase end-to-end latency, may reduce the visual clarity of the image and introduce lip-synch problems. As with any other type of compression system, there is a complex interaction between bit-rate, frame-rate, image resolution, and end-to-end latency. For XGA images, settings above 1000 kbps generally produce excellent results. The lowest latency is achieved by setting the bit-rate to the maximum permitted, which is 10,000 kbps. Reducing the bit-rate, frame-rate and resolution will allow older PCs operating at lower performance levels to decode the received imagery without skips and stutters. For the full frame-rate and bit-rate at XGA resolutions modern PCs in the 2 GHz.+ class are required. NCast Corporation Revision 2.2 Page 46 NCast Telepresenter Reference Manual For the lowest bit rate, 128 kbps, a resolution of 640x480 and a frame-rate of 5 frames/second for graphics or 10 frames/second for video are recommended. There is no way to define the optimum settings for a given application. It depends on the material being presented, the expectations for motion smoothness and embedded video performance, the equipment available to the receiving audience, the maximum network bandwidth available, and other factors. The only way to determine the optimum settings for a particular installation is to run tests on the material being presented using the network at hand. 4.2.7. Video Frame-rate The video frame-rate represents the number of frame (visual image) grabs per second the system will attempt to achieve. The range of this setting is 1-60 frames per second. For NTSC video encoding a full 30 frames/second is achieved. At XGA resolutions, dropping the frame rate to lower values (5 frames/second, for example) allows a broader range of lower performance PCs to successfully decode the received presentations. It also reduces the required network bandwidth. At these rates, however, cursor movements look somewhat jerky and embedded video clips do not play well. One tradeoff might be to send a lower resolution (SVGA, 800x600) image at a higher frame-rate. At settings of 10 frames/second cursor movement and drop-down menus look natural, but video still suffers. At 15 frames/second video playback starts to become acceptable, but high-motion imagery has detectable artifacts. At the higher rates of 20 frames/second and up both the video and graphics performance look natural. These high frame-rates deliver smooth animation and video playback that most viewers will find acceptable. 4.2.8. Video.9. Audio Address An address entered for Audio (the Audio media stream) will be either a valid multicast address, or the numeric host IP address of the remote unit if a point-to-point connection is being established. For a discussion of multicast addresses, see the discussion above (Graphics addresses). All units in one session use the same multicast address. The Graphics,.10. Audio Port The port number assigned to the audio media stream. See the discussion above (Graphics ports) for more detailed information on ports. 4.2.11. Audio Format This menu pulldown selects the bandwidth and encoding properties of the audio media stream associated with the graphics stream. All audio is encoded in the Advanced Audio Coding (AAC) format. Different bitrates and an optional stereo setting provide for a wide selection of audio formats to be associated with the graphics media stream. NCast Corporation Revision 2.2 Page 47 NCast Telepresenter Reference Manual Sample Rate Channels Bit Rate Quality 11 kHz. Mono 16 kbps. Phone 22 kHz. Mono 32 kbps. FM radio 44 kHz. Mono 64 kbps. CD 44 kHz. Stereo 128 kbps. Stereo CD If audio is not to be transmitted or recorded, it may be disabled here as well. If recording in Mono and using the Line input, make sure that active audio is available on the LEFT channel. 4.2.12. Audio.13. Time-to-Live (TTL) The time-to-live defines the number of router hops that will be valid for a packet. When the number of hops is exceeded, the packet is discarded. The minimum value for this field is 1, and a value of 127 or greater should be used for global transmission. In some multicast networks TTL defines the “scope” or boundary conditions for containment of the multicast traffic flow. The following table lists commonly accepted values of TTL used in this manner.. TTL scopes, however, have fallen into disfavor, and current practice recommends use of administratively scoped addresses for containment of multicast traffic flows. 4.2.14. Automatic Unicast This Channel Type enables automatic transfer of a Telepresenter’s SDP file to a streaming server (e.g. a QTSS/DSS server). The transfer is accomplished by RTSP ANNOUNCE commands sent from a Telepresenter RTSP client to the server. The system makes sure that the latest version of the SDP file is NCast Corporation Revision 2.2 Page 48 NCast Telepresenter Reference Manual always on the server (SDP files describe the media being streamed and other details such as port assignments). Typically the SDP file is transferred when a session starts and during the session when the SDP file changes. The Telepresenter issues "Announced kill" when a session has ended. 4.2.15. Configuration The following parameters related to the Announce capability are available: • RTSP server - IP address or name of the streaming (QTSS/DSS, NWay, Flash) server • RTSP port - server RTSP port number (554 for QTSS/DSS, 1935 for Flash) • Username - server username for the SDP file save authorization (can be empty if authorization is not used) • Password - server password for SDP file save authorization (can be empty if authorization is not used) • SDP filename – the name under which the SDP file is saved by the server. Should have a .sdp extension. The names should be unique for each Telepresenter accessing a reflecting server. 4.2.16. Conference Address If a channel is defined as a collaboration channel, a multicast address must be assigned for use by the Conference Control Protocol (NCCP). This multicast group supports protocol messages between the coordinator and the participants for implementation of floor control and conference identification and participation. For a discussion of multicast addresses, see the discussion above (Graphics addresses). In the case of a two-party, point-to-point collaboration channel using a unicast link, this address may be the numeric IP address of the remote unit. Note that the Conference Address fields will only be visible if the Channel is setup as a Collaboration channel. 4.2.17. Conference Port NCast Corporation Revision 2.2 Page 49 NCast Telepresenter Reference Manual The port number assigned to the conference control protocol. See the discussion above (Graphics ports) for more detailed information on ports. Note that the Conference Port fields will only be visible if the Channel is setup as a Collaboration channel. 4.2.18. Auto-Start If the “Auto-Start” checkbox is enabled on a Channel, then Session activity for that Channel will automatically resume when the unit is rebooted or restarted after a power failure. 4.2.19. Show Thumbnail If this box is checked, a thumbnail image of the current capture will appear on the View page. Thumbnails are only available in Streaming Send mode. Uncheck this box if video/graphic material being streamed needs to be kept private. 4.2.20. Advanced Channel Settings For additional tuning of the channel parameters an Advanced channel settings button may be activated. The entry fields on the page change when the Advanced checkbox is clicked: 4.2.21. Bandwidth Smoothing If enabled, the encoder smooths the stream transmission and sends packets at the prescribed target bit rate (this is the default setting). This will increase network jitter and latency. If disabled, the encoder uses burst transmission by sending all packets immediately after encoding. This will significantly decrease network jitter and latency, but, depending on network connection, it can cause packet loss and bottlenecks. If burst network transmission is acceptable, it is possible to disable this option to get extra low video latency. This is a video encoder option - it doesn't affect the decoder. 4.2.22. Graphics Quantizer These options set minimum and maximum video quality. The valid range is from 1 (best quality) to 31 (worst quality). The default range is 2-31 for MPEG-4. For H.264 the range is 0-51 (default is 10-51). Decreasing min quantizer will increase the maximum possible video quality, and increasing min quantizer will decrease the maximum possible video quality. Increasing max quantizer will decrease minimum permitted video NCast Corporation Revision 2.2 Page 50 NCast Telepresenter Reference Manual quality. Increasing max quantizer too much may cause the encoder to skip frames in order to maintain the target framerate. This is a video encoder option - it doesn't affect the decoder. 4.2.23. Graphics CBR Buffer Sets the Constant Bit Rate buffer size in seconds. This controls how much the bit-rate can vary locally. A larger buffer size results in higher overall video quality and less frame skips, but increases the video latency. This is a video encoder option - it doesn't affect the decoder. 4.2.24. Audio Frames Sets how many AAC frames can be sent in one packet. The default value is 8. The valid range is from 1 to 10. Lower values result in lower network jitter and lower latency, but higher network overhead (each packet contains additional headers). Set to 1 to achieve extra low audio latency. This is an audio encoder option - it doesn't affect the decoder. 4.2.25. Audio/Video Synchronization This option is only visible if the Channel is set to “Full-duplex” or “Receive”. If enabled, audio and video is synchronized during playback to maintain lip-sync (this is the default setting). If disabled, audio and video is not synchronized during playback. In typical configuration audio will be played ahead of video. If lip-sync is not needed, disable this option to get lower audio or video latency. This is a decoder option - it doesn't affect the encoder. 4.2.26. Burst Video Playback This option is only visible if the Channel is set to “Full-duplex” or “Receive” and is only available if “Audio/Video Synchronization” is disabled. If enabled, the decoder forces video frames to playback immediately after being received. This will result in lower video latency, but video playback will be jumpy due to encoder and network jitter. If disabled, video frames are delayed to achieve smooth and fluid video playback (this is the default setting). If jumpy video playback is acceptable, disable this option to get the lowest video latency. This is a video decoder option - it doesn't affect the encoder. 4.3. CHANNEL SETTINGS - RECORDING 4.3.1. Recording Options NCast Corporation Revision 2.2 Page 51 NCast Telepresenter Reference Manual Three options are available for control of recording: Manual – Recording must be started and stopped by the user via controls on the Session page or by the room controller via one of the serial interfaces. Auto – Recording starts and stops when the Session starts and stops. Disabled – Recording is not permitted on this channel. 4.3.2. Archive Filename The default archived filename is of the form 20071119-143206-001.mp4 which represents the start time of the recording through use of the fields: year, month, day, hours, minutes, seconds, channel-number, filetype. This default filename format may be altered to reflect more customized filenames through use of a formatting string utilizing any of the following codes: %a %b %c %C %d %H %I %m %M %n %p %P %S %t %Y %% – - abbreviated weekday name abbreviated month name 4 digit counter 6 digit counter day of the month (01 to 31) 24 hour clock (00 to 23) 12 hour clock (01 to 12) month (01 to 12) minute (00 to 59) channel number (001 to 100) AM or PM am or pm seconds (00 to 61) transcode variable year % For example, if a Telepresenter user wishes to create a custom filename for the “Accounting 101” series of lectures, the following filename formatting string might be used: Acct101-%Y-%m-%d This will create filenames of the form: Acct101-2007-11-19.mp4 Acct101-2007-11-21.mp4 Acct101-2007-11-23.mp4 … Using this formatting notation, the default value of the format string for standard archive filenames is this: %Y%m%d-%H%M%S-%n The counter variables start at 0001 or 000001 and go to 9999 or 999999. Only one counter variable is permitted per filename. The counter’s next value is calculated by scanning existing archives which match the filename template. The filename with highest counter value is discovered and the counter value found is incremented by one. If all files are removed the counters will start again from 1. If a newly created archive filename conflicts with an existing archive, a suffix _n (_1, _2, _3, … ) is added to the new name to avoid overwriting an existing file. 4.3.3. Archive Title NCast Corporation Revision 2.2 Page 52 NCast Telepresenter Reference Manual Enter information about the Title of the session being recorded (e.g. class or course number, conference session title, meeting name, etc.). This information is entered as meta-data about the recorded archive and will be captured in the .xml data file associated with the archive. 4.3.4. Archive Presenter Enter information about the Presenter of the session being recorded (e.g. class professor or instructor, conference session speaker, meeting chairperson, etc.). This information is entered as meta-data about the recorded archive and will be captured in the .xml data file associated with the archive. 4.3.5. Archive Description Enter additional descriptive details about the event, the presenter, the topic or background of the recording. This description field will be used, for example, in automatically creating RSS feeds for the recording once it has been uploaded to an N-Way server. 4.3.6. Transcode n The H.264 MPEG-4 file format is becoming the industry standard for webcasting, streaming and other video distribution uses. The mainstream media players (Flash, Quicktime and Silverlight) now support this common format for video-on-demand playback. A Telepresenter is now able to transcode high-quality MPEG-4 Part 2 or 10 files into four different H.264 or Theora formats (Also VC-1 for the M4W), with selectable resolution sizes and bit-rates. A high-bit-rate file can be created for local distribution; a medium quality file can be created for DSL and cable modem clients, and a low-bit-rate, low-resolution version can be created for iPods and other mobile devices. Theora is an open-source codec required for use in some countries and for HTML-5 use in some browsers. Also, some websites will only be supporting codecs that are not encumbered by patents, a claim made by the Theora developers. The original file and the four transcoded files will be automatically uploaded via FTP or SFTP to the videoon-demand server specified on the Upload page. Transcoding options are shown on the Modify Channel page when a Transcode box is checked. Here you can assign a resolution, graphics bit-rate and a filename to each H.264 or Theora file. The audio track is moved to the H.264 file without any changes. You may keep your original MPEG-4 file by unchecking the "Remove original archive" option. Otherwise when transcoding is finished the original archive is deleted. For best results you should choose wisely the graphics bit-rate and graphics capture size. Setting the highest possible graphics bit-rate is recommended for optimum transcode quality. The Graphics Capture size should match the H.264 size (or highest H.264 size if transcoding to multiple files). We recommend using values dividable by 16. Transcoding is done when the Session is off and can take a very long time. Don't power off or reboot the unit when transcoding a file because the whole process will be restarted. Transcoding adds a new special parameter "%t" which can be used in filename format string and in the FTP/SFTP upload directory - it will be filled with transcode number (1 to 4) or skipped (original recording). 4.3.7. Remove Original Archive Uncheck this box to retain the original MPEG-4 archive file after all transcode operations have finished. If only the transcoded output is desired, leave it checked. The original MPEG-4 file may be larger in resolution and size than is needed for distribution to viewers. However, for archival purposes it may be desirable to keep the high-quality original. Also, some video editing tools may find MPEG-4 Part-2 files easier to deal with than the H.264 equivalents. 4.3.8. Add MP4 Hint Tracks Streaming servers require some additional information about the contents of a media file to optimize delivery for remote clients. An additional track, called a hint track, contains this information. If the file is to be used with a streaming server this option must be checked. If streaming is not required, uncheck to save on file processing and to reduce the file size. 4.3.9. Optimize MP4 Layout NCast Corporation Revision 2.2 Page 53 NCast Telepresenter Reference Manual Sometimes a media file is placed on a web server and is played without the assistance of a streaming server. In such instances the location of the media data required for progressive download needs to be optimized. Optimization rearranges the audio and video blocks within the file. Optimization does not significantly affect the size of a file, but adds slightly to the post-Session processing time required. Uncheck this box if files will not be used in progressive download environments. 4.3.10. Transcode Timing The time needed to transcode files to other formats and resolutions depends on several different factors. For an XGA-sized image on an M4 using these settings: • Video - MPEG-4, 1024x768, 30 fps, 5000 kbps • Audio - AAC 44100Hz, Mono, 64 kbps • 1 hour recording the transcoding times to H.264 were measured as follows: • 1024x768 - 55-48 minutes • 640x480 - 41-38 minutes • 320x240 - 26-25 minutes Four different bitrates were used (from 4000 Kbps to 125 Kbps). The higher resulting values are for higher bitrates, and the lower values are for lower bitrates. The bitrate doesn't impact transcode time very much. The transcode time is influenced mainly by the video size and framerate. For 1920x1080 transcodes these settings were used: • Video - MPEG-4, 1920x1080, 30 fps, 5000 kbps • Audio - AAC 44100 Hz., Mono, 64 kbps • 1 hour recording Transcoding times to H.264: • 1920x1080 - 142-124 minutes • 1280x720 - 109-101 minutes • 640x360 - 53-51 minutes Transcoding times to Theora are quite lengthy because this first generation implementation has not yet been optimized as much as some of the more mature codecs. 4.4. CHANNEL SETTINGS - LAYOUT 4.4.1. Frame Size The Frame Size defines the dimensions of the Frame, a surface (capture surface or “the canvas”) which is the primary imaging surface on which the composite image (Main window + PIP window + Overlays) is drawn. The resolution and aspect ratio of the transmitted or archived media stream aligns exactly with the resolution and aspect ratio of the Frame. Consequently, selection of one of the default frame sizes and aspect ratios, or definition of a custom Frame Size and possibly a custom Aspect Ratio is the first step in defining the format of the media stream which will be produced by the Telepresenter. The Frame can have any dimension or aspect ratio, with the limitation that the maximum dimensions are 1920 x 1200. Once the frame is defined, the next step is the (X,Y) placement and (W,H) sizing of the primary or “Main” image stream. Typically the “Main” stream is sized at “Full-screen” which means that the primary stream is scaled to the full dimensions of the frame. It is useful to note, however, that the primary stream can be dimensioned to a smaller size than the full frame size. The unused space might then be reserved for the secondary image stream (the PIP image, but placed outside the boundaries of the Main image) and possibly NCast Corporation Revision 2.2 Page 54 NCast Telepresenter Reference Manual an overlay graphic. A “Main” and “PIP” side-by-side composition would also dictate that the Main image only occupies one-half of the capture surface area. Next, if the secondary “PIP” stream is enabled, its (X,Y) placement and (W,H) dimensions are overlaid on the frame. Typically this might be in the upper-right or lower-right corner of the frame. The Telepresenter user has the option of determining if the PIP window obscures any portion of the Main window. It can be placed on top of or outside of the Main image. Finally, the Overlay Graphics or Text Overlays, if preloaded and enabled, are added to the composition. These graphics would usually be a corporate or organizational logo, a trademark or watermark, a course descriptor or content designator, and possibly a copyright or other statement about the media stream being transmitted or archived. Once this content has been composited and created, it is handed off to the compression codecs for transmission to the outside or for archiving. NCast Corporation Revision 2.2 Page 55 NCast Telepresenter Reference Manual In a typical conference it is quite common to have different input resolutions during the course of one session (graphical input from laptops set for SVGA and XGA resolution, and video input from a camera). These different resolution images can be transmitted in their native dimensions, or stretched or shrunk to some common size for the webcast or the recording. The setting of the Main and PIP Windows controls this process and the implications of these settings are explained below: Graphics Capture Size QVGA, VGA, SVGA, XGA, SXGA, ... Frame size n 4.4.2. Results The media streams and archive files are sent/kept in the resolution selected, Captured images which are larger or smaller than the selected Frame Size are automatically scaled to the Window dimensions specified by the Main and PIP settings. The media streams and archive files are sent/kept in a custom resolution. Custom resolutions allow for non-standard images of user defined width and height. The Custom menu under the Configuration tab allows setting of these non-standard frame sizes. Aspect Ratio The aspect ratio of an image is the visual width divided by the visual height. For most computer systems “square pixels” are displayed, so the aspect ratio of the image is the pixel width divided by the pixel height. In video systems, however, often “non-square’ pixels are displayed and the aspect ratio differs from the pixel width to height ratio. The Frame size (see 4.4 above) only determines the pixel dimensions of an image. For proper display the aspect ratio must be specified and used to render the final image. NCast Corporation Revision 2.2 Page 56 NCast Telepresenter Reference Manual This menu selection item allows specification of five standard aspect ratios and ten custom aspect ratios (which are defined in the Custom menu under the Configuration tab). “Square pixel” derives the aspect ratio from the given capture width and height. 4.4.3. Main Video/Graphics Window This pull-down menu specifies the positioning of the primary (Main) image input onto the capture surface. The most common selection would be “Full-screen”, but in some situations a side-by-side image (Left half, Right half) might be desirable, or the Main image might be temporarily utilized as the video overlay (picturein-picture), in which case one of the corner settings (Top-left, Top-right, Bottom-left, Bottom-right) would be chosen. The custom window selections (Window 1, Window 2, ...) allow for placement of the primary and secondary images in arrangements not covered by the standard selections. These window sizes and positions are specified on the Custom tab under the Configuration menu. A key concept to understand this hardware implementation is to realize that the “Main” and “PIP” channels are really independent and nearly equal in functionality, and could have just as well been called “A” and “B”. We use the terminology “Main” and “PIP” to conceptually simplify the idea of one channel overlaying another, but in reality both input channels are basically equivalent in character and operation. The primary differences are that the PIP channel will overlay the Main, and the Main channel does not have deinterlacing functions, which are available in the PIP channel. NCast Corporation Revision 2.2 Page 57 NCast Telepresenter Reference Manual 4.4.4. PIP Video/Graphics Window This pull-down menu specifies the positioning of the secondary (PIP) image input onto the frame. The most common selection would be one of the corner settings (Top-left, Top-right, Bottom-left, Bottom-right). The custom window selections (Window 1, Window 2, ...) allow for placement of the PIP window in arrangements not covered by the standard selections. These window sizes and positions are specified on the Custom tab under the Configuration menu. NCast Corporation Revision 2.2 Page 58 NCast Telepresenter Reference Manual 4.5. CHANNEL SETTINGS – IMAGE OVERLAYS Customized images may be added to the media stream being created. These images would typically be corporate or organizational logos, trademarks or watermarks, copyright statements, media content or date annotation, or descriptive information on the course or presentation being viewed (speaker, topic, etc.). There can be up to four different Overlay images per Channel (400 images total).These images must be created in .jpg, .png, .gif or animated .gif format (up to 1920x1200 pixels) and may use transparency to limit the amount of underlying graphical material which is blocked. Images must be less than 4 MB in size. 4.5.1. Overlay n (X/Y) The X,Y entries in these fields are integers (pixel values) or percents (of the Frame dimension). Channel Table Image Overlays are transferred to the operating Session parameters at Session startup and thus initialize the image overlays used during the Session. Once a Session has started modifications to these entries have no effect until the next Session start. Changes to the Image Overlay in use during a Session may be made from the Sources page (see Section 6.1) or from the Configuration menu (see Section 3.5). 4.5.2. Overlay n to upload Use the “Browse …” button to select the image file to be uploaded and then press the “Upload Files” button. Overlay graphics can be uploaded dynamically, allowing scheduling tools and scripts to automatically change the presentation graphics and layouts at prescribed times (e.g. to conform to speaker times and track changes at a conference). See Section Error: Reference source not found for details on dynamic upload. 4.6. CHANNEL SETTINGS – TEXT OVERLAYS Text Overlays are windows which contain text to be displayed on the frame. The text can be inserted from fields on administration web pages (Channel settings and the Configuration menu), or can be sent via serial NCast Corporation Revision 2.2 Page 59 NCast Telepresenter Reference Manual RS-232 or Serial Telnet IP commands. See the Telepresenter Serial Reference Manual for details on these commands. Text overlays can implement dynamically displayed text such a news tapes, stock tickers, closed captions, and for other purposes such as changing the name of the speaker for a presentation due to a last-minute change of presenters or participants The Channel Table Text Overlays are transferred to the operating Session parameters at Session startup and thus initialize the text overlays used during the Session. Once a Session has started modifications to these entries have no effect until the next Session start. Changes to the Text Overlay in use during a Session may be made from the Sources page (see Section 6.1) or from the Configuration menu (see Section 3.5). 4.6.1. State The enable/disable setting will cause the text to be included or not included in the composite media stream being created. More than one text window (all four, in fact) may be included if required. 4.6.2. Window (X/Y/W/H) The X,Y,W,H entries in these fields are integers (pixel values) or percents (of the Frame dimension). The X,Y offset defined will position the text window relative to the top-left corner of the frame. The W,H values define the window width and height. 4.6.3. Text alignment Text may be aligned Left, Center or Right within the window. 4.6.4. Text wrapping Text wrapping may be enabled or disabled. 4.6.5. Font size This entry specifies the font size in pixels. 4.6.6. Padding in Pixels NCast Corporation Revision 2.2 Page 60 NCast Telepresenter Reference Manual Specifies a minimum distance (in pixels) between the frame of a window and the text. This option keeps the text from crowding or adjoining the edge of the window. 4.6.7. Foreground (R/G/B/A) The (R,G,B) color values for the text and alpha value (transparency setting) for the characters are specified here. Values must be in the range 0-255. For transparency, 0 is fully transparent and 255 is opaque. 4.6.8. Background (R/G/B/A) The (R,G,B) color values for the window background and alpha value (transparency setting) for the background matte are specified here. Values must be in the range 0-255. For transparency, 0 is fully transparent and 255 is opaque. 4.6.9. Text The text to be displayed in the window. This text may include format strings (e.g. %H, %M, %S for hour, minute, and second) which are dynamically updated in the overlay on a regular basis. 4.6.10.Serial Commands The text within a text overlay can be changed and frequently updated through use of serial commands. See the Telepresenter Serial Reference Manual for details. • OT0 - disables all four text overlays • OT[1|2|3|4],[0|1] - disables/enables given text overlay • OS0 - sets empty text on all four text overlays • OS[1|2|3|4],TEXT - set TEXT text on given text overlay 4.6.11. Format Strings The following special codes are available for text overlays: NCast Corporation Revision 2.2 Page 61 NCast Telepresenter Reference Manual Format String Function %a Abbreviated weekday name (for example Sun) %A Full weekday name (for example Sunday) %b Abbreviated month name (for example Jan) %B Full month name (for example January) %d Day of the month (01 to 31) %D Archive description %H Hour (00 to 23) %I Hour (01 to 12) %k Hour (0 to 23) %l Hour (0 to 12) %L Archive title %m Month (01 to 12) %M Minute (00 to 59) %n Channel number (001 to 100) %N Channel name %p AM/PM %P am/pm %R Archive presenter %S Second (00 to 60) %T Recording duration (for example 01:45:12) %x Date (for example 12/31/08) %X Time (for example 23:13:48) %Y Year (for example 2009) %z Numeric time zone (for example -4000) %Z Alphabetic time zone abbreviation (for example EDT) %% % 4.7. CHANNEL SETTINGS – UPLOAD The Upload tab provides for automatic upload of archives to a streaming server using File Transfer Protocol (FTP) or Secure File Transfer Protocol (SFTP). Automatic upload transfers archives automatically at a scheduled time (or immediately after creating the archive). NCast Corporation Revision 2.2 Page 62 NCast Telepresenter Reference Manual The system marks an archive for automatic upload right after it was created if auto upload is enabled. If auto upload is disabled archives are not marked and will be not uploaded even when auto upload is later enabled. Archives marked for automatic upload will not start uploading when a session is active. The automatic upload mark is preserved after system shutdown or reboot. Manual upload is available from the "Archives" tab, where a user may choose to upload one archive or all archives. Selected archive(s) will be marked for manual upload. Manual upload is executed immediately and can start when a session is active. The system will upload archives marked for manual upload before archives marked for automatic upload. The manual upload mark is not preserved after system shutdown or reboot. When the archive is being uploaded to the FTP server its transfer progress is shown on “Archives" tab. Secure FTP (SFTP) is supported with password and private key authorization. It will first try to use private key and if it fails password authorization is used. Only SSH-2 protocol is supported. The private key should be in Open SSH's SSH-2 format or PuTTY's SSH-2 format or ssh.com's SSH-2 format and can't be password protected. Secure retrieval of files is also possible through use of the HTTPS SSL encrypted interface, utilizing either the standard web page or the scripts documented in Section 9.3 on the HTTP interface. 4.7.1. Configuration The following parameters related to FTP transfer are available: • Auto upload - enable/disable automatic upload • Start auto upload - schedules automatic upload. It will start immediately after capture or in the selected 2 hour time window (i.e. “After 18:00” means upload after 6:00 p.m., not after an 18 hour delay) • Remove after upload - remove the archive after uploading it to the server • Protocol – selects insecure (FTP) or secure (SFTP) protocol to use • (S)FTP server - IP address or name of the FTP server • (S)FTP port - FTP server port number NCast Corporation Revision 2.2 Page 63 NCast Telepresenter Reference Manual • (S)FTP username - FTP server username • (S)FTP password - FTP server password • FTP anonymous login - login as anonymous (username & password are not used) • (S)FTP upload directory - directory where to upload archives, which may be absolute or relative • Private key to upload – SSH2 secure key for use with the SFTP protocol 4.7.2. (S)FTP Upload Directory – Special Parameter The (S)FTP upload directory name may include special codes (%n, %t) which will modify the directory name based on the Channel number or Transcode variable. For example, if the FTP upload directory path is written as: m4/Class-%n/archives then for files completing a Channel 1 session the effective upload directory will be m4/Class-001/archives and for files completing a Channel 2 session the effective upload directory will be m4/Class-002/archives This provides for automatic placement of uploaded files into directories based on the channel number which was used for recording. Changing directories based on Channel number or Transcode variable may help ease the administration of many incoming files being recorded and uploaded by a single Telepresenter. Directory based access rights (as implemented on the N-Way server) will automatically restrict viewers rights to the directory/channel for which they are entitled. 4.7.3. Connection Test The Telepresenter will try to connect to the (S)FTP server and list contents of the upload directory. It uses the current configuration of all parameters. 4.7.4. Multiple Upload Locations. 4.8. CHANNEL SETTINGS – NOTIFICATIONS The Telepresenter has an extensive system of notifications by e-mail for routine and extraordinary events related to Channel operation. Events can be informational, like “Archive uploaded” or “Recording Started Normally”, or they can be error reports such as “Recording Start Failed - Disk Full” or “Archive Upload Failed”. See Section 3.10. for information on how to setup system-wide error notifications. 4.8.1. Channel N Settings - Notifications Each Channel provides for entry of an e-mail to be associated with that Channel. Channels are often used in conjunction with specific presenters or Departments, so the person or Department most closely associated with the operation of that Channel will be informed of any normal or unusual events. A typical use would be NCast Corporation Revision 2.2 Page 64 NCast Telepresenter Reference Manual to inform a presenter or lecturer that the recordings and transcodes have completed and are available on the VOD server. See Section 3.10. for detailed information on the entries required for this page. 4.8.2. Channel N Settings – Notification Events A subset of all system-wide events is available for Channel-specific notifications. A system-wide event would report the start of ANY Session, whereas a Channel-specific event would only report the start of activity on Channel N. See Section 3.10.11. for additional information on use of this menu. NCast Corporation Revision 2.2 Page 65 NCast Telepresenter Reference Manual 5. Archive Page 5.1. ARCHIVE SETTINGS The Telepresenter units with archive disks allow complete recording of audio and graphics streams onto a hard-drive for later retrieval and playback. The estimate for recording time is a simple calculation based on the bit-rate set for the channel. Take the bit rate set for the channel in use and divide by eight to get the bytes/second of archive space needed. Multiply by 3600 to get the bytes required per hour. So for a 5 Mbps stream (graphics plus audio) we estimate 625,000 bytes/second or 2.25 GB per hour. If we use a 50 GB archive disk that's about 22.2 hours of recording. The disk size in the unit is noted at the beginning Archive page. The resolution and framerate of a channel aren't as important as the max bit-rate set for operation. Recording times may be slightly longer than the above calculation would suggest because the actual bit-rate generated during operation varies with the material being encoded, and the calculation above should represent worst-case conditions. Archive files are named with time-stamp information indicating the start time of the archive: yyyymmdd-hhmmss-nnn.mp4 where yyyy Year of archive mm Month of archive dd Day of archive hh Hour of archive mm Minute of archive ss Second of archive nnn Channel number .mp4 File format, MPEG-4 The default archive filename may be changed (See Section 4.3 above). If the archive time is not correct, check the hardware clock settings in the BIOS during hardware bootup, check the Time-zone field settings on the Unit Options page, check for correct DNS entries on the network page, and finally, determine if any network firewall is blocking access to the time-servers configured in the Telepresenter. The final processing of an archive file occurs when a Session has ended. If a Session is active an archive file may be in an incomplete state listed as “Captured” or “Processing”. After pressing the “End Session” button all archive files will be finished and converted into a “Ready” state. NCast Corporation Revision 2.2 Page 66 NCast Telepresenter Reference Manual Note that during recording two separate files (one video, one audio) are being created and at the end of recording these two files must be multiplexed into a single .mp4 file. This multiplexing is not permitted during active Sessions. At the end of a Session the Archive page will show a status of “Processing” for files, which are in the process of being multiplexed. When the status becomes “Ready” the archived file is ready for download. 5.1.1. Play Button Plays the archived file on the locally attached display. Session activity is stopped. 5.1.2. Download Button Downloads the archived file to the operator’s PC. 5.1.3. About Button This button allows downloading or viewing of the associated xml file. This information is available in XML format for use by other applications: <?xml version="1.0" encoding="UTF-8"?> <archive version=”1.0”> <filename>20071119-143215-001.mp4</filename> <title>Weekly update</title> <presenter>The CEO</presenter> <description>The CEO’s weekly discussion on the state of the company</description> <unit>Telepresenter Room 209</unit> <channel>Streaming 1</channel> <start>2007-11-19 14:32:15</start> <duration>00:30:09</duration> <timezone>-0800</timezone> <width>1024</width> <height>768</height> <aspect_width>4</aspect_width> <aspect_height>3</aspect_height> <main_window>0,0,1024,768</main_window> <pip_window>0,0,240,180</pip_window> <bitrate>768</bitrate> <framerate>30</framerate> <video_format>h264</video_format> <audio_format>aac</audio_format> NCast Corporation Revision 2.2 Page 67 NCast Telepresenter Reference Manual </archive> The use of XML format allows the content to be encoded in the Unicode (UTF-8) character set. The <main_window> and <pip_window> tags record the position of these windows at the start of a session. This information may be useful for downstream video editing processes which wish to extract video or graphics details from these windows. The “video_format” types currently supported are “mpeg4” and “h264”. There is currently only one audio format available, “aac”. 5.1.4. Details Button Along with every archive file an associated text file (in XML format) is kept with additional information about the archive. The Details button allows entry of “Title”, “Presenter” and “Description” comments into this file. These entries may be made during the presentation or afterwards. 5.1.5. Remove Button Places the archive file into the Trash. Files may be recovered from the Trash Can if they have not yet been automatically deleted by the system during recording operations which require more disk space. 5.1.6. Upload Clicking on this button marks this archive file for immediate upload (via FTP or Secure FTP) to the configured FTP server (see Section 4.7 for details on (S)FTP server setup). The upload is executed immediately and can start when a Session is active. Immediate upload may interfere with ongoing Session streaming, and should be used cautiously or not at all if network bandwidth is not available to support both streaming and file transfer.. 5.1.7. Remove All Archives This action places all archive files into the system Trash Can. 5.1.8. Upload All Archives Clicking this button marks all archive files for immediate upload and initiates a file transfer to the configured (S)FTP server(s). Immediate upload may interfere with ongoing Session streaming, and should be used cautiously or not at all if network bandwidth is not available to support both streaming and file transfer. See Section 5.1.6. above for additional details. 5.1.9. Open Trash Files which have been removed are placed into the system Trash Can. If a file was removed or deleted in error, opening the Trash Can permits recovery of the file, provided the file was not permanently deleted in the quest for more recording space. At the start of recording the system reserves a fixed percent (currently 5%) of the disk for new recordings. If the recording consumes all free space, more archive files in the Trash Can will be permanently deleted until the disk becomes completely full. 5.1.10. Record Only Sessions It is possible to disable multicasting of a Session in a record-only situation by using a special multicast address in the Channel Table. To disable multicasting set all multicast addresses to “127.0.0.1”. NCast Corporation Revision 2.2 Page 68 NCast Telepresenter Reference Manual 5.1.11. Editing Archive Files There are several tools which have been used to edit and manipulate MPEG-4 archive files: Quicktime Pro, Adobe After Effects and Streamclip. There may be, and probably are, other tools as well, but these are known to work. The words "video editing" means different things to different people. Common tasks related to manipulating archive files would include these different activities: • Reducing resolution and reducing the frame rate to downsize the file to smaller formats and smaller bit rates so lower power PCs can successfully play them back. • Cleaning up a file by removing unneeded material at the beginning, end or in the middle of a file. • Converting archive files to another format (e.g. conversion to RealMedia or WindowsMedia formats). • More complex editing tasks such as adding titles, inserting other video sequences or material that was not in the original presentation, selectively adding or deleting sequences or scenes from the original file, rearranging the order of the presentation, adding fancier transitions or wipes, and technical work such as fixing color balance. • Creation of DVDs, VCR tapes, CDs etc. from the original material. Obviously this could be a long list and the above items are only representative. The nature of MPEG-4 files (one keyframe - I frame followed by many differential frames - P, B frames) is hard for a video editor to deal with directly. Any type of more complex edit would require conversion of the archive files to an I-frame only format (Motion JPEG or DV format, for example) where differential frame interpolation is no longer required. Quicktime Pro, an inexpensive add-on to Quicktime player for both MACs and Windows, is suitable for taking the original files and exporting them to a variety of other formats for further editing or simple playback in the new format. It is not a video editor and should be used just for straight export of the original files to the new format. Adobe After Effects (available on PCs and MACs) is a high powered, full-featured video editor, which is very popular with professional videographers and which can do almost any video editing or rendering task known to man. It is, however, expensive in both cost and time-to-learn. This package can import the archive files directly. Squared 5 MPEG Streamclip is an application for editing Telepresenter MPEG-4 files, setting In/Out points, and converting to different formats such as AVI and DV. The archive files are at the ultra-high-end in terms of resolution and frame rate, and that processing times for these files are not trivial, with rendering times often being 3 to 7 times real-time (one minute of material may take three minutes to export, for example). A high-powered PC is absolutely essential, with something like a 3 GHz. Pentium with 1.5 GB of RAM being the required hardware. A 1 GHz laptop with 256 MB of memory will not do the job. Customers should carefully assess what their target audience requirements are, and make recordings in reduced resolution or reduced frame rates if a lot of down-conversion is contemplated. Keeping everything at the highest resolution and highest frame rates will be very costly in terms of video-editing post processing. NCast Corporation Revision 2.2 Page 69 NCast Telepresenter Reference Manual 6. Sources Page 6.1. SOURCES SETTINGS The Sources Page controls what graphics/video or audio inputs will be sent to the compression engines. 6.1.1. Main input The user may select one of the following graphics/video sources for capture as the primary image: Graphics/Video Input VGA RGB analog signals from the 15-pin VGA connector DVI Digital RGB signals from the DVI connector S-Video (Y/C) NTSC or PAL video from the auxiliary S-video pin connector Composite NTSC or PAL video from the composite (BNC) connector The DVI input is compatible with the DVI-D 1.0 specification and the VESA DCC/EDID 1.3 specification. Analog input on the DVI cable is not supported. The required interface cable is a DVI-D (Single Link). A DVID (Dual Link) cable is also acceptable. The following cables will not connect: DVI-I (Single Link), DVI-I (Dual Link) and DVI-A. NCast Corporation Revision 2.2 Page 70 NCast Telepresenter Reference Manual If Autodetect is selected the hardware will search for an active signal from one of the input connectors. If more than one signal is present, then the first one detected will be utilized. The Swap button is used during Picture-in-Picture (PIP) setups. The Main and PIP inputs will be exchanged when the button is toggled. For example, if a video PIP was overlaying a graphics (XGA) background, pressing the Swap button will result in a graphics PIP overlaying a video scene. 6.1.2. PIP input The user may select a graphics or video source for capture as the secondary image, which may be positioned inside of and thus overlay the Main image (picture-in-picture, PIP) or the secondary image may be placed adjacent to and outside the Main image (picture-out-of-picture, POP, side-by-side). The following table shows Main/PIP combinations which are available: MAIN \\ PIP XGA DVI S-VIDEO COMPOSITE XGA Duplicate Yes Yes Yes DVI Yes Duplicate Yes Yes S-VIDEO Yes Yes Duplicate No Composite Yes Yes No Duplicate In the above table, “Yes” implies that the PIP arrangement is normal and would be used during a capture session. “Duplicate” implies that the Main image and the PIP image are identical, and this arrangement could be used, but would probably not be useful. The “No” entries are present because the Composite and S-video channels are not completely independent inputs. The hardware has only one video decoder, and only Composite or S-video may be selected as the video feed. Thus there is no way to have an S-video as a PIP on a Composite signal, or to have a Composite signal as a PIP on an S-video signal. 6.1.3. PIP graphics This button enables or disables PIP on-screen images. The Border On/Off control applies a thin border line on the inside edge of the PIP window. The settings of these buttons are OVERWRITTEN during Session start. 6.1.4. Graphics position These buttons control fine positioning of the Graphics image (VGA input connector only). The image will move a few pixels to the left, right, up or down when these buttons are activated. The Auto button attempts to center the image properly on the screen. 6.1.5. Image Overlays Enables or disables display of uploaded graphical overlay 1-4. Overlay graphics are initialized from the Channel Table and after Session start may be uploaded from the Custom page. The settings of these buttons are OVERWRITTEN during Session start. 6.1.6. Text Overlays Enables or disables display of text overlay 1-4. Text overlays are initialized from the Channel Table and after Session start may be changed though use of serial commands or via the Custom page. The settings of these buttons are OVERWRITTEN during Session start. 6.1.7. Audio input There are two audio input connectors on the chassis, line (high-level) and microphone (low-level). This control selects the primary audio input source. If recording in Mono, make sure the active audio is available on the LEFT channel. 6.1.8. Audio Meter NCast Corporation Revision 2.2 Page 71 NCast Telepresenter Reference Manual When the Audio Meter pushbutton is on, two pairs of audio meters appear on the local loopback display connected to the Telepresenter. The audio meter window is never transmitted over the network nor recorded as part of the media stream. The stereo meters on the left show local audio activity originating from the microphone or line-level inputs. The stereo meters on the right show network activity, that is, strength of the audio derived from the incoming media stream in full-duplex or collaboration mode. The local meters are useful to check for proper connectivity and activity of the sound system connected to the Telepresenter. The levels should be checked for proper range, and gains should be changed if the audio is too hot or soft. The Audio Meter positioning controls (Top-left, Top-right, Bottom-left, Bottom-right) allow the meter display to be set in an area of the screen that does not obscure other important windows (like the PIP window, for example). 6.1.9. Main Window The placement of the Main window may be altered after Session start with this menu selection. Custom Windows 1-10 are defined on the Custom page under the Configuration Tab. The position of this window is OVERWRITTEN during Session start using values from the Channel Table. 6.1.10. PIP Window The placement of the PIP window may be altered after Session start with this menu selection. Custom Windows 1-10 are defined on the Custom page under the Configuration Tab. The position of this window is OVERWRITTEN during Session start using values from the Channel Table. 6.1.11. Audio Microphone Gain The audio microphone gain adjusts the signal level from the microphone to the input of the AC’97 codec. A reference signal of –40.0 dBu ( 7.75 mV RMS) will produce maximum sample values when the Mic Gain is set to a value of approximately 90. If this is considered the internal 0.0 dB signal reference, the chart shows gain adjustments for different values of Mic Gain. 6.1.12. Audio Line-In Gain The audio line-in gain adjusts the signal level from the line-in connector to the input of the AC’97 codec. A reference signal of 0.0 dBu (0.775 V RMS) on the line-in connector will produce maximum sample values with the line-in gain set to approximately 40. If this is considered the internal 0.0 dB signal reference, the chart shows gain adjustments for different values of Line-in Gain. If recording in Mono, make sure the active audio is available on the LEFT channel. 6.1.13. Audio Output Gain The audio output gain adjusts the signal level from the AC’97 codec to the line-out connector. This signal powers the local speakers (after suitable amplification) and delivers the audio media stream to the audience. For a 0.0 dB reference signal (maximum sample values) the measured output levels in dBu are shown in the chart. 6.1.14. Audio Loopback Gain Allows input audio to be looped back to the output connector. The normal use of this loopback is for confidence checking of the input audio on a control monitor or speaker. If input microphones are able to pickup this output signal, serious feedback loops (whine) will result. Setting this value to non-zero where speakers and microphones are in the same space is not recommended. NCast Corporation Revision 2.2 Page 72 NCast Telepresenter Reference Manual Audio Gain Charts Mic Gain Amplification Line-in Gain Amplification Output Gain Output Level 0 Mute 0 Mute 0 Mute 10 -18.0 10 -6.0 dB 10 -37.3 dBu 20 -16.5 20 -4.5 dB 20 -33.2 dBu 30 -13.5 30 -1.5 dB 30 -28.8 dBu 40 -12.0 40 0.0 dB 40 -24.9 dBu 50 -9.0 50 3.0 dB 50 -19.3 dBu 60 -7.5 60 4.5 dB 60 -14.9 dBu 70 -4.5 70 7.5 dB 70 -10.7 dBu 80 -3.0 80 9.0 dB 80 -6.3 dBu 90 0 90 12.0 dB 90 -1.9 dBu 100 1.5 100 13.5 dB 100 2.6 dBu 6.1.15. USB (XLR) Audio Input and Output The USB Matchbox from Henry Engineering () is a highperformance, ultra-low-noise audio interface which supports industry standard balanced XLR connectors for line-level audio input and output. Microphone input is not supported. Using an input device such as this both improves audio quality and allows easier audio cable interface with professional sound systems. The system detects an attached USB Matchbox on boot (hot-plug is not supported). If the USB device is present a new option "Audio Device" is added to the "Sources" tab. The user can switch between the internal AC97 and USB audio codec at any time. The audio device will be changed immediately. When the user selects the USB device, audio samples are captured and played back using the USB interface. In this configuration some audio settings will disappear from the "Sources" tab: audio input, audio mic-gain and audio line-in gain. The audio output gain setting is shared between the two devices. 6.1.16. Video Adjustments - Brightness, Contrast, Saturation, Hue, Sharpness These values allow fine tuning of image brightness, contrast, saturation, hue and sharpness. The following table shows the allowable ranges of adjustment: NCast Corporation Control Range Brightness 0-100 Contrast 0-100 Saturation 0-100 Hue 0-100 Sharpness 0-44 Revision 2.2 Page 73 NCast Telepresenter Reference Manual For each Control there are four adjustments for the four different inputs: XGA, DVI, Composite and S-Video. There is no Sharpness control for XGA or DVI, as this control applies to the video inputs only. 6.1.17. Video Preview This button launches a new web page with a single-frame capture of the composite image currently being encoded and compressed. Provides an excellent confidence check of the video and graphics capture in progress without the need for an attached local output display. Can be used to check on the current frame grab of the Telepresenter from a remote site. NCast Corporation Revision 2.2 Page 74 NCast Telepresenter Reference Manual 7. Information Pages Reference 7.1. SESSION PAGE The Session Page summarizes the current operational state of the Telepresenter. The bulk of the information listed here comes directly from the Channel Table parameters. When a Session is started, the Channel in use is queried and all addresses, ports and other controls listed for the Channel are activated. If one of the parameters looks incorrect, check the corresponding Channel entry to verify if the entry had been made correctly. The Session Page also shows if the Session is currently active, and the state of archiving. Buttons on the page allow the operator to stop and start a Session, and to start, pause and stop archiving. In addition to this static information, at the very bottom of the page (every web page, not just the Session page) there are four fields of information listed that are dynamically updated on a regular basis. Note: Interlaced video sources will be reported at their field rate and resolution rather than the frame rate. So NTSC video will be reported as [email protected] rather than 720x480. NCast Corporation Revision 2.2 Page 75 NCast Telepresenter Reference Manual 7.2. VIEWERS PAGE The Viewers Page lists units that are currently on-line and active in this Session. This information is derived from RTCP (Real-time Control Protocol) reports and from information obtained through use of the NCast Conference Protocol. The descriptive information comes from entries made in each unit’s Unit Options page. Desktop streaming media players which issue RTCP reports will also be listed on this page. NCast Corporation Revision 2.2 Page 76 NCast Telepresenter Reference Manual In Collaboration Mode the Coordinator is able to select which participant has floor control by highlighting a Viewer and clicking on the selection. 7.3. VIEW PAGE The View Page allows users at their desktops or laptops to launch client media players, which will receive and decode the media streams for playback to the user. NCast Corporation Revision 2.2 Page 77 NCast Telepresenter Reference Manual Access controls on the “Passwords” page may be used to restrict viewing to selected users or groups. For small organizations and departments this page will be sufficient for most uses. However, for larger organizations or for universities the functions of this page should probably be duplicated on the streaming media pages of the organization’s website. A discussion of how to achieve this is beyond the scope of this manual. The various links on this page are used to launch client applications on the desktop. In each case the link causes a small control file to be downloaded, and this control file is passed to the appropriate client player. The control file provides the client player with all the information required to find or request the media stream(s) and to decode the information contained therein. Four different types of files are dynamically created by the links: File Name File Type rtp_fullscreen_live.qtl Quicktime RTP Fullscreen rtsp_fullscreen_live.qtl Quicktime RTSP Fullscreen rtp_live.qtl Quicktime RTP in a Window rtsp_live.qtl Quicktime RTSP in a Window rtp_fullscreen_live.ram Real Player RTP Fullscreen rtsp_fullscreen_live.ram Real Player RTSP iFullscreen rtp_live.ram Real Player RTP in a Window rtsp_live.ram Real Player RTSP in a Window rtp_live.asx Windows RTP Playback rtsp_live.asx Windows RTSP Playback live.sdp Session Description Protocol File In all cases these files contain parameters such as the address of the RTSP server, media stream types, multicast groups, etc. To view samples of these files, right-click and “Save Target As …” to a directory on your desktop. The graphics, overlays and PIP video are in one media stream, inseparable. The file extension will determine which media player to launch. Each web browser keeps a list of file extensions and the appropriate application to process a file with that extension. The most generic of these files, the SDP file, might be associated with any number of different players on different operating systems. The sequence of events for getting a successful playback with an SDP file works like this: 1. At installation the client player informs the web browser that “If you see an SDP file, launch me and pass the file information to me”. 2. On the web page, when the playback link is clicked, the browser sends a request to the server to retrieve the requested SDP file. 3. The server, upon receiving this request, dynamically generates an SDP file based on the current channel and media parameters in use. This SDP file is returned to the browser. 4. When the browser get the SDP file requested it launches the application currently associated with the “SDP” extension. This application must be the client media player. NCast Corporation Revision 2.2 Page 78 NCast Telepresenter Reference Manual 5. The browser passes the file information to the application by giving the application the filename or the location of the file. 6. The application (the client media player) reads the contents of the SDP file and determines how many media streams must be requested, what types of audio/video codecs are required to process the media, and what type of connection (multicast, RTSP) is required. 7. When all the appropriate components have been loaded, the client player opens up the Internet connections required to play the media streams, and starts buffering media for playback. 8. After a few seconds of initial buffering the viewer sees the media playback. 7.4. VLC MEDIA PLAYER A popular cross-platform media player with low latency is called “VLC” (Video Lan Client). There are several ways to launch VLC for use with a Telepresenter: 1. Associate the file extension “.sdp” with the VLC application. Under Windows this can be done using: My Documents Tools Folder Options and associating a .sdp extension with the vlc.exe application. 2. Download (Right click and Save as …) the .sdp file, and then drag it onto the VLC client. This method works only for multicast connectivity. 3. For an RTSP connection, use File Open Network Stream RTSP and enter the proper RTSP URL: rtsp://telepresenter.ncast.com/live.sdp 7.5. MEDIA PLAYERS The MPEG-4 format used by the Telepresenters is an industry-wide standardized format which multiple client players support. NCast Corporation Revision 2.2 Page 79 NCast Telepresenter Reference Manual For PCs with properly configured software the playback process will be quick and easy. However, if a customer is having difficulty, common problems to check include: The client player has not been installed or is not at the latest revision level. A codec required for playback has not been installed. Windows Media Player does not natively support MPEG-4 files and needs a plug-in to be installed to properly decode Telepresenter streams. Contact NCast Corporation for details concerning availability of its MPEG-4 plug-in. Some other application has associated with one of the above file extensions. Firewalls (either in the laptop/desktop or externally) are blocking access to the required RTSP or UDP ports. The network being used is not multicast enabled and multicast connectivity is being requested. The network path between the client and the server is bottlenecked and unable to sustain the packet flow required for smooth, continuous playback. Wireless links, very commonly, do not have the throughput required for media streaming. The machine does not have enough processing power or memory to sustain continuous playback. Some modern PC have a “power-saving” mode, and there have been instances where the machine goes into power-save mode during playback, crippling the capacity of the machine. Other activities in the machine (including hidden spyware or Trojans) are consuming so much CPU time that the media player is unable to get the processing cycles required for correct playback. Even some active web pages can consume nearly 100% of the CPU. The audio devices set for the media player have not been configured correctly. The audio has been muted. 7.6. CLOSED-CAPTION SUPPORT Section 508 of the Rehabilitation Act of 1973, is an amendment to a law requiring that electronic and IT technology provided by agencies of the Federal Government be accessible to both employees with disabilities and to members of the public with disabilities. The Section 508 requirement has been adopted by a growing number of university and university systems, including all California State University colleges.1 Video and/or multimedia products also fall under the standard, by including requirements for captioning of multimedia products such as training or informal multimedia productions. Captioning, or video descriptors must be able to be turned on or off.2 NCast’s Telepresenter product lines fall under the category of video and/or multimedia products, and are thus required to implement closed captioning for appropriate compliance. 7.6.1. Real-time sub-titles and chapters There does not appear to be a single, widely adopted standard for recording timed-event information for use either in sub-titles or chaptering. Some client players use various forms of .txt files and others use .xml files. The Telepresenter implementation has adopted one format which is simple to use and has some existing support in the open-source community and works with several players. The format is an ".srt" text file type which is described here: New serial commands have been added to receive text information and automatically create ".srt" files during a recording. These files will be: • Available on the Archives page for download 1 2 NCast Corporation Revision 2.2 Page 80 NCast Telepresenter Reference Manual • Available for download via our http interface • Uploaded automatically via the FTP upload service Upon receipt of this file a program can easily extract the timing information of interest and create a web page with playback start points of interest. For example, Quicktime uses the "STARTTIME" parameter: <embed src="sample.mp4" width="320" height="240" starttime="00:15:22.5"> After recording is finished and there is at least one subtitle, an .srt subtitle file is created which can be downloaded from the web-page or HTTP interface. The .srt format is very simple, this example has two subtitles: 1 00:00:20,000 --> 00:00:24,400 Subtitle 1 2 00:00:24,600 --> 00:00:27,800 Subtitle 2 The NCast Telepresenters support real-time caption or sub-title capture through use of serial commands which define timings and durations of sub-title text. See the Telepresenter Serial Interface Reference Manual for complete details. 7.6.2. Sub-titles using Quicktime and SMIL Receivers/Decoders of the stream, whether using a desktop player (QuickTime, Windows Media Player, etc.) or a Telepresenter system, must have the ability to turn on/off the captioning features; thus the term “closed”. Unfortunately, there is no fully standardized mechanism for captioning across these technologies. Each media player handles captions differently. QuickTime does not currently support industry standard closed caption such as ISMA. QuickTime currently supports closed captioning by including a text track alongside audio and video content. QuickTime currently supports two main methods of introducing captions, through .QT.TXT and .SMIL files. This URL provides an overview of the QuickTime text track: The following sample .smil file launches a QuickTime player with a closed-caption text area: <?xml version="1.0" encoding="UTF-8"?> <smil xmlns: <head> <meta name="title" content="NCast Telepresenter M3 Commercial"/> <meta name="author" content="VP Sales"/> <meta name="copyright" content="NCast Corporation 2007"/> <layout> <root-layout <region id="videoregion" left="5" height="240" width="320" top="5" backgroundcolor="black"/> <region id="textregion" left="5" height="40" width="320" top="245" backgroundcolor="black"/> </layout> </head> <body> <par dur="0:03:14.10"> <video region="videoregion" src="rtsp://" dur="0:03:14.10"/> <textstream region="textregion" src="" dur="0:03:14.10"/> </par> </body> NCast Corporation Revision 2.2 Page 81 NCast Telepresenter Reference Manual </smil> The .txt file used to play back the captions is shown here: {QTtext}{timescale:100}{font:Arial}{size:12}{backColor:0,0,0} {textColor:65535,65535,65535}{width:320}{justify:left} [00:00:02.69] Have you ever wanted to communicate with someone face-to-face? [00:00:05.28] To show them something, maybe a presentation or brochure? [00:00:08.44] But they were far away. [00:00:10.00] You could call them, but audio alone is not enough. [00:00:13.00] You could video-conference, [00:00:15.00] but that lacks graphics and only works for small audiences. [00:00:18.07] You could get on a plane, or you could telepresent. [00:00:21.38] Introducing the NCast Telepresenter M3, [00:00:24.07] the easy and affordable way to present when your audience is not present. [00:00:27.98] [00:00:33.46] The Telepresenter M3 is an all-in-one multimedia production appliance. 7.6.3. Captioning software MAGpie 1.0 can be used to export the captions to three multimedia formats: SAMI, RealText Apple's Timed Text and SMIL (which can also be used by Apple and Real). Magpie 2.02 is the newest version, and adds functionality for Flash, and can play NCast’s MPEG-4 media files. The tool can be found here: World Caption is a program written by a University of Wisconsin staff member and is distributed free. See:. System Requirements: World Caption requires Mac OS X version 10.4 or later. NCast Corporation Revision 2.2 Page 82 NCast Telepresenter Reference Manual 8. Custom Layouts 8.1. FRAME LAYOUTS AND PRESETS The main Frame of a Telepresenter composition consists of the following elements: • The Main Window • The PIP Window (optional) • Graphical Overlays (1-4) • Text Overlays (1-4) • Black Matte Background The size and arrangement of all of these elements is completely under the user's control and may be changed on a Channel-by-Channel basis. This example shows how to setup a Channel for one custom layout 8.1.1. Custom Settings Example For a distance learning application the client wishes to transmit a 640x480 graphics capture of the presentation, a 240x180 video shot of the instructor, and a University logo with a copyright statement. The proposed composite image should look like this: To create this composite the following steps are required: 1. Go to the Configuration Tab and select the Custom Settings page. 2. Click on Frame sizes and in the “Frame size 1” fields enter 880 and 480, which are the dimensions of the width and height of the desired media stream. Update the change. 3. Go Back and click on Aspect ratios. In the “Aspect ratio 1” fields enter 11 and 6 (or 88 and 48) to define an aspect ratio appropriate for this image. Update the change. 4. Go Back and click on Windows. In the “Window 1” fields enter 0, 0, 640, 480 to define Window 1 as the window which will be associated with the Main graphics image. NCast Corporation Revision 2.2 Page 83 NCast Telepresenter Reference Manual 5. In the “Window 2” fields enter 640, 0, 240, 180 to define Window 2 as the window which will associated with the PIP video stream. Update the change. 6. Go to the Channel Table and click “Modify” on the Channel which will be used for this custom layout. Click on the Layout tab. Select “Frame size 1”, “Aspect ratio 1”, “Window 1” and Window 2” in their respective menus. Check the PIP checkbox and Update the change. 7. Click on the Image Overlays tab. In the “Overlay 1” fields enter 640, 180 to define the upper-left corner of the overlay. Change the right-hand field to “Enabled”. Update the change. 8. In the “Overlay 1 to upload” field use the “Browse …” button to find the required .jpg or .png image and then upload the image. This image must have dimensions of 240x300 to properly fit in the capture window. 9. On the Sources page make these selections and press “Update”: a. Main input: XGA (or possibly DVI) b. PIP input: Composite (or possibly S-Video) The Telepresenter is now ready to transmit the composite image as defined in this example. 8.1.2. Hi-Definition 720p Layout Example For archival purposes or for playback on hi-definition 16:9 screens the following example gives the dimensions of a 720p layout that NCast and its customers have used successfully to capture conference proceedings and other seminars. The capture window used is WXGA at 1280x720 resolution and 16:9 aspect ratio. The Main graphics window occupies an area of 960x720 (Custom Window 1) and the PIP video window is set to 320x240 (Custom Window 2). In this example the Graphic Overlay 1 .png image is 320x480 and is located at (0,240). For a graphics framerate of 30 frames/second a bitrate of 2.5 Mbps produces excellent results. The Channel Table Layout parameters required to produce this frame arrangement is shown below: NCast Corporation Revision 2.2 Page 84 NCast Telepresenter Reference Manual 8.1.3. Overlay Layout Placement Conference rooms or presentation auditoriums typically have the speaker’s podium to the right or left of the projection screen being viewed by the audience. A potential problem in using the PIP video window or speaker shot as a side-by-side layout is to position the window in the wrong spatial relationship to the screen being discussed by the presenter. If the podium is to the right of the projection screen (as viewed from the audience) the following layout shows the correct positioning for the PIP window: If the podium is to the left of the projection screen (as viewed from the audience) the following layout shows the correct positioning for the PIP window: NCast Corporation Revision 2.2 Page 85 NCast Telepresenter Reference Manual The point being made here is that in planning for a conference or seminar recording, rooms may have a podium right or podium left configuration and the overlay graphics which are created must be able to accommodate right-side or left-side speaker placements (the speakers naturally look at the projected graphics while presenting). Here is an example of a mismatched left-right alignment: 8.1.4. Customer Layout Examples NCast customers and associates have created some outstanding examples of graphically interesting and aesthetically pleasing layouts using this overlay facility. The following are some examples of captures done from live conferences: NCast Corporation Revision 2.2 Page 86 NCast Telepresenter Reference Manual HASTAC Conference, courtesy of Duke University TeraGrid Conference, courtesy of UCSD Virtual Teams Conference, courtesy of Media-X HP Historical Presentation NCast Corporation Revision 2.2 Page 87 NCast Telepresenter Reference Manual 9. Telepresenter Interfaces 9.1. SERIAL INTERFACE Commands to control the Telepresenter over an RS-232 style serial interface are documented in the Telepresenter Serial Interface Specification. Please refer to that document for complete details. 9.2. TELNET INTERFACE Commands to control the Telepresenter over an IP network interface using industry standard Telnet protocol are documented in the Telepresenter Serial Interface Specification. Please refer to that document for complete details. NCast offers several example programs which allow operation of the Telepresenter using the Telnet Interface. One such program is called the “Telepresenter Management System” and there is a version written in Java and Python. See the “Download” area of the NCast web site. An example of the interface implemented by TMS is shown here: For simple operations such as starting and stopping a Telepresenter from a controlling system, simple scripts will be adequate. For example, to start a Telepresenter here is a sample script: #!/bin/bash # # Starts Telepresenter session using telnet interface if [ $# -ne 3 ]; then echo "This script starts a Telepresenter session using the telnet interface." echo "Synopsis: start.sh address password channel" exit fi ADDRESS=$1 PASSWORD=$2 CHANNEL=$3 ( echo "IdTelnet,002,$PASSWORD" sleep 1 echo "C$3" sleep 1 echo "QT" sleep 1 ) | telnet $ADDRESS 7474 >& /dev/null Stopping a session utilizes this script: NCast Corporation Revision 2.2 Page 88 NCast Telepresenter Reference Manual #!/bin/bash # # Stops a Telepresenter session using the telnet interface if [ $# -ne 2 ]; then echo "This script stops a Telepresenter session using the telnet interface." echo "Synopsis: stop.sh address password" exit fi ADDRESS=$1 PASSWORD=$2 ( echo "IdTelnet,002,$PASSWORD" sleep 1 echo "PE" sleep 1 echo "QT" sleep 1 ) | telnet $ADDRESS 7474 >& /dev/null 9.3. HTTP INTERFACE – ARCHIVE DOWNLOAD Special HTTP commands are available to enable automatic or script downloading of archive files: Downloads a list of READY archive files Downloads an archive file Downloads an archive xml file Removes an archived file where file.mp4 The time-stamped archive filename obtained from the downloaded list (also .wmv or .ogg) file.xml The time-stamped xml file associated with an archive file. Note that archive operations are username/password protected and this information must be supplied to utilize these special URLs. The required username is “backup”. The password is entered on the Configuration → Passwords web page (“HTTP API” entry). Removed files are immediately deleted, and not stored in the trash can. A comprehensive sample retrieval script follows: #! /bin/tcsh # # # # # Usage: m4files.tcsh host password delete host - the hostname or IP address of the M4 unit password - backup password for the unit delete - optional keyword to delete archived files after download set m4ip = $1 set passwd = $2 set deleteoption = $3 set verbosity = --quiet #set verbosity = --non-verbose #set verbosity = --verbose if ($m4ip == "") then echo "m4files: M4 Host address or IP address missing" echo "Usage: m4files.tcsh host password" exit endif NCast Corporation Revision 2.2 Page 89 NCast Telepresenter Reference Manual if ($passwd == "") then echo "m4files: M4 password required" echo "Usage: m4files.tcsh host password" exit 1 endif # Get list of current archive files if (-e m4-filelist) then rm -f m4-filelist endif wget $verbosity --output-document=m4-filelist --http-user=backup --http-passwd=$passwd http:// $m4ip/backup/list.cgi if ($status != 0) then echo "m4files: Error in accessing archive" exit 1 endif if (! -e m4-filelist) then echo "m4files: Failed to retrieve archive file list" exit 1 endif if (-z m4-filelist) then echo "m4files: No archive files in list" exit 1 endif # Process all files in the list that was downloaded foreach mp4 (`cat m4-filelist`) # Get the media file echo "m4files: Retrieving media file $mp4" wget $verbosity --timestamping --http-user=backup --http-passwd=$passwd http:// $m4ip/backup/download/$mp4 if ($status != 0) then echo "m4files: Error in accessing media file $mp4" exit 1 endif # Get the associated xml description file set xml = $mp4:r.xml echo "m4files: Retrieving xml file $xml" wget $verbosity --timestamping --http-user=backup --http-passwd=$passwd http:// $m4ip/backup/download/$xml if ($status != 0) then echo "m4files: Error in accessing xml file $xml" exit 1 endif # Delete the file if it was downloaded and if the delete option was set (argument 3 == "delete") if ($deleteoption == "delete" && -e $mp4 && -s $mp4) then echo "m4files: Deleting archive file $mp4" wget $verbosity --http-user=backup --http-passwd=$passwd --output-document=$mp4:r.msg http:// $m4ip/backup/remove.cgi\?file=$mp4 if ($status != 0) then echo "m4files: Error in deleting media file $mp4" exit 1 NCast Corporation Revision 2.2 Page 90 NCast Telepresenter Reference Manual endif echo "m4files: returned result is: `cat $mp4:r.msg`" rm -f $mp4:r.msg endif end rm -f m4-filelist The Python programming language is a widely available, cross-platform programming language available for Windows, Macs, Linux and other platforms. The following is a sample Python program for downloading archive files: #! /usr/bin/python """ ncfiles.py -- A Python program to download NCast archive files This program allows downloading of archive files from one or more Telepresenters. It requires installation and use of the Python programming language. The most recent versions of the language may be installed by visiting "" and downloading the correct binaries for Windows, Linux, Macs or other platforms. All archive files are downloaded into the directory where the program was started. Sample usage: ncfiles.py ncfiles.py ncfiles.py ncfiles.py telepresenter.ncast.com -r telepresenter.ncast.com 192.168.0.5 192.168.0.6 -p adam telepresenter.ncast.com Download Download Download Download all files from a single host all files and then remove them from multiple hosts using password "adam" Complete specification: ncfiles.py -d -f hostfile -h -p password -r -v --debug --file=hostfile --help --pswd=password --remove --version host host1 host2 ... where -d, -f, -h, -p, -r, -v, --debug --file=hostfile --help --pswd=password --remove --version host ... Turn debug statements on Use a list of hosts from a file (see below) Print usage information Use "password" Remove archive file from the host after download Report program version One or more hosts to download from The list of hosts is a text file (e.g. created with Notepad) that contains a list of hosts to download from and optionally password information: # This is a sample host file # Optional password line for supplying a password pswd=adam # Hosts to download from 192.168.0.5 telepresenter.ncast.com NCast Corporation Revision 2.2 Page 91 NCast Telepresenter Reference Manual my.other.boxes.com To run this program under Windows you may use a command line, such as: C:> "C:\Program Files\Python24\python.exe" ncfiles.py 192.168.0.5 A simpler alternative is to create a shortcut to "ncfiles.py" and then using the Properties tab for the shortcut enter the required arguments: "C:\Documents and Settings\owner\My Documents\Python\ncfiles.py" 192.168.0.5 Please send comments or questions to "[email protected]". Copyright (2005) NCast Corporation All rights reserved """ import import import import import import import import sys os, os.path time getopt string urllib urllib2 socket def Download(host, user, pswd, realm, remove): # Create an OpenerDirector with support for Basic HTTP Authentication... auth_handler = urllib2.HTTPBasicAuthHandler() auth_handler.add_password(realm, host, user, pswd) opener = urllib2.build_opener(auth_handler) # ...and install it globally so it can be used with urlopen. urllib2.install_opener(opener) # Get list of files to download url = "http://" + host + "/backup/list.cgi" try: filelist = # Process the list of files to download files = [] for line in filelist.read().split("\n"): file = line.strip(' \n\r') if file == "": break NCast Corporation Revision 2.2 Page 92 NCast Telepresenter Reference Manual files.append(file) filelist.close() if debug: print "ncfiles: Download list", files if len(files) == 0: print "ncfiles: No files to download" return True # Download each file for mp4 in files: url = "http://" + host + "/backup/download/" + mp4, "wb") while True: try: bytes = filein.read(1024000) fileout.write(bytes) except IOError, (errno, strerror): print "ncfiles: I/O error(%s): %s" % (errno, strerror) sys.exit(2) if bytes == "": break filein.close() fileout.close() # Download the detail xml file associated with the mp4 file url = "http://" + host + "/backup/download/" + mp4[:-4] + ".xml" if debug:[:-4] + ".xml", "w") bytes = filein.read() fileout.write(bytes) NCast Corporation Revision 2.2 Page 93 NCast Telepresenter Reference Manual filein.close() fileout.close() # Remove file if requested if remove: url = "http://" + host + "/backup/remove.cgi?file=" + mp4 if debug: print "ncfiles: Removing", url try: filerm = filerm.close() return True # Main Program ------------------------------------------------------hostlist = [] debug = False inputfile = None user = "backup" pswd = "ncast" realm = "NCast M3" remove = False def Usage(): print "Usage: ncfiles.py -d -f hostfile -h -p password -r -v --debug --file=hostfile --help --pswd=password --remove --version host host1 host2 ..." try: options, args = getopt.getopt(sys.argv[1:], 'df:hp:rv:', ['debug', 'file=', 'help', 'pswd=', 'remove', 'version']) except getopt.GetoptError: Usage() sys.exit(2) for o, a in options: if o in ("-d", "--debug"): debug = True if o in ("-h", "--help"): Usage() sys.exit() if o in ("-p", "--pswd"): pswd = a if o in ("-r", "--remove"): remove = True if o in ("-v", "--version"): print "ncfiles.py Version 1.0" sys.exit() if o in ("-f", "--file"): inputfile = a NCast Corporation Revision 2.2 Page 94 NCast Telepresenter Reference Manual hostlist.extend(args) if inputfile : try: f = open(inputfile, 'r') for line in f: host = line.strip(' \n\r') if host == "": continue if host[0] == '#': continue if host[0:4] == 'pswd': pswd = host[5:] continue print "ncfiles: Adding host", host, "to list of hosts" hostlist.append(host) f.close() except IOError, (errno, strerror): print "ncfiles I/O error(%s): %s" % (errno, strerror) sys.exit(1) if len(hostlist) == 0 : print "ncfiles: No hosts listed for download" sys.exit(1) else: print "ncfiles: Downloading from these hosts:", hostlist for host in hostlist: if remove: removetext = "and removing files" else: removetext = "and keeping files" print "ncfiles: Downloading from host", host, removetext result = Download(host, user, pswd, realm, remove) if not result: print "ncfiles: Download error on host", host print "ncfiles: Download complete" 9.4. HTTP INTERFACE – IMAGE AND THUMBNAIL CAPTURE The HTTP Interface may be used to capture single images from the encoder. Commonly employed utilities such as “wget” can retrieve the current composite frame for placement of the image on a web page or elsewhere. Here is an example of the single command line needed (without the required user/password): wget -O capture.jpg All required capture parameters like format, frame size and quality are supplied as arguments in the URL. You can override all capture parameters, for example: wget -O capture.png These parameters are supported: format - jpg or png width - 128 to 1920 height - 128 to 1200 NCast Corporation Revision 2.2 Page 95 NCast Telepresenter Reference Manual quality - jpeg quality 0 to 100 compression_level - png compression level 0 to 9 With no parameters the default settings are format=jpg, quality=85, and the width and height will match the current settings of the session frame size. The interface is password protected, so each “wget” must include a username and password as two additional arguments. The required username is “api” and the password is set on the Configuration → Passwords page at the “HTTP API” entry: wget --http-user=api --http-passwd=passwd 9.5. HTTP INTERFACE – GRAPHICS OVERLAY UPLOAD Overlay graphics used in presentations may be uploaded dynamically through use of an upload utility program. When used in conjunction with a scheduler or serial interface command controller this leads to a powerful method to configure all aspects of a Telepresenter for a given Session. It allows custom templates to be changed on an hourly basis, for example. A single command line using a widely available utility is enough to upload a single graphic: curl -u api:ncast -F "[email protected]" The following program is an example of a Python utility which may be used to upload multiple new graphics images on command (check the NCast website for the latest version of this program): #!/usr/bin/env python ''' Tool to upload graphical overlays to an NCast Telepresenter. Rewritten version by Matt Eastman Updated by H. S. Magnuski Usage: ncgo.py <options> <host> -d, -h, -p, -v, -1, -2, -3, -4, ''' --debug --help --pswd=password --version --g1 --g2 --g3 --g4 Turn debug statements on (not used) Print usage information Use "password" Report program version Overlay graphic 1 Overlay graphic 2 Overlay graphic 3 Overlay graphic 4 __author__ = 'Matt Eastman <[email protected]>' __version__ = '2.1 (meastman rewrite, updated)' import import import import import import import getopt mimetools mimetypes os sys urllib urllib2 def main(): debug = False username = 'api' NCast Corporation Revision 2.2 Page 96 NCast Telepresenter Reference Manual password = 'ncast' images = {} try: getopt_func = getopt.gnu_getopt except AttributeError: getopt_func = getopt.getopt shortopts = 'dhp:v1:2:3:4:' longopts = ('debug', 'help', 'pswd=', 'version', 'g1=', 'g2=', 'g3=', 'g4=') try: opts, args = getopt_func(sys.argv[1:], shortopts, longopts) except getopt.GetoptError, e: print >>sys.stderr, 'Error: %s' % str(e) print >>sys.stderr usage(sys.stderr) sys.exit(1) for optname, optvalue in opts: if optname in ('-d', '--debug'): debug = True elif optname in ('-h', '--help'): usage(sys.stdout) sys.exit(0) elif optname in ('-p', '--pswd'): password = optvalue elif optname in ('-v', '--version'): print __version__ sys.exit(0) elif optname in ('-1', '-2', '-3', '-4', '--g1', '--g2', '--g3', '--g4'): imgnum = int(optname[-1]) if not os.path.exists(optvalue): raise Exception('Invalid image file', optvalue) images[imgnum] = optvalue else: raise Exception('BUG: should have caught %s but didn\'t' % `optname`) if not images: print >>sys.stderr, 'Error: no images specified' print >>sys.stderr usage(sys.stderr) sys.exit(1) if not args: print >>sys.stderr, 'Error: no server specified' print >>sys.stderr usage(sys.stderr) sys.exit(1) server = args[0] upload(server, username, password, images) def usage(stream): stream.write(__doc__) def upload(server, username, password, filenames): # build payload print 'ncgo: building payload' fields = {} for key, filename in filenames.items(): fields['overlay_%d_file' % key] = { 'filename': os.path.basename(filename), 'value': file(filename).read(), 'content-type': get_content_type(filename), } NCast Corporation Revision 2.2 Page 97 NCast Telepresenter Reference Manual content_type, data = encode_multipart_formdata(fields) # upload print 'ncgo: uploading image(s)' url = '' % server # Create an OpenerDirector with support for Basic HTTP Authentication... auth_handler = urllib2.HTTPBasicAuthHandler() auth_handler.add_password(realm='NCast Telepresenter', uri=url, user=username, passwd=password) opener = urllib2.build_opener(auth_handler) # ...and install it globally so it can be used with urlopen. urllib2.install_opener(opener) request = urllib2.Request(url, data) request.add_header('Content-Type', content_type) try: response = urllib2.urlopen(request) except urllib2.HTTPError, msg: print "ncgo: Urllib2 HTTP Error (%s)" % msg sys.exit(1) except socket.error, (errno, strerror): print "ncgo: Socket error (%s) for host %s (%s)" % (errno, host, strerror) sys.exit(1) print 'ncgo: finished' def encode_multipart_formdata(fields): boundary = mimetools.choose_boundary() lines = [] for key in fields: if isinstance(fields[key], dict): entry = fields[key] else: entry = {'value': fields[key]} lines.append('--' + boundary) if 'filename' in entry: lines.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, entry['filename'])) else: lines.append('Content-Disposition: form-data; name="%s"' % key) if 'content-type' in entry: lines.append('Content-Type: %s' % entry['content-type']) lines.append('') lines.append(entry['value']) lines.append('--' + boundary + '--') lines.append('') body = '\r\n'.join(lines) content_type = 'multipart/form-data; boundary=%s' % boundary return (content_type, body) def get_content_type(filename): type = mimetypes.guess_type(filename)[0] if type is None: type = 'application/octet-stream' return type if __name__ == '__main__': main() NCast Corporation Revision 2.2 Page 98 NCast Telepresenter Reference Manual 10. Techniques for Presentation Capture 10.1. WEBCASTING, PODCASTING AND ARCHIVING The new world of webcasting meetings and conferences, recording presentations and running effective distance learning operations requires some thought, planning, and understanding of the objectives to be met for the operation. This section discusses common problems in making an excellent presentation capture, based on the experience of doing a number of live meeting and conferences. Hopefully, the tips and techniques discussed here will aid in avoiding common problems. 10.1.1. Objectives for the Webcast or Recording Creating a quality, professional recording is not trivial, and requires cooperation from the organization hosting the meeting. It should be well understood in advance what the ground rules for the recording of the meeting will be: 1. The live meeting is paramount, the recording will be done on a best effort basis. 2. The needs of the live meeting and the recording should be balanced. 3. The recording/webcasting is most important, and the live audience is there for the ride. Achieving balance is not difficult and the needs of the webcaster/recorder can be accommodated without much extra effort. The paragraphs below offer specific tips on how to achieve this balance. Another objective that needs definition is the intended audience for the recording: 1. Distribution to a wide audience – If the captured visualizations need to be seen by a wide audience with a variety of connecting bandwidths and PC playback capabilities, then the bandwidth used must be limited (i.e. typically less than 750 kbps) and the resolution and frame rate must be restricted (i.e. 800x600 or less and a target framerate of 15-20 frames per second). If these limits are not observed, viewers will see various artifacts (pixelation, stuttering, loss of lip-sync) that lead to a negative experience. The principal causes of these artifacts are packet loss (due to overloading of the internet connection) and processing capability (the receiving PC does not have enough CPU capacity to process high-resolution, high frame-rate imagery). 2. Distribution to a local audience – If transmission is only on a local campus or high-speed network, then bandwidth is not an issue and can be set as needed. There remains the issue of the processing capabilities of the receiving devices. 3. Archiving only – If the recording will not be transmitted as is, but needs to be transcoded into other formats during post-production, then the highest bandwidth and highest resolution settings available should be used. Finally, the speaker or presenters need to know that a webcast/recording will occur, and this may require a written release from the speaker giving authority to capture and distribute the material. Speakers may have many different reasons for not wanting a webcast of their material (e.g. a webcast of some research material may be considered a “publication” by some and they wish to reserve first publication rights for a specific journal or the speaker may be using copyrighted video, audio or text in the presentation which may not be freely distributed). Doing a recording and finding after-the-fact that it may not be released is a waste of everybody’s time. These details need to be worked out and agreed to in advance, and not two minutes before the presentation. 10.2. CAPTURING GRAPHICS, VIDEO AND AUDIO The following paragraphs outline common problems in recording a typical conference or presentation. 10.2.1. Capturing Graphics The output of the presenter’s laptop needs to go to two places: the room projector and the Telepresenter. Many conference rooms are currently not capable of this two-way split. It’s a really good idea to check out NCast Corporation Revision 2.2 Page 99 NCast Telepresenter Reference Manual the A/V equipment in the room the day before the recording, if possible, or to consult with the A/V staff to plan how these video, graphics and audio connections will be made. There are several ways to solve this problem: • VGA Splitter – A VGA splitter is a small distribution amplifier which accepts a VGA signal as input and provides two or more VGA signals as output. The VGA splitter plus two extra cables is all that’s required. One cable (a short one, one or two meters in length) connects the output of the presentation PC to the splitter. The other cable (a long one, 25 meters or more) connects the output of the splitter to the input capture card of the Telepresenter. A long cable is required as the Telepresenter recording table/station is frequently in the back of the room (where there is a power connection and where the technician can operate the video camera). The projector plugs into the second output of the splitter. Test all the cable connections ahead of time to insure correct mating, or bring along enough gender-changer adapters to accommodate misconnections. • Projector Loopback Output – Some projectors have a loopback output connector, and that is a suitable place for the Telepresenter to capture the graphics signal. • Telepresenter Loopback Output – The room projector can be plugged into the loopback output of the Telepresenter. • Matrix switcher – Some A/V setups have an XGA matrix switcher as part of the room installation, and the Telepresenter could plug into one of the output connectors on that device. 10.2.2. Capturing Video The video signal for PIP or side-by-side video is usually easy to obtain. Most cameras have Composite or Svideo output connectors available, and only an appropriate cable is required to connect to the Telepresenter. • Make sure that the camera’s video output does not have time/date stamps, battery icons or other clutter on the signal being captured. There are usually menu options to turn these information icons off. • Arrange with the conference staff to have one or two spotlights on the podium. Often the room lights will go dark so the audience can see the projection screen, and if there is no lighting on the speaker, the video quality deteriorates rapidly. Ask the speakers to not wander from the lighted podium area. • A dark background behind the speaker leads to visually pleasing results. White screens, white tablets or signs behind the podium will lead to backlighting of the speaker, causing the exposure level on the speaker to go dark. Remove any unneeded visual clutter behind the podium. Ask the conference staff for a black curtain or sheet behind podium if there are whiteboards or bright white surfaces there. • Speakers often like to stand directly in front of the projection screen while making a point. This leads to horrible backlight problems for the camera and a terrible recording. Ask speakers not to stand in front of the screen. The screen should not be anywhere in the framing of a video shot. • Keep the video shots “tight” on the speaker. The PIP format reduces the size, and it’s best to have as large a headshot as possible. Video of half the room is neither visually pleasing nor does it convey the karma of the speaker. • Mount the camera on a high tripod. Waiters, latecomers and other traffic right in front of the camera is very distracting to the video recording. • Speakers invariably move around, and it is unrealistic to not have an operator full-time on the camera, unless there is some sort of automatic tracking device being used. 10.2.3. Capturing Sound Quality sound recording is probably one of the most important requirements for a decent presentation capture. Viewers will find the presentation incomprehensible if the audio is soft, distorted or noisy. This is especially true if there are non-native language speakers or listeners. Clean audio can be achieved by following these steps: NCast Corporation Revision 2.2 Page 100 NCast Telepresenter Reference Manual • Lavalier Microphone – The best audio capture is through use of wireless lavalier (lapel) microphone on the speaker. Including one in the Telepresenter gadget bag is a really good idea. The levels will be consistently correct (through experience), and the results will be predictable. • House Audio – If the conference staff is setting up audio, ask for a feed from their mixer. It is usually easy to get a balanced or unbalanced feed (if asked for in advance). A balanced feed going into a small mixer (e.g. a Mackie 12-channel or similar) which then plugs (unbalanced) into the Telepresenter is an excellent solution. The operator can instantly adjust and check levels. The Telepresenter has an option for external connections to balanced audio. • Audio Meter – Use the Audio Meter on the local loopback display to confirm correct level into the Telepresenter. Audio peaks should be 2/3 to ¾ high on the meter. • Listen to the webcast/archive – Do an audio pre-check and listen to the final recorded audio from the Telepresenter. Make sure the levels are correct and that noise, hum or other problems are eliminated. • Audience Microphones – If the audience will be interacting and asking questions, arrange for wired or wireless audience microphones, and insist on their use. A long dead silence during an audience question followed by a speaker response to a question the remote viewers did not hear is very frustrating. Ask the speakers or chairperson to always repeat or summarize the audience question. • Panel Microphones – If there will be a panel discussion, insure that a suitable number of microphones for the panel discussion is available. 10.2.4. Automatic Recording A Telepresenter Channel can be setup to automatically start recording when a Session is started. This is probably the best solution for guaranteeing that the recording will happen. 10.2.5. Graphics and Video Swap Usually during conferences there are periods when no active or meaningful graphics are being displayed (e.g. during Q&A sessions, panel commentaries, introductions). Be prepared to swap the video and graphics windows during these times. The Swap button on the Sources web page will do this easily. 10.3. CONFERENCE DAY PROBLEMS AND ISSUES During the actual conference or seminar, these problems and issues may occur: 10.3.1. The Podium The Telepresenter screen-capture composition has a natural podium-left or podium-right orientation. If the exact room layout is not known in advance, two composition setups will need to be ready for use, and the operator will need to know how to setup a left or right arrangement. Speakers naturally look at the projection screen while they are talking, so using a right-hand setup for a lefthand podium gives unnatural looking results and should be avoided. Most of the graphics used will probably be symmetrical and so the re-arrangement will not be difficult, but must be planned for in advance. 10.3.2. The Conference Chairperson The meeting Chairperson or Master of Ceremonies (MC) needs to be informed that a webcast/recording is happening and that there are certain things he/she can do to assist in a quality recording: • Clean Breaks - The MC should arrange to have a clean introduction to each new speaker or topic (i.e. Power-point all setup and ready to go, no fumbling around trying to find and start the next slide show) and a clean break at the end so that recording can stop and video tapes can be changed, overlay graphics updated and recording restarted. In many cases the MC starts introducing the next speaker while the previous speaker’s graphics are still being projected. The speaker is given the podium while his/her computer is being connected and the desired graphics being discussed are not present. Viewing this later in a recorded archive looks very unprofessional and sloppy. With just a little care the MC can make some interesting comments on the previous speaker or can make small NCast Corporation Revision 2.2 Page 101 NCast Telepresenter Reference Manual talk or tell a story while this speaker transition is occurring. It is hard to capture clean recordings when one presentation runs right into the next one. • Session Length – If the cameras are recording a backup copy of the sound and video (which is a really good idea) the MC must know that MiniDV tapes only record for an hour (or some other length of time) and need to be changed at some point. • Discrete Units – The webcast file recording should be broken up into discrete units by topic or speaker so that the file lengths remain manageable and viewers can download or view only the material of interest. A continuous three or four hour conference recording is very difficult to manage or post-process. The MC must plan for some breaks. • Speaker Order – If the MC plans on changing the order of speakers or presentations, the recording crew needs to be informed so that the proper sequence of overlay graphics can be readjusted. 10.3.3. The Conference Speakers If possible, the recording crew should talk to the speaker(s) prior to their presentation and make the following points: • Use a microphone – Even if the room audience can hear the speaker well, non-use of a microphone can be a disaster for the webcast or recording. The proper microphone must be on and functioning, period. • Stay near the podium – The speaker should stay near the lighted area of the podium and not wander up and down the front of the room. • Don’t stand in front of the projection screen – Talking in front of the projection screen leads to video backlighting problems and should be avoided. • Start of Talk – Ideally, the presenter’s discussion should start once the proper graphics are being projected, and no sooner. • Repeat the Question – If there are audience questions or comments, the speaker should repeat them or summarize them for the viewing audience. 10.3.4. The Conference Audience The conference audience should be informed that a webcast/recording is underway and that a few rules need to be applied: • Audience microphones – The audience needs to use the audience microphones any time a question or comment is being given. The MC and/or speaker needs to help enforce this directive. • Public audience – Comments provided by the audience are being recorded and archived so that any type of inappropriate comment, personal attack, sexist joke, or other outburst should be avoided. 10.3.5. Summary Fixing these problems in post-production is very time-consuming and expensive and recompression degrades the quality of the captured material. With these relatively minor changes and help from the organizers and the MC and perhaps a little training for the speakers the recordings will be captured well and become great historical archives worthy of the effort. 10.4. VIDEO POST-PRODUCTION If there is a need to do some minor editing on an archive file, there are tools which can clip and trim the archive file without recompression of the material. 10.4.1. Streamclip One such tool is a free utility called “Streamclip”. This program may be obtained at the following website: NCast Corporation Revision 2.2 Page 102 NCast Telepresenter Reference Manual To use Streamclip to trim a file, follow these steps: Open the .mp4 file to be trimmed Drag the slider to the starting sequence of your new clip and select the “In” point where the new clip should start Align the “In” point to the nearest key frame. This is required to eliminate pixelation and picture breakup at the start of the new clip. If that key frame is unacceptable as a starting point, move the slider backward or forward until a usable key frame is found. NCast Corporation Revision 2.2 Page 103 NCast Telepresenter Reference Manual Drag the slider to the end of the new clip and select an “Out” point where the new clip ends Save the file as a new .mp4 file. You should override the “.mov” suggested suffix with “.mp4”. If this file will be used on a streaming server, the “hint” tracks must be added to the file. NCast Corporation Revision 2.2 Page 104 NCast Telepresenter Reference Manual 11. References 11.1. MPEG COMPRESSION ISO 14496-12 - ISO base media file format ISO 14496-14 - MP4 file format 11.2. PACKET TRANSMISSION IETF RFC 3550 “RTP: A Transport Protocol for Real-Time Applications”, H. Schulzrinne, et. al., July 2003 IETF RFC 3551 “RTP Profile for Audio and Video Conferences with Minimal Control”, H. Schulzrinne, et. al., July 2003 IETF RFC 3016 “RTP Payload Format for MPEG-4 Audio/Visual Streams ”, Y. Kikuchi, et. al., November 2000 IETF RFC 3640 “RTP Payload Format for Transport of MPEG-4 Elementary Streams ”, J. van der Meer, et. al., November 2003 IETF RFC 2326 “Real Time Streaming Protocol (RTSP)”, H. Schulzrinne, et. al., April 1998 IETF RFC 2327 “SDP: Session Description Protocol”, M. Handley, et. al., April 1998 11.3. MULTICAST IETF RFC 1112 “Host Extensions for IP Multicasting”, S. Deering, August 1989 IETF RFC 3171 “IANA Guidelines for IPv4 Multicast Address Assignments” , Z. Albanna, et. al., August 2001 IETF RFC 3180 “GLOP Addressing in 233/8”, D. Meyer, et. al., September 2001 IETF RFC 3138 “Extended Assignments in 233/8”, D. Meyer, June 2001 IETF RFC 2365 “Administratively Scoped IP Multicast”, D. Meyer, July 1998 IETF RFC 2327 “SDP: Session Description Protocol”, M. Handley, et. al., April 1998 NCast Corporation Revision 2.2 Page 105 NCast Telepresenter Reference Manual 12. Revision History • Revision 2.2 – Revision for changes in Release 5.2. A new Event Notification System with emailed notices and warnings. Transcoding to Theora. DVI output support. Local archive playback and an Archive trash can implementation. Video preview windows and thumbnails. A new HTTP API with additional commands for image grabs. Realplayer launch option on the View page. New event and serial logs with a logs download command. New option for MP4 hint tracks and optimized MP4 layout. Padding option in text overlays. Local audio loopback added. Backup password changed to HTTP API password. Changes in the Viewers tab layout. Coordinator can remove and edit archives. Recordings can be stopped and paused in Auto mode, and the default is now “Manual”. Optimization of Viewers list and keyframe forcing to increase maximum Viewers count. Custom time server option. • Revision 2.1 – Revision for changes in Release 5.1. The Channel Table adds (S)FTP Upload configurations. The Announce function now becomes a Type of Channel activity. A new Configuration tab for Logs is available. Custom window settings are available on the Sources page. • Revision 2.0 – Major revision for changes in the Release 5.0 architecture. The Channel Table becomes comprehensive in its ability to control all setup information needed for a Session. Many changes related to this enhancement of the Channel Table. Save and restore functionality added. H.264 support added. • Revision 1.10 – Updates for Release 4.2. New facilities for automatic transcoding to H.264. Support for SFTP file upload. Improved support for wide-screen displays and alternate timings, with or without supporting EDID information. Serial command changes for display modes. Additional support for sub-title events and Chaptering. Increased Overlay storage space. Overlay buttons on the Sources page. Additional tags in the XML file for format description. CIDR notation added to the Telnet IP restriction field. CE Compliance information. Additional closed caption program pointer. • Revision 1.9 – Documentation changes for PIP border, audio meter position, advanced channel options and Channel page layout. A new “Description” field on the archive Details and Channels page and the corresponding <description> tag in the XML file. Other additions to the XML file. • Revision 1.8 – M3S2 software version change to 4.0.x release numbers. • Revision 1.7 – Updates for Release 1.0.4. Archive filename formatting options. FTP upload filename formatting options. Additions to the XML archive file. Audio meter IP address. • Revision 1.6 – Updates for Telepresenter Series 2. Documentation on the Scheduler interface. Remove reference section on external scheduler program. New section on techniques for presentation capture. Added a section on startup. • Revision 1.5 – Updates for software Release 3.1.0. Two new configuration tabs are introduced: an FTP page for ftp “push” operations and an Announce tab for automatic use of .sdp files by a streaming server. A new network configuration file has been introduced. Optional support for network time servers. New examples of Closed Caption support. Balanced line-level XLR support via an external USB interface. Telepresenter scheduling. Graphics overlay upload from a command script. • Revision 1.4 – FCC and CE compliance language added to the text. • Revision 1.3 – Updated for Release 3.0 with description of higher resolutions and PIP. • Revision 1.2 – Added additional information on the DVI interface. • Revision 1.1 – Updates required for changes introduced in Release 2.8. The web interface has new “Passwords” and “Web Control” tabs. There is a change in options on the “Display” page. An NCast Corporation Revision 2.2 Page 106 NCast Telepresenter Reference Manual “Auto-start” option is now available for a Channel. The Archive detail files now support Unicode and are in XML format. The .txt files are no longer available. • Revision 1.0 – Initial revision based on software Release 2.7.4. NCast Corporation Revision 2.2 Page 107 * Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
https://manualzz.com/doc/26273964/telepresenter-m4-reference-manual
CC-MAIN-2020-45
refinedweb
31,959
55.03
Borislav Hadzhiev Last updated: Jul 11, 2022 To divide each element in a list by a number: my_list = [8, 12, 20] # ✅ divide each element in list by number new_list = [item / 2 for item in my_list] print(new_list) # 👉️ [4.0, 6.0, 10.0] # -------------------------------------- # ✅ divide each element in list by number using floor division new_list_2 = [item // 2 for item in my_list] print(new_list_2) # 👉️ [4, 6, 10] We used a list comprehension to iterate over the list and divide each list item by 2. On each iteration, we divide the current list item by the specified number and return the result. If you need to divide each element in a list by a number without a remainder, use the floor division // operator. my_list = [8, 12, 20] new_list_2 = [item // 2 for item in my_list] print(new_list_2) # 👉️ [4, 6, 10] Division / of integers yields a float, while floor division // of integers results in an integer. The result of using the floor division operator is that of a mathematical division with the floor() function applied to the result. my_num = 60 print(my_num / 10) # 👉️ 6.0 (float) print(my_num // 10) # 👉️ 6 (int) Using floor division is like applying the math.floor method to the result. The method returns the largest integer less than or equal to the provided number. import math result_1 = math.floor(25 / 4) print(result_1) # 👉️ 6 result_2 = 25 / 4 print(result_2) # 👉️ 6.25 Alternatively, you can use a for loop. To divide each element in a list by a number: forloop to iterate over the original list. my_list = [20, 30, 60] new_list = [] for item in my_list: new_list.append(item / 2) print(new_list) # 👉️ [10.0, 15.0, 30.0] forloop works in a very similar way to the list comprehension, but instead of returning the list items directly, we append them to a new list. You can also use the map() function to divide each element in a list by a number. my_list = [20, 30, 60] new_list = list(map(lambda item: item / 2, my_list)) print(new_list) # 👉️ [10.0, 15.0, 30.0] The map() function takes a function and an iterable as arguments and calls the function with each item of the iterable. mapgets called with each item in the list, divides the item by 2and returns the result. The last step is to use the list() class to convert the map object to a list. You can divide each element in a numpy array by a number by using the division operator. import numpy as np arr = np.array([10, 25, 35, 66]) new_arr_1 = arr / 2 print(new_arr_1) # 👉️ [ 5. 12.5 17.5 33. ] Dividing a numpy array by a number effectively divides each element in the array by the specified number. Note that this only works with numpy arrays. If you divide a Python list by a number, you'd get an error.
https://bobbyhadz.com/blog/python-divide-each-element-in-list
CC-MAIN-2022-40
refinedweb
471
72.56
Groovy multiple classLoaders I never had to worry about whether the classes loaded in our application are in the same class loader or different, until I was stuck with the weird class not found exception. We were using a third party tool (Snowbound’s DocViewer) which provided around 10 jar files, which worked well for except one functionality which was provided by 3 separate jar files that always came up with “class not found exception”. All 10 jar files were loaded the same way i.e from the artifactory or even tried adding them to the grails-app/lib folder but to no avail. After digging more into it, we found that class in question is loaded in some other classLoader, not sure the reason yet. Also found that child classLoader can find the class loaded in parent classLoader but not the vice versa. So we decided to load jars files in question, to the rootLoader but found at many places rootLoader was null so it didn’t help either. Then we decided to load the jars files into top most parent class loader, see the sample below : def classLoader = BootStrap.class.classLoader while(classLoader.parent){ //identify topmost class loader. classLoader = classLoader.parent } // find path to the jars files, which are located in web-app/jars String jarsPath = "" + grailsApplication.getParentContext().getServletContext().getRealPath("/jars") classLoader.addURL(new URL(jarsPath + '/1st.jar')); classLoader.addURL(new URL(jarsPath + '/2nd.jar')); Voilla it just worked. Hope this helped. Cheers! ~~Amit Jain~~ amit@intelligrape.com
http://www.tothenew.com/blog/groovy-multiple-classloaders/
CC-MAIN-2017-30
refinedweb
250
56.35
12 January 2011 16:42 [Source: ICIS news] TORONTO (ICIS)--?xml:namespace> The agency, Wiesbaden-based Statistisches Bundesamt, said its preliminary data for 2010 showed a 3.6% increase in GDP from 2009 – the largest increase since the country’s reunification in 1990. The recovery came after a 4.7% decline in 2009 from 2008 - Germany's sharpest recession since the Second World War. The economic recovery occurred mainly in the spring and summer of 2010, the agency said. “What was striking in 2010 was the fact that economic growth was not only based on foreign trade, but also on domestic demand,” it added. Still, as in many years before the crisis, foreign trade was a major driving force for economic growth in The German chamber of commerce (DIHK) said that given the quick recovery and sharp growth in 2010, DIHK also warned that companies were finding it increasingly difficult to hire qualified workers. In addition, Germany’s many industrial producers were struggling with material shortages and rising raw material costs, the chamber said. In 2011, raw material costs would rise further as many countries were curbing their supplies of metals, rare earths and other critical inputs, or were facing difficulties producing the raw materials, it added. Economics research institute DIW Berlin warned Germans against “exaggerated euphoria” as 2010’s growth was largely the result of a “catching-up effect” after a massive decline in 2009. In particular, export demand was likely to soften this year, said DIW economics expert Ferdinand Fichtner. Fichtner predicted Chemicals industry trade group VCI has predicted 2.5% growth in The increase in chemical production in 2011 would come after 11% growth in 2010 from 2009, and a 10% decline in 2009 from
http://www.icis.com/Articles/2011/01/12/9425411/germany-gdp-grows-3.6-in-2010-but-experts-warn-against-euphoria.html
CC-MAIN-2014-35
refinedweb
288
51.48
Hi iam just trying to install YENCAP to see how does it work , while trying to install this I was able to run yencap-2.1.11 but while trying to go for yencap-manager -2.1.11 I had a problem I installed all the rpms as are mentioned in document for manager I have installed openssl-0.9.7f-7.i386 and by default fedora release 9 already has openssl-0.9.8g-6.fc9.i686 but when i run the yencap manager using /etc/init.d/yrncap-manager start i get this error: No module named openssl in file secureHTTPserver.py at line mentioned as from OpenSSL import SSL I again checked if the openssl is installed by using rpm -q openssl it shows that fllowing are installed : openssl-0.9.7f-7.i386 openssl-0.9.8g-6.fc9.i686 can u please tell me what am i missing in all this ... and how to solve this problem
https://sourceforge.net/p/ensuite/discussion/637351/thread/7bf4d39a/
CC-MAIN-2017-04
refinedweb
162
73.88
Created on 2010-04-14 00:01 by haypo, last changed 2010-04-25 22:40 by haypo. This issue is now closed. It would be nice to support the PEP 383 (surrogateescape) for environment variables in os.execvpe(). Attached patch uses PyUnicode_AsEncodedString(val, Py_FileSystemDefaultEncoding, "surrogateescape") to encode an environment variable value. I'm not sure that PyUnicode_AsEncodedString(val, Py_FileSystemDefaultEncoding, "surrogateescape") does always return a PyBytes object. I not patched environment keys, but it might be useful. See also issue #4036. See also #8393. My patch doesn't work for types bytes and bytearray. I noticed that py3k uses surrogateescape to encode environment variable values ;-) Other notes: Environment variable *names* use also surrogateescape "encoding". os.spawnve() and os.spawnvpe() should also be patched (the code should also be factorized). New version of the patch: - factorize code between execve(), spawnve() and spawnvpe() - support also surrogates in environment variable names - support bytes and bytearray (bytearray cannot be used as a dictionary key, but my patch supports it) - remove unrelated fix (my first patch contains a fix for os.system(), also about surrogates) Because of the factorization, the error messages doesn't contain the function name anymore. spawnve() and spawnvpe() omit BEGINLIBPATH and ENDLIBPATH, as execve(): "that Would Confuse Programs if Passed On". I suppose that if execve() ignore them, spawn*e() should also ignore them. I don't have an OS/2, so I'm unable to test my patch on this OS :-/ Note: The patch fixes also subprocess to support bytes and bytearray in the environment dictionary. Current code of execve() has a bug: it uses the length of the environment variable value in *characters* and not in *bytes* to allocate the "p" buffer. I remember that someone wrote a comment somewhere about that... The result is that the environment variable value is truncated by 1 byte. Example (copy of): ----------- $ cat test.py #!/usr/bin/python # -*- coding: utf-8 -*- import os env = {"VAR": "ćd"} os.execve("test.sh", [], env) $ cat test.sh #!/bin/bash declare -p VAR $ python2.6 test.py declare -x VAR="ćd" $ python3.1 test.py declare -x VAR="ć" ----------- Commited: r80421 (py3k), blocked in 3.1 (80422). The commit fixes also os.getenv() to support bytes environment name. I.
http://bugs.python.org/issue8391
CC-MAIN-2014-49
refinedweb
372
59.3
distribute 0.6.34.34.tar.gz $ cd distribute-0.6.34 $. ======= ---------- Unreleased ---------- + `Issue #341`_: 0.6.33 fails to build under python 2 <http: bugs.jython.`_ and `#1981 <http: bugs.jython.`_. * `Issue #334`_: Provide workaround for packages that reference `sys.__stdout__` such as numpy does. This change should address `virtualenv #359 <https: github.`_ as long as the system encoding is UTF-8 or the IO encoding is specified in the environment, i.e.:: PYTHONIOENCODING=utf8 pip install numpy * Fix for encoding issue when installing from Windows executable on Python 3. * #283`_: Fix and disable scanning of `*.pyc` / `*.pyo` files on Python 3.3. ------ 0.6.27 ------ * Support current snapshots of CPython 3.3. * Distribute now recognizes README.rst as a standard, default readme file. * Exclude 'encodings' modules when removing modules from sys.modules. Workaround for #285. * `Issue #231`_: Don't fiddle with system python when used with buildout (bootstrap.py) ------ 0.6.26 ------ * `Issue #183`_: Symlinked files are now extracted from source distributions. * `Issue #227`_: Easy_install fetch parameters are now passed during the installation of a source distribution; now fulfillment of setup_requires dependencies will honor the parameters passed to easy_install. ------ 0.6.25 ------ * `Issue #258`_: Workaround a cache issue * `Issue #260`_: distribute_setup.py now accepts the --user parameter for Python 2.6 and later. * `Issue #262`_: package_index.open_with_auth no longer throws LookupError on Python 3. * `Issue #269`_: AttributeError when an exception occurs reading Manifest.in on late releases of Python. * `Issue #272`_: Prevent TypeError when namespace package names are unicode and single-install-externally-managed is used. Also fixes PIP `issue 449`_. * `Issue #273`_: Legacy script launchers now install with Python2/3 support. ------ 0.6.24 ------ * `Issue #249`_: Added options to exclude 2to3 fixers ------ 0.6.23 ------ * `Issue #244`_: Fixed a test * `Issue #243`_: Fixed a test * `Issue #239`_: Fixed a test * `Issue #240`_: Fixed a test * `Issue #241`_: Fixed a test * `Issue #237`_: Fixed a test * `Issue #238`_: easy_install now uses 64bit executable wrappers on 64bit Python * `Issue #208`_: Fixed parsed_versions, it now honors post-releases as noted in the documentation * `Issue #207`_: Windows cli and gui wrappers pass CTRL-C to child python process * `Issue #227`_: easy_install now passes its arguments to setup.py bdist_egg * `Issue #225`_: Fixed a NameError on Python 2.5, 2.4 ------ 0.6. ------ 0.6.17 ------ * Support 'DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT' environment variable to allow to disable installation of easy_install-${version} script. * Support Python >=3.1.4 and >=3.2.1. * `Issue 204`_: Don't try to import the parent of a namespace package in declare_namespace * `Issue 196`_: Tolerate responses with multiple Content-Length headers * `Issue 205`_: Sandboxing doesn't preserve working_set. Leads to setup_requires problems. ------ 0.6.16 ------ * Builds sdist gztar even on Windows (avoiding `Issue 193`_). * `Issue 192`_: Fixed metadata omitted on Windows when package_dir specified with forward-slash. * `Issue 195`_: Cython build support. * `Issue 200`_: Issues with recognizing 64-bit packages on Windows. ------ 0.6.15 ------ * Fixed typo in bdist_egg * Several issues under Python 3 has been solved. * `Issue 146`_: Fixed missing DLL files after easy_install of windows exe package. ------.12 ------ * `Issue 149`_: Fixed various failures on 2.3/2.4 ------ == 'main'" * Added the 'DONT `issue #52`_. * Added an upload_docs command to easily upload project documentation to PyPI's. This close `issue `_. * Fixed invalid bootstraping with easy_install installation (`issue `issue #10`_. --- ============ * Immediately close all file handles. This closes `issue #3`_. .. _ #336`: .. _`Issue #341`: .. _`: - Author: The fellowship of the packaging - Documentation: distribute package documentation -: jaraco, guyr, tarek - Package Index Maintainer: jaraco, guyr - DOAP record: distribute-0.6.34.xml
https://pypi.python.org/pypi/distribute/0.6.34
CC-MAIN-2016-22
refinedweb
630
61.12
Thanks emotional blind Moderator: Board moderators I don't think so.I don't think so.sclo wrote:even if v==m, the solution v is still valid. According to problem statement, v must bigger than m.According to problem statement, v must bigger than m.Given the value of m and x, you will have to find the value of the maximum income v, which is effectively (after deducting the tax) less than someone earning less than v. Code: Select all if(n<=m) puts("Not found"); Code: Select all if(n<m) puts("Not found"); sorry, you are right.sorry, you are right.emotional blind wrote:even if v==m its effective income may less then m-1, so solution v is valid as i think. Thanks, it really help meThanks, it really help meWei-Ming Chen wrote:To hi!man! For input "100 67", your code outputs 300 But I think the answer is 299 by the way, I thinkexist a problemexist a problemif(n*100%(100-x)==0) n--; Hope it helps Code: Select all #include <iostream> #include <bitset> #include <algorithm> #include <cstdio> #include <cstdlib> #include <string> #include <cstring> #include <vector> #include <map> #include <queue> #include <deque> #include <stack> #include <cctype> #include <set> #include <cmath> #include <climits> #include <sstream> #include <fstream> #include <list> #include <functional> #include <utility> #include <iomanip> #include <ctime> using namespace std; #define SZ size() #define pp push_back typedef long long LL; typedef vector <int> vi; typedef vector <double> vd; typedef vector <vi> vvi; typedef vector <string> vs; typedef pair<int,int> pii; typedef vector <LL> vll; int main () { int n,m; while (scanf("%d %d",&n,&m) != EOF) { if (!n && !m) return 0; if (m==100 || m == 0 || n == 1) { printf("Not Found\n"); continue;} double temp = (double)m/100.0; temp = 1.0-temp; temp = (n-1) / temp; int ret = (int) temp; ret++; if (ret < n) { printf("Not Found\n"); continue;} bool stat = false; while (true) { double t = (ret*((double)1-m/100.0)); //cout << ret << " " << t << "\n"; if (t < ((double)n-1) && ret >= n) { printf("%d\n",ret); stat = true; break;} ret--; if (ret < n) break; } if (!stat) printf("Not Found\n"); } return 0; } Code: Select all Remove after AC
https://onlinejudge.org/board/viewtopic.php?p=67373
CC-MAIN-2020-40
refinedweb
369
68.5
Technical Article Citrix XenApp 5.0 Implementation Tips Updated 16-Apr-2010•Originally posted on 26-Feb-2010 by naladar 10 article big-ip citrix news partner techtip v4 xenapp I recently had the pleasure of working on a Citrix 5.0 implementation and I wanted to share a few things that I learned during that setup. As many of you know, there are two deployment guides that have been made available by F5 Networks in regards to setting up Citrix Presentation Server 4.5 in TMOS versions 9.x and 10.x. They are excellent guides and the best thing about them is that you can utilize those guides to assist you in deploying Citrix XenApp 5.0, with a few exceptions of course. Those exceptions are what I will be covering in this tech tip. Both of the previously mentioned deployment guides discuss editing files on the Citrix farms Web Interface servers so that it looks for the client IP address in the X-Forwarded-For HTTP header. Otherwise, every connection will appear to be originating from the BIG-IP LTM and not from its true IP. After reading both guides and looking at my current environment I was dismayed to find that the files and locations mentioned were no longer valid. I then turned to my top three resources on the web in the search for an answer: AskF5, DevCentral and Google. I struck out on the first two (which seldom happens) but my Google search did turn up some interesting results on the Citrix Forums. I finally found some code posted by Sam Jacobs back in August 2009 that modifies the way the Citrix farm looks up the client IP address. His method allows for the use of the X-Forwarded-For header. The first file that you will want to find and edit is the Include.java file. You will want to locate and change this file on every Web Interface XenApp server in the farm. Speaking from experience, save a copy of the original file to a safe location such as your desktop or flash drive. DO NOT copy the file and rename the original to Include.old and leave it on the server. It may sound crazy, but doing that will not work. I’m not a programmer, so I cannot tell you why that will not work, but I can tell you I know for a fact it will not. That being said, here is the file path for the Include.java file: “\Inetpub\wwwroot\Citrix\XenApp\app_code\PagesJava\com\citrix\wi\pageutils\Include.java” Now that you have found the file, open it up with a text editor (I use Textpad) and find the Java routine named “getClientAddress”. Replace the code for that routine with the code listed below. public static String getClientAddress(WIContext wiContext) { String ageClientAddress = AGEUtilities.getAGEClientIPAddress(wiContext); String userIPAddress = wiContext.getWebAbstraction().getRequestHeader("X-FORWARDED-FOR"); if (userIPAddress == null) { userIPAddress = wiContext.getWebAbstraction().getUserHostAddress(); } return (ageClientAddress != null ? ageClientAddress : userIPAddress); } Save the file and wash/rinse/repeat this step on every Web Interface server in the farm. The next thing that you will want to do is to modify the login page so that it displays the client IP address being obtained from the X-Forwarded-For header. The file you will want to edit is called “loginView.ascx” and can be found in the following file path on your Web Interface Servers: ”\inetpub\wwwroot\Citrix\XenApp\app_data\include\loginView.ascx” The code you will want to add is: Client IP: <%= com.citrix.wi.pageutils.Include.getClientAddress(wiContext) %> I added the code directly below the LoginPageControl viewControl line and it works well for me. Save the file and repeat this step on every Web Interface server in the farm and reboot each Web Interface Server after you are done. That’s it! Well, you do have to complete the other setup steps listed in the deployment guide that you are using, but after that your farm will be ready for business! I am aiming to develop some custom monitors for the Web Interface Server and for the XML Broker Servers over the next few weeks. Once I have those done I will put them out in the forums for the community enjoy. -naladar 0 Ratings Log in to rate this content Print Download Share Comments on this Article Comment made 01-Mar-2010 by jlooney3 0 Hello naladar. Thanks very much for the post! I have not tried your suggestions yet but will as time permits. Looks great. -Jim 0 Comment made 10-Mar-2010 by O-Dub-F5-King 0 Thanks for your post mate! I've been hunting for this. I even asked an F5 consultant who came into the office, and it looks like they don't have the healthiest relationships with Citrix so to find code that fixes stuff, is easier said than done. So...nice one! Testing it now. 0 Comment made 10-Mar-2010 by datka1 0 We are in process of deploying WI through F5 , we are trying to assign custom monitors for the Web Interface, i would appreciate if you could post your finding on creating custom F5 monitor for WI.ThanksDavid 0 Comment made 11-Mar-2010 by hoolio F5 Nice info, naladar!If you're using the client IP parsed from the X-Forwarded-For header for anything other than reporting, it would make sense to have LTM remove any previous X-Forwarded-For instances by setting the HTTP profile option to: 'Request Header Erase: X-Forwarded-For'.Aaron 0 Comment made 17-May-2012 by JH 0 Anyone tried this with a 5.4 web interface, or xenapp 6.5?The moment I edit the include.java file and save we get a down WI.Internal ErrorThe Web site is experiencing technical difficulties. We apologize for any inconvenience.The internal error may only be temporary. Try reconnecting and, if the problem persists, contact your system administratorA restart doesn't help. There is Citrix article that is no good either. Already have a ticket open... but the first thing they pointed me to was this artice. At first I thought I might have a backed version of that file.... I didn't.The best part? You have to "repair site" to get the WI working again... not what that Citirx article says... just WI Manager, maintenance, repair site. 0 Comment made 17-May-2012 by JH 0 Update, So, if you use the include.java code in the Deployment Guide Here: luckIf you use the code in this Tip. Yatzee!C 0
https://devcentral.f5.com/articles/citrix-xenapp-50-implementation-tips
CC-MAIN-2019-04
refinedweb
1,101
65.22
The third item in my Swift Tool Belt is a couple of extensions on UILabel. These extensions will allow easy access to modify the edge insets on a label (the extra padding all around the text). There’s also an extension to add a rotation transform to a label. All of these extensions will be IBDesignable and IBInspectable for easy modification from Xcode’s Interface Builder. Rotation The first extension is pretty simple. It adds a rotation transform to a UILabel. The setter for the rotation converts the degrees into radians and then constructs a transform to rotate the label. The getter is not necessary here, so I just return zero. You could extend this extension to do more than just rotation. Any ability you have with CGAffineTransform, such as translation or scale, can be done in a similar way. import UIKit extension UILabel { @IBInspectable var rotation: Int { get { return 0 } set { let radians = CGFloat(CGFloat(Double.pi) * CGFloat(newValue) / CGFloat(180.0)) self.transform = CGAffineTransform(rotationAngle: radians) } } } I’ve added a basic label and a gray background to my storyboard so you can see the outline of the UILabel. With the extension compiled in our project, a rotation setting will show up in Interface Builder’s Attribute Inspector. However, you will not see your rotation changes take effect until we change the class of our UILabel to DesignableLabel. (See my first post in this series to get an explanation of DesignableLabel.) If we don’t change the class type, the label will still rotate at runtime–you just won’t be able to see it in your storyboard. Now, let’s set the class type of our label to DesignableLabel. At this point, you should be able to see the label rotated in the storyboard. You may notice clipping on your label text after it is rotated. Unfortunately, Interface Builder does not do a great job of rendering the rotated label, but this will not be the case at runtime. The label will not be clipped when you run your project. If you can’t see the rotated label, you may have to refresh the storyboard view in Xcode. To do this, select Editor->Refresh All Views. This is what the rotated label looks like running on the simulator. Edge Insets The next extension on UILabel is actually a combination of an extension and an override of UILabel. You cannot set edge insets on a label easily. In order to accomplish it, you have to draw the text manually. The class override will take care of the drawing, and the extension provides easy access to the edge insets in Interface Builder. I did not come up with this solution. Thanks go to Nikolai Ruhe answering this Stack Overflow question. I’ve changed the name of the class from his NRLabel, and I moved the @IBDesignable to the class vs. the extension. As I mentioned in my first post in this series, putting the attribute on an extension can be hit and miss. import UIKit // From @IBDesignable class EdgeInset = UIEdgeInsetsInsetRect(bounds, UIEdgeInsetsInsetRect(textRect, invertedInsets) } override func drawText(in rect: CGRect) { super.drawText(in: UIEdgeInsetsInsetRect(rect, textInsets)) } } extension EdgeInsetLabel { @IBInspectable var leftTextInset: CGFloat { set { textInsets.left = newValue } get { return textInsets.left } } @IBInspectable var rightTextInset: CGFloat { set { textInsets.right = newValue } get { return textInsets.right } } @IBInspectable var topTextInset: CGFloat { set { textInsets.top = newValue } get { return textInsets.top } } @IBInspectable var bottomTextInset: CGFloat { set { textInsets.bottom = newValue } get { return textInsets.bottom } } } To demonstrate the override and extension to UILabel, I’ve added a couple of labels in Xcode and changed the background so you can see the edge inset. Change the class name of your label to EdgeInsetLabel. After you change the class for your label, you will see the new attributes that we added in the extension show up in the Attributes inspector. I like this solution and use it on almost every project. Thanks again to Nikolai Ruhe. I hope you find it useful as well.
https://spin.atomicobject.com/2017/08/04/swift-extending-uilabel/
CC-MAIN-2018-13
refinedweb
663
58.18
hi UI gurus, we have a simple requirement to display certain links in a dashboard. All is good until there is invalid (un-encoded) characters involved. then if I use [[CDATA]] then Splunk simple XML takes the values as literal Below is dashboard we want to achieve <dashboard> <label>test HREF CDATA</label> <row> <html> <h1> HREF test with un-encoded characters </h1> <li>Lookup Links <ul> <li>My Lookup => <a href="../lookup_editor/owner=nobody&namespace=search&lookup=xyz.csv&type=csv">Link</a> </li> </ul> </li> </html> </row> </dashboard> Since the href is "un-encoded", this complains. When we change the <a> link as below <![CDATA[<a href="../lookup_editor/owner=nobody&namespace=search&lookup=xyz.csv&type=csv">Link</a>]]> Then splunk XML does not render href properly. What's the best way to use "href" links properly in Simple XML? PS: Even <link> don't like & in the URL as below also have same problem <link> ../lookup_editor/owner=nobody&namespace=search&lookup=xyz.csv&type=csv </link> xx how about $url|u$? <drilldown> <set token="a_link">$click.value2$</set> <eval token="url">trim(mvindex(split($a_link$,"("),1),")")</eval> <link target="_blank"> <![CDATA[ ]]></link> </drilldown> this works Got the gist of the logic. Thanks again. If you want to put as answer, will mark as "answer" but in the above, where are we passing the "token" to the link URL? If you write statically, you only have to convert this problem when writing it, right?
https://community.splunk.com/t5/Dashboards-Visualizations/Splunk-Simple-XML-Invalid-character-entry-in-XML-help-with-CDATA/td-p/480283?sort=votes
CC-MAIN-2020-40
refinedweb
246
57.67
How can i remove all characters except numbers from string? In Python 2.*, by far the fastest approach is the .translate method: >>>>> import string >>> all=string.maketrans('','') >>> nodigs=all.translate(all, string.digits) >>> x.translate(all, nodigs) '1233344554552' >>> string.maketrans makes a translation table (a string of length 256) which in this case is the same as ''.join(chr(x) for x in range(256)) (just faster to make;-). .translate applies the translation table (which here is irrelevant since all essentially means identity) AND deletes characters present in the second argument -- the key part. .translate works very differently on Unicode strings (and strings in Python 3 -- I do wish questions specified which major-release of Python is of interest!) -- not quite this simple, not quite this fast, though still quite usable. Back to 2.*, the performance difference is impressive...: $ python -mtimeit -s'import string; all=string.maketrans("", ""); nodig=all.translate(all, string.digits); x="aaa12333bb445bb54b5b52"' 'x.translate(all, nodig)' 1000000 loops, best of 3: 1.04 usec per loop $ python -mtimeit -s'import re; x="aaa12333bb445bb54b5b52"' 're.sub(r"\D", "", x)' 100000 loops, best of 3: 7.9 usec per loop Speeding things up by 7-8 times is hardly peanuts, so the translate method is well worth knowing and using. The other popular non-RE approach...: $ python -mtimeit -s'x="aaa12333bb445bb54b5b52"' '"".join(i for i in x if i.isdigit())' 100000 loops, best of 3: 11.5 usec per loop is 50% slower than RE, so the .translate approach beats it by over an order of magnitude. In Python 3, or for Unicode, you need to pass .translate a mapping (with ordinals, not characters directly, as keys) that returns None for what you want to delete. Here's a convenient way to express this for deletion of "everything but" a few characters: import string class Del: def __init__(self, keep=string.digits): self.comp = dict((ord(c),c) for c in keep) def __getitem__(self, k): return self.comp.get(k) DD = Del() x='aaa12333bb445bb54b5b52' x.translate(DD) also emits '1233344554552'. However, putting this in xx.py we have...: $ python3.1 -mtimeit -s'import re; x="aaa12333bb445bb54b5b52"' 're.sub(r"\D", "", x)' 100000 loops, best of 3: 8.43 usec per loop $ python3.1 -mtimeit -s'import xx; x="aaa12333bb445bb54b5b52"' 'x.translate(xx.DD)' 10000 loops, best of 3: 24.3 usec per loop ...which shows the performance advantage disappears, for this kind of "deletion" tasks, and becomes a performance decrease.
https://codedump.io/share/3w1ptrQHAQPM/1/python-removing-characters-except-digits-from-string
CC-MAIN-2017-39
refinedweb
412
79.46
Question State law provides that all cash not immediately needed by school districts to finance current operations be forwarded to the counties in which the school districts are located. The law also requires that county treasurers place these resources in a separate fund and invest them on behalf of the school districts. Because Contra County is experiencing financial problems and to provide resources to the county, the county treasurer tells the county administrator that he plans to invest the school district funds in “junk bonds” yielding 9 percent interest. He will credit the “normal” rate of return (5 percent) to the school districts and the remaining 4 percent to the county itself. Explain the position the county administrator should take on the treasurer’s proposal. Answer to relevant QuestionsA city ordinance provides that “no money shall be spent for any purpose without the prior approval of the city council.” In approving the budget for the year, the council had authorized spending $ 1,300,000 for road ...(Use of funds in governmental accounting) On Election Day, the citizens of a small village voted affirmatively on the following proposition: “To authorize the sale of $ 3,000,000 in bonds for the purpose of constructing a ...Compare the timing of revenue and expense (or expenditure) recognition using the accrual basis of accounting with that using the modified accrual basis of accounting. Which basis of accounting is used in each fund category?During a heated campaign for mayor of Hoschkosh, an unsuccessful candidate said: “I will do away with all the special interests in government. I will abolish all the Special Revenue Funds and merge that money with the ...What is a capital budget? Why should it be prepared for a period greater than one year? Post your question
http://www.solutioninn.com/state-law-provides-that-all-cash-not-immediately-needed-by
CC-MAIN-2017-13
refinedweb
295
51.89
I finally got my i2c servo driver from Adafruit working beautifully and I can use to control both a micro servo and a larger one. But I have several questions about automating or writing a calibration script for the various types. Goals: 1. I'd like to write a calibration script that I can run to convert degrees (0-180 for normal and I don't know what for Continuous rotation) I enter into a physical servo position for a pan/tilt system. 2. Figure out how to set-up the continuous rotation servos with this i2c chip. Hardware: 1. Servo driver 16 Channel Ada controller. 2. micro servos I can't find the frequency on the docs btw 3. 3-d printed pan tilt 4. Pi Camera Module of course :) with the video4linux drivers up and running So I wrote some initial code (below) to run the servos by providing an angle and "hoping" it goes there. Just some slight modifications of the Servo code provided by Ada (shown below). I would really love to get some feedback on how others are doing their calibration of the servos so that I can become more precise. I'm eventually going to use this system both for the pan/tilt gimbal of a quad copter and for a wheeled robot so I'd like to control by angle first and then just by clicking on an area in the field of view. I'm having some difficulty correlating angle/with position though and that's where I would like some help if possible min is: - Code: Select all setPulseDegree(15, 60, 0) max is : - Code: Select all setPulseDegree(15, 60, 320) Currently the angle input is -40 to about 300 which correlates to a physical 0 - 180. How would you calibrate this or adjust my values to work with this.: - Code: Select all def angleToms(angle): pulseAngle = float(1.0/180.0) return ((pulseAngle * angle) + 1.0) # 1ms / 180o .. you will have to add this to 1ms to get total. # so say you want 90o you do (pulseAngle * 90) + 1 def setPulseDegree(channel, freq, angle): sec = float(1000000) pulseLength = (sec / float(freq)) # period / pulse print "%.3f us per period" % pulseLength pulseLength /= totalTicks # us / tick print "%.2f us per bit" % pulseLength pulse = angleToms(angle) print "%.2f pulse for 90 angle" % pulse ticksOn = (pulse * 1000) / pulseLength print "%.2f ticksOn for 90 angle" % ticksOn pwm.setPWM(channel, 0, int(ticksOn))
http://adafruit.com/forums/viewtopic.php?f=50&t=44486
CC-MAIN-2014-15
refinedweb
406
63.29
Today I Learned This Part 2: Pretrained Neural Networks What are they? Deeplearning is the buzz word right now. I was working on the course for deep learning by Jeremy Howard and one thing I noticed were pretrained deep Neural Networks. In the first lesson he used the pretrained NN to predict on the Dogs vs Cats competition on Kaggle to achieve very good results. What are pretrained Neural Networks? So let me tell you about the background a little bit. There is a challenge that happens every year in the visual recognition community - The Imagenet Challenge. The task there is to classify the images in 1000 categories using Image training data. People train big convolutional deep learning models for this challenge. Now what does training a neural model actually mean? It just means that they learn the weights for a NN. What if we can get the weights they learn? We can use those weights to load them into our own NN model and predict on the test dataset. Right? But actually we can go further than that. We can add an extra layer on top of the NN they have prepared to classify our own dataset. In a way you can think of the intermediate features created by the Pretrained neural networks to be the features for the next layer. Why it works? We are essentially doing the image classification task only. We need to find out edges, shapes, intensities and other features from the images that are given to us. The pretrained model is already pretty good at finding these sort of features. Forget neural nets, if we plug these features into a machine learning algorithm we should be good. What we actually do here is replace the last layer of the neural network with a new prediction/output layer and train while keeping the weights for all the layers before the second last layer constant. Code: I assume that you understand Keras a little. If not you can look at the docs. Let us get into coding now. First of all we will create the architecture of the neural network the VGG Team created in 2014. Then we will load the weights. Import some stuff import numpy as np from numpy.random import random, permutation from scipy import misc, ndimage from scipy.ndimage.interpolation import zoom import keras from keras import backend as K from keras.utils.data_utils import get_file from keras.models import Sequential, Model from keras.layers.core import Flatten, Dense, Dropout, Lambda from keras.layers import Input from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D from keras.optimizers import SGD, RMSprop, Adam from keras.preprocessing import image VGG has just one type of convolutional block, and one type of fully connected (‘dense’) block. We start by defining the building blocks of our Deep learning model. def ConvBlock(layers, model, filters): for i in range(layers): model.add(ZeroPadding2D((1,1))) model.add(Convolution2D(filters, 3, 3, activation='relu')) model.add(MaxPooling2D((2,2), strides=(2,2))) def FCBlock(model): model.add(Dense(4096, activation='relu')) model.add(Dropout(0.5)) Now the input of the VGG Model was images. When the VGG model was trained in 2014, the creators subtracted the average of each of the three (R,G,B) channels first, so that the data for each channel had a mean of zero. Furthermore, their software that expected the channels to be in B,G,R order, whereas Python by default uses R,G,B. We need to preprocess our data to make these two changes, so that it is compatible with the VGG model. We also add some helper functions. #Mean of each channel as provided by VGG researchers vgg_mean = np.array([123.68, 116.779, 103.939]).reshape((3,1,1)) def vgg_preprocess(x): x = x - vgg_mean # subtract mean return x[:, ::-1] # reverse axis bgr->rgb def VGG_16(): model = Sequential() model.add(Lambda(vgg_preprocess, input_shape=(3,224,224))) ConvBlock(2, model, 64) ConvBlock(2, model, 128) ConvBlock(3, model, 256) ConvBlock(3, model, 512) ConvBlock(3, model, 512) model.add(Flatten()) FCBlock(model) FCBlock(model) model.add(Dense(1000, activation='softmax')) return model def finetune(model, num_classes): # Drop last layer model.pop() # Make all layers untrainable. i.e fix all weights for layer in model.layers: layer.trainable=False # Add a new layer which is the new output layer model.add(Dense(num_classes, activation='softmax')) model.compile(optimizer=Adam(lr=0.001), loss='categorical_crossentropy', metrics=['accuracy']) return model # A way to generate batches of images def get_batches(path, dirname, gen=image.ImageDataGenerator(), shuffle=True, batch_size=64, class_mode='categorical'): return gen.flow_from_directory(path+dirname, target_size=(224,224), class_mode=class_mode, shuffle=shuffle, batch_size=batch_size) The hard part is done now. Just create a VGG object and load the weights.We will need to load pretrained weights into the model too. You can download the “VGG16_weights.h5” file here model = VGG_16() model.load_weights('VGG16_weights.h5') # Since our dogs vs cat dataset is binary classification model ftmodel = finetune(model,2) print ftmodel.summary() path = "dogscats/" batch_size=64 # Iterators to get our images from our datasets. The datasets are folders named train and valid. Both folder contain two directories 'dogs' and 'cats'. In each directory the corresponding images are kept. batches = get_batches(path,'train', batch_size=batch_size) val_batches = get_batches(path,'valid', batch_size=batch_size) # Now run for some epochs till the validation loss stops decreasing. no_of_epochs=1 for epoch in range(no_of_epochs): print "Running epoch: %d" % epoch ftmodel.fit_generator(batches, samples_per_epoch=batches.nb_sample, nb_epoch=1, validation_data=val_batches, nb_val_samples=val_batches.nb_sample) latest_weights_filename = 'ft%d.h5' % epoch ftmodel.save_weights(latest_weights_filename) #Create Predictions on test set. The test images should be in the folder dogscats/test/test_images/ , which is a single directory containing all images. test_batches = get_batches(path, 'test', batch_size=2*batch_size, class_mode=None) preds = ftmodel.predict_generator(test_batches, test_batches.nb_sample) isdog = preds[:,1] image_id = batches.filenames final_submission = np.stack([ids,isdog], axis=1) And we are done!
https://mlwhiz.com/blog/2017/04/17/deep_learning_pretrained_models/
CC-MAIN-2020-16
refinedweb
987
52.26
Mark, Thank you! Excellent answer. You're right that it was formerly cpanel. Just wondering, isn't it a bug that by default virtual hosts Mailman namespaces collide? Why should it be considered normal to require a patch to support virtual hosts properly? In the web pages you referred me to there's some griping that cpanel was slow to share the patch. Why no rush to adopt it? Robin Mark Sapiro wrote: > The former URL looks like one that would come from a cPanel > installation or perhaps one that uses other patches mentioned in > <>. > > Your 'new' URL is the correct one for a standard Mailman install. The > only reason to consider anything else is a requirement to support > lists with the same list name on different virtual hosts. Mailman as > distributed doesn't do this. See the above FAQ article for more info. >
https://mail.python.org/pipermail/mailman-users/2006-February/049593.html
CC-MAIN-2016-40
refinedweb
144
75.5
Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM! I have a glance at codeLite's parser, it use a lex and yacc grammar. But I'm just concerning it's performance. (It use CTags to generate a database).The current design in CC parses all the files in the current workspace as soon as it was opened. So, the MAIN parser is a index service (which is based on Ctag's parser), the Lex&Yacc is used to parse the "lookup table generated by the indexer". Quote from: ollydbg on March 17, 2009, 03:46:39 pmSo, the MAIN parser is a index service (which is based on Ctag's parser), the Lex&Yacc is used to parse the "lookup table generated by the indexer".No, the indexer creates a database of tags collected from the entire workspace. It searches for declarations and implementations of:- classes (include methods and variables)- methods- globals- statics - defines- structs - namespaces- enums- unionsThe Yacc / Lex are used to resolve expressions:GetManager()->GetWxString(). // completion here is resolved by the yacc grammar (and additional code) Eran
https://forums.codeblocks.org/index.php/topic,13531.0/prev_next,next.html?PHPSESSID=34d9bcc7b014d224d15b7ba243cd05de
CC-MAIN-2021-43
refinedweb
189
62.07
Ticket #5062 (closed defect: fixed) import virtual app feature doesn't import pae/nx cpu option Description Import virtual app feature seems doesn't import pae/nx cpu option. In fact if this last is selected in the source virtual machine and then I do an export and then import of the same virtual machine, the target virtual app doesn't inherit pae/nx option. Tested with VirtualBox 3.0.6 r52128 on Ubuntu 8.04 LTS. Change History comment:1 Changed 6 years ago by frank - Host type changed from Linux to other - Version changed from VirtualBox 3.0.6 to VirtualBox 3.1.2 - Component changed from other to OVF - Guest type changed from Linux to other comment:2 Changed 6 years ago by umoeller - Status changed from new to closed - Resolution set to fixed All VirtualBox-specific settings are now preserved in custom OVF tags, starting with version 3.2. Note: See TracTickets for help on using tickets.
https://www.virtualbox.org/ticket/5062
CC-MAIN-2016-07
refinedweb
161
61.67
I am writing a GPA calculator for a java programming class. I have written all the code and tried to run the program but I keep getting the most insane GPA's. 0.00 13.00 etc. While I would love to have a 13.00 GPA, I think there is something perhaps wrong with my code. I have posted the code below. I have also included some system.out.prints of different variables throughout the process trying to diagnose what is wrong. I will delete these in the final code but thought they would perhaps be useful for diagnostic purposes. Below is the code and the terminal screen. Also I apologize if my variables are confusing. I need to work on defining them better. For your info, Ctotal is the total number of class hours and Gtotal is the number of GPA points for each class added together. hours is the number of hours for an individual class. grade is the letter grade while Ngrade is that converted into number form. Ex A(grade) = 4.0(Ngrade). Please ask if anything does not make sense. I appreciate the help with troubleshooting. I have tried several things but can not figure out what is wrong. I guess it is at least putting out a GPA now even if it is obviously incorrect Code Code : import java.text.*; import java.util.*; public class proj3 { public static void main (String[] args){ DecimalFormat df = new DecimalFormat("#0.00"); Scanner s = new Scanner(System.in); System.out.print("How many courses did you take?"); int course = Integer.parseInt(s.nextLine()); int count = 0; int Ngrade = 0; int Ctotal = 0; int Gtotal = 0; while (count < course){ count ++; System.out.print("How many hours?"); int hours = Integer.parseInt(s.nextLine()); System.out.print("Letter Grade?"); String grade = s.nextLine(); if (grade.equals( "A" )) { Ngrade = 4; } if (grade.equals( "B" )) { Ngrade = 3; } if (grade.equals("C" )) { Ngrade = 2; } if (grade.equals("D" )) { Ngrade = 1; } if (grade.equals("F" )) { Ngrade = 0; } if (grade.equals( "a")) { Ngrade = 4; } if (grade.equals("b")) { Ngrade = 3; } if (grade.equals( "c")) { Ngrade = 2; } if (grade.equals("d")) { Ngrade = 1; } if (grade.equals( "f")) { Ngrade = 0; } // Gtotal is A = 4.0 b=3.0 etc //Ctotal is number of class hours System.out.println(Gtotal + "initial GPA value"); System.out.println(Ctotal + "initial class hours"); Gtotal= Gtotal * Ctotal; System.out.println(Gtotal + "GPA when multiplied by class hours"); //Gtotal equals gpa times class hours Ctotal= Ctotal + hours; Gtotal = Gtotal + Ngrade; System.out.println(Ctotal + "total number of class hours"); System.out.println(Gtotal + "total of GPA's for all classes"); } double GPA = Gtotal/Ctotal; System.out.println(df.format(GPA)); } } Terminal window How many courses did you take?4 How many hours?1 Letter Grade?A 0initial GPA value 0initial class hours 0GPA when multiplied by class hours 1total number of class hours 4total of GPA's for all classes How many hours?2 Letter Grade?B 4initial GPA value 1initial class hours 4GPA when multiplied by class hours 3total number of class hours 7total of GPA's for all classes How many hours?3 Letter Grade?C 7initial GPA value 3initial class hours 21GPA when multiplied by class hours 6total number of class hours 23total of GPA's for all classes How many hours?4 Letter Grade?D 23initial GPA value 6initial class hours 138GPA when multiplied by class hours 10total number of class hours 139total of GPA's for all classes 13.00 (This is Semester GPA)
http://www.javaprogrammingforums.com/%20whats-wrong-my-code/25841-troubleshooting-gpa-calculator-printingthethread.html
CC-MAIN-2016-18
refinedweb
586
70.7
Code for this can be found in the Github Branch There is a bit of a chicken or the egg situation now. I guess I could start with getting my state managed in Vuex setup first although I prefer to get the DB setup so that I can use it. I'm going for Firebase to give me a quick solution for setting up a database and also later adding auth in one place. So let's go ahead and install and initialize firebase Setup # The first thing is going over to Firebase console and setting up a new project. Once done you want to add the new application that you want to give access to your Firebase project. Select Project Overview and then select +Add app and select web app After that you give the application a name and it will create the app and provide the SDK config required when initializing the app. Save that data and we'll add it to the main.js file soon to get things up and running with Firebase initialized. Installing Firebase SDK with NPM is done as follows npm install firebase Once installed in my main file I will initialize Firebase using the config file created for this app. import { createApp } from 'vue'; import App from './App.vue'; import router from './router'; import firebase from 'firebase/app'; // Initialize Firebase const firebaseConfig = { apiKey: 'AIzaSyDbYPvxMaECPwjgR06njRfTLFa_skZ9-Qo', authDomain: 'pantry-fe77c.firebaseapp.com', databaseURL: '', projectId: 'pantry-fe77c', storageBucket: 'pantry-fe77c.appspot.com', messagingSenderId: '235929136377', appId: '1:235929136377:web:23a498fc887466ce76c628', measurementId: 'G-S4ER2JYTKZ', }; firebase.initializeApp(firebaseConfig); createApp(App) .use(router) .mount('#app'); With this we can now use firebase in the application. So let's add a method for getting and posting the ingredients to the DB Discussion (0)
https://practicaldev-herokuapp-com.global.ssl.fastly.net/iarehilton/setup-firebase-5b85
CC-MAIN-2021-17
refinedweb
293
62.88
filter - disable use of certain terminal capabilities #include <curses.h> void filter(void); The filter() function changes the algorithm for initialising terminal capabilities that assume that the terminal has more than one line. A subsequent call to initscr() or newterm() performs the following additional actions: - Disable use of clear, cud, cud1, cup, cuu1 and vpa. - Set the value of the home string to the value of the cr. string - Set lines equal to 1. Any call to filter() must precede the call to initscr() or newterm(). The filter() function does not return a value. No errors are defined. Defined Capabilities, initscr(), <curses.h>.
http://pubs.opengroup.org/onlinepubs/7990989775/xcurses/filter.html
CC-MAIN-2016-07
refinedweb
103
60.21
Example of using dependent types in Scala to verify code at compile time Dependent types is a term that describes using values as types. This means you can encode some properties of an object in its type. Once you do that, it allows a type checker (a compiler) to verify that the object (type) is used in a suitable way. For a trivial example, imagine that Scala's AnyRef would have been defined as: AnyRef[Null <: TBoolean] Where TBoolean is: trait TBoolean trait TTrue extends TBoolean trait TFalse extends TBoolean So we encode values 'true' and 'false' as types TTrue and TFalse Imagine further, that all classes would automatically be encoded this way (the compiler could add the [Null <: TBoolean] part to a class definition) While imagining, we can also imagine the compiler is enhanced so that if it sees 'null' as return value from a method returning Something, it immediately infers the return type as Something[TTrue] Now if I define a method as: def workWithSomething(s: Something[TFalse]) = ... Then trying to call it with a method that returns Something[TTrue] would fail at compile time. The result: No NullPointersException any more! (note: obviously, a smarter thing would have to remove 'null' altogether from the language, and use Option instead...) Here's another blog post that shows a concrete example without the need for compiler magic:
https://www.tikalk.com/posts/2011/11/29/example-of-using-dependent-types-in-scala-to-verify-code-at-compile-time/
CC-MAIN-2019-30
refinedweb
227
52.02
Cache controller - Syntax - Cache controller restrictions and limitations - Advanced features - See also The Modern UI cache controller is responsible for displaying the cached documents that have been gathered by Funnelback during an update. It will highlight the search terms when it displays the document. Syntax The cache controller will respond to any request with the name cache, regardless of the extension: /s/cache?collection=...&url=... /s/cache.xml?collection=...&url=... /s/cache.custom?collection=...&url=... This allows you to customise the cache URL depending on the type of content that’s returned. The following URL parameters are accepted: collection ID of the collection containing the cached document profile Profile to use to select the FreeMarker cache template form Name of the FreeMarker cache template (without .ftl) url URL of the document to display doc As an alternative to url, the caller can specify the path to the cached document to display, relative to the collection’s live data folder offset When doc is used, the offset to start reading content from the document (in bytes) length When doc is used, then length of the document that should be read (number of bytes) hl Regular expression used to highlight the user’s query. Optional. URL vs DOC parameter It’s usually better to use the url parameter to access a cached document, as Funnelback will fetch the document regardless of the storage mechanism (WARC files, XML files, MirrorStore, etc). However, in some circumstances the document cannot be retrieved from its URL alone: Collections that weren’t gathered using a Funnelback built-in component Collection for which the URL of the document as seen by the indexer is different from the URL used to store the document at gathering time. That can happen if the document URL is customised by setting a document URL in the XML configuration. If both url and doc are present, the cache controller will first attempt a lookup by URL, and it it fails, will try to locate the document from the doc parameter. The doc parameter is expected to be a file path relative to the collection live data folder ( $SEARCH_HOME/data/<collection>/live/data/), for example ...&doc=folder/sub-folder/file. Any other form of path will be rejected (absolute paths, paths with parent folder specifiers like ..). Cache controller restrictions and limitations Certain documents will not be returned by the cache controller: Any document that was flagged as noarchiveor nosnippetvia robots meta tags. XML documents generated as a result of padre’s XML document splitting (where the document field is set in the XML index settings). All documents in an index where document level security is enabled. Advanced features The Modern UI cache controller provides flexible features to manipulate the document content before it’s sent back to the user. Hook script A pre_cache hook script will be run if present. This hook script should be created in $SEARCH_HOME/conf/<collection>/hook_pre_cache.groovy. Data model The data model available from within the hook script contains the following variables: collection A collection object identical to the one available in the search lifecycle hook scripts under the question.collection node. Collection configuration can be accessed through collection.configuration.value("key") document A composite object of class RecordAndMetadata with 2 fields: record contains the actual content of the cached document, and metadata is a map containing the document metadata from the storage layer (i.e. the metadata specifically written by the gathering component that stored the document, such as the web crawler).The document.record object is of class Record and contains the following fields: primaryKey Key used to store the record at gathering time. This is usually a URL, but could be something else like an ID from a database collection. content The actual content. This content can be of a different type depending on the type of data that was stored at gathering time. Common content types are: An array of bytes (Java type byte[]), usually from Web collections An XML document (Java type org.w3c.dom.Document), usually from database, directory and connector collections Return values, document modifications The hook script can choose to return a boolean return value. If false is returned, access to the cached document will be denied and a 403 HTTP status code will be returned. If true is returned or if there’s no return value, access to the cached document is granted. The hook script can modify the fields of the document object to replace the content and metadata of the document. The replaced content will be used as the cached document content instead of the original document. This is achieved by assigning new values to the field of the document object, e.g. document.record = new XmlRecord(...) Examples Example 1: Prevent users from accessing cached copies for a specific site section def url = document.record.primaryKey if (url =~ /.*\/protected\/.*/) { return false } else { return true } Example 2: Build a completely new HTML document to use as a cached copy, ignoring the original document def url = document.record.primaryKey def html = "A new document" document.record = new StringRecord(url, html) This last example makes use of the StringRecord class, a type of Record where the content is a simple string (as opposite to an array of bytes or an XML document as discussed previously). FreeMarker template and Jsoup Similar to search templates, the cache controller makes use of FreeMarker templates to display the cached content. Cache template naming and location The cache templates must be created in the profile folders for a collection, and must end in .cache.ftl. The default template name is simple, i.e. simple.cache.ftl. Multiple templates can be created and selected using the form URL parameter. For example with the URL ...&form=mobile&profile=PROFILE... the following FreeMarker template will be used: $SEARCH_HOME/conf/<collection>/PROFILE/mobile.cache.ftl. If no cache template exists, the default one used is $SEARCH_HOME/conf/simple.cache.ftl. It’s usually a good starting point and it’s recommended to copy it as an example in the profile folder of a collection when you want to create a customised template. Cache unavailable screen A default message is presented if the cached copy cannot be retrieved when attempting to access a cached copy of a search result. This can be fully customised, however the customisation is server-wide. See: Cache unavailable screen. Data model and Jsoup The following variables are available from the data model in the FreeMarker template: url URL of the document collection A collection object identical to the one available in the search lifecycle hook scripts under the question.collection node profile ID of the current profile form Name of the current cache form requestURL Current URL (URL used to access the cache controller, e.g.…) metaData Document storage metadata as a Map httpRequest Java’s HttpServletRequest for the current HTTP request document HTML document as a Jsoup object[Jsoup] is a powerful HTML parser providing an easy API to modify HTML content. To use the Jsoup API within a FreeMarker template you’ll need to assign your API calls to temporary FreeMarker variables, as FreeMarker does not provide a way to call a function that doesn’t return a value. For example, if you wanted to append a CSS file to the HEAD of the document, use: <#assign tmp = doc.head().append("<style type=\"text/css\" src=\"...\">") /> Once the document has been manipulated as desired, its HTML source must be written to the template in order to be rendered on the user’s browser. To do so, the last line of your template should be ${doc}. For more examples, please consult the default cache template $SEARCH_HOME/conf/simple.cache.ftl.dist. XML and XSL By default, if a document is detected as XML, it will be returned as-is with an appropriate content type. Documents are detected as XML when: They have been gathered by a component that stores XML records (database, directory collections) They have been retrieved via the doc parameter (rather than url) and have a suffix of .xml The cache controller also supports transforming XML documents using XSL stylesheets. XSL transformation will be automatically applied if a stylesheet named template.xsl exists under the current profile folder for the collection, e.g. $SEARCH_HOME/conf/<collection>/<profile>/template.xsl. Note that the default content type for the XSL output is text/xml. If the XSL is generating HTML output, the content type must be set to text/html with ui.modern.cache.form.FORMNAME.content_type otherwise the web browser will attempt to interpret the generated HTML as XML and is likely to display an XML syntax error. Custom content type A custom content type can be set on a per-form basis, similar to search forms. This is done using the ui.modern.cache.form.FORMNAME.content_type setting. Custom headers Custom headers can be set using the ui.modern.cache.form.FORMNAME.headers.KEY setting.
https://docs.squiz.net/funnelback/docs/latest/build/results-pages/cache-controller/index.html
CC-MAIN-2021-31
refinedweb
1,492
51.48
Update 2018-07-11: Added note about Pi model, evdev installation, and gamma correction. Update 2018-08-02: Deprecated QR varient of HAP python. Introduction The article describes how to make a very simple light which you can control through Apple’s HomeKit1 service. It is very much a proof of principle, rather than a practical device, and all the hard work has been done by other people! Hardware The key element in the project is a Raspberry Pi with an internet connection. Originally I used an old Model A, but I found this often led to ‘Accessory not responding’ errors. In practice a Pi Zero W worked much better. The notes below assume you’ve set up the Pi roughly along these lines2. The next part of the hardware is to connect an LED to GPIO 18. If you’ve installed the gpiozero package, you can identify pin 18 with the pinout command. And that’s the hardware done! You can see my version, cobbled together with stuff lying within easy reach on my desk: Testing To test the hardware do this (note that you shouldn’t need to be root): $ echo 18 > /sys/class/gpio/export $ echo out > /sys/class/gpio/gpio18/direction $ echo 1 > /sys/class/gpio/gpio18/value $ echo 0 > /sys/class/gpio/gpio18/value You should see the LED turn on, then off. PWM support Of course, any self-respecting light these days can be dimmed, so we should add that. Happily we can use the PWM drivers built into the kernel. To do this, edit /boot/config.txt and add this line: dtoverlay=pwm Now reboot the machine. The runes above tell the Raspberry Pi to use a devicetree overlay to set up a pulse-width modulation4 device on GPIO pin 18. If you want to know more about this you might find an article I wrote about devicetree5 interesting. If you just want to use control the LED though, you just need to know about the sysfs interface: $ The units above are all nanoseconds, and so these commands: - Set up a 1kHz signal on GPIO18; - Initially set the signal on 50% of the time; - Change this faction to 90%, then 10%. One of the nice features about all this, is that we have been able to handle all the hardware by just configuring the standard kernel software. This leaves our application code free from any need to talk directly to hardware, free from any need to have elevated permissions, and free to run without significant timing constraints The HomeKit Accessory Protocol These days, it is relatively easy to see the official documentation6 from Apple. There are still hoops to jump through if you want to do this commercially, but those don’t concern us here. Now, actually implementing the Protocol from scratch is a major task but happily someone has done it: Ivan Kalchev’s HAP-python7 library. Thank you Ivan! I should say that there are other similar projects: some in python, many more in Javascript. Home Assistant8 uses HAP-python though, and that’s enough to break the symmetry for me. To install HAP-python: $ sudo apt-get install libavahi-compat-libdnssd-dev $ pip3 install HAP-python Sadly this can take quite a lot of time. Previous versions of this post used the QR version of HAP-python which displays the pairing code in a pretty QR-code which the iPhone can read. It is great on the command line, but awful if it gets sent to syslog. Our software Having used existing software to control the LED and to talk to HomeKit, we now need to write some code to connect the two. Happily it is all very straightforward. lamp.py Let’s begin with the main program: import sys sys.path.append('lib') import logging import signal from pyhap.accessory_driver import AccessoryDriver from LightBulb import LightBulb logging.basicConfig(level=logging.INFO) driver = AccessoryDriver(port=51826) lamp = LightBulb(driver, 'ToyLamp') driver.add_accessory(accessory=lamp) signal.signal(signal.SIGTERM, driver.signal_handler) driver.start() This code is based heavily on the example9 in the HAP-python repository. In essence, it just instantiates the accessory, the driver, then tells the driver to get on with it. Lightbulb.py Although this is the largest bit of new code, it is hardly enormous. Happily the HAP-python repository includes an example LightBulb10 accessory: the chief differences below are: - I want to be able to dim the bulb so there’s a new Brightness characteristic. - The LED is attached to a PWM device which is controlled via the sysfs API, rather than a binary GPIO line. from pwm import PWM from pyhap.accessory import Accessory from pyhap.const import CATEGORY_LIGHTBULB class LightBulb(Accessory): category = CATEGORY_LIGHTBULB def __init__(self, *args, pwm_channel=0, **kwargs): super().__init__(*args, **kwargs) chars = [ ( 'On', self.set_on ) , ( 'Brightness', self.set_brightness ) ] server = self.add_preload_service( 'Lightbulb', chars = [ name for (name,_) in chars ]) for (name, setter) in chars: server.configure_char(name, setter_callback = setter) self.pwm_channel = pwm_channel self.brightness = 1.0 # fraction self.is_on = False # Initialize this now, so that it has time to initialize # properly before we call it self.pwm_device = PWM(self.pwm_channel) self.pwm_device.export() def set_on(self, value): self.is_on = bool(value) self.set_bulb() def set_brightness(self, value): # HAP spec says brightness is specified as a percentage self.brightness = float(value) / 100.0 self.set_bulb() # push local state to PWM def set_bulb(self): if self.is_on: self.set_pwm_state(self.brightness) else: self.set_pwm_state(0) # actually drive PWM device def set_pwm_state(self, f): pwm_period = 1000000 # 1ms = 1000000ns => 1kHz self.pwm_device.period = pwm_period self.pwm_device.duty_cycle = int(f * pwm_period) self.pwm_device.enable = True def stop(self): super().stop() pwm.py To access the PWM sysfs API, I’m using code written by Scott Ellis. You can get his original from GitHub11 The only local difference is that I added code to wait for the PWM device to be exported: particularly on older hardware, this seems to take a while. A better patch might check that the udev rules which fix the PWM device permissions have had time to fire too. ... def export(self): """Export the channel for use through the sysfs interface. Required before first use. """ if not self.is_exported(): with open(self.base + '/export', 'w') as f: f.write('{:d}'.format(self._channel)) # wait for the device to appear, so that immediate attempts # to configure it don't fail max_wait = 10.0 # in seconds sleepq = 0.1 # in seconds timeout = time.clock() + max_wait while not self.is_exported(): if time.clock() > timeout: raise TimeoutError("Unable to export PWM device") time.sleep(sleepq) ... Basic operation As you’ll know if you’ve used HomeKit before, you have to add new accessories to the system. Happily HAP-python makes this easy: the first time the accessory is run, it displays a QR code on the command line, which the Home app on your iPhone understands. Our accessory isn’t certified, so you have to explicitly approve it. The AccessoryDriver persists its state in a local file, by default called accessory.state, so subsequent invocations of the accessory don’t go through the pairing routine and generate the QR code. If you should need to re-pair the accessory, delete the state file. systemd Having paired the accessory, you will probably want to start it automatically when the system boots. To do this, we use systemd12. Specifically, with this script: [Unit] Description="HomeKit Lamp" [Service] Type=simple User=pi WorkingDirectory=/home/pi/mjo-homekit/code ExecStart=/usr/bin/python3 /home/pi/mjo-homekit/code/lamp.py StandardInput=null StandardOutput=syslog StandardError=syslog Restart=on-failure [Install] WantedBy=multi-user.target I don’t claim this is optimal, but it appears to work. Some caveats: - It is not robust with respect to the network disappearing and reappearing. - It runs as the standard pi user: it would be better to set up a new one. Local control Although it’s handy to be able to control the light from the Internet, I think it’s helpful to have controls on the light too. When I last built an IoT light13 I included a combined push-button and rotary-encoder to control both brightness and whether the light was on. Unsurprisingly, I’ve now replaced the software I wrote then with this HomeKit version, and so I want similar local controls. Events Just as it is convenient to use a devicetree overlay to create a PWM device which drives the light, we can also use overlays to create input devices for the rotary-encoder and power button. I’ve made more detailed notes15, but the key lines to include in /boot/config.txt are: dtoverlay=gpio-key,gpio=25,label=MYBTN,keycode=0x101 dtoverlay=rotary-encoder,pin_a=7,pin_b=8,relative_axis=1 As you can probably guess, you should connect the rotary-encoder to GPIOs 7 and 8, and the power button to GPIO 25. The overlays enable pull-ups in the processor, so you don’t need extra resistors. Having installed the overlays and connected the hardware, devices appear in /dev/input/eventN. You can test them with evtest, or talk to them from Python with the evdev library. Sadly evdev isn’t packaged in raspbian, but you can install it easily with pip3: $ pip3 install evdev New code We need to make several changes to our accessory code: add code to parse the events, add code to push local changes to the HomeKit world, and finally arrange for the code to be called appropriately. Parsing the events is made simpler because we don’t have to worry about distinguishing different buttons. async def event_handler(self, dev): async for e in dev.async_read_loop(): # all events _might_ update local state variables... t = e.type v = e.value # key presses toggle state... if t evdev.ecodes.EV_KEY and v 1: self.is_on = not(self.is_on) self.local_update = True # rotary encoder changes brightness (and turns light on)... elif t == evdev.ecodes.EV_REL and v != 0: if not self.is_on: self.is_on = True self.local_update = True b = clamp(0, 1.0, self.brightness + v * self.bri_delta) if self.brightness != b: self.brightness = b self.local_update = True # if the state has changed push those changes to the bulb if self.local_update: self.set_bulb() You’ll see that this code is marked async16 which marks it as an asynchronous coroutine. This makes it easy to integrate into the main AccessoryDriver code. In the init method just add: for d in evdevs: driver.async_add_job(self.event_handler(d)) Where evdevs is a list of devices passed to the accessory when it’s created. To push changes back to HomeKit, we use another async event, though HAP-python provides some syntactic sugar to make the code a bit sweeter: @Accessory.run_at_interval(1) def run(self): if self.local_update: self.char['On'].set_value(self.is_on) self.char['Brightness'].set_value(int(100.0 * self.brightness)) self.local_update = False Note that we only push updates if there are any changes: this both reduces spurious traffic and stops local and remote updates from fighting. Improvements In practice, setting the PWM duty-cycle to the fractional brightness gives very crude control at low levels, and the perceived change in intensity isn’t consistent. Better results comes from employing gamma correction17, here with γ = 2.5: # push local state to PWM def set_bulb(self): if self.is_on and self.brightness > 0: theta = self.brightness ** 2.5 self.set_pwm_state(theta) else: self.set_pwm_state(0) GitHub You can get all the code for this from GitHub18. Conclusions This project worked well: the final light works reliably, integrates seemlessly into the Apple HomeKit ecosystem, and the whole process wasn’t particularly difficult. Much of the credit for this goes to Ivan Kalchev’s HAP-python library, which does all the heavy-lifting. Abstracted a little, you can see it as yet another nice project enabled by cheap commodity electronics and fine open-source software. I think some credit is also due to Apple though. By placing HomeKit devices firmly on the local network, and only allowing remote access through some sort of Hub (e.g. Apple TV or HomePod), Apple have made the security problems much easier. In particular we don’t have to worry about setting up crypto-certificates so as to limit access to the right people. Overall, then, it was a fun thing to do, and if you’ve got Apple devices around then I recommend you start building your own HomeKit trinkets. References - 1. - 2. ./rpi-setup.html - 3. ./hap-light.jpg - 4. - 5. ../../2017/03/rpi-devicetree.html - 6. - 7. - 8. - 9. - 10. - 11. - 12. - 13. ../..2017/05/yauiotl.html - 14. ../../2017/05/yauiotl-case.jpg - 15. ../../2017/03/rpi-devicetree.html - 16. - 17. - 18.
https://www.mjoldfield.com/atelier/2018/06/homekit-light.html
CC-MAIN-2020-50
refinedweb
2,123
57.87
In my last article, I discussed some of my previous experiences with dependency management solutions and set forth some primary objectives I believe a dependency management tool should facilitate. In this article, I’ll show how I’m currently leveraging NuGet’s command line tool to help facilitate my dependency management goals. First, it should be noted that NuGet was designed primarily to help .Net developers more easily discover, add, update, and remove dependencies to externally managed packages from within Visual Studio. It was not designed to support build-time, application-level dependency management outside of Visual Studio. While NuGet wasn’t designed for this purpose, I believe it currently represents the best available option for accomplishing these goals. Approach 1 My team and I first started using NuGet for retrieving application dependencies at build-time a few months after its initial release, though we’ve evolved our strategy a bit over time. Our first approach used a batch file we named install-packages.bat that used NuGet.exe to process a single packages.config file located in the root of our source folder and download the dependencies into a standard \lib folder. We would then run the batch file after adding any new dependencies to the packages.config and proceed to make assembly references as normal from Visual Studio. We also use Mercurial as our VCS and added a rule to our .hgignore file to keep from checking in the downloaded assemblies. To ensure a freshly downloaded solution obtained all of its needed dependencies, we just added a call to our batch file from a Pre-build event in one of our project files. Voilà! Here’s an example of our single packages.config file (note, it’s just a regular NuGet config file which it normally stores in the project folder): <?xml version="1.0" encoding="utf-8"?> <packages> <package id="Antlr" version="3.1.3.42154" /> <package id="Castle.Core" version="2.5.1" /> <package id="Iesi.Collections" version="3.2.0.4000" /> <package id="NHibernate" version="3.2.0.4000" /> <package id="FluentNHibernate" version="1.3.0.717" /> <package id="Machine.Specifications" version="0.4.9.0" /> <package id="Machine.Fakes" version="0.2.1.2" /> <package id="Machine.Fakes.Moq" version="0.2.1.2" /> <package id="Moq" version="4.0.10827" /> <package id="Moq.Contrib" version="0.3" /> <package id="SeleniumDotNet-2.0RC" version="3.0.0.0" /> <package id="AutoMapper" version="1.1.0.118" /> <package id="Autofac" version="2.4.5.724" /> <package id="Autofac.Mvc3" version="2.4.5.724" /> <package id="Autofac.Web" version="2.4.5.724" /> <package id="CassiniDev" version="4.0.1.7" /> <package id="NDesk.Options" version="0.2.1" /> <package id="log4net" version="1.2.10" /> <package id="MvcContrib.Mvc3.TestHelper-ci" version="3.0.60.0" /> <package id="NHibernateProfiler" version="1.0.0.838" /> <package id="SquishIt" version="0.7.1" /> <package id="AjaxMin" version="4.13.4076.28499" /> <package id="ExpectedObjects" version="1.0.0.0" /> <package id="RazorEngine" version="2.1" /> <package id="FluentMigrator" version="0.9.1.0" /> <package id="Firefox" version="3.6.6" /> Here’s the batch file we used: @echo off set SCRIPT_DIR=%~dp0 set NUGET=%SCRIPT_DIR%..\tools\NuGet\NuGet.exe set PACKAGES=%SCRIPT_DIR%..\src\packages.config set DESTINATION=%SCRIPT_DIR%..\lib\ set LOCALCACHE=C:\Packages\ set CORPCACHE=//corpShare/Packages/ set DEFAULT_FEED="" echo [Installing NuGet Packages] if NOT EXIST %DESTINATION% mkdir %DESTINATION% echo. echo [Installing From Local Machine Cache] %NUGET% install %PACKAGES% -o %DESTINATION% -Source %LOCALCACHE% echo. echo [Installing From Corporate Cache] %NUGET% install %PACKAGES% -o %DESTINATION% -Source %CORPCACHE% echo. echo [Installing From Internet] %NUGET% install %PACKAGES% -o %DESTINATION% echo. echo [Copying To Local Machine Cache] xcopy /y /d /s %DESTINATION%*.nupkg %LOCALCACHE% echo. echo Done This batch file uses NuGet to retrieve dependencies first from a local cache, then from a corporate level cache, then from the default NuGet feed. It then copies any of the newly retrieved packages to the local cache. I don’t remember if NuGet had caching when this was first written, but it was decided to keep our own local cache due to the fact that NuGet only seemed to cache packages if retrieved from the default feed. We used the corporate cache as a sort of poor-man’s private repository for things we didn’t want to push up to the public feed. The main drawback to this approach was that we had to keep up with all of the transitive dependencies. When specifying a packages.config file, NuGet.exe only retrieves the packages listed in the file. It doesn’t retrieve any of the dependencies of the packages listed in the file. Approach 2 In an attempt to improve upon this approach, we moved the execution of NuGet.exe into our rake build. In doing so, we were able to eliminate the need to specify transitive dependencies by ditching the use of the packages.config file in favor of a Ruby dictionary. We also removed the Pre-Build rule in favor of just running rake prior to building in Visual Studio. Here is our dictionary which we store in a packages.rb file: packages = [ [ "FluentNHibernate", "1.3.0.717" ], [ "Machine.Specifications", "0.4.9.0" ], [ "Moq", "4.0.10827" ], [ "Moq.Contrib", "0.3" ], [ "Selenium.WebDriver", "2.5.1" ], [ "Selenium.Support", "2.5.1" ], [ "AutoMapper", "1.1.0.118" ], [ "Autofac", "2.4.5.724" ], [ "Autofac.Mvc3", "2.4.5.724" ], [ "Autofac.Web", "2.4.5.724" ], [ "NDesk.Options", "0.2.1" ], [ "MvcContrib.Mvc3.TestHelper-ci", "3.0.60.0" ], [ "NHibernateProfiler", "1.0.0.912" ], [ "SquishIt", "0.7.1" ], [ "ExpectedObjects", "1.0.0.0" ], [ "RazorEngine", "2.1"], [ "FluentMigrator", "0.9.1.0"], [ "Firefox", "3.6.6"], [ "FluentValidation", "3.1.0.0" ], [ "log4net", "1.2.10" ] ] configatron.packages = packages Here’s the pertinent sections of our rakefile: require 'rubygems' require 'configatron' ... FEEDS = ["//corpShare/Packages/", "" ] require './packages.rb' task :default => ["build:all"] namespace :build do task :all => [:clean, :dependencies, :compile, :specs, :package] ... task :dependencies do configatron.packages.each do | package | FEEDS.each do | feed | !(File.exists?("#{LIB_PATH}/#{package[0]}")) and sh "#{TOOLS_PATH}/NuGet/nuget Install #{package[0]} -Version #{package[1]} -o #{LIB_PATH} -Source #{feed} -ExcludeVersion" do | cmd, results | cmd end end end end end Another change we made was to use the -ExcludeVersion switch to enable us to setup up the Visual Studio references one time without having to change them every time we upgrade versions. Ideally, I’d like to avoid having to reference transitive dependencies altogether, but I haven’t come up with a clean way of doing this yet. Approach 2: Update As of version 1.4, NuGet will now resolve a package’s dependencies (i.e. transitive dependencies) from any of the provided sources (see workitem 603). This allows us to modify the above script to issue a single call to nuget: task :dependencies do configatron.packages.each do | package | !(File.exists?("#{LIB_PATH}/#{package[0]}")) and feeds = FEEDS.map {|x|"-Source " + x }.join(' ') sh "nuget Install #{package[0]} -Version #{package[1]} -o #{LIB_PATH} #{feeds} -ExcludeVersion" do | cmd, results | cmd end end end Summary While NuGet wasn’t designed to support build-time, application-level dependency management outside of Visual Studio in the way demonstrated here, it suits my team’s needs for now. My hope is NuGet will eventually support these scenarios more directly. Pingback: The Morning Brew - Chris Alcock » The Morning Brew #941() Pingback: digitalBush » Manage Your Dependencies with Rake and NuGet()
https://lostechies.com/derekgreer/2011/09/20/dependency-management-in-net-using-nuget-without-visual-studio/
CC-MAIN-2017-13
refinedweb
1,243
53.07
iservices.rssdocument 0.4 A dynamic RSS content-type for plone Introduction iservices.rssdocument: A dynamic RSS content-type for plone This is a dynamic RSS content-type for plone. This idea comes from the need to provide a simple content-type which will display RSS feeds by using only jQuery, which is already available from Plone. You will only need to add the RSS feed URL and configure how many items to display. The jquery app will download the RSS fedd and show it inside Plone. It uses the zRSSFeed jQuery plugin to do so. RSS Feeds Reader Plugin for jQuery: Changelog 0.4 (15-Dic-2011) - Plone 4.1 compatibility - Update README.txt file - Update zRSSFeed jQuery plugin - Change jquery namespace from jq to $ 0.3 (unreleased) Working product. Changes: - Full Test Coverage - Fully working 0.2 (unreleased) - Don't remember when.4.xml
http://pypi.python.org/pypi/iservices.rssdocument/0.4
crawl-003
refinedweb
146
69.89
In this tutorial, we'll be building a quick shortlink web app with Ruby, the Sinatra web framework, and the Redis database. By the conclusion of this tutorial, you'll end up with a dead simple, high performance shortlink webapp that's super easy to scale. Step 1. Getting Started To follow along with this tutorial, you'll need Ruby installed on your system (I'm using 1.9.2), as well as the sinatra and redis gems, and Redis. If you don't already have Ruby installed on your system, then you should be able to install it relatively easily. OS X, Debian or CentOS users may need to compile a newer version of Ruby. It's a pretty straightforward process. Refer here to learn about how to install Ruby, via RVM. Now you'll need to install the required Ruby Gems. Gems are a convenient way of installing virtually any Ruby library available. Simply type the following in your terminal window to install the required gems: gem install sinatra redis We'll also need to install and compile Redis. Don't worry, it's really small and only takes roughly 15 seconds to compile on my machine. wget tar zfx redis-2.0.4.tar.gz cd redis-2.0.4 make sudo make install cd .. You can run the Redis server by typing redis-server into your terminal, and if you feel like playing around with Redis, give redis-cli a go. Step 2. Building the App One of the great things about Sinatra is how quick and easy it makes whipping up simple little apps - it's almost silly! The code for the shortlink app itself won't be very long, so it should be really easy to understand. Don't worry if you don't understand it at first, I'll explain how it all works shortly. Make a folder for your webapp - I've called mine redis-ruby-shortlink - and put the following files in it. shortlink_app.rb require 'sinatra' require 'redis' redis = Redis.new helpers do include Rack::Utils alias_method :h, :escape_html def random_string(length) rand(36**length).to_s(36) end end get '/' do erb :index end post '/' do if params[:url] and not params[:url].empty? @shortcode = random_string 5 redis.setnx "links:#{@shortcode}", params[:url] end erb :index end get '/:shortcode' do @url = redis.get "links:#{params[:shortcode]}" redirect @url || '/' end That's it. Pretty simple, eh? In that little Sinatra app above, I've done a few key things. In the first two lines, I'm bringing in the libraries we need - sinatra and In Sinatra, you can specify helpers that are executed every time one of your routes (those get and post parts) is run. We can put anything that we might need often in the helpers block. In my helpers block, I've aliased h to Rack's escape_html, and defined a method to generate a random alphanumeric string of a certain length. Next up are the routes. The first route is rather simple. Whenever a client makes a GET request to /, it just renders the index.erb page (I've included the source to this further down.) The next route is where the good stuff happens. First, we make sure that the user has actually typed a URL into the URL box. If so, we generate a random shortcode five characters long by calling the random_string method we defined before. Then, we tell Redis to setnx (Set if n exists), a key representing our shortcode to its URL. Redis is a really fast and simple key/value database, or a NoSQL database. These databases are designed for really heavy key/value lookup operations, and as they drop most of the complexity of SQL, they can do it much faster. The 'links:' part of the key isn't strictly required, but it's good practice to split your Redis keys into namespaces so if you decide later on to store more information in the same database, you don't have to worry about clashes. After all that, we render the same index.erb page as before. Notice how if the user doesn't enter anything, this route does the same thing as the previous route. The final route is run when a client visits a shortlink. This route introduces what's called a URL parameter. For example, when a client visits '/foobar', the :shortcode part of the route matches 'foobar'. We can access URL parameters the same way as any other parameter - the params hash. We look up the shortcode in the Redis database. If there's no such key as what we are trying to access, Redis will return nil. The next line redirects to either the URL we grabbed out of Redis (if it exists), or redirects to the homepage if not. views/index.erb index.erb is mostly boring markup, although it does have a few lines I'd like to point out. erb stands for embedded Ruby, and allows us to mix Ruby and HTML, like you would with PHP. <!DOCTYPE html> <html> <head> <title>Shortlink App</title> <style> body { font-family:"Gill Sans", "Gill Sans MT", Sans-Serif; } .container { width:400px; margin:120px auto 0px auto; } h1 { width:400px; margin-bottom:12px; text-align:center; color:#ff4b33; font-size:40px; padding-bottom:8px; border-bottom:2px solid #ff4b33; } form { display:block; width:400px; } input { display:block; float:left; padding:8px; font-size:16px; } #url { width:280px; margin-right:12px; } #submit { width:88px; border:none; background:#ff4b33; padding:10px; } #submit:hover { background:#ff7866; } .clear { height:1px; width:400px; clear:both; } .result { clear:both; width:400px; margin-top:12px; border-top:2px solid #ff4b33; padding-top:12px; text-align:center; } .result a { font-size:24px; display:block; margin-top:8px; color:#ff2d11; background:#ffd2cc; padding:8px; } </style> </head> <body> <div class="container"> <h1>shortlink app</h1> <form method="post"> <input type="text" value="<%= h(params[:url]) %>" name="url" id="url" /> <input type="submit" value="shorten" id="submit" /> </form> <div class="clear"></div> <% if @shortcode %> <div class="result"> Your shortened URL is: <a href="<%= @shortcode %>"><%= @shortcode %></a> </div> <% end %> </div> </body> One difference between erb and PHP that you may have already noticed (apart from the different languages) is that, where PHP uses <? and <?=, erb uses <% and <?=. The only interesting things about index.erb is the if block that only renders the part of the page that shows the shortlink if the @shortcode variable is defined. This lets us use the same view for everything. Another point of note is that we've made sure to HTML escape params[:url], so that we don't fall victim to an XSS attack. Other than those points, it's essentially a stock standard webpage. Step 3. Scaling Up One thing I briefly mentioned in this tutorial's introduction is how easily we can scale, thanks to Redis. Whereas scaling out to multiple SQL databases is a complicated affair, scaling Redis is actually quite trivial. This is a direct result of Redis' simplicity. If you need to scale to multiple Redises, add the following to your Redis configuration: slaveof master-redis-server.my-shortlink-app.com 6379 Once you have multiple slaves set up, it's a tiny little tweak to the Sinatra app above to make each Sinatra instance connect to a random Redis server (if you're at the stage where you need to scale Redis, I'm going to assume that you've already had to deploy multiple Sinatra instances. ;) Conclusion I hope this tutorial proved to be useful to you, whether you want to run your own shortlink service, or you're simply interesting in the latest cutting-edge technologies that are available to us web developers. I've covered some pretty neat software in this tutorial that's been incredibly useful to not just me, but thousands of other developers out there. Enjoy your tinkering!
http://code.tutsplus.com/tutorials/how-to-build-a-shortlink-app-with-ruby-and-redis--net-20984
CC-MAIN-2014-10
refinedweb
1,320
63.8
Contents Learning the OpenMP framework with GCC The OpenMP framework is a powerful way of doing concurrent programming in C, C++, and Fortran. The GNU Compiler Collection (GCC) version 4.2 supports the OpenMP 2.5 standard, while GCC 4.4 supports the latest OpenMP 3 standard. Other compilers, including Microsoft® Visual Studio, support OpenMP as well. In this article, you can learn to use OpenMP compiler pragmas, find support for some of the application programming interfaces (APIs) that OpenMP provides, and test OpenMP with some parallel algorithms. This article uses GCC 4.2 as the preferred compiler. Your first OpenMP program Let us start with a simple Hello, World! printing application that includes an additional pragma. Listing 1 shows the code. Listing 1. Hello World with OpenMP #include <iostream> int main() { #pragma omp parallel { std::cout << "Hello World!\n"; } } When compiling and running the code in Listing 1 with g++, a single Hello, World! should be displayed in the console. Now, recompile the code with the -fopenmp option. Listing 2 shows the output. Listing 2. Compiling and running the code with the -fopenmp command tintin$ g++ test1.cpp -fopenmp tintin$ ./a.out Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! So, what just happened? The magic of the #pragma omp parallel works only when you specify the -fopenmp compiler option. Internally, during compilation, GCC generates the code to create as many threads as it optimally can at run time based on the hardware and operating system configuration, with the start routine of each created thread being the code in the block that follows the pragma. This behavior is implicit parallelization, and OpenMP in its core consists of a set of powerful pragmas that relieve you of having to perform a lot of boilerplate coding. (For the sake of comparison, check out what a Portable Operating System Interface (POSIX) threads [pthreads] implementation of what you just did would be like.) Because I am using a computer running an Intel® Core i7 processor with four physical cores and two logical cores per physical core, the output from Listing 2 seems quite reasonable (8 threads = 8 logical cores). Now, let us get in to more details about parallel pragmas. Fun with OpenMP parallel It is easy enough to control the number of threads using the num_threads argument to the pragma. Here is the code from Listing 1 again with the number of available threads specified at 5 (as shown in Listing 3). Listing 3. Controlling the number of threads with num_threads #include <iostream> int main() { #pragma omp parallel num_threads(5) { std::cout << "Hello World!\n"; } } Instead of the num_threads approach, here is an alternative to change the number of threads running the code. That also brings us to the first OpenMP API you will be using: omp_set_num_threads. You define this function in the omp.h header file. No additional libraries need to be linked to get the code in Listing 4 to work—just -fopenmp. Listing 4. Using omp_set_num_threads to fine tune thread creation #include <omp.h> #include <iostream> int main() { omp_set_num_threads(5); #pragma omp parallel { std::cout << "Hello World!\n"; } } Finally, OpenMP also uses external environment variables to control its behavior. You can tweak the code in Listing 2 to simply print Hello World! six times by setting the OMP_NUM_THREADS variable to 6. Listing 5 shows the execution. Listing 5. Using environment variables to tweak OpenMP behavior tintin$ export OMP_NUM_THREADS=6 tintin$ ./a.out Hello World! Hello World! Hello World! Hello World! Hello World! Hello World! You have discovered all the three facets of OpenMP: compiler pragmas, runtime APIs, and environment variables. What happens if you use both the environment variable and the runtime API? The runtime API gets higher precedence. A practical example OpenMP uses implicit parallelization techniques, and you can use pragmas, explicit functions, and environment variables to instruct the compiler. Let us look at an example in which OpenMP can be of real help. Consider the code in Listing 6. Listing 6. Sequential processing in a for loop int main( ) { int a[1000000], b[1000000]; // ... some initialization code for populating arrays a and b; int c[1000000]; for (int i = 0; i < 1000000; ++i) c[i] = a[i] * b[i] + a[i-1] * b[i+1]; // ... now do some processing with array c } Clearly, you can potentially split the for loop and run into multiple cores, calculating any c[k] is dependency free from other elements of the c array. Listing 7 shows how OpenMP helps you do so. Listing 7. Parallel processing in a for loop with the parallel for pragma int main( ) { int a[1000000], b[1000000]; // ... some initialization code for populating arrays a and b; int c[1000000]; #pragma omp parallel for for (int i = 0; i < 1000000; ++i) c[i] = a[i] * b[i] + a[i-1] * b[i+1]; // ... now do some processing with array c } The parallel for pragma helps to split the for loop workload across multiple threads, with each thread potentially running on a different core, thus reducing the total computation time significantly. Listing 8 proves the point. Listing 8. Understanding omp_get_wtime #include <omp.h> #include <math.h> #include <time.h> #include <iostream> int main(int argc, char *argv[]) { int i, nthreads; clock_t clock_timer; double wall_timer; double c[1000000]; for (nthreads = 1; nthreads <=8; ++nthreads) { clock_timer = clock(); wall_timer = omp_get_wtime(); #pragma omp parallel for private(i) num_threads(nthreads) for (i = 0; i < 1000000; i++) c[i] = sqrt(i * 4 + i * 2 + i); std::cout << "threads: " << nthreads << " time on clock(): " << (double) (clock() - clock_timer) / CLOCKS_PER_SEC << " time on wall: " << omp_get_wtime() - wall_timer << "\n"; } } In Listing 8, you benchmark the time it takes to run the inner for loop by continuously increasing the number of threads. The omp_get_wtime API returns the elapsed wall time in seconds from some arbitrary but consistent point. So, omp_get_wtime() - wall_timer returns the observed wall time to run the for loop. The clock() system call is used to estimate the processor usage time for the whole program—that is, individual thread-specific processor usage time is summed up before reporting the final figures. On my Intel Core i7 computer, Listing 9 shows what gets reported. Listing 9. Statistics for running the inner for loop threads: 1 time on clock(): 0.015229 time on wall: 0.0152249 threads: 2 time on clock(): 0.014221 time on wall: 0.00618792 threads: 3 time on clock(): 0.014541 time on wall: 0.00444412 threads: 4 time on clock(): 0.014666 time on wall: 0.00440478 threads: 5 time on clock(): 0.01594 time on wall: 0.00359988 threads: 6 time on clock(): 0.015069 time on wall: 0.00303698 threads: 7 time on clock(): 0.016365 time on wall: 0.00258303 threads: 8 time on clock(): 0.01678 time on wall: 0.00237703 Although the processor time is almost the same across executions (they should be, except for some additional time to create the threads and the context switch), it is the wall time that is interesting and is progressively reduced as the number of threads increases, implying that data is being crunched by cores in parallel. A final note on the pragma syntax: #pragma parallel for private(i) means that the loop variable i is to be treated as a thread local storage, with each thread having a copy of the variable. The thread local variable is not initialized. Critical sections with OpenMP You were not exactly thinking of having OpenMP figure out how to deal with critical sections automatically, were you? Sure, you do not have to explicitly create a mutual exclusion (mutex), but you still need to specify the critical section. Here is the syntax: #pragma omp critical (optional section name) { // no 2 threads can execute this code block concurrently } The code that follows pragma omp critical can only be ran by a single thread at a given time. Also, optional section name is a global identifier, and no two threads can run critical sections with the same global identifier name at the same time. Consider the code in Listing 10. Listing 10. Multiple critical sections with the same name #pragma omp critical (section1) { myhashtable.insert("key1", "value1"); } // ... other code follows #pragma omp critical (section1) { myhashtable.insert("key2", "value2"); } Based on this code, you can safely assume that the two hash table insertions will never happen concurrently, because the critical section names are the same. This is slightly different from the way you are accustomed to dealing with critical sections while using pthreads, which are by and large characterized by the use (or abuse) of locks. Locking and mutexes with OpenMP Interestingly enough, OpenMP comes with its own versions of mutexes (so it is not all pragmas after all): Welcome to omp_lock_t, defined as part of the omp.h header file. The usual pthread-style mutex operations hold true—even the API names are similar. There are five APIs that you need to know: omp_init_lock: This API must be the first API to access omp_lock_t, and it is used for initialization. Note that right after initialization, the lock is deemed to be in an unset state. omp_destroy_lock: This API destroys the lock. The lock must be in an unset state when this API is called, which means that you cannot call omp_set_lock, and then make a call to destroy the lock. omp_set_lock: This API sets omp_lock_t—that is, the mutex is acquired. If a thread cannot set the lock, then it continues to wait until it is able to lock. omp_test_lock: This API tries to lock if the lock is available, and returns 1if successful and 0otherwise. This is a non-blocking API—that is, this function does not make the thread wait to set the lock. omp_unset_lock: This API releases the lock. Listing 11 shows a trivial implementation of a legacy single-threaded queue extended to handle multithreading using OpenMP locks. Note that this might not be the right thing to do in every situation, and the example as such is primarily meant as a quick illustration. Listing 11. Using OpenMP to extend a single-threaded queue #include <openmp.h> #include "myqueue.h" class omp_q : public myqueue<int> { public: typedef myqueue<int> base; omp_q( ) { omp_init_lock(&lock); } ~omp_q() { omp_destroy_lock(&lock); } bool push(const int& value) { omp_set_lock(&lock); bool result = this->base::push(value); omp_unset_lock(&lock); return result; } bool trypush(const int& value) { bool result = omp_test_lock(&lock); if (result) { result = result && this->base::push(value); omp_unset_lock(&lock); } return result; } // likewise for pop private: omp_lock_t lock; }; Nested locks Other types of locks that OpenMP provides are the omp_nest_lock_t lock variants. These are similar to omp_lock_t, with the additional benefit that these locks can be locked multiple times by the thread that is already holding the lock. Each time the nested lock is reacquired by the holding thread using omp_set_nest_lock, an internal counter is incremented. The lock is freed from the holding thread when one or more calls to omp_unset_nest_lock finally reset the internal lock counter to 0. Here are the APIs used for omp_nest_lock_t: omp_init_nest_lock(omp_nest_lock_t* ): This API initializes the internal nesting count to 0. omp_destroy_nest_lock(omp_nest_lock_t* ): This API destroys the lock. Calling this API on a lock with a non-zero internal nesting count results in an undefined behavior. omp_set_nest_lock(omp_nest_lock_t* ): This API is similar to omp_set_lock, except that the thread can call this function multiple times while the thread is holding the lock. omp_test_nest_lock(omp_nest_lock_t* ): This API is a non-blocking version of omp_set_nest_lock. omp_unset_nest_lock(omp_nest_lock_t* ): This API releases the lock when the internal counter is 0. Otherwise, the counter is decremented with each call to this method. Fine-grained control over task execution You have already seen that all the threads run the code block that follows pragma omp parallel in parallel. It is possible to further categorize the code inside this block for execution by select threads. Consider the code in Listing 12. Listing 12. Learning to use the parallel sections pragma int main( ) { #pragma omp parallel { cout << "All threads run this\n"; #pragma omp sections { #pragma omp section { cout << "This executes in parallel\n"; } #pragma omp section { cout << "Sequential statement 1\n"; cout << "This always executes after statement 1\n"; } #pragma omp section { cout << "This also executes in parallel\n"; } } } } The code that precedes pragma omp sections, but just after pragma omp parallel, is ran by all the threads in parallel. The block that succeeds pragma omp sections is further classified into individual subsections using pragma omp section. Each pragma omp section block is available for execution by an individual thread. However, the individual statements inside the section block are always run sequentially. Listing 13 shows the output of the code from Listing 12. Listing 13. Output from running the code in Listing 12 tintin$ ./a.out All threads run this All threads run this All threads run this All threads run this All threads run this All threads run this All threads run this All threads run this This executes in parallel Sequential statement 1 This also executes in parallel This always executes after statement 1 In Listing 13, you again have eight threads being created initially. Of these eight threads, there is sufficient work for only three threads in the pragma omp sections block. Within the second section, you specify the order in which the print statements are ran. That is the whole point behind having the sections pragma. If there is a need, you will be able to specify ordering of code blocks. Understanding the firstprivate and lastprivate directives in conjunction with parallel loops Earlier, you saw the use of private to declare thread local storage. So, how should you initialize the thread local variables? Perhaps synchronize them with the value of the variable in the main thread before ensuing operations? This is where the firstprivate directive comes in handy. The firstprivate directive Using firstprivate(variable), you can initialize the variable in a thread to whatever value it had in the main. Consider the code in Listing 14. Listing 14. Using the thread local variable that is not synchronized with the main thread #include <stdio.h> #include <omp.h> int main() { int idx = 100; #pragma omp parallel private(idx) { printf("In thread %d idx = %d\n", omp_get_thread_num(), idx); } } Here is the output I get. Your results might vary. In thread 1 idx = 1 In thread 5 idx = 1 In thread 6 idx = 1 In thread 0 idx = 0 In thread 4 idx = 1 In thread 7 idx = 1 In thread 2 idx = 1 In thread 3 idx = 1 Listing 15 shows the code with the firstprivate directive. The output, as expected, prints idx initialized to 100 in all the threads. Listing 15. Using the firstprivate directive to initialize thread local variables #include <stdio.h> #include <omp.h> int main() { int idx = 100; #pragma omp parallel firstprivate(idx) { printf("In thread %d idx = %d\n", omp_get_thread_num(), idx); } } Also, note that you have used the omp_get_thread_num( ) method to access a thread's ID. This is different from the thread ID that the Linux® top command shows, and this scheme is just a way for OpenMP to keep track of the thread counts. Another note on the firstprivate directive if you are planning to use it with your C++ code: The variable that the firstprivate directive uses is a copy constructor to initialize itself from the master thread's variable, so having a copy constructor that is private to your class will invariably result in bad things. Let us move on to the lastprivate directive now, which in many ways is the other side of the coin. The lastprivate directive Instead of initializing a thread local variable with the main thread's data, you now intend to synchronize the main thread's data with whatever data the last ran loop count generated. The code in Listing 16 runs a parallel for loop. Listing 16. Using a parallel for loop with no data synchronization with the main thread #include <stdio.h> #include <omp.h> int main() { int idx = 100; int main_var = 2120; #pragma omp parallel for private(idx) for (idx = 0; idx < 12; ++idx) { main_var = idx * idx; printf("In thread %d idx = %d main_var = %d\n", omp_get_thread_num(), idx, main_var); } printf("Back in main thread with main_var = %d\n", main_var); } On my development computer with eight cores, OpenMP ends up creating six threads for the parallel for block. Each thread in turn accounts for two iterations of the loop. The final value of main_var depends on the last thread that ran, and therefore, the value of idx in that thread. In other words, the value of main_var does not depend on the last value of idx but the value of idx in whichever thread that ran last. The code in Listing 17 illustrates the point. Listing 17. The value of main_var depends on the last thread run In thread 4 idx = 8 main_var = 64 In thread 2 idx = 4 main_var = 16 In thread 5 idx = 10 main_var = 100 In thread 3 idx = 6 main_var = 36 In thread 0 idx = 0 main_var = 0 In thread 1 idx = 2 main_var = 4 In thread 4 idx = 9 main_var = 81 In thread 2 idx = 5 main_var = 25 In thread 5 idx = 11 main_var = 121 In thread 3 idx = 7 main_var = 49 In thread 0 idx = 1 main_var = 1 In thread 1 idx = 3 main_var = 9 Back in main thread with main_var = 9 Run the code in Listing 17 a couple of times to be convinced that the value of main_var in the main thread is always dependent on the value of idx in the last-run thread. Now, what if you want to synchronize the value of the main thread with the final value of idx in the loop? This is where the lastprivate directive comes in, which is illustrated in Listing 18. Similar to the code in Listing 17, run the code in Listing 18 a few times to convince yourself that the final value of main_var in the main thread is 121 ( idx being the final loop counter value). Listing 18. Using the lastprivate directive for synchronization #include <stdio.h> #include <omp.h> int main() { int idx = 100; int main_var = 2120; #pragma omp parallel for private(idx) lastprivate(main_var) for (idx = 0; idx < 12; ++idx) { main_var = idx * idx; printf("In thread %d idx = %d main_var = %d\n", omp_get_thread_num(), idx, main_var); } printf("Back in main thread with main_var = %d\n", main_var); } Listing 19 shows the output of Listing 18. Listing 19. Output from the code in Listing 18 (note that the main_var always value equals 121 in the main thread) In thread 3 idx = 6 main_var = 36 In thread 2 idx = 4 main_var = 16 In thread 1 idx = 2 main_var = 4 In thread 4 idx = 8 main_var = 64 In thread 5 idx = 10 main_var = 100 In thread 3 idx = 7 main_var = 49 In thread 0 idx = 0 main_var = 0 In thread 2 idx = 5 main_var = 25 In thread 1 idx = 3 main_var = 9 In thread 4 idx = 9 main_var = 81 In thread 5 idx = 11 main_var = 121 In thread 0 idx = 1 main_var = 1 Back in main thread with main_var = 121 A final note: Supporting the lastprivate operator for a C++ object requires that the corresponding class have the operator= method publicly available. Merge sort with OpenMP Let us look at a real-world example in which knowing OpenMP will help you save on the run time. This is not a heavily optimized version of merge sort, but it is enough to show the benefits of using OpenMP in your code. Listing 20 shows the example's code. Listing 20. Merge sort using OpenMP #include <omp.h> #include <vector> #include <iostream> using namespace std; vector<long> merge(const vector<long>& left, const vector<long>& right) { vector<long> result; unsigned left_it = 0, right_it = 0; while(left_it < left.size() && right_it < right.size()) { if(left[left_it] < right[right_it]) { result.push_back(left[left_it]); left_it++; } else { result.push_back(right[right_it]); right_it++; } } // Push the remaining data from both vectors onto the resultant while(left_it < left.size()) { result.push_back(left[left_it]); left_it++; } while(right_it < right.size()) { result.push_back(right[right_it]); right_it++; } return result; } vector<long> mergesort(vector<long>& vec, int threads) { // Termination condition: List is completely sorted if it // only contains a single element. if(vec.size() == 1) { return vec; } // Determine the location of the middle element in the vector std::vector<long>::iterator middle = vec.begin() + (vec.size() / 2); vector<long> left(vec.begin(), middle); vector<long> right(middle, vec.end()); // Perform a merge sort on the two smaller vectors if (threads > 1) { #pragma omp parallel sections { #pragma omp section { left = mergesort(left, threads/2); } #pragma omp section { right = mergesort(right, threads - threads/2); } } } else { left = mergesort(left, 1); right = mergesort(right, 1); } return merge(left, right); } int main() { vector<long> v(1000000); for (long i=0; i<1000000; ++i) v[i] = (i * i) % 1000000; v = mergesort(v, 1); for (long i=0; i<1000000; ++i) cout << v[i] << "\n"; } Using eight threads to run this merge sort gave me a run time execution time of 2.1 seconds, while with one thread it was 3.7 seconds. The only thing worth remembering here is that you need to be careful with the number of threads. I started off with eight threads: The mileage can vary according to your system configuration. However, without the explicit thread count, you would end up creating hundreds if not thousands of threads, and the probability that the system performance would degrade is pretty high. Also, the sections pragma discussed earlier has been put to good use with the merge sort code. Conclusion That is it for this article. We covered a fair bit of ground here: You were introduced to OpenMP parallel pragmas; learned different ways to create threads; convinced yourself of the better time performance, synchronization, and fine-grained control that OpenMP provides; and wrapped it all up with a practical application of OpenMP with merge sort. There is a lot more to study, though, and the best place to check it out is the OpenMP project site. Be sure to check the Related topics section for additional details. Downloadable resources Related topics - Be sure to check out the OpenMP project site. - For more information on improving merge-sort performance, read Shared Memory, Message Passing, and Hybrid Merge Sorts for Standalone and Clustered SMPs by Atanas Radenski.
https://www.ibm.com/developerworks/aix/library/au-aix-openmp-framework/index.html
CC-MAIN-2018-17
refinedweb
3,722
61.67
Overflow when defining points on elliptic curve I have the following elliptic curve in SAGE: p1 = 2^256-189 E10 = EllipticCurve(GF(p1),[-3,0]) I want to find points of different orders and multiply them with a number. However when I try to get SAGE to define or print a point like P=E10.points()[19] I get the following error: Error in lines 1-1 Traceback (most recent call last): File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 982, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_finite_field.py", line 214, in points v = self._points_via_group_structure() File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_finite_field.py", line 156, in _points_via_group_structure for m in range(1,ni[0]): OverflowError: Python int too large to convert to C long So far I have only suceeded in finding the point (0,0) of order 2 but I also need points of higher order. Is there any way to fix this overflow error or find points of different orders that SAGE can actually handle without getting overflow or is my curve just impossible to work with? I started out trying to print the list of all points and their orders but that resulted in the error. Then I tried printing only one point and now I am simply trying to define the points without printing them (however I need to print k*P for some k later on for all the points). I got the point (112810383992036387042877104932833846002363090508032041943368137894367452952778,85347934490306136025376423714596250175969011873639765034628869535783033211301) using E10.gens() but I can't define it getting the error: ValueError: libGAP: Error, E: <n> must be a positive integer (not a integer (>= 2^60)) So I am suspecting that it is not possible to get any useful points on this curve. If so can anyone explain to me why it is so (with some references if possible)? The error you encounter: has nothing to do with elliptic curves: Your elliptic curve is called E10, not E. You;d make it easier to diagnose if you'd include the exact command that triggered the error for you. Eby default is bound to a function that constructs n-th roots of unity (don't ask me how THAT escaped into the global namespace!) That is weird since I don't have a curve named E in my code. I just tried to say E10(x,y). But I have got the points I need now thanks to the answers
https://ask.sagemath.org/question/36709/overflow-when-defining-points-on-elliptic-curve/?answer=36715
CC-MAIN-2020-45
refinedweb
443
60.14
Let's do a careful study of where that time is going. We're going to test the JVM itself, the JVM with Clojure, and the JVM with Clojure and Leiningen. Table of Contents - Why is JVM startup so slow? - What does the JVM do when it starts up? - But is it really slow? - Running Clojure - Running Leiningen - Running code - Conclusions Why is JVM startup so slow? The easiest answer is that startup time has never really been a big focus. Most JVMs run on servers for a long time. So most installations don't care if it takes a few more seconds. What does the JVM do when it starts up? There are three things the JVM does when it starts. - It grabs a bunch of memory for the initial heap. - It loads in the classfiles (bytecode) it needs to run. - It initializes needed classes. Some classes do quite a lot. Then it can run your code. Now, this is complicated (or simplified?) a little because the JVM will lazily load and initialize classes as they are needed. But, still, the classes can't be used until they're initialized. And very often you have to initialize quite a lot of classes even for the simplest programs. But is it really slow? I'm all for experimentation for questions like this. Just like we can work at the REPL to understand our Clojure code's behavior, we can similarly do some benchmarking in our terminals. Let's start with a super simple Java program that does nothing, in the file Nothing.java. class Nothing { public static void main(String[] args) { } } I'll compile it with javac Nothing.java then run it: > time java Nothing real 0m0.101s user 0m0.083s sys 0m0.021s I've run it several times and it's always very close to this answer. That's actually pretty fast. Starting the JVM, grabbing the memory for the heap, and then exiting takes one tenth of a second. When I try to change the heap size by passing command line arguments, it seems to take longer by a few milliseconds. Perhaps just parsing the arguments adds time. It doesn't seem to matter how big I make the heap. Even a 4GB heap takes the same amount of time. I can count the number of classes being loaded like this: java -verbose:class Nothing | grep Loaded | wc -l I get: 429 So just to do nothing, we're loading 429 classes! That's good to know. So that's probably a lower limit. Running Clojure Let's do the same test with a minimal Clojure example. Luckily, Clojure lets us pass in a program on the command line. So we don't even need a file. This simplest program is just nil. > time java -cp clojure-1.8.0.jar clojure.main -e nil real 0m0.780s user 0m1.340s sys 0m0.093s This one took about a second. Where is the extra time going? java -verbose:class -cp clojure-1.8.0.jar clojure.main -e "nil"|grep Loaded|wc -l It loads 1988 classes! Just reading the output of the -verbose:class option yourself will be instructive. Here's an excerpt: ... [Loaded clojure.main$repl from file:clojure-1.8.0.jar] [Loaded clojure.main$repl$fn__7404 from file:clojure-1.8.0.jar] [Loaded clojure.main$repl$fn__7406 from file:clojure-1.8.0.jar] [Loaded clojure.main$load_script from file:clojure-1.8.0.jar] [Loaded clojure.main$init_opt from file:clojure-1.8.0.jar] [Loaded clojure.main$eval_opt from file:clojure-1.8.0.jar] [Loaded clojure.main$init_dispatch from file:clojure-1.8.0.jar] [Loaded clojure.main$initialize from file:clojure-1.8.0.jar] [Loaded clojure.main$main_opt from file:clojure-1.8.0.jar] ... [Loaded clojure.core.server$start_server from file:clojure-1.8.0.jar] [Loaded clojure.core.server$stop_server from file:clojure-1.8.0.jar] [Loaded clojure.core.server$stop_servers from file:clojure-1.8.0.jar] [Loaded clojure.core.server$parse_props from file:clojure-1.8.0.jar] [Loaded clojure.core.server$start_servers from file:clojure-1.8.0.jar] ... Those "classes" are actually functions defined in Clojure. Running Leiningen Let's testing Leiningen. I created a new Leiningen project depending on Clojure 1.8. > time lein run -m clojure.main -e nil real 0m2.506s user 0m2.554s sys 0m0.267s Wow! That's a lot of time. Two-and-a-half seconds. First, we can try to AOT compile it and build an uberjar. In project.clj: :main clj-test.core :profiles {:uberjar {:aot :all}} In clj-test/core.clj: (ns clj-test.core (:gen-class)) (defn -main [& args]) Then: > lein uberjar > time java -jar target/clj-test-0.1.0-SNAPSHOT-standalone.jar real 0m0.913s user 0m1.709s sys 0m0.120s That's not bad. Let's try a lein trampoline (which starts two JVMs): > time lein trampoline run -m clojure.main -e nil real 0m2.416s user 0m2.931s sys 0m0.302s Well, that didn't help. But I remember reading about an environment variable called LEIN_FAST_TRAMPOLINE. Let's try setting that: > LEIN_FAST_TRAMPOLINE=y time lein trampoline run -m clojure.main -e nil real 0m0.964s user 0m0.913s sys 0m0.143s Wow! So that is fast. Just under a second. It's back down to around the same time as not using Leiningen. I am going to set that flag in my .bash_profile! Running code So far, we're not running any interesting code. But it's clear that startup times will only go up if you've got code in your system. And real applications do a lot of stuff at startup: initializing logging, setting up the server, reading in configuration files, etc. If you're running Clojure files, they'll have to be parsed and compiled. Any required namespaces will have to be read in, parsed, and compiled as well. AOTing your code will definitely help by eliminating the parsing and compilation. Conclusions Running Clojure takes a lot of time above the JVM startup time. It has to load a lot of classes. Different setups take more and less time. But it looks like the minimum on my machine is about one second when using Clojure. And that brings up a good point: it tooke me about 30 minutes to test all of these variations and figure out which commands were faster and which slower. You can do this, too! In fact, others have done similar things. Alex Miller analyzed a lot of different variations. Nicholas Kariniemi analyzed where time went when booting Clojure. Joe Kutner analyzed JVM startup times for Spring. And the JRuby Wiki has some information about making JRuby boot faster. Now, I hope this shows that the JVM is a fine platform. I hope you want to learn more about it, and how to make use of it with Clojure. I've got a course teaching all the JVM stuff I learned from ten years of experience that I still use as a Clojure programmer. You can also get it as part of a membership, along with all of the other courses. What is clear is that Clojure (or JRuby or Spring) are what take a long time to load, not the JVM. Clojure can take 7-9x the time the entire JVM takes. So how do Clojure programmers deal with long startup times? We'll touch on that next time!
https://purelyfunctional.tv/article/the-legend-of-long-jvm-startup-times/
CC-MAIN-2020-34
refinedweb
1,251
72.02
Put timestamps on Image's name into a bag I have a folder containing sequence of images with the timestamp which is also the name of each image. I create a bag containing "image topic" , and i want to set header of this topic by these timestamps. But when i run this bag , i think speed of this topic is really fast; It runs just within 2s when normally , the sequence of image(30Hz) runs within 30s. def getImageFilesFromDir(dir): '''Generates a list of files from the directory''' image_files = list() timestamps = list() if os.path.exists(dir): for path, names, files in os.walk(dir): for f in files: if os.path.splitext(f)[1] in ['.bmp', '.png', '.jpg']: image_files.append( os.path.join( path, f ) ) timestamps.append(os.path.splitext(f)[0]) #sort by timestamp sort_list = sorted(zip(timestamps, image_files)) image_files = [file[1] for file in sort_list] return image_files def loadImageToRosMsg(filename): image_np = cv2.imread(filename, cv2.IMREAD_GRAYSCALE) timestamp_nsecs = os.path.splitext(os.path.basename(filename))[0] timestamp = rospy.Time( secs=int(timestamp_nsecs[0:-9]), nsecs=int(timestamp_nsecs[-9:]) ) rosimage = Image() rosimage.header.stamp = timestamp rosimage.height = image_np.shape[0] rosimage.width = image_np.shape[1] rosimage.step = rosimage.width #only with mono8! (step = width * byteperpixel * numChannels) rosimage.encoding = "mono8" rosimage.data = image_np.tostring() return rosimage, timestamp try: bag = rosbag.Bag(parsed.output_bag, 'w') #write images camfolders = getCamFoldersFromDir(parsed.folder) for camfolder in camfolders: camdir = parsed.folder + "/{0}".format(camfolder) image_files = getImageFilesFromDir(camdir) for image_filename in image_files: image_msg, timestamp = loadImageToRosMsg(image_filename) bag.write("/{0}/image_raw".format(camfolder), image_msg, timestamp) You could have each iteration sleep the time difference between the last image and the current one, but why would you want it to run slower? in fact, i put this as the input of SLAM system, the frequency of images reaches normally 30 Hz. What i don't understand is that i put the timestamp of each image in the header of this bag. it means that frequency have to be 30Hz if all things are right. I misunderstood the question before. Update the question with a list of filenames ( ls -1in a camera folder) and the timestamps that were put into the bag ( rostopic echo /folder/image_raw/header/stampwhile playing the bag) then it could be seen if your code is good. Also the indentation in your quoted code is messed up, making it hard to read.
https://answers.ros.org/question/269414/put-timestamps-on-images-name-into-a-bag/
CC-MAIN-2021-31
refinedweb
398
50.43
The HippoDraw's sihippo Python extension module is used with PyQt. Thus it uses the SIP tool to built the Python extension module. Modules built with SIP are not compatible with those built with SWIG or Boost.Python. A complete HippoDraw application written in Python can be as simple as this... > python Python 2.2.3 (#1, Jun 21 2003, 08:34:26) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> from qt import * >>> app = QApplication ( sys.argv ) >>> from sihippo import * >>> window = CanvasWindow() >>> window.show() >>> app.exec_loop() This produces the equivalent of the HippoDraw stand-a-lone application. With this release, Not all of HippoDraw's C++ library has been exposed to Python. Although this could be done, as was done with PyQt, it is not believed to be necessary. Rather, selected high level components have been exposed. More can be exposed in future releases as needed. It is perhaps more interesting to add the HippoDraw to an existing application. This can be done by using a HippoDraw display as a Qt widget, or by adding a canvas window and Inspector to an existing application. The testwidget.py file in the sip subdirectory demonstrates using HippoDraw library as a Qt widget. Its contents is... import sys from qt import * app = QApplication ( sys.argv ) from sihippo import * ntc = NTupleController.instance() nt = ntc.createNTuple ( '../../hippodraw/examples/aptuple.tnt ) dc = DisplayController.instance(); plotter = dc.createDisplay ( "Histogram", nt, [ 'Cost' ] ) view = QtViewWidget() view.setPlotter ( plotter ) view.resize ( 400, 400 ) app.setMainWidget ( view ) view.setCaption ( "Qt Hippodraw - View widget" ) view.show() app.exec_loop() Note that the HippoDraw library interface with SIP mirrors the C++ interface. Also since calls to these member functions are being done from the same thread as the one that Qt QApplication object created, no locking or unlocking of the application is needed. The results looks like this... Window with HippoDraw Qt widget. At SLAC, a data acquisition system was built entirely with Python and PyQt. HippoDraw was added to it to display the collected data. The run control panel is initialized in its startup member function like this... import sys from qt import * from sihippo import * import RunControl as rc def startup(): # Start up run control app = QApplication(sys.argv) QObject.connect(app, SIGNAL("lastWindowClosed()"), app, SLOT("quit()")) canvas = CanvasWindow() canvas.show() runCtl = rc.RunControl() app.setMainWidget(runCtl) runCtl.show() app.exec_loop() The result is a run control panel, a HippoDraw Canvas Window Users Guide and the HippoDraw Inspector Users Guide. Elsewhere, this example application creates two empty one column NTuples to monitor the run. The code looks like this label1 = ['Strip Hits'] label2 = ['Event Size'] ntc = NTupleController.instance() self.__nt = ntc.createNTuple(1) self.__nt2 = ntc.createNTuple ( label2 ) self.__nt.setTitle('Event Readout #1') self.__nt2.setTitle('Event Readout #2') self.__nt.setLabels(label1) self.__nt.reserve ( 512 ) self.__nt2.reserve ( 512 ) Later in this application's code, two displays are created like this... wc = WindowController.instance() canvas = wc.currentCanvas() dc = DisplayController.instance() hist = dc.createDisplay ( 'Histogram', self.__nt, label1 ) hist2 = dc.createDisplay ( 'Histogram', self.__nt2, label2 ) canvas.addDisplay(hist) canvas.addDisplay(hist2) self.__nt.setIntervalCount ( 500 ) self.__nt2.setIntervalCount ( 100 ) Again, the SIP built interface mirrors the C++ interface. At this point we have displays attached to an empty ntuples. As the ntuples get filled. they send an Observer::update message to their observers. This will cause the displays to be refreshed. The NTuple::setIntervalCount slows down the refresh rate so that application can spend more time collecting data. The first ntuple sends the update message only for every 500 updates of the ntuple, while the second only 100 updates. The startRun member function looks like this... self.__nt.clear() self.__nt2.clear() wc = WindowController.instance() canvas = wc.currentCanvas() canvas.setIntervalEnabled ( 1 ) cnt = self.__arg.getValue("Enter number of triggers to take") The ntuples are cleared at the beginning of a run. The interval counting is enabled by calling CanvasWindow::setIntervalEnabled member function. It forward the enabling message to all the ntuples that have displays in the window. At the end of the run, interval counting will be turned off so that the displays will refresh to the current state of the ntuple. The event processing is not very interesting but looks like this... def process(self, buffer): "Method called back for each data event taken" self.evtCli.evDumpTKR() for stripData in self.evtCli.evt.TKRstrips: self.__nt.addRow([stripData.ui]) self.__nt2.addRow([self.evtCli.evt_size]) Thus, the ntuples are built row by row. This applications collects about 80 events per second. With the interval counting enabled, the histograms still refresh about once a second. Without interval counting, the event rate would be cut in half, because the application would be spending so much time drawing new histograms.
http://www.slac.stanford.edu/grp/ek/hippodraw/python_appli.html
CC-MAIN-2015-11
refinedweb
806
53.78
XQuery/Overview of Page Scraping Techniques Motivation[edit] You want a toolkit for pulling information out of web pages, even if those pages are not well formed XML files. Method[edit] XQuery is an ideal toolkit for manipulating well-formed HTML; you need only use the doc() function, e.g. doc('') or doc('/db/path/to/index.html'). But, if a webpage is not well-formed XML, you will get errors about the source not being well-formed. Luckily, there are programs that transform HTML files into well-formed XML files. eXist provides several such tools. One is the httpclient module's get function, httpclient:get(). To use this function you need to enable the httpclient module, by modifying the conf.xml file so that the module is loaded the next time you start eXist. Uncomment the following line: <module class="org.exist.xquery.modules.httpclient.HTTPClientModule" uri="" /> For example the following example performs an HTTP GET on the list of all the feeds from the IBM web site: let $feeds-url := '' let $data := httpclient:get(xs:anyURI($feeds-url), true(), <Headers/>) return $data Sometimes the HTML is so malformed that even httpclient:get() will not be able to salvage the HTML. For example, if an element has two @id elements, you will get the error, "Error XQDY0025: element has more than one attribute 'id'". In this case, you may need to download the HTML source and clean up the HTML just enough so that eXist can parse the rest. Then, store the file in your database, and use the util:parse-html() function (which passes the text through the Neko HTML parser to make it well-formed). The following XQuery will clean up HTML (saved as text file, because it is still malformed): let $html-txt := util:binary-to-string(util:binary-doc('/db/html-file-saved-as-text.txt')) let $data := util:parse-html($html-txt) return $data Testing your HTTP Client with an Simple Echo Script[edit] Once you have the have the results in Source code for echo.xq xquery version "1.0"; declare namespace httpclient=""; let $feeds-url := '' let $http-get-data := httpclient:get(xs:anyURI($feeds-url), true(), <Headers/>) return <echo-results> {$http-get-data} </echo-results>
https://en.wikibooks.org/wiki/XQuery/Overview_of_Page_Scraping_Techniques
CC-MAIN-2016-44
refinedweb
373
62.58
mod_python support for MoinMoin this is all inside MoinMoin 1.2 release I have begun working on integrating mod_python into request.py (moin--main branch). But I have suspended work on it as mod_python doesn't work with python2.3 yet - so I wait for release 3.1 of it. -- ThomasWaldmann 2003-11-02 20:38:56 At what handler do you aim? mod_python Performance shows that we should try to make a native handler implementation if we want to go for speed. The publisher will be hardest to implement, because of the path traversal (similar to Zope and Bobo), which MoinMoin does not have. cgipublisher is the easiest, but also the slowest implementation. -- OliverGraf 2004-01-05 08:57:00 The native PythonHandler directive of mod_python should be fairly easy to implement, too. I'll see if I can get one running. Lets see if it can beat FastCGI... ( see PerformanceProposals) -- OliverGraf 2004-01-05 09:06:00 Class traversal of current (3.1.2b, 3.0.4, 2.7.10) modpy is broken. See HelpOnInstalling/ApacheWithModPython for a workaround. The bug seems to be fixed in mod_python cvs head. With this patch we can use the RequestModPy directly from PythonHandler directive. Example: .htaccess SetHandler mod_python PythonHandler test::Test.run test.py from mod_python import apache class Test: def __init__(self, req): self.req=req def run(self, req): self.req.content_type = "text/plain" self.req.write("Hello World!") return apache.OK So using MoinMoin with mod_python could be as easy as: SetHandler mod_python PythonPath "['/path/to/moin/moin/lib/python','/path/to/moin/moin/config']+sys.path" PythonHandler MoinMoin.request::RequestModPy.run -- OliverGraf 2004-01-05 10:22:00 Patch against moin--main--1.2 which gets modpy via PythonHandler working. BTW: Quick benchmark shows nearly identical speed to FastCGI, but much higher load (2 vs 25) Tested with cgi, fastcgi, Twisted and modpy. Plus the two new files for wiki/cgi-bin/ as extra files. committed to moin--main--1.2 TODO check https and http with uncommon port (especially AttachFile URLs as seen with Twisted) double check all RequestModPy methods some setup documentation (sample files) documentation added on HelpOnInstalling/ApacheWithModPython
http://www.moinmo.in/MoinMoinTodo/Release%201.2/ModPython
crawl-003
refinedweb
364
52.97
Python 3.6 and pythonista Is it possible to use pythonista with python 3.6? I’m trying to use it with ‘Learn python 3 the hard way’ but it doesn’t work on the new format commands such as print( f" Here's your file {filename}:") It also struggles with argv commands saying there are not enough arguments. Has anyone used it successfully with python 3.6 or is there an update somewhere that I’m missing? Python 3.6 support isn't ready yet, but it's coming soon, i.e. you cannot use Python 3.6 in Pythonista right now. By the way, the beta version has already included Python 3.6 for a while, and it's working quite well. I haven't noticed any problems specific to 3.6. (There's of course no guarantee that anything from the beta will be in the next release update, but it seems very likely.) With "argv commands" do you mean scripts where you would pass extra arguments in the shell like python3 myscript.py arg1 arg2 arg3? To do that in Pythonista, you can long-tap on the play button, which brings up a popup with extra options for running your script. In the text field at the top you can type arguments for your script. (You only need to type the arguments, like arg1 arg2 arg3, not a full python3command.) Also, a small note regarding LPTHW - you should be aware that the author has some strong opinions about Python 3. Until recently the book was Python 2 only and was extremely negative about Python 3. I don't have the full Python 3 edition, so I don't know how much that has changed. Just be aware that the author's opinion isn't that of the Python community in general. For a potential f-strings workaround, check out ok @ccc, i tried future_fstrings, and it does work, provided you: - pip install tokenize_rt - download future_fstrings.py, and copy into site packages - in your pythonista_startup, include the following: import future_fstrings future_fstrings.register() pretty neat idea (registering a custom encoding with codecs, which gets called on the file to transform it before it gets executed).
https://forum.omz-software.com/topic/4401/python-3-6-and-pythonista
CC-MAIN-2021-10
refinedweb
367
73.37
updated an older 0.6 installation from CVS yesterday and ran install.py Unfortunately, the installation process left some traces in Application.config and broke it. Until I fixed the file manually, Webware refused to start. Application.config is attached to this message. Just look for ">>>" or "<<<" to get to the parts that break the format. (Ob-Security: password has been changed) Regards, Fionn -- I believe we have been called by history to lead the world. G.W. Bush, 2002-03-01 On April 26, 2002 06:06 pm, Terrel Shumway wrote: > is for = a > concrete implementation that can go into Webware RSN that can replace > the current filesystem-centric mapping strategy. Tangent 1 ----------- This URI topic is somewhat related to how contexts/packages are loaded in= to=20 WebKit. The current implementation of ServletFactory relies on the 'imp'= =20 module and thus can't take any advantage of custom import hooks. As a=20 result, you have to create a new servlet factory for .tmpl files, .psp fi= les,=20 etc., in addition to any import hooks you've written. =20 The code in ServletFactory.importAsPackage() and=20 ServletFactory._importModuleFromDirectory could be refactored to allow it= to=20 work with import hooks and remove the need for a separate ServletFactory = for=20 each extension. It should be possible to use a single ServletFactory for= =20 =2Epy, .psp, and .tmpl servlets once the refactoring has been done and an= =20 import hook has been written for .psp files. =20 Tangent 2 ----------- The current implementation of psp doesn't allow one psp servlet to seemle= ssly=20 inherit from another psp servlet. An import hook would make this possibl= e.=20 Ditto for .tmpl files. I've written an import hook for .tmpl files (usin= g=20 Gordon McMillan's ui.py rather than ihooks or imputils, which are both ba= dly=20 broken). See ImportManager.py and ImportHooks.py in Cheetah's CVS. It=20 should be fairly simple to extend this to work with PSP as well. Anyone=20 interested? Tavis I didn't mean to start a debate when I complained about Webware's simplistic URI mapping strategy. I was just giving a heads up to anyone trying to go where I had been. It looks like Kendall had already figured it out. Geoff: I don't have a problem with the current behavior being the default. When I designed URLDecode, preserving the existing behavior was a major goal. I don't remember why URLDecode never made it into Webware -- probably only because I didn't have the energy/time to polish it and push it through, or maybe because I just got distracted doing other things. (The perfectionist in me wanted to fix too many things. Starting Jaguar with a clean slate seemed easier.) Anyway, Geoff is at worst ambivalent, and there are at least three people who want very much to have the URI decoding fixed. What do we need to do to get it there? I have created two wiki topics for the discussion, since I think this fits better in wikispace than in mailing list space. is for high-level best practices that we have discussed in the WebDAV thread. is for a concrete implementation that can go into Webware RSN that can replace the current filesystem-centric mapping strategy. I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details
https://sourceforge.net/p/webware/mailman/webware-discuss/?viewmonth=200204&viewday=27&style=flat
CC-MAIN-2017-17
refinedweb
599
67.35
Hello Dave, hello Patrick, this is the tenth post of the patch series that adds the PF_CAN protocol family for the Controller Area Network. We've fixed some cosmetic issues as remarked by Arnaldo: * Rename our static debug variables to {can,raw,bcm,vcan}_debug. * Use module_param_named() so that the module option names remain. * Remove raw_poll() and bcm_poll() functions and use datagram_poll instead. * Cleanup of can_addr union in sockaddr_can. * Change type of echo module parameter to boolean. Thanks to all reviewers for the constructive feedback! Regards, urs The changes in try #9 were: * Changes suggested by Arnaldo Carvalho de Melo: - Use gfp_any() instead of checking in_interrupt(). - Don't kfree() the sk_protinfo field. * Fixed licence text as pointed out by Yoshifuji Hideaki and Patrick McHardy. * Added IFF_ECHO to include/linux/if.h and use that instead of IFF_LOOPBACK, as suggested by Eric W. Biederman. IFF_LOOPBACK is only for the normal loopback interface. The changes in try #8 were: * Some changes in debug code, following suggestions from Joe Perches: - Remove dynamically allocated buffer for debug output. - Use kernel functions for hexdumps. - Don't interpret printf-style %-sequences in can_debug_cframe(). - Specify the fixed argument "fmt" to DBG() macro and use GCC ## mechanism to remove , when args is empty. * Removed CAN_RAW_USER and CAN_BCM_USER Kconfig options following a suggestion from Patrick. * Prevent overflow in statistics calculation. * Minor optimization. The changes in try #7 were: * Changes suggested by Patrick: - protect proto_tab[] by a lock. - add _rcu to some hlist traversals. - use printk_ratelimit() for module autoload failures. - make can_proto_unregister() and can_rx_unregister() return void. - use return value of can_proto_register() and can_rx_register() (this also removed a flaw in behavior of raw_bind() and raw_setsockopt() in case of failure to can_rx_register() their filters). - call kzalloc() with GFP_KERNEL in case NETDEV_REGISTER. - use round_jiffies() to calculate expiration times. - make some variables static and/or __read_mostly. - in can_create() check for net namespace before auto loading modules. - add build time check for struct sizes. - use skb_share_chack() in vcan. - fixed some comments. * Typos in documentation as pointed out by Randy Dunlap and Bill Fink. The changes in try #6 were: *522 of. It can be found in the directory<version>.
http://article.gmane.org/gmane.linux.network/73736
crawl-002
refinedweb
354
61.33
Azure Release Notes (October 2012) Updated: January 12, 2015 This document contains the release notes for the Azure – October 2012 release. For more information related to this release, see the following resources: - New features inAzure - What's New in Azure - New features in the Azure Tools for Microsoft Visual Studio - What's New in the Azure Tools There are significant changes to Introducing Azure Storage Client Library 2.0 for .NET and Windows Runtime. In particular, you can receive the following error if you are using Azure Diagnostics in combination with the Storage Client Library version 2.0. Error: The type or namespace name 'StorageClient' does not exist in the namespace 'Microsoft.WindowsAzure' (are you missing an assembly reference?) Azure SDK versions 1.7 and earlier were developed before the availability of Azure SDK 1.8 no longer contains cloud service templates that target .NET Framework 3.5. As a result, you cannot create a new .NET framework 3.5 targeted cloud service with the Azure SDK 1.8. However, you can still open existing .NET framework 3.5 targeted cloud services in the Azure SDK 1.8. You are given an option to upgrade the project. Do not upgrade if you need to continue to support .NET Framework 3.5. For more information see October 2012 release section in What's New in the Azure Tools. The release notes for Azure Caching are available at Azure Caching Release Notes. The release notes for Service Bus are available at Service Bus Release Notes. The release notes for SQL Database are available at Known Issues in SQL Database. The release notes for the Management Portal for SQL Database are available atKnown Issues in the Management Portal for SQL Database. See Also Other ResourcesIntroducing Azure
https://msdn.microsoft.com/en-us/library/jj835813.aspx
CC-MAIN-2015-22
refinedweb
293
68.57
Short time). There are lots of standard implementations on the web, so the question is, what performance impact the implemenation of .hashCode() will have. I did some tests and here are the results. My test program uses a simple, nevertheless non-trivial, "PrimaryKey" class. This class has two integers (a and b). In a loop, I created one million of those "PrimaryKeys" and .put(PK, REF) them into a presized HashMap. Then, I tried to find them again using .get(PK). Both loops will access each of the one million objects exact once, and the time for .put() and .get() is measured separately. Using this test mockup I tried several algorithms. Here is the interesting result: public final int hashCode() { // return this.a + this.b; // 32876, 33578 // return this.a ^ this.b; // 48845, 48205 // return this.a; // 11016, 14266 // return this.b; // 49658, 49626 (worst case) // return this.a * 65536 + this.b; // 1672, 2437 (optimum, less readable) // return this.a + this.b * 65536; // 2063, 4063 return this.a << 16 ^ this.b; // 1672, 2453 (optimum, well readable) // return this.a ^ this.b << 16; // 2204, 4609 } The left number is the time for .put(), the right for .get(). As you can see, the algorithm has huge impact on performance. While the best implementation needs less than two seconds to write and less than three seconds to read all one million instances (what, BTW is fascinating, since this is Java - the language that everybody calls "slow"), a typically used algorithm like return "this.a ^ this.b;" needs nealry fifty (!) seconds. What a difference! Not to mention the nearly endless time that a simple (and idiotic) "return 0;" will produce... (I cancelled that one after several minutes. Yes: MINUTES!). Another interesting point is that there is no general optimum: Compare the last two algorithms and you will notice that both are essentially the same. While the first one (the optimum) is shifting a, the seconds one is shifting b. The answer is quite simple: Since our numbers range from 0 to 1000, shifting a leads to a strongly increased spread, while shifting b leads to weak spread increase (and the spread is what brings the performance). As the difference is 100% between those algorithms, this shows that the better one knows its data, the better the implementation can be optimized (and as a result, there is no general optimum). Conclusion: There is no generally optimal solution, but "return this.a << 16 ^ this.b;" will be optimal in the most cases. Another question is performance of Strings. Often the above algorithm cannot be used since the "PrimaryKey" class contains Strings. So what to do then? I changed my test to provide some more numbers. The test program was changed only slightly: While the general mockup is exactly the same, just the implementation of the "PrimaryKey" class is changed to internally store not integers but Strings (and certainly, .hashCode() and .equals() are modified). Using that changed mockup I tried several String algorithms. Here is the result: public final int hashCode() { // return this.a.hashCode() << 16 + this.b.hashCode(); // 36235, 35642 (worst case) // return (this.a + this.b).hashCode(); // 1360, 250 (skew!) // return (this.b + this.a).hashCode(); // 1515, 375 (skew!) // return (this.a + '|' + this.b).hashCode(); // 1156, 485 (good) // return (this.a + "|" + this.b).hashCode(); // 1156, 485 (good) return (this.a + "|~" + this.b).hashCode(); // 1156, 266 (optimum?) } I started with the optimal solution of the integer test and was shocked to see that it is actually the worst case for Strings. The reason seems to be that a call to String.hashCode() (possibly any method of any class?) needs some fixed base time independent of the String's length. And that time seems to be very huge. Adding the Strings before calling .hashCode() works better, but actually is highly dependent of your data (since "1" + "11" will be the same than "11" + "1", what might lead to skew spread and (as a result) very indeterministic results (you shouldn't do that in reality). To prevent this problem, the typical solution is to add a "seldomly used character" (mostly the pipe symbol) between both, to get "1|11" and "11|1" (both having different hash codes). The test proofs that the result still is good (while there is no test to proof for the skew, since this was out of scope of my tests). But what really funny is (and what nobody can every explain): Adding two "seldomly used" characters further improves performance! I hardly couldn't believe it, but it is true as you can see above. But be warned: That is just by pure incidence I think. I would nobody give the tip to add another character without having a good explanation for it. So the well known String algorithm (adding a pipe symbol) works pretty well, but due to the actual data you are using it might not be the optimal one. Conclusion: There is no generally optimal solution, but "return (this.a + '|' + this.b).hashCode();" should provide very good results in most cases. - Login or register to post comments - Printer-friendly version - mkarg's blog - 6247 reads apache-commons HashCodeBuilder by philistine - 2010-01-04 20:25Have you tried the apache commons-lang HashCodeBuilder? It is what I typically use to build my hash codes. I would be curious to see how it performs in your tests. These apache-commons Builder utilities are abominations by opinali - 2010-01-08 14:46 HashCodeBuilder, EqualsBuilder etc. - they require object allocation, which is a big no-no in critical methods like hashCode() and equals(). And the latest IDEs will generate these methods with MUCH superior quality, trust me (at least Eclipse does). I find it very interesting that some people just say things ... by esimioni - 2011-10-28 09:41 I find it very interesting that some people just say things like 'big no-no' and 'MUCH superior quality' without facts. I did run a set of tests in different JVMs (1.5, 1.6, 1.7 and IBM 1.5). The tests were very similar to the original post, I tested with 2 million objects, Eclipse (Indigo) generated vs Apache HashCodeBuilder and also Java core HashMap vs. FastMap (from Javolution). If you use Java HashMap the Eclipse generated will perform better, roughly around 50% faster on all JVMs (except for IBM, for which Apache implementation is always faster). If you use FastMap (and why wouldn't you if have heavy processes using Maps?) then Apache HashCodeBuilder is almost twice as fast, and the readability is way better. People that are truly concerned about quality and performance run tests, people that pretend to be concerned say things like 'abomination' and 'trust me'. Temporary Allocation is no problem with modern JVMs by mkarg - 2010-01-23 08:17 Our tests did not show any problem with short term object allocation on modern JVMs. Or in other words: It is a Java myth that allocation in loops is a problem in the real world. At least for most applications. Good question by cowwoc - 2010-01-04 16:48Regardless of your results, you bring up a very interesting (and fundamental) question. I hope to see more such posts in the future. More Interesting Stuff by mkarg - 2010-01-23 08:16 Stay Tuned. We do real world tests like this (i. e. non-academic discussion of what should be a good solution, but what proofed to be fast) every other week. We noticed that there is a big difference in what people (even from Sun and Oracle) write what they think and what our customers are reporting about what it really is like. One idea of this blog is to tell the truth from our view, which might be different from the truth from other's view. Not measuring hashCode(), bur rather HashMap by opinali - 2010-01-03 09:34 At least in your first test, the execution of hashCode() is virtually irrelevant - will consume a tiny amount of CPU cycles for all algorithms. The different performance that you observe should be attributed to the innards of HashMap. Hashcodes like a^b produce a large number of collisions, because (1) the hashcode's most significant bit is not higher than the max msb of a and b, a big problem if your test's PKs are not random samples of the range 0..2^32-1; (2) a^b == b^a, which reduces your hashcode variability by half. HashMap's performance will quickly degenerate from O(1) to O(N) for objects with poor hashcodes (lots of collisions). The a<<16+b hashcode is better, mostly for small values of a/b: you guarantee at least 16 bits of significant bits and no collisions for all values of a/b below 2^16 (for bigger values, the hashcode quality approaches that of a^b). As or the String test: please, don't EVER allocate objects (in this case, String and javac-generated StringBuilder objects) in a method like hashCode(). The allocation & GC costs may disappear in a synthetic benchmark that does only this in a tight loop (i.e. you basically fill the young-gen with these temp objects, and generational GCs is virtually instantaneous because the young-gen is stuffed with dead objects but GC time depends only on the number of live objects), but things may be very different in a real-world app workload. Theory and Practice by mkarg - 2010-01-23 08:20 In theory you are absolutely right. But in practice our customers reported that real world application performance actually was better after implementing our "optimal" solution. What does that mean? That there is a gap in what we all think should happen in real world applications to what actually does happen in the wild. I do not say anything against your arguments, they all are true. We just wanted to report that why ever in the real world there had no reports of negative effects but there had been reports of positive effects. So why ever, our benchmark actually predicted the result we got in the end. Your short test runs short of performance tips... by karakfa - 2010-01-04 12:04Agree with the previous post. Most alternatives you tried are bad practices. For example for your PrimaryKey class with two Integers or Strings a, b. You can try the pattern: p * (a != null ? a.hashCode() : 0) + (b != null ? b.hashCode() : 0); pick p a prime. Most IDE's will generate this for you.
https://weblogs.java.net/blog/mkarg/archive/2010/01/03/short-test-hashcode-performance
CC-MAIN-2014-15
refinedweb
1,751
65.73
A concurrent wrapper for OpenAI Gym library that runs multiple environments concurrently. Project description agymc For reinforcement learning and concurrency lovers out there ... TL;DR - Mostly the same API as gym, except now multiple environments are run. - Envs are run concurrently, which means speedup with time consuming operations such as backprop, render etc.. Intro This is a concurrent wrapper for OpenAI Gym library that runs multiple environments concurrently, which means running faster in training* without consuming more CPU power. What exactly is concurrency ? Maybe you have heard of parallel computing ? When we say we execute things in parallel, we run the program on multiple processors, which offers significant speedup. Concurrency computing has a broader meaning, though. The definition of a concurrent program, is that it is designed not to execute sequentially, and will one day be executed parallelly**. A concurrent program can run on a sigle processor or multiple processors. These tasks may communicate with each other, but have separate private states hidden from others. Why do we need concurrency on a single processor ? Some tasks, by nature, takes a lot of time to complete. Downloading a file, for example. Without concurrency, the processor would have to wait for the task to complete before starting to execute the next task. However, with concurrency we could temporarily suspend the current task, and come back later when the task finishes. Without using extra computing power. So much for introducing concurrency... now, what is gym ? OpenAI gym, is a Python library that helps research reinforcement learning. Reinforcement learning is a branch from control theory, and focusing mainly on agents interacting with environments. And OpenAI gym provides numerous environments for people to benchmark their beloved reinforcement learning algorithms. For you agents to train in a gym, they say. Um, so why do we need agymc, do you say ? Despite its merits, OpenAI gym has one major drawback. It is designed to run one agent on a processor at a time, only. What if you want to run multiple environments on the same processor at a time? Well, it will run, sequentially. Which means slow if you want to train a robot in batches. Experiments Using env.render as our bottlenecking operation, runing 200 environments, our version agymc completes 50 episodes in 4 minutes, while naive gym version takes around twice as long. This is what the madness looks like: Wow, how to use agymc ? agymc, which combines the power of Python async API and OpenAI gym, hence the name, designed for users to make final Except now the returns are in batches (lists). And except serveral environments are run asynchronously. Example Usage Code Snippet import argparse import agymc if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--num-envs", type=int) parser.add_argument("--episodes", type=int) parser.add_argument("--render", action="store_true") parser.add_argument("--verbose", action="store_true") flags = parser.parse_args() num_envs = flags.num_envs num_episodes = flags.episodes render = flags.render verbose = flags.verbose envs = agync.make("CartPole-v0", num_envs) if verbose: import tqdm iterable = tqdm.tqdm(range(num_episodes)) else: iterable = range(num_episodes) for _ in iterable: done = list(False for _ in range(num_envs)) envs.reset() while not all(done): if render: envs.render() action = envs.action_space.sample() (_, _, done, _) = envs.step(action) envs.close() * When doing pure gym operation such as sampling, stepping, this library runs slower since this is a wrapper for gym. However, for actions that takes a while to execute, such as backprop and update, sending data back and forth, or even rendering, concurrency makes the operations execute much faster than a naive gym implementation ** If you would like to learn more about concurrency patterns, this video is really informative. Project details Release history Release notifications 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/agymc/
CC-MAIN-2020-10
refinedweb
636
51.75
In this post, I will lay down the major principles of Functional Programming, starting with the basics and then exploring more advanced concepts. I'll first talk about why you should bother with Functional Programming, that is when it's useful and when it's not. We will cover a lot of stuff here, so please go at your own pace. Take some breaks and naps between your reading sessions and do the exercises I propose. Of course, you can skip sections or go back and fourth depending on your needs. This post intentionally targets several kind of readers: - Those who know almost nothing about FP but are pretty familiar with JavaScript - Those with an Intermediate knowledge of FP and some familiarity with the paradigm, but who want a clearer picture of the whole and want to explore advanced concepts - Those who know a lot about FP and want a cheatsheet+ to revisit some concepts if needed I invite you to ponder each sentence carefully instead of rushing through the content like we're all used to. I hope this post will be an important milestone in your journey into Functional Programming, as well as a source of information to go back to when needed. Just a heads up, though – this post doesn't constitute a single source of truth but rather an invitation to go further after reading it. In other words, it's meant to be revisited and expanded with further resources and practice. I hope to clarify the functional landscape in your mind, spark your interest for what you didn't know, and more importantly, provide useful tools for your day-to-day projects. Without further ado, let's get started! Why Functional Programming? In my opinion, there are 3 major benefits to FP and 3 (little) drawbacks: Advantages: - More readability, thus maintainability - Less buggy, especially in concurrent contexts - A new way of thinking about problem solving - (Personal bonus) Just great to learn about! Drawbacks: - Can have performance issues - Less intuitive to work with when dealing with state and I/O - Unfamiliar for most people + math terminology that slows the learning process Now I'll explain why I think that. Increased Readability First, Functional Programming is often more readable because of its declarative nature. In other words, the code is focused on describing the outcome of the computations, not the computations themselves. Kyle Simpson phrases it like this: Declarative code is code that's more focused on describing the "what" outcome. Imperative code (the opposite) is focused on precisely instructing the computer "how" to do something. Because we spend the vast majority of our time reading code (around 80% of the time I guess) and not writing it, readability is the first thing we should enhance in order to increase our efficiency when programming. It's also very likely that you'll return back to a project after several weeks of not touching it, so all the context loaded in your short-term memory will have disappeared. Thus, understanding your imperative code will not be as easy as it was. The same thing goes for the potential colleagues that work with you on the project. So readability is a huge advantage for an ever more important purpose: maintainability. I could stop arguing right there. Increased readability should give you major motivation to learn Functional Programming. Luckily, that's an advantage that you'll experience more and more as you get familiar with the paradigm. No need to be an expert. The moment you write a declarative line of code you'll experience it. Now the second argument. Less buggy code Functional programs are less buggy, especially in concurrent contexts. Because the functional style strives to avoid mutations, shared resources will not have unexpected contents. For example, imagine that 2 threads access the same variable. If this variable can be mutated, then, as the programs grow, you'll likely not get what you want when re-accessing it. In addition, the rise of multiprocessor systems allows multiple threads to execute in parallel. So now there's also a risk of overlapping (one thread may try to write while the other tries to read). It's kind of a shame not to leverage the hardware because we're not able to make the software work. However, JavaScript is single-threaded and my personal experience doesn't expand much beyond it. Thus, I'm less confident in this argument, but more experienced programmers seem to agree on that fact (for what I've heard/read). Problem solving Finally, the last advantage – and more important than you might think – is that Functional Programming gives you a new way of thinking about problem solving. You might be so used to solving problems using classes and objects (Object-Oriented Programming) that you don't even think there might be a better way to do so. I'm not saying that Functional Programming is always better. I'm saying that it will be better in certain cases and that having this knowledge will (re)open your mind and make you a better programmer. Because now you'll have more tools and an increased capacity to choose the right one for the problem at hand. I even think that some core principles in FP can translate to problem solving outside the domain of computers. Let's see the drawbacks now. Performance issues The first is that, by applying FP techniques, you can end up using a lot of time and/or memory. Because you don't want to mutate things, the process is basically to copy the data, then mutate that copy and use it as the current state. This means that the original data is left untouched but you allocate a bunch of time and memory to make the new copy. So when you make a lot of copies (really big nested objects) or use techniques like recursion (accumulating layers in the callstack), performance issues may appear. However, many solutions exist (structural sharing, tail-call optimization) which make poor performance very rare. Less intuitive The second drawback is when you need state or I/O operations. Well, you're gonna say: Computers are stateful machines! And eventually I'll need to call my database, or display something on the screen, or write a file. I totally agree. The thing is to remember that Functional Programming is a style convenient for humans, but machines make imperative operations (aka mutations) all the time. That's just how it works at the lowest level. The computer is in one state at a given moment and it changes all the time. The point of FP is to ease our reasoning about the code which increases the chances that the messy stuff that comes out of it actually works. And Functional Reactive Programming helps us deal with state (if you want to learn more, there are links at the end of the post). Even if imperative code seems easier/more intuitive at first sight, you'll eventually lose track. I'm pretty confident that if you make the initial efforts of learning FP, it will pay off. For I/O – short for Input/Output, that is code that transfers data to or from a computer and to or from a peripheral device – we can't have pure isolated functions anymore. To deal with that, we can take a Functional Core Imperative Shell approach. In other words, we want to do as much as we can in a functional way and push back the I/O operations to the outer layer of the program: Steeper learning curve Finally, the last drawback is that Functional Programming is kind of cluttered with math terminology. This often creates unnecessary friction when developers are trying to learn it. It's likely because this style of programming first appeared in the academic world and stayed there a long time before emerging and becoming more popular. However, these technical/unfamiliar terms shouldn't make you neglect the very powerful mathematical principles that underlie them. All in all, I think the strengths of FP outweigh the weaknesses. And functional programming makes a lot of sense for the majority of general-purpose JavaScript programming. Just keep in mind that there are few programs with peculiar requirements for which FP is not a good fit. But if that's not your case, there's no reason not to leverage this paradigm. Now, if you're a total beginner you might be feeling a bit lost. It's ok – bear with me. The following sections will clarify the concepts I referred to here. Now let's dive into the nuts and bolts of functional programming. Data, Calculations, and Actions In FP, you can break down your program in 3 parts: data, calculations and actions. Data The data is, well, the data. In our languages, they have different forms, different types. In JavaScript you have numbers, strings, arrays, objects, and so on. But at the end of the day, they are just bits. Data are the building blocks of the program. Having none of it is like having no water in an aquatic park. Then we can do things with the data: calculations or actions. Calculations Calculations are mathematical-like transformations of the data. Functions are a way to create them. You provide it a set of inputs and it returns you a set of outputs. That's it. It does nothing outside the function, like in math. The world around the function is not impacted. In addition, if you feed the function with the same input multiple times, it should always give you the same output. A common term for this type of function is pure function. Because of its characteristics, its entire behavior is known in advance. In fact, because it just returns a value, we can treat it as that value, as data. In other words, we could replace the function call by the value it returns and it would not change the state of the program. This is called referential transparency. Thus, they're really easy to reason about, and you can use them as function input or output and assign them to variables. These kinds of functions are called first-class functions. In JavaScript, all functions are first-class. It's safe to use pure functions because, again, they're like values. For functions that do more than return a value, you rely on human memory. That's a bad strategy, especially for large software with multiple people working on it. So you can use pure functions as a replacement for calculations. They are identical. Now let's talk about actions. Actions Of course, we also need functions that impact the outside world, that actually do something. Otherwise, your program would be a calculator without screen. When a function impacts things outside of itself, we say that it has side-effects. As opposed to pure functions, it is said to be impure. Common side-effects are assignments/mutations of variables outside the function, logging to the console, making an API call, and so on. So basically, actions and impure functions are the same. Here's a simple example to illustrate these concepts: // ↓ variable // ↓ data let a = 3; // Calculation / Pure function const double = (x) => x * 2; double(a); // 6 // Action / Impure function const IncThenPrint = () => { // assignment of a variable outside the scope of the function a = a + 1; // do something (here printing) outside the function console.log(a); }; IncThenPrint(); // console: 4 Data, calculations, and actions in functional programming In FP, the objective is to separate the data, the calculations, and the actions while striving to do most of the job with calculations. Why? Because actions rely on the outside world. We don't have total control on it. Thus, we may get unexpected results/behaviors out of it. So if the majority of your program is made of actions, it quickly becomes a mess. Taking the previous example, what if somewhere else in the program, someone decided to assign an object to the variable a ? Well, we'll get an unexpected result when running IncThenPrint because it makes no sense to add 1 to an object: let a = 3; // ... a = { key: "value" }; // ... // Action / Impure function const IncThenPrint = () => { // assignment of a variable outside the scope of the function a = a + 1; // do something (here printing) outside the function console.log(a); // prints: 4 }; IncThenPrint(); // prints: [object Object]1 // (Because JavaScript is a dynamically-typed language, it converts both operands of the + operator // to strings so it can perform the operation, thus explaining the result. // But obviously, that not what was intended.) The ability to differentiate data, calculations, and actions in your program is a fundamental skill to develop. Mapping Mapping is a fairly trivial but very important concept in the world of functional programming. "Mapping from A to B" means going from A to B via some association. In other words, A points to B by means of some linkage between them. For example, a pure function maps an input to an output. We can write it like this: input --> output; where the arrow indicates a function. Another example are objects in JavaScript. They map keys to values. In other languages, this data structure is often called a "map" or "hash-map", which is more explanatory. Like the latter term infers, the thing that happens behind the scene is that each key is linked to its value via a hash function. The key is passed to the hash function which returns the index of the corresponding value in the array that stores them all. Without going into further detail, I wanted to introduce this term because I'll use it throughout this article. More on side-effects Before we move on, I want to go deeper into side-effects in JavaScript and showcase a vicious pitfall that you may not be aware of. To remind ourselves, saying that a function has side-effects is the same as saying, "When this function runs, something outside of its scope will change." Like I said, it can be logging to the console, making an API call, changing an outer variable, etc. Let's see an example of the latter: let y; const f = (x) => { y = x * x; }; f(5); y; // 25 That's pretty easy to grasp. When f runs, it assigns a new value to the outer variable y, which is a side-effect. A pure version of this example would be: const f = (x) => x * x; const y = f(5); // 25 But there's another way to change an outer variable that's more subtle: let myArr = [1, 2, 3, { key: "value" }, "a string", 4]; const g = (arr) => { let total = 0; for (let i = 0; i < arr.length; i++) { if (Number.isNaN(Number(arr[i]))) { arr[i] = 0; } total += arr[i]; } return total; }; g(myArr); // 10 myArr; // [1, 2, 3, 0, 0, 4] // Oops, all elements that were not numbers have been changed to 0 ! Why is that? In JavaScript, when assigning a value to a variable or passing it to a function, it's automatically copied. But there's a distinction to make here. Primitive values ( null, undefined, strings, numbers, booleans and symbols) are always assigned/passed by value-copy. In contrast, compound values like objects, arrays and functions (by the way, arrays and functions are objects in JavaScript, but I don't refer to them as objects for clarity) create a copy by reference on assignment or passing. So in the previous example, the value passed to g is a compound one, the array myArr. What happens is that g stores the memory address of myArr in arr, the parameter's name used in the function's body. In other words, there's no value-copy of each elements in myArr like you would expect. Thus, when you manipulate or change arr, it actually goes to myArr memory's location and perform whatever computation you specified. So yeah, be aware of that quirk. Exercises (Set 1) - In the snippet below, find the pure functions and the impure ones: // a const capitalizeFirst = (str) => str.charAt(0).toUpperCase() + str.slice(1); // b const greeting = (persons) => { persons.forEach((person) => { const fullname = `${capitalizeFirst(person.firstname)} ${capitalizeFirst( person.lastname )}`; console.log(`Hello ${fullname} !`); }); }; // c const getLabels = async (endpoint) => { const res = await fetch("" + endpoint); const data = await res.json(); return data.labels; }; // d const counter = (start, end) => { return start === end ? "End" : // e () => counter(start + 1, end); }; 2. Convert this snippet into a pure one (you can make more than one function if you feel the need to): const people = [ { firstname: "Bill", lastname: "Harold", age: 54 }, { firstname: "Ana", lastname: "Atkins", age: 42 }, { firstname: "John", lastname: "Doe", age: 57 }, { firstname: "Davy", lastname: "Johnson", age: 34 }, ]; const parsePeople = (people) => { const parsedPeople = []; for (let i = 0; i < people.length; i++) { people[i].firstname = people[i].firstname.toUpperCase(); people[i].lastname = people[i].lastname.toUpperCase(); } const compareAges = (person1, person2) => person1.age - person2.age; return people.sort(compareAges); }; parsePeople(people); // [ // {firstname: "DAVY", lastname: "JOHNSON", age: 34}, // {firstname: "ANA", lastname: "ATKINS", age: 42}, // {firstname: "BILL", lastname: "HAROLD", age: 54}, // {firstname: "JOHN", lastname: "DOE", age: 57}, // ] Immutability Like we've seen previously, a common side-effect is to mutate a variable. You don't want to do that in functional programming. So an important characteristic of a functional program is the immutability of data. In functional languages like Clojure and Haskell, this feature is built-in – you have no way to mutate the data unless the language allows it. In any case, you must consciously opt to do so. But in JavaScript, that's not the case. So it's more about having the "immutability" mindset than a real robust implementation of this feature. What this means is that you will basically make copies of the data you want to work on. In the first section, we saw that JavaScript functions automatically make copies of the arguments passed. While primitive values are copied by value, compound values are only copied by reference, so it's still possible to mutate them. Thus, when working with an object/array in a function, you should make a copy and then operate on it. By the way, notice that some built-in functions doesn't mutate the value it's called upon, while others do. For example, Array.prototype.map, Array.prototype.filter, or Array.prototype.reduce are don't mutate the original array. On the other hand, Array.prototype.reverse and Array.prototype.push are mutate the original array. You can find out if a built-in function mutates the value it's called upon or not in the documentation, so check it out if you're not sure. That's annoying, and ultimately not perfectly safe. Shallow vs. deep copies Since ES6, it's easy to make object/array copies through spread notation, Array.from(), Object.assign(). For example: // arrays const fruits = ["apple", "strawberry", "banana"]; const fruitsCopy = [...fruits]; fruitsCopy[0] = "mutation"; // fruitsCopy: ['mutation', 'strawberry', 'banana'] // fruits (not mutated): ['apple', 'strawberry', 'banana'] // objects const obj = { a: 1, b: 2, c: 3 }; const objCopy = { ...obj }; objCopy.a = "mutation"; // objCopy: {a: "mutation", b: 2, c: 3} // obj (not mutated): {a: 1, b: 2, c: 3} console.log(obj); console.log(objCopy); That's cool but there's a gotcha. Spread arrays/objects only have there first level copied by value, also known as a shallow copy. So all subsequent levels are still mutable: // But with nested objects/arrays, that doesn't work const nestedObj = { a: { b: "canBeMutated" } }; const nestedObjCopy = { ...nestedObj }; nestedObjCopy.a.b = "hasBeenMutated!"; console.log(nestedObj); console.log(nestedObjCopy); // nestedObjCopy: {a: {b: "hasBeenMutated!"}}} // nestedObj (mutated): {a: {b: "hasBeenMutated!"}} To resolve this problem, we need a custom function to do deep copies. This article discusses multiple solutions. Here's a shortened version of the custom function proposed in it: // works for arrays and objects const deepCopy = (obj) => { if (typeof obj !== "object" || obj === null) { return obj; // Return the value if obj is not an object } // Create an array or object to hold the values let newObj = Array.isArray(obj) ? [] : {}; for (let key in obj) { // Recursively (deep) copy for nested objects, including arrays newObj[key] = deepCopy(obj[key]); } return newObj; }; const nestedObj = { lvl1: { lvl2: { lvl3: { lvl4: "tryToMutateMe" } } }, b: ["tryToMutateMe"], }; const nestedObjCopy = deepCopy(nestedObj); nestedObjCopy.lvl1.lvl2.lvl3.lvl4 = "mutated"; nestedObjCopy.b[0] = "mutated"; console.log(nestedObj); // { lvl1: { lvl2: { lvl3: { lvl4: "tryToMutateMe" } } }, b: ["tryToMutateMe"]} console.log(nestedObjCopy); // { lvl1: { lvl2: { lvl3: { lvl4: "mutated" } } }, b: ["mutated"]} If you already use a library that provides functional utilities, it's likely that it has one to do deep copies. I personally like Ramda. See its clone function. If the difference between shallow and deep copies still isn't clear, check this out. Now let's talk about performance. Obviously, making copies doesn't come without a cost. For performance-sensitive parts of the program, or in cases where changes happen frequently, creating a new array or object (especially if it contains lots of data) is undesirable for both processing and memory reasons. In these cases, using immutable data structures from a library like Immutable.js is probably a better idea. They use a technique called structural sharing which I referred to when talking about the downsides of FP earlier in this post. Dealing with immutable data is thus, in my opinion, the second skill to have in your functional programmer tool belt. Composition and Currying Composition Unsurprisingly, the fundamental building blocks of a functional program are functions. Because your functions are free of side-effects and considered first-class, we can compose them. Like I said, first-class means that they're treated as regular data structures, possibly being assigned to variables, passed as arguments, or returned from other functions. Composition is a powerful idea. From tiny little functions, you can add up their functionalities to form a more complex one, but without the pain of laying it down upfront. In addition, you get greater flexibility because you can easily rearrange your compositions. Being backed up by mathematical laws, we know that everything will work if we follow them. Let's introduce some code to make things concrete: const map = (fn, arr) => arr.map(fn); const first = (xs) => xs[0]; const formatInitial = (x) => x.toUpperCase() + "."; const intercalate = (sep, arr) => arr.join(sep); const employees = ["Yann", "Brigitte", "John", "William"]; const initials = intercalate("\n", map(formatInitial, map(first, employees))); // Y. // B. // J. // W. Ouch – there's a little bit of nesting here. Take some time to understand what's going on. As you can see, there are function calls passed as arguments to outer functions. With the power of map, we essentially composed the functionalities of first, formatInitial, and join to eventually apply them on the employees array. Pretty cool! But as you can see, nesting is annoying. It makes things harder to read. Currying To flatten that stuff and make composition a breeze, we have to talk about currying. This term may scare you, but don't worry, it's just jargon for a simple idea: feeding a function one argument at a time. Usually, when we make a function call, we provide all the arguments at once and get back the result: const add = (x, y) => x + y; add(3, 7); // 10 But what if we could pass only one argument and provide the second one later? Well, we can do that by currying add like so: const add = (x) => (y) => x + y; const addTo3 = add(3); // (y) => 3 + y // ...later addTo3(7); // 10 This can be useful if we don't have all the arguments yet. You might not understand why we wouldn't have all the arguments beforehand, but you'll see later. Thanks to closures, we're preloading the function with its arguments step-by-step until we eventually run it. If you have a hard time grasping the concept of closure, check this, then this to go deeper. In short, closure allows an inner function to access variables of an outer function's scope. That's why we can access x in the scope of addTo3 which comes from the outer scope, add. Often you don't want to bother writing your functions in this special form. In addition, you can't always write them this way, for example, when you use external library functions and virtually anything you don't write but use all the same. For this reason, there's a common helper to curry a function (from Kyle Simpson book YDKJS): const curry = (fn, arity = fn.length) => { return (function nextCurried(prevArgs) { return function curried(...nextArgs) { const args = [...prevArgs, ...nextArgs]; return args.length < arity ? nextCurried(args) : fn(...args); }; })([]); }; curry takes a function and a number called arity (optional). The arity of a function is the number of arguments it takes. In the case of add, it's 2. We need that information to know when all the arguments are there, and thus decide to run the function or return another curried function that will take the remaining ones. So let's refactor our example with add: const add = curry((x, y) => x + y); const addTo3 = add(3); addTo3(7); // 10 Or we can still call add with all its arguments directly: const add = curry((x, y) => x + y); add(3, 7); // 10 Partial application Actually, curried strictly means "takes one argument at a time", no more, no less. When we can provide the number of arguments we want, we're actually talking about partial application. Thus, currying is a constrained form of partial application. Let's see a more explicit example of partial application compared to currying: const listOf4 = curry((a, b, c, d) => `1. ${a}\n2. ${b}\n3. ${c}\n4. ${d}`); // strict currying const a = listOf4("First")("Second")("Third")("Fourth"); // or const b = listOf4("First"); // later const c = b("Second")("Third"); // later const d = c("Fourth"); // partial application const e = listOf4("First", "Second", "Third", "Fourth"); // or const b = listOf4("First"); // later const c = b("Second", "Third"); // later const d = c("Fourth"); Do you see the difference? With currying, you should provide one argument at a time. If you want to feed more than one argument, then you need to make a new function call, hence the pair of parentheses around each argument. Honestly, that's just a matter of style. It seems a bit awkward when you're not used to it, but on the other hand, some people find the partial application style to be messy. The curry helper I introduced allows you to do both. It stretches the real definition of currying, but I prefer to have both functionalities and don't like the name looseCurry that Kyle Simpson used in is book. So, I cheated a little bit. Just keep the differences in mind and be aware that curry helpers you find in libraries probably follow the strict definition. Data comes last A final point I want to make is that we usually place the data as the last argument. With the previous functions I used, it's not obvious because all arguments are data. But take a look at this: const replace = curry((regex, replacement, str) => str.replace(regex, replacement) ); You can see that the data ( str) is in the last position because it's likely to be the last thing we'll want to pass through. You will see that this is the case when composing functions. Bring it all together Now to take advantage of currying and flatten our nested jumble from before, we also need a helper for composition. You guessed it, it's called compose!: const compose = (...fns) => fns.reverse().reduce((fn1, fn2) => (...args) => fn2(fn1(...args))); compose takes functions as arguments and returns another function which takes the argument(s) to pass through the whole pipeline. Functions are applied from right to left because of fns.reverse(). Because compose returns a function that takes the future argument(s), we can freely associate our functions without calling them, which allow us to create intermediate functions. So with our initial example: const map = (fn, arr) => arr.map(fn); const first = (xs) => xs[0]; const formatInitial = (x) => x.toUpperCase() + "."; const intercalate = (sep, arr) => arr.join(sep); const getInitials = compose(formatInitial, first); const employees = ["Yann", "Brigitte", "John", "William"]; const initials = intercalate("\n", map(getInitials, employees)); // Y. // B. // J. // W. first and formatInitial already take one argument. But map and intercalate take 2 arguments, so we can't include them as is in our compose helper because only one argument will be passed. In this case it's an array that both take as a final argument (remember, data is the last thing to get passed). It would be nice to give map and intercalate their respective first argument in advance. Wait a minute – we can curry them!: // ... const map = curry((fn, arr) => arr.map(fn)); const intercalate = curry((sep, arr) => arr.join(sep)); const formatInitials = compose( intercalate("\n"), map(formatInitial), map(first) ); const employees = ["Yann", "Brigitte", "John", "William"]; const initials = formatInitials(employees); // Y. // B. // J. // W. So clean! Like I said, compose makes a pipeline with the functions we give it, calling them from right to left. So let's visualize what happens when formatInitials(employees) is parsed: Personally, I prefer when it goes from left to right, because when writing the function, I like to think about what transformation to apply first, write it down, then repeat until the end of the pipeline. Whereas with compose, I have to step back to write the next transformation. That just breaks the flow of my thinking. Fortunately, it's not complicated to tweak it in order to go from left to right. We just have to get rid of the .reverse() part. Let's call our new helper pipe: const pipe = (...fns) => fns.reduce((fn1, fn2) => (...args) => f2(f1(...args))); So if we refactor the previous snippet, we get: const formatInitials = pipe(map(first), map(formatInitial), intercalate("\n")); For the visualization, same thing as compose but in reverse order: Hindley-Milner type signatures As you know, a complete program ends up with quite a few functions. When you plunge back into a project after several weeks, you don't have the context to easily understand what each function does. To counter that, you reread only the parts you need. But this can be quite tedious. It would be nice to have a quick and powerful way to document your functions and explain what they do at a glance. That's where type signatures come in. They are a way to document how a function operates and its inputs and outputs. For example: // ↓ function name // ↓ input // ↓ output // formatInitial :: String -> String const formatInitial = (x) => x.toUpperCase() + "."; Here we see that formatInitial takes a String and returns a String. We don't care about the implementation. Let's look at another example: // first :: [a] -> a const first = (xs) => xs[0]; Types can be expressed with variables (usually a, b, etc.) and the brackets means "an array of" whatever is inside. So we could literally read this signature like this: first takes an array of a and returns an a, where a can be of any type. But because the type taken as input is the same as the one returned as output, we use the same variable. If the output had another type, we would have used b: // imaginaryFunction :: a -> b Warning! That doesn't ensure that a and b are different types. They still can be the same. Finally, let's see the case of intercalate which is a bit more complex: // intercalate :: String -> [a] -> String const intercalate = curry((sep, arr) => arr.join(sep)); OK, here there are 2 arrows, which can be replaced by "returns...". They indicate functions. So intercalate takes a String then returns a function which takes an array of a, which returns a String. Wow, that's hard to keep track of. We could have written the signature like this: // intercalate :: String -> ([a] -> String) Now it's more obvious that it first returns a function, which is in parentheses here. And then that function will take [a] as input and return String. But we usually don't use them for clarity sake. Basically, if you stumble upon a signature of the form: // imaginaryFunction :: a -> b -> c -> d -> e // or // imaginaryFunction :: a -> (b -> (c -> (d -> e))) // ...you see how parens nesting affects readability e, the type on the right side, is the output. And everything before are inputs given one-by-one, which indicates that the function is curried. Nowadays, we usually have type systems like TypeScript or Flow, and the IDE is able to give us the type signature of a function when we hover over its name. Thus, it might be unnecessary to write them as comments in your code. But this remains a nice tool to have in your toolkit because a lot of functional libraries out there use these type signatures in their documentations. And idiomatic functional languages (like Haskell) use them heavily. So if you give them a shot, you will hopefully not be completely lost. Pat yourself on the back for having read this far. You should now have the ability to work with higher-order functions. Higher-order functions are simply functions that take functions as inputs and/or return them. Indeed, that's exactly what we did. For example, curry is an higher-order function because it takes a function as input and returns one as output. compose, pipe, map, and reduce are all higher-order functions because they take at least one function as input. They are pretty cool because they allow to create very powerful abstractions. Enough nattering. Let's get some practice. Exercises (Set 2) - Given a string of the form: these helpers: // filter :: (a -> Boolean) -> [a] -> [a] const filter = curry((fn, arr) => arr.filter(fn)); // removeDuplicates :: [a] -> [a] const removeDuplicates = (arr) => Array.from(new Set(arr)); // getChars :: String -> [Character] const getChars = (str) => str.split(""); // lowercase :: String -> String const lowercase = (str) => str.toLowerCase(); // sort :: [a] -> [a] const sort = (arr) => [...arr].sort(); Create a function getLetters that returns all the letters in a string without duplicates, in alphabetical order, and in lowercase. The goal is to use compose and/or pipe: // getLetters :: String -> [Character] const getLetters = ... Note: You may have to create intermediate functions before the final one. 2. Imagine you have an object with groups' names as keys and arrays of objects representing people as values: { "groupName": [ {firstname: "John", lastname: "Doe", age: 35, sex: "M"}, {firstname: "Maria", lastname: "Talinski", age: 28, sex: "F"}, // ... ], // ... } Create a function that returns an object of the form: { "groupName": { "medianAgeM": 34, "medianAgeF": 38, }, // ... } Where medianAgeM is the median age of men in the group and medianAgeF the one of women. Here's some helpers: // map :: (a -> b) -> [a] -> [b] const map = curry((fn, arr) => arr.map(fn)); // getEntries :: Object -> [[Key, Val]] const getEntries = (o) => Object.entries(o); // fromEntries:: [[Key, Val]] -> Object const fromEntries = (entries) => Object.fromEntries(entries); // mean :: Number -> Number -> Number const mean = curry((x, y) => Math.round((x + y) / 2)); // reduceOverVal :: (b -> a -> b) -> b -> [Key, [a]] -> [Key, b] const reduceOverVal = curry((fn, initVal, entry) => [ entry[0], entry[1].reduce(fn, initVal), ]); You may have to create intermediate functions before the final one, and like before, try to use compose and pipe: // groupsMedianAges :: Object -> Object const groupsMedianAges = ... 3. Find the type signature of reduce: const reduce = curry((fn, initVal, arr) => arr.reduce(fn, initVal)); 4. Find the type signature of curry: const curry = (fn, arity = fn.length) => { return (function nextCurried(prevArgs) { return function curried(...nextArgs) { const args = [...prevArgs, ...nextArgs]; return args.length < arity ? nextCurried(args) : fn(...args); }; })([]); }; Working with boxes: From Functors to Monads You may already be stressed out by the title of this section. You might be thinking, "What the heck are 'Functors' and 'Monads'?" Or maybe you've heard about monads because they're famously "difficult" to understand. Unfortunately, I can't predict that you will definitely understand these concepts, or effectively apply them in whatever work you do. In fact, if I talk about them at the end of this tutorial, it's because I think they're very powerful tools that we don't need very often. Here's the reassuring part: Like anything in the world, they're not magic. They follow the same rules of physics (and more specifically computer science and math) as everything else. So at the end of the day, they're understandable. It just requires the right amount of time and energy. In addition, they essentially build upon what we've previously talked about: types, mapping and composition. Now, find that tube of perseverance in your toolkit and let's get started. Why use boxes? We want to make our program with pure functions. Then we use composition to specify in which order to run them over the data. However, how do we deal with null or undefined? How do we deal with exceptions? Also, how do we manage side-effects without losing control, because one day we'll need to perform them? The first two cases involve branching. Either the value is null and we do this, or we do that. Either there's an error and we do this, or a success and we do that. The usual way to deal with branching is control flow. However, control flow is imperative. It describes "how" the code operates. So functional programmers came up with the idea of using a box that contains one of two possible values. We use that box as input/output to functions regardless of what's inside. But because those boxes also have specific behaviors that abstract function application, we can apply a function over a box and it will decide how to actually perform it depending on its inner value. Thus, we don't have to adapt our functions to the data. We don't have to clutter them with logic that doesn't belong to. Things like: const myFunc = (x) => { // ... if (x !== null) { // ... } else { // ... } }; With that, we can implement branching (and other stuff) while using only functions and preserve composition. The boxes we'll see, named Algebraic Data Types (ADT), enable us to do more while keeping the data and the functions separate. Functors and monads are indeed Algebraic Data Types. Functors Functors are containers/data structures/types that hold data along with a map method. This map method allow us to apply a function on the value(s) contained in the functor. What's returned is the same functor but containing the result of the function call. Let's introduce Identity, the simplest functor: We could implement it with a class, but I'll use regular functions here: const Identity = (x) => ({ inspect: () => `Identity(${x})`, map: (fn) => Identity(fn(x)), value: x, }); // add5 :: Number -> Number const add5 = (x) => x + 5; const myFirstFunctor = Identity(1); myFirstFunctor.map(add5); // Identity(6) You see? Not that complicated! Identity is the equivalent of the identity function but in the world of functors. identity is a well-known function in FP that may seem useless at first sight: // identity :: a -> a const identity = (x) => x; It does nothing on the data, just returns it as is. But it can be useful when doing stuff like composition because sometimes, you don't want to do anything with the data, just pass it through. And because composition works with functions and not raw values, you need to wrap them into the identity function. Identity serves the same purpose but when composing functors. More on that later. Returning back to the previous snippet, we could have done map(add5, 1) and it would have given us the same result apart from the fact that there would not have been a container around it. So there's no extra feature here. Now let's see another functor called Maybe: const Nothing = () => ({ inspect: () => `Nothing()`, map: Nothing, }); const Maybe = { Just, Nothing }; // Just is equivalent to Identity Maybe is a mix of 2 functors, Just and Nothing. Nothing contains, well, nothing. But it's still a functor so we can use it wherever we need functors. Maybe, like its name suggests, may contain a value ( Just) or not ( Nothing). Now how would we use it? Most of the time, it's used in functions that can return null or undefined: // isNothing :: a -> Boolean const isNothing = (x) => x === null || x === undefined; // safeProp :: String -> Object -> Maybe a const safeProp = curry((prop, obj) => isNothing(obj[prop]) ? Maybe.Nothing() : Maybe.Just(obj[prop]) ); const o = { a: 1 }; const a = safeProp("a", o); // Just(1) const b = safeProp("b", o); // Nothing a.map(add5); // Just(6) b.map(add5); // Nothing Do you see were the power of Maybe lies? You can safely apply a function on the inner value within whatever functor safeProp returns, you will not get an unexpected NaN result because you added a number with null or undefined. Thanks to the Nothing functor, the function mapped will not be called at all. However, Maybe implementations often cheat a little bit by doing the isNothing check inside the monad, whereas a strictly pure monad shouldn't: const Maybe = (x) => ({ map: (fn) => (x === null || x === undefined ? Maybe(x) : Maybe(fn(x))), inspect: () => `Maybe(${x})`, value: x, }); // safeProp :: String -> Object -> Maybe a const safeProp = curry((prop, obj) => Maybe(obj[prop])); const o = { a: 1 }; const c = safeProp("a", o); // Maybe(1) const d = safeProp("b", o); // Maybe(undefined) c.map(add5); // Maybe(6) d.map(add5); // Maybe(undefined) The advantage of having these functors is that, to be called "functors", they must implement a specific interface, in this case map. Thus, each type of functor has unique features while having capabilities shared by all functors, which make them predictable. When using Maybe in real cases, we eventually need to do something with the data to release the value. In addition, if the operations took the unwanted branch and fails, we'll get Nothing. Let's imagine we want to print the value retrieved from o in our previous example. We might want to print something more useful to the user than "Nothing" if the operation failed. So for releasing the value and provide a fallback if we get Nothing, we have a little helper called maybe: // maybe :: c -> (a -> b) -> Maybe a -> b | c const maybe = curry((fallbackVal, fn, maybeFunctor) => maybeFunctor.val === undefined ? fallbackVal : fn(maybeFunctor.val) ); // ... const o = { a: 1 }; const printVal1 = pipe( safeProp("a"), maybe("Failure to retrieve the value.", add5), console.log ); const printVal2 = pipe( safeProp("b"), maybe("Failure to retrieve the value.", add5), console.log ); printVal1(o); // console: 6 printVal2(o); // console: "Failure to retrieve the value." Great! If this is the first time you've been exposed to this concept, that might seem unclear and unfamiliar. But actually, it's something you're already familiar with. If you're familiar with JavaScript, chances are that you've used the built-in map: [1, 2, 3].map((x) => x * 2); // [2, 4, 6] Well, remember the definition of a functor. It's a data structure that has a map method. Now look at the previous snippet: what's the data structure that has a map method here? The Array! The native Array type in JavaScript is a functor! Its specialty is that it can contain multiple values. But the essence of map stays the same: it takes a value as input and returns/maps it to an output. So in this case, the mapper function runs for each value. Cool! Now that we know what's a functor, let's move on to extend its interface. Pointed A pointed functor is one that has an of (aka pure, unit) method. So with Maybe that gives us: const Maybe = {Just, Nothing, of: Just}; of is meant to place a given value into the default minimum context of the functor. You may ask: Why Justand not Nothing? When using of, we expect to be able to map right away. If we use Nothing, it would ignore everything we map. of expects you to insert a "successful" value. Thus, you can still shoot yourself in the foot by inserting undefined, for example, and then map a function that doesn't expect this value: Maybe.of(undefined).map((x) => x + 1); // Just(NaN) Let's introduce another functor to better understand when it's useful: const IO = (dangerousFn) => ({ inspect: () => `IO(?)`, map: (fn) => IO(() => fn(dangerousFn())), }); IO.of = (x) => IO(() => x); Unlike Just, IO don't get a value as is but needs it wrapped in a function. Why is that? I/O stands for Input/Output. The term is used to describe any program, operation, or device that transfers data to or from a computer and to or from a peripheral device. So it's intended to be used for input/output operations, which are side-effects because they rely on/affect the outside world. Querying the DOM is an example: // getEl :: String -> DOM const getEl = (sel) => document.querySelector(sel); This function is impure because given a same input, it can return different outputs: getEl("#root"); // <div id="root"></div> // or getEl("#root"); // <div id="root">There's text now !</div> // or getEl("#root"); // null Whereas by inserting an intermediate function, getEl returns always the same output: // getEl :: String -> _ -> DOM const getEl = (sel) => () => document.querySelector(sel); getEl("#root"); // function... Whatever the argument passed is, getEl will always return a function, allowing it to be pure. However, we're not magically erasing the effect because now, it's the returned function that's impure. We get purity out of laziness. The outer function only serves as a protective box that we can pass around safely. When we are ready to release the effect, we call the returned function's function. And because we want to be careful doing so, we name the function unsafePerformIO to remind the programmer that it's dangerous. Until then, we can do our mapping and composition stuff peacefully. So that's the mechanism used by IO. If you pass a value directly to it, it must be a function with the same signature as the one that getEl returns: const a = IO(() => document.querySelector("#root")); // and not: const invalid = IO(document.querySelector("#root")); But as you can imagine, it quickly becomes tedious to always wrap our value in a function before passing it into IO. Here's where of shines – it will do that for us: const betterNow = IO.of(document.querySelector("#root")); That's what I meant by default minimum context. In the case of IO, it's wrapping the raw value in a function. But it can be something else, it depends of the functor in question. Exercises (Set 3) - Write a function uppercaseFthat uppercase a string inside a functor: // uppercaseF :: Functor F => F String -> F String const uppercaseF = ... 2. Use the uppercaseF function you previously built, maybe, and safeProp to create a function that retrieves the name of a user and prints an uppercased version of it. The user object has this form: { name: "Yann Salmon", age: 18, interests: ["Programming", "Sport", "Reading", "Math"], // ... } // safeProp :: String -> Object -> Maybe a // maybe :: c -> (a -> b) -> Maybe a -> b | c // printUsername :: User -> _ const printUsername = ... Applicatives If you work with functors, you will stumble upon situations where you have multiple functors containing values on which you would like to apply a function: // concatStr :: String -> String -> String const concatStr = curry((str1, str2) => str1 + str2); const a = Identity("Hello"); const b = Identity(" world !"); Unfortunately, we can't pass functors as arguments to concatStr because it expects strings. The Applicative interface solves that problem. A functor that implements it is one that implements an ap method. ap takes a functor as argument and returns a functor of the same type. Within the returned functor, there will be the result of mapping the value of the functor ap was called on, over the value of the functor previously taken as argument. I know that's a lot to digest. Take some time and let that sink in. Let's continue our previous snippet to see it in action: // concatStr :: String -> String -> String const concatStr = curry((str1, str2) => str1 + str2); const a = Identity("Hello"); const b = Identity(" world !"); const c = a.map(concatStr); // Identity(concatStr("Hello", _)) const result = c.ap(b); // Identity("Hello world !") First, we map concatStr over a. What happens is that concatStr("Hello") is called and becomes the inner value of c, still an Identity functor. And remember, what does return concatStr("Hello")? Another function that waits for the remaining arguments! Indeed, concatStr is curried. Note that currying is necessary in order to use this technique. Then, like I said, ap maps the value of the functor it's called on (in this case c, so it maps concatStr("Hello")) over the value of the functor taken as argument (here it's b containing " world !"). So result ends up being an Identity functor (same type as b) containing the result of concatStr("Hello")(" world !"), that is "Hello world !"! Here's the implementation: const Identity = (x) => ({ inspect: () => `Identity(${x})`, // Functor interface map: (fn) => Identity(fn(x)), // Applicative interface ap: (functor) => functor.map(x), value: x, }); // Pointed interface Identity.of = (x) => Identity(x); As you can see, the functor ap is called on must contain a function. Otherwise it wouldn't work. In our previous example, that was the c step. If we inline everything, we get: // concatStr :: String -> String -> String const concatStr = curry((str1, str2) => str1 + str2); const result = Identity("Hello").map(concatStr).ap(Identity(" world !")); // Identity("Hello world !") There's an interesting mathematical property about ap: F(x).map(fn) === F(fn).ap(F(x)); The left side of the equality corresponds to what we did previously. So following the right side, result could also be written like this: const result = Identity(concatStr) .ap(Identity("Hello")) .ap(Identity(" world !")); Take the time to reread if you feel overwhelmed. The latter version ressembles more to a regular function call than the previous. We're feeding concatStr with its arguments in a left-to-right manner: And all of that happens inside our protecting container. Finally, we can further clean up this process with parametrization. A function called liftA2 do that: // liftA2 :: Apply functor F => (a -> b -> c) -> F a -> F b -> F c const liftA2 = curry((fn, F1, F2) => F1.map(fn).ap(F2)); // ... const result = liftA2(concatStr, Identity("Hello"), Identity(" world !")); I'm sure we can agree that this name is really awkward. I guess it made sense for the pioneers of Functional Programming, who were probably "math" people. But anyway, you can think of it as "lifting" a function and its arguments, then putting them into a functor in order to ap each one on the other. However, this metaphor is just partially true because arguments are already given within their container. The interesting part is the body of the function. You can notice that it uses the left-hand side of the mathematical property we saw earlier. If we implement it using the right-hand side, we need to know what type of functor F1 and F2 are because we need to wrap the function with the same: const liftA2 = curry((fn, F1, F2) => F(fn).ap(F1).ap(F2)); // ↑ what's F ? We need the precise constructor. So by using the left version, we abstract the functor type for free. Now you might think, "OK, but what if the function requires 3, 4, or more arguments?" If that's the case, you can build variants just by extending our previous liftA2: // liftA3 :: Apply functor F => (a -> b -> c -> d) -> F a -> F b -> F c -> F d const liftA3 = curry((fn, F1, F2, F3) => F1.map(fn).ap(F2).ap(F3)); // liftA4 :: Apply functor F => (a -> b -> c -> d -> e) -> F a -> F b -> F c -> F d -> F e const liftA4 = curry((fn, F1, F2, F3, F4) => F1.map(fn).ap(F2).ap(F3).ap(F4)); // take3Args :: String -> String -> Number -> String const take3Args = curry( (firstname, lastname, age) => `My name is ${firstname} ${lastname} and I'm ${age}.` ); // take4Args :: a -> b -> c -> d -> [a, b, c, d] const take4Args = curry((a, b, c, d) => [a, b, c, d]); liftA3(take3Args, Identity("Yann"), Identity("Salmon"), Identity(18)); // Identity("My name is Yann Salmon and I'm 18.") liftA4(take4Args, Identity(1), Identity(2), Identity(3), Identity(4)); // Identity([1, 2, 3, 4]) As you can notice, A* refers to the number of arguments. Wow! We've covered a bunch of things. Again, I want to congratulate you for the time and attention you've given so far. We almost have a fully fledged toolbox for resolving real world problems in a functional way. We now need to explore the Monad interface. Exercises (Set 4) Consider this user object for the next 2 exercises: const user = { id: "012345", name: "John Doe", hobbies: ["Cycling", "Drawing"], friends: [ {name: "Mickael Bolp", ...}, // ... ], partner: {name: "Theresa Doe", ...}, // ... } - Create a function that returns a phrase describing the couple if the user has a partner using the given helpers and ap: // safeProp :: String -> Object -> Maybe a const safeProp = curry((prop, obj) => obj[prop] === undefined || obj[prop] === null ? Maybe.Nothing() : Maybe.Just(obj[prop]) ); // getCouplePresentation :: User -> User -> String const getCouplePresentation = curry( (name1, name2) => `${name1} and ${name2} are partners.` ); // getName :: User -> String const getName = (user) => user.name; // I could have written: const getName = safeProp("name") // but I didn't and that's intentional. // We assume that a user always has a name. const couple = ... 2. Refactor the previous answer using liftA2 (check out the answer of the previous question before): // liftA2 :: Apply functor F => (a -> b -> c) -> F a -> F b -> F c const liftA2 = curry((fn, F1, F2) => F1.map(fn).ap(F2)); const couple = ... Monads In the exercises just before, I gave the helper getName whereas we could have derived it from safeProp. The reason I did that is because safeProp returns a Maybe functor. Thus, by trying to get the partner's name of a user, we end up with 2 nested Maybe functors: const getPartnerName = pipe(safeProp("partner"), map(safeProp("name"))); // Maybe(Maybe("Theresa Doe")) Let's see another example where this problem get even worse: // getUser :: Object -> IO User const getUser = ({ email, password }) => IO.of(db.getUser(email, password)); // getLastPurchases :: User -> IO [Purchase] const getLastPurchases = (user) => IO.of(db.purchases(user)); // display :: [Purchase] -> IO _ const display = "some implementation"; // displayUserPurchases :: Object -> IO _ const displayUserPurchases = pipe( getUser, map(getLastPurchases), map(map(display)) ); displayUserPurchases({ email: "johndoe@whatever.com", password: "1234" }); // IO(IO(IO _)) How to get rid of these layers of container that enforce us to do nested map that impairs readability ? Monads to our rescue! Monads are functors that can flatten. Again, like regular functors, you will probably not use them very often. However, they're powerful abstractions that bundle a specific set of behaviors with a value. They're data structures backed up by mathematical laws which make them extremely predictable and reliable. In addition, laws like composition or associativity tell us that we can do the same thing while making the operations in a different way. Remember what we saw with Applicatives and ap: F(x).map(fn) === F(fn).ap(F(x)); These can be helpful because certain variants might be more efficient computationaly. The thing is that the way we prefer to write programs may differ from the way they should be written if we wanted them to be efficient as much as possible. So because these laws ensure us that all variants do the same thing, we can write how we like and ask the compiler to use the more efficient variant later. That's why I didn't bothered you with these laws very much. But be aware of their utility (which certainly extends beyond that). Going back to our monads, the flattening behavior is usually implemented with a chain (aka flatMap, bind, >==) method: const Identity = (x) => ({ inspect: () => `Identity(${x})`, // Functor interface map: (fn) => Identity(fn(x)), // Applicative interface ap: (functor) => functor.map(x), // Monad interface chain: (fn) => fn(x), value: x, }); // Pointed interface Identity.of = (x) => Identity(x); // chain :: Monad M => (a -> M b) -> M a -> M b const chain = curry((fn, monad) => monad.chain(fn)); const getPartnerName = pipe(safeProp("partner"), chain(safeProp("name"))); In the case of Identity, chain is like map but without a new Identity functor surrounding it. You may think, "That defeats the purpose, we'll get back a value unboxed!" But, we won't because fn is meant to return a functor. Look at the type signature of this chain helper: // chain :: Monad M => (a -> M b) -> M a -> M b const chain = curry((fn, monad) => monad.chain(fn)); In fact, we could do the same by first applying the function that returns a functor, which gives us a nested one, and then removing the inner or the outer. For example: const Identity = (x) => ({ // ... chain: (fn) => Identity(x).map(fn).value, value: x, }); You can see that we first wrap x, then map, then grab the inner value. Because wrapping x in a new Identity and eventually picking its inner value are opposite, it's cleaner to do none of those like in the first version. Now let's refactor the fist snippet of this section (with nested functors) using the chain helper: // BEFORE // ... // displayUserPurchases :: Object -> IO _ const displayUserPurchases = pipe( getUser, map(getLastPurchases), map(map(display)) ); displayUserPurchases({ email: "johndoe@whatever.com", password: "1234" }); // IO(IO(IO _)) // AFTER // ... const displayUserPurchases = pipe( getUser, chain(getLastPurchases), chain(display) ); displayUserPurchases({ email: "johndoe@whatever.com", password: "1234" }); // IO _ First, getUser returns an IO(User). Then, we chain getLastPurchases instead of mapping it. In other words, we keep the result of getLastPurchases(User) (which is IO(?)), getting rid of the original IO that surrounded User. That's why monads are often compared to onions – flattening/chaining them is like removing an onion's layer. When you do it, you're releasing potential unwanted results which could make you cry ?. In the last example, if the first computation getUser had returned Nothing, calling chain on it would have returned Nothing too. This functor does no operation. However, we need to extend the simple version we saw earlier in this post in order to give it the Applicative and Monad interfaces. Otherwise, we couldn't use it as such: const Nothing = () => ({ inspect: () => `Nothing()`, map: Nothing, ap: Nothing, chain: Nothing, }); Nothing.of = () => Nothing(); As long as you keep at least one layer (that is one functor) until you're ready to release the effect, that's ok. But if you flatten the monad to get the raw value contained within all over the place because you're not able to figure out how to compose it, that defeats the purpose. Recap Functors apply a function to a wrapped value ( map). Pointed functors have a method to place a value in the default minimum context of the functor ( of). Applicatives apply a wrapped function to a wrapped value ( ap + of). Monads apply a function that returns a wrapped value to a wrapped value ( chain + of). Exercises (Set 5) - Consider this object: const restaurant = { name: "The Creamery", address: { city: "Los Angeles", street: { name: "Melrose Avenue", }, }, rating: 8, }; Create a function getStreetName that, like the name suggests, returns the street name of the restaurant. Use safeProp (and chain, along with any other functional helpers you need) to do so in a pure way. // safeProp :: String -> Object -> Maybe a const safeProp = curry((prop, obj) => obj[prop] === undefined || obj[prop] === null ? Maybe.Nothing() : Maybe.Just(obj[prop]) ); // getStreetName :: Object -> Maybe String const getStreetName = ... Exercise Answers The answers I propose are not the only ones. You may come up with your own, even better solutions. As long as your solution works, that's great. Set 1 - Pure functions: a, d, e / Impure functions: b, c For e, the answer might not be easy to understand. It was this function: const counter = (start, end) => { // ... // e () => counter(start + 1, end); }; So it's one function inside another. We said that a pure function shouldn't rely on the outside, but here it accesses variables outside its scope, those on which it has a closure over ( counter, start and end). In a pure functional language, unlike JavaScript, counter, start and end would be immutable so e would be pure because, for the same input (in this case none), we would always get the same output. However, values in JavaScript are mutable by default. So if start was an object for whatever reason, it could be mutated outside of counter or inside e itself. In this case, e would be considered impure. But because that's not the case here, I class it as a pure function. See this thread for more details. 2. const people = [ { firstname: "Bill", lastname: "Harold", age: 54 }, { firstname: "Ana", lastname: "Atkins", age: 42 }, { firstname: "John", lastname: "Doe", age: 57 }, { firstname: "Davy", lastname: "Johnson", age: 34 }, ]; const uppercaseNames = (person) => ({ firstname: person.firstname.toUpperCase(), lastname: person.lastname.toUpperCase(), age: person.age, }); // "sort" mutates the original array it's applied on. // So I make a copy before ([...people]) to not mutate the original argument. const sortByAge = (people) => [...people].sort((person1, person2) => person1.age - person2.age); const parsePeople = (people) => sortByAge(people.map(uppercaseNames)); // NOT SURE TO INCLUDE // If you have already read the section on Composition (after this one), you may come up with // a more readable version for "parsePeople": const parsePeople = pipe(map(uppercaseNames), sortByAge); // or const parsePeople = compose(sortByAge, map(uppercaseNames)); parsePeople(people); // [ // {firstname: "DAVY", lastname: "JOHNSON", age: 34}, // {firstname: "ANA", lastname: "ATKINS", age: 42}, // {firstname: "BILL", lastname: "HAROLD", age: 54}, // {firstname: "JOHN", lastname: "DOE", age: 57}, // ] That's the version I came with, but any variation works from the moment it has no side-effects. The function in the exercise indeed mutates the object passed as argument. But you can verify that the original people array is unchanged in this correction. Set 2."; // ... // keepLetters :: [Character] -> [Character] | [] const keepLetters = filter((char) => "abcdefghijklmnopqrstuvwxyz".includes(char) ); // getLetters :: String -> [Character] const getLetters = pipe( lowercase, getChars, keepLetters, removeDuplicates, sort ); // or const getLetters = compose( sort, removeDuplicates, keepLetters, getChars, lowercase ); getLetters(input); // ["a", "b", "c", "d", "e", "f", "g", "h", "i", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x"] 2. // getMedianAges :: [Key, [Person]] -> [Key, Object] const getMedianAges = reduceOverVal((acc, person) => { const key = `medianAge${person.sex}`; return !acc[key] ? { ...acc, [key]: person.age } : { ...acc, [key]: mean(acc[key], person.age) }; }, {}); // groupsMedianAges :: Object -> Object const groupsMedianAges = pipe(getEntries, map(getMedianAges), fromEntries); // or const groupsMedianAges = compose(fromEntries, map(getMedianAges), getEntries); 3. // reduce :: (b -> a -> b) -> b -> [a] -> b 4. // curry :: ((a, b, ...) -> c) -> a -> b -> ... -> c Set 3 const uppercaseF = map((str) => str.toUpperCase()) // Example: const myFunctor = Just("string") uppercaseF(myFunctor) // Just("STRING") 2. const uppercaseF = map((str) => str.toUpperCase()); // Example: const myFunctor = Just("string"); uppercaseF(myFunctor); // Just("STRING") ``` 2. ```js // printUsername :: User -> _ const printUsername = pipe( safeProp("name"), uppercaseF, maybe("Username not found !", console.log) ); // Example: printUsername({ name: "Yann Salmon", age: 18, interests: ["Programming", "Sport", "Reading", "Math"], // ... }); // console: YANN SALMON Set 4 // getPartnerName :: User -> Maybe String const getPartnerName = pipe(safeProp("partner"), map(getName)); // userName :: Maybe String const userName = Maybe.of(getName(user)); // partnerName :: Maybe String const partnerName = getPartnerName(user); // couple :: Maybe String const couple = Maybe.of(getCouplePresentation).ap(userName).ap(partnerName); // Just("John Doe and Theresa Doe are partners.") 2. // ... const couple = liftA2(getCouplePresentation, userName, partnerName); Set 5 // ... // getStreetName :: Object -> Maybe String const getStreetName = pipe( safeProp("address"), chain(safeProp("street")), chain(safeProp("name")) ); getStreetName(restaurant); // Just("Melrose Avenue") Going further This post is mainly inspired by what I learned from these 3 amazing resources (in order of difficulty): - Fun Fun Function playlist (video) - Functional-Light JavaScript (book) - Mostly adequate guide for Functional Programming (book) Like me, you'll certainly find some concepts really hard to grasp at first. But please keep going. Don't hesitate to rewind videos and reread paragraphs after a good night of sleep. I ensure you that it will pay off. There's also a great Github repository that gather resources about Functional Programming in JavaScript. You'll find, among other things, nice libraries that provide functional helpers. My favorite at the time is Ramda JS. Others also provide monads like Sanctuary. I certainly don't know everything about Functional Programming, so there are topics I didn't cover. Those I'm aware of are: - A technique called transducing. In short, it's a way of composing map, filterand reduceoperations together. Check this and that to learn more. - Other common types of monads: Either, Map, List - Other algebraic structures like semi-groups and monoids - Functional Reactive Programming Conclusion That's it! Before we finish, I want to warn you about potential mistakes. I'm not an expert in Functional Programming, so please be critical of this article as you learn more about it. I'm always open to discussions and refinements. In any case, I hope that I laid down what I consider to be the fundamentals necessary for you to be more productive in your day-to-day work, as well as giving you the tools and the interest to go further. And with that, keep coding! ?
https://www.freecodecamp.org/news/the-principles-of-functional-programming/
CC-MAIN-2021-21
refinedweb
10,833
55.95
NeXT Computers Log in to check your private messages UAE for NeXTstep NeXT Computers Forum Index -> Porting New Software View previous topic :: View next topic Author Andreas Joined: 27 Dec 2005 Posts: 356 Location: Germany Posted: Tue Dec 04, 2007 3:23 am Post subject: UAE for NeXTstep Just for fun, is claimed to compile under NeXTstep. Have someone tried that and is a ready compiled archive, if possible as FAT, for downloading avail? Back to top kb7sqi Joined: 24 Sep 2007 Posts: 488 Location: Winston Salem, NC Posted: Tue Dec 04, 2007 9:30 am Post subject: A quick port. No real testing, but the older "stable" version 0.7.6 compiled w/ out too much trouble. Needed to add strdup to genp2c.c & modify the sysconfig.h a bit, then compile a few files w/ -traditional-cpp. You'll find the Uae.app in the tarball in the ns3.3_quadfat directory. Here's the url And here's a quick screenshot of it starting kickstart: I did start it by going into the Uae.app directory & typing ./Uae. The screenshot was on the Gecko. I compiled it on my x86 box. Give it a shot & let me know how it works. If it works ok, I'll start working on the newer dev snapshots and make a proper package. If I remember right, the last packaged version was 0.5.3 or so. Also, FYI, the NeXT version don't support sound. Hope it works ok. Take care. Back to top kb7sqi Joined: 24 Sep 2007 Posts: 488 Location: Winston Salem, NC Posted: Tue Dec 04, 2007 9:45 am Post subject: I had to test it atleast w/ a demo adf file. It works that much atleast. Here's a screenshot of a demo called LostWorld. I'll have to mess w/ it more l8r. Hope you like it. Take care. Back to top Andreas Joined: 27 Dec 2005 Posts: 356 Location: Germany Posted: Tue Dec 04, 2007 11:04 am Post subject: kb7sqi wrote: I had to test it atleast w/ a demo adf file. It works that much atleast. Here's a screenshot of a demo called LostWorld. I'll have to mess w/ it more l8r. Hope you like it. Take care. Oh, thanx, i will test that version by myself. Is there a chance to see the much newer versions that i have linked below to compile? Back to top kb7sqi Joined: 24 Sep 2007 Posts: 488 Location: Winston Salem, NC Posted: Tue Dec 04, 2007 11:21 am Post subject: If the 0.7.6 release works ok, then I'll work on the newer development releases. I just wanted to make sure the stable version worked first. There was quite a few changes from 0.5.2/3 to 0.7.6. So, I was amazed it compiled so quickly. I'll download some dev snapshots & give them a shot. I was also working vMac/minivmac. So, this should go along well w/ one of them. Take care. Back to top Andreas Joined: 27 Dec 2005 Posts: 356 Location: Germany Posted: Wed Dec 05, 2007 11:57 am Post subject: kb7sqi wrote: If the 0.7.6 release works ok, then I'll work on the newer development releases. just a short test on m68k, doubleclicking to start the app doesn't work. some commands like -O 352:240:c wasn't interpreted right, and i don't know how the joystick is emulated ;-) Quote: I was also working vMac/minivmac. So, this should go along well w/ one of them. Take care. Oh nice since we can assume a usefuel performance on m68k systems. The only thing on vMac that i doesn't like is the fixed screensize of (unusable) 512x384 Back to top helf Joined: 29 Dec 2005 Posts: 1097 Location: Alabama, USA Posted: Thu Dec 06, 2007 6:03 pm Post subject: isnt that the screensize of the original macs? Do emulators like vmac and UAE run the emulated systems cpu 'natively' if they are on a 68k chip? Would boost speed tremendously... _________________ *INACTIVE* Back to top Andreas Joined: 27 Dec 2005 Posts: 356 Location: Germany Posted: Fri Dec 07, 2007 12:39 am Post subject: helf wrote: isnt that the screensize of the original macs? Yes, but here are later models with bigger solutions and vmac ist AFAIK able to run until 7.5. Quote: Do emulators like vmac and UAE run the emulated systems cpu 'natively' if they are on a 68k chip? Would boost speed tremendously... unfortunatly MOST emulators are emulation also the CPU. For MAC amulation only Shapeshifter on Amiga-Systems uses the native CPU. Would be nice to see something like that for the NeXT Back to top neozeed Joined: 15 Apr 2006 Posts: 716 Location: Hong Kong Posted: Sat May 24, 2008 7:59 am Post subject: I just built this last night so I could try to see how to do some video under NS. I needed to have GCC 2.7.2.3 to build everything except NeXTwin.m Also you'll need gnu make and I always find bash 2.01 helpfull. in the sysconfig.h I had to comment out HAVE_GETOPT 1 from there it'll build with gmake uae gmake uae CC=cc gmake uae this way gcc 2.7.2.3 will build most except the .m, and the NeXT gcc can only build the objective C part... Even though I built the objective C portion of 2.7.2.3 but it doesn't compile. Go figure. It's great fun for Captain Blood & having fun with WorkBench. I just rebuilt it trying to figure out some colour stuff on NS... I had to comment out memory.h & newcpu.h from NeXTwin.m And add in strdup to a few things (cpuopti, genp2c, uae) and remove the strdup 'fix' in sysconfig... which doesnt work. and for refrence here is strdup.c: Code: #include <stdio.h> /* * posted to comp.sys.next.programmer: * * * From: moser@ifor.math.ethz.ch (Dominik Moser,CLV A4,2 40 19,720 49 89) * Subject: Re: Compile problems (pgp 2.6.3i) * Date: 10 Jul 1996 06:50:42 GMT * Organization: Swiss Federal Institute of Technology (ETHZ) * References: <4rrhvj$6fr@bagan.srce.hr> * Message-ID: <4rvjs2$6oh@elna.ethz.ch> * * Most systems don't have this (yet) */ char *strdup(str) char *str; { char *p; extern char *malloc(); extern char *strcpy(); if ((p = malloc(strlen(str)+1)) == NULL) return((char *) NULL); (void) strcpy(p, str); return(p); } _________________ # include <wittycomment.h> Back to top neozeed Joined: 15 Apr 2006 Posts: 716 Location: Hong Kong Posted: Wed May 28, 2008 7:29 am Post subject: UAE Oh I found something else while playing with the source, if you have a 16bit deep display, it looks like crap. There is some 'issue' with using long's for the display, and it leaves some weird line artifacting. The solution is to trust display postscript. Apparently you can just 'describe' a 32bit colour plane to it, and it'll render it down on whatever colour display you have. And I might add it looks way better to me. Maybe it was an issue prior to NS 3.3 fixpack 3? Anyways, you just have to modify NeXTwin.m to something like this: Code: --- NeXTwin.m Wed May 28 10:24:25 2008 +++ vid.m Wed May 28 10:26:27 2008 @@ -357,24 +357,27 @@ case NX_TwelveBitRGBDepth: case NX_EightBitRGBDepth: { - for(i = 0; i < 4096; i++) - { - xcolors[i] = NXSwapHostShortToBig((short)((i <<4) | 0xf)); - } - - bitmap=[[NXBitmapImageRep alloc] - initData:(unsigned char *)NULL - pixelsWide:(int)800 - pixelsHigh:(int)(313-29) - bitsPerSample:(int)4 - samplesPerPixel:(int)4 - hasAlpha:(BOOL)YES - isPlanar:(BOOL)NO - colorSpace:(NXColorSpace)NX_RGBColorSpace - bytesPerRow:(int)800*2 - bitsPerPixel:(int)16 - ]; - gfxvidinfo.pixbytes=2; + for(i = 0; i < 4096; i++) + { + xcolors[i]= NXSwapHostLongToBig(((i & 0x0f00)<< (20))| + ((i & 0x00f0) << (16))| + ((i & 0x000f) << (12))| + 0xff); + } + + bitmap=[[NXBitmapImageRep alloc] + initData:(unsigned char *)NULL + pixelsWide:(int)800 + pixelsHigh:(int)(313-29) + bitsPerSample:(int)8 + samplesPerPixel:(int)4 + hasAlpha:(BOOL)YES + isPlanar:(BOOL)NO + colorSpace:(NXColorSpace)NX_RGBColorSpace + bytesPerRow:(int)800*4 + bitsPerPixel:(int)32 + ]; + gfxvidinfo.pixbytes=4; break; } case NX_EightBitGrayDepth: _________________ # include <wittycomment.h> Back to top Display posts from previous: All Posts 1 Day 7 Days 2 Weeks 1 Month 3 Months 6 Months 1 Year Oldest First Newest First NeXT Computers Forum Index -> Porting New
http://www.nextcomputers.org/forums/viewtopic.php?p=9055&sid=5dc7f96113cac5fa01ca3b2f2b73eafa
CC-MAIN-2019-09
refinedweb
1,403
75.1
Synopsis Retrieves the types of ChIPS errors collected. Syntax get_error_types() Description The get_error_types command retrieves the type errors/warnings which have occured since the last legal ChIPS command. This command is part of the advanced ChIPS module; refer to "ahelp chips" for information. To load the module: from pychips.advanced import * The value returned can take one of four values: 0, 1, 2 or 3: The value returned is the type of errors, if any exist. Once the user issues a legal command (other than the get_error_ and set_error_ commands), the error count is reset to zero, and so the response of this command will be zero. The error statistics collected refer to ChIPS internal error only. For example, if the user mispells an attribute, this will count as a ChIPS error. If the user mispells a ChIPS command, Python will return an error saying the command is not defined, and this will not be counted in the error count, and therefore a get_error_types command will return zero. Example chips> print(get_error_types()) 0 chips> add_label(0.5, 0.5, 'FOO', 'font=foo') chips WARNING: The requested font (foo) has not been loaded, using default font (helvetica) chips> e = get_error_types() chips WARNING: The requested font (foo) has not been loaded, using default font (helvetica) chips> print(e) 2 chips> set_preference("curve.err.right", "tre") chips ERROR: The curve.err.right value (tre) must be one of [t|f|true|false|on|off|1|0|yes|no] chips> e = get_error_types() chips> print(e) 1 get_error_types() is issued on a clean startup of ChIPS and the expected value of zero is returned. Next an add_label command is issued with a non-existant font. This generates warnings as shown by the subsequent get_error_types command. Next, an invalid set_preference command, with an incorrect attribute value, is issued to Chips. This results in an error. get_error_types responds with a one. Bugs See the bugs pages on the ChIPS website for an up-to-date listing of known bugs. See Also - concepts - setget - errors - clear_errors, get_error_count, get_error_verbosity, get_errors, set_error_verbosity - utilities - set_current
https://cxc.cfa.harvard.edu/chips/ahelp/get_error_types.html
CC-MAIN-2020-16
refinedweb
344
55.34
Hello, all. Starting out with Julia. I need to display some pseudo-color images so I'm playing around with the ImageView package. It seems to be running very slowly. Displaying one of the images from TestImages can take nearly a minute: img = testimage( "cameraman" ) Gray Images.Image with: data: 512×512 Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2} properties: colorspace: Gray spatialorder: x y Advertising julia> tic(); ImageView.view( img ); toc(); elapsed time: 50.552471225 seconds Zooming and other interaction with the mouse is similarly sluggish. I didn't expect this for a 512x512 grayscale image. I am running Julia version 0.5.1-pre+2 and ImageView is running into some issues with deprecated functionality and namespace conflicts. However, the above did not generate any warnings at all but still took 50 seconds to display. This is all under Linux. Any ideas why this is happening or if I could be doing something wrong?
https://www.mail-archive.com/julia-users@googlegroups.com/msg51149.html
CC-MAIN-2017-51
refinedweb
157
52.97
public class BooleanClosureWrapper extends Object Closureand convert the result to a boolean. It will do this by caching the possible "doCall" as well as the "asBoolean" in CallSiteArray fashion. "asBoolean" will not be called if the result is null or a Boolean. In case of null we return false and in case of a Boolean we simply unbox. This logic is designed after the one present in DefaultTypeTransformation.castToBoolean(Object). The purpose of this class is to avoid the slow "asBoolean" call in that method. BooleanReturningMethodInvokeris used for caching. clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait public BooleanClosureWrapper(Closure wrapped) public boolean call(Object... args) public <K,V> boolean callForMap(Map.Entry<K,V> entry)
http://groovy.codehaus.org/api/org/codehaus/groovy/runtime/callsite/BooleanClosureWrapper.html
CC-MAIN-2013-48
refinedweb
119
59.09
Django makes creating a REST API a breeze. We’ll walk you through the steps to get your first API up and operating in this tutorial. What is the purpose of a REST API? Before we get into the programming, think about why you’d want to create an API. We would have been so much better off if someone had taught these fundamental concepts to us before we started. A REST API is a standardized method of delivering data to other programs. The data can then be used in any way by those applications. APIs can sometimes allow other programs to make changes to the data. For a REST API call, there are a few crucial methods: - GET -The most common method, GET, retrieves data from the API based on the endpoint you visit and any arguments you supply. - POST — The POST method is responsible for adding a new record to the database. - PUT — Searches for a record at the specified URI. In addition, it updates the existing record if it exists and creates a new record if you don’t have one already. - DELETE — Removes the record from the specified URI. - PATCH — Modify a record’s specific fields. An API is typically an interface to a database. The backend of the API is responsible for querying the database and formatting the answer. You get a static response of whatever resource you requested, usually in JSON format. REST APIs are so widespread in software development that understanding how they function is a must-have skill for any developer. APIs are how applications communicate with one another and even with one other. Many web applications, for example, rely on REST APIs to allow the front end to communicate with the back end. For example, if you’re building an Angular application on top of Django, you’ll need an API that allows Angular to consume data from the database. Serialization is the process of searching and converting tabular database values into JSON or another format. Correct data serialization is a crucial difficulty when developing an API. What is the purpose of the Django REST Framework? The most compelling reason to utilize the Django REST Framework is how simple serialization is! Models for your database are defined in Django using Python. So, while you can write raw SQL, the Django ORM takes care of the majority of the database migrations and queries. from django.contrib.auth.models import User from django.db import models class CodeItem(models.Model): access_token = models.CharField(max_length=180) user = models.ForeignKey(User, on_delete=models.CASCADE) Consider the Django ORM to be a librarian who pulls the information you need, so you don’t have to. This frees you to focus on your application’s business logic rather than the low-level implementation details as a developer. Django ORM takes care of everything. On the other hand, the Django REST Framework works well with the Django ORM, which handles all database queryings. You may serialize your database models to REST-ful representations with just a few lines of code using the Django REST Framework. Django to-do list for creating a REST API So, how do we develop a REST API based on what we’ve learned? - Step 1: Install Django - Step 2: Create a database model that the Django ORM will manage - Step 3: Install Django’s REST Framework - Step 4: Serialize the model - Step 5: To view the serialized data, create URI endpoints. If it appears straightforward, it is. Let’s get started! Install Django We’ll need to install Django before we can make a Django app. That’s not difficult at all! However, it would help if you first considered building a distinct virtual environment for your project so that you may manage your dependencies independently. To accomplish this, run the following command: virtualenv django_rest_env The command above is responsible for creating a virtual environment with the name django_rest_env. Next, we will activate the virtual environment before installing Django. To achieve the former, run the following command. source django_rest_env/bin/activate You should be ready to install the virtual environment using pip, as shown below. pip install Django Let’s now create a new Django project: $ django-admin startproject django_rest_app We can see that Django created a new folder for us in the directory now: $ ls And there’s everything we need to run a Django site inside that folder. Let’s double-check if it works. To do so, we will run the Django server to see how it works: cd django_rest_app $ python manage.py runserver In some cases, port 8000 may already be in use by another application, in which case you can stop the other app or switch to using another port. We killed the other application using the following command, which applies to Debian-based systems. sudo kill -9 $(sudo lsof -t -i:8000) You should see the Django welcome screen if you browse to Making an API app With the folder structure now, we may develop our application. However, when creating a new Django project, it is excellent practice to divide it into different apps. So, let’s make a new app to use with our API: $ python manage.py startapp api_app $ ls Registering the api_app We need to tell Django about the new app we’ve just established. The measures we’ll take later won’t function until Django is aware of api_app. As a result, we make the following changes to django_rest_app/settings.py: INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'api_app' ... # Leave all the other INSTALLED_APPS ] Database migration Remember how we mentioned that Django allows you to create database models in Python? We must tell Django to migrate the changes to the database whenever we make or edit a model. The Django ORM then writes all of the SQL CREATE TABLE commands. Django, it turns out, comes with a few models pre-installed. So, those built-in models must be migrated to our database. For those of you who think, “But we didn’t make a database!” You are correct. Django will construct a simple SQLite database for us if we don’t specify otherwise. SQLite is also fantastic! So, here’s how we’re going to move those initial models: $ python manage.py migrate Make a Super User Before we move on, there’s one more thing. We’re about to start building some models. When we wish to review the data in our database, it would be wonderful to use Django’s attractive admin interface. We’ll need login credentials to do so. So, let’s make ourselves the project’s owners and administrators. THE ULTIMATE SUPERUSER!!! $ python manage.py createsuperuser Let’s make sure it works. To do so, we start the Django server by following these steps: $ Python manage.py runserver After that, go to localhost:8000/admin. You should see the admin dashboard after logging in with your superuser credentials. If you cannot, your superuser credentials are not correct. If that is the case with you, then redo the previous steps. Creating a database model that Django ORM will manage Let’s get started on our first model! We’ll make it in api_app/models.py, so go ahead and open it. api_app/models.py Let’s create a codeunderscored database! Each programmer has a given favorite programming language and alias in everyday life. Let’s get started with our model: # models.py from django.db import modelsclass CodeLanguage(models.Model): name = models.CharField(max_length=60) alias = models.CharField(max_length=60) def __str__(self): return self.name Strings are stored in the name and alias character fields. When Django needs to print an instance of the CodeLanguage model, the __str__ method tells it what to print. perform migrations Remember that every time we define or modify a model, we must tell Django to migrate the changes. $ python manage.py makemigrations $ python manage.py migrate Register CodeLanguage on the admin site Remember that it is a great admin site with Django out of the box? It is unaware of the CodeLanguage model, but we can inform it of its existence with two lines of code. Make the following changes to api_app/admin.py: from django.contrib import admin from .models import CodeLanguage admin.site.register(CodeLanguage) Now you may start the Django server and go to localhost:8000/admin. Creating some Code Languages While we’re on the admin site, we might as well make some code languages to experiment with within our app. “Add” should be selected. Then go ahead and create your code languages! Configure the Django REST Framework Now it’s time to think about our heroes API. We need to use endpoints to serialize data from our database. We’ll need Django REST Framework, so let’s get that installed first by running the following command on the terminal. pip install djangorestframework Now, in django_rest_api/settings.py, notify Django that we installed the REST Framework: INSTALLED_APPS = [ # All your installed apps stay the same ... 'rest_framework', ] That concludes it. Make the CodeLanguage model serial Now we’re starting to venture into uncharted territory. REST Framework needs to know about our CodeLanguage model and data serialization. Remember that serialization is the conversion of a Model to JSON. We can use a serializer to indicate which fields should be included in the model’s JSON representation. The serializer will convert our code languages to JSON so that the API user may parse them even if they don’t know Python. When a user POSTs JSON data to our API, the serializer converts it to a CodeLanguage model, which we can save or validate. To do so, make a new file called api_app/serializers.py. We must include the following information in this file: - Bring in the CodeLanguage model. - Import the serializer from the REST Framework. - Make a new class that connects the CodeLanguage and the serializer. Here’s how to do it: # serializers.py from rest_framework import serializers from .models import CodeLanguage class CodeSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = CodeLanguage fields = ('name', 'alias') Displaying Data All that’s left is to connect the URLs and views to show the data! Those fundamental notions are taken to the next level with our REST API! Views Let’s start with setting up the views. The various code languages are rendered in JSON format. To do so, we must: - Look up all code languages in the database. - Pass the database queryset through the serializer we just built, and it will be turned to JSON and rendered. # views.py from rest_framework import viewsets from .serializers import CodeSerializer from .models import CodeLanguage class CodeViewSet(viewsets.ModelViewSet): queryset = CodeLanguage.objects.all().order_by('name') serializer_class = CodeSerializer ModelViewSet is a unique view provided by Django Rest Framework. It will handle GET and POST for CodeLanguage without requiring additional effort. URLs for the Site Okay, this is fantastic already. We’re almost there. The final step is to give the viewset we just generated a URL. URLs in Django are resolved first at the project level. So, in the django_rest_api/ directory, there’s a file called urls.py. Make your way over there. In addition, you’ll notice that the admin site’s URL is already included. Now, our remaining task is to add a URL to our API. Let’s just put our API at the index for now: # django_rest_api/urls.py from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('', include('api_app.urls')), ] URLs of APIs You’ll note that we included ‘api_app.urls’ if you pay attention instead of copying and pasting. That’s the location of a file we haven’t yet created. And it’s there that Django will look for instructions on how to route this URL next. So, here’s what we’ll do next: create api_app/urls.py: from django.urls import include, path from rest_framework import routers from . import views router = routers.DefaultRouter() router.register(r'code', views.CodeViewSet) # Wire up our API using automatic URL routing. # Additionally, we include login URLs for the browsable API. urlpatterns = [ path('', include(router.urls)), path('api-auth/', include('rest_framework.urls', namespace='rest_framework')) ] You’ll notice that we imported something called router from rest_framework. The REST Framework router will ensure that our requests are dynamically routed to the correct resource. The URLs will update as we add or remove entries from the database. Isn’t it cool? To dynamically route requests, a router works with a viewset (see views.py above). A router must point to a viewset to function, and in most circumstances, if you have a viewset, you’ll want a router to go with it. Only one model+serializer+viewset has been introduced to the router so far: CodeLanguage. But, it is harmless to add more in the future by repeating the technique above for new models! Perhaps we should create a Villains API next. Of course, urls.py will look slightly different if you only want to use regular DRF Views instead of viewsets. Simple views don’t require a router, and you can add them. Put it to the test! Restart the Django server as follows: $ Python manage.py runserver Go to localhost:8000 now. Use the GET method to get to the endpoint We see the exact API results if we click the link (Hyperlinks are incredible REST-ful architecture, by the way): Fetch individual Code Language The ID of a single model instance is used to GET it. The viewsets in the Django REST Framework take care of this for us. You can see only one of your CodeLanguage models by going to 127.0.0.1:8000/code/id>/, where id> is the ID of one of your code languages models. For instance, for me, returns: We can make this more user-friendly by including ID in the code/ endpoint response. Change the fields list in api_app/serializers.py to have “id”: class CodeSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Code fields = ('id', 'name', 'alias') The following is the current code language list: We can check up individual models using their IDs. Sending a POST request to the server Our API likewise handles post requests. We can send JSON to the API, which will create a new database record. Conclusion Django REST Framework allows you to create quick REST APIs. We hope this article has been informative. However, APIs can get complicated with several models interacting and endpoints with more advanced queries. With that said, you’re almost done with this post. The REST Framework does an excellent job of dealing with complexity. If you get stuck, there’s a fantastic community waiting to assist you.
https://www.codeunderscored.com/how-to-create-rest-apis-in-django/
CC-MAIN-2022-21
refinedweb
2,469
59.5
import "github.com/ngmoco/falcore" Package falcore is a framework for constructing high performance, modular HTTP servers. For more information, see README.md buffer_pool.go continue.go doc.go filter.go handler_filter.go logger.go pipeline.go request.go response.go router.go server.go server_notwindows.go string_body.go const ( FINEST level = iota FINE DEBUG TRACE INFO WARNING ERROR CRITICAL ) func Critical(arg0 interface{}, args ...interface{}) error func Debug(arg0 interface{}, args ...interface{}) func Error(arg0 interface{}, args ...interface{}) error func Fine(arg0 interface{}, args ...interface{}) func Finest(arg0 interface{}, args ...interface{}) Global Logging func Info(arg0 interface{}, args ...interface{}) func RedirectResponse(req *http.Request, url string) *http.Response func SetLogger(newLogger Logger) func SimpleResponse(req *http.Request, status int, headers http.Header, body string) *http.Response func TimeDiff(startTime time.Time, endTime time.Time) float32 Helper for calculating times func Trace(arg0 interface{}, args ...interface{}) func Warn(arg0 interface{}, args ...interface{}) error type HandlerFilter struct { // contains filtered or unexported fields } Implements a RequestFilter using a http.Handler to produce the response This will always return a response due to the requirements of the http.Handler interface so it should be placed at the end of the Upstream pipeline. func NewHandlerFilter(handler http.Handler) *HandlerFilter func (h *HandlerFilter) FilterRequest(req *Request) *http.Response type HostRouter struct { // contains filtered or unexported fields } Route requsts based on hostname func NewHostRouter() *HostRouter Generate a new HostRouter instance func (r *HostRouter) AddMatch(host string, pipe RequestFilter) TODO: support for non-exact matches func (r *HostRouter) SelectPipeline(req *Request) (pipe RequestFilter) type Logger interface { // Matches the log4go interface Finest(arg0 interface{}, args ...interface{}) Fine(arg0 interface{}, args ...interface{}) Debug(arg0 interface{}, args ...interface{}) Trace(arg0 interface{}, args ...interface{}) Info(arg0 interface{}, args ...interface{}) Warn(arg0 interface{}, args ...interface{}) error Error(arg0 interface{}, args ...interface{}) error Critical(arg0 interface{}, args ...interface{}) error } I really want to use log4go... but i need to support falling back to standard (shitty) logger :( I suggest using go-timber for the real logger func NewStdLibLogger() Logger type MatchAnyRoute struct { Filter RequestFilter } Will match any request. Useful for fallthrough filters. func (r *MatchAnyRoute) MatchString(str string) RequestFilter type PathRouter struct { Routes *list.List } Route requests based on path func NewPathRouter() *PathRouter Generate a new instance of PathRouter func (r *PathRouter) AddMatch(match string, filter RequestFilter) (err error) convenience method for adding RegexpRoutes func (r *PathRouter) AddRoute(route Route) func (r *PathRouter) SelectPipeline(req *Request) (pipe RequestFilter) Will panic if r.Routes contains an object that isn't a Route type Pipeline struct { Upstream *list.List Downstream *list.List RequestDoneCallback RequestFilter } Pipelines have an upstream and downstream list of filters. A request is passed through the upstream items in order UNTIL a Response is returned. Once a request is returned, it is passed through ALL ResponseFilters in the Downstream list, in order. If no response is generated by any Filters a default 404 response is returned. The RequestDoneCallback (if set) will be called after the request has completed. The finished request object will be passed to the FilterRequest method for inspection. Changes to the request will have no effect and the return value is ignored. func NewPipeline() (l *Pipeline) func (p *Pipeline) FilterRequest(req *Request) *http.Response Pipelines are also RequestFilters... wacky eh? Be careful though because a Pipeline will always returns a response so no Filters after a Pipeline filter will be run. type PipelineStageStat struct { Name string Status byte StartTime time.Time EndTime time.Time } Container for keeping stats per pipeline stage Name for filter stages is reflect.TypeOf(filter).String()[1:] and the Status is 0 unless it is changed explicitly in the Filter or Router. For the Status, the falcore library will not apply any specific meaning to the status codes but the following are suggested conventional usages that we have found useful type PipelineStatus byte const ( Success PipelineStatus = iota // General Run successfully Skip // Skipped (all or most of the work of this stage) Fail // General Fail // All others may be used as custom status codes ) func NewPiplineStage(name string) *PipelineStageStat type RegexpRoute struct { Match *regexp.Regexp Filter RequestFilter } Will match based on a regular expression func (r *RegexpRoute) MatchString(str string) RequestFilter type Request struct { ID string StartTime time.Time EndTime time.Time HttpRequest *http.Request Connection net.Conn RemoteAddr *net.TCPAddr PipelineStageStats *list.List CurrentStage *PipelineStageStat Overhead time.Duration Context map[string]interface{} // contains filtered or unexported fields } Request wrapper The request is wrapped so that useful information can be kept with the request as it moves through the pipeline. A pointer is kept to the originating Connection. There is a unique ID assigned to each request. This ID is not globally unique to keep it shorter for logging purposes. It is possible to have duplicates though very unlikely over the period of a day or so. It is a good idea to log the ID in any custom log statements so that individual requests can easily be grepped from busy log files. Falcore collects performance statistics on every stage of the pipeline. The stats for the request are kept in PipelineStageStats. This structure will only be complete in the Request passed to the pipeline RequestDoneCallback. Overhead will only be available in the RequestDoneCallback and it's the difference between the total request time and the sums of the stage times. It will include things like pipeline iteration and the stat collection itself. See falcore.PipelineStageStat docs for more info. The Signature is also a cool feature. See the func TestWithRequest(request *http.Request, filter RequestFilter, context map[string]interface{}) (*Request, *http.Response) Returns a completed falcore.Request and response after running the single filter stage The PipelineStageStats is completed in the returned Request The falcore.Request.Connection and falcore.Request.RemoteAddr are nil func (fReq *Request) Signature() string The Signature will only be complete in the RequestDoneCallback. At any given time, the Signature is a crc32 sum of all the finished pipeline stages combining PipelineStageStat.Name and PipelineStageStat.Status. This gives a unique signature for each unique path through the pipeline. To modify the signature for your own use, just set the request.CurrentStage.Status in your RequestFilter or ResponseFilter. func (fReq *Request) Trace() Call from RequestDoneCallback. Logs a bunch of information about the request to the falcore logger. This is a pretty big hit to performance so it should only be used for debugging or development. The source is a good example of how to get useful information out of the Request. type RequestFilter interface { FilterRequest(req *Request) *http.Response } Filter incomming requests and optionally return a response or nil. Filters are chained together into a flow (the Pipeline) which will terminate if the Filter returns a response. func NewRequestFilter(f func(req *Request) *http.Response) RequestFilter Helper to create a Filter by just passing in a func filter = NewRequestFilter(func(req *Request) *http.Response { req.Headers.Add("X-Falcore", "is_cool") return }) type ResponseFilter interface { FilterResponse(req *Request, res *http.Response) } Filter outgoing responses. This can be used to modify the response before it is sent. Modifying the request at this point will have no effect. func NewResponseFilter(f func(req *Request, res *http.Response)) ResponseFilter Helper to create a Filter by just passing in a func filter = NewResponseFilter(func(req *Request, res *http.Response) { // some crazy response magic return }) type Route interface { // Returns the route's filter if there's a match. nil if there isn't MatchString(str string) RequestFilter } Interface for defining individual routes type Router interface { // Returns a Pipeline or nil if one can't be found SelectPipeline(req *Request) (pipe RequestFilter) } Interface for defining routers func NewRouter(f genericRouter) Router Generate a new Router instance using f for SelectPipeline type Server struct { Addr string Pipeline *Pipeline AcceptReady chan int // contains filtered or unexported fields } func NewServer(port int, pipeline *Pipeline) *Server func (srv *Server) FdListen(fd int) error func (srv *Server) ListenAndServe() error func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error func (srv *Server) Port() int func (srv *Server) SocketFd() int func (srv *Server) StopAccepting() type StdLibLogger struct{} This is a simple Logger implementation that uses the go log package for output. It's not really meant for production use since it isn't very configurable. It is a sane default alternative that allows us to not have any external dependencies. Use timber or log4go as a real alternative. func (fl StdLibLogger) Critical(arg0 interface{}, args ...interface{}) error func (fl StdLibLogger) Debug(arg0 interface{}, args ...interface{}) func (fl StdLibLogger) Error(arg0 interface{}, args ...interface{}) error func (fl StdLibLogger) Fine(arg0 interface{}, args ...interface{}) func (fl StdLibLogger) Finest(arg0 interface{}, args ...interface{}) func (fl StdLibLogger) Info(arg0 interface{}, args ...interface{}) func (fl StdLibLogger) Log(lvl level, arg0 interface{}, args ...interface{}) (e error) func (fl StdLibLogger) Trace(arg0 interface{}, args ...interface{}) func (fl StdLibLogger) Warn(arg0 interface{}, args ...interface{}) error type StringBody struct { BodyBuffer *bytes.Reader // contains filtered or unexported fields } func (sb *StringBody) Close() error func (sb *StringBody) Read(b []byte) (n int, err error) type StringBodyFilter struct { // contains filtered or unexported fields } func NewStringBodyFilter() *StringBodyFilter func (sbf *StringBodyFilter) FilterRequest(request *Request) *http.Response func (sbf *StringBodyFilter) FilterResponse(request *Request, res *http.Response) Insert this in the response pipeline to return the buffer pool for the request body If there is an appropriate place in your flow, you can call ReturnBuffer explicitly func (sbf *StringBodyFilter) ReturnBuffer(request *Request) Returns a buffer used in the FilterRequest stage to a buffer pool this speeds up this filter significantly by reusing buffers Package falcore imports 24 packages (graph) and is imported by 12 packages. Updated 2013-11-08. Refresh now. Tools for package owners.
http://godoc.org/github.com/ngmoco/falcore
CC-MAIN-2014-10
refinedweb
1,600
50.43
Hi, I migrated my application ExtJS version from 3.4 to 4.1.1. I modified almost all .js files with the new classes (like instead of Ext.Button used Ext.button.Button etc.), removed all .namespaces(), modified Ext.extend to Ext.define, removed all superclass constructor calls and placed 'this.callParent(arguments) and few more. After that no errors displayed either in Firebug or in Developer tools (chrome) and more over no page is displayed. I used Fiddler to see the request breakages and find no clues. Could anyone have any idea on where exactly do I need to focus to find out the issues for not loading the page..??? Thanks for your help. Regards, Raghu
https://www.sencha.com/forum/showthread.php?246761-No-Errors-and-No-page-displayed&s=4afd0cf4f78e737f9af26d00bf104c19
CC-MAIN-2020-05
refinedweb
117
71.61
User talk:THE/arkive one From Uncyclopedia, the content-free encyclopedia 'Lo. Good to see you've joined the fold and got an account - you've created some good quality work, I'm looking forward to seeing more of it ;) RabbiTechno 18:48, 11 April 2007 (UTC) Bout time!! :-D -- THINKER 18:54, 11 April 2007 (UTC) Thanks y'all. --THE 23:22, 11 April 2007 (UTC) A small tip when creating new articles Actually, two tips. First, you better come out with something that actually looks like an article since the beginning. Or else it can be ICUed or worse, QVFDed, all that shit. If you want to take your time, create it in your user space (instructions here). In case you are sure you're creating a funny thing and proceed to start it in the main space, use the {{Construction}} template to signal other users about the article still being incomplete. All right? -- herr doktor needsAV2 [scream!] 14:26, 13 April 2007 (UTC) Pennywise Thank you for your contributions to Pennywise the clown. Your help is greatly appreciated. I thought that article was done for. Jimmy the Hellhound 13:30, 18 April 2007 (UTC) - No problem. I'll try and add some more stuff to it when I get the chance. --THE 15:28, 18 April 2007 (UTC) Thanks THE u edited my article Unda Construction and made it better and make more sence. FREDD is me and i'm not a comedic genius though (that comment was left by TheNewYarkov sometime in April) Thank you Gracias for the the review of Barbie doll worship. You have no idea how long I've waited for it (or perhaps you do, never can be sure). By the way, the Kool Aid outburst was about the Heaven's Gate suicide (which I bet you already know) and the Paul Newman thing was because Paul Newman donates proceeds to charity, which seems the logical extension of Jesus' teachings, hence the Jesus Says. However, the joke there (admittedly coming after reading Farenheit 451) is that Jesus is commercialized. Whatever. It's a good review anyway. I need to linkify, I agree. Thanks. --(That comment was left by this guy whose username I can't spell properly, but he forgot to sign his comment so I signed it for him) - I'm glad you found my review helpful. I sort of get the Paul Newman thing now. It's just a rather elaborate joke that took a while (roughly twenty-four hours) for me to comprehend. Sorry I mistook it for being meaningless. Anywho, thanks for the Golden Shower Award. --THE 20:51, 23 April 2007 (UTC) Haaa THE; a definite brother in arms. A mad genius secretly plotting against Bogdanovich? I damn well hope so. --THINKER 00:22, 24 April 2007 (UTC) - Indeed. What a pity that UQG and Boggy never finished their collaborative film. I'm sure it would have been a cinematic masterpeice that none of us mortals would have ever forgotten. --THE 22:35, 24 April 2007 (UTC) - Food for thought: that collab is an article away.. - hmm...now there's an idea! I can see it now. A collaboration of two brilliant, but incredibly deranged, minds...it would certainly require a little tweaking of the intertwining epic of UQG and Bog, but this could definately be a masterpeice of epic proportions in the works. --THE 18:36, 25 April 2007 (UTC) UPDATE: I left this message in your talk page, too, but I started an article called Sex Seafood about their collaboration. --THE 18:28, 26 April 2007 (UTC) Oh Noez! Looks like The UQG page got huffed man...might want to talk to an admin about that... --THINKER 22:05, 29 April 2007 (UTC) - I am THE, writing to you from an IP address, because I was banned for writing UQG quotes. I talked to the admin who huffed the article about resurrecting it...now, all we can do is wait....and pray.... --74.75.67.207, aka a depressed and exiled THE. 20:10, 30 April 2007 (UTC) Exclamation point? Ampersand! THE... I came to help fight for your cause but it looks like Famine is bipolar changed his mind. I had a whole list of colorful words, too.......................... Oh well. Glad you're not disunbanned. Keep up the good work. " - K. See ya. Or maybe not. Really depends on when you see this message, I guess. Could be never, depending on what or what doesn't happen. --Nutmegger 01:38, 2 May 2007 (UTC) - It's a good thing you didn't get to Famine's talk page. I don't know what "colorful words" you had in mind, but they probably would have pissed him off. It's not a good idea to insult an admin. It usually gets you nothing but a ban. --THE 17:45, 2 May 2007 (UTC) - Famine handled the situation like any spot-on mod, managing a large community of personalities. See a potentially problematic trend, squash problem before it gets too out of hand, all standard MO. Please no anti-Famine backlash. He's obviously dealt with some tougher cookies in his time as admin. - I agree. There were about 700,000 Unrelated Quotes scattered around this website, and he was just doing his job and cleaning up things that could potentially get messy. I hope I don't give the impression of being anti-Famine. I realize that without him and other admins deleting excessive crap, this website would be filled to the bursting point with basic stupidity. --THE 18:30, 2 May 2007 (UTC) - I still want to do the article on Famine's Fan Club, though... --Nutmegger 20:36, 2 May 2007 (UTC) Like I said on Famine's talk, I was only vouching for THE, and his lack of action has proven THE to be the type I expected, thankfully. Nutmegger, you're treading thin ice, on your own. Provoking mods unnecessarily will get you exactly what you're expecting. I wouldn't say anything, but you seem like the vendetta type who'll get banned and come back as an IP blanking pages and/or committing other anti-admin vandalisms. This is frowned upon activity. Instead of holding a grudge over a resolved situation, why not edit an article or two? Jeeze.. --THINKER 03:08, 3 May 2007 (UTC) - I don't have anything against Famine. I'm just parodying his handling of the situation. --Nutmegger 20:05, 3 May 2007 (UTC) - Well, making fun of an admin in any way is generally a no-no here. If you want to make fun of the way someone handled a situation...well...aren't there any other people who would be better to parody? Presidents, perhaps? Perhaps you should put your writing skills to better use, as The Thinker suggested, and stop practicing the evil and despicable crime of Admin-Bashing. --THE 20:12, 3 May 2007 (UTC) - Holy Crap. you don't quit do ya? Well, your article appears to be on the Quick Vote for Deletion Page. Perhaps whichever admin deletes it will have mercy on your sinful soul and give you a second chance here...but i don't know. you seem awfully...unremorseful about all this. I'd start praying for mercy if I were you.--THE 21:17, 3 May 2007 (UTC) UPDATE:It seems you;ve been given a second chance. Your article is gone, but you are not banned. Well, whatever. Uncyclopedia works in mysterious ways. Maybe you could write something constructive now, huh? --THE 19:00, 5 May 2007 (UTC) - Ugh. I worked hard on that article. Oh well. Heh heh heh... --Nutmegger 01:37, 6 May 2007 (UTC) - Guess what? An Article About the Deleted Article that was Famine's Fan Club. It's like a spaceship. --Nutmegger 18:23, 6 May 2007 (UTC) NOTE for intrested readers: the usserdiskussd here has been bannd for three monthts for vanity and genral assholery. wen he comes bak, hopfuly he'll be sober. --THE 20:03, 9 May 2007 (UTC) - Heh...pretty damn funny. Although to be frank, I'm a little upset that someone who I've never banned took the time to work that up. I mean really - with all the bans I've given out, how is it that most of the people who come and mess with my userpage aren't people I've banned? - Anyway, thanks for giving me a laugh. I'd probably have done what Mhaille did, but it's too bad I didn't get to see it all first hand. A fan club...now that's funny....what's next? The "Famine cares" page? :) Sir Famine, Gun ♣ Petition » 05/9 23:50 - haaa, I figured you would discover this strange little incident sooner or later. I guess Nutmegger was tired of writing articles about your fan club and decided to "parody" you in a more direct way by vandalizing your userpage. You ought to vandalize his userpage while he's banned, just to rub it in his face :)--THE 23:57, 9 May 2007 (UTC) - I wasnt being serious about vandalizing his userpage...or I wasn't being particularly serious....."until he returns"...now there's a terrifying thought. I'm having nightmarish visions already: "The article about the recently deleted article about the deleted article about the huffed article written by the banned user who wrote the huffed article about the deleted article about famine's fan club" or something along those lines... --THE 00:45, 10 May 2007 (UTC) cokie I'm geeving oot cokies. Whope hyou appreshieate id. -:10, 7 May 2007 (UTC) Notes on the Project Hey bud, don't want you to think I've abandoned over here (even though one drunken evening produced this little beauty). Did some work on the Pre-production today. I don't want to start hacking away at anything, but you'll notice I made pre-production a subheading rather than heading. My concern is that if we go too far into the conflict, we're gunna not have any room to write about the film itself (either that, or it'll be 8 sections down, beyond the reader's attention span). Now, being that Un is so awesomely expansive, there are a number of options here: 1. We condense the history and talk about the film within the article. 2. We leave this article as a "Making of" kinda-almost featurette about the film, and then cowrite the actual film itself as an UnScript (depending on what decisions we make for the film itself, this could be either very funny, very stupid, or very both). This would allow for something I've wanted to do ever since seening UnScripts: A DIRECTOR'S COMMENTARY PAGE!! Like the exact same article as the script, with little blurbs from the directors thrown in where ever! Isn't that a cool idea? Option 2 would be a pretty massive undertaking, but hell, if I don't have 5 am class this month I'll probably be up for anything. Your call though, partner. :) --THINKER 21:52, 7 May 2007 (UTC) - Well, here are my thoughts. The article seemed to be drifting more towards having the film be some sort of weird expiremental film (three hours of footage of lobsters crawling around in a little plastic kid's pool, or something). However, with a click of the "delete" button, we could abandon the thing about a "non-human" cast and start over. The reason there is so much stuff in there about the history of the film is that I, similarly to UQG and Bog, have been putting off the idea of thinking of a subject for the movie to the very last second. - My initial idea, though, would be to go with a sort of combination of the two options. Firstly, the film itself. Our first task should be to think of what the movie itself will actually be like. If we decide to make it a full-fledged movie (with a plot and everything!) we could go with your idea and make an unscript and a commentary to go with it. OR, if we decide to make it into a screwed up expiremental movie, we could make a synopsis of it in the article, then maybe make an individual section in the article solely devoted to an excerpt from the director's commentary. Then, there could be a final section of the article devoted to the "critical acclaim" the film recieved, and the ends of the respective tales of our two heroes. - So, basically, what we do comes down to what we decide to make the movie about. Either way, we will still be making a director's commentary, the only difference being whether to make a section out of it, or an entire script. The commentary thing does have the potential to be absolutely hilarious, whether it becomes a full article or not. So whaddya think? What kind of movie did UQG and Bog make? --THE 22:25, 7 May 2007 (UTC) - Hmm, this is a good point which I hadn't considered.. - Well, my thinking would be that as a collaborative effort, it'd end up being sort of the "best" of both directors. Like, UQG likes to set a camera on something and film it for hours on end, while Bog likes overly dramatized melodrama, so the result could be something like: - UQG and Bog decided upon what they dubbed "Half-Natural Performance Art," in which the camera was trained solely upon the lobster tank at a local Shells seafood restaurant. Par UQG's vision, various aquatic animals were placed within the tank and were filmed interacting with the lobsters. Around 12 hours of footage was taken with several species of crustations and fishes. Bogdanovich handled coordinating efforts between cast, crew, and onlooking restaurant patrons at this time. - After filming wrapped, Bogdanovich set out to add cohesion to the otherwise plotless mass of film. In post production, Bogdanovich and UQG sifted tirelessly through every taken shot, piecing them together one-by-one. As they built the film, so too did Bogdanovich build a story around Alister, the tank's biggest lobster, and the various characters he meets as they enter and exit the tank. This, when added to the psychedelic backgrounds and ambient musical choices of the pair, turned the film into a modern masterpiece. - I like it! If you don't have any objections, I think I'll stick that section you wrote into the article. It definately works well. I find the idea of writing an UnScript slightly terrifying, as I tend to prefer writing in huge blocks of formal, "textbook-style" prose, but I'm sure I'll figure out what I'm doing once we get going on that project. - Okay, so the way I see it, we've got our priorities set as follows: - ONE-finish Sex Seafood. The simplest of our tasks. - TWO-write an UnScript. You can start this one, and hopefully I'll "catch on" soon as to how to write a script, something I have little experience at doing. - THREE-director's commentary. this one should be hilarious, and a little easier too. Like you said, it would just be copying the original script, and adding "commentary" from both directors. - Well, it sounds good to me. Should be fun. So, are you okay with me copying in that section to the article? We could re-word it and stuff, of course, but does that sound good? --THE 22:58, 7 May 2007 (UTC) - Absolutely dude! I was just flyin by the seat of my pants on that one but if you like it, definitely add it right in there where ever! - Also, don't be intimidated by the script. I too perfer blocky faux-textbook style writing, but as I found with The Creature of Planet Cheese, its really just about getting into the flow with it. Lots of copy-and-paste on the bolded names, lot of formatting, but over all it should be cake...maybe not if it were a real script, but its Un, and thus it can be as nonsensical as we want (lol, and it'll probably evolve as we go along with it). I'll get it going as soon as we hammer out the rest of this article. --THINKER 23:05, 7 May 2007 (UTC) - Excellent. I'll go ahead and add that section to the article, and we can mess around all we want with it after that. Then, I'm afraid I'll have to log off for tonight (my pizza is going to be EXTREMELY cold). But I'll be back to help finish up this article as soon as I possibly can (which might be tomorrow, I'm sad to say). --THE 23:09, 7 May 2007 (UTC) PS - Vote or Die! :) --THINKER 23:12, 8 May 2007 (UTC) - Thanks man! I just don't want it to stall out; my other 2 nom'd articles were only Quasi-featured mainly due to inactivity. My schedule is much better now, so once I can get back in a positive sleeping cycle I'll jump back on the project. We should be finished with the history page pretty soon! :) --THINKER 06:29, 9 May 2007 (UTC) - Oh yeah, that page is definitely getting near completion. I've been working on it quite a bit. Just finished an extensive rework of the "making the movie" section. It still needs a little tweaking, and definately one last section about how the film was recieved, but we are definitely almost done! I can feel it!!!! --THE 20:41, 9 May 2007 (UTC) Okay, updated the Inspiration section (very funny btw, love the part about the haircut: such a perfect reference note :-D). By the way, we MUST get a good photochopper to do a poster for this thing. --THINKER 03:56, 10 May 2007 (UTC) - A poster sounds good. We could use a poster for the script too, once we make that. The thing about UQG using pie-charts to explain his idea was hilarious! I added a TON of stuff to the article today, in a fit of pre-finishing-the-article excitement. The history of our two heroes seems to have taken a rather melodramatic and tragic turn in the "unfinished sequel" section. The section about the critical response to the movie could really use some more work (and could also use an oscar acceptance speech by Bogdanovich...I wrote one for UQG, but I'm not too good at writing Bogdanovich quotes). I've also tweaked the two articles about the individual directors to correspond with these new developments. --THE 19:45, 10 May 2007 (UTC) - Alright, everything on the page has been Thinkeriz'd. This article, as is, seems like a "Making Of" featurette rather than a complete entry about the film, mostly because we don't go into the movie itself at all (I guess, due in part to the fact that we haven't written it yet). It'd be branching the concept out a bit, but we might be able to have it linked to an umbrella DVD page, featuring links to the film script, director's commentary, this page, and the page that discusses the movie's specs in an encyclopedic manner. Just thinking out loud; we can discuss this all. Right now though if there is nothing more for that article, it is complete on the writing side. We need some pics and a few little touches (factoid template maybe, things like that), and it'll be set to go. Now, step 2 is the script then? yeeee! - Oh, and PS - Vote or Die...AGAIN! (probably gunna be another Quasi, *sighh*) lol :) --THINKER 18:38, 16 May 2007 (UTC) Hey, just wanted to let you know I put up 2 new sections, getting towards the meat of the screenplay. I'm kinda formulating a story as we go along, so it can still go any direction, but I think it has a pretty firm set of material so far. Lemme know whatcha think! :) --THINKER 12:02, 23 May 2007 (UTC) - It looks pretty good to me so far, though I have so much stuff I have to do that I don't think I'll be able to really look through it or edit it until tomorrow. --THE 20:05, 23 May 2007 (UTC) - Awesome, I'll leave it alone for a bit so you can check it out at your leisure and we can both think up some new ideas. I'm working off a basic plot in my head, and of that, the script is about half complete (like the dream sequence is gunna imply about 45 minutes of footage, and serves as the half-way point, at which time I think the "ant song" would be playing). The second half also has a concept, but that can evolve also if we get inspired. :) --THINKER 02:07, 24 May 2007 (UTC) - I added some more to the bizarre dream sequence and had him wake up. The fixation with the salad bar is still there (I have an idea for an ending of the "salad bar" storyline). As for the second half of the story, whaddya have in mind? I seem to have developed a small idea for a story...something along the lines of Alister falling in love with Daphne and proposing with hopes of soothing his "melancholy soul," but their marriage getting interfered with by some sort of religious zealot character (perhaps a snail) who doesn't believe in "inter-species marriage" or something like that. Could provide for lots of melodrama. But what's your idea? Let's brainstorm a bit before we start the second half. --THE 19:41, 24 May 2007 (UTC) - That all sounds pretty cool, I think it'd all work with my ideas: I was thinking that the dream sequence can end with Alister being visited by some mystical creature (I was thinking something like Ra, the Almighty Blowfish). The creature tells Alister of the grandness of the salad bar (making it out to be a sort of crustacean heaven). When Alister wakes up, he becomes enlightened, preaching about the afterlife at the salad bar (at this time, he could begin courting Daphne...I think it'd be funny if he continues his sort of disdainful attitude towards her though, even while trying to woo her). He gains a following with his preaching (a congregation of shrimp or something). Everything is going great, when Alister is taken out of the tank by human hands. I envision a lengthy goodbye speech as he's being taken out (like, way longer than it would take for a person to pull a lobster out of the tank). He'd tell them how grand it is that he's transcending to the next plane of existence, etc etc. For the dramatic, ironic melancholy ending, Alister is dead, ready to be served to a customer, being garnished on a platter at the salad bar. I like the idea of Alister becoming some sort of religious prophet, and it wouldn't be too hard to weave in a romantic storyline between him and Daphne. Your idea for an ending, with Alister getting cooked, then seasoned at the salad bar, would maximize the bizarre irony of this whole tale. My original idea for an ending to the "salad" storyline was more centered around making fun of excessively sappy, corny, hallmark-channel style feel good movies. Alister would have some sort of crisis of faith, and get all depressed, thinking he would "never, ever ever" taste salad in his life. He would become convinced that his life was worthless, and in the typical "feel-good movie" fashion, some sort of absurd plot twist would happen (along the lines of a passing waiter spilling a monstrous bowl of salad into the tank for Alister to feast on). Either way, I like the idea of Alister becoming a prophet for his fellow creatures. I think either ending could work all right, because they're both odd and ironic in their own way, but let me know what you think. The character box was a good idea, by the way. That way we can add as many characters as we want without worrying about the list taking up more space than the actual script:) --THE 23:43, 24 May 2007 (UTC) M'kay. I added a part to the dream where Alister meets the blowfish (I called the mighty blowfish "A", but you can change it if you want). I still left our options open as far as the rest of the story is concerned, but I'm starting to think your idea for an ending (Alister getting cooked rather than some waiter spilling salad into the tank) would work better. lemme know watcha think, though. --THE 00:47, 25 May 2007 (UTC) - Aw, damn I'm actually really torn, because your ending makes perfect sense (I see where you were going with the build-up of Ali's existential frustration), and reminds me on a HILARIOUS Upright Citizens Brigade sketch that could totally be work into the story!! My only concern, if we went that route, is what happens after the salad gets dropped in? Alister eats, and becomes happy? Actually come to think of it, a waiter dropping in some salad could be worked into my ending as well as the Daphne angle: perhaps, after the dream sequence, the waiter drops in the salad. Alister wakes up covered in a couple of lettuce leaves, which give him credibility among his new followers. It covers all of our ideas into a cohesive package, unless I missed a point somewhere in this massive discussion we've amassed here (hehe) - And A is fine by me for the mighty blowfish: I have some great, great dialogue ready for him which we can play around with. He's one of those enigmatic "one with the universe" types, which are sooo funny in parody. I think, if the story is somewhat hammered out, we'll be able to truck through the rest pretty easily (and funnily)!! - Oh, and PS - I had to give a little nod to the boys. :-D --THINKER 03:14, 25 May 2007 (UTC) - Yeah, that sounds like a good plan. Maybe at first nobody believes what Alister says about salad until after the waiter spills some in, or something like that. That way, we could still have that ultimate irony at the end. great idea, by the way. I have a good idea of some closing dialogue between some of the remaining animals in the tank, something along the lines of "I will never forget...um...what was that guy's name again?" Something along those lines, that will really drive home the empty-headedness of the rest of the creatures in the tank. We still have a few details to work out, but I'd say we're ready to dive back in and start writing part two. Think so? --THE 19:47, 25 May 2007 (UTC) - Absolutely; sail on, silver bird! I'd get on it right now if I didn't have to go out drinking (normally that'd be a good thing, but tonight it's with shit company; I'd rather drink at home and do some writing). If I'm functioning when I get home, I'll do some addingz. :) --THINKER 20:21, 25 May 2007 (UTC) - I started the next act. It's much smoother sailing now that we have a definite story that we're setting up. Also, I messed around with the history article a little for continuity with the emerging script. - I like it!!! Just finished some edits on the current material; leads perfectly into the waiter dropping in the salad/sign from god. As for the linking, I wouldn't say its exempt, but I try to limit my linking in the script world since, unlike an encyclopedia entry, the material isn't meant to be referential. I mostly try to keep it to proper names and stuff like that (which is why James Bond and Orson Welles are linked therein). I wouldn't be against it though, but with the conversational nature of the bulk of the work, I'd keep it sparse. --THINKER 20:21, 26 May 2007 (UTC) - Okay, I started a new section where the waiter spills in the salad. It's a bit weak now, could use some messing around with. I couldn't figure out what to make Daphne say after she tasted salad; what would a creature as simple minded as her say when exposed to the vegetably (YEEE! I invented a word!) goodness of salad? - I was thinking act seven could be the one where Alister becomes the preist that he is destined to be, and will also be where the romance blossoms...it'll probably be a fairly long act, but 'twill be good anyway. From there, it will just be the final act left, which will be really fun to write. --THE 22:23, 26 May 2007 (UTC) - Well, I've now added a villainous character, another lobster who is a sort of worm flakes purist. He's the only one who doesn't taste the salad. I was thinking that he would be the source of conflict in act seven when he tries to turn the other animals against Alister, and possibly interfere with Alister and Daphne's romance (dialogue along the lines of "First he tried to corrupt us against the mighty fish flakes, now he's encouraging inter-species marriages! Next, he'll be telling us to try and escape!"). Then, the moment of victory for Alister (before tragedy strikes) can be when he finally convinces Dennis to taste the last remaining piece of salad in the tank, and Dennis can finally be converted to the glories of saladism, and it can be right after that that Alister gets taken out, and the empty-headed animals in the tank forget about him in five seconds. Sound good? --THE 23:02, 26 May 2007 (UTC) - Definitely sounds good! I looked over the new stuff but haven't sat down line-by-line with it yet, but I like the direction 100%. I'll hit it up tomorrow for the indepth read. Let's continue the discussion down under "thank you," shall we? This section of the talk page is getting tough to work with cuz it's so LONG. --THE 16:53, 28 May 2007 (UTC) sorry, me again just out of interest, how old are you?--TheNewYarkov 06:43, 9 May 2007 (UTC) Fair enuff ok- me from a different computer - From a different computer? You can still sign in even if you are on a different computer. It's amazing.--THE 19:44, 15 May 2007 (UTC) Not fr0m my mum's. she would bite off my dick--The New Yarkov 06:57, 21 May 2007 (UTC) HowTo:Beat the Odds As per your advice, I tweaked the beginning and added a new section. If you could, please review it again. Gracias--Sir Ljlego, GUN VFH FIYC WotM SG WHotM PWotM AotM EGAEDM ANotM + (Talk) 21:51, 9 May 2007 (UTC) - Whew, tough set of edits there. Just kidding. Yeah, I wasn't too keen on my European section either. It frankly sucked. And I changed the first part of "What are the odds." Review it one more time, if you wish.-Sir Ljlego, GUN VFH FIYC WotM SG WHotM PWotM AotM EGAEDM ANotM + (Talk) 22:17, 9 May 2007 (UTC) Peace. And nice! 46.5! That's the best I've ever getted.-Sir Ljlego, GUN VFH FIYC WotM SG WHotM PWotM AotM EGAEDM ANotM + (Talk) 22:36, 9 May 2007 (UTC) - It's a good article, and was enjoyable to review. Quite a contrast to the last article I reviewed. --THE 22:28, 9 May 2007 (UTC) - It's up for VFH (see my sig for the link), vote for it!-Sir Ljlego, GUN VFH FIYC WotM SG WHotM PWotM AotM EGAEDM ANotM + (Talk) 00:31, 11 May 2007 (UTC) PINK FLOYD! You like them too? AWESOME! Just because they're not a lot peoples' favorite. Nice. Another cultured Wikipedian.-Sir Ljlego, GUN VFH FIYC WotM SG WHotM PWotM AotM EGAEDM ANotM + (Talk) 21:54, 9 May 2007 (UTC) - Aw yeah. They're awesome. my first article was almost completely about them. --THE 22:28, 9 May 2007 (UTC) Hey THE Thanks for helping me with my debut article. And yes, its funnier if both Stephen Hawking and Yoko Ono go on their sexcapades together. -Leoispotter - Yep. No problem. And you do know that you're logged out right now, right? Check out the history page of the article. It shows you as an IP for some of your most recent edits. --THE 23:48, 9 May 2007 (UTC) - Oh whoops-Leoispotter Careful you two.. this guy might come to gitcha.. hah! --THINKER 01:55, 10 May 2007 (UTC) - Haaaa...yeah plus there's the "Sex Tape" section I added to this article.--THE 19:45, 10 May 2007 (UTC) Self Promotion Thank you for looking at me, I thought no-one cared. The changes you made were great... Please award yourself a shitty template of your choice... and if you are bored all the other articles on my user page are in desperate need of comedy. --dantoller - No problem. I'll take a look at some of the others, though I probably won't get to ALL of them --THE 19:45, 10 May 2007 (UTC)) VERY IMPORTANT, MORTAL!!! FREDD has extended an invitation for you to join the mighty Unda Construction in doing so, you ensure your survival, on the day of reckoning, when Unda Construction finishes their master plan. To accept this invitation go to the User page of our mouthpeice, FREDD, go to the discussion page, and type i accept. sign your comment to decline, hide in a box and die. that is all. --Unda Construction Thank You!/NotPII:Redux2.0 Thank you for choosing The Red Pill You've exhibited the capacity for the divine truths of existence (*even if you were originally just trying to shed some poundage before the big cruise). Muchos gracias, mi amigo. :) --THINKER 04:01, 27 May 2007 (UTC) - Hey no problem. You got a featured article at last, after all those QFH's! congratulations!! - I'll wait to add anything more to the script until after you've gotten a look at the stuff that's there now. --THE 16:03, 27 May 2007 (UTC) M'kay. I started up the next act, where everything falls into place for our hero. Looks like we're getting pretty close to finishing this script! /*rubs hands together excitedly in preparation for THE COMMENTARY PAGE* :} --THE 21:04, 28 May 2007 (UTC) - Yep everything is truckin right along pretty damn nicely. Its gunna be the Uncyclopedia film release of the year! --THINKER 21:07, 28 May 2007 (UTC) - Yes, it should be quite an epic upon completion. I was going to apologise for getting sidetracked earlier today, but I saw that you did too. Nice article by the way, an excellent parody of the IP users who haven't yet realised that nobody cares about how awesome their algebra teacher is. - I might be able to get a few more punches into the script tonight, maybe. We're almost done! Yeeeeyyyaaaya!! -- 74.75.54.87 21:40, 28 May 2007 (UTC)THE (who accidentally logged out) 21:42, 28 May 2007 (UTC) OKAY! I've finished up my initial "draft" of the seventh act, which still awaits your usual round of edits. I gave the last act a title, and I figure Alister should get seized at some point during the wedding procedure (preferably sooner rather than later, since the script is getting pretty massive now). --THE 19:53, 30 May 2007 (UTC) - DENNIS: HEY! Just because I'm dismissing you without even considering what you have to say doesn't mean I'm closed-minded! -- made me lol! I really hope my edits are helping your humor rather than chopping away at it; if there are any parts you feel are being poorly altered pleeeease change them! I just think that you have the right idea on most of this stuff as far as I can tell, and I just tweak and fine tune it. I don't wanna be like the looming.. chopper-awayer(?) I don't know. Anyway as usual, I really love where its going, and will do some edits first thing after class tomorrow. - PS - Were you channeling the kindred spirit of Lil Jon in that scream up there?!?!!?! :-D heheheh --THINKER 03:46, 30 May 2007 (UTC) - Dennis' line is actually based on numerous political debates I've had with THE. THE based Dennis' character on me.--Leoispotter - Keep out of this, Leospotter! And you just interrupted one of the thinker's old messages, completely throwing off this entire discussion! oops, I did too...anyway, get outta here! And I'm not an asshole! Just because I beat you mercilessly in ALL of our political arguments doesn't make me an asshole, it just makes me RIGHT! - Don't make me start ranting about your political ignorance again! We'll take this up in class tomorrow (unless I forget. in that case, have a nice day)!!!!!!! --THE 19:00, 31 May 2007 (UTC) - UPDATE: Ah. you took the "THE's an asshole" part out of your message. I suppose I'll look like a lunatic now, especially after giving you that bowl of shit pudding in your user talk...oh well. And yes, I did borrow some of the more objectionable aspects of your political opinions for Dennis, especially the part about Dennis never even considering the fact that he might be wrong about ANYTHING, no matter how reasonable the argument against him is. Wow. Look at me. I'm ranting, after I promised I wouldn't! AAAAAAAAAAAA! --THE 19:18, 31 May 2007 (UTC) - Whoops, didn't mean to interrupt that message. Yeah, I should probably stop talking now.(PS. I win all our political debates, not you)(PPS: I fixed the talk page. Now this entire discussion is irrelevant)--Leoispotter - No no, your edits are always helpful. I almost never proofread anything, so it helps to have all my "peices" turned to "pieces," my "rediculous's" changed back to "ridiculous's," and my other generally embarassing spelling mistakes fixed. And your contributions and alterations add well to the humor, too. No worries. And yes, that was an attempt at a Lil Jon scream up there. I'll wait to start in on the last act 'till you've gone through act sebben. "sebben"? "yeeeeyaaaya"? what is WRONG with me? :} --THE 19:53, 30 May 2007 (UTC) - Act Phil Ken Sebben?? Finish'd! :-D WELL, I've written the rest of the script. It could use a once-over, and Alister's farewell speech is rather sub-par. I wasn't quite sure what the nature of the speech was going to be; does Alister think he's being taken to the salad bar? Or does he not know what's happening to him? You can go ahead and rewrite the speech if you want, as in its present stage it's not very good. I really laid on the melancholy irony quite a bit in there at the end...I'm telling ya, it was tough writing that last scene... Sometimes satire can be suprisingly...tragic. --THE 20:42, 30 May 2007 (UTC) - D'oh! I was going to foreshadow the "hands from above" in Ali's meeting with A and totally forgot. I'll add a few lines on that when I do my read-through and edits. How crazy is it that the movie is like 98% done?!?!?!? :) --THINKER 21:21, 30 May 2007 (UTC) - I know! It's almost ready to be unleashed! - Incidentally, there are a few pictures on the Wikipedia article about lobsters that could be extremely useful if "borrowed." I was actually extremely suprised by the potential usefulness of one image [1], which seems to show EXACTLY what the final act describes! Just food for thought. Seafood for thought. --THE 23:58, 30 May 2007 (UTC) RIP looks like unda construction is fucked--FREDD 06:07, 28 May 2007 (UTC) I need a hug--FREDD 06:07, 29 May 2007 (UTC) /*pats you on the back reassuringly*/ I have repsnotted rebsponded resplotted ressponted responded in your talk page. --THE 21:58, 29 May 2007 (UTC) Thanks For the Pee Review. --Mr.Vib 13:13, 29 May 2007 (UTC) - no problem. was i right in assuming that it was referring to the REM song, or the fact that there was some correlation just some wild coincidence? --THE 21:58, 29 May 2007 (UTC) not so bad Nah, my uncles american and hes about the coolest guy ever. exept hew kinda moved to costa rica. and he smokes cuban cigars. Hey do you know what country Uncyclopedia started in? i couldn't find out anywhere, so i just assume Haung is american--ETLCh X4Ch ChTLG GTLCh 06:17, 30 May 2007 (UTC) - I think the site's servers are here in America anyway. not sure though. and for all I know about Haung, he could be a gerbil from Sweden. --THE 19:53, 30 May 2007 (UTC) i asked him on User talk:Chronarion and somebody answered it started in the US--TheNewYarkov 09:21, 4 June 2007 (UTC) Cookie= for trying to help Unda construction--ETLCh X4Ch ChTLG GTLCh 07:38, 30 May 2007 (UTC) Kidlet research iv asked you before but how old are you. im trying to find out how many users are kidletts or there about. are you?? - I am three and a half years old. My parents occasionally let me out of my crib, and whenever they do I crawl over to my computer and write uncyclopedia articles. --THE 19:53, 30 May 2007 (UTC) Thanks!! The Folgers brand Folgers Corporation thanks you for choosing Folgers Crystals Your commitment to quality confirms that you are definitely not a pussy. One mo' 'gain, thanks buddy!! SS gets edited after I finish handing these out!! :) --THINKER 18:07, 30 May 2007 (UTC) Thank You! And also: Seamus was your article? Awesome! I found the Seamus article to be hilarious, and I can't wait to check out your edits to "Wish you Had Beer". Thanks for fixing it!--Glowla 18:29, 30 May 2007 (UTC) - You're welcome, though I didn't really "fix" it so much as just extending it. - And yeah, seamus was my article. my very first one. I wrote it when I was still a lonely, friendless IP user. I'm glad you like the "Seamus" article, and am also glad that you don't mind that I made references to it in your article (i was afraid you'd get pissed). --THE 19:53, 30 May 2007 (UTC) Welcome to UnNews Nice work with UnNews:Donald Rumsfeld opens pizza parlor) Reverend Zim_ulator says: "There are coffee cup stains on this copy, damnit! Now that's good UnJournalism." Welcome to UnNews,) Actually... you said a while ago to let you know if i needed help with anything, well there is one thing, can you ad an UQG quote onto my user page? or is that just for articles?--TheNewYarkov 06:33, 31 May 2007 (UTC) - I added an unrelated quote to your userpage. Feel free to change it if you don't find it amusing. --THE 19:13, 31 May 2007 (UTC) - Thanks--TheNewYarkov 06:01, 1 June 2007 (UTC) Oye I'm gonna nominate your Drunk Olympics article for VFH. Hope you don't mind--Leoispotter - Wow. This is rather terrifying. I've no idea how good it'll do...AAAAAA! I'm scared! - By the way, I'm sorry I didn't see this message sooner. I was peeing. I hope it hasn't been sitting here...unread...for too long. - Anywho, go ahead and nom it if you want...don't know if it'll make it...AAAAAAAAAA! --THE 20:02, 31 May 2007 (UTC) - The deed's been done. Good luck--Leoispotter - Hey, it was an accident!--Leoispotter - Hah no worries; looks like its doing pretty well as is anyway. I'm keepin my fingers crossed for ya! - Aw, that's okay. No biggie. Hey, we finished the script! Excellent! Drunk Olympics just got killed on VFH!-- Phlegm Leoispotter * (garble! jank!) 20:17, 11 June 2007 (UTC) - Wow, I seriously need to make an archive soon. I saw "you have new messages," and it took me about eight years to find this. Oh well...*sigh*...it'll be all right. It didn't get voted down, it just kind of stagnated. but still...*sob*...thanks for nomming it, anyway. --THE 20:29, 11 June 2007 (UTC) Important information you must know To unlock the secret, you must answer this question: What are the essay questions due tomorrow? Please answer soon... I must get started... J Oh, you can answer in Nutmegger's talk page and delete this little bit of nonsense if you want. But it is related to Uncyclopedia. --64.185.129.238 20:59, 31 May 2007 (UTC) - HOW DARE YOU ask me to help you in your FOUL PROCRASTINATION by asking me such a completely UNRELATED, not to mention STRANGELY WORDED question?!?! Do you REALLY expect me to tell you that question one was something along the lines of "Discuss political reforms sought by the progressive movement. What were the reformers supposed to accomplish, and how succesful were they?" Do you REALLY think I would tell you that question two was "Discuss the philosophies of Oliver Wendell Holmes Jr. and Louis Brandeis. How did their philosophies reflect the progressive frame of mind? Citing examples form court cases, explain the response of the Supreme Court to new legal thought."??? Would you REALLY expect me to tell you something so completely irrelevent to this website? No, my friend, I should say not! --THE 21:06, 31 May 2007 (UTC) - Well then MAYBE you should go stick your head in a PICKLE JAR and EAT all of the GOLDFISH you SLOB... [T]omorrow[H]ank's[A]pple[N]eeds[K]indness... [Y]ell[O]ut[U]rn Try to lick the ICE CREAM OFF YOUR TOENAIL --64.185.129.238 21:14, 31 May 2007 (UTC) - Thanks, I needed those essay questions too. Don't forget to vote for your own article, by the way--Leoispotter Oh Noes! In case you'd like to know, Bruce the moose just called my house and informed my parents that I still haven't passed in my final draft after three weeks. Needless to say, I've been grounded. Thought that might amuse you. --Leoispotter NotPIII: The Second Day After Word, the script = completed, amazing! I'm very proud, that was a massive undertaking. Now, from here? I guess next is the commentary. After that, I was thinking that, if I talk to some other users and get the hang of how to do it, maybe we do that Sex Seafood DVD page. So far we'd have: - The Film (script article) - The Commentary (next article) - Making of Featurette (original article) If we get into it (which, I mean, why not, considering how much time and effort we've already put in) I was thinking a "Behind the Scenes" page interviewing the Joes would be really funny, to get like an objective view of Bog and UQG during the creative process. Besides that though, I'm kinda at a loss for other DVD items,and we'd absolutely need pics for all that.. Whatcha think? --THINKER 00:15, 2 June 2007 (UTC) - The idea of a DVD page is indeed an interesting one, but I too am at a bit of a loss as to what else could be put in it. And another idea that I've been considering lately is the number of pages about this one subject we could have; three is fine as each of them should be able to stand out on its own as a comic piece. Four articles about one thing could be pushing our luck a bit. And as for the need for pics, I recently found a pic on Wikipedia [2] that has some potential. I think I'll get something started on the commentary page today, or I'll at least create it. Should I just call it "Sex Seafood: Special Director's Commentary Edition" or something along those lines? --THE 12:37, 2 June 2007 (UTC) - Yeah I agree that 4 is pushing it (hell, so is 3 honestly, considering SS being blurbed on Bog's and UQG's respective articles). The DVD would be a way to give these articles some central focus. If it were created, I think we'd probably end up moving all these current articles under it's namespace (ie. [[Sex Seafood/Commentary]], [[Sex Seafood/Making_Of]], etc.) which I think would probably be an okay thing. Thinking about it more, I came up with some other possible bonus features to fill it out: - The Film (script article) - The Commentary (next article) -") - It'd be a pretty massive undertaking, but considering we've been working on this in some way or another for like 2 months, I don't see why it couldn't work. I'm going to start asking about some photochopping help in IRC, since the image request is obviously not working (some random shots of crabs and whatnot is okay, but I'd like to get some specific scenes in photo form to give the pages some more authenticity, which is going to require some manipulationing). I'll let you know whats up with that. You should think about poking around the IRC sometime though, its fun when there are funny people in there. - here we are! It's all set and ready for the addition of commentary. I suppose the DVD idea would work out all right. I hadn't thought about stuffing all of the stuff under one namespace. It would take a lot of reorienting of all of the articles, but I think it would work well, sort of making it all into one gigantic article that's divided into sub sections. I can talk about this more in-depth tomorrow, right now I'm being summoned. --THE 23:03, 2 June 2007 (UTC) - Schweet!! This is gunna be great. To snazz it up a bit, I made us some templates for the commentary: {{CUQG}} and {{CBog}} In action, they look come out like this: Awesome, minor addition, already getting funny!! --THINKER 00:35, 4 June 2007 (UTC) - I've added some more for the first couple acts. Commentary from these two guys is so fun to write! --THE 19:17, 4 June 2007 (UTC) - As for your earlier suggestion that I poke around IRC, I have gone there on a few occasions now, with varying degrees of success. The first time I went on, it was when I was banned, and that incident was slightly embarassing. I've gone on a few times since then, hopefully our paths will cross on there sometime :) anywho, I have added some more commentary from our two heroes on the commentary page. As I said before, this commentaru page has been insanely fun to write...I might add a little more today, but I won't add a ton so you can get some punches in if you want :) --THE 19:27, 7 June 2007 (UTC) help me please... i can't log in to uncyclopedia!!! it says i dont have COOKIES enabled??! wtf does that mean?? how do i fix it?? warghhhhhhhh!!! /*cries softly* --TheNewYarkov cant log in help him Help him - Okay. Here'z what you do: go to the "tools" option on top of your screen, and click on "internet options." Once you're in there, there should be an option in there someplace to enable cookies. --THE 12:37, 2 June 2007 (UTC) fukitt i just deleted the external links onb my page, and i can loggin again--TheNewYarkov 00:42, 3 June 2007 (UTC) You need to see this J --64.185.129.238 06:06, 3 June 2007 (UTC) - That site was better when it was a shoe... they've had better pictures before. --64.185.129.238 15:14, 3 June 2007 (UTC) - I used the I-Doser while tripping on nutmeg. It was an experience I'll never forget-- Phlegm Leoispotter * (garble! jank!) 18:56, 5 June 2007 (UTC) - Nutmeg is BAD! Don't you remember NARE (Nutmeg Abuse Resistance Education)? you've got to DARE to resist drugs, nutmeg, and binaural beats! --THE 23:16, 5 June 2007 (UTC) - No, I never graduated from NARE. Its a shame, I really wanted one of those t-shirts they gave out at the graduation ceremony.-- Phlegm Leoispotter * (garble! jank!) 23:21, 5 June 2007 (UTC) - Ha, but you didn't say anything about morning glory seeds or catnip! --64.185.129.238 10:38, 7 June 2007 (UTC) Oh, come on! Ever since Famine went on his quote deleting spree, I've had nowhere to release all my UQG quotes. If you don't let me release them on the commentary of Sex Seafood, my head will asplode from all the pressure building up in my brain.-- Phlegm Leoispotter * (garble! jank!) 23:01, 5 June 2007 (UTC) My head asplode. See, you've killed me. I hope you're happy.-- Phlegm Leoispotter * (garble! jank!) 23:02, 5 June 2007 (UTC) - User:THE/Leoispotter's Unrelated Quote Repository. There you go. If you can manage to repair your asploded head, you can turn that subpage into a shrine of unrelated quotes. have fun. --THE 23:06, 5 June 2007 (UTC) - Nah, the damage is permanent-- Phlegm Leoispotter * (garble! jank!) 23:08, 5 June 2007 (UTC) - I'm sorry man, but I'm afraid that you writing quotes in that article me and the thinker have been writing for two months now would be...i dunno...sort of like "inviting yourself over" to our two-month party. But feel free to write as many quotes as you want in that shrine I made for you...as a matter of fact, you could put ALL of the old ones in there if you could find them, as a sort of memorial to what was. It could even be Unrelated Quote Guy's book, 1000 unrelated quotes! But if you don't want to write unrelated quotes in there, or the damage from your head asploding is unhealable, let me know and I'll blank that subpage and forget it ever existed. --THE 23:14, 5 June 2007 (UTC) - Sadly, my head is beyond repair, rendering me unable to edit the website. By the way, you can have all your shit pudding back. It was stinking up the house. THE has awarded you a bowl of SHIT FLAVORED PUDDING. 'This indicates that you have irritated him in some way. Congragulations. THE has awarded you a bowl of SHIT FLAVORED PUDDING. 'This indicates that you have irritated him in some way. Congragulations. THE has awarded you a bowl of SHIT FLAVORED PUDDING. 'This indicates that you have irritated him in some way. Congragulations. Have a nice day.-- Phlegm Leoispotter * (garble! jank!) 23:30, 5 June 2007 (UTC) - Thanks for the red links. The "Pudding" template only works for ME! BWAHAHAHAHAHA! --THE 23:31, 5 June 2007 (UTC) - All part of my evil plan. Be afraid-- Phlegm Leoispotter * (garble! jank!) 23:43, 5 June 2007 (UTC) Help! I need somebody! Help! Not just anybody! See if you can help me out with this mess-- Phlegm Leoispotter * (garble! jank!) 21:45, 6 June 2007 (UTC) - I was doing that as you were writing the message. I'll add some more to it after I finish respondin' here. --THE 21:46, 6 June 2007 (UTC) Take a look at this one-- Phlegm Leoispotter * (garble! jank!) 20:33, 8 June 2007 (UTC) - I taked a look, and editted it a little. um....oh yeah just for future reference, when you make a news article leave in the "sources" section that automatically comes with it. If there is a real news story the article is based on, link to it. If not, put in {{Original}} and the "original research" thingy will be put in there for ya. That's the only formatting problem I noticed --THE 22:08, 8 June 2007 (UTC) Celebrity Manufacture A while ago you mentioned that you liked this article, well now it's on vfh. Your vote would be greatly appreciated. --Winstanley1 12:56, 7 June 2007 (UTC) Paul Bunyan You wrote that? Absolutely brilliant, sir. You deserve this: Sir Ljlego, GUN VFH FIYC WotM SG WHotM PWotM AotM EGAEDM ANotM + (Talk) 14:31, 9 June 2007 (UTC) Hmm, was there a reason why the woman mentioned in that article was named Christine???-- Phlegm Leoispotter * (garble! jank!) 00:38, 10 June 2007 (UTC) The capital of Idaho is Boise Dear THIS, I am proud to announce that I have found out the true meaning of cabbage. However, I took quite a beating in my perilous task. I haven't eaten the floppy disk since 200 and yes. Sincerely, --Fonchezzz 15:30, 9 June 2007 (UTC) Thank you - I do not know what these bisexual beats are. I wish you could tell me so I wouldn't be in the dark ::like all the other ones. - THE: He is impostor. Only I am me could possibly be. Fairly ironic, surprising to myself but still the answer remains a solid yes. Does catnip ring the proof bell? Most certainly does. Please take my test in user page. --Polystyrene Man 16:23, 9 June 2007 (UTC) OK let me sort this mess out. Fonchezzz is an avantgarde musician who goes by the name "Jack Sullivan". You've heard his album before.-- Phlegm Leoispotter * (garble! jank!) 21:06, 9 June 2007 (UTC) - See as I see. I as I I. What would you like to find out? From this type of guy. I am not the type of person who will sit around all day and look at how the parade goes and dies. How much would you like if I gave you $10? How bout that? --Fonchezzz 21:45, 9 June 2007 (UTC) UPDATE:It finally happened. Fonchezzz left a nonsensical message on Famine's talk page. May God have mercy on Fonchezzz's soul.-- Phlegm Leoispotter * (garble! jank!) 19:33, 13 June 2007 (UTC) - Oh, what the hell did he do that for? If he gets banned he'll lose his nomination! God dammit! --THE 19:36, 13 June 2007 (UTC) Thanks Sir Ljlego, GUN VFH FIYC WotM SG WHotM PWotM AotM EGAEDM ANotM + (Talk) 20:26, 12 June 2007 (UTC) that ISNT AS MANY AS LAST TIME....sIlLy--Fonchezzz 19:53, 13 June 2007 (UTC) PS:As I said, I don't want you being the dough that you desire! - Yaaaaaaaaa! another award for my awards page! thanks fonchezzzzzzzzzzzz! glad to see you...uh...alive! --THE 19:55, 13 June 2007 (UTC) - He ain't alive anymore. He got banned by Spang :(-- Phlegm Leoispotter * (garble! jank!) 21:56, 13 June 2007 (UTC)
http://uncyclopedia.wikia.com/wiki/User_talk:THE/arkive_one
CC-MAIN-2014-41
refinedweb
9,987
81.63
- Read and Display File's Content In this article, you will learn and get code to read and display file's content using a C++ program. But before going through program, let's first create a text file, codescracker.txt Things to Do Before Program Since the program given below read and displays the content of a file entered by user. Therefore, we must have to create a file named codescracker.txt with following content: Hello C++ I'm a File My Name is codescracker.txt Save the file with this content, inside the current directory. The current directory means, the directory where your C++ source code to read and display file's content is saved. Here is the snapshot of opened codescracker.txt file: And here is the folder, cpp programs where the file is saved. In this folder, I'll also save the C++ source code given below to read and display file's content: Now let's move on and create a C++ program to read the content of file, codescracker.txt Read and Display File's Content in C++ To read and display file's content in C++ programming, you have to ask from user to enter the name of file along with its extension say codescracker.txt. Now open the file using open() function. And then read its content in character-by-character manner. Display the content (character by character) at the time of reading as shown here in the following program: The question is, write a program in C++ to read and display the content of a file entered by user at run-time. Here is its answer: #include<iostream> #include<fstream> #include<stdio.h> using namespace std; int main() { char fileName[30], ch; fstream fp; cout<<"Enter the Name of File: "; gets(fileName); fp.open(fileName, fstream::in); if(!fp) { cout<<"\nError Occurred!"; return 0; } cout<<"\nContent of "<<fileName<<":-\n"; while(fp>>noskipws>>ch) cout<<ch; fp.close(); cout<<endl; return 0; } This program was build and run under Code::Blocks IDE. Before executing the code, be sure to save this C++ source code in the same folder where you've created or saved your codescracker.txt file. Here is the initial output produced by this program: Now supply the name of newly created file, codescracker.txt and press ENTER to read its content and display it as shown in the snapshot given below: The fstream type variable allows to work with files in C++. It is defined in fstream header file. The function used in above program, that is open() receives one/two argument(s). The first argument is compulsory, that is the name of file to open. Whereas the second of its argument is optional, that indicates to its opening mode. The fstream::in file opening mode is used to open the file to read its content only. And the following statement: fp>>noskipws>>ch reads data from file in character-by-character manner, without skipping any white spaces. You can also use the following block of code to read and display file's content: while(!fp.eof()) { fp.get(ch); cout<<ch; } instead of: while(fp>>noskipws>>ch) cout<<ch; But still if you want the complete program, then here it is, with only two extra changes. That is the condition of both if and while loop: #include<iostream> #include<fstream> #include<stdio.h> using namespace std; int main() { char fileName[30], ch; fstream fp; cout<<"Enter the Name of File: "; gets(fileName); fp.open(fileName, fstream::in); if(fp==NULL) { cout<<"\nError Occurred!"; return 0; } cout<<"\nContent of "<<fileName<<":-\n"; while(fp.eof()==0) { fp.get(ch); cout<<ch; } fp.close(); cout<<endl; return 0; } This program does the same job as of previous program. That is, asks from user to enter the name of any text file to read and display its content on the screen. Same Program in Other Languages « Previous Program Next Program »
https://codescracker.com/cpp/program/cpp-program-read-and-display-file.htm
CC-MAIN-2022-21
refinedweb
657
65.01
Yehuda Katz - Registered on: 07/18/2009 - Last connection: 10/26/2015 Issues - Assigned issues: 0 - Reported issues: 12 Activity 10/26/2015 - 12:25 PM Ruby trunk Feature #11537: Introduce "Safe navigation operator" - Yukihiro Matsumoto wrote: > I like the idea. My remaining concern is ".?" is too similar to "?." which is chosen by ... 08/21/2015 - 03:28 PM Ruby trunk Feature #11473: Immutable String literal in Ruby 3 - I would like to suggest a phased transition across several releases in Ruby 2.x (the specific version numbers and fla... 11/24/2014 - 08:11 PM Ruby trunk Bug #10540 (Open): Yielded fibers do not execute ensure blocks - When a thread has paused fibers, if an exception occurs anywhere in the thread, `ensure` blocks in the paused fibers ... 11/05/2013 - 07:51 AM Ruby trunk Bug #9080 (Closed): ENV[key] produces three objects - This code: ENV["HOME"] allocates three T_STRING according to ObjectSpace.count_objects. Unless I'm missing so... - 07:49 AM Ruby trunk Bug #9079 (Feedback): Interpolated Symbol creates unnecessary intermediate String on the heap - This case: x = "world" y = :"hello#{world}!" allocates one T_STRING according to ObjectSpace.count_objects... 01/07/2013 - 07:29 AM Ruby trunk Bug #7664 (Rejected): Keyword arguments with `**` make code targeting 1.9 / 2.0 difficult - You could imagine writing code that calls into a user-supplied hook: log("App booted", level: :info) It is po... - 07:11 AM Ruby trunk Bug #7663 (Rejected): Unable to invoke a method with `**kwargs` if the receiver doesn't define ke... - This works: def hello puts "hello" end hello(*[]) This does not: def hello puts "hello... - 07:06 AM Ruby trunk Bug #7662 (Closed): Unable to define a method with bare `**` - This works: def foo(*) end This does not: def foo(**) end This does not: def foo(*, **) ... 10/16/2012 - 10:29 PM Ruby trunk Bug #7172: [[Ruby 1.9:]] fix rbconfig for --enable-load-relative (v2) - Thanks mpapis for moving the ball forward on this. I rely on --enable-load-relative for Tokaido, and getting/keepi... - 10:29 PM Ruby trunk Bug #7158: require is slow in its bookkeeping; can make Rails startup 2.2x faster - Yehuda Katz (ph) 718.877.1325 On Tue, Oct 16, 2012 at 12:21 AM, gregprice (Greg Price) <price@mit.edu>wrot...
https://bugs.ruby-lang.org/users/738
CC-MAIN-2016-26
refinedweb
383
64.61
On Sun, Feb 16, 2003 at 09:06:27PM -0500, Steven Cummings wrote: > Hello! > > I've got a couple of ideas for the Python language that I wanted to run by > this list before I wrote up a couple of pre-PEP's. The guidelines say > that I should generate discussion here or they will be rejected outright, > so here goes nothing. > > > 1. Separate Definition (or Dynamic Addition) of Methods > > As we all know and love Python it provides many facilities for run-time > checking and typing, and for many things to be defined on the fly. For > example, given an object "o", its class can be dynamically changed by > making the statement "o.__class__ = C" where C is a class other than that > originally used to initialize "o". > > My specific idea is to allow the definition of methods outside of the > class's main definition. This would allow a class to be dynamically > constructed based on conditional constructs. Suppose the initial > definition of a class were the following. > > class A(object): > "my simple example class" > def __init__(self, value=None): > "create an instance of A" > self._value = value > > Now suppose that we could add methods like the following. > > def A.print(self): > "print a string representation to sys.stdout" > print self._value > > This syntax could allow for the "self" argument to be omitted in cases > where the coder would like the method to be specified as a static- or > class-method later on. Otherwise, that's the basic gist of this idea. I > thought it could make python a little more dynamic to be able to add > methods like this on the fly. I don't have a lot of details here as you > see, so perhaps someone on this mailing list can identify potential > problems or issues. I would also like to identify potential practical uses > as right now it's only an idea for making Python more dynamic in my mind. > A form of this is available with no modifications to Python. See for an example of how. > > 2. Alternative String Interpolation Syntax > > [snip - string interpolation proposal] > > Now on to the expressions. I think it would be reasonable to allow simple > expressions inside of the parentheses as well. So for numbers, a coder > could write "%(x + y)d" or "%(x + y)f" and get the numeric results > inserted into the result appropriately given the type. Unfortunately, "x + y" is a perfectly valid dictionary key. print "%(x + y)d" % {'x + y': 10} What about %(expr)E as an entirely -new- format specifier ("E" standing for "Expression", of course)? The contents of the () could be evaluated using the provided dictionary as the local namespace, the result str() or repr()'d, and dropped in place. I haven't followed previous debates on this topic though, so maybe it's been proposed and shot down. ;) Jp -- There are 10 kinds of people: those who understand binary and those who do not. -- up 8 days, 6:28, 3 users, load average: 0.05, 0.04, 0.00 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 196 bytes Desc: not available URL: <>
https://mail.python.org/pipermail/python-list/2003-February/176557.html
CC-MAIN-2014-15
refinedweb
527
63.8
05 August 2011 15:23 [Source: ICIS news] HOUSTON (ICIS)--Rentech Nitrogen Partners has filed a registration statement with US regulators for an initial public offering, it said on Friday. Rentech Nitrogen, which is a wholly-owned subsidiary of energy technology firm Rentech, said its stock would be listed under the ticker symbol “RNF” on the New York Stock Exchange. It did not disclose how much money it expects to raise or how many shares it will be offering. On completion of the offering, Rentech Nitrogen will own and operate a nitrogen fertilizer plant in a corn region in ?xml:namespace> The plant produces primarily anhydrous ammonia and urea ammonium nitrate (UAN) solution, using natural gas as its primary feedstock. In its statement with the US Securities and Exchange Commission, Rentech said the plant produced 267,000 tonnes of ammonia and 287,000 tonnes of UAN in the fiscal year ended 30 September 2010. Rentech had bought the plant from Canada-based agribusiness firm Agrium in 2006. In the six months ended 31 March 2011, Rentech Nitrogen had sales of $67m (€48m) and net income of $7.5m, according to the statement. (
http://www.icis.com/Articles/2011/08/05/9483090/us-rentech-nitrogen-files-for-initial-public-offering.html
CC-MAIN-2014-52
refinedweb
192
59.23
ConcurrentHashMap: Call Only One Method Per Key ConcurrentHashMap: Call Only One Method Per Key Using the ConcurrentHashMap in a thread-safe way is easy. Join the DZone community and get the full member experience.Join For Free Each method of ConcurrentHashMap is thread-safe. But calling multiple methods from ConcurrentHashMap for the same key leads to race conditions. And calling the same method from ConcurrentHashMap recursively for different keys leads to deadlocks. Let us look at an example to see why this happens: Calling Multiple Methods In the following test, I use two methods from ConcurrentHashMap for the same key 1. The method update, line 3 till 10, first gets the value from the ConcurrentHashMap using the method get. Than update increments the value and put it back using the method put , line 6 and 8: import com.vmlens.api.AllInterleavings; public class TestUpdateWrong { public void update(ConcurrentHashMap<Integer, Integer> map) { Integer result = map.get(1); if (result == null) { map.put(1, 1); } else { map.put(1, result + 1); } }()); } } } } To test what happens I use two threads, created in line 18 and 21. I start those two threads, in line 25 and 25. And then wait till both are ended using thread join,in line 26 and 27. After both threads are stopped I check if the value is indeed two,line 28. To test all thread interleavings we put the complete test in a while loop iterating over all thread interleavings using the class AllInterleavings from vmlens, line 15. Running the test I see the following error: java.lang.AssertionError: expected:<2> but was:<1> To see why the result is one, not two as expected we can look at the report vmlens generated: So. the problem is that first both threads call get, and after that, both threads call put. So, both threads see an empty value and update the value to one. This leads to a result of one and not, as expected, two. The trick to solving this race condition is to use only one method instead of two methods to update the value. Using the method compute, we can do this. So, the correct version looks like this: public void update() { map.compute(1, (key, value) -> { if (value == null) { return 1; } else { return value + 1; } }); } Calling the Same Method Recursively Now, let us look at an example for calling the same method from ConcurrentHashMap recursively: public class TestUpdateRecursive { private final ConcurrentHashMap<Integer, Integer> map = new ConcurrentHashMap<Integer, Integer>(); public TestUpdateRecursive() { map.put(1, 1); map.put(2, 2); } public void update12() { map.compute(1, (key,value) -> { map.compute(2, ( k , v ) -> { return 2; } ); return 2; }); } public void update21() { map.compute(2, (key,value) -> { map.compute(1, ( k , v ) -> { return 2; } ); return 2; }); } @Test public void testUpdate() throws InterruptedException { ExecutorService executor = Executors.newFixedThreadPool(2); executor.execute( () -> { update12(); } ); executor.execute( () -> { update21(); } ); executor.shutdown(); executor.awaitTermination(10, TimeUnit.MINUTES); } } Here, we call the compute method inside of the compute method for different keys. Once for the key, one then two, and once for the key, two then one. If we run the test, we see the following deadlock: To understand why this deadlock happens, we have to look at the internals of the ConcurrentHashMap. ConcurrentHashMap uses an array to store the mapping between the keys and the values. Every time we update such a mapping of the ConcurrentHashMap, it locks the array element in which the mapping is stored. So in our test, the call to compute for the key one locked the array element for the key one. And then, we try to lock the array element for the key two. But this key is already locked by the other thread who called compute for key two and tries to lock the array element for the key one. A deadlock. Note that only updates need a lock to an array element. Methods that are read-only, like, for example, get, do not use locks. So, it is no problem to use a get method inside a compute call. Conclusion Using the ConcurrentHashMap in a thread-safe way is easy. Select one method that best fits your needs — and use it exactly once per key Opinions expressed by DZone contributors are their own. {{ parent.title || parent.header.title}} {{ parent.tldr }} {{ parent.linkDescription }}{{ parent.urlSource.name }}
https://dzone.com/articles/concurrenthashmap-call-only-one-method-per-key?fromrel=true
CC-MAIN-2020-40
refinedweb
717
65.32
Gestures¶ The really interesting side-effect of having an accelerometer is gesture detection. If you move your BBC micro:bit in a obvious, the 3g, 6g and 8g gestures apply when the device encounters these levels of g-force (like when an astronaut is launched into space). To get the current gesture use the accelerometer.current_gesture method. Its result is going to be one of the named gestures listed above. For example, this program will only make your device happy if it is face up: from microbit import * while True: gesture = accelerometer.current_gesture() if gesture == "face up": display.show(Image.HAPPY) else: display.show(Image.ANGRY) Once again, because we want the device to react to changing circumstances we use a while loop. Within the scope of the loop the current gesture is read and put into gesture. The if conditional checks if gesture is equal to "face up" (Python uses == to test for equality, a single equals sign = is used for assignment - just like how we assign the gesture reading to the gesture object). If the gesture is equal to "face up" then use the display to show a happy face. Otherwise, the device is made to look angry! Magic-8¶ A Magic-8 ball is a toy first invented in the 1950s. The idea is to ask it a yes/no question, shake it and wait for it to reveal the truth. It’s rather easy to turn into a program: clears the screen, waits for a second (so the device appears to be thinking about your question) and displays a randomly chosen answer. Why not ask it if this is the greatest program ever written? What could you do to “cheat” and make the answer always positive or negative? (Hint: use the buttons.)
https://microbit-micropython-hu.readthedocs.io/hu/latest/tutorials/gestures.html
CC-MAIN-2019-30
refinedweb
296
64.1
Welcome. The reason I'm going with it is because it has great support for writing posts with iPython notebooks. So it's easy to embed, code, LaTeX, and pretty much anything in the daily workflow of a data scientist/software engineer. Here's an example of some code: def fibonacci(n): if n == 0 or n == 1: return 1 else: return fibonacci(n-1) + fibonacci(n-2) fibonacci(10) 89 Example of some LateX: %%latex $$c = \sqrt{a^2 + b^2}$$ I am really inspired by the DataQuest community so I want to contribute to it and share some of the stuff that I've been working on. Here are some of my favorite posts that I hope to emulate:
https://sorlovsky.github.io/welcome.html
CC-MAIN-2018-13
refinedweb
121
52.73
XamlTypeName Class .NET Framework (current version) Namespace: System.Xaml.Schema Provides a means to specify a XAML type in terms of name and namespace. Assembly: System.Xaml (in System.Xaml.dll) System.Object System.Xaml.Schema.XamlTypeName System.Xaml.Schema.XamlTypeName XamlType is the type information class in the XAML type system, whereas XamlTypeName is more of a data structure that provides different ways of specifying that type. XamlTypeName also provides static helper methods for generating a XamlTypeName by resolving an existing type identifier in a XAML namespace. .NET Framework Available since 4.0 Available since 4.0 Return to top Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe. Show:
https://msdn.microsoft.com/en-us/library/ee474945.aspx
CC-MAIN-2018-17
refinedweb
126
50.43
This C Program calculates the number of integers divisible by 5. This program checks if the given number is divisible by 5 and then prints an appropriate message. Here is source code of the C program to calculate the number of integers divisible by 5. The C program is successfully compiled and run on a Linux system. The program output is also shown below. /* * C program to find the number of integers divisible by * 5 between the given range num1 and num2, where num1 < num2. * * Also find the sum of all these integer numbers which are divisible * by 5 and display the total. */ #include <stdio.h> void main() { int i, num1, num2, count = 0, sum = 0; printf("Enter the value of num1 and num2 \n"); scanf("%d %d", &num1, &num2); /* Count the number and compute their sum*/ printf("Integers divisible by 5 are \n"); for (i = num1; i < num2; i++) { if (i % 5 == 0) { printf("%3d,", i); count++; sum = sum + i; } } printf("\n Number of integers divisible by 5 between %d and %d = %d\n", num1, num2, count); printf("Sum of all integers that are divisible by 5 = %d\n", sum); } advertisements $ cc pgm18.c $ a.out Enter the value of num1 and num2 12 17 Integers divisible by 5 are 15, Number of integers divisible by 5 between 12 and 17 = 1 Sum of all integers that are divisible by 5 = 15.
http://www.sanfoundry.com/c-program-number-divisible-by-5/
CC-MAIN-2016-44
refinedweb
233
54.86
A simple way to approach this problem would be to consider all ranges of the input array and determine the largest number that can be produced in that range. However, most ranges aren't actually interesting as they could never be combined into one. To see this it helps to look at the equivalent problem where each of the array elements are powers of two and instead of combining x and x to produce x + 1 you produced 2x. Now it's clear that a range must sum to a power of two to be interesting. In fact, an interesting range can be better described by its starting position and the power of two it sums to. This informs a simple Dynamic Programming solution. We let DP[p][i] give the ending index of the range starting at i that can combine to p, or -1 if it doesn't exist. DP[p + 1][i] is then calculated as DP[p + 1][i] = DP[p][DP[p][i]] provided DP[p][i] is valid. Here's my solution to this problem. #include <iostream> #include <cstdio> #include <vector> using namespace std; #define MAXN ((1 << 18) + 10) #define MAXSZ 70 int dp[MAXSZ + 1][MAXN]; int A[MAXN]; int main() { int N; cin >> N; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } int result = 0; for (int i = 0; i <= MAXSZ; i++) { for (int j = 0; j < N; j++) { if (A[j] == i) { dp[i][j] = j + 1; result = max(result, i); } else { if (i == 0 || dp[i - 1][j] == -1 || dp[i - 1][dp[i - 1][j]] == -1) { dp[i][j] = -1; } else { dp[i][j] = dp[i - 1][dp[i - 1][j]]; result = max(result, i); } } } dp[i][N] = -1; } cout << result << endl; return 0; } Further analysis contributed by Kyle Liu: There is an alternative $O(N)$ greedy approach. An $O(N \log N)$ greedy solution is obvious. We can remove the lowest value ($M$) by greedily combining $K$ consecutive pairs of $M$ into $K/2$ pairs of ($M+1$). In case that $K$ is odd, we can simply break the sequence into two and assign the $K/2$ pairs of $M+1$ to both sequences. Repeating this process will give us an $O(N \log N)$ solution, using appropriate data structures. $O(N)$ can be achieved since we don't have to always find lowest value to remove. Consider the sequence of numbers as heights of hills. We can simply find the "valley points" (point whose heights are below its neighbours') to remove. We first condense the sequence into consecutive intervals of same heights. We use a stack to keep track of the sequence and "valley point". As we go through the list of intervals, if the stack is empty or the incoming height is below the height in the top of stack (downhill), we simply push the incoming interval to the stack. If the incoming height is above the height in the top of stack (uphill), the point at the top of the stack is a "valley point", and it needs to be removed by combining into its neighbouring intervals. Its left neighbours are in the stack and its right neighbour is the incoming interval. If any combination needs to break into two sequences. We can calculate the optimal value of the first sequence by "collapsing" the stack. We then start the second sequence with only the "valley point" in the stack. Here is my code implementing this approach: #include <stdio.h> #include <iostream> #include <math.h> using namespace std; #define MAXN 262144+10 struct Node { int val; int tot; }; Node ar[MAXN]; Node s[MAXN]; int N, top = 0, res = 0; void collapse_stack(void) // calculate value for first squence and reset stack { for (; top > 1; top--) s[top-2].tot += s[top-1].tot / (1 << (s[top-2].val - s[top-1].val)); res = max(res, s[top-1].val + (int)log2(s[top-1].tot)); top--; } void combine_left(int val) // combine the left side until height reaches val { for (; top > 1; top--) { if(s[top-2].val > val) break; int num = 1 << (s[top-2].val - s[top-1].val); if (s[top-1].tot % num) { Node tmp = s[top-1]; collapse_stack(); s[top++] = tmp; // start second sequence with the "valley point" break; } s[top-2].tot += s[top-1].tot / num; } } int main(void) { freopen("262144.in","r",stdin); freopen("262144.out","w",stdout); cin >> N; int st = 0; for(int i=1; i<=N; i++) { int a; cin >> a; res = max(res, a); if(a == ar[st].val) ar[st].tot++; else { ar[++st].val = a; ar[st].tot++; } } for(int i=1; i<=st; i++) { if (top == 0 || (ar[i].val < s[top-1].val)) { // downhill, add to stack s[top++] = ar[i]; continue; } combine_left(ar[i].val); int num = 1 << (ar[i].val - s[top-1].val); if (s[top-1].tot % num == 0) { // combine new interval into stack s[top-1].val = ar[i].val; s[top-1].tot = ar[i].tot + s[top-1].tot / num; } else { // new intervals cannot be merged to intervals already in stack ar[i].tot += s[top-1].tot / num; collapse_stack(); s[top++] = ar[i]; } } collapse_stack(); // obtain answer for remaining intervals in stack cout << res << endl; return 0; }
http://usaco.org/current/data/sol_262144_platinum_open16.html
CC-MAIN-2018-17
refinedweb
889
72.05
Not a zip file specifically - just a binary stream which organises scripts to be installed. If each class in a hierarchy has access to a binary stream, then subclasses have access to the streams for base classes as well as their own stream, and can install selectively from base class streams and their own stream. class Base: scripts = ... # zip stream containing scripts A, B def install_scripts(self, stream): # ... def setup_scripts(self): self.install_scripts(self.scripts) class Derived: scripts = ... # zip stream containing modified script B, new script C def setup_scripts(self): self.install_scripts(Base.scripts) # adds A, B self.install_scripts(self.scripts) # adds C, overwrites B. Regards, Martin
https://mail.python.org/archives/list/python-dev@python.org/message/Q6VH6SAPCTFYQDYZOWX5WYP2PKA5AL2E/
CC-MAIN-2021-21
refinedweb
107
60.72
Playify Playify is a Flutter plugin for play/pause/seek songs, fetching music metadata, and browsing music library. Playify was built using iOS's Media Player Framework to fetch and play music from iOS's Music Library. Currently supports only iOS. Requirements: - iOS: >= iOS 10.1 (Due to MPMusicPlayerMediaItemQueueDescriptor) Usage import 'package:playify/playify.dart'; //Create an instance Playify myplayer = Playify(); //Play from the latest queue. Future<void> play() async { await myplayer.play(); } //Fetch all songs from iOS's Apple Music. Future<List<Artist>> getAllSongs() async { var artists = await myplayer.getAllSongs(sort: true); return artists; } //Fetch song information about the currently playing song in the queue. Future<SongInfo> nowPlaying() async { var songinfo = await myplayer.nowPlaying(); return songinfo; } //Set the queue using songIDs for iOS. Future<void> setQueue(List<String> songs, int index) async { await myplayer.setQueue(songIDs: songs, startIndex: index); } //Skip to the next song in the queue. Future<void> next() async { await myplayer.next(); } //Skip to the previous song in the queue. Future<void> previous() async { await myplayer.previous(); } //Set the playback time of the song. Future<void> setPlaybackTime(double time) async { await myplayer.setPlaybackTime(time); } //Set the shuffle mode. Future<void> setShuffleMode(Shuffle mode) async { await myplayer.setShuffleMode(mode); } iOS For iOS, Playify uses iOS's Media Player framework. This makes Playify available only on iOS >= 10.1. Make sure to specify the minimum version of the supported iOS version in your app from XCode. Getting All Songs: For geting all songs from the Apple Music library of the iPhone, you can specify whether to sort the artists. The songs are sorted by their track number, and the albums are sorted alphabetically. The cover art of each album is fetched individually, and you can specify the size of the cover art. The larger the cover art, the more amount of RAM it consumes and longer it takes to fetch. The default value takes about 1-2 seconds with 800+ songs. Android - For Android, I plan to use a popular audio playing library such as audioplayers. Feel free to suggest better implementation plans by creating an issue or by contributing. Screenshots
https://pub.dev/documentation/playify/latest/
CC-MAIN-2020-45
refinedweb
352
52.66
DFS namespace folders are deleted after you restart a Windows Server 2008 R2-based computer Issue 1 Symptoms Consider the following scenario: - You install the Distributed File System (DFS) Namespace service on a computer that is running Windows Server 2008 R2. - The reparse points that are configured within the default namespace setting represent the corresponding DFS namespace folders on the server. - You restart the server. During the startup process, the system time of the server is changed. For example, when you restart a virtual machine, the system time of the virtual machine is synchronized with the host computer during the startup process. Note After the system time is changed, an event that contains the system time before and after the change is logged in the System log. Issue 2 Users cannot access their DFS shares because of DFS links disappearing from root servers within every 30 minutes. Note DFS Links and their associated reparse point might disappear at any time during the runtime of the server. This issue occurs because the system time is changed in the middle of the DFS time calculation operation for folder scavenging during the DFS Namespace service initialization process. When the DFS Namespace service starts, it creates reparse points for all the links in the namespace. The service also deletes any reparse points that are in a DFS root share path and do not belong to the namespace. During the service startup and the hourly synchronization, every link of the reparse points is stamped in order to change the time stamps of the reparse points. These time stamps are compared with the startup time of the DFS Namespace service. If the time stamp of a reparse point is earlier than the service startup time, the reparse point is considered an orphan, and is therefore deleted by the service. Cause When the system time changes before the reparse points are validated, then the changed time of the DFS namespace folders may be earlier than the service startup time. Therefore, the issue that is described in the "Symptoms" section occurs. Note After you apply this hotfix, the scavenging algorithm for reparse points no longer relies on time stamps for validation. DFS Namespace service To work around this issue, restart the DFS Namespace service on the computer. Workaround Properties Article ID: 2761922 - Last Review: 11/12/2014 18:58:00 - Revision: 4.12761922
https://support.microsoft.com/en-us/kb/2761922
CC-MAIN-2016-50
refinedweb
395
59.13
howlingmadpandaMembers Content Count1 Joined Last visited About howlingmadpanda - RankNewbie Issues interfacing 16x2 LCD with PIC18F4550 howlingmadpanda posted a topic in Electronics chit chatFor some time I have been working with some more basic electronics projects and have been familiar with electronic theory and the physics behind it. I have now begun working on a geiger counter project, which has gone well for the most part. All of my actual electronics (creating GM tube voltage, detection or ionising radiation) have worked fine. I have only recently, however, begun to work with interfacing an LCD with a PIC18F4550. My intended use of this is to display CPM digitally -- x number of counts in a certain amount of time, display to LCD. I am familiar with PIC Timers, so I didn't think there would be an issue with that code. My issue here is that I attempted to write a "hello world" program on my 16x2 LCD, of course partially skidding the code from online as I had never used an LCD with a PIC before. I know that my PIC is hooked up to the LCD correctly and I am getting current on the pins, implying that a signal is being sent. Could anybody help? Code: <code> #if defined(__XC) #include <xc.h> #elif defined(HI_TECH_C) #include <htc.h> #endif #include <stdint.h> / #include <stdbool.h> #include <xc.h> #include "system.h" #include "user.h" #include <htc.h> #define _XTAL_FREQ 1000000 #define rs RA0 #define rw RA1 #define en RA2 //LCD Data pins #define lcdport PORTB void lcd_init(); void lcdcmd(unsigned char); void lcddata(unsigned char); unsigned char data[20]="hello world"; unsigned int i = 0; void main(void) { TRISA=0; // Configure Port A as output port //PORTA=0; TRISB=0; // Configure Port B as output port //PORTB=0; lcd_init(); // LCD initialization while(data != '\0') { lcddata; } </code>
https://www.electronics-lab.com/community/index.php?/profile/76793-howlingmadpanda/
CC-MAIN-2020-24
refinedweb
306
64.71
Binary Trees in C++ programming Binary tree data structures Binary trees differ from linked lists in that where a node in a linked list may have at most one successor, a node in a binary tree can have up to two successors. A binary tree is a collection of nodes in which each node is associated with up to two successor nodes, respectively called the left and right child. Not every node in the binary tree will have two children: one or both nodes may be omitted. A node in a binary tree that has no children is called a leaf node. A node that has children is said to be the parent of its children. For a nonempty collection of nodes to qualify as a binary tree, every node must have at most one parent, and there must be exactly one node with no parent. The one node that has no parent is called the root of the binary tree. An empty collection of nodes is regarded as constituting an empty binary tree. Implementation of binary trees Binary trees are used to store values in their nodes. A node in a binary tree will therefore be a structure or class object that contains a member for storing the value, as well as two members that point to nodes that are the left and right children of that node: struct TreeNode { int value; TreeNode *left; TreeNode *right; }; A binary tree is itself represented by a pointer to the node that is the root of the tree. An example binary tree, with the values stored in the nodes not shown, is illustrated in below. The left or right pointer in a node is set to NULL if that node does not possess the corresponding child. An example of binary tree Binary search trees may be implemented as templates, but any data types used with them must support the <, >, and == operators. The actual implementation of a binary tree template has been left as a examples to demonstrates for you. If you use the tree to store class objects, these operators must be overridden. The following program uses a generalization of binary trees to build genealogy trees. #include <iostream> #include <vector> #include <string> using namespace std; enum Gender{male, female}; class Person { string name; Gender gender; vector<Person *> parents; vector<Person *> children; void addParent(Person *p){ parents.push_back(p); } public: Person (string name, Gender g) { this->name = name; gender = g; } Person *addChild(string name, Gender g); Person *addChild(Person *p); friend ostream &operator << (ostream &out, Person p); // Member functions for getting various Person info string getName(){ return name; }; Gender getGender(){ return gender; }; int getNumChildren(){ return children.size(); } int getNumParents(){ return parents.size(); } Person *getChild(int k); Person *getParent(int k); }; Person *Person::addChild(string name, Gender g) { Person *child = new Person(name, g); child->addParent(this); // I am a parent of this child children.push_back(child); // This is one of my children return child; } Person *Person::addChild(Person* child){ child->addParent(this); // I am a parent of this child children.push_back(child); // This is one of my children return child; } Person *Person::getParent(int k){ if (k < 0 || k >= parents.size()) { cout << "Error indexing parents vector." << endl; exit(1); } return parents[k]; } Person *Person::getChild(int k) { if (k < 0 || k >= children.size()) { cout << "Error indexing children's vector." << endl; exit(1); } return children[k]; } ostream & operator<<(ostream & out, Person p) { out << "<person name = " << p.name << ">" << '\n'; if (p.parents.size() > 0) out << " <parents>" << ' '; for (int k = 0; k < p.parents.size(); k++) { out << " " << p.parents[k]->name << ' '; } if (p.parents.size() > 0) out << " </parents>" << "\n"; if (p.children.size() > 0) out << " <children>" << ' '; for (int k = 0; k < p.children.size(); k++) { out << " " << p.children[k]->name << ' '; } if (p.children.size() > 0) out << " </children>" << "\n"; out << "</person>" << "\n"; return out; } int main(int argc, char** argv) { // Here are the people Person adam("Adam", male); Person eve("Eve", female); Person joan("Joan", female); // Adam and Eve are parents of Abel Person *pAbel = eve.addChild(new Person("Abel", male)); adam.addChild(pAbel); // Abel and Joan are parents of Missy Person *pMissy = joan.addChild("Missy", female); pAbel->addChild(pMissy); // Output all the people cout << "Here are all the people:\n\n"; cout << adam << eve"; cout << *pAbel << joan; cout << *pMissy << "\n"; // Print parents of Missy cout << "Missy's parents are: " << endl; for (unsigned int k = 0; k < pMissy->getNumParents(); k++) { Person * p = pMissy->getParent(k); switch(p->getGender()) { case female : cout << "\tMother: "; break; case male: cout << "\tFather: "; break; } cout << p->getName() << endl; } return 0; } Program Output : Here are all the people: <person name = Adam> <children> Abel </children></person> <person name = Eve> <children> Abel </children></person> <person name = Abel> <parents> Eve Adam </parents> <children> Missy </children></person> <person name = Joan> <children> Missy </children></person> <person name = Missy> <parents> Joan Abel </parents></person> Missy's parents are: Mother: Joan Father: Abel Ads Right
https://www.infocodify.com/cpp/binary-trees
CC-MAIN-2020-45
refinedweb
814
51.99
LMGC90 Sprint at Logilab At the end of March 2013, Logilab hosted a sprint on the LMGC90 simulation code in Paris. LMGC90 is an open-source software developed at the LMGC ("Laboratoire de Mécanique et Génie Civil" -- "Mechanics and Civil Engineering Laboratory") of the CNRS, in Montpellier, France. LMGC90 is devoted to contact mechanics and is, thus, able to model large collections of deformable or undeformable physical objects of various shapes, with numerous interaction laws. LMGC90 also allows for multiphysics coupling.. The main drawback of this approach is the double modelling of data that this architecture implies: once in the core and once in Pre_LMGC. It was decided to build a unique user-level Python layer on top of ChiPy, that would be able to build the computational problem description and write the DATBOX input files (currently achieved by using Pre_LMGC), as well as to drive the simulation and read the OUTBOX result files (currently by using direct ChiPy calls). This task has been met with success, since, in the short time span available (half a day, basically), the team managed to build some object types using ChiPy calls and save them into a DATBOX.. There is still a lot of work to be done (notably regarding the charges applied to the bodies), but this is already a great achievement. This could only have occured in a sprint, were every needed expertise is available: the SNCF experts were there to clarify the import needs and check the overall direction; Logilab implemented a data model based on CubicWeb, and imported the data using the ChiPy bindings developed on-demand by the LMGC core developer team, using the usual-for-them ISO_C_BINDING/ Swig Fortran wrapping dance. Logilab undertook the data import; to this end, it asked the LMGC how the relevant information from LMGC90 can be exposed to Python via the ChiPy API. Using HDF5 as a data storage backend for LMGC90 The main point of this topic was to replace the in-house DATBOX/OUTBOX textual format used by LMGC90 to store input and output data, with an open, standard and efficient format. Several formats have been considered, like HDF5, MED and NetCDF4. MED has been ruled out for the moment, because it lacks the support for storing body contact information. HDF5 was chosen at last because of the quality of its Python libraries, h5py and pytables, and the ease of use tools like h5fs provide. Alain Leufroy from Logilab quickly presented h5py and h5fs usage, and the team started its work, measuring the performance impact of the storage pattern of LMGC90 data. This was quickly achieved, as the LMGC experts made it easy to setup tests of various sizes, and as the Logilab developers managed to understand the concepts and implement the required code in a fast and agile way.. Logilab kept working on this after the sprint and produced packages that are currently being tested by the LMGC team. Some changes are expected (for instance, Python modules should be prefixed with a proper namespace) before the packages can be submitted for inclusion into Debian. The expertise of Logilab regarding Debian packaging was of great help for this task. This will hopefully help to spread the use of LMGC90. Distributed Version Control System for LMGC90 As you may know, Logilab is really fond of Mercurial as a DVCS. Our company invested a lot into the development of the great evolve extension, which makes Mercurial a very powerful tool to efficiently manage the team development of software in a clean fashion. This is why Logilab presented Mercurial's features and advantages over the current VCS used to manage LMGC90 sources, namely svn, to the other participants of the Sprint. This was appreciated and will hopefully benefit to LMGC90 ease of development and spread among the Open Source community..
https://www.logilab.org/view?rql=Any%20X%20WHERE%20T%20tags%20X%2C%20T%20eid%20126845%2C%20X%20is%20BlogEntry
CC-MAIN-2021-17
refinedweb
637
53.34
[POSIX] incorrect included header files in src/color-profile.cpp for open(2) Bug Description src/color- Duplicate of, or covered by Bug #740969 in Inkscape: “build problems on Oracle "Solaris 10" X86_64”? <https:/ See also: CompilingSunSolaris - Inkscape Wiki: <http:// It is not Solaris specific issue, look at open(2) manpage in Linux (e.g. ,http:// this is really just an oversight of the developer who mistakenly added the wrong declaration, which happened to work on his system (glibc). this really doesnt compile anywhere except on glibc. and it is completely trivial to fix since glibc also has the right header see the posix specs here: http:// affected distro: sabotage linux, using musl libc [1] [1] http:// btw, the proposed patch above is overkill it is sufficient to only change sys/fcntl.h to fcntl.h. there are no other missing symbols. i can tell this for sure since musl doesnt expose any superfluous symbols, unlike glibc which has the habit of including other headers (e.g. stdio.h there pulls in stdlib.h which is a namespace violation) > btw, the proposed patch above is overkill > it is sufficient to only change sys/fcntl.h to fcntl.h Change tested on Windows XP and Debian testing, Inkscape trunk revision 12007. The application compiles and runs with no problem on both systems. If it's ok on OS X, I guess it's safe to commit it. > If it's ok on OS X, I guess it's safe to commit it. Seems to compile and run ok on Mac OS X 10.5.8 (Xcode 3.1.4) and OS X 10.7 (Xcode 4.3.2) - I can't test on the most recent version OS X 10.8 (with Xcode 4.5.2) though. On 10.5 and 10.7, the main content of '/usr/include/ $ tail -2 /usr/include/ */ #include <sys/fcntl.h> Fix committed in the trunk, revision 12009. Milan and John, Thanks! Looks like an OS difference, and one that would warrant some autoconf and #ifdef conditioning.
https://bugs.launchpad.net/altlinux/+source/inkscape/+bug/910335
CC-MAIN-2019-39
refinedweb
342
76.93
Products and Services Downloads Store Support Education Partners About Oracle Technology Network see comments EVALUATION It is not clear to me if these symtab files should exist in the bin directory, if they should then please provide a specification. If it should not exist in the product build, then why does it exist in the product build ? EVALUATION The debug info on Windows in $JAVA_HOME/jre/bin is for libraries and not for programs. In my attempt to make everything architecturally the same, I misinterpreted what the leading architecture (Windows) had in the way of Full Debug Symbols... Yes, it's hard to use "leading architecture" and "Windows" in the same sentence, but it's true. Windows has had FDS since JDK1.4.1... I will use this bug (7160895) to back out the installation of Full Debug Symbols for programs. Yes, I did mean just installation. The Windows build does generate .map and .pdb files for programs, but it does not install them. I'll do the same for Linux and Solaris. SUGGESTED FIX Here is the context diff for the fix: $ hg diff make/common/Program.gmk diff -r d922195b678d make/common/Program.gmk --- a/make/common/Program.gmk Wed Apr 11 07:26:35 2012 -0700 +++ b/make/common/Program.gmk Thu Apr 12 13:38:36 2012 -0700 @@ -268,6 +268,11 @@ else $(ZIPEXE) -q $(@F).diz $(@F).debuginfo ; \ $(RM) $(@F).debuginfo ; \ ) + # save ZIP'ed debug info with rest of the program's build artifacts + $(MV) $@.diz $(OBJDIR) + else + # save debug info with rest of the program's build artifacts + $(MV) $@.debuginfo $(OBJDIR) endif endif # PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS endif # ENABLE_FULL_DEBUG_SYMBOLS EVALUATION Changeset: 70d82f2a6c11 Author: dcubed Date: 2012-04-12 16:23 -0700 URL: 7160895: tools/launcher/VersionCheck.java attempts to launch .debuginfo Summary: Do not install .debuginfo files in bin dir. Reviewed-by: ksrini, sspitsyn ! make/common/Program.gmk
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7160895
CC-MAIN-2013-20
refinedweb
311
59.6
BeatRoute Magazine [AB] print e-edition - [September 2017] BeatRoute Magazine is a monthly arts and entertainment paper with a predominant focus on music – local, independent or otherwise. The paper started in June 2004 and continues to provide a healthy dose of perversity while exercising rock ‘n’ roll ethics. BeatRoute Magazine is a monthly arts and entertainment paper with a predominant focus on music – local, independent or otherwise. The paper started in June 2004 and continues to provide a healthy dose of perversity while exercising rock ‘n’ roll ethics. Beakerhead • Comeback Kid • Yes • A Bomb • Nosaj Thing • Kacy & Clayton • Divinity • Chad VanGaalen feature The Poutine Supreme! ground beef, jalapeño cheddar cheese sauce, sour cream topped with tomatoes and green onions. ROLLING OUT ALL SEPTEMBER! To Book the Big Cheese Food Truck call: 403-354-CURD (2873) Featured Hot Dog: BEEF WRANGLER all beef wiener topped with onion rings, sour cream, bacon and shredded cheddar cheese Slurpees! Milkshakes! This Month’s Milkshake is.. Chocolate Banana Split Visit our Kensington location and enjoy 12 flavours of ice cream! 738B 17TH AVE. S.W. I 207 10TH ST. N.W. I FACEBOOK.COM/MYBIGCHEESE. I MYBIGCHEESE.COM FIXED Editor’s Note/Pulse 4 Bedroom Eyes 7 Vidiot 19 Edmonton Extra 30-31 Book Of Bridge 32 Letters From Winnipeg 33 This Month in Metal 47 FEATURES Calgary Film 15-17 CITY 8-13 Beakerhead, Skifflemania!, Fashion FILM 15-19 CIFF roundup, Return To Nuke Em High Volume 2, The Vidiot TABLE OF CONTENTS MUSIC rockpile 21-33 Comeback Kid, Yes, The New Pornographers, The Mad Caddies, The Voodoo Glow Skulls, A-Bomb, Mister & Mystic, 2/3 Of Nothing, Mammoth Grove, UP + DT Festival jucy 35-36 Nosaj Thing, Billy Kenny, Caspa roots 38-39 Kacy & Clayton, Amy Helm, Ayla Brook shrapnel 41-42 Divinty, Yawning Man, Maglor REVIEWS music 45-51 Chad VanGaalen, Alvvays, Faith Healer, The National and much more ... BEATROUTE Publisher/Editor-in-Chief Brad Simm Marketing Manager Glenn Alderson Editor Colin Gallant Managing Editor Sarah Kitteringham Production Coordinator Hayley Muir Web Producer Masha Scheele Social Media Coordinator Amber McLinden Section Editors City :: Brad Simm Film :: Jonathan Lawrence Rockpile :: Jodi Brak Edmonton Extra :: Brittany Rudyck Book of (Leth)Bridge :: Courtney Faulkner Letters From Winnipeg :: Julijana Capone. Dave Drebit, in the newly-formed The Night Terrors, lets loose at Dickens on a hot August night. BEATROUTE • SEPTEMBER 2017 | 3 pulse ALLY PARTY Friday Sept 22 – Sunday Sept 24 Friday Sept 28 – Sunday Oct 1 Beers, bands and tacos in the parking lot. Record sale Woolworm Archaics Feel Alright I am The Mountain Jason famous Cold Water King Turtle Seizure Salad Kris Ellestad Fox Who Slept The Day away Body Body Jordon Hossack Freddy Dwight 36? Grey Screen Liquor Mountain … more LOCAL 510 AFTER HOURS WITH BRAIDS Following a successful spring season, Studio Bell After Hours is back with more to offer late night guests on Friday, September 22 from 7:00 pm to 11:00 pm. The fall season will kick-off with JUNO Award-winning three-piece Braids headlining in Studio Bell’s Performance Hall, while beat-makers Kloves (techno) and Miss Hazard (house and techno) spin selections on multiple levels. Due to public demand, the fourth installment of the series will also include a later start time, giving attendees more time to dance and mingle after they’ve gotten warmed up. CALGARY BEER CORE BENEFIT Duane Hostland is a 40 year old father of three, a loving husband and an avid obstacle course racing competitor. During a routine procedure, Duane was diagnosed with stage 3B terminal stomach cancer. His first thoughts were not of himself, but of his two daughters, his son, and the love of his life, Rosalie. Duane is determined to overcome his illness. His biggest fear is not being able to provide for his family while undergoing aggressive treatment. On Saturday, Sept. 30, CALGARY BEER CORE will host a fundraiser for the Hostland family, bringing together health, wellness, art, and music at The Stetson between 3pm and 12am. A silent auction will be held, showcasing products and services donated by Calgary businesses dedicated to health, wellness, art, culture, music, and community. Local bands and musicians are slated to play throughout the event to celebrate the Hostland family. All proceeds will go to the Hostland family. WENDESDAYS 4 | SEPTEMBER 2017 • BEATROUTE NO, YOU’RE WEIRD! JOHNFLUEVOGCALGARYTHAVESW·· JOHNFLUEVOGEDMONTONAVENW·· FLUEVOGCOM SOARING EAGLE RECORDS It’s a bird, it’s a plane, it’s.... Matt Olah was the founder and frontman of Cowpuncher, a Calgary band that had a good run over several years, playing across Canada, making records, having a devout following. All good things must pass, Olah took a job with the Calgary Folk Music Festival and hung up his microphone (for the now, anyway) and is now pitching his new venture, Soaring Eagle Records. Where does the name come from? When we were filling out grant applications for Cowpuncher there was always a field on the form for record labels. As a joke we would fill in Soaring Eagle Records. We even made a Facebook page. And now it’s for real! Any specific focus or kind of music or artist? No. With the Folk Fest I’m programmed to work with a diverse list of artists. I want colour, female representation and people I like! What does it mean these days when you get signed to a label? What do you have to offer? Artist development. I work at a large music festival that also has a venue with shows year round. I think I’m good at knowing how to book and promote artists and shows. I was also an artist for 12 years and had some real successes. I’m happy to share that knowledge and experience. For more Matt go to... BEATROUTE • SEPTEMBER 2017 | 7 CITY BEAKERHEAD a fun-filled history of human innovation at your fingertips! by B.Simm CITY AT NITE, CITY OF LIGHT Beakerhead’s photowalk workshop Torch night with Serpent Mother and her flame lovin’ fans. Now in its fifth year, Beakerhead’s stimulating, visual, hands-on, art meets science, street walk experience ups the ante with more than 60 events and exhibitions designed to inform, entertain, excite and tweak your imagination. On account this extravaganza is so massive, we decided to let Jasmine Palardy, Beakerhead’s communication pro, do the talking and touch upon this year’s theme and a just a few of the fun rides to look forward to. SNAKES AND LADDERS This is Canada’s 150th year birthday, although the land certainly has a history that extends well beyond that as does human ingenuity. This year we decided on a snakes and ladders theme. It’s not a typical board game, not in the literal sense you roll the dice and see what happens. Rather, with 14 engineered art installations we constructed a snakes and ladders story. Innovation and invention is a bumpy road. For anyone going from innovation to execution there’s a lot of failures and successes along the way. And what we’ve often heard about Beakerhead is that because it’s so massive, where do I go next? You can choose your adventure and self-discover, or walk up to a site and read about the snakes and ladders story which offers another direction to go in. It’s our way of bread-crumbing people through this story of history and human ingenuity and innovation. SERPENT MOTHER Now the most literal of snakes is the Serpent Mother which is a mechanically articulated snake more than 160 foot long staged at Fort Calgary. She shoots 20-30 feet columns of fire from multiple points along her body. And there’s buttons you can push! get your pack on and up to the space station and prepare for space travel. It delightfully pokes fun at the bureaucracy of public transit. We may think the future will be glitzy and smooth, but public transit will always come with its glorious red tape. INKED: THE SCIENCE OF DEEP SKIN One interesting workshops is Inked, and the science of tattooing. You’ll walk into a tattoo parlour, sit down with a tattoo artist and dermatologist and learn about tattoo augmentation and the affect it has on your body. Then you get to pick up the machine and actually make a tattoo… on an orange peel! SCIENCE OF CATS AND DOG Co-founder Jay Ingram is hosting a stage show at MRU’s Bella Concert Hall that looks at everything from cat and dog behaviorists to detective dogs to robot cats and dogs. THAT’S SOUNDS DIFFERENT Deaf and Hear Alberta is having a listening party at the Grace Presbyterian Church where you can bring a CD or piece of vinyl, they will play it and will remove or add certain frequencies so you understand what people with different auditory perceptions hear. Beakerhead’s complete schedule of events can be found at Last year, one of Beakerhead’s main attractions were the giant white, luminous bunnies who lite up the night. Everyone loved the bunnies, and everyone wanted to take photos of them trying to capture that fabulous glow-in-the-dark experience, which is not so easy to do. No, the bunnies didn’t scamper off, but night photography can be tricky business if you’re not exactly sure how it works. This year Beakerhead offers a new indepth hands-on experience with a refine your skills workshop led by local photographer and visual storyteller Rob Brown. Growing up, Brown developed a passion for film cameras and went shooting when and wherever he could to snag the world through his lens. As the digital age unfolded so did Brown’s photo adventures, roaming the planet taking him to exotic territories including New Zealand, Cambodia, Cuba and Turkey where he indulged in landscape, street and night photography. “The photos I most enjoy taking involve emotional storytelling, usually with people in them, but not always... Beakerhead is so unique, because so many of the exhibits have a light component to them. The big bunnies and octopus in previous years were all lite up and dramatic allowing for great photography.” Brown will be carrying his Panasonic Lumix GX8, a street camera supreme, but he’ll show how you can make your own hand-held capture all the glory at night. For more info go to Night Photography Workshop SAIT LOVES ACAD Anyone who has gone to SAIT or ACAD know the technical world is siloed away from the arts world, and that extends way beyond school. So this year SAIT and ACAD are playing with each other with giant inflatables, kind of a love story between those two institutions. SAIT will have a hug paint brush on its rooftop, while ACAD will have a rocketship on top of there’s. CALGARY MUNICIPAL SPACE STATION There’s a local group called Humble Wonder who will be turning the Calgary Tower into its first municipal space station. To envision an extension of public transit, we have to think about a municipal space station that will connect to galaxies beyond. They’re converting the elevator and at least half of the top of the tower into a space station that’s a fully inclusive experience and includes some virtual reality. It’s guided experience, you’ll be with a fellow space traveler to get some ground training like any other astronaut, then Calgary’s Major Tong gazing down from the tower. Rob Brown: viewing the world through a storytelling lens. 8 | SEPTEMBER 2017 • BEATROUTE CITY HEXAGON CAFE game board delight in Kensignton The afternoon sun pours into the fresh, bright, clean, contemporary interior of the Hexagon Board Game Cafe. It’s truly a warm delight looking out from a second story window as people wander up and down Kensington Road, enjoying their summer’s day. That the cafe has such an exquisite and inviting design is no surprise considering the owners, Kellie Ho and Randy Wong, both graduated with degrees in architecture. But the Hexagon is more than just a place to chitchat and enjoy the view over a cup of coffee or a beer, if you prefer. It’s where board-gamers congregate and delve deep into their obsession. The idea came to Ho and Wong when they couldn’t find work as designers and traveled to Korea. “Boarding cafes are really popular there with people from all over the world,” say Ho. “And we thought to bring the concept back home.” Three years ago they opened their first cafe in Edmonton, Ho’s hometown, on Whyte Ave. And then the location here in Calgary, where Wong’s from, last year. Kellie says that while they do cater to gamers they also get a lot of professionals, students and those out on date nights that crack open the board. “It’s a good ice-breaker, and you get to see the other’s personality quite easily,” she laughs. For those who haven’t yet taken the plunge into the parallel universe of gameland, you’re missing out on a wonderful experience in a wonderful place. On Thursday, Oct. 5. ACAD Student Night takes place at Hexagon, #200 -1140 Kensington Rd. NW. MADISON’S Inglewood’s new comfort cafe has many splendors Community-minded whiz kids Pieter and Jared Co-owner, Pieter Boekhoff, says that he and his partner, Jared Salekin, designed their boutique nacho bar with women in mind. “It’s meant to be female-centric. A place were women can come, enjoy a glass of wine, have good conversation,” says Boekhoff. And clearly the elegance of Madison’s with its wood paneling, white tiling, a modern flair for furniture and golden rays of sun filling the room, distinguishes and distances itself from the dingy, bottom-rung sports bar full of men chugging back beers. Although you can order beer at Madison’s, they have lots of local craft brew on tap that they rotate regularly. Boekhoff adds, “We also wanted to make it the most comfortable coffee shop you’ve every worked out of.” He notes the design of the tables, chairs and positioning of power outlets, all for the convenience of using a laptop. Speaking of comfort and style, Madison’s CITY by B.Simm Let’s go boarding now, everyone is learning how! by B.Simm may have the best patio in Inglewood, facing south, back off the street and partly shaded by mature trees and building walls on each side. There’s both sun and protection, a real comfy pocket. The nacho menu is their food specialty. Served on a 8 x12 inch aluminum tray, they offer five different selections that include the Angry Hawaiian, Mexican, Korean, Poke and Wild Mushroom & Truffle with none of the typical pub grub ingredients you’d get in a bar. Fresh, filling and fantastic is a deserving description. You’d be hard-pressed to go back to that ole plate piled high with its shredded monza-cheddar mix. The name Madison’s is tip of the hat to New York where both Salekin and Boekhoff went for inspiration. And what did they come back with? A delicious Old Fashioned cocktail priced at TEN DOLLARS! Thank you very much!! Both graduates of the entrepreneur program at MRU and pro-community, Boekhoff and Salekin set up Madison’s to give people a stake in the firm. “For $5,000,” says Boekhoff, “you get an order of nachos per week. And it’s also an investment in the company where you get a profit share as a non-voting member.” Chips Ahoy! On so many levels. Madison’s is located at 1212 - 9 Ave. SE. WHAT SHAKES YYSCENE’s quick scan go-to-guide for September... Everything, and I mean EVERY- THING is happening this month. Music? Check. Dance? Check. Food from trucks? Check. Film? Hells yes, check. Science and art, together again? Check check. Are you a fan of Jay Arner? Well, he’s playing with Heavydive and Carbolizer on Sept. 7 at the Nite Owl. More into dance? The 36th Annual Alberta Dance Festival presented by Dancers’ Studio West runs at the Pumphouse Theatres Sept. 7-16. Go, culture yourself. Food! On Saturday, Sept. 9 head to Currie Park (by Wild Rose Brewery if that’s a better marker for you) for this year’s Circle the Wagons traveling carnival, featuring YYC Food Trucks, beer, music, art and performers from 9 a.m. to 11 p.m.Head off to MacEwan Hall after you’ve eaten your body weight in tacos to check out Oh Wonder’s Ultralife Tour. Beakerhead: Your art is in my science! Your science is in my art! From Sept. 13-17 you can take in some amazing exhibits – both interactive and not – around downtown Calgary and just revel in Beakerhead’s awesomeness. A giant, fire-y serpent, fun down Kensington Alley, the art of butchery. .. well that sounds weird, but you get the idea. Much to see! The Ballantynes with Hard Pressed and Letters to Lions play the Palomino on Sept. 14, with Fiver and Saltwater Hank at the Hillhurst United Church Sept. 15. Market Collective – more than just a market – brings us the Market Collective Bike Scavenger Hunt on Sept. 17 from 12-4 p.m. Film! So much film from Sept. 20 - Oct. 1 with the 2017 Calgary International Film Festival, featuring documentaries, shorts, local films, international films ... you name it, they’ve got it. Buy a pass and start planning your month. That’s a lot of films ... Studio Bell After Hours will feature former locals Braids with Kloves and Miss Hazard on Sept. 22 from 7-11 p.m. Sept. 23sees Elliott Brood headlining at The Gateway, and The Commonwealth will be busy with Kacy & Clayton on Sept. 24 and Austra (so excited!) on Sept. 27. Ending the month you have Feist at the Bella Concert Hall for a three-night stand, Sept 27-29, The New Pornographers with Born Ruffians on Oct. 3 at MacEwan Hall, and why not head to the Ship & Anchor on Oct. 4 to check out Adictox with Canibales & No More Moments? There — start planning your month. The Ballantynes, Vancouver’s premier soul-rockers Sept. 14 at The Palomino Kari Watson is a writer and former Listings Editor of FFWD Weekly, and has continued to bring event listings to Calgary through theYYSCENE and her event listings page, The Culture Cycle. Contact her at kari@theyyscene.ca. Kari Watson Editor, writer, events listings curator BEATROUTE • SEPTEMBER 2017 | 9 Books SKIFFLEMANIA! Billy Bragg reveals the roots of Britain’s rock ‘n’ roll revolution At the height of its popularity in 1957 skiffle in Britain was enormous. Nothing less than a massive skiffle attack with an estimated 400 groups in London and literally thousands more scattered across the country playing school gymnasiums, cafes and church basements, prompting an insane surge in annual guitar sales that also soared into the thousands. Top hits on the radio, smash records, crazed skiffle contests and packed coffee houses... Skifflemania was in full swing! And then in a flash it was gone, just as a one scruffy skiffle outfit from Liverpool, The Quarrymen, made their first demo recording a Buddy Holly song. Soon after, rock ‘n’ roll was here to stay. Skiffle was a major influence, the segue to stardom and a new universe for many of great British pop and rock artists including The Beatles, The Who, David Bowie and Jimmy Page. Yet very little is known about this fertile period from ‘56 to ’58 which hasn’t garnered much more than a footnote in the history books. This is precisely why Billy Bragg, the political folk-punk troubadour, took to writing a fine piece of smart, articulate and often witty historical research with Roots, Radicals And Rockers: How Skiffle Changed The World. Its beginnings hinge on Ken Colyers, whose unwavering purist love for New Orleans jazz led to the formation of a “trad jazz” band that included Lonnie Donegan, a lively Scot who also cherished country swing and the blues. In 1954 Ken Colyer’s Jazzmen recorded a reeved-up version of Leadbelly’s “Rock Island Line” as a B-side with Donegan taking lead vocals. What was essentially a near throwaway track would launch the skiffle craze two years later and vault Donegan into orbit. In terms of Donegan’s talent, Bragg claims, “He was undoubtedly the best blues singer in Britain. Head and shoulders above anyone else as a white blues singer. He was a good all ‘round entertainer, who had that ability to engage an audience. A very gregarious personality. I meet him in his later years, he was the life and soul of the party kind of guy. And a real fan of the music. He had a real a love for it, which he wanted to communicate to the people. That’s what I got out of him.” It wasn’t just Donegan’s skill, fire and enthusiasm that created the skiffle boom, it was also its accessibility. Bragg notes that post-war youth in Britain had gown up with rationing. Music was scarce, record stores weren’t in abundance, many teenagers had to sign records out of the public library to hear jazz, blues and country. And there was a long standing a feud in the ‘50s between the British and American music unions that prevented artists to tour in the others’ country. On top of it, the BBC put the squeeze on. “They rationed rock ‘n’ roll,” says Bragg. “And these kids said, ‘Fuck em! We’re going to make our own music. We don’t care about the BBC. We’re going to take the guitar and make our own music.’” by B.Simm And that they did. Bragg claims upward of 50,000 skiffle bands existed in Britain with guitars in hand. “You got to remember these are teenagers, and they used the guitar as way of defining themselves as not adults and not children. The guitar is the tool by which they do that. And I do think if you were a 15 year old in 1957, and you saw a sign that said, Tonight Skiffle, you wouldn’t expect to hear just Lonnie Donegan type of songs. You would expect to hear music played on a guitar. It could be blues, it could be jazz or calypso. Just picking up the guitar was a symbol of something new. That’s what these people were trying to do. Paradoxically by going back to Lead Belly they were trying to build a bridge to the future and make it happen. And the guitar is the means but which they defined themselves as being a completely new generation.” Indeed it did. Ten years later “My Generation” was fiercely punctuated by Pete Townshend’s spectacle of violent windmills and smashed guitars that then would pave the way for yet another DIY generation led by a feisty, street fightin’ man named Stummer who, armed with a battered black Telecaster, threw down the gauntlet: This is a public service announcement… WITH GUITARS! Roots, Radicals And Rockers: How Skiffle Changed The World is publishsed by Faber & Faber. 10 | SEPTEMBER 2017 • BEATROUTE CITY FASHION HUSTLE PIECE ON PEACE a small boutique forging ahead with a flair for fashion and health After working as a skin care specialist for several years, Barb MacKenzie shifted her focus to fashion while continuing to maintain her interests in healthy and sustainable products. The result is Piece on Peace, a small boutique located in Southwest Calgary. Essentially MacKenzie runs a mini-department store that carries a variety of designer clothes, handbags, jewelry, footwear and bedding along with full line of eco-friendly cleaning and skin care products. “I’ve always been about the piece,” she say when discussing her shop’s name that she runs with her husband. “What got us accepted into the Farmers’ Market years ago was making capes and using the most beautiful fabrics. None of them were exactly the same, so that became your ‘piece’, it’s individual and has your name on it as you walk around the city.” MacKenzie adds that as an artisan-based company, they didn’t want to carry any “manufacturing”— materials or products that made from industrialized processes. “We want to support textiles in a green way. For instance, is that piece, that product, going to be sitting in a landfill forever? So the other part, the other ‘peace’ is about sustainability. Textiles are becoming a dirty business. The dyes can be very toxic, as are the chemicals in permanent-press products. Everything from the clothing you’re wearing to what you’re sleeping in, it concerns autoimmune systems, your health, your lifestyle.” To get a better idea of what Piece on Peace is about, MacKenzie talks specifically about some of the products she carries and the benefits they have. Skin Care “They aren’t necessarily organic, but we don’t want any fillers, any petroleum by-products, or parabens which are preservatives, we frown against dyes, and don’t like artificial scents. We are looking at the most natural product that you can wear on your skin and thinking that they can be absorbed into your system. Think of it as food!” Barb MacKenzie owner of Piece On Peace, located at 5 Spruce Center in Spruce Clif f in SW Calgary pieceonpeace.com by B.Simm Cleaning Products “Most cleaners are filled with abrasive chemicals to do the job, but you don’t need that. A lot of our cleaning products are from Clean Conscious, a small company out St. Alberta who make their cleaners from natural ingredients (e.g., baking soda, vinegar, alcohol, cornstarch, lemon) that are really effective. They also source out all their ingredients based on fair-trade practices, so no low-pay, child labour. It’s important to know that story, and we want to tell it.” Jewelry “One of our jewelry designers works with stones and their meanings. Stones have stories behind then, certain energies too and they work differently on everyone. Another is a metal jeweler who takes a lots of recycled materials, like copper tubing used for plumbing. And she also finds old broken jewelry at markets and thrift shops, then breaks it down to make something new.” Swedish Stockings “Stockings, leggings, tights and nylons make textiles the second largest pollutting industry because they’re only worn a few times, if that, then thrown away filling up landfills. And most dyes used are bad for you pressed against your body all day... This company is about women making products for women. The two Swedes who started it use recycled yarns, dyes that aren’t harmful, they taken the comfort level miles beyond, and all their products are made in a solar power plant in Italy. The company has grown from a baby to giant in the last couple years.” Footwear “We have some stylish boots similar to Wellies, Wellington rainboots, but you sweat in those. The ones we have come from Denmark although made in Portugal called Lemon Jelly. They have this technology that smells fresh like lemons but uses anti-bacterial material so your feet don’t sweat or smell.” Bedding “Real Egyptian cotton is really the best way to sleep. The quality of cotton is not based on thread count, it’s based on how durable the fibre and how long it. This cotton comes from Italy, which is the hub for all your manufactured green materials. It comes into Canada as an unfinished good then sewn here saving a huge cost on all the duty. Sleeping in Egyptian is like a dream, it allows you to have a far better sleep and that improves your health. Never underestimate your bedding.” CITY BEATROUTE • SEPTEMBER 2017 | 11 ody-body by PUNK MEETS FASHION a runway makeover with street style by B.Simm debut cassette release available sept 15 at all fine local record shops body-body by After creating a jewelry line based on “wearing your spirituality” which has grown substantially and now has national distribution, local designer and yoga instructor, Apryl Dawn, is embarking on another venture bringing underground street style to the refined, high-flyin’ world of runway fashion. The idea of a punk rock fashion show with bands that provide a runway soundtrack, has that idea been done before somewhere? There’s a fashion week in Toronto that mixes music with fashion, but locally, definitely not. This was brainchild of Dave (Pederson, vocalist/guitarist in Downway) and I bouncing ideas off each other, and my frustration with not seeing more alternative fashion and looks on the main runway. Not seeing more alternative fashion on the runway, what does that mean specifically? I’m not a pastels and floral kind of girl, or a cut and structured wearables type of person. I’ve been to lots of fashion shows and for the big ones, that what it’s about — What is the average 30 to 40 year woman wearing? I suppose I’m not average or interested in average, nor are the people I work with. I don’t see alternative fashion out there on the level it should be. We have a lot of freedom to dress the way we want, and express our authentic self. Our fashion is our inner self, it’s our authentic being which we should be able to express. More and more we’re moving towards that point, but I still think we need to break down some walls. But you have punk street fashion, a DIY culture that creates their own style from clothes bought at thrift shops. When or how does that street style crossover and spill onto the runway? Honestly, I love the person on the street that found a whole bunch of shit for five bucks and looks totally rockin’, opposed to someone who just went out and spent 500 dollars on a t-shirt. And I think it blends from one world to the other because there is no structure in place yet. There is this deep, grungy, grindy underworld of punk and rock that’s actually feeding the high side of fashion. Couture is definitely not shaping that. It’s coming off the street, from the bottom up. We’re feeding off something that’s been underground for decades and decades, and stealing little bits of pieces — chains, leathers, belts and buckles — and that’s all being becoming one for me. The PUNK MEETS FASHION showcase takes place Thursday, Sept. 21 at Commonwealth. 12 | SEPTEMBER 2017 • BEATROUTE CITY OTAHPIAAKI 2017 Indigenous Beauty, Fashion and Design Week by B.Simm Rebecca Merasty models new fashion by one of Otahpiaaki’s feature designers, Brenda Lee Asp, who named the cape “Honouring Raven - My Mother’s People”. Photos taken at Tsuu T’ina on the banks of the river called they call Kootsisáw, the Blackfoot refer to as Moh kínstsis, and the Stoney Nakoda call Wincheesh pah. PHOTOS: JASON ENG these designers are building their brands. In some cases, our students have collaborated on eCommerce sites, graphic design and the design of lookbooks for designers who do not have these tools. One of our founding students Spirit River Striped Wolf (MRU Policy Studies) developed an international costing export tool for any designer to use if they’re thinking of selling in the EU. Another student, Taryn Hamilton (MRU Justice Studies) is engaged in developing new Canadian law designed to protect the industrial designs of Indigenous creatives. It matters who is at the front of the room too. Each of these designers have successful ventures. So, having thought leaders like Justin Louis present and inspire others is critical to growth that we anticipate could be upwards of 19.6M in our province alone. The Truth and Reconciliation Showcases go beyond the flair of a fashion show. Could you elaborate on these two showcases? We kick off the week with a performance by Grammy nominated artists, the Northern Cree Singers on September 18, and are very excited to be screening Rumble: The Indians Who Rocked the World on Tuesday, Sept. 19 both at the Bella Concert Hall. The Truth Showcase has been curated to include designers whose work inspires questioning, commitment, action, impact and change through designs. The evening opens with opens with champion hoop dancer Dallas Arcand who warms up our runway. The Reconciliation Showcase has been assembled from designers’ collections that are more couture and avant-garde, similar to a luxury runway from New York or Paris – many of our designers have been invited to both. Our featured guest is Brenda Lee Asp from the Northern Tutchine First Nation in the Yukon. The final piece in the showcase is a reconciliation cape project organized by Brenda that will be built collaboratively over the week. For all details about the seminars, runaway shows, music, film, scheduling and tickets for Otahpiaaki 2017, go to otahpiaakifashionweek.com Based out of Mount Royal University, Otahpiaaki is an annual week long event that showcases Indigenous beauty, fashion and design featuring a wealth of local and regional Indigenous artists and designers with their inspiring creatives. Patti Derbyshire – Chair of Entrepreneurship, Marketing and Social Innovation in the Bissett School of Business at MRU – talks indepth about what Otahpiaak 2017 has to offer and what it hopes to achieve with this bold and exciting Indigenous venture. Overall the focus of the event draws on a rich Indigenous past, but then places it into a very contemporary context. In fact, that seems to be a statement made: while its roots are deep in tradition, this is a very progressive exhibition, this is Indigenous fashion design here and now. I think this is a good read of Otahpiaaki 2017 and the designers with whom who we’ve started to build relationships. At our first showcase last November, Justin Louis and Tishna Marlowe informed the direction of this project. There were three things that are important to convey. First, that our student teams understand that Indigenous creatives are carriers of vibrant cultural knowledge and a voice that has always been strong, resilient and diverse. Also, the design and craft of Indigenous apparel, fashion, music, film and arts has always been a critical component of identity in Indigenous communities – an underappreciated hallmark of Canada’s fashion identity. Our students completed research in this area earlier this year and we discovered that iconic fashion and apparel in Canada, in fact, is Indigenous. Finally, there is an immense creative and economic engine, by Indigenous designers and for Indigenous designers, where global impact and presence is inevitable. Looking at cross-section of the seminars and workshops offered, it seems like every stone is overturned, is there anything in Indigenous fashion and and design that isn’t covered? There are 760+ First Nations, Métis and Inuit communities within Canada, so there is much to discover yet. This is a Seven Generations project that we intend to co-create over the next seven years, so we’re just infants really. There’s no question that the strength of the program comes from the advice of our Elder, Jeannie Smith Davis, recommendations from our founder-designers, as well as Otahpiaaki student teams. Fashion and creativity are powerful platforms for discussion and healing. What we’ve developed is what worked last year – using fashion, sewing, creative studios, social innovation, and entrepreneurial thinking as opportunities to build relationships and knowledge of difficult and compelling topics. Those who participate in workshops with this year’s Indigenous designers, both Indigenous and non-Indigenous receive new knowledge. It is not formalized but we found when people work creatively with their hands, they will listen and speak with one another, with time to reflect on what is being shared. One might learn about a craft technique and its lineage, but honestly last year participants learned as much about deep beauty –intellectual, spiritual, cultural, emotional and physical, the diversity of Nations, Missing and Murdered Indigenous Women and Men, the intergenerational trauma of residential schools, the Indian Act, and about the TRC Calls to Action. Discussion and action are embedded in each of the workshops and will be shown over and over on the runway events . There’s a strong entrepreneurial, a business component. How is that weaved into the event? Economic reconciliation is a pillar of the greater Otahpiaaki project and incorporates new venture thinking, marketing, and social innovation. We are based at the Bissett School of Business so it’s valuable and a natural fit to hear the stories and methods of how each of CITY BEATROUTE • SEPTEMBER 2017 | 13 FILM CALGARY FILM 2017 200 films, 40 counties, Alberta galore by Jonathan Lawrence SUCK IT UP Grief and friendship meet in Invermere-shot film by Morgan Cairns try not to talk your ear off,” says Steve Schroeder jokingly. As executive director of the Calgary International Film Festival, he “I’ll talks vigorously about this year’s new films and events, espousing the level of originality and local pride that they aspire to each year. With over two thousand submissions, the team at Calgary Film (no longer abbreviated as CIFF) had their work cut out for them. What they ended up with is “200 different, remarkable perspectives, visions of the world that come through every genre from 40 countries or more and of every type of film,” says Schroeder. It’s a passion Calgary Film has both for film and organizing a community is palpable. “It’s what we love, it’s what motivates us,” he adds. Schroeder himself is no stranger to festivals or films. “I’ve always been a film buff. I’ve been now 20 plus years working in the arts community in Calgary. I started as a live theatre producer, where I developed a love of festivals in general…I love when a city has a deep festival-based culture because nothing makes a city liveable, vibrant and fun and civilized like a festival.” Calgary Film isn’t merely a series of screenings at different theatres, however. People are encouraged to come out to the Q&As and other special events that will be happening during the festival week, particularly the Opening Gala which includes walking the red carpet, live entertainment and a post-screening after party. Then the Closing Gala, which follows the Alberta-made film presentation, Suck It Up, will be an all-inclusive awards celebration, free to the public that provides a great opportunity for “fans to mingle with filmmakers,” says Schroeder. Calgary Film has a growing dedication to Alberta-produced film and TV, which has been expanding rapidly for the past several years. In 2016, they began a feature called Showcase Alberta to champion Alberta talent. In fact, about a quarter of their Canadian content has ties with Alberta. “We’re definitely an international film fest.” states Schroeder. “But the percentage of local content that we show is significantly higher than [other film festivals].” Calgarians, in specific, are really excited by this industry that they know is growing.” Schroeder also notes that often the best attendances during the festival are films with Alberta content, particularly where the local filmmakers are present. This year’s festival will have an event focused on the new television show, Wynnona Earp¸ produced in Alberta. It will be a “big cast and creator event,” says Schroeder, which includes a Q & A session. He adds that tickets to the event are selling fast, and that people are flying in from all over to see it, “If people’s Facebook posts are to be believed,” he jokes. Attendees can expect a wide range in tone and genre from the lineup this year. Schroeder says if you’re unsure which film to see, his best advice is to “find a local film and just check it out, you’re likely to have a very good time. Pick one blind, and have a random experience. People are always surprised happily so.” Calagry Film runs from September 20 to October 1, 2017. See for film sch edules and to purchase tickets. Albertan pride – not pretending to be anything else. After her feature film debut at TIFF in 2014, director Jordan Canning’s much-anticipated sophomore feature is set to make its Alberta debut at this year’s Calgary International Film Festival. Programmed as the coveted Closing Gala selection, this locally shot film is finally ready for its homecoming. Initially premiering at the Slamdance Film Festival in January, Suck It Up follows the impromptu trip of two friends, Faye and Ronnie, in an attempt to cope with the sudden death of Ronnie’s brother and Faye’s ex-boyfriend Garrett. Spending the week in Ronnie’s family cabin in Invermere, the two girls, in their own very different ways (Ronnie through drugs and drinking, and Faye through crafting and micromanaging) attempt to reconcile their loss whilst humorously engaging in typical vacation trysts, in what Canning aptly describes as a “joyride through grief.” “It was much more of a comedy when I first got [the script]. There was less of the grieving, emotional weight, and that was something I really thought was important to bring into the story,” says Canning. “I can’t call the film a comedy, I can’t call it a drama, and I hate the term dramedy, but that’s really where it sits - a mix of both. I call it the salty and the sweet. It has that emotional through line that really grounds the characters, and the comedy is there, and some of it is quite dark, because when you go through heavy shit your humor can get quite dark.” Joining the project after reading the first script, Canning recounts how the film’s two leads, Erin Carter and Grace Glowicki, who had already made a short together, initially fueled the passion project. “[They] wanted to take on something bigger. They wanted to write great roles for themselves that they weren’t necessarily getting in auditions,” explains Canning. “So they approached [screenwriter] Julia Hoff and said, ‘Hey, do you maybe want to write us a feature that we can shoot for $10,000?’” With Glowicki’s family cabin serving as the starting point, the actresses tapped Los Angeles-based Hoff to create a script around the BC Rockies locale. “Julia had never been to Invermere,” explains Canning, “but Grace and Erin had spent their childhoods there, so they sent her this list saying there’s a bowling alley, there’s a candy store, there’s these great lookouts. So Julia created this story, and the three of them developed these characters, and wrote this script.” Their search for a female director led them to Canning, who was immediately attracted to the project. “I was going through some stuff in my own life and Faye just kinda grabbed hold of me and I saw myself in her and I felt that I really could bring something to the table with a story about grief, and losing someone to cancer,” she said. “The script that I originally read was very different from the script we eventually shot, but what was always clear was Julia’s voice. She is so good with dialogue and emotional truth.” And while the script may have gone through numerous rewrites, the Invermere shooting location remained a steady presence through the entire process. “Right from the get-go it was written for Invermere,” says Canning. “We wanted to use everything we could about the town and showcase it well.” With most of the cast and crew returning for the film’s Calgary premiere, Canning couldn’t be happier to see the film come full circle. “We’re making films in Canada, and we’re not pretending this is anything but Canada,” she states. “I hope that there can be some pride in seeing Calgary and seeing Invermere for what it is and being like, fuck yeah, we don’t need to pretend it’s anything else.” Suck It Up will be the Closing Gala event of the Calgary International Film Festival on September 30 at 7:30pm, followed by the awards ceremony. Jordan Canning and Erin Carter will be in attendance. 14 | SEPTEMBER 2017 • BEATROUTE FILM SMALL TOWN CRIME modern film noir is conventional, yet intriguing Another small town meets mystery in this edgy detective film. BUCKOUT ROAD creepy urban legend delves into dream sequences Buckout Road is an intense throwback to 70s horror films. by Philip Clarke by Philip Clarke When alcoholic cop Mike Kendall (John Hawkes) is let go from the police force due to an incident involving the death of his partner, he inevitably hits rock bottom. A year and a half goes by without him ever getting a new job. Mike learns that being branded as an “alcoholic cop-killer” tends to not bode well when trying to meet new people in any kind of social circle. Either way, Mike does what he can by going to interview after interview, but he never gets the job. The fact that he tells interviewers that he has a serious drinking problem, however, might have something to do with it. In the meantime, Mike is busy collecting unemployment checks and using them at the bar to get wasted. If he’s numb to the pain, then the pain won’t hurt so badly. All his sister Kelly (Octavia Spencer) wants for him is to get sober. That and for him to get a job and pay her and her husband (Anthony Anderson) back all the money that he owes them. Old habits die hard when John discovers an unconscious, bloody and bruised woman lying on the side of the highway. This inciting incident will take Mike down an insidious rabbit hole of sex and violence. What follows is an incredibly tense series of events that never lags or feel tiresome; the pacing is on point. Small Town Crime is a lean, mean and expertly-made modern day film noir. Written and directed by Eshom and Ian Nelms, the film has all the elements of a classically made noir, but maintains a modern sensibility to it. A hard-edged private eye, femme fatales, and over-the-top gangsters are just a few of the wonderful ingredients thrown in. The film has a very balanced blend of gruesome violence and incredibly subtle pitch-black humour that takes the story over the edge to be exceptional. While many elements of the film work incredibly well overall, the film rests squarely on Hawkes’ shoulders. As the broken, snarky and charming lead, Hawkes is purely magnetic from beginning to end. Mike is onscreen for almost every single scene in the film, and deservedly so. He’s so utterly compelling that you simply can’t take your eyes off him. You’re on his side throughout the length of the story. Small Town Crime follows all the beats of your typical crime film, so nothing in the story is particularly shocking or surprising. That said, it’s still incredibly well made all the same. You don’t always have to reinvent the wheel. You just need to find an interesting way to spin it. That interesting spin is named John Hawkes. Small Town Crime will be shown during the Calgary International Film Festival. For more info and times go to NO ROADS IN Directed by Calgary-based Josh Wong, NO ROADS IN follows singer-songwriter Blake Reid, sound engineer Adam Naugler, and the Blake Reid Band on a musical journey as they challenge industry convention and set out to create an analog record. An abandoned house in the middle of an endless Alberta wheat field is transformed into a recording studio, as the group comes together to capture the love, laughter and raw energy of 13 songs recorded live off-the-floor over five days in the summer of 2016. Showcasing the vast Alberta prairie landscape and the uniquely haunting isolation that foments creativity, the beautifully shot documentary celebrates music’s imperfections and explores what is really important in music, and in life. Following the film, the Blake Reid Band will perform songs from the film. Both the film screening and live performance will take place at Studio Bell, home of the National Music Centre. When Aaron Powell (Evan Ross) returns home to his small town after several years away in the military, he’s disappointingly correct in his assumption that his psychologist grandfather Dr. Powell (Danny Glover) wasn’t there to pick him up from the bus station. It turns out that Dr. Powell had shirked his familial responsibilities in favour of working with Detective Harris (Henry Czerny) to try and stop the strange happenings that are afoot in their town. The townsfolk have been haunted for several years by the many urban legends about the titular Buckout Road. Some believe in them, while others simply pretend that none of it is real. “Out of sight, out of mind” is the general mantra that many of them seem to live by. However, the legends begin to seep into the real world when members of the town begin to sleepwalk their way in the middle of the night to Buckout Road. That is, before they ultimately kill themselves in both awful and downright disturbing ways. With the help of fraternal stoner twins Erik (Kyle Mac) and Derek (Jim Watson) as well as Detective Harris’ daughter Cleo (Dominique Provost-Chalkley), Aaron attempts to figure out the mystery of these troubling legends before it’s too late. What works best about Buckout Road are the dream sequences, which go back and forth between a 1970s’ zombie exploitation film, and witches being burned at the stake, to name just a few of the scenes. The dreams are both creepy and unnerving in equal measure. The moments of shock and gore generally work to great effect, shown over and over again to the point of numbing submission. Buckout Road plays at the Calgary International Film Festival. For more info and times go to www. calgaryfilm.com/films Wednesday, Sept. 27 Studio Bell • NMC 7:30 pm Friday, Sept. 29 Globe Cinema 9:30 pm Amsterdam Film Festival 2017 Van Gogh Award 16 | SEPTEMBER 2017 • BEATROUTE FILM TURN IT AROUND: the story of East Bay punk love letter to San Fran music scene Green Day at Gilman circa 1990. Turn It Around: The Story of East Bay Punk is a purely unadulterated love letter to punk rock and everything it stands for. Co-writer/director/producer Corbett Redford has flawlessly crafted a documentary about the punk rock scene in the San Francisco Bay Area over the course of over thirty years. It began in the late 1970s where punk was a counterculture response to the Vietnam War. Contrary to popular belief, however, true punk rock is not about being loud and angry for the sake of being loud and angry, as many critics of the genre so often prematurely point out. Like all good art, punk rock is a form of self expression and Turn It Around is an informative, inspiring and entertaining lens with which to showcase that self-expression. We’re treated to lots of footage, photos and interviews from several key players in the punk scene spanning many years. Redford’s documentary is incredibly broad in its scope, yet remains an intimate character study with many different personalities. Billie Joe Armstrong, Noah Landis, Tre Cool, Robert Eggplant, Anna Joy Springer, Tim Armstrong and Kathleen Hanna are just a few titans of their industry that Redford interviews. The film very easily could have been a painfully biased slant on the genre. However, Redford wisely captures several different influential voices to give the film an incredibly well-rounded point of view overall. Being 155 minutes in length, Redford makes sure that every single possible aspect about punk rock is covered. Several different forms of the genre are discussed, such as hardcore punk, pop punk, ska, queer by Philip Clarke punk and feminist punk, just to name a handful. The beauty of punk rock is just how incredibly inclusive and communal it can all be. The heart and soul of Turn It Around is where much of the film’s running time takes place, at 924 Gilman Street. The venue was a well-regarded Shangri-La for every race, gender and orientation of punk rocker. Gilman was, and still is, a place all to its own. The club was home to many different shows over the decades where every kind of person could go to be themselves as free spirits. That said, Gilman did unfortunately experience some trouble from time to time. Like with anything popular, the more positive attention something gets, the more detractors and contrarians will come crawling out of the grass like serpents. As punk became continually popular throughout the years, skinheads and Neo-Nazis subsequently also joined shows at the Gilman, where they would often spout their repugnant hate-speech and/or incite brutal acts violence. It’s these moments of tension and conflict that Redford carefully documents that elevate the film to another level. The punks and skinheads conflict is ripe for several different films on their own. If you think about it, Green Room would be a perfect film to have as a double bill with Turn It Around. The very fact that these conflicts are still going on today make the hatred and intolerance showcased all the more visceral and disturbing to watch. As hard as those moments in the film are to experience, they are equally important to be aware of and discuss at length. Turn It Around: The Story of East Bay Punk is unquestionably a film worth watching for punk rockers of all ages. Even if you’re not a fan of punk rock, the film is still worth seeing to understand why both its music and lifestyle have been so beloved for many years. If you’re still not convinced however, it’s narrated by Iggy Pop and executively produced by Green Day. And who doesn’t want to hear Iggy Pop narrate? Turn It Around will be shown during the Calgary International Film Festival. For more info and times go to SOME OTHER GUYS fascinating documentary about Merseybeat’s forgotten rockin’ rollers that was the Big Three.” The above quotation is frequently heard throughout “And Some Other Guys, often used to punctuate a story from witnesses and fans of the reckless, hard-partying loud 1960s Liverpool band, The Big Three. The band members, Johnny Hutchinson (Hutch), Johnny Gustafson (Gus), and Brian Griffiths (Griff), were punk before there was punk, and caused rock-androll mayhem long before anyone else. That said, they were a Merseybeat band, who sounded – and looked – much like The Beatles and other acts of that time and place. They packed music venues and played to hordes of screaming girls (which sounded like a “bomb going off.”) They were lauded for their musical talents, both then and today. They were called the “greatest, ass-kicking band that ever came out of Liverpool” by one musician. They were the “original power trio,” remarked another. So why then has no one ever heard of them? Beatroute spoke with Todd Kipp, director of the film, to shed light on that question, although he himself could not explain why they’ve been essentially reduced to a footnote in music history, despite their talent. “[The Big Three] were praised by everyone in Liverpool,” said Kipp. While planning the film, Kipp met with guitarist Brian Griffiths - who now resides in Calgary - and listened to some of his stories. Kipp soon realized that this was “more than just another band who were one of the hundreds on the Mersey Beat scene in the early 1960s.” Clearly, there was a story here worth telling. The documentary shares a fascinating, yet poignant story of how the band “could have and should have been huge,” Kipp said, “but were too self destructive and ahead of their time and ultimately imploded before the British Invasion.” FILM Many argue that the Big Three should’ve been even bigger. Despite their clean image, The Big Three answered to no one, least of all their manager, Brian Epstein, who also managed The Beatles. Epstein, or “Epi,” was trying to turn them into his other rising stars, donning the three in matching suits and encouraging them to write poppy love songs. The Big Three weren’t having any of it though; they were violent, rowdy, tough-talking Brits - and hard drinkers. by Jonathan Lawrence “They loved being on stage,” Kipp added, “but didn’t care for the rest of the business and it was to be their downfall.” Fans of The Beatles who are interested in extra lore will find some lesser known tales here. The Big Three played gigs with them, they hung out together, and even lived together. The Beatles were even fans. Yet The Big Three were essentially the anti-Beatles. “I wouldn’t join the Beatles for a gold clock,” said Hutch, the drummer. Kipp, an admitted huge fan of the Merseybeat era, shared his enthusiasm for making this film, which is evident throughout. “These are all first-hand stories,” he wrote, “and despite the fifty plus years and everyone’s memories, it’s essentially the truth.” Some Other Guys is a fascinating examination of a band that voluntarily cut their career short because they didn’t want to play by the rules. A band that had the potential to reach Beatles-like heights, but refused to because they didn’t want to wear suits. To be fair, there’s a sense of admiration and heroism in that sentiment. The film is told through a colorful, dynamic mix of interviews, archival photos, animation, and even a modern enactment of the band in action. Kipp summarizes it with this quote: “The Story of The Big Three is the ultimate story of every band with talent and potential, but who just didn’t make it. These guys were signed with Brian Epstein, Decca Records, played The Cavern Club countless times, all the TV shows and are still considered the best band to miss the British Invasion.” And that was The Big Three. Some Other Guys will be shown during the Calgary International Film Festival. For more info and times go to BEATROUTE • SEPTEMBER 2017 | 17 RETURN TO NUKE EM HIGH: VOL. 2 Lloyd Kaufman reveals political message hidden in slimy satire by Breanna Whipple RUMBLE: THE INDIANS WHO ROCKED THE WORLD Tuesday, Sept. 19 Bella Concert Hall. — Hot Docs 2017, Toronto With a nuclear power-plant seeping toxic sludge into the veins of slapsticky nerds as they wage war against a gang of punky sadists, to describe Class of Nuke ‘Em High as anything but a subversive work of art would be a cardinal sin. Released in 1986, a historical time in which high school exploitation films swept the nation, Lloyd Kaufman’s brainchild is set apart by its meaningful message hidden by the outlandishly lavish chaos that erupts on screen. Placing hot coals to the feet of the American educational system was the goal since inception, and much of the reason why Kaufman called for a reboot of the franchise in 2013 with Return to Nuke ‘Em High: Volume 1 (2013). Doused heavily enough in biting social commentary to warrant two films, Return to Return to Nuke ‘Em High: Volume 2 (2017) is set to premiere in Calgary at The Globe on September 9. “Young people are the people that change the world and they’re usually in high school, so I’m fascinated with that age group. Its the most interesting and certainly, in my opinion, the most important... and they’re the people that want to make the world a better place,” explains Kaufman of his favored age group to represent on film. “When it comes to issues like toxic nuclear waste from back in 1983, I didn’t think it made sense to appeal to middle aged, bourgeois people. I wanted to appeal to young punks who might actually learn something from this very entertaining movie called The Toxic Avenger (1984)... and indeed, The Toxic Avenger has been a huge influence on everybody from the directors of Deadpool (2016) to the Environmental Protection Agency (EPA). The EPA in both Canada and the US have used Toxic Avenger as a way to appeal to young people.” Kaufman says social commentary is deeply and intentionally embedded throughout his filmography, and the Nuke ‘Em High series is no different. “Class of Nuke ‘Em High is all about high schools and there’s lots of themes therein, especially in the United States where the junk food is being foisted on the high school students... We know about the bullying, we know about the fact that they learn nothing in the American educational system and that’s kind of what we’re dealing with here. It’s the satirical view of the horrors of the American educational system, and that is exactly the reason that we had this unpleasantness in Charlottesville, Virginia.” Sadness envelops his voice. “We’ve let the American educational system deteriorate... So that is kind of what interests me -- get young American people to realize that they’ve been totally fucked over.” Much of this message is overshadowed by Troma Film’s notoriety for bizarre scenes and cartoonish gore, making censorship a regularly faced issue. “Serious blood, guts, dismemberment... Die Hard, that’s okay – but the Troma goofy cartoon violence is not okay... This is a thing called fascism, when they apply different rules to the elite and other rules for you. It’s fascism, and it’s on the rise in your country and mine.” Social issues aside, Return to Return to Nuke ‘Em High: Volume 2 is promised to continue and upscale the madness propagated in the first volume. Sure to pique the interest of Motörhead-bangers everywhere, Lemmy Kilmister returns as the President. “We dedicated the movie to Lemmy and to Joe Fleishaker, who was our 500 pound action star.” Fleishaker was a regular fixture in the Troma film universe, appearing in such films as Zombiegeddon (2003), Tromeo and Juliet (1996), and the second and third renditions of The Toxic Avenger. Both figures passed away within six months of each other. In summation, if one were to look past the giant penis monsters and slimy green ooze dripping from every orifice in the Nuke ‘Em High films, a couple things become clear – We are the youth of today, and Lloyd Kaufman wants us to pay attention so we pave the way for our tomorrow. Catch Return To Nuke ‘Em High: Volume 2 at The Globe Cinema September 9 (Calgary). 18 | SEPTEMBER 2017 • BEATROUTE FILM Alien Convenant Baywatch Guardians of the Galaxy Vol. 2 Okja Snatched FILM ALIEN COVENANT The key to colonizing a new planet is bringing enough weapons to subjugate the current inhabitants. Unfortunately, the colonists in this sci-fi thriller only brought American flags. When a settlement ship on its way to its new home world breaks down, the onboard android (Michael Fassbender) wakes the crew (Katherine Waterston, Billy Crudup, Danny McBride) from stasis so they can mend the ship on a nearby planet. Luckily, that planet is home to a lost crewmember of an earlier Earth expedition. Unluckily, it’s infested with body-imbedding aliens created by the previous party’s experiments with locale DNA. Although this sequel to Prometheus finds director Ridley Scott returning to his horror roots, this Alien prequel resembles too many other entries in the anthology to be revolutionary. This is particularly true when it comes to the heroine. Besides, if mankind wanted to create new life it would just legalize marriage with space bacteria. BAYWATCH The most important thing to remember when lifeguarding is to not rely on dolphins to save everyone. Thankfully, the lifeguards in this comedy are keeping the beach safe themselves. When esteemed lifeguard Mitch (Dwayne Johnson) is forced to add hotshot Olympian Brody (Zac Efron) to his summer roster, he shows his distain by training the cocksure rookie himself. After enduring Mitch’s grueling feats of strength, Brody is filled in on the Baywatch team’s (Alexandra Daddario, Kelly Rohrbach) extracurricular activity: surveilling a suspected drug smuggler (Priyanka Chopra). A raunchier version of the already exploitive television series, this poorly written feature film adaptation brings the show’s best assets to the forefront, but at the expensive of a decent story and capable acting. Terrible T&A humour aside, this quasi-tribute plays more like an insult to the show and its fans. Incidentally, the only explosions lifeguards see are the beached whale kind. BORN IN CHINA Girls born in China know that they will grow up in a safe, white American suburb. Unfortunately, as this documentary verifies, the same doesn’t apply to every female species in China. A single-mother snow leopard struggles to find nourishment for her young in China’s merciless mountain region. Meanwhile in the jungle, the birth of a female golden snub-nosed monkey forces a neglected male to venture out on his own. Also leaving the nest is a giant panda whose mother is having a hard time letting her go. Narrated by John Krasinski, Disney’s latest nature documentary once again does an excellent job of capturing rare fauna in their native environments. Unfortunately, like the others in the eco-series, this maternal endeavour is also heavily edited to fit a desired narrative while the animals are given human characteristics. By making the pandas human, however, just makes eating ginger beef that much more difficult. THE CIRCLE The downside to working for an innovative tech company is being the first killed by sentient machines. Luckily, the gadgets in this thriller are not nearly as nefarious as their creators. As the newest hire at tech giant, The Circle, Mae (Emma Watson) makes quite the impression on the company’s co-founders (Tom Hanks, Patton Oswalt) by becoming a lab rat for their latest spycam technology. Being online all the time, however, takes its toll on Mae, her family (Bill Paxton, Glenne Headly) and her friends (Karen Gillan, Ellar Coltrane), as each of their lives are also televised for public consumption. While it is a timely piece on the loss of privacy, the power of online mob mentality and the digitization of our data, this paranoid Orwellian analogy is tactlessly encrypted with bad acting, outdated discoveries and stock villains. Moreover, facial recognition cameras can’t find you if you’re wearing a Burqa. GOING IN STYLE The most stylish way for an old man to depart this world is in a pinstriped zoot suit. The chaps in this comedy, however, chose to wear Halloween masks instead. After losing his house and pension to the bank, Joe (Michael Caine) must find a way to support his granddaughter (Joey King), so he proposes that he and his friends (Morgan Freeman, Alan Arkin) rob the aforementioned bank. With help from some neighbourhood crooks, the trio gleans enough knowledge to stage a successful stickup, but not enough to evade the FBI (Matt Dillon). A tepid remake of the 1979 heist spoof starring George Burns, this Zach Braff-directed ensemble does have some outstanding chemistry between its elderly leads, but little in the way of big laughs. The sappy script and predictable outcome don’t help either. Besides, retirees would have more money if they’d stopped giving out their credit card numbers. GUARDIANS OF THE GALAXY VOL. 2 The worst thing about summer in space is that all the garage sales just float away. Fortunately, the starship in this sci-fi adventure has found a planet able to regulate its own gravity. When Rocket (Bradley Cooper) pockets a powerful battery, the alien race he stole it from hires Yondu (Michael Rooker) to bring it and the Guardians of the Galaxy – Star-Lord (Chris Pratt), Gamora (Zoe Saldana), Drax (Dave Bautista), Baby Groot (Vin Diesel) – back to them. While his surrogate father stalks him, Star-Lord’s real father Ego (Kurt Russell) offers him and his crew asylum on a sentient planet. A surprisingly emotional sequel to the 2014 sleeper hit, this complex follow-up focuses on the fluidity of fatherhood and the burden of loss. Thankfully, it also amps up the action and layers on the laughs. Incidentally, if planet Earth was sentient then she could tell us where to drill for oil. THE VIDIOT rewind to the future by Shane Sellar HOW TO BE A LATIN LOVER To be a successful Latin lover you must consummate your sham marriage in 90-days or be deported. Smartly, the lothario in this comedy has sex in the first 90 minutes. Securing a sugar mama at the old of 21, Maximo (Eugenio Derbez) has spent the last 25 years leeching off his wealthy, older wife. But that all changed when she left him for a younger model (Michael Cera). Single for the first time in ages and living with his estranged sister (Salma Hayek) and her son, who is training to be a Latin lover, Maximo seeks help from a fellow gigolo (Rob Lowe). With a plethora of Hollywood cameos to compensate for its unknown lead, those brief star-studded appearances are the only highlight in this predictable comedy’s endless parade of sexist, racist and humorless jokes. Incidentally, sex with a senior citizen is actually a threesome with the Grim Reaper. OKJA When the world runs out of food the starving masses will have no choice but to eat at Arby’s. Thankfully, the scientists in this fantasy are devising new food sources. A greedy CEO (Tilda Swinton) creates and disperses a race of super-pigs across the globe that she hopes will someday feed the multitudes and make her millions. Ten years later, Okja, the super-sized swine adopted by a South Korean girl (Ahn Seo-hyun), grabs headlines when she becomes embroiled in a battle between the company’s crazed zoologist (Jake Gyllenhaal) and animal rights activists (Paul Dano, Lily Collins) trying to liberate her from slaughter. An eclectic parable of the meat industry marinated in oddball performances, this quirky Korean import pads its vegetarian agenda with twee moments between pig and owner that are brutally punctuated by the grim reality of the food chain. Besides, wouldn’t it just be easier to start eating CEOs? SNATCHED The upside to vacationing with your parents is that they wake early enough to get good poolside loungers. Nonetheless, the party girl in this comedy tried her hardest to find anyone else to take. Stuck with an extra ticket to Ecuador after her boyfriend dumps her, recently unemployed Emily (Amy Schumer) has no other option but to offer it to her overly mistrusting mother (Goldie Hawn). Their retreat takes a turn for the worse when they’re kidnapped by a crime lord (Óscar Jaenada) and accidentally kill his nephew. On the run, they must make it to the US consulate before he catches them. With scant character development between the bickering mother and daughter duo before, during, and after their experience, this poorly structured romp relies too heavily on its humorous leads to offset its lack of story. Fortunately, when you travel with family there’s always someone to identify your body. He’s a Tornado Alley Cat. He’s the… Vidiot BEATROUTE • SEPTEMBER 2017 | 19 ROCKPILE COMEBACK KID heavy as hell and holding steady by Jodi Brak Winnipeg hardcore veterans drop their new album on September 8. From their humble beginnings as a side project through their rise to one of the biggest bands in Canadian hardcore, Comeback Kid has rolled with the punches like the best of them. They embody an aggressive style in their music that, much like the group itself, presses forward with a furious momentum. “Hardcore music is something that took me on a path in life that I would never have gone on without this certain genre of music, I’m still inspired by it,” says vocalist Andrew Neufeld. “I think the aggression and the tempos are just a healthy release. To get some of that stuff out, some of those feelings you couldn’t get out any other way.” Beginning as a side project by Neufeld and fellow Figure Four member Jeremy Hiebert, Comeback Kid quickly found traction after their 2003 debut Turn it Around, and began touring full time. It wasn’t long before they had broken through their home turf in Winnipeg and were embarking on coast-to-coast North American tours, then beyond. Now closing in on 20 years as a band, Comeback Kid has become iconic, built upon musicianship and dedication. It’s seen them grow from the community centre, all-ages scene to international headliners. Powerful drums and heavy, high-strung guitar riffs are front and centre to their sound, setting the pace for ferocious vocals that cut through the cacophony. Melodic leads rise through the distortion, adding a sense of sonic emotion to supplement the meaningful lyrics. The consistency of their sound has been impressive, and their seventh studio album Outsider ROCKPILE shows that they remain as focused as ever. It’s their fifth album featuring Neufeld as lead vocalist. His original role as co-founder was guitar; Scott Wade provided vocals. Wade then departed in 2006, which shook the band for but a brief moment, but hardly caused a hiccup in their touring schedule. “We were in between an Australian and American end of a tour when he told me, so I had some time to think about it. Actually we organized for him to do his last show, and then get dropped off, and then the guy who dropped him off drove the other guy up from Minneapolis to play guitar so I could sing,” Neufeld recalls. “Obviously in the beginning taking his style and trying to do the songs sort of like him was hard. But slowly we just kind of merged that into where we are today.” Their 2007 release, Broadcasting was the first Comeback Kid album entirely featuring Neufeld on vocals. “We just really have kind of rolled with the punches,” Neufeld says. “Me and Jeremy [Hiebert, lead guitarist], two original members, we’ve been with each other through thick and thin, we’ve also had a lot of really great members who have contributed quite a bit of their lives to this project. And we’re just able to somehow keep it going, and it always works out. Right now we feel pretty over the moon about the new record and the new tour we have lined up. And it’s never any bad blood with anybody… our old singer Scott is at our house right now.” That new record is Outsider. Featuring 13 tracks of fast and furiously melodic hardcore music, the music only slows down to catch its breath before launching into another intense salvo. From the first self-titled track, it digs in and continually gains momentum with a string of heavy rippers one after another. For the most part, the album keeps up the hard and heavy pace for the entire record. Around the halfway point there is a bit of a change in tone; it’s still aggressive, but somehow on a lighter note. Towards the end of the album the music feels almost reflective, with a more somber track “Moment in Time” (featuring Northcote) to close it all off. “I think we’re writing more complete songs.” Neufeld says of the new album. “We just tried to be a little more up front on this record with our themes and really make the features of each song actually be features and not sometimes letting those things slide.” One track in particular, “Consumed the Vision” (which features Chris Cresswell from The Flatliners on guest vocals) stands out as one of the small handful of songs Comeback Kid has written that uses major-key notes to create a lighter feel. Rest assured, though, the song is just as heavy as the rest of the album. Neufeld says, “I just think it creates a different mood, and that definitely separates itself. With that song, I think it was kind of directly in response to everything we were writing that week. I remember Jeremy (lead guitar) and Stu (Ross, rhythm guitar) had all these fast songs with double picking, just fast riffs and heavy drums. I like that kind of stuff and that definitely always has a part on Comeback Kid records, but I kind of wanted to write something lighter in mood.” After the September 8 release, Comeback Kid hits the road from coast to coast across Canada and the U.S.A. After that, they’ll hop across the pond for a European leg of the tour. Outsider is another milestone in a storied career. Looking back on what Comeback Kid has become, what has been made of the blood, sweat and tears of many dedicated musicians, Neufeld can’t help but reflect on how the band evolved to become more than simply the sum of its parts. “I mean honestly it’s a dream come true for us. When we were kids this is what we wanted to do, and we were able to fulfill that. We were able to play in places we never thought we would go and stay busy as a band for this long and that’s all we ever wanted,” Neufeld says. “Comeback Kid is bigger than us, and that’s crazy to think about. We’re kind of just along for the ride and hopefully we can stay on this train for a while because we really enjoy it.” Comeback Kid plays the Park Theatre on September 26 (Winnipeg), The Exchange on Septeber 27 (Regina), The Needle Vinyl Tavern on September 28 (Edmonton) and The Gateway September 30 (Calgary). Outsider comes out via New Damage Records on September 8. BEATROUTE • SEPTEMBER 2017 | 21 YES days of future past There are few things progressive rock and roll pioneer Gary Downes hasn’t attempted in his storied career. As the sole member of the legendary band Yes to possess a musical degree, his expertise on the keyboards has opened the doors (or gates of delirium, if you will) to some remarkable adventures. Opportunities that the innovative synth-player has embraced time and again, as further evidenced by his work with The Buggles and Asia. “I look at all of the different bands I’ve been in as books, or films, really,” begins Downes. “I think that certain events happen throughout a band’s history. Talking about Yes, it’s an amazing series of chapters that have happened over the years. And I think that every musician has contributed at some stage when they’ve come into the band. I consider myself to be present in a few chapters of the band at least, which is nice.” Taking a page from his own book of life, Downes’ current collaboration with Yes members; singer Jon Davison, guitarist Steve Howe, drummer Alan White and bassist Billy Sherwood, is focused on bringing that joy of discovery to a new demographic of prog-rock listeners. And, when it comes to condensing the band’s half-century run of 21 albums into a single concert event, Downes’ is definitely a fan of the divide and conquer approach. “On this particular tour we’re doing a chronological review of the first 10 albums, plus some extra tracks. And it’s been very successful in terms of the fans getting to hear a couple of cuts they’ve never heard before. We put it together like that in a way that’s interesting from a musicology standpoint in that you see how the band progressed and how the influences moved on. By connecting one song from each album to the next, you see the progression of the group through the years.” Appreciation for Yes’s time-dissolving long-distance opuses has gained an almost religious quality over the decades, as their popularity has grown despite a persistent disregard for the commercial viability of 10-minute long songs. Given the cult of followers who have embraced the group’s attention surplus disorder, Downes’ hasn’t really moved that far from his roots as the son of a church organist and choirmaster in Stockport, England. NEW PORNOGRAPHERS life imitates art “You make a record and then you have to learn how to play it!”. Celebrating five decades of music with an uplifted spiritual outlook. “The music is quite dynamic, and at times dark in parts, but the end result when you listen to Yes music is one of an uplifted spiritual outlook. The name of the band is positivity. I’ve come across a lot of young musicians like Taylor Hawkins of Foo Fighters who’ve decided Yes is one of their favourite bands of all time. “So, you can tell that the music isn’t just the domain of progressive rock fans, it’s spread right across a number of generations and genres.” He laughs knowingly at the mention of fellow progressive groundbreakers Rush. “When Yes was getting inducted this year at the Rock and Roll Hall of Fame, the presenters were Alex and Geddy from Rush. They both said that they were hugely influenced by Yes from the very beginning. There are whole eras of different bands and styles of music by Christine Leonard photo: Glenn Gottlieb that appreciated what Yes has had to offer over the years. And I think a lot of that comes down to the individual musicianship being to the fore, as well as composition. You could probably say that we’re the ultimate modern-day musician’s band.” A bonafide musicians’ musician himself, Downes was reputedly entered into the Guinness Book of World Records for the most keyboards played in a live performance That’s a record only one with his prowess at tickling the ivories and pushing the envelope of music can hope to achieve. Catch Yes in performance with Todd Rundgren at the Queen Elizabeth Theatre September 5 (Vancouver), the Northern Alberta Jubilee Auditorium on September 7 (Edmonton) and the Southern Alberta Jubilee Auditorium on September 8 (Calgary). by Christine Leonard MacEwan Hall in Calgary on Monday, Oct. 2, then Winspear Centre in Edmonton on Wednesday, Oct. 4 and at Burton Cummings Theatre on Saturday, Oct. 7. 22 | SEPTEMBER 2017 • BEATROUTE ROCKPILE ROCKPILE BEATROUTE • AUGUST 2017 | 23 THE MAD CADDIES hustling horns on the Prairies California Ska punks The Mad Caddies tease new self-produced album. The Mad Caddies have been tooting their ska horns over the world since their inception in 1995. The Caddies’ sound is a feast for the ears; it’s thirdwave ska influenced by their punk predecessors with dominating guitar riffs. Infused with a mix of reggae and calypso beats, the band tops it off with jazzy horns and heavier vocals on a pop-backbone. Combining these styles gave The Caddies their own brand of madness, which they’ve maintained and delivered across numerous releases and tours worldwide. The Mad Caddies’ last album, Dirty Rice, was released in 2014 and although new music is in the works, the guys are keeping the details tightly under wraps. Vocalist and guitarist Chuck Robertson, who helped form the band while in high school, reveals what he can. “We are recording it on our own, we love our family at Fat [Wreck Chords] but have decided to try something different this time around. Todd [Rosenberg, drums] handles a lot of the by Sarah Mac production aspect, and we’ve recently built a studio in our hometown in the Santa Ynez Valley in California.” This may come as a surprise to some since The Caddies have released all their records, except for their debut, on Fat Wreck Chords. “As for musical style, we think our fans will be very pleased! We’re experimenting with some new sounds, but it’s definitely still very Caddies-esque. The creative process is still what we love about our jobs. And it’s been pretty collaborative the past few years. One of us may have an idea, sometimes complete, sometimes in the early stages and we’ll finish and arrange it together as a band.” But, as for the release date, “it’s sort of a surprise.” Robertson adds. Fortunately for us Albertans, we’ve been graced with a second set of shows from The Caddies; the first set was during a small tour in July with the Offspring. “Well, The Offspring tour came up last minute and we were happy to be a part of it,” says Robertson, the concludes, “But we’ve always felt a strong connection with our Canadian fans. So, we love heading up North for shows. Plus, we are all still really good friends. So, it’s fun to get out on the road together whenever we can.” Don’t miss The Mad Caddies at The Needle Vinyl Tavern on September 14 (Edmonton) and at Dicken’s Pub on September 15 (Calgary). THE VOODOO GLOW SKULLS packing in the California street music This past summer, the news coming from the camp of legendary ska-core band The Voodoo Glow Skulls was hard to swallow. But first, some context. Hailing from Riverside, California and formed by brothers Frank, Eddie and Jorge Casillas in ‘88, The Voodoo Glow Skulls combine the elements of ska with traditional punk and hardcore style, and douse it with Mexican flare and rhythm; they’ve released nine full-length albums, around a half-dozen EPs and have contributed to well over 30 different compilations. The Glow Skulls’ rowdy and rambunctious feel, alongside blazing horns and bi-lingual lyrics, have hooked a legion of fans and given them a distinctive sound that couldn’t be matched. Recently though, the Glow Skulls have fallen on hard times. This past June, lead singer and eldest brother Frank unexpectedly announced that he was leaving the band, leaving the remaining Glow Skulls shocked and shaken. Heartbroken, we chatted with Eddie to discuss the future. “In hindsight, we might have seen it coming over the course of a few years, but it wasn’t so clear or evident. Really, this has a lot to do with personal family business rather than the band not getting along, there’s a lot more to it that I won’t get into. But, he [Frank] moved away, to Arizona, about 15 years or so ago and that was the beginning of him distancing himself from the band. It took a while for things to really change, but apparently, they did. So, it’s still shocking.” Pausing for a moment, he resumes. “And now, we’re about to do a full tour without our older brother and lead singer of the band. So, it’s an uphill battle and it’s hard. When you’re used to one guy being the front man and he’s not there and worse, he’s not coming - it’s weird. So, we’re in a weird place, but we’re working our way through it and we’re still thinking positive. So, we just want to play well and make it a rad show; hopefully people will respect that.” There’s a deep appreciation for the members of the Glow Skulls who are continuing this tour for their fans. Efrem Martinez Shulz of Manic Hispanic and Death By Stereo fame has stepped up to front the Glow Skulls for their upcoming tour. “He’s a hardcore singer in a great band of his own. So, we’re just glad he can tour, he can help us save face and not cancel on our fans, which is the most important thing. And also, not cancel on us. But, he isn’t a permeant member of the band.” Solemnly, Casillas continues, “we’ve had a career for 29 years now and we’re not sure if we want to stop, but we want the option. But, to be fair with you, we’re really close to not doing this again and we might just stop. It’s hard, but we’re trying not to bum anyone out and fulfill these commitments to our fans.” He pauses, and continues. “The fact that I still get to go on stage and perform these songs I wrote over the last almost 30 years, that’s a big deal and I wouldn’t take it for granted. Because it’s all about the band and all about the music, we’re gonna be at these shows with a band that’s still functioning 100 per cent. And we’re not taking it lightly. We’re practicing more than ever, which makes us tighter than ever.” So, come ‘on Canada, let’s do Voodoo (hopefully not) one last time. Come celebrate 29 years of music with the Voodoo Glow Skulls at the Windsor Tavern on September 20 (Winnipeg), at the Exchange on September 21 (Regina), at Dicken’s Pub on September 22 (Calgary), at the Needle Vinyl Tavern on September 23 (Edmonton), and at the International Beer Haus on September 24 (Red Deer). Wherein we hear sombre news from the long-running ska band. by Sarah Mac 24 | SEPTEMBER 2017 • BEATROUTE ROCKPILE A-BOMB an explosive break-out A-Bomb’s debut Break Through The Static is unleashed September 1. A-Bomb has come crashing into Calgary, rising in the ranks of the local music scene over the past two years since the band first performance on fateful night at Tubby Dog. After the release of several online singles, A-Bomb has compiled their debut EP, Break through the Static. MISTER & MYSTIC philosophers in love When sitting down with Kat Westermann and Matthew Spreen, two key members of Calgary’s psych-rock outfit The Heirlooms, you’lll quickly find a refreshing outlook towards music. As the duo expounded upon their future goals, it’s clear a big part of this vision came to be in their new project Mister & Mystic, a romantic indie rock vision by two philosophers deeply in love. Westermann and Spreen are on the brink of releasing their debut self-titled EP, which was recorded in Vancouver at Blue Light Studios with producer Kaj Falch-Neilson. The album opens with an upbeat, percussion-filled rendition of “Walk Me Home,” which incorporates Spreen’s loop pedal for the multiple guitar layers. In the second track, “All the Way,” Kat sings “I missed you before I met you…” She admits the song is unabashadely “directly [about] Matt.” One notable characteristic of this YYC duo is their personal bond. It reaches all the way from their romantic and musical partnership, to their philosophical beliefs, to everything in-between. You can even see it in their perpetually fresh wardrobe and naturally abounding kindness. In the aforementioned track, Westermann captures the sentiment of “missing something… Where you know what it’s going to feel like, but you don’t quite have it yet… Then you finally get it and it’s a thousand times better than you would have thought.” So what is the big plan for the record and the couple? “Album release September 8. Wedding September 9.” Simple enough! Their album follows the same vein: something simple and sweet with a vibrant authenticity. Some reoccurring themes woven into their mystical tapestry are hints of desolation after a collapse. Don’t worry, Spreen can explain. “There’s this lingering thing in society involving apocalyptic expectations, and people kind of feel anxious, and maybe that’s a bit far, but we are living in a city where the main industry has collapsed.” Westermann happens to indulge this dark fantasy in their track “Caves In,” as ROCKPILE photo: Trevor Hatter The band itself is named after the raunchy hot dog combo of chips, cheese sauce, and ketchup, and the three-piece band is living up to their name with explosive synergy, edgy ballads, and classic rock ‘n’ roll attitude. Lead vocalist and guitarist Faith Schadlich has by Kaeleigh Phillips stellar vocal range, and is reminiscent of the great Lita Ford who rose to stardom in the ‘80s hair metal scene, along with Canadian female-led bands Diemonds and The Pack A.D. With newest addition Jenny Brisebois on the bass and Nicole Niewinski on drums, A-Bomb makes for an all-force, no-fluff power trio, and their four-track EP is a tightly wound and energetic example of great music arising from the ashes of the hair metal scene. “We got a free recording with [celebrated local musician] Lorrie Matheson and found we wanted to record more, so we decided to do the EP,” Schadlich says. Each member of the trio has a different favourite song, with Schadlich preferring “Rocker Roller” due to its stylistic integrity as a classic ‘70s inspired tune. Brisebois is a fan of “Queen of the Night” because of the sing-along ballads in the song, and Niewinski loves “Breaking through the Static” because it is fun to play. When the band is taking a break from rocking on stage, they can be found “drinking cold ones with the boys” according to Brisebois. These rock-n-roll women are excited to release their EP on September 1 and are passionate about their future in the Alberta music scene. “ You are jamming on stage with your friends and you meet people with a similar interest who love your shows. It is a love of playing and sharing my music,” Schadlich says of the Calgary experience. “I get to live my dream.” A-Bomb releases Break Through The Static at The Palomino Smokehouse & Bar on September 1 (Calgary) with support from Electric Revival and Dane. Check them out online at Mister & Mystic is finding harmony in all avenues of life. by Taylor Odishaw-Dyck photo: Kevin Kirkpatrick she sings “I love you when the world caves in.” There are eight tracks on the short album, although one of these is a brief spoken word interlude, which contains thought-provoking poetry laden with heavy vocal effects. Additional instrumentation on the album was provided by two studio musicians, including Peter Robinson on percussion and Brian Chan on cello. The recording took two days, which was a pleasant surprise, because that lined up perfectly with their budget. They had nothing but good to say about Falch-Neilson, who struck a balance between assertive and flexible production. For Westermann and Spreen, this release is the next step towards making their music more intimate both for their audience and for each other. Catch Mister & Mystic’s EP release as a part of We Are The Wind - A Soaring Eagles Record Showcase alongside Todd Stewart, Jason Famous & Le Fame, and Sinzere. The show takes place at Festival Hall September 8 (Calgary). BEATROUTE • SEPTEMBER 2017 | 25 2/3 OF NOTHING please enjoy responsibly! 2/3 of Nothing celebrate the release of The High Cost of Low Living. Hindsight maybe 20/20, but that doesn’t mean you don’t gain a lot of clarity by going through that shit the first time around. For Calgary-based hardcore rock outfit 2/3 of Nothing the gravelly road to rock ‘n’ roll notoriety represented a tough age for the band who spent four years slogging it out in the pit before hanging up their gloves. “Back in 1997, the jam space smelled like beer, cigarettes and pee. We didn’t take ourselves or our music seriously. It was more about hanging out and having an excuse to party. All of the songs were written under the influence so they could be played under the influence,” confirms guitarist Mike Davies. That pattern of self-immolation started to take its toll and Davies was ready to take a step back from the proverbial canvas at that point. And he wasn’t alone. “With so many conflicting drugs-of-choice, ego being one of them, infighting and addiction shortened the life of the band and we broke up in 2001,” fellow founding guitarist Trevor Lagler explains. “Fast-forward to 2015, with several years of recovery under our belts, and Davies and I rekindled our friendship, which inevitably lead to a discussion about putting the band back together. We wanted to go into the studio and record our lost songs.” Recovery is a loaded term for 2/3 of Nothing, as the group may have distanced themselves from those negative habits and attitudes, but the goal of writing and performing riveting punk and metal-tinged tunes continues to be a shared obsession. Salvaging their friendships was the easiest part of the equation, according to Lagler; he credits the band’s comradery and willingness to laugh at themselves as being essential to the process of going back to the drawing board and drafting the plans for the future. Fortunately, the passage of time had not diminished their instrumental or songwriting talents, and only served to amplify them. “Dave (Countryman) is one of the most solid and under-rated bassists playing in the local scene,” confirms Lagler. “He and Mike Davies go all the way back to the mid-80s; they co-wrote and arranged all of the band’s by Christine Leonard original songs. Mike is considered to be one of the best punk rock guitar players in Calgary and his level of experience, sense of humor, and personality help to keep things in the band light, and fun, which is one of the main focuses of this project.” With that promise of keeping things pleasant and clearheaded, Lagler and Davies had little trouble roping Countryman and (recently retired) drummer Rich Johnson into their idea for a proper 2/3 of Nothing reunion. “When the four of us got back together we discovered a different energy and perspective,” recalls Countryman. “We were playing together again because we love each other and we enjoy playing as a band. Total 180-degree turn. This time we had an opportunity to grow the music as a brand and put some pride into it. We’re now coming from a place of humility, and just having fun. This album, we’ve created together, is called The High Cost of Low Living. It’s a historical record of the band and it is everything that has come before, with our new perspective stamped on it.” There’s nothing more empowering that an unclouded mind and a fresh mouth. For these Calgary rock vets that’s just two thirds of the big picture. “My lyrics range from taking the piss out of everyday mundane situations (from a very tongue and cheek perspective), to the more serious subject like life and addiction. Basically, we have serious songs and seriously silly songs. It’s all about maintaining balance,” says Lagler. “Recording this album means finally tying up loose ends that are decades old. We are intensely proud of this accomplishment, because this was the reason we got back together. People can expect us to be loud, tight, make jokes at our own expense and play some kick-ass punk rock ‘n’ roll music!” 2/3 of Nothing celebrate their album release with headliners Gaytheist and Solid Brown at The Palomino Smokehouse & Bar on September 16 (Calgary). You can listen to the record online at MAMMOTH GROVE street hearts hits the bricks September’s back-to-school regime is a questionably welcome event, but for Calgary students-of-life Mammoth Grove the requisite first essay question of ‘How I spent my summer vacation?’ is one worth crowing about. While others spent their dog days mowing lawns and painting fences, Mammoth Grove has been growing its fuzzy beard, working on its psychedelic moontan and observing the migratory behaviour of the Cowtown concertgoer. “In my experience music has been one of the most consistent, most enjoyable, most beneficial ways to make a living,” extolls lead singer-guitarist Devan Forrester of his summer employment of choice. “I have a pretty hard time sticking through things I don’t care about, don’t believe in and don’t want to be a part of, which how I’ve felt about most jobs in the past. So music has been great, especially recently I’ve been jamming a lot. I’ve been downtown playing gigs, solo shows, open mics and just being out there and it’s working really well.” Catching the waves of humanity that wash across the core throughout July and August, Forrester (who also performs solo under the name Silver Moss) has had ample opportunity to exercise his mind, polish his craft and gain a more fulsome understanding of the relationship between performer and audience. “I was out a lot for Stampede which is great, of course. Happy, smiley, drunk people everywhere. I was playing outside of the gates of the [Calgary International] Blues Festival as everyone filtered out and middle-aged crowd was having a lot of fun. I’ve never been offered more joints, roaches, doobies, piece of hash, one-hitters. Mom and Dad like to have a good time out! On the train ride home afterwards I had the entire car singing along to “I Won’t Back Down” on the Green Line. What can I say? Tom Petty’s been a gold nugget for me.” Sure he gets plenty of requests for CCR, Neil Young and Steve Miller, but it’s Petty who’s illuminated Forrester’s quest for authenticity and Sidewalk citizen. Mammoth Grove takes it to the street. by Christine Leonard self-awareness. By his estimation, it’s not just looking the part and delivering the goods, but bridging the gap between generations while exuding a signature sound that is entirely unique. “I play very few covers, I don’t really know many at all,” explains Forrester. “Right now the point of busking for me is to try out all these new songs I’ve been writing. And I’ve been writing lots! Mammoth Grove has this massive back catalog that we want to record and do stuff with, but we’re just kind of relaxing right now. After we went toured out to B.C. in May we figured let’s do our own things and enjoy the summer by soaking it up on the coast and playing on the streets back home.” Although this post-tour summer hiatus has been the longest of their collaboration, Mammoth Grove has been busily cultivating all of the elements necessary to flourish throughout the dark, cold winter months. Bound with wood, wire and an unquenchable thirst for beauty, Forrester’s methods and approach have only grown stronger thanks to weeks spent pounding the pavement during his 21st century troubadour bootcamp. “The biggest thing for me was just getting over that initial fear of busking. I was scared and I was nervous, but now I’m really into being able to rely on my voice and a guitar. Mammoth Grove is always electric, but this summer I’ve been really only playing acoustic, because it’s lighter to carry around. So, that definitely changes the sound and dynamic and everything about it. I’m really focusing on simple songwriting. I’ve noticed while busking that people connect with your voice way more than your guitar. I’ve been working on my vocal technique and range and it feels great to be confident in just what I am right here and now. ‘Blam!’ Until recently I felt like I had to be the singer, now I feel like I get to be.” Mammoth Grove performs with Yawning Man and Alex Perrez & The Rising Tide at The Palomino Smokehouse & Bar on September 21 (Calgary). 26 | SEPTEMBER 2017 • BEATROUTE ROCKPILE BODY-BODY bring on the dance floor bangers! by B. Simm LOOSE ENDS what’s happening around Calgary in September by Jodi Brak photo: Arif Ansari The Menzingers hit Marquee Beer Market & Stage on October 3. photo: Charles Wrzesniewski After three decades in the business of making conceptual punk, Kamil Krulis is no stranger, and certainly no wallflower, when it comes to reivention and making a statement. In his newest project he’s rechristened himself DJkkay and teamed up with an electro-beat specialist, Antoine, to produce a new dance floor (in the works) sensation called Body-Body. What’s the concept, what’s the statement? Well, as always, it’s a pleasure sparing with good ole KK and not too difficult for him to simply lay it on the line, or rather, the dance floor. Briefly, what’s the concept behind your new project? Basing a dance group on the Italo drive sound of the early ‘80s and deconstructing it. There’s definitely a lot of overt sexual referencing. Let’s start with the track “I Want Your Body”, which has the unlikely combination of Rod Stewart’s “Do You Think I’m Sexy” and Olivia Newton John’s “Let’s Get Physical” dubbed in with some slo-mo, German robotic techno. There’s no real mincing of words here with a line like, “I want your body”. A rather blunt come on, don’t you think? Well, in reality that song is the beginning of working with the Italo bass sound. How Antoine works it warps genres. I was interested in simple anthemic lyrics, as if English was my second language. Oh wait, English is my second language! But the pleasure of hedonism is a call to hit the dance floor. “Maschine” another sexified track. What are you talking about when you say, “When you turn me on, I’ll turn you on”? One of those extended mechanical devices with a dildo attached to it seen in porn videos, a fuck machine? Or is the person here a sexual machine themself, a get-up-stay-on-the-scene sort of character? Haha! Is it man-made? Is it human? In Body-Body we are living in a Phillip K. Dickian future. “Sexbooth”, interesting title. Do you remember the Orgasmatron in Woody Allen’s Sleeper from the early ‘70s? A sci-fi sex capsule that someone steps into for climatic pleasure. Is that what the sexbooth here is about? Oooooh Brad. “Sexbooth” is about what is affectionately known as booth number one at Pizza Bob’s, the one you might have passed out in. It has been the subject of a number of rumoured make-out scenes over the passage of time. The track itself is another hedonistic dance floor banger. For the record, it’s booth number three at Bob’s I had a “little nap” in on one occasion. Back to the Body- Body EP. This is a six-song recording that starts out with the suggestive “Get Down On The Beat” and ends with the kiss-off “You Don’t Know Me”. A journey, an adventure seems to take place during the songs in between. Is this some story about a sexual romp? It seems all very promiscuous, a lot of body, body and very little soul going, which perhaps is the idea. While lust and sex are the dominating themes, there’s an alienating undertow. A big part of the conceptual aspect of Body-Body is to reinvent a time when Reagan was president and nuclear war truly a fear with the zeitgeist, not unlike Trump now. So perhaps the journey is one where pleasure and the bacchanalian coincide on the dance floor with the regular mundaneness of being alive in a meaningless middle-class world. The dance floor is the ultimate other-world escape. Who’s the master programmer working the keyboards and computer? Who’s the other Body? And where do you draw your inspiration for this kind of get your electro-pop groove on? Just Italo disco? Antoine is the other Body. He is heavy into hip-hop beats. He is both a savant and very knowledgeable, so I think there is that element. I made him figure out the Italo drive, ha! One of my stipulations was that it had to sound pre-house Chicago. I think it’s working. body-body is having a tape “dance-floor” release party Saturday, Sept. 30 at Local 510. ROCKPILE THE MENZINGERS Marquee Beer Market & Stage, October 3 Armed with music that looks into the depths of sadness and cynicism to pull out something positive, The Menzingers are a group of Pennsylvania punk rockers who understand that inspiration can be found in the face of darkness. Their music is highly melodic and surprisingly progressive, swinging back and forth between clean, lightly picked chords and heavy, high-gain crescendos. Top it off with a witty, irreverent sort of poetry to their lyricism and you have songs that will loop endlessly in your head for weeks. STATE CHAMPS Marquee Beer Market & Stage, September 23 These guys most assuredly bring the pop to pop-punk. Hailing from New York, State Champs songs always seem to fall on a lighter note – at least musically. With an infectious, head-bobbing beats, their songs are played in keys that leave a smile on the face and a warm feeling in the gut. They’re bringing their tunes quite a ways west on their latest tour; check them out while you actually have the chance. JESUS PIECE Palomino Smokehouse & Bar, October 4 Unleashing classic hardcore that leans towards the metal side, this five-piece act out of Philly deliver moshpit tunes like the best of them. They mix the beat of hardcore with the deep growls and incessant background calamity of metalcore, and are known for their ability to spin crowds into a delirious frenzy at the drop of a chorus hook. Their Calgary show is sure to be one for the books. CHANGE OF HEART Palomino Smokehouse & Bar, October 6 Once thought to be a spark that flickered in the ‘80s and quickly faded away, Change of Heart pulled off a successful reunion in 2009 and has been bringing their weird brand of Tragically Hip meets The Clash indie-punk back to the stage ever since. Vocalist Ian Blurton is known for his work with other Canadian indie projects such as beloved Napalmpom pals Bad Animal; he also worked with C’mon and Cowboy Junkies, conjuring a much deserved cult following. BEATROUTE • SEPTEMBER 2017 | 27 UP+DT Festival U.S. GIRLS exploring new modes of music making Big changes are underway in the U.S. Girls world. The music of U.S. Girls, the moniker of American expat Meg Remy, is always sentimental, socially aware and elusive. Remy, the Toronto based songwriter and producer, is known for her obscure samples, produced by old tapes and recordings that are stretched and dismantled as well as fuzzy beats. Her Illinois tinged voice tells stories of despairing sadness through a glowing voice. Though challenging, her experimental singer/songwriting is hopeful and vibrant. U.S. Girls has not released an album since 2015’s Half Free, a vivid, by Michael Grondin dreamlike collection of anecdotes that also dive deep into Remy’s imagination, partnered with music videos that complement its dreamy qualities. In a phone interview with Remy while on set for a new music video in Kingston, Ontario, she explains that a brand new album is in the works. “I just finished a record. It’ll come out early 2018,” she says, not giving away too many details. “I don’t know if I can tell you what it’s called.” Making a turn from her minimalist beats, Remy says she wanted to explore new ways to approach writing an album. “It’s a record like I’ve never made before with lots and lots of musicians. Like 20. So it’s very elaborate but not ornate at all,” she explains. “It features a band, and from now on I’ll be playing with a band.” Indeed, her upcoming tour features a full band. “There’ll be drums, bass, guitar, keyboards, vocals, saxophone,” she explains with a laugh. Without getting too political, Remy discussed the ways in which the current social climate seeped into her new work. “A lot of this album was written during the course of the U.S. presidential election. So, there is a lot of that in there,” she says, again without going into detail. “It’s like asking for an opinion on the bible or something. I’m just sad, but also not surprised unfortunately. I don’t know what else to say.” She says that even if not directly, any we can asks bigger questions is important regardless of the medium. “Any platform or vehicle to address social issues can be good. If it’s a poster on a wall, or a conversation two people have, or a film or a song, it works. Music is as good as any other,” she says. U.S. Girls perform as part of Up + Downtown Fest at the Vinyl Needle Tavern on October 6 (Edmonton). They’ll be playing with Tei Shi, GGOOLLDD, and Lyra Brown. They perform with Crystal Eyes and Child Actress at The Palomino Smokehouse & Bar on October 7 (Calgary). SISTER NANCY bringing 41 years of experience to the stage. by Paul Rodgers on October 6 at the Freemason Hall (Edmonton) during Up + Downtown Fest. 28 | SEPTEMBER 2017 • BEATROUTE ROCKPILE TEI SHI pop musician moves beyond the bedroom to the studio Colombian-born, Vancouver raised artist comes into her own. photo: JJ Medina The hypnotic grooves and bombastic beats of New York based Canadian singer Tei Shi are showcased on her debut full-length Crawl Space, what she calls a vessel for her emotions and fears expressed through warm melodies and a liquid-smooth voice. “Crawl Space is the closing of a chapter and the beginning of something new in my life,” says Valerie Teicher in a phone call from her Chinatown apartment in Manhattan. The album came out in April, and has received rave reviews. The Colombian-born, Vancouver raised writer/producer claimed some fame after self-producing and self-releasing two EPs, showcasing UP+DT Festival by Michael Grondin her charming yet minimal approach to electronic bedroom-pop, layering her vocals over experimental, pop-infused beats. “The journey of my experiences after having jumped into all of this made me feel like I wanted my first album to push both personal boundaries and re-introduce myself musically,” she says. “A crawl space seemed like this metaphorical space where I could hide to work through fears and anxieties.” She explained that in the two-year process of writing and producing Crawl Space, her life went through many changes. “I was dealing with a lot of the eternal conflicts and pressures you feel when you are starting to put together something you love — something that is very precious to you,” she says. “When I was really working on the bulk of the album and finishing it, I was experiencing the end of many important relationships in my life as well.” This forced her to reexamine things. “I re-inserted this period of my life and revisited my childhood life. I looked at things now the way I would have as a kid,” she says. “I wanted to rediscover the roots of why I loved singing and performing. There was a lot of tying back a lot of my current emotions as I tried to stay true to that young part of myself.” Crawl Space is a mature, fleshed out, 15 song musical effort that pushes far beyond what Teicher released in the past, moving beyond the bedroom and into a studio. “I was able to bring many musicians in, so there’s a different role you have to play where you have to guide the process but also let things unfold in their own way,” she concludes. Tei Shi perform as part of Up + Downtown Fest at the Vinyl Needle Tavern on October 6 (Edmonton). They’ll be playing with U.S. Girls, GGOOLLDD, and Lyra Brown. They also perform at the Commonwealth Bar & Stage on October 7 (Calgary). FIVER bringing mistreatment of those with mental illness to light in song With increasing numbers of people in Canada being aware of and accepting of those with mental illness, and those who suffer from them learning to cope with the challenges those illnesses present, Toronto-based artist Fiver has explored some of the darkest historical elements of those afflictions on her new record, Audible Songs From Rockwood. The album finds singer-songwriter Simone Schmidt inhabiting the psyches, in field recording style, of a number of fictional patients at the Rockwood Asylum For The Criminally Insane, as gathered from case files dated between 1854 and 1881. Schmidt, who also works with Toronto psych-country group The Highest Order, and was in underground country group One Hundred Dollars, took two years to research the case histories of patients, and the album has an immediacy, a subtle yearning easily at home in the classic Appalachia of the arrangements. “I read an article about women who were incarcerated at the Rockwood Asylum before the asylum was built, this period of 12 years when prison labourers from the Kingston Penitentiary constructed the asylum,” says Schmidt. “They had nowhere to put people who were designated criminally insane, those being people who had plead criminally insane at trial, or even those who were in jail but weren’t adhering to the social order of the institutions. The ‘social order’ of the Kingston Penitentiary in particular was one of silence and work. If you couldn’t be quiet all day and work, they deemed you criminally insane. Because Rockwood Asylum took 12 years to build, they need to do something with the people who couldn’t live in the other institutions so they sent the women to live on the Cartwright Estate, where the asylum was being built, housing them in the horses’ stables. I wrote a song from that almost immediately, and wanted to explore the history further. It took me into the roots of our institutions in settler and colonial society.” ROCKPILE Two years of research brought on Fiver’s latest album. by Mike Dunn While those methods for diagnosing mental illness in the past might seem very dubious now, Schmidt doesn’t feel we’re that far removed from the antiquated methods of history. “I don’t think that the DSM (Diagnostic and Statistical Manual of Mental Disorders) is that much more of a precise science, and I would argue that I think that people who can’t conform to the dominant notions of what it is to be a productive person, or to fit into the economy, are often incarcerated, whether that’s in a mental institution or a prison, quite often their freedom is withheld.” Fiver performs at Hillhurst United Church on September 15 (Calgary) and at McDougall United Church as part of Up + Downtown Fest on October 7 (Edmonton). Schmidt’s other band, The Highest Order, will also perform at Up + Downtown. BEATROUTE • SEPTEMBER 2017 | 29 live music september 2 the frontiers september 9 jay bowcott september 16 mackenzie walas september 23 SADLIER-BROWN DUO september 30 MIKE WATSON saturday nights EDMONTON EXTRA PAROXYSM Edmonton crust punks unleash sociopolitical debut photo: Dustin Ekman Paroxysm will release their self-titled EP on September 22. by Sarah Kitteringham weekly specials late night movies $5 pints, $1 oysters $1/2 off wine $2.50 tacos $7 beer flights $5 draft pints $3 jack daniels midtownkitchen.ca Emerging from Edmonton, Paroxysm expels a d-beat laden, blackened style of hardcore punk. The socio-politically oriented band is on the cusp of releasing their self-titled EP, a 25-minute crossover rager. The multi-label release will be available on vinyl, and features blazing riffs and a crusty howl excellently lain over top the mix. Paroxysm has improved quickly since their March 2016 offering, the Open Wounds Demo. Despite its rudimentary recording quality, the 50-cassette edition sold out. “I believe that musically the aim has been for a d-beat, blackened-crust type sound. At least, this is where I think a lot of our influences are coming from. Each member of our band seems to feed off of a variety of metal and punk,” explains Holly Blake, the lyrics and vocalist for the act. She discussed the release with BeatRoute alongside drummer Chris. “The demo was recorded in one take, live-offthe-floor in a matter of hours with equipment that none of us knew how to use. By the time we recorded the EP, we were tighter as a band and playing much faster. We also took our time while recording the EP. There are more layers of guitar. The sound is altogether cleaner.” It’d be foolish to mistake cleanliness for meekness, as the EP is anything but. The oscillating groovy riff in “White Picket Fence” is overlain with unnerving shrieks; “Sickness Remains” opens with crushing, swelling instrumentation then transforms into something bordering on grindcore. The obvious difference here is the improved production, courtesy of Derek Orthner (Begrime Exemious). Thematically, the release has many commonalities with their demo, whose cover depicted the St. Bernard Residential School located in Grouard, Alberta. Paroxysm’s Bandcamp page includes a strong statement regarding the release. “Paroxysm is a platform for me to bring to light the rampant human indignities that have been caused by colonialism,” explains Chris. Extreme racism, poverty, unusually high rates of illness, low life expectancy, inconsistent access to clean drinking water and suicide rates that are double the national average are all deep seated, ongoing issues for Aboriginal communities across Canada. “Be it the cover of our demo, which depicts the Residential School my mother and her siblings attended, the cover of our [new self-titled] album that shows an ominous view of the tar sands that have destroyed a vast landscape, or in the music which I use as a release for inner turmoil caused by the struggles of daily racism.” He continues, “My family along with EVERY indigenous family on Turtle Island [the ingenious name for North America] have deep wounds that we are trying to deal with. It’s very true that not a lot of people know or acknowledge the atrocities committed on Indigenous peoples. By telling a part of my story in that write up it puts a face to the white supremacist laws created by the Canadian government.” Blake is adamant that Paroxysm will continue to focus on social issues as a means of addressing and combating injustice. In the current antagonistic political climate where extreme right wing ideologies are being normalized, it’s a message Paroxysm places deep importance in, both from within and in their day-to-day lives. “I don’t just think it’s important to make a statement about this with our band, I think it’s important to make this statement in every life situation where it needs to be heard,” explains Blake. “It’s about speaking out against ‘socially acceptable’ racism which includes anti-refugee and Islamophobic sentiments, spitting on anti-choice-misogynist-sign-holding-scumbags, or standing in solidarity with workers in every industry being exploited for their labour.” She concludes, “It’s about acknowledging that the land we inhabit is stolen, and this nation continues to exploit and victimize indigenous communities to date. We must all work toward reconciliation and indigenous liberation. I believe it starts with educating folks on Canada’s treacherous history, and addressing the racism that has been passed down through generations and dismantling it.” Paroxysm will release their self-titled EP on vinyl at the Brixx on September 22 (Edmonton). They’ll be performing alongside Begrime Exemious and WAKE. You can hear the band at paroxysmofficial.bandcamp.com 30 | SEPTEMBER 2017 • BEATROUTE ROCKPILE FUCK FENTANYL Punks stand up for safe partying by Jessica Robb There’s no doubt there’s a greatly romanticized cultural depiction of hard partying, one that is particularly celebrated and exacerbated by those within the music scene. It’s become as easy to find hard drugs as it is to find marijuana, and the timing could not be worse. Canada in the depths of an opioid crisis that has claimed at least 2458 people last year alone, making the tragic line between euphoria and fatal overdose so thin that two grains the size of salt can kill even the healthiest adult. This is fentanyl: a powerful synthetic opioid that is similar to morphine, but is 50 to 100 times more potent. Today it is found mixed with street drugs to enhance the associated effects of heroin and cocaine. The high potency of fentanyl greatly increases the risk of an overdose, especially as bootleg versions of the drug become more attainable and variations of the drug (carfentanil) grow even more toxic. “It’s not the fear of getting addicted anymore… It’s the fear of immediately dying that should be scaring people,” says Abby Blackburn of the band Ripperhead. Blackburn saw a need to educate the Edmonton punk community on the realities of the fentanyl crisis after witnessing some friends come fatally close to an overdose first hand. As such, she’s organized a presentation and gig at DV8 in September to help folks become better educated on the crisis. “I don’t want it to be a D.A.R.E. program. People want to party, it’s their life and they’re in control of it… I just want them to be safe about it. And that’s where the naloxone kits come in,” explains Blackburn. Naloxone kits are now available at pharmacies across Alberta, and contain a drug that can reverse an opioid overdose by pushing opioids off the receptors in the brain to restore normal breathing. The effects only last 20 to 90 minutes, which is enough time to call 9-1-1 and seek professional medical attention. “It’s basically the rule of three: don’t party alone, make sure you have this kit and know where your supplier is coming from,” Blackburn encourages. The kits are free to pick up at most pharmacies and will also be provided at the event for attendees to take home as part of the presentation by Alberta Health Services. If you’re unable to attend, Alberta Health Services website also features a lengthy list of locations where they are available. Blackburn has brought together four local punk bands to provide the music for the night, to scream in the face of fentanyl and even open up with their own personal struggles. While punk rock may be the lens to view the issue through on this particular occasion, the event isn’t specific to the punk community. Blackburn welcomes anyone who wants to get educated, regardless of genre preference. “I just want everyone to know that there’s a lot of love and heart in everything that [the punk community] does, and even though our music may be aggressive at times… We’re still happy about it,” affirms Blackburn. “That’s the number one thing: just always be happy about it, because you only get one life.” Fuck Fentanyl will be taking place at DV8 Tavern on September 8 (Edmonton). The event includes a presentation by an Alberta Health Services representative as well as a potluck. SASS, Whiskey Wagon, The Unreliables, and NME will perform after the presentation. For a list of pharmacies where naloxone Kits are available, visit Overdose prevention gets loud. photo: Nadja Banky INDUSTRY HOUSE new venue fills gap in the Edmonton scene While larger venues thrive and purvey booze to the legal music loving crowds, the question in the Edmonton music scene remains: where will the all-ages scene flourish? This is something Ryan Walraven has been considering for years, whether it was putting on all ages shows at the now defunct Avenue Theatre or with his new project, Industry House. The new venue will provide a much-needed stage for under-age bands as well as house a safe space for younger show goers. Walraven has partnered with his friend Phil Short of Corvus the Crow as well as Sabian Ryan, who will help handle booking and marketing. The venue’s manifestation appears rather spontaneous, coming together in three months at most. Thankfully, each member of the venue team has a background in the trades, which made the renovation process not only cost effective, but speedy. Walraven, Short and Sabian put in countless hours sanding, woodwork and so much more to get the room in quick operational condition. “I’ve worked in trades my whole life,” explains Short. “This is my first adventure into this side of the music scene. I’m in a band and I do wanna be involved in other parts of music. My brother has the silkscreen connections and after finding and putting this place together, I realize my new job now is making merch,” he says, his smile clear over the phone. “We tried to make it so that we considered what ROCKPILE All ages and all genres are welcome at new Edmonton venue Industry House! bands really want in a stage,” Walraven adds. “People don’t have to stare face to face with the artist and you’re also not taco-necking yourself because the stage is so high. We wanted to build the best intimate venue in the city.” The silkscreen connection Short spoke of is part of the three-pronged business plan Industry House has been implementing. Combining the silkscreen shop with L.T.D. Talent Services and Industry House, the venue can more easily manage running all-ages shows. BeatRoute asked about the common issue with all-ages venues lacking the liquor sales to be sustainable, and how Industry House plans on combatting this. “I think it’s going to take some time establishing the all-ages shows,” explains Walraven. “After about a year and a half, I found a handful of bands who were hungry and motivated. The high school networks are so tight knit that word of mouth was how we were able to get everyone out. We would have 250+ local by Brittany Rudyck kids coming out. It was insane.” While not every show at the venue will be an all-ages event, the trio looks forward to a frequent array of genres, which perhaps has not been the case in other DIY all-ages shows. “I think over the last few years the motivation to start a band at a young age wasn’t really there because there weren’t many places to play publicly,” muses Walraven. “You couldn’t rent halls anymore, and the Armoury was doing a few shows but it seemed mostly secluded to hardcore. There [are] a lot of other underage rock bands and genres that need places to play too.” The goal is to put on six shows with liquor licenses a month to ensure all-ages shows remain the priority and the youth community can be served. That said, their first performance is for an 18+ crowd. To sweeten the deal, a local food truck the Cranky Ape (owned by Walraven’s partner at L.T.D. Talent Services) will be on site most event nights to sling their carb heavy delights. “I swear he has the best fries in the city,” claims Walraven. “Hand cut, made day of - you’ll never meet a dude more proud of his food truck.” Corvus the Crow, Bring Us Your Dead and From the Wolves perform at the grand opening of Industry House on September 1 (Edmonton). For more information on upcoming shows, visit their website at BEATROUTE • SEPTEMBER 2017 | 31 BOOK OF BRIDGE ARTS DAYS showcasing the arts in Lethbridge by Courtney Faulkner Youth create chalk art outside of Casa for Family Affair on the Square. Claire Lint busks on the street as a tap dancer for Art Walk 2016. photos: Henriette Plas Lethbridge celebrates their seventh annual Arts Days from September 23 through October 1, with a plethora of activities for all-ages and interests. The event showcases the work of talented local artists through performances, workshops, artist talks, and artisan markets, connecting the community through creativity. Claire Lint, a local dance artist and co-founder of the non-profit organization the Lethbridge Society of Independent Dance Artists (LSIDA), is one of the city’s young artists who has chosen to invest her talent locally. Lint, who grew up Lethbridge, and whose dance has taken her to perform in the likes of places like the northern artist community of Dawson City, Yukon, has proudly watched the city grow and develop its talent pool. “I think we’re starting to really blossom and come into our own as an arts community,” says Lint. “I think it’s time that we’re put on the map, especially in Alberta, but I think in Western Canada, as a community that has a lot to say, and has a lot to contribute, in all art forms.” “As we continue to band together, it’s going to start happening. I feel like there’s a pulse, where the more people that get involved, the bigger the pulse is going to become, and then I think people will just have to come here, they’ll need to come here to access festivals, and residencies, and however you access the community as an artist.” Lint first became involved with Arts Days as a busker for Art Walk, an annual event that has taken place in Lethbridge coming on its 14th year. This collaboration between businesses and artists will showcase over 40 exhibitions installed in local businesses and venues throughout downtown. Lint remembers the first Art Walk she attended in 2009. “I have a very vivid memory of walking around, and I think there was only 10 venues, it was very, very small, but I just remember going around and thinking that it was just the coolest thing. For shops to open up their doors, and bring art in.” Five years later, Lint found herself compelled to participate. Buskers had primarily been musicians up until that point, however Lint had an alternative idea with her dancing shoes. “I found a piece of plywood in my parent’s garage and I painted it white, and I found a top hat, and I threw out a suitcase and I tap danced,” says Lint. “I would be like a living statue, and you know, get the coin and then tap. It was really great to see the kids engage with that, and to have that live performance art theatre feeling, while cross-pollinating into this art world, where people are moving around and they’re looking at different visual art, like ceramics and paintings, fabrics and textiles, then to be a part of the busking and the music was really cool.” Last year LSIDA put out a call for dancers, and the performance of busking dance artists grew to eight different dancers performing 17 times in 17 different locations throughout the community. “Now, nearly a decade later, I’m able to reach out and connect with other people and bring those opportunities to them, which to me is really incredible,” says Lint. “Something that always stuck in my gut was creating opportunities for others, that was always something that I felt really passionate about.” The artists participating in Arts Days spans all generations. Karen Brownlee, a local painter and fine artist who has been creating work focused on the landscape and people of southern Alberta for over 40 years, has been involved with Art Walk since its inception. She’s been showcasing her work permanently in Tompkins Jewelers, and in the past offering on-site painting demonstrations. “The concept is that you take the art to the people. Rather than the people having to search it out,” says Brownlee. “My life has been devoted to my family, and the creation of my own art,” she continues. “When you get down to the heart of the arts practice, in the visual arts, it’s me in the studio. There is no exhibit, there is no book, unless you guard your studio time.” Brownlee has devoted herself to interpreting the everyday sights around her, such as the mapping out scenes of farming towns, grain elevators, community members, flowers and horses, in her colourful water colour creations. She jokingly says that as she ages and grays, her paintings subsequently become more colourful. “One of my first art professors, Pauline McGeorge, told me ‘True artists find inspiration in their backyard,’ so I really took that to heart. When I see something happening on the piece of paper that’s exciting, I go with it.” “I really feel it’s been my calling, and in a lot of ways I feel it’s been art therapy. Just don’t give up. You’ve just got to do it.” Arts Days takes place September 23 through October 1 in Lethbridge, with the Art Walk on September 29 and 30. Visit artsdayslethbridge.org for a full list of events and times. 32 | SEPTEMBER 2017 • BEATROUTE ROCKPILE letters from winnipeg SLOW SPIRIT maestros of mercurial pop Since their emergence on the Winnipeg music scene, self-described “genre-immune” five-piece Slow Spirit have opted to follow their creative whims rather than meet any predetermined expectations. The band’s seven-song debut studio album, Unnatured, arrives independently on September 23. Recorded and mixed by Paul Yee at Stereobus Recording, it strikes a seamless balance between multi-instrumental precision and compositional spontaneity. The band’s five members—all skilled musicians who met while studying at the University of Brandon’s School of Music—draw from the worlds of jazz, punk, post-rock, pop and singer/bassist Natalie Bohrn’s lyrical prose to concoct something all their own. “People are still really taking us for our jazz influence, which is something I think we kind of run from in our own artistic identities,” says guitarist Eric Roberts. “We try to think of ourselves as making loose pop music.” Call it what you will. With aesthetics and influences abounding, the album shows the group’s mastery of bringing intricate ideas together. Lead tracks “Human” and “Legendary Mistake” are powerful, rhythmically complex numbers that reveal the group’s versatility. Elsewhere, “Last Night,” a portrait of the members’ time in Brandon, Manitoba and their interactions with the colourful characters that lived outside of their downtown apartment, bring their post-rock ambitions to light. “Creatively, going to jazz school helped us be more equipped to understand some fundamental concepts about music,” says Bohrn. Between the five members of the band, which also includes Justin Alcock (drums), Julian Beutel (keyboards), and Brady Allard (guitar), they now count at least four other bands that they contribute to between them. Noise troupe tunic, dream-popsters Living Hour, electro-pop act ATLAAS, and a cinematic instrumental project called Palm Trees are among them. 3PEAT pass the mic The spawn of ‘90s backpack hip hop and underground Prairie rap legends, 3PEAT’s infectious beats swirl to the laid back loops of the ones that set the groundwork. During their short time on the scene, the emerging group—which includes MCs Steve, E.GG and Dill the Giant, as well as DJ/manager Anthony Carvalho—has found a place on bills alongside punk and indie-rock acts as easily as they would a rap showcase. “I think that’s what Winnipeg’s about,” says E.GG. “They just support everything.” The group’s triad of MCs started rapping outside of Grippin’ Grain shows, a long-standing rap-centric club night, and before long they were rocking stages at festivals and opening for some of their own microphone heroes, like Blackalicious and T.I. In 2016, 3PEAT released their stellar debut self-titled EP, a top to bottom fresh collection of cuts that flow to a golden-era sample base. The record features members trading verses as part of their self-styled “triangle offensive” or tackling tracks solo. “All of those songs we did together,” says Steve of the EP. “We wanted to kind of build that model with our EP. Half of it is 3PEAT songs and the other half is solo songs from each of us. It’s kind of like introducing us.” ROCKPILE “It’s hard for us to schedule rehearsals, because we’re all so busy and have so many projects,” says Bohrn. “We’re always giving our time to other bands.” It’s because of this that their first proper release feels more like a finale than it does a birth. After years of performing, refining, and adapting the songs on the album, Roberts and Bohrn both seem ready to write Slow Spirit’s next chapter. “[Unnatured] captures what we’ve been able to accumulate in the last four years,” says Roberts. “Those songs we’ve reshaped a number of times, because often we don’t have the energy between our other projects to write new songs… Rearranging was always a way that we could keep things fresh and kind of grow as a band and as musicians.” As a result, some of the songs on the album are unrecognizable live. Like living entities, they can transform depending on the situation. The song “Unknown,” a quieter piece on the record, for example, has been entirely altered into a full-blown rock tune for festival appearances, according to Roberts. “It’s hard to know when inspiration is going to strike and you’re going to want to change a song completely,” he continues. “Sometimes we’re inspired by a certain performance opportunity.” It remains to be seen what the future will hold for the purveyors of mercurial pop. What they are certain of, however, is their commitment to following whatever new creative pursuit may come their way. “It has been such a long process to get this album out, and we kind of just want to be creative again,” says Roberts. “We’re not exactly sure what we’re going to do next… We’ve never been very good at the industry standard way of doing things.” Slow Spirit perform at The Good Will Social Club on September 23 (Winnipeg). To pre-order their new album, Unnatured, visit slowspiritband.com 3PEAT are a Winnipeg hip-hop group on the rise. Much like other rap supergroup marketing models (read: Wu-Tang), 3PEAT will operate as a rap trifecta and each individual MC will also be propped up with their own solo output. “It’s kind of like everyone brings their own little flavour into the big pot of jambalaya,” says Steve. More releases have already emerged. E.GG followed up 3PEAT’s group debut with his own Slow Spirit’s Unnatured will be released on hi-fidelity format. photo: Tommy Illfiger solo Alverstone record in 2016. Since then, Steve has offered up the soulful “Oh Yeah,” and Dill the Giant dropped the track “Emails” featuring ARI IQ earlier this year. With a consistent stream of tracks, appearances at industry conferences, live shows galore, and a 2017 Western Canadian Music Award (WCMA) nomination for Rap/Hip Hop Artist of the Year to by Julijana Capone photos: Eric Roberts by Julijana Capone add to their list of accomplishments, the past year for the group has been fruitful. “We were actually in Toronto at a conference— Canadian Music Week—and we were on the street when we got the email [about the WCMA nod],” says Carvalho. “We were like, ‘Holy shit!’” “I think it’s dope that things like the Western Canadian Music Awards are kind of shining a light on artists from that area of Canada,” says Steve. Indeed, it hasn’t always been easy for Canadian Prairie rap to get its due, but a new generation of hip hop artists are emerging from the ‘Peg—namely, 3PEAT, Super Duty Tough Work, The Lytics, and more—to pick up where others left off, following in the footsteps of nationally-underrated Manitobans like Shadez, Mood Ruff, Frek Sho, pioneering rap label Peanuts & Corn, and Winnipeg’s Most, among others. “They’ve laid the stepping stones for us to be here and do what we do,” says Steve. “It’s gonna be dope in another decade when you’re gonna see a lot more [Winnipeg] names,” adds E.GG. 3PEAT perform at Freemasons’ Hall on September 15 (Edmonton) and on September 16 at the Mercury Room (Edmonton) as part of BreakOut West. To hear more of 3PEAT’s tunes, head to threepeatmusic.com BEATROUTE • SEPTEMBER 2017 | 33 september AT sun HOT MESS 09/03 PRIDE BASH mon 09/11 Hifi Club Presents Com Truise+ NOSAJ THING thur 09/14 10@10: A HIP-HOP SHOWCASE OF BEATS AND RHYMES sat 09/16 WED 09/20 Live Nation Presents: the Cave Singers w/ Chris Cheveyo Live Nation Presents: Allan Rayman WITH GUESTS sun 09/24 MRG CONCERTS PRESENTS:Kacy & Clayton WITH GUESTS wed 09/27 commonwealth PRESENTS AUSTRA WITH ELA MINUS what a time wednesdays • world famous fridays • modern vintage saturdays 403-247-4663 731 10 TH AVE SW COMMONWELATHBAR.CA COMMONWEALTHYYC COMMONWEALTHBAR JUCY NOSAJ THING shining a light on music photo: Innovative Leisure Mastering the connection between audio and visual. Nosaj Thing, who is colloquially known as electronic producer/composer/ performer Jason Chung, has released his fourth full-length studio LP Parallels. To celebrate, he is taking the release out on a two month North American tour. Chung’s previous full-length LP tour (Fated) travelled through Houston, where the theft of all of his equipment and digital archives occurred, triggering an opportunity to reassess. In a crushing state of deep loss, Chung resiliently pushed forward with the support of his fans and friends to acquire a fresh set of equipment and a clean slate to start over with. Heading into that fateful tour, Chung had been heavily focused on collaboration in the visual realm to create an immersive experience; with his rebound production EP, No Reality, he did just that, stringing together a cohesive set of five tracks and visuals that left concert goers awestruck. JUCY With Parallels, Chung has created an album that takes the listener on a dark journey, replete with oscillating emotions and sonic reflections. While Steve Spacek, Kazu Makino and Zuri Marley’s vocal contributions to the record helped push Chung’s experimentations further in the instrumental aspects of the music, there are to be no collaborations when Chung takes the music visual. “Actually, for this tour, it’s going to be the first time that I’m performing solo, even with the visual aspect of it,” Chung says. “You know in the past I worked with graphic designers, animators and programmers and this time around I’m going to be experimenting more with light and space.” This statement may come as a bit of a surprise to anyone who’s experienced a live Nosaj Thing performance recently, but the illuminating aspect of it is that the reset and rebound of Chung’s career have helped him by Andrew R. Mott to take full personal control of the concert experience on this tour. “I’m programming lasers and lights and seeing where I can take it. Pretty much just experimenting with the space of the venue… I’m trying to program in non-traditional ways that I haven’t seen before and program to movements in a way that I kind of envision to my music. I’m going to be programming the lights with each song and getting really detailed with it.” This move away from collaborating with visual artists to venture into the creation and marriage of music with light is really born from the combination of aspiration and discontentment in a creative minimalist seeking to enter the trance of production. “I think I’m feeling just a little bit exhausted from how we consume everything, like news, basically, social media and our phones and everything. It’s just so stressful. Sometimes I want to throw my phone out the window, like, once a week or something. I just want to sit at home and make ambient music and channel out?” So Chung’s immersed himself in the task of creating a flexible multi-sensory set, pushing his skill set further and reaching deeper into the process to push his influence fully across the venue. “I’m a little bit frustrated, and actually it feels weird for me as a performer playing electronic music, when everyone’s just facing the stage. You know, I’m not up there singing or playing guitar like a traditional band or whatever. I’m used to just working in the studio or in a room. That’s kind of the reason that I started doing visuals in the first place. ‘Cause I just didn’t like the idea of everyone paying attention to what I’m doing on stage. I don’t think it’s that interesting with a midi controller and drum machine up there. It’s kind of distracting (me) from being able to perform. You know, sometimes electronic music isn’t designed to be performed on stage with a whole crowd watching, so I thought it would go hand in hand bringing a visual element in [to] play, because light has some distance, some range to it, it’s something you can kind of feel. With a laser you can feel it, it has an energy that it sends, cause it reaches to the end of the room.” This desire to personally create the visual experience of his music on stage has helped Chung find a greater sense of reward as a performing artist, shifting his focus from just playing his music to that of helping people to see what he envisions. “I’m actually just really excited about it, because I feel that it’s going to be more of an output of what I have in my head. I love collaborating cause things come out that I’d never even imagined, but it’s also interesting to make things visually that you have in your head that you can share, especially if you’re also making music too. I think that’s kind of rare.” Nosaj Thing performs at the Commonwealth Bar & Stage on September 11 (Calgary), at Amigos Catina on September 13 (Saskatoon), and at the West End Cultural Centre on September 14 (Winnipeg). LET’S GET JUCY! Good god it’s autumn again. This is an interesting September for yours truly, in that it is the first in four years that I am not returning to school. Feels good man! Here’s hoping that you all had summers rich with dancing, partially regrettable decisions and drained your bank accounts on festival, shows and various intoxicants. Anyways, here’s a bunch of shows I can’t go to: Justin Martin returns to the HiFi September 2. One of those just long-standing favourites, Dirtybird’s poster boy definitely seems to like it out here, making multiple stops in Calgary a year and performing at Bass Coast and Shambhala annually. It’s for good reason, his productions and live shows never disappoint. I was really, really hoping to lock down an interview with this artist, as he is a personal favourite of mine but it didn’t end up panning out. However, you should all know Bonobo well. The multi-instrumentalist is one of the single best producers within the realms of downtempo and melodic electronic music. He brings his riveting live show to the Palace Theatre on September 13. This right here is one outrageous lineup if I’ve ever seen one: Vanilla Ice, Salt-N-Pepa, Rob Base and Biz Markie play at Winsport Arena at Canada Olympic Park on September 13. Don some neon, maybe some gigantic pants and a fanny-pack and get your nostalgic groove on! Masked and leather-clad dubstep trio Black Tiger Sex Machine perform at the Marquee on September 15. A tad too heavy on the screech and wonkiness for my cynical, decrepit old ears, but hey, if that’s your thing it should be one heck of a party, seems like they were pretty well received at this year’s Shambhala. Another festival favourite, Skiitour brings the winter early to the Palace theatre on September 16. Another good one for neon, but maybe sub out the fanny pack for some ski goggles. DON’T EAT THE SNOW! Australian hip-hop duo Bliss N Eso perform at Wild Bill’s on September 25 (Banff), the Forge on September 27 (Edmonton) and the Gateway on the 28 (Calgary). Though their career has been marred in recent years by some unfortunate occurrences, like having their music barred from Triple J, or a stuntman getting shot in the gut while filming one of their videos, their music is actually really sunny and enjoyable for the most part. Rap giant Tech N9ne performs with his frequent collaborator Krizz Kaliko play the Marquee September 29. I shall personally be making the commute for Billy Kenny at the end of the month so I hope to see some familiar faces there, and will be covering Calgary artists at Fozzy Fest as well! Enjoy the month, see ya in October. • Paul Rodgers Bliss N Eso BEATROUTE • SEPTEMBER 2017 | 35 BILLY KENNY multi-faceted DJ and musician is a man of many faces Billy Kenny has cemented his footing within the electronic dance music industry and is making waves with his solo work and his Hannover-based imprint, This Ain’t Bristol. Kenny’s passion for music stems from an early age. At 16-yearsold, Kenny was already booking venues and showcasing his vinyl spinning skills. “I got into grime music really early and it was a huge thing at the time. I DJed for a lot of grime MCs and moved from that to speed garage. I went into bassline and tiny bit of dub, then to jacking house, into what I do now,” Kenny says. Transitioning from heavy bass drops to rubbery basslines, Kenny was set to dominate dance floors and was presented an opportunity do so by starting a label through the This Ain’t Bristol event imprint in 2014. photo: Ollie Simcock “This Ain’t Bristol was This Ain’t Bristol before I became to be a part of it. I was the first international artist that they booked at the event. It was just a party…. I became really good friends with the crew and I moved over four months later and we collectively decided to start this record label,” Kenny clarifies. Everyone involved with the label is from Germany, with the exception of Kenny, who hails from Leeds and Nick Hill, from Bristol. Despite having international status now, it was a challenge to get people on board with their first project, a compilation featuring an impressive list of names including Ardalan, Abby Jane and Kyle Watson. That same year, Kenny decided to chase after Dirtybird Records, where he immediately caught the attention of Barclay Crenshaw, also known as Claude VonStroke. by Catalina Briceno “The debut was April 2015, but [in] December 2014 I sent [Barclay] seven demos and he liked them all and maybe a month later he said, ‘Look I can definitely tell you’re going send me something that we’re going to go with, but I think these aren’t the ones.’ A week later, I wrote “I Operate,”” says Kenny. It is no doubt that This Ain’t Bristol is influenced and inspired by Dirtybird. Kenny says the challenge is keeping the labels separate from his own work. The key to attaining that distinction is doing everything himself. “I’m trying very hard at the moment to do everything myself. I’m not sampling anything, the vocals are my own, whether it sounds like me or not, it’s always my voice.” His vocals can be heard in various tracks like “I Operate,” “Hula Hoop,” and “Das Ist Sick.” Kenny also reveals he has start to delve into singing and will experiment with that in the future. Currently, he just wrapped up the tracks, “The Trip Report,” “Hood Girl,” and an official remix of Claude VonStroke’s pounding, anthemic track “Barrump,” which will be released on the Dirtybird Campout compilation in October. Although there is no word on a release date for his collaboration with Mija, Kenny reveals plans to accompany the track with a music video. He is also back in the studio with Motez, testing out possible tracks. A plethora of those unreleased tracks were exhibited during his set at Shambhala Music Festival this year, which left attendees thirsting for more. Many on the popular event’s group page declared his set as the highlight of the weekend. Although it won the hearts of many, Kenny has decided not to post the entirety of his set on SoundCloud, he will soon release a recap. “We’re also talking about [doing something similar to Dirtybird Campout],” explains Kenny, referencing the three-day electronic festival in California. He concludes thoughtfully, “I think first, we need to make sure that we have a nice stamp in the market to attack something like that.” Catch a special five-hour-long set from Billy Kenny on September 30 at the HiFi Club (Calgary). CASPA doing what he wants when he wants Dubstep giant Caspa has been hard at work in the studio, churning out tunes more akin to the roots of the genre than the hyper-produced, mainstream “brostep” that’s come to dominate the cyber airwaves and festival bills. Perhaps best known for his pivotal FabricLive mix with Rusko, that arguably did more to shape the genre of dubstep than any one other release, West London’s Gary McCann is now setting out on a tour that hits only Canadian locations, in order to “show that dubstep is still popping in Canada.” “I just feel like there’s a lot of love in Canada,” says McCann. “And they love bass music. And it’s got a lot of history there.” He said with this tour he wants to “make a statement” that the original sound of dubstep still has the ability to get bass-heads to flock to dance floors. McCann has played numerous shows across North America, and spent a four-month stretch of time living in Denver, Colorado. He got perhaps the best taste of North American bass culture when he played Shambhala alongside Rusko last summer. “It was interesting,” relays Caspa. “We had so many people in our career asking us, ‘When you playing Shambhala’ and it was like fuck it, was finally good to say, ‘We’ve played it, if you wasn’t there, too bad.’” McCann is mindful of the stress put on an artist Dubstep icon embarks on a cross-Canada tour. by the cycle of excessive touring and partying, then returning home to record more music and repeating. “You need to find that balance of enjoying writing the music to go and enjoy it playing it out, not just too much in the studio or too much live. You need to get that balance right and I think that’s what keeps the energy flowing.” He said in the early days of his touring career, nearly 15 years ago, he would try bringing a small photo: On The Rise Music studio set up with him everywhere he went on tour, but would only succeed in creating ideas, never full tracks. “When you go back to basics and you start writing music and enjoying writing music and not in a hotel room on the lobby floor doing a bloody remix, for me that’s not fun and that’s not why I do it. You need to be in the studio being creative, enjoying what you’re doing.” by Paul Rodgers In terms of the music he has been creating from the home-front, it is an absolute return to form. His Vibrations series thus far consists of five songs that highlight his origin story in music: stripped back tracks with deep bass wobbles and minimal, effective percussion usage. ““Deja Vu,”” he says, “that’s the last track I released. When I made that, that’s why it’s called “Deja Vu” I wanted to make a 2007, 2005 sounding kinda tune but on steroids, with 2017 production.” McCann is also the founder of imprint Dub Police, but in recent years he has decided to step back in order to slow down and focus on putting his time, energy and money into his own project. “There’s only so much that you can put into music and keep pumping it in and pumping it in and pumping it in,” McCann explains. His philosophy on touring, recording and the future is quite simple: keep things consistent, and more importantly enjoyable. He has been putting quality time into his recording process, releasing one single at a time, in an “old school” fashion and touring where, when and how he sees fit. Caspa performs at OV Club on September 3 (Winnipeg), at the Starlite Room on September 8 (Edmonton), at Marquee Beer Market on September 9 (Calgary), and at the Pump Roadhouse on September 10 (Regina). 36 | SEPTEMBER 2017 • BEATROUTE JUCY ROOTS KACY & CLAYTON from Saskatoon to Chicago Kacy & Clayton were all set to record in Saskatoon when Jeff Tweedy approached them. It’s been a whirlwind year for Kacy & Clayton. It saw them sign to New West Records, earn a Juno nomination for their debut album Strange Country (2015), open for Wilco at San Francisco’s legendary Fillmore Auditorium, and have their latest album, The Siren’s Song, produced by Jeff Tweedy. Throughout it all, the Wood Mountain, Saskatchewan duo have maintained their very laid back vibe and very dry sense of humour. “Well, [Jeff Tweedy] had [Strange Country] in a frame in the bathroom at the studio in Chicago,” says vocalist Kacy Lee Anderson. “If not Jeff, then someone went out of their way to hang it up in there. I mean, I wouldn’t do that, you know, to stroke someone’s ego when they’re coming by.” Adds her second cousin, Clayton Linthicum, “‘Oh they’re coming over, better hang their record up in the bathroom.’” Jokes aside, the transition from playing smaller clubs and festivals to touring with one of alt-country’s pioneering acts was a smooth one for the band, having toured throughout Canada for several years, the band did not feel much pressure. “It’s really not so different from playing a festival,” says Linthicum. “The Wilco shows were in amphitheaters, so they had a festival feel, but going from those venues to the smaller shows we did in clubs was a real change. We felt this push to play the best show we could, and it’s nice to get that feeling, you feel a good kind of tense, it keeps you on the ball.” photo: Dane Roy The Siren’s Song finds Kacy & Clayton expanding on Strange Country’s ‘60s folk-rock sound, with the influences of Fairport Convention, Sandy Denny, The Byrds, and The Grateful Dead running through the mix. Having Tweedy sign on to produce the album had a bigger impact on their schedule than it did on the music however. Anderson notes that Tweedy was genuinely excited and easy to work with. “ We wanted to have everything put together in case Jeff wanted to change things up,” Anderson attests, “and when we listened to demos, he said, ‘It all sounds great, let’s just do it.’ He really just made us feel so relaxed and let us do the work. He’d bring us soda waters, with caffeine in them.” by Michael Dunn “Kacy and I had been planning the album for awhile,” Linthicum explains. “We wanted to make one with our live band, with Mike [Silverman] and Shuyler [Jansen]. and we had the material almost all together,” says Linthicum. “We’d already booked the studio in Saskatoon, but when the opportunity to record in Chicago came up we had to rearrange some things. Tweedy’s a really kind guy. He knew a lot about our last album, it blew me away that he knew so much about what we’d already done. He really let us do our thing, and he’d step in here and there, if there was a moment of doubt or he had some idea he thought was cool.” The run up to the release of the album has seen the band drop videos for “The Light Of Day” and “Just Like a Summer Cloud,” both shot in the pair’s absence. The clips are short films that feel connected to the content of the songs, as opposed to the live or performance footage that’s become de rigueur. As with the move to New West, Linthicum and Anderson are seeing the need to let go of the day-to-day promotion of their work. “Kacy and I used to do all of that stuff, like most bands, just do it yourself,” says Linthicum. “And now there are a lot more people around, with smart ideas, chiming in on everything. Having a good manager like Shuyler really helps, we can leave a lot of those things up to him, and having a good agent to book the shows. It’s hard to keep that control at a certain point, so you have to let things go and trust the people you’re working with.” “We have to constantly check on what’s being promoted, and make sure things are going out that reflect the way we want to represent the music we’re making,” says Anderson. “With the videos, it’s about acting, it doesn’t have much to do with playing music. I hope we never have to act in another video again, maybe we could just make a slide show, or a Powerpoint maybe?” Kacy & Clayton perform at Amigo’s Tavern on September 21 (Saskatoon), at the Commonwealth Bar & Stage on September 24 (Calgary), and at the Needle Vinyl Tavern on September 25 (Edmonton). 38 | SEPTEMBER 2017 • BEATROUTE ROOTS AMY HELM rambling into the limelight Preaching love and community through folk and gospel. by Brendan Morley photo: Jana Leon AYLA BROOK & THE SOUND MEN selling yourself, then and now by Michael Dunn A musician finds ways to keep themselves “A lot of the time people hear my name and busy in between recording projects. think I’m a woman, so I thought the fellas in the For veteran Edmonton songwriter Ayla band might think it was funny being called The Brook, a number of life events and factors led to Brookettes,” says Brook. “Well, they didn’t. Most of him taking a long break between the Danny Michel-produced the best sound techs I know are women, but being After The Morning After (2008) that we’re all techs, and very reasonable, or “sound” and his latest, (I Don’t Wanna Hear Your) Break people, if you will, we became The Sound Men.” Up Songs, released earlier this spring. As the time passes between releases, Brook “I’d been living off music for about eight years, notices the difference between releasing records taking every gig, doing everything I could to make then and now. a living by playing, and I was pretty burned out,” “Well, there aren’t as many record stores, so you Brook tells BeatRoute. don’t have as much on-the-ground curation or the “Saved By Radio sort of ceased being a thing, suggestions to fit people’s tastes or expand them so we couldn’t work with them to put out the that you might have once before,” says Brook, who record when it was finished, and we sort of shelved worked in legendary and now defunct Whyte Avenue it for a while. Brent [Oliver, bass player] moved to record store Megatunes for a number of years. Winnipeg for three years, and so there was no real “The whole branding thing is a little new to me. rush to put the album out. I kept doing what I had The old ideal was that you weren’t supposed to be been, doing the side player thing with Bombchan, seen as trying to sell yourself, where now, it takes a and working as a sound tech, until it felt like it was massive amount of engagement to do so. You have time to put out the record.” to be on social media as much as being out playing, (I Don’t Wanna Her Your) Break Up Songs finds always putting your best face on things, and Brook and his Sound Men rollicking in a sort of maybe that’s tough for some artists. But it levels early Wilco via Sticky Fingers style, with dashes of the playing field a bit, like how are you gonna hear Lou Reed and Marc Bolan present in Brook’s laid about some band form Saskatoon without that back vocal delivery. That relaxed vibe is countered engagement? It’s a learning curve, but writing songs by the drive of the band, a full-throat throwback and playing music is still as fun as it’s always been.” rock n’ roll unit featuring veteran Edmonton players Brent Oliver, Sean Brewer, Chris Sturwold and Ayla Brook & The Sound Men perform at the Ship & Johnny Blerot. Anchor Pub on September 23 (Calgary). ROOTS Music has always been a part of life for Amy Helm. In fact, it runs deep in her blood. Growing up as the daughter of acclaimed singer/songwriter Libby Titus and legendary rock and roll pioneer Levon Helm, a career in music might seem like an inescapable fate. Yet for Helm the decision to follow on this path was not always obvious. “I’m not sure that I had a vision of a career in music.” Helm tells BeatRoute, “I just enjoyed singing. So that’s what I always gravitated towards. Then at some point in my late 20’s I think that I really decided that this was a better career than waitressing. And the money wasn’t that much better, but certainly the reward was, and the heart and spirit was much stronger, so I jumped in.” For nearly 20 years the singer and multi-instrumentalist has been sharpening her skills and honing her sound as a key player in several groups, including the celebrated alt-country outfit Ollabelle and in the Grammy-winning band led by her late father, Levon Helm of The Band fame. So when Amy Helm finally stepped into the spotlight as a solo artist with the release of her debut album Didn’t It Rain (2015), she was already well equipped. “It was a huge transition. It’s one that I’m still discovering,” Helm modestly admits about the shift to bandleader. “As I watch others who’ve done it much longer than I have, and who do it much stronger than I do, I realize that you could spend a lifetime crafting it.” This deep respect and gratitude for older gospel, blues, and folk artists (particularly strong women), is prominently displayed on Helm’s record. The album’s title track, a soulful rendition of the classic gospel hymn, is a nod to Mahalia Jackson; an artist that Amy confesses she once went months listening to exclusively. The gospel spirit that resonates on the album has been with Amy since she was a child. “My grandmother, when I was a kid, would sing those songs to me. In church, it is stuff that I would hear. Then when I was in my 20’s, I was just so drawn to singing it.” Since the album’s release, Helm and her backing band the Handsome Strangers, have toured extensively, most recently playing a string of shows with Elvis Costello. In the true spirit of the gospel music she was raised on, Amy’s live performances aim to create a powerful and emotional atmosphere rooted in community and love. “I try to keep politics off the stage because I think that going to hear music is a relief for people. Especially when there is a political climate as fraught as it is now in the States. But, I also believe that when you have an administration that is silently and now actively allowing white supremacy to be alive and vibrant in the United States, you have to do something because people need to be reminded that we’ve got to come together.” Helm is currently finishing up a brand new album, tentatively slated for release in early 2018, with Grammy award winning producer Joe Henry. “It’s not even 12 hours old!” says Helm excitedly from a Los Angeles studio. “We did four days of tracking and today I go in and do a little editing and that’s about it! It feels strong.” With lots of voices and instruments filling the room in a live off-the-floor approach, Amy Helm’s new album is aiming to capture the togetherness and community of her spirited live shows. Amy Helm performs at the WISE Hall on September 17 (Vancouver), the Hume Hotel on September 20 (Nelson), Festival Hall on September 21 (Calgary), and the New Moon Folk Club on September 22 (Edmonton). There’s a learning curve to marketing yourself, especially when you started before the Internet. photo: Chris Sturwold BEATROUTE • SEPTEMBER 2017 | 39 SHRAPNEL DIVINITY longstanding Calgary act unveils full-length offering by Sarah Kitteringham Calgary’s longest running metal band is Divinity. photo: Kirk Duncan In terms of longevity, Calgary has no longer living metal act than Divinity (though props go out to Forbidden Dimension, who hold that title in punk realms). Formed in the summer of 1997, they’ve outlasted every act to emerge from the city with their technically proficient, emotive melodic death metal. Created by vocalist Sean Jenkins and guitarist James Duncan, they’ve endured the rigmarole of the music industry to emerge as proudly independent, and that’s just fine by them. “Since we’ve been pushing the same band for 20 years now, there has been all kinds of ups and downs and everything in between,” begins Sean Jenkins, the vocalist and designer for the band (the band also contains a second vocalist, their former bassist Jeff Waite). Jenkins formed the project with Duncan just out of high school; both have been part of the project ever since. “In the first 15 years of it, we were very hungry for success. Honestly it was never ‘full-time’ because we’ve always had day jobs and other commitments but we did manage to put in a full-time effort. We would practice three to four times a week for three to four hours a time for years and years and this was a major reason why we were able to achieve the things we did. We released our first full-length album [2007’s Allegory] in 2006 independently and within six months of that release we were signed to Nuclear Blast. This wasn’t by chance!” The band followed up the release with a slot on 2008’s Summer Slaughter. Candlelight Records later picked up the band for their second offering, 2010’s The Singularity. “The thing with getting signed is… is it’s extremely hard staying signed. We found that there [was] all kinds of opportunities coming about once [we were] signed, but it SHRAPNEL didn’t mean all the expenses and costs were easily taken care of. We simply could not sustain that kind of a situation and it created all kinds of turmoil within the band.” Rather than remain on the industry wheel, Divinity struck out on their own to get back to doing what they enjoy: making tunes at an unrushed pace. The result was a series of EPs, including The Immortalist - Pt. 1 - Awestruck (2013), The Immortalist - Pt. 2 - Momentum (2016) and The Immortalist - Pt. 3 - Conqueror (2017), earlier this year. Now those three releases are compiled into a full-length dubbed The Immortalist, which is available on CD and digital download. Despite each EP being a stand-alone piece, as a whole they make a cohesive statement. “The trilogy EP concept was something we came up with in 2011 after things fizzled out with Candlelight Records in 2010. We thought it would be a good way to release new music more often than a creating a full-length album all in one shot,” explains Jenkins of the unusual release strategy. “This was also because we decided at that time to no longer pursue major labels or any labels for that matter… We realized that being independent was what worked best for us.” Their style of very technical melodic death metal is extremely clean and organized, and has changed little in the past decade – with the exception of how it’s produced. “We have definitely gone on a huge musical journey creating these EPs and the final all-in-one full-length. Each EP would exponentially improve upon the last in regards to song writing and recording production, because we had decided to take on more and more aspects of production, except the final mixing and mastering,” explains Jenkins. “However, we would also make sure there was cohesion between the EPs because we knew it would all come together as a fulllength. The biggest connection between it all is the lyrics are all built around a sci-fi concept story of a character who figures out how to become immortal. So each song talks about a specific part of the concept story.” Musically, the album highlight just might be “Hallowed Earth,” as it slows down the onslaught and features a substantial dose of melody. Reminiscent of Strapping Young Lad’s opus “Love?”, it showcases a different side of Divinity. “I’m glad you hear the Strapping Young Lad influence! [They] and Soilwork are our biggest influences for sure. I am going back and forth on the songs “D.M.T.” and “Conqueror” as to which one best showcases our new album. I have to say “D.M.T.” is something very special to us because we managed to get guest vocals from Björn “Speed” Strid of Soilwork on that song, along with Jeff and I doing vocals too. It was all recorded in different stages but to hear the final song with all of us playing along with Bjorn is just fucking awesome!” Now on the cusp of their Calgary release party, the unit known as Divinity is better than ever. “Five years ago or so, we decided that we were happiest as an independent band doing our thing completely on our own terms. This brought out our original love of simply playing heavy metal.” Divinity will perform at their album release party at Mercury Room with Expain, Immunize, and Skepsis on September 22 (Edmonton) and at Distortion on September 23 (Calgary) alongside Expain, Plaguebringer, and Sonder. You can listen to their album online at www. divinity.ca In METAL Kick off your month with some heavy metal! On Saturday, September 2, head to Vern’s in Calgary for Vancouver based techy grind/deathcore act Angelmaker, who are performing alongside citymates Torrefy. Also on the bill is Edmonton act Protosequence and Calgary acts Train Bigger Monkeys and ChaosBeing. On Sunday, September 10, head to Broken City in Calgary to see another Vancouver based act. This time around it’s Neck of the Woods, who are touring their newest album The Passenger. They’ll be performing with grindsters Exit Strategy, deathcore act Plaguebringer, and Chained by Mind. The following weekend, Vern’s in Calgary will be hosting a black metal show featuring Edmonton’s own Idolatry, Vile Insignia, Scythra, Arctos, and Black Sacrament. Tickets are only $13 at the door, bring your ID and don’t forget yer corpsepaint. Edmonton’s finest Canadian gig goes down on Friday, September 22 when Calgary’s own WAKE heads North to play with their pals in Begrime Exemious and Paroxysm, who are celebrating their album release party (read about the crust album in the Edmonton Extra section). Show is at the Starlite Room, tickets are $10 in advance. melodic death metal warriors Dark Tranquility touch down at Dickens Pub in Calgary on September 25 with their buds in Warbringer and Striker. That same bill hits Park Theatre on September 23 (Winnipeg), The Exchange on September 24 (Regina), The Starlite Room on September 26 (Edmonton), and the Rickshaw Theatre on September 28 (Vancouver). Unfortunately, despite many attempts, we couldn’t get the band on the horn to discuss it in further detail, but rest assured you’ll have a neck snapping time! • Sarah Kitteringham BEATROUTE • SEPTEMBER 2017 | 41 YAWNING MAN and the never-ending battle with boredom Conjuring epic multihued shamanic yarns. Waging a never-ending war on boredom, the lumbering Californian desert rock entity known as Yawning Man dates back to the golden era of the psych-rock fringe when the likes of Brant Bjork, John Garcia and Josh Homme caught wind of their free-wheeling space rock ways. From pulling off clandestine generator parties for a few friends the desert back in the mid-80s to performing in front of thousands of devoted fans at venues around the globe, founding guitarist Gary Arce has never forgotten the desolate internal and external landscapes that informed his early years. “I actually lived at the Salton Sea, and believe me, the Salton Sea is not that romantic!” Arce recalls with a chuckle. “I used to live near there, I grew up in the Palm Desert also known as the Low Desert. The place is a running joke with locals; cuz tourists would go there and find just a toxic puddle with dead fish on the shore everywhere. I just remember going there and walking along the shore thousands of dead fish and meth heads walking streets like the walking dead. In between where I lived and Mexican border there was this weird culture of illegal immigrants mixed with meth heads mixed with dead fish.” These days Arce is looking forward to hopping the border together with the band’s original bassist Mario Lalli and their 2014 addition known as drummer Bill Stinson, as Yawning Man prepares to bring their ponderous machinations to Canada for the second time in recent memory. Having fallen under the thrall of the land of ice and snow at last April’s 420 Music and Arts Festival in Calgary, the sidewinding trio is set for autumnal return, but this time as headliners. “I’ve toured all over the world and I love Canada. It’s so beautiful and breathtaking and the people are super sweet and it’s just a rad place. This tour we really wanted to go back there, so we asked the agency for that to happen. This time we’re going as a headlining band and it’s our first time going out on our own!” Hard to believe for a band that’s had such a lengthy and influential run. Although admittedly inconsistent, Yawning Man’s discography has attracted ample attention and garnered them many comparisons to other so-called stoner rock acts, although he understandably shirks that unimaginative label. “I’m excited and I’m just hoping that people come out to see us, because we get type-cast into this weird metal-desert-rock thing like Kyuss and all those bands. And yeah, we’re from the same town as Kyuss and we’re friends with all those bands, but we are nothing like Kyuss. And I think hopefully people will start to realize that we are our own band. We’ve never followed trends. Never tried to be metal or this or that. We’ve just done our own thing.” Sighting the work-ethic and nonconformity of his favourite punk acts for a point of reference amidst the ever-shifting sands of public opinion, construction-worker-by-day Arce’s primal howl dredges up the heart of darkness from the bottom of the Salton Sea. “Music for me is like another job; I do have a hardcore job. I do concrete and construction and I have to have a side of me where I’m mellow and I do love ambient dark music. I’ve always found something in it that’s mysterious and innocent. I’ve always been into that kind of sound.” by Christine Leonard Known for his ability to take a simple musical phrase and spin it out into an epic multihued shamanic yarn, Arce has come to realize the importance of channeling his creative impulses into increasingly defined forms. Edging away from amorphous compositions like those found on their foundational albums Rock Formations (2005) and Vista Point (2007), the threesome’s newest constructs refer to a predetermined set of musical blueprints. “I started all these projects,” Arce explains. “I’d call up all these friends and go ‘Hey, dudes let’s drink beer and jam!’ We’d take best of improvised jams and make a record. It got to the point where all of the recordings I was doing were all fuckin’ jammie with no song structure and that started to get boring for me. I was under the gun and I just stopped. I told myself Yawning Man was one band where I couldn’t afford that attitude of just working off-the-cuff. Mario has moved and now he lives right near me, so we have closed the distance. We’re starting to get focused and write more structured songs, coming up with riffs and going back and forth and playing it until we both think it’s cool enough to keep.” He concludes honestly, “I’m kind of a dick about the beats being a certain way. I always tell our drummer ‘Don’t play a silly four-four beat. Give me something different that fits, don’t play a dumbass rock beat over again!’ cuz I’ll get bored and once I get bored I get lazy and lose interest.” Yawning Man performs at the Palomino Smokehouse & Bar on September 21 (Calgary) and at the Starlite Room September 23 (Edmonton). MAGLOR answers the call of the forest by Sarah Kitteringham After two of three members relocated to Canmore, it took former Calgary act Maglor an ungodly amount of time to release their second album Asunder. Not that it’s out of the ordinary for the atmospheric black metal trio: everything they’ve done has taken an ungodly amount of time, but the result is always worth the wait. “We do often have a difficult time trying to decide exactly what style our music is. We’ve never really tried to specifically fit into any one particular genre,” explains multi-instrumentalist and vocalist Beren Tol Galen. Every member of the band uses a pseudonym; all members are multi-instrumentalists. “That said, we definitely draw inspiration from metal projects such as Moonsorrow, Summoning, Enslaved, Wardruna... to name a few. Alongside this, we are often heavily influenced by many soundtrack composers as well: [American film, game and television composer] Jeremy Soule, [American film score composer] James Horner, and [Japanese video game composer] Nobuo Uematsu, among others. We’ve had our music described as heathen folk metal, atmospheric black metal, and even blackened folk metal.” After forming in 2002 and functioning under the name Haven, the band reassessed and renamed after “one of the seven sons of Fëanor,” within J.R.R Tolkien’s collection The Silmarillion. They eventually released 2012’s Call of the Forest, delivering a layered and expansive sound marked by cold tremolo picking, battering drums, hypnotic crooning and chanting then shrieking vocals, alongside floating keyboard lines. This approach is continued on Asunder. “We tried to write the album with the idea that it is one, singular tale; separated into chapters, each with a different sense or feel,” says Tol Galen. “We try to create a sound born from realms unknown; of ages long forgot.” The album spans five tracks, taking the listener on an eerie, varied journey that sounds best when blasted loud on its gorgeous 12-inch format. The package visually utilizes a mountainous theme that spreads across the cover and insert. “For Asunder we decided to press vinyl as well as again releasing CDs. We are all avid record collectors and really enjoy having an album on vinyl format. The sound and feel, as well as full art and jacket is a really nice package to have as far as physical formats go,” explains Tol Galen. Both editions are available now. Asunder is now available on vinyl from Sounds of the Land Records. Visit to purchase a copy or stream the album. 42 | SEPTEMBER 2017 • BEATROUTE SHRAPNEL musicreviews Chad VanGaalen Light Information Flemish Eye Records Without a doubt, alienation and disassociation are at the core of Chad VanGaalen’s bizarre and beautiful indie rock. Since his early days as a street busker in Calgary’s core, VanGaalen has been nebulous and moody, effortlessly shape shifting between genres and styles. While previous works have always retained his singularly odd and utterly ramshackle style, they’ve also flirted with country (Shrink Dust), blipping electronica (Diaper Island and Soft Airplane), alternative folk (Infiniheart and Skelliconnection) and experimental techno (his 2015 collaboration with Seth Smith, Seed of Dorozon). Albums are further heightened with the bizarre bleeps and bonks of homemade instruments, delightful contraptions that are best enjoyed when witnessed in a live setting alongside VanGaalen’s disarming animations. On sixth solo studio album Light Information, VanGaalen has somewhat reverted to the stylistic proceedings of his earlier days. The result is a record that’s startlingly in line with both 2006’s Skelliconnection and 2008’s follow-up Soft Airplane. The result is an album that’s startlingly in line with both 2006’s Skelliconnection and 2008’s follow-up Soft Airplane. Opener “Mind Hijackers Curse” kicks off the proceedings, with Chad’s slightly layered, reverberating vocals making an almost immediate appearance. The drums are clattering and understated, and the vague and hard-to-pinpoint background instrumentation evokes a plinking, plunking sound that wouldn’t be out of place in a sci-fi movie. Of course, this is right in line with his previous output: he has long been fascinated by the subject, most notably materializing in his 2015 short film ‘Tarboz,’ which tells the story of an intergalactic space traveller. If you’ve yet to witness it, think the animation style of Adult Swim’s disturbing Superjail!, as utilized by Wes Anderson. It’s a wonder to behold. “Prep Piano and 770” is the first jarring track of the record, flirting with the same noise that made his side project Black Mold damn near unlistenable for anyone disinterested in the genre. While menacing keys bleep and bop, cascading keys set the tone for follow-up track “Host Body.” The lyrics are the strongest of the release, as Chad forebodingly croons, “I’ll be the host body yes, for the parasitic demons. They can eat me from the inside out, I already hear them chewing.” Herein, the similarity to Soft Airplane’s “Poisonous Heads” is obvious: the song is stark, and slightly bouncy, spinning foreboding tales of the future. Later on, “Old Heads” is upbeat and joyous jangly pop. In particular, the chorus is infectious and sung high– “WHO IS THE OPERATOR, KEEPING ALL MY CELLS TOGETHER?!” – and is sure to incite a future sing-along at gigs. Later on, “Faces Lit” has a similar vibe with its a sway inducing style. “Pine And Clover” evokes the yowl of Neil Young with its layered style and lazy, folkish guitars. After nearly two decades of making music, VanGaalen’s ruminations have grown more contemplative, yet remain consistently dark. Long associated with the archetype of a man-child (a moniker Chad himself has used) for his forays into implausible fantasy territory, his lyrics skirt between out-of-this-world and highly relatable. “Broken Bell” illustrates this. I sit and do a drawing A portrait of my dad I should really visit him Before he is dead Cause we are getting old Our cells just won’t divide like their told I’m not really good At this kind of thing Should I take the advice of the graffiti on the wall, telling me to go suck it? Or should I listen to the voices ringing in my head, like a broken bell? Family is a recurrent theme, particularly now that VanGaalen is a proud father. Relevant to that point, it sounds like there is a distorted, childish croon in opener “Mind Hijacker’s Curse” (though on the former, it might just be the Korg 770 monosynth he fixed up for the release). Childish sounds appear again, but this time much clearer, in closer “Static Shape.” Evidently, the backing vocals are provided by his daughter Pip and Ezzy. In the closing song, the effect of modulated childish noise is pleasant, particularly in conjunction with the jaunty keyboards. Although it’s not out of character, when the last 30 seconds or so of “Static Shape” end in noise territory that is unpleasantly jarring and squealing, it does not benefit the album. It’s likely the intention to be confrontational this way directly after the album’s sweetest moments, but it seems unnecessary. Fittingly, Soft Airplane ended in a similar fashion with a full noise track dubbed “Frozen Energon,” though that track was far longer with a better sonic arc. All told, Light Information offers nothing particularly new in the Chad VanGaalen universe; it remains a wonderful addition to his catalog that’s likely to dominate the earshot! charts for months and be nominated for a Polaris Prize. In short, VanGaalen is well on his way to being the type of musician we remember in decades to come, courtesy of his bizarre bent on Canadiana. • Sarah Kitteringham Illustration by Emile Compion BEATROUTE • SEPTEMBER 2017 | 45 Alvvays Antisocialites Polyvinyl Record Co. When Alvvays burst onto the scene, it was a perfect conduit between stadium pop-rock and the grimey and brittle toned indie darlings of the mid-10’s. Equal parts Beach House, Mac Demarco, and Tegan and Sara, rounded off with a refined coat of ‘80s synth shimmer. They had a lot going for them, even outside of the fact that frontwoman Molly Rankin is one of those Rankins, and is thus East Coast royalty. After a disappointing, but necessary, relocation from PEI to Toronto, their self-titled debut pushed about as far as a Canadian indie could. The record is an absolute single machine, with catchy pop hook after catchy pop hook. The guitars are brittle, the reverb is dense, the synths are smooth, and Rankin’s electric silver hair sparkles almost as much as her luminous vocals. This band was the full package. It’s only been three years, but those songs are burnt into the speakers of every coffee house in Canada, thus, it’s about time for a few new ones. Hence, Antisocialites: an extremely polished sophomore release that hits fast, but arcs strongly. It’s a much stronger front-to-back listen than its forebear, but the trade-off is that there are markedly fewer shimmering hooks. For each fluttery and beautiful pop anthem like “Dreams Tonite” there is a stuttering and unfamiliar indie exercise like “Hey.” The rougher tracks are by no means inaccessible, but rather just divergent enough to add shape to the album. The least comfortable songs are the most interesting on the record. Things slow down in the second half, with the sparkly clean tonality giving way to some careful grit in the low end of the mix. Of note is the beautiful and restrained closer “Forget About Life,” with its rolling percussion, off-time guitar chords, and intermittent discordant noises, echoing the lifestyle of disarray the song half-heartedly celebrates. “Already Gone” is perhaps the most melancholic tracks on the record, a starry-eyed song with a slowly building wall of noisy harmony. The second half is tremendous, but is made all the stronger in conversation with the whopping one-two-three punch of “In Undertow,” “Dreams Tonite,” and “Plimsoll Punks,” the brightest and biggest songs on the record, not coincidentally the first three songs released. It’s hard to say that the biggest moments on Antisocialites top the pop genius of their debut, but they certainly come close, and the album experience is strong enough to keep neo-millenials running in slow motion through urban sidestreets to these songs for years to come. • Liam Prost 46 | SEPTEMBER 2017 • BEATROUTE The National Sleep Well Beast 4AD For all intents and purposes, the ever-growing acclaim surrounding Cincinnati commiserators The National can be attested to anything but a brimming and constant need for experimentation — but their latest album, Sleep Well Beast, finds the group revelling more outwardly than ever before. Following the success of their last release Trouble Will Find Me, the past four years have found each respective member of the band focusing primarily on side-projects, individually fracturing into various collaborations with other artists such as Sufjan Stevens, Jonny Greenwood, and Brent Knopf. But the burning question for one of the biggest bands in indie-rock, a group known for their overt dedication to grandiose subtlety, latent slow-burn tracks that bleed familiarity with permeating emotional dread, and wickedly-talented composition that grows in the mind like ivy, is always How? How could they possibly continue their consistent stream of quality albums, each more acclaimed than the last? The answer to this question is found in Sleep Well Beast, an album constructed with familiar framework—down-tempo malaise and rollicking percussion—a house built on a tried-and-true foundation, rooms filled with self-referential lyrics and sad-sack moroseness, but this time decorated with left-turn flair: bristling guitar solos (“The System Only Dreams in Total Darkness”), oscillating synth-work (“Walk It Back”), and unbridled urgency (“Turtleneck”). Sleep Well Beast also marks one of the most sonically-rich albums in The National’s near-impeccable discography, with each moment featuring minute sounds and ambience in an aural experience that only serves to compliment the honeyed baritone of vocalist Matt Berninger. Drummer Bryan Devendorf’s percussion is, as always, on point (“Day I Die”), and the influence from guitarist/keyboardist Bryce Dessner’s work on the solar-system-inspired album Planetarium shines through the glitchy keys on tracks like “Empire Line” and “I’ll Still Destroy You.” There is also a structural contrast from the The National’s previous two releases Trouble Will Find Me (2013) and High Violet (2010), which were carried on a fluid wave of emotional resonance, each track flowing into one another very simply and delicately. Sleep Well Beast, while retaining some fluidity, is more of a callback to the shifting tonal structures of Alligator (2005) and Boxer (2007), and manages to do so without seeming regressive in its execution. While Sleep Well Beast may not probe any new territory thematically, primarily focusing on the dissolution of relationships and friendships, ruminating in the melancholic way that only Berninger’s lyricism can, the album still manages to hit the emotional high-points that the longtime National fans hunger for (“Nobody Else Will Be There,” “Carin at the Liquor Store”). If anything, Sleep Well Beast can be considered the first album by The National that isn’t a grower — it comes out full force, showcasing the best parts of a band full of talented performers who know their strengths, playing music together in utter synergy. • Alec Warkentin Faith Healer Try ;-) Mint Records Jessica Jalbert, indie paladin of acid dream-in-denim psych pop, has been writing so many pleasant earworms over the years it’s really quite exciting to think about what the future holds: not just for her personally, but the crew of Edmonton musicians who tour and perform with her. Looking back since her first proper solo LP over half a decade ago, fans and those in the know should see that the humbly talented songwriter/guitarist can craft a damn good pop song. “Paris Green” from her solo release, Brother Loyola, “I Wish That I” from art-punk supergroup Tee-Tahs and “Acid” or “Universe (Whatever ‘Till You’re Dead)” from the lauded 2015 Faith Healer release Cosmic Troubles: there’s a reason why these songs could be the soundtrack to you and your pals making all the right questionable late-night summertime decisions. A big part of this is Jalbert’s kismet partnership with producer Rene “Renny” Wilson, a virtuosic multi-instrumentalist and sentient crushed velvet suit playing a vintage Hammond. Try ;-) is their second Faith Healer release, and sonically there’s a pretty linear connection between this new record and Cosmic Troubles: pleasantly washed-out production, delicate layers of ‘60s and ‘70s keys and guitars and effortless vocals that question and search. While the album is a tight nine tracks, you can still hear the evolution and experimentation sprinkled in every new song. A piano fill or third guitar lick may only be a few bars long, but it’s in those moments you can really hear Jalbert and Wilson’s cosmic growth (the fading outro to the title track is a great example). “Light of Loving,” an absolute journey that starts off with a subtle 13th Floor Elevators riff, slow burns into over five minutes of percussive cruise, fuzz and speaking-panning organ. The starts, stops tones and changes on “Might As Well” sounds like Ardent Records in ‘70s Memphis. “2nd Time” vibes like an outdoor folk music festival, especially with those downhome piano tickles and rare acoustic guitar (!) solo, while “Sufferin’ Creature” probably wouldn’t sound too out of place on Velvet Underground’s Loaded. Try ;-) feels like self-exploration and reflection on expectation versus reality. Whether it’s for fun, for love or for reasons unknown, we all sometimes do crazy, inexplicable shit. And you know what, that’s fine. As French writer Sidonie-Gabrielle Colette once said, “You will do foolish things, but do them with enthusiasm.” • Jared Maleski Belle Game Fear Nothing Arts & Crafts offer the listener a powerful album that never suffocates or remains static. • Nathan Kunz Brand New Through sonic walls of booming rhythms and strung-out synth lines, Vancouver crush pop group Belle Game create a unique and dynamic experience throughout their sophomore LP, Fear Nothing. Led by vocalist Andrea Lo, the band manages to pack the 10-song album with full and precise arrangements from track to track. Subtle guitar lines and acoustic drums scattered amongst songs create natural elements without taking away from the pop sensibilities put in place by wavering synthesizers and striking keys. Though rarely sparse or static in arrangement, Belle Game does a great job of never suffocating the listener with sound, as instrumentals remain organized throughout. Performances by Lo on Fear Nothing are consistently tasteful, often acting as a strong addition to the regimented tirade of instrumentation, though at times punching through to become a focal point. As synths sizzle and steady bass drum hits gallop into existence on the opening track “Shine,” Lo’s vocals seem to command the soundscape as they appear before the wall of sound. On the standout track “Bring Me,” Lo belts the opening lines as keys punch her performance home with striking effectiveness. Fear Nothing remains consistently strong thanks to precise walls of instrumentation and captivating vocal performances by Lo. By blending natural and electronic elements, Belle Game Brand New Science Fiction Procrastinate! Music Traitors For the first time in eight years, Brand New has finally released a new album. The band rose to superstar status in the world of nostalgic emo bands, dominating the minds of high school kids through a formidable mix of melodramatic lyrics and vengeful guitars. Brand New fans are extremely passionate and patient for good reason, as the band always delivers on songs with the potential to become immortal and sacred. However, the band’s past three albums have set the bar high and Science Fiction falls short for the amount of time it took to create. When fans say they love the album, but believe another album is on the way, something is wrong. Science Fiction is a solid offering with some of the best tracks the band has ever recorded, but there are too many flaws for an album that’s taken this long. In fact, a few songs suffer from a stretched out length like album opener “Lit Me Up“ and “Batter Up,” two tracks with underwhelming song progression compared to other longer tracks like “Same Logic/ Teeth.” The worst song “Could Never Be Heaven” features an acoustic melody that doesn’t suit Jesse Lacey’s vocals, failing to rival other softer Brand New classics. Even then, the album’s lows aren’t much to complain about. From Nirvana to Modest Mouse, the band does justice to their influences without ever compromising their own identity. It’s hard not to wish for more of The Devil and God Raging Inside Me on this album, but Science Fiction offers a satisfying conclusion to a legacy that has affected thousands and will affect generations to come. • Paul McAleer Death From Above Outrage! Is Now Dine Alone Records In the current music industry landscape, three years can feel like a damn long time. It’s hard to say that Death From Above (1979) BEATROUTE • SEPTEMBER 2017 | 47 Julie & The Wrong Guys are a legacy act, but Outrage! Is Now does its damndest to make the case, ultimately feeling less like DFA and more DOA. The Torontonian duo once known for deftly blending hard rock with proto-EDM return on the scene feeling like stale egalitarians preaching a “both sides are just as bad” apathetic message full of year-old cliché and rote, riff-rocky tunes. Instead of offering any semblance of thought-provoking lyrics, Outrage! stays on the sideline, instead pointing out the painfully obvious trends that anyone with an internet connection already knew. The most egregious lyric lies in “Freeze Me,” with Sebastien Grainger pondering “are we outside the safe spaces of love?” It reads like a cynical mockery of safe space initiatives that help minorities feel at home in scenes that often feel hostile to their very existence. Overall, Outrage! is a special kind of middling. Not outright terrible, but so mediocre that it makes you question if the band has always been this ok. Fond memories of the band’s past albums dissipate, leaving only a cloudy image of a band that once felt revolutionary dirtying that air with a gaseous explosion of radio rock gone awry. • Jamie McNamara Everything Everything A Fever Dream RCA A Fever Dream is the fourth album from Everything Everything, a four-piece band from Manchester who derived their name from the first words on Radiohead’s Kid A. They stretch and pull at the fabric of pop with each release, seeing how far they can go before the whole thing tears apart. No matter how indiscernible the end results are from the source material, the music commands the senses like a puppeteer changing your mood with the pull of a finger. That’s what Radiohead and Everything Everything have in common despite heading in different sonic directions. Each of the band’s past releases have been well received by both fans and critics, but A Fever Dream is easily their most complete full length yet. The album embraces simplicity in the eye of an electronic hurricane. The storm is full of noise – trees crashing into houses, power lines exploding, and rain flooding the streets, but there’s always a sliver of a blue sky the distance. The simple melodies provide the backbone and the storm is whatever the band decides to break it with, including the erratic and emotionally crushing nature of Jonathan Higgs’ vocals. The energy is unlike any album released this year. From the crashing cymbals in the latter half of the title track to the urgent chorus of “Good Shot, Good Soldier,” the album is full of euphoric moments surrounded by meaning. A Fever Dream is made for dancing, created in the same vein as “Idioteque” off Kid A, but the subject matter speaks about modern injustices. The record can fall on both sides of the spectrum, helplessly disengaged and unrealistically optimistic, but the band knows unity is the only solution. In that regard, dancing is one way of achieving Everything Everything’s goal. • Paul McAleer Goldtop You Possess Me Independent Too often, indie pop tends toward the simple, with the “millennial whoop” standing in for actual lyrical content in the choruses of otherwise catchy and infectious tunes. Thus the relief in hearing You Possess Me, by Edmonton duo Goldtop. Alice Kos and Everett LeRoi are crafting thoughtful, well-arranged songs with lyrical and melodic choruses that refuse to dumb down emotion to mere wailing over simple changes. The title track leads off with a beat that has a similar tone to The Ronettes’ classic “Be My Baby,” buoying the wobbling tremolo rhythm guitar, while Kos and LeRoi harmonize throughout the length of the number, which is rare and lends the song a laid back Everly Brothers vibe. “Even Tonight” is a warm classic pop ballad reminiscent of Jackson Browne, with some mid-’60s Beatles shining through in the arrangement, before Kos takes the lead on the licorice power pop of “Rip It Off.” You Possess Me makes solid use of programmed beats in a number of songs, but still feels natural and intimate. Goldtop are working with a lot of space and taste on You Possess Me, although they veer in a number of stylistic directions, including some interesting atmospheric alt-country cuts, never quite settling on one particular sound. Those turns are a good thing over the course of an album, but the most interesting moments on You Possess Me touch on the Brill Building/power pop/indie rock combination, a unique synthesis of styles that bring out the best in Goldtop’s catchy hooks and melodies. • Mike Dunn Emily Haines & The Soft Skeleton Choir of the Mind Last Gang Records Over 10 years after releasing her first solo endeavour, Knives Don’t Have Your Back, Emily Haines is back with Choir of The Mind. The album once again centers around her piano playing and poetic prose style, but here her vocals are used to create venerable layers of instrumentation. Where Haines’ project previously focused on the misery that comes with loss, she’s more hopeful here, exploring the inner recesses of her mind and the strengths of femininity. For Haines, feminine strength comes from softness. On “Strangle All Romance” she is ghostly and rough; vocal reverberations through a mountain valley. It’s deeply personal, her equivalent of flexing a muscle. She sings: “Love is my labour of life/ we’ll tear it up.” The song transitions into “Wounded,” where she acknowledges the repercussions of her open heart. “Statuette” galvanizes on these themes further, examining the traditional hierarchy between men and women in relation to social power. Haines replicates these roles to place her at the feet of a male contemporary, who has the creed and material possessions to “buy any girl in the world.” The backing beat mimics the worst type of elevator music, adding to the sleaze of her counterpart. The standout is the title track, “Choir of the Mind.” It’s as if the artist has voiced all of the concurrent thoughts within her head to create a deconstructed monologue atop her own meditative lullaby. It’s poetic, melodic, and painfully introspective. Haines has a way of evoking drama through her pace, which is often her biggest asset. Some may be turned off by the downtempo scenes she creates, but for a reflective listener, it’s an exercise in meditation. • Trent Warner Julie & The Wrong Guys Julie & The Wrong Guys Dine Alone By masterfully creating a union of delicacy and aggression, Julie & The Wrong Guys concoct a powerfully potent mixture on their debut self-titled LP. Over the distorted riffs of Eamon McGrath and a thumping rhythm section courtesy of Mike Schwarzer and Mike Peters of Cancer Bats, Canadian indie legend Julie Doiron (formerly of Sub Pop heroes Eric’s Trip) delivers vocal performances tuned to each track individually. On lead single “You Wanted What I Wanted,” Doiron strikes with urgently strained lines between screeching guitar licks at the chorus, then drops into a laid back tone as notes are softly and precisely picked through the verses. Later, on “Tracing my own Lines,” Doiron sings with a soft fragility over an open, breathing instrumental track of steady bass drum strikes and chugging guitar, accented occasionally with shaking thunderous strums. The band’s power throughout the 10-track LP lays not in an expected display of volume, but rather their keen sense of effective strikes and heavy tones. McGrath’s twisting western-tinged guitar lines on “Farther from You” beautifully contrast a darker driving rhythm section, eventually tying together at the refrain with explosive effectiveness. Acting as a modern day odd couple, Julie & The Wrong Guys blend elements from across the spectrum beautifully and to great effect, making their debut powerfully raw and unpredictable from start to finish. • Nathan Kunz Lascar Saudade Independent With Lascar’s sophomore outing, there has been a very noteworthy development on the sonic tone that made the Chilean band popular with their first release, 2016’s Absence. Lascar makes atmospheric black metal that is full of melancholy and longing, and the tone of the album is nothing short of beautiful. There is a lot to like about this band, but the unfortunate news is that what is being evoked is nothing that hasn’t been said before by other bands. The melodies played are beautiful in their own right, but the songs stagnate towards the end as the ideas are not varied or developed upon to justify the long track lengths. Even when the band is playing a beautiful melody or adding a new idea, it doesn’t seem as honed or well executed as successful bands in this style of music such as Alcest or Coldworld. On Saudade, Lascar has still yet to show a sound or style that is uniquely its own, and sets itself apart from the other bands who have succeeded at this style of music. Even when the album is at its best moments, it’s unfortunately something that has been heard and done before, and therefore becomes hard to recommend to anyone who isn’t an avid fan of this style of music. It’s certainly not a bad release, but the project still has yet to come into its own and therefore it becomes an easy album to forget about after a listen or two. • Greg Grose Milo Who Told You to Think??!!?!?!?! Ruby Yacht / The Order Label Milo (née Roy Ferreira) has been a bubbling name in the art rap scene for a while. Formerly of the now defunct Hellfyre Club, the Wisconsin-bred rapper learned the ropes from artists like Busdriver (who guests with a freestyle), Nocando and Open Mike Eagle. Following up 2015’s very solid So The Flies Don’t Come is Milo’s latest release, the exceptionally punctuated Who Told You to Think??!!?!? !?!. It’s by far his most cohesive work yet, starting life as a cloudy, jazzy beat tape reminiscent of Madlib. It’s a new approach for Milo, considering he’s most known for his Wikipedia-required reference-heavy verses. Like he says on track “the young man has a point (nurture),” his vocabulary pays his rent. 48 | SEPTEMBER 2017 • BEATROUTE That vocabulary consists of references to beat poets, role playing games, cartoons, philosophy, and everything in between. He uses these to comment on the state of rap, love, society or mortality. A lesser artist, including the Milo of the past, may have struggled to pull these seemingly disparate ideas together into a structured whole, but Who Told You To Think??!!?!?!?! marks a definite evolution for him, one which serves as a frequent source of pride for him on the record. And he should be proud. Who Told You To Think??!!?!?!?! is the beautiful and flowing piece of artistry that we’ve all been waiting for. • Cole Parker Nosaj Thing Parallels. • Andrew R. Mott No Use For A Name Rarities Vol. 1: The Covers Fat Wreck Chords For fans of the skate punk quartet, No Use For A Name, the last five years have been difficult. The unexpected passing of frontman Tony Sly in 2012 brought the band to halt and left fans wondering what the future would hold for NUFAN. Rarities Vol. 1: The Covers is the first new release since 2008’s final studio album, Feel Good Record of the Year. Although these tracks aren’t originals, they still manage to fill a void left by NUFAN’s absence. Throughout their 20-year career, NUFAN lent their talents to many compilations; including both covers and original hits. Fat Wreck Chords combed through countless recordings and compiled a compilation of only non-album covers, combining a wide variety of unreleased gems from NUFAN’s time at the label. Included on Rarities Vol. 1 are songs ranging from punk rock legends D.I. and The Pogues, to more classic artists like Depeche Mode and Cheap Trick. Queens of the Stone Age Their take on each track is as No Use as you’re going to get; each song performed in perfect NUFAN style with Sly’s distinctive vocals echoing alongside. And because it’s NUFAN, a couple of your favourite T.V. theme songs too – you’ll love them. In respect to the five-year anniversary of Sly’s passing just this past July, many fans will be embracing this record as soon as they get the chance. • Sarah Mac BEATROUTE • SEPTEMBER 2017 | 49 Tricky Queens of the Stone Age Villains Matador Records Perhaps Queens of the Stone Age frontman Josh Homme’s most underrated talent is his ability to make anything that he works on sound like a QOTSA record, no matter the personnel involved. That’s been true for the past six QOTSA albums, and even with pop producer Mark Ronson, it’s true for Villains. While bringing Ronson, whose past credits include Amy Winehouse and Bruno Mars, aboard may seem like a leftfield move, the results are almost disappointingly similar to 2015’s …Like Clockwork, because, after all, to quote Josh Homme himself on “Make It Wit Chu,” “Sometimes the same is different, but mostly it’s the same.” Villains explodes out of the gate with “Feet Don’t Fail Me,” a desert-noir foot stomper that blends Ronson’s penchant for pop-funk with QOTSA’s bong-ripping stoner rock. It’s not the last time that blend of influences pays off well: “The Evil Has Landed,” “Hideaway,” and “Un-Reborn Again” all exude pomp and swagger while still sounding like textbook QOTSA. Album highlight “Domesticated Animals” is a chugging, mixed-meter melee that builds to one of the best rock choruses in recent memory and a thrilling conclusion that finds bassist Michael Schuman unleashing a bloodcurdling yell not heard on a QOSTA album since Songs for the Deaf. It doesn’t reinvent the wheel, but throughout its runtime, Villains serves to cement QOSTA’s reputation as one of the most consistently enjoyable bands in modern rock music. • Jamie McNamara RALEIGH Powerhouse Bloom Independent RALEIGH kind of rips. Powerhouse Bloom opens with a short hit of percussion, followed by a glimmering guitar voicing. What follows is a meditative intro, a slow drum pattern, a bubbling bass line, and a warm cello set the scene. It isn’t until the first chorus, where a legitimate guitar riff cuts through the bustling mix, where it becomes clear that this is a bigger and more mature RALEIGH than Sun Grenades and Grenadine Skies. It’s their third full-length release of bumpy dream pop, but this time with sharper edges, and a keen ear for pacing. RALEIGH has always played with quick starts and stops, and stabbing transitions, but mostly within the spectrum of playfulness. Powerhouse Bloom cuts parts in and out with precision, and with a completeness of vision. The experimental but deliberate studio production work here invites a tonal and musical cohesiveness, filling in dead space with ambient sounds and long reverb trails, and adding texture with a grimey compression or phaser on the vocals. There is so much viscera and effect to Powerhouse Bloom, it reeks of deliberation and experimentation like we’ve come to expect from RALEIGH, but with a force and dynamism that transcends anything that’s come before. • Liam Prost the record to all-night dance party proportion.. • Andrew R. Mott Tchornobog Tchornobog I, Voidhanger Records The murky, churning waters of the debut Tchornobog album are not waters to be traversed lightly. The riffs and production are clouded in a thick haze, where the music can be heard, but the delivery of the riffs sounds booming, cavernous and epic. The listening experience of the album is one that feels akin to being lost in a vast underground cavern, hearing sounds moving through the blackness but not quite being able to parse where they are coming from. The album sounds dissonant, hostile, and full of ideas. Even as far as simple metal structure goes, the guitar playing is always strong and always driving but never flashy; things drift from moving at breakneck speeds to crunching to a halt and moving into slower, heavier passages. The way the songs are structured allows for a huge wealth of ideas to be displayed over the course of their epic runtimes, featuring both heavy, memorable riffs and quieter moments featuring saxophone and piano from time to time as well. One negative that the album has is that there seems to be little consistency through any of the its four tracks. Although the album is very consistent in tone, once the band finishes playing a riff, they seem more or less done with it. The album cycles ideas so many times over the course of any of its songs that there seems to be little reason the album couldn’t have been one giant piece of music. That being said, all the ideas presented on the album work very well, and Tchornobog’s debut is easily one of the strongest and most memorably alternative pieces of extreme metal to be released this year. • Greg Grose The Royal Foundry Lost in Your Head Independent Tricky Ununiform False Idols/!k7 Music After putting out numerous singles and getting heavy rotation on the terrestrial airwaves, the quartet known as The Royal Foundry has finally released its breakout album, Lost In Your Head. First coming onto the Edmonton music scene in 2013 as a newly-married alternative folk duo, Jared Salte and Bethany Schumacher have completely reinvented themselves with a solid and well-defined electro-pop sound. Drawing inspiration from the latest trends as well as movements from ‘90s Brit pop and ‘70s progressive rock, Salte and Schumacher dive deep into the exploration of love and relationship on a 13-track explosion of youthful expression and experimentation. Salte’s vocals hold the consistent lead on the record while Schumacher provides a subtle harmonic reinforcement that sits just right in the mix. Sprinkled like candy throughout the LP, Schumacher’s timbre takes the fore in anthemic elements that elevate the intensity of I wonder, when you’re a dozen albums into a storied career in the trip-hop game, is there still enough creative gas in the tank? Apparently so, if your name is Adrian Thaws. The iconoclastic beat-maker and producer still has a lot of issues to get off his chest and he has some top-notch talent to help him out. Biding his time between grime-swathed and trap-infused tracks such as “Same As It Ever Was, “It’s Your Day,” and “Bang Boogie” (with Russian hip hop homie Scriptonite), the master of melancholy plays it cool. Elsewhere, Tricky glides around genres from some signature R&B sultriness from the likes of labelmate Francesca Belmonte (“New Stole”), to the slashing guitar fuelled electro-banger of “Dark Days” (featuring rising dub-pop princess Mina Rose), to a breathy and sparse cover of Hole’s “Doll Parts” (from avant-garde artist and former AA-model Avalon Lurks). Of course, no Tricky oeuvre is complete without a contribution from his most influen- 50 | SEPTEMBER 2017 • BEATROUTE tial muse Martina Topley-Bird; her smoky haze of a voice blankets the last track on the album “When We Die,” while the brooding Dark Prince spits out bars asking all the important questions about where we go when the afterlife is upon us. Thirteen appears to be a lucky number after all and for fans of the genre this is your good luck charm. • Bryce Dunn Wand Plum Drag City Records California’s Wand comes from a different time, staying true to their classic rock influences with each release through avoiding the cheap tricks the modern age offers.. • Paul McAleer Wintersun The Forest Seasons Nuclear Blast Records 2017 has been a big year for Jari Mäenpää. With Wintersun’s late July release The Forest Seasons, something has shifted in the tone of the band. The album still channels the epic fantasy bombast of their earlier works, but the musicianship and songwriting displays a maturity not shown in earlier work. Rather than starting out at the speed of sound, the compositions on The Forest Seasons begin with a simple idea, and continue to slowly and gradually develop upon it over the course of 10 minutes until the track draws to a close. Songs move steadily and progress in a way that manages to fit plenty of ideas without feeling crowded, muddled, or overcomplicated. Melodies and motifs drift in and out of the composition, taking you from quiet acoustic moments to thunderous crescendos without disconnecting from each other. Considering the album only features four songs, The Forest Seasons is an incredibly varied record, as each song feels separate and different from one another, but all intensely varied and containing an entire world of detail within their 10 minute spans. In this way, the album strongly Wintersun succeeds. Wintersun set out to convey an entire season with each track on this album, and the album follows through with this vision. The compositions are well thought out and excellently executed, and because of this, the album becomes a must listen for any power metal fan who wants excellent songwriting with a little high fantasy cheese on the side. • Greg Grose BEATROUTE • SEPTEMBER 2017 | 51 STRANGELY BEAUTIFUL Momentous allusions to a disastrous outcome. Predictions have come and gone, the end is almost here. Welcome to CIRCUS OF THE STRANGELY BEAUTIFUL: FERAL APOCALYPSE. Tribes from all walks of performance and across Alberta are making the journey to the last standing building, the Distortion, in what was the city of Calgary. The annual show is the best kept underground secret in the province. Producer Harley Page started the event to help local performers, artist, and vendors network, connect and showcase their amazing talents all in one night. Atmosphere is the core of the show, and in one day the cast and crew change Distortion into the apocalypse. Guests are strongly encouraged to dress up for their chance to win great prizes in the costume contest such as a Big Rock Brewery Tour, and at the always free carny games. Take pictures with old and new friends in the life size bird cage photo booth complete with a swing and carcasses. Sample the customized food menu and drinks and of course check out all the stage show craziness. This year Edmonton’s Waking Mayhem brings their trash-metal to town, and as usual local clothing designer, Sheppish Contour, brings her magic. Also featuring Alberta’s outstanding talents: Circus of Hell, Visha Loo, Fatt Matt, Lindsay Marie and Chelsea Nightingale. Along with tribe leaders: Tiffany Tailfeathers, Elizabeth Kay, Bitch Sassidy, Dani Spades, Rica Shae, Tannus Betzler, Lady O, Emcee Mr. Adelaide and DJ Clay Stitches. Can they all come to a revelation? Which tribe will stand tall and which will fall? You are all invited to come and witness the Strangely Beautiful. Friday, Sept. 22 doors at 8:30, $13 presale/ $18 door/ $20 no costume. Distortion Nightclub on Macleod Trail. BEATROUTE • SEPTEMBER 2017 | 53 SAVAGE LOVE stranger things. My. 7-yearold. ” , BAN- D. mail@savagelove.net @fakedansavage on Twitter ITMFA.org by Dan Savage 54 | SEPTEMBER 2017 • BEATROUTE
https://www.yumpu.com/en/document/view/59417766/beatroute-magazine-ab-print-e-edition-september-2017
CC-MAIN-2022-33
refinedweb
38,176
67.59
There are many scenarios where i tried to compare images but failed to compare them. Image comparison is a very deep concept where there involved lot many complex algorithms . In brief for Two images to be same we need to compare the two images pixel by pixel so i came across PixelGrabber class in java and started using it which gave a positive result, but not accurate. The sample code for image comparision as follows: import java.awt.Image; import java.awt.Toolkit; import java.awt.image.PixelGrabber; public class Compare { static void processImage() { String file1 = "img1.png"; String file2 = "img2.png"; Image image1 = Toolkit.getDefaultToolkit().getImage(file1); Image image2 = Toolkit.getDefaultToolkit().getImage(file2); try { PixelGrabber grab1 =new PixelGrabber(image1, 0, 0, -1, -1, false); PixelGrabber grab2 =new PixelGrabber(image2, 0, 0, -1, -1, false); int[] data1 = null; if (grab1.grabPixels()) { int width = grab1.getWidth(); int height = grab1.getHeight(); data1 = new int[width * height]; data1 = (int[]) grab1.getPixels(); } int[] data2 = null; if (grab2.grabPixels()) { int width = grab2.getWidth(); int height = grab2.getHeight(); data2 = new int[width * height]; data2 = (int[]) grab2.getPixels(); } System.out.println("Pixels equal: " + java.util.Arrays.equals(data1, data2)); } catch (InterruptedException e1) { e1.printStackTrace(); } } public static void main(String args[]) { processImage(); } } Happy Coding 🙂 Advertisements 40 thoughts on “Comparing two Images in Java” its giving classcastexception while converting Object to int[] Hi I think you did not cast the PixelGrabber object cast it to (int[]). it will work fine Sir , I have to check one circuitpad’s back image with another circuitpad if any line is missing then it shows the pixels of missing lines . pls tell me Sorry i am a pure software guy not an ECE so i dont know how to see diff in PCB lines and design Sir ,I need to know how can I use java image comparision coding in Matlab. Hello Midhuna, Comming to matlab, its very powerful tool for Image Processing techniques compared to java. so u have a different procedures methods and coding style in matlab for this and i am not very familiar with matlab. Thanks. Hi Pavan, Good Morning.Thanks for this wonderful site.Please keep up the good work.Please share your knowledge and experiences through this website.Thank You.May GOD BLESS You. Thank you very much “Chaitanya” … i keep the site updated as per my knowledge and i am happy as the site is helping others to enhance knowledge.. Hi , I need your help in completing my project.Can you help me please. My email id v.anoopkrishna@gmail.com sure, ill help if the project that you are doing is under my scope of coding :), but i can help a very few hrs on sat and sun… Very interesting artcile! I’m involved in a similar project but i have a doubt …. What would you do to compare images that are different in size ? Because two images can be the same but different in width and height! Regards and keep up your good work! Hi sir, i need ur help to implement my project in image comparing , my mail id ahalyaathirupathi1993@gmail.com Yes Ahalyaa, i can guide you to some extent please post your project details/explanation. Hi, I am doing project on content based image retrieval, I retrieved by color but not with shape and texture. please reply soon Sorry Naveen, i too dont have answer for your question ill post the same question to my friends if i get any answer, ill reply back Thanks, Pavan Kumar Mantha Sir , can u suggest me an algorithm to automatically generate a caption for an image. Hi Akasha, to my knowledge more automation is also injurious to humanity… but any have please send your idea in breif so that i will try to suggest some solution. Hello Sir, I was thinking how about wen I upload a pic the system generates an automatic caption for it, like the location where the pictures were taken, time at which the photo was clicked.So, I thought of using geo-tagging for this purpose. My question is whether it is a good approach or not Good Idea but to a wrong person, i think some research persons can help you but not me, if you get ans please let me also know that. Thanks. Pavan Kumar That would be my pleasure sir. Thanks for your cooperation. Is it possible to read the text which is present in an image. If so can we able to print the “CAPTCHA” word.? Hi Saran, This is a complex question and lot of R&D is going on, also CAPTCHA is a security and we can’t breach it through code, any have i wll do some R&D from my side and will get back to your question. Thanks Pavan Kumar Mantha @Mantha pavan we can get the info of the images from the meta data that exist with them. It can be accessed by using “javax.imageio” with the method getImageMetadata(0); Hi Sir, Can it be possible to compare two images and give the output in percentage. If it compares two images it should show how much percentage it is similar when it compares. Hi Arun, May be we can get it, not sure at this point of time. I will reply once i get the solution. Hello Sir, Just wanted to ask you if its possible to compare two faces to show if the person in both the images are same or the different person. Is there any algorithm for that? Thank you Yes there are some algorithms available in matlab, check out. Hello friend. Thank you very much for this extraordinary simple code. I have been looking for an image-comparison code for some time. You made my day. 🙂 Thanks João Thank You. Hi Is there any possible way to compare a image in the web and the image in the desktop.If yes please provide the details. Don’t know exactly. if i do some research i will intimate you can i pass path of image in place of static image ??? Hi Shubham, Yes you can pass the path instead of static images, but then your code should fetch images based on the path and then compare. in any case at the end of the day its images that should be compared. how run this code its a simple main program..can be ran from a terminal as well Osmanm i want to compare the two images between two different human being to know him across the face its a little complicated algorithm, please go through Image processing using color depth analysis. i am also doing similar kind of research. Hi, I don’t know why but this is not working for me on Windows, however this works perfectly on Mac Hi Uday, Please let me know the error, so that i can trace it back. Hi, It was a mistake, somehow the way i was capturing the image to be compared had different sizes and dimension in Mac and Windows. Once I baselined the correct images, it was working as smooth as knife goes through butter 🙂
https://manthapavankumar.wordpress.com/2012/11/25/comparing-two-images-in-java/
CC-MAIN-2018-13
refinedweb
1,192
73.47
10 March 2011 09:23 [Source: ICIS news] SINGAPORE (ICIS)--Global acetyls producer Celanese declared a force majeure (FM) last week on supply from its ?xml:namespace> The company placed customers in mainland Market sources said that Celanese’s 1.2m tonne/year acetic acid plant and 300,000 tonne/year VAM plant in Nanjing halted operations on 2 March, with the tentative restart date set on 22 March. When asked about the outage and restart date of the Some market sources attributed the cause of the outage to a leakage at a reactor unit at the site, while others pointed to problems at the control tower of the complex. If the outage was due to problems at the reactor, Celanese’s plants may be down for a longer period of two to three months, market sources said. It was not clear if the recent plant outage was related to the outage in late January. “It seems that their production was not stable in the past period,” an eastern China-based distributor said. Domestic producers in Offers for spot exports were also raised by $60/tonne (€43.2/tonne) this week to $530/tonne FOB (free on board) A wide buy-sell gap however, hindered trades, as buying ideas in Major acetic acid producers in ($1 = CNY6.56 / $1 = €0.72)
http://www.icis.com/Articles/2011/03/10/9442445/celanese-declares-fm-on-supply-from-nanjing-acetyls-complex.html
CC-MAIN-2014-42
refinedweb
221
67.69
RDF and OWL Are W3C Recommendations 170 J1 writes . Read the press release for the full list of twelve documents, read the testimonials, and visit the Semantic Web home page." If you're interested in the Semantic Web... (Score:5, Informative) Re:If you're interested in the Semantic Web... (Score:3, Informative) Re:If you're interested in the Semantic Web... (Score:2) All these tools, and so far only one application which looks useful -- web annotations -- which probably could have been done without RDF just as easily. Other metadata schemes which should have been suited to RDF such as RSS, ended up moving away from it after everybody realised how hard it was to use, and how verbose the code ended up when trying to write the XML representation. This is good news (Score:4, Interesting) Surely it's about time for Slashdot to go XHTML+CSS? Re:This is good news (Score:4, Insightful) Re:This is good news (Score:4, Interesting) I'd be thrilled if they even just went to valid HTML. Then we could move to a nice HTML 4.01 transitional with CSS. Heck, they still haven't replaced their Re:This is good news (Score:2, Informative) Re:This is good news (Score:3, Informative) I know, the fact that somebody already did all the work for them makes their lack of progress even more inexcusable. About the only hard thing about the whole exercise (other than finding a way to run Internet Explorer to test it for the various bugs in its CSS implementation) is validating or correcting user comments to make sure they will be valid markup once inserted in the main page. This isn't rocket science, I think tools like xmllint do this for free. Even XHTML 1.1 isn't that hard to comply with, Re:This is good news (Score:2) You need to deviate from spec. to get Internet Explorer to even attempt to render it. If you serve it as application/xhtml+xml as per spec., Internet Explorer simply prompts you to save the file rather than rendering it. Re:This is good news (Score:2) Re:This is good news (Score:2) Re:This is good news (Score:2) re: this is good news (Score:1) ed Re:This is good news (Score:3, Informative) Yes, as previously discussed here [slashdot.org]. Re:This is good news (Score:5, Insightful) That is because there are a lot of very complex standards with little or no toolsupport. Most of the implementations of the major w3c standards are incomplete and/or inconsistent with the specification. As a content provider (i.e. a website maintainer) there is no point in producing stuff that the majority of the visitors cannot display. Basically anything beyond xhtml1.0 and a subset of CSS1 & 2 w3c standards compliant documents are totally pointless if the intention is that anyone can access them. BTW. I agree that slashdot is long overdue in supporting standards. Sites like wired.com and espn.com show that it is possible to save bandwidth (considering that Re:This is good news (Score:1, Interesting) Slashdot is unlikely to follow w3c standards as it does not believe in them. Re:This is good news (Score:5, Insightful) Re:This is good news (Score:2) Surely it's about time for Slashdot to go XHTML+CSS? I sure hope not. XHTML sent as text/xml is unsupported [w3.org] by 95% of the browser market. Sending XHTML as text/html works in many cases, but is an even worse idea [hixie.ch] because agents that XHTML as HTML wind up interpreting something that is neither correct XHTML or HTML. On the other hand, there's little wrong with HTML 4.01. Re:This is good news (Score:2) Should be: "...agents that send XHTML as HTML..." My mistake. I even previewed. Re:This is good news (Score:2) Re:This is good news (Score:2, Insightful) Granted, but the web's 'unFUBARness' and forgiving/liberal parsing of HTML, is a large part of its success. In contrast, Mark Pilgrim [diveintomark.com], has been documenting the evolution of XML's error handling [diveintomark.org] (which is pretty much "fail on first error"). Something I personally think is good (in the projects where we use XML), but general adoption is far slower. The threshold - while pretty low - is too high. The semantic web... (Score:5, Interesting) About a year later, I noticed that Clay Shirkey [shirky.com] had written an interesting article on the Semantic Web... It's a bit of a long read, but it does sum up the issues with it quite handily. Re:The semantic web... (Score:4, Informative) For good responses see Peter Van Dijck [poorbuthappy.com] or Paul Ford [ftrain.com]. Re:The semantic web... (Score:4, Insightful) Perhaps you could clarify then - I'd be interested in your feedback (specifically where you were misquoted), so I can go and re-read the article with your quotes in context. For good responses see Peter Van Dijck or Paul Ford. I consider neither of these to be "good" responses. I was unable to get through the first, as it was incredibly difficult to read with all those pictures and quotes interrupting the text flow. I stopped reading the second when I saw the following: 'Shirky defines the Semantic Web as "a machine for creating syllogisms." This is an over-simplification. The Semantic Web cannot "create", any more than the current Web can create.' This obvious straw-man setup comes immediately after the author decries Shirkey's article as being full of them. (Note that Shirkey doesn't say "the semantic web will create syllogisms", he says that it's a machine for doing so.) Re:The semantic web... (Score:5, Informative) My actual response at the time is brief and chatty [w3.org]. The response from Dan Brickley [dannyayers.com] is also short and sweet. Neither of us felt it was worth the time to reply point-by-point. The "misquoting" is to suggest that my "how you buy a book on the Semantic Web" sketch should possibly cause Jeff Bezos to lose sleep. I was trying to explain an experimental protocol in a way I hoped my grandmother could understand (seriously!) and Shirky thinks I'm sketching out Amazon's doom? I don't expect the Semantic Web to doom anyone but folks who want to keep data exchange laborious. Re:The semantic web... (Score:4, Interesting) Thanks, I find both of these much better than the two you gave - you're both pretty succinct. One issue I have with Brickley's response is his criticism of Shirkey's alternative that we 'do nothing'.. he seems to have fallen inot the trap of 'we should to do something, this is something, therefore we should do this' (if you'll pardon the syllogism. Sometimes it is better to do nothing than to do the wrong thing; even if you don't see anything better, once that something better does come along, it is often difficult to undo that something once it's become entrenched. (Note, I'm not saying that's what's happening here, this is just a general response to someone who implies that doing nothing is always worse than doing something.) The "misquoting" is to suggest that my "how you buy a book on the Semantic Web" sketch should possibly cause Jeff Bezos to lose sleep. I was trying to explain an experimental protocol in a way I hoped my grandmother could understand Ahh, I see.. I remember that passage pretty well.. I didn't put too much stock into the 'Jeff Bezos' comment - to me, it sounded like a joke, I don't think he was seriously suggesting that anyone involved in the SW project had any such plans for Amazon (or anyone else.) All in all, thanks for your responses, they've been quite informative. Re:The semantic web... (Score:1, Interesting) The examples Shirkey uses are fundamentally flawed. In each case he uses a flawed set of axioms to produce a flawed result and decides that the TECHNIQUE is at fault. That's utterly rediculous. Using his example of himself and Boston: - The creator of shirky.com lives in Brooklyn - People who live in Brooklyn speak with a Brooklyn accent He comes up with the logical co Re:The semantic web... (Score:3, Insightful) I disagree. While his examples do show that (my initial assessment was on par with yours) he does address this issue. In each case he uses a flawed set of axioms to produce a flawed result and decides that the TECHNIQUE is at fault. Not quite - in each case he uses a flawed set of axioms, then expands on them to show that the world is not a black-and-white place, Re:The semantic web... (Score:3, Insightful) Wow, you're missing the obvious. How about this: "Clay Sharkey might speak with a Brooklyn accent." Not quite - in each case he uses a flawed set of axioms, then expands on them to show that the world is not a black-and-white place, which then shows models are imperfect (Score:5, Insightful) So we don't model the real world perfectly, we model it well enough for some set of applications in some ontology. Every database designer, nearly every programmer does this all the time. We model it well enough and then the computers... do what computers do. RDF is nothing new here. What's new is establishing a fairly wide and precise consensus around a language for communicating data about arbitrary things. Re:The semantic web... (Score:2, Informative) or search for Shirkey in the archive why care about what the W3C has to say? (Score:1, Informative) Re:why care about what the W3C has to say? (Score:2) ummmmm, ok? (Score:4, Funny) And the only browser to use the new recommendations correctly is..... Phoni... Firebi... FireFox! Re:ummmmm, ok? (Score:2) Does Firefox even have any useful RDF applications in it? I know Amaya does because it has the built-in web annotation engine, but I can't see anything in Firefox which might be RDF in nature. Unless of course, that's how it stores its bookmarks. W3C? (Score:3, Insightful) Who really cares about their recommendations? Re:W3C? (Score:2, Interesting) alt="" (Score:2, Informative) Re:alt="" (Score:2) Omitting the ALT attribute when you have nothing to say about the image would be less wasteful and much more elegant than having to write ALT="". Re:alt="" (Score:2) I think there's a semantic difference there. If you don't have an alt attribute, you are saying there is no alternative to the image. If you have alt="", you are saying there is an alternative, and that alternative is the empty string. That being said, some of the places the W3C have been seen to use alt="" are fairly wrong. For the right arrow graphic, why don't they make the alt attribute '>'? In fact, why don't they make the right arrow graphic render using CSS instead of putting it in the HTML? Re:W3C? (Score:5, Informative) Re:Where's your logic? (Score:3, Informative) If you've ever used clear gifs to space out a page just so, you've hit an area where this is important. You don't want the screen reader spitting something out for an image that the sighted can't even see. What would be the point? In the W3C page, the 8 alt="" ar Re:Where's your logic? (Score:2) Re:Where's your logic? (Score:2) or "Bar, Greater Than" or "Asterisk" Alt tags aren't supposed to be ASCII art, they're supposed to tell the user of text based - and in particular text to speech screen readers - what the image is. If the image isn't anything useful, there's no point in it saying anything. alt="" very clearly shows that this image is irrelevant, anything else just confuses things. Re:Where's your logic? (Score:2) The point is, every bit of content should be meaningful. ASCII art isn't really appropriate anywhere (IMO). Re:Where's your logic? (Score:2) I always make sure my html contains no layout whatsoever, and only structure (and content ofcourse). If you can't do it in css, you're better off not doing it at all. Otherwise your site will just break in too many corner Re:Where's your logic? (Score:2) From a strictly theoretical perspective, if I were inventing a new language called "HTML" and could be reasonably sure implementers would do it properly, I might personally accept all three, making #2 and #3 equivalent. The problem is that 99% of the HTML on the Internet is bad, and non-graphical user agents are widely deployed and know that the markup is bad. As a result, they are obligated to not consider #2 and #3 as equivalent. Re:Where's your logic? (Score:2) Microsoft Reporting Services (Score:4, Interesting) Interesting don't ya think? Peace Out. Re:Microsoft Reporting Services (Score:2) Yeah, that's interesting. Re:Microsoft Reporting Services, open yeah right! (Score:2) Re:Microsoft Reporting Services (Score:2, Troll) Or "bait-and-switch-and-embrace-and-extend", as Microsoft calls it in internal communication. The word for today is "litigation" (Score:2, Insightful) This makes me think that "security through legally -enforced obscurity" will be the order of the day in Redmond. Imagine if, say, all element names were encrypted, or were even just bloody confusing, e.g. <ioueWOIUKJRE87yjhi> arial </ioue Re:The word for today is "litigation" (Score:4, Insightful) In other words, Microsoft can easily, and without patents, stick a proprietary file format in an "open format" XML document. Don't assume that they're always going to do some evil shit just because they're Microsoft. In the case of XML, they don't have to! Obfuscation is allowed by the standard! Re:The word for today is "litigation" (Score:2) Re:Microsoft Reporting Services (Score:2) I just don't want all the fresh blood that hear about free software for the first time slashdot to be too misinformed, although since they are re About RDF (Score:2, Offtopic) Re:About RDF (Score:3, Interesting) RDF (in the abstract) doesn't use namespaces, it just uses URIs (aka URLs). (The concept of namespaces is still there in effect, as a collection of related names, in an ontology -- but that's quite different from the formalism of XML Namespaces.) Re:About RDF (Score:2) Review vocabulary (Score:4, Interesting) Re:Review vocabulary (Score:1) Anyway -- sounds like an excellent project. I'm not aware of anyone doing it quite yet..... Re:Review vocabulary (Score:1) This led to my question of whether a large repository of RDF reviews could be created and have reviews aggregated there automatically by polling RSS feeds. Of course, there could be a problem with this setup. All the large feed aggregators got tired of wasting bandwidth re-downloading eleventy b RDF Validator (Score:4, Informative) It will be very interesting to see how RDF/XUL stands up against XAML [microsoft.com]. Re:RDF Validator (Score:2) Did they ever fix the performance problems with RDF in Mozilla? I can remember waiting for 12 seconds at 100% CPU for a dialogue box to come up because the downloader was extracting information from 300 records in the previously-downloaded files list. BTW, why were they using this sort of thing to store structured information anyway? Re:RDF Validator (Score:2) There were problems with downloading in gerneral, so it may be an unrelated issue. why were they using this sort of thing to store structured information anyway? They use it for backend stuff because it makes it easier to write cross-platform code. Re:RDF Validator (Score:3, Informative) In other news... (Score:5, Funny) Speculation that these two new standards are broken versions of w3c's recent RDF and OWL releases was further confirmed when leaked documents with "w3c" blacked out in pen, the Microsoft logo added to the top with crayon and a few numbers blocked out with white out written back in with biro, came to light. Criticism of Microsoft's horrifically buggy and insecure browser Internet Exploder(tm) was shot down by Steve "Developers(tm)" Ballmer who said that features were much more important than security. "People want to browse the web with help from our new Browser Assistant(tm) to assist them. We think an animated cartoon image of an owl will reassure our customers." When another reporter pointed out that OWL had little or nothing to do with ornithology, cartoon, animated or otherwise, Steve looked a little uncomfortable and declined to answer any more questions. Shouting "Developers Developers Developers!" loudly, and squirting sweat everywhere in what can only be assumed is a defence mechanism similar to an octopus ot squid, he beat a hasty retreat into a waiting helicopter. The helicopter is later reported to have crashed. It was rebooted and a patch applied. The patch restored flying ability, but the doors no longer work. A patch is promised for the doors tomorrow. (-1 offtopic) (+1 recovering from car crash, cut me some slack) Is W3C out of touch with reality? (Score:1, Insightful) Political agendas aside, a standards body has to recognize what technologies and extensions are actually being used "in the wild" and incorporate them into the standard. Whether you like M$ or not, you have to recogni Re:Is W3C out of touch with reality? (Score:3, Insightful) Re:Is W3C out of touch with reality? (Score:2, Insightful) Maybe you should look at the standards. These aren't common end-user things like XHTML or CSS, where Microsoft's reluctance to play along dooms the standards to meaninglessness. Instead, they are two esoteric standards which would be handled by a wide range of specialised XML tools, not Grandma's web browser. There's more to "The Web" then endless HTML pages (Score:4, Insightful) Yes, they're available via http and include many web technologies but really these are about metadata and relationship information, not presentation. There's more to "The Web" then endless HTML pages, and that other space is where these are aimed at. Material using these newly set standards can be linked and searched and eventually massaged for presentation but the raw stuff isn't intended for your traditional web browser to use itself.Y'know, thats a really interesting opinion, but it would be more so if you were to tie it to the topic at hand. Yes these are quickly evolving technologies and yes, what's out in the field doesn't always match what's in the standards process. However when you talk to the folks doing this stuff IRL most will tell you they're trailblazing out of need and are quite enthusiastic about a standard eventually happening they can use. Indeed many of them are actively involved in the standard-setting process and applying the lessons they've learned. Sometimes the W3C does seem out in left field: It's got any number of way-far-ahead things cooking, as well as any number of other passed-by ones still stumbling along. It's hard to predict when starting up a committee what will be needed when they're done, nor always how it will end up being used, or if it will all be quickly irrelevant. On the other hand they're right on target much of the time, and if occasionally laggard they're as often prescient. But back to the immediate topic both these specs being set will be welcomed in many circles. Neither appears perfect but both seem quite good, immediately usable, and without great conflict to past practice. Re:Indeed, only 0.7% of all HTML document are vali (Score:2) I wonder what percentage of web page authors are even actually aware of the fact that there are standards they're supposed to be following? If people are incapable or unwilling to learn to use their own native language correctly, what makes you think they'll be willing or able to use an artificial language correctly? Considering how much web content has basic gramatical errors, I'd say the percentage is pretty low. RDF Crawlers (Score:5, Informative) Well defined semantic web ... (Score:1) from, emphasis mine Hmm, CC. Re:Well defined semantic web ... (Score:2) I'm not thrilled with the phrase, myself. My offering: The Semantic Web is the part of the Web where information is conveyed not in natural language or proprietary and legacy formats, but in languages designed s OWL (Score:5, Funny) Fast work? (Score:1) Oh I see... (Score:3, Funny) So, in 2.5 centuries, when Governamental Mandatory Internet Explorer Browser V. 7.5 do implement all of these (stolen from GPLed code, of course), all those jobs will be re-insourcered into the USA. Re:To be serious (Score:2) Unfortunatelly I guess you will have to read the articles pointed in the story. As well as the twelve other documents. When you are done, if you can make any sense of it, you could help the world by making a good sumary, and posting it in places like the nice everything2 [everything2.net] semi-clopaedia. I for myself am still to try SVG witch is a usefull WEB XML recomendation at all. Re:To be serious (Score:3, Informative) A fun place to start in RDF is making a foaf page. Foaf is the friend of a friend vocabulary. If you search for foaf in google you should find stuff to help you start with it. This lets you track things like degrees of seperation between people. You can write OWL markup that describes the conte He he he... (Score:3, Funny) Ok, back into my hovel I go, Joe Lost and without a clue (Score:2, Interesting) Re:Lost and without a clue (Score:2) Markup (Score:3, Interesting) If the markup is part of the content, it's not really pure content, or good markup. Markup tags should reference the content, not be embedded in it. The separate Structure, Content and Markup layers should all be parsable without knowledge of the others. --Mike-- Umm... Clue me in about Ontology (Score:1) 1 : a branch of metaphysics concerned with the nature and relations of being 2 : a particular theory about the nature of being or the kinds of existents. So, WTF does that mean and what does it have to do with information? Re:Umm... Clue me in about Ontology (Score:4, Informative) That is, an OWL ontology tells readers (especially computers) what kinds of things exist and what kinds of relationships they can have to each other. Some of the OWL specs are actually pretty readable. Try starting with the OWL Overview [w3.org]. (Others, like OWL Semantics, are... more challenging.) Re:Umm... Clue me in about Ontology (Score:3, Informative) OWL and RDF schemas are ontologies in the philosophical sense in that they define a set of entities and relations which allow you to make meaningful inferences from assertions framed in terms defined by the ontologies in question. An Ontology defines the categories and relations that make up a world. Ontologies are not themselves information (except in the trivial sense) but rather structures which RDF? (Score:1) Anyone remember Borland? (Score:1) Ornothology? (Score:2) Did anyone else misread that as OWL Web Ornothology Language? Re:Ornothology? (Score:2) Especially since our primary office is in a building with many doctor's offices. OWL Web Ontology Language (Score:2) Re:OWL Web Ontology Language (Score:1, Informative) It says: Q. What does the acronym "OWL" stand for? A. Actually, OWL is not a real acronym. The language started out as the "Web Ontology Language" but the Working Group disliked the acronym "WOL." We decided to call it OWL. The Working Group became more comfortable with this decision when one of the members pointed out the following justification for this decision from the noted ontologist A.A. Milne who, in his influential book "Winnie the Pooh" stated of the wise character OWL: "He c Re:OWL Web Ontology Language (Score:3, Interesting) Also, consider the A. A. Milne character Owl, who "could spell his own name WOL, and he could spell Tuesday so that you knew it wasn't Wednesday, and he could read quite comfortably when you weren't looking over his shoulder saying "Well?" all the time...". Re:And with Microsoft's market control (Score:2, Interesting) Most blogs have RDF/RSS feeds right now. And just a few days ago there was an article right here on /. about embedding licensing information in web sites - more semantic webbery ;) Microsoft? Didn't they use to make a browser or something? Re:Once again, Microsoft Research leads the way. (Score:2, Informative) Re:Once again, Microsoft Research leads the way. (Score:2) Re:What language is the word 'Ontology' in? (Score:1) Re:Exchange information! (Score:2) The idea is basically that my web page contains a lot of information about me, but most of it is only interpretable by a human. If I have a format for saying "Amy a person", "Amy reads slashdot", and a way that we c Re:GREAT!!! (Score:2) Nah, I'll make the troll. RDF is a way of trying to force people to write a single web page twice: once for the computer, and once for the human, both containing exactly the same information. This is a workaround for the problem of artificial intelligence not accelerating fast enough, because if it were, we wouldn't need anything like RDF, the bots would just read the damn web site.
https://slashdot.org/story/04/02/10/1527201/rdf-and-owl-are-w3c-recommendations
CC-MAIN-2017-17
refinedweb
4,337
63.7
GNU C++ version 4.1.0 20050810 This little program: struct qd_real { double x[4]; inline qd_real(double x0, double x1, double x2, double x3) { x[0] = x0; x[1] = x1; x[2] = x2; x[3] = x3; } }; #define TWO(x) x, x const qd_real sin_table[] = { TWO( TWO( TWO( TWO( TWO( TWO( TWO( TWO( TWO( TWO( qd_real(1, 2, 3, 4) )))))))))) }; takes about 25 seconds to compile on my machine, although it's only 1000 lines or so. Compile time seems to scale roughly linear, but it's pretty damn slow. 2.95 takes 6 seconds, but that's without checking, so it's not entirely fair. Profile: samples % symbol name 3483 14.2530 rtx_equal_for_memref_p 2016 8.2498 find_base_term 1765 7.2227 canon_rtx 1493 6.1096 memrefs_conflict_p 1189 4.8656 for_each_rtx_1 1052 4.3049 nonoverlapping_memrefs_p 921 3.7689 rtx_equal_p 690 2.8236 exp_equiv_p 640 2.6190 addr_side_effect_eval 579 2.3694 canon_true_dependence 504 2.0624 check_dependence 479 1.9601 is_gimple_stmt 460 1.8824 ggc_alloc_stat 343 1.4036 for_each_rtx 327 1.3381 walk_tree 300 1.2276 base_alias_check 270 1.1049 poison_pages 258 1.0558 schedule_block 253 1.0353 cse_insn The only things in your profile which is tree based: 479 1.9601 is_gimple_stmt 327 1.3381 walk_tree The rest are rtl based. So this is a RTL issue. (In reply to comment #1) > The only things in your profile which is tree based: > 479 1.9601 is_gimple_stmt > 327 1.3381 walk_tree Oh and those are most likely just checking and nothing more. earth:~>time gcc -O1 t.cc -S 5.993u 0.056s 0:06.18 97.7% 0+0k 0+0io 0pf+0w earth:~>time gcc -O1 t.cc -S -O2 11.529u 0.058s 0:11.84 97.7% 0+0k 0+0io 0pf+0w earth:~>time gcc t.cc -S 0.426u 0.012s 0:00.93 46.2% 0+0k 0+0io 0pf+0w This is without checking disable. Interesting 2.95.3 does not have the issue even with -fstrict-aliasing: earth:~>time ~/ia32_linux_gcc2_95/bin/gcc t.cc -S 0.248u 0.019s 0:00.51 49.0% 0+0k 0+0io 0pf+0w earth:~>time ~/ia32_linux_gcc2_95/bin/gcc t.cc -S -O1 1.259u 0.013s 0:01.63 77.3% 0+0k 0+0io 0pf+0w earth:~>time ~/ia32_linux_gcc2_95/bin/gcc t.cc -S -O2 1.630u 0.021s 0:01.90 86.8% 0+0k 0+0io 0pf+0w earth:~>time ~/ia32_linux_gcc2_95/bin/gcc t.cc -S -O2 -fstrict-aliasing 1.626u 0.018s 0:01.81 90.0% 0+0k 0+0io 0pf+0w This has been a bug since 3.0.4. It also happens on x86 too. On the mainline at -O3 on x86_64-pc-linux-gnu: CSE : 2.15 (13%) usr 0.01 ( 7%) sys 2.14 (12%) wall 257 kB ( 0%) ggc CSE 2 : 1.50 ( 9%) usr 0.00 ( 0%) sys 1.49 ( 9%) wall 0 kB ( 0%) ggc reload CSE regs : 2.19 (13%) usr 0.00 ( 0%) sys 2.20 (13%) wall 257 kB ( 0%) ggc load CSE after reload : 8.46 (50%) usr 0.00 ( 0%) sys 8.46 (49%) wall 0 kB ( 0%) ggc So this is definitely a RTL problem. (In reply to comment #4) > load CSE after reload : 8.46 (50%) usr 0.00 ( 0%) sys 8.46 (49%) wall 0 kB ( 0%) ggc This is only thing which does not show up at -O2. The rest shows up with about the same compile time. I'll look at the "load CSE after reload" (postreload-gcse, gddmmtgrmbl!), which I've looked at before. The top functions in the profile of the report are from RTL alias analysis. Even the bad timings for postreload-gcse are almost entirely to blame on RTL alias analysis: CPU: P4 / Xeon with 2 hyper-threads, speed 3194.18 MHz (estimated) Counted GLOBAL_POWER_EVENTS events (time during which processor is not stopped) with a unit mask of 0x01 (mandatory) count 1000000 samples % symbol name 4503 10.9264 rtx_equal_for_memref_p 3080 7.4736 canon_rtx 2298 5.5760 memrefs_conflict_p 2219 5.3844 find_base_term 2057 4.9913 ix86_find_base_term 1877 4.5545 nonoverlapping_component_refs_p 1474 3.5766 for_each_rtx_1 1412 3.4262 nonoverlapping_memrefs_p 1386 3.3631 addr_side_effect_eval 1279 3.1035 mems_in_disjoint_alias_sets_p 764 1.8538 get_addr 710 1.7228 exp_equiv_p 682 1.6549 invalidate 604 1.4656 check_dependence 587 1.4243 is_gimple_stmt 579 1.4049 cselib_invalidate_mem 553 1.3418 canon_true_dependence 532 1.2909 rtx_equal_p 406 0.9851 cse_insn 398 0.9657 decl_for_component_ref 359 0.8711 ldst_entry 341 0.8274 verify_expr 304 0.7376 walk_tree 272 0.6600 alias_sets_conflict_p 272 0.6600 base_alias_check I'd like to see this fixed. Is there any throttling we can do here? For reload CSE there is --param max-cselib-memory-locations=10 that cuts it's time to 1%, overall. Since this testcase is sort of designed to excercise the worst case behaviour, I think it is not too bad... alias analysis has: /* Maximum length of pbi->mem_set_list before we start dropping new elements on the floor. */ #define MAX_MEM_SET_LIST_LEN 100 perhaps unifying all these lists would make sense. Would that be applicable for 4.1? (Ie I would have to pick some common value, like 300 - cselib defaults to 500) CSE has: /*. */ I am not sure if I can fit memory specific limit in this (it would be nice to simply throw away old entries rather than flushing it all), or we can just keep it. None of these algorithms would grow ad infimum and manifest worse behaviour than in this testcase, so I would not consider it P2 Honza Created attachment 10134 [details] Preprocessed test case This is not a designed test case, it's distilled from a real-world application (libqd). I've attached the original source. g++ -O2 takes 103s for 33667 lines (about 1M, not really very large for preprocessed C++). Subject: Re: [3.4/4.0/4.1 Regression] Long compile time for array initializer with inlined constructor Hmm, OK, this adds the neccesary knobs so you can trottle the parameters even further. Sadly this brings quite dificult to tune parameters since reducing them considerably might easilly ruin code quality and I am unsure how we want to proceed... (IE keep them high and change your makefiles or try to reduce them to something more scalable) Honza 2005-11-03 Jan Hubicka <jh@suse.cz> *. Index: doc/invoke.texi =================================================================== --- doc/invoke.texi (revision 106422) +++ doc/invoke.texi (working copy) @@ -5934,6 +5938,13 @@ given basic block needs to have to be co Select fraction of the maximal frequency of executions of basic block in function given basic block needs to have to be considered hot +@item max-predicted-iterations +The maximum number of loop iterations we predict statically. This is useful +in cases where function contain single loop with known bound and other loop +with unknown. We predict the known number of iterations correctly, while +the unknown nummber of iterations average to roughly 10. This means that the +loop without bounds would appear artifically cold relative to the other one. + @item tracer-dynamic-coverage @itemx tracer-dynamic-coverage-feedback @@ -5971,6 +5982,9 @@ order to make tracer effective. Maximum number of basic blocks on path that cse considers. The default is 10. +@item max-cse-insns +The maximum instructions CSE process before flushing. The default is 1000. + @item global-var-threshold Counts the number of function calls (@var{n}) and the number of @@ -6031,6 +6045,10 @@ value is 100. The maximum number of memory locations cselib should take into acount. Increasing values mean more aggressive optimization, making the compile time increase with probably slightly better performance. The default value is 500. + +@item max-flow-memory-location +Similar as @option{max-cselib-memory-location} but for dataflow liveness. +The default value is 100. @item reorder-blocks-duplicate @itemx reorder-blocks-duplicate-feedback Index: flow.c =================================================================== --- flow.c (revision 106422) +++ flow.c (working copy) @@ -141,6 +141,7 @@ Software Foundation, 51 Franklin Street, #include "obstack.h" #include "splay-tree.h" #include "tree-pass.h" +#include "params.h" #ifndef HAVE_epilogue #define HAVE_epilogue 0 @@ -283,10 +284,6 @@ static int ndead; static int *reg_deaths; -/* Maximum length of pbi->mem_set_list before we start dropping - new elements on the floor. */ -#define MAX_MEM_SET_LIST_LEN 100 - /* Forward declarations */ static int verify_wide_reg_1 (rtx *, void *); static void verify_wide_reg (int, basic_block); @@ -630,7 +627,7 @@ update_life_info (sbitmap blocks, enum u /* We repeat regardless of what cleanup_cfg says. If there were instructions deleted above, that might have been only a - partial improvement (see MAX_MEM_SET_LIST_LEN usage). + partial improvement (see PARAM_MAX_FLOW_MEMORY_LOCATIONS usage). Further improvement may be possible. */ cleanup_cfg (CLEANUP_EXPENSIVE); @@ -2515,7 +2512,7 @@ add_to_mem_set_list (struct propagate_bl } } - if (pbi->mem_set_list_len < MAX_MEM_SET_LIST_LEN) + if (pbi->mem_set_list_len < PARAM_VALUE (PARAM_MAX_FLOW_MEMORY_LOCATIONS)) { #ifdef AUTO_INC_DEC /* Store a copy of mem, otherwise the address may be Index: cse.c =================================================================== --- cse.c (revision 106422) +++ cse.c (working copy) @@ -6890,7 +6890,7 @@ cse_basic_block (rtx from, rtx to, struc ??? This is a real kludge and needs to be done some other way. Perhaps for 2.9. */ - if (code != NOTE && num_insns++ > 1000) + if (code != NOTE && num_insns++ > PARAM_VALUE (PARAM_MAX_CSE_INSNS)) { flush_hash_table (); num_insns = 0; Index: predict.c =================================================================== --- predict.c (revision 106422) +++ predict.c (working copy) @@ -624,8 +624,9 @@ predict_loops (struct loops *loops_info, niter = desc.niter + 1; if (niter == 0) /* We might overflow here. */ niter = desc.niter; - if (niter > MAX_PRED_LOOP_ITERATIONS) - niter = MAX_PRED_LOOP_ITERATIONS; + if (niter + > (unsigned int) PARAM_VALUE (PARAM_MAX_PREDICTED_ITERATIONS)) + niter = PARAM_VALUE (PARAM_MAX_PREDICTED_ITERATIONS); prob = (REG_BR_PROB_BASE - (REG_BR_PROB_BASE + niter /2) / niter); @@ -653,19 +654,17 @@ predict_loops (struct loops *loops_info, if (TREE_CODE (niter) == INTEGER_CST) { int probability; + int max = PARAM_VALUE (PARAM_MAX_PREDICTED_ITERATIONS); if (host_integerp (niter, 1) && tree_int_cst_lt (niter, - build_int_cstu (NULL_TREE, - MAX_PRED_LOOP_ITERATIONS - 1))) + build_int_cstu (NULL_TREE, max - 1))) { HOST_WIDE_INT nitercst = tree_low_cst (niter, 1) + 1; probability = ((REG_BR_PROB_BASE + nitercst / 2) / nitercst); } else - probability = ((REG_BR_PROB_BASE - + MAX_PRED_LOOP_ITERATIONS / 2) - / MAX_PRED_LOOP_ITERATIONS); + probability = ((REG_BR_PROB_BASE + max / 2) / max); predict_edge (exits[j], PRED_LOOP_ITERATIONS, probability); } Index: params.def =================================================================== --- params.def (revision 106422) +++ params.def (working copy) @@ -309,6 +309,22 @@", @@ -363,6 +379,10 @@ DEFPARAM(PARAM_MAX_CSE_PATH_LENGTH, "max-cse-path-length", "The maximum length of path considered in cse", 10, 0, 0) +DEFPARAM(PARAM_MAX_CSE_INSNS, + "max-flow-memory-locations", + "The maximum instructions CSE process before flushing", + 1000, 0, 0) /* The cost of expression in loop invariant motion that is considered expensive. */ @@ -417,6 +437,10 @@ DEFPARAM(PARAM_MAX_CSELIB_MEMORY_LOCATIO Index: predict.def =================================================================== --- predict.def (revision 106422) +++ predict.def (working copy) @@ -58,18 +58,6 @@ DEF_PREDICTOR (PRED_UNCONDITIONAL, "unco DEF_PREDICTOR (PRED_LOOP_ITERATIONS, "loop iterations", PROB_ALWAYS, PRED_FLAG_FIRST_MATCH) -/*. */ -#define MAX_PRED_LOOP_ITERATIONS 100 - /* Hints dropped by user via __builtin_expect feature. */ DEF_PREDICTOR (PRED_BUILTIN_EXPECT, "__builtin_expect", PROB_VERY_LIKELY, PRED_FLAG_FIRST_MATCH) Subject: Bug 23490 Author: hubicka Date: Sat Nov 5 00:55:23 2005 New Revision: 106520 URL: Log: PR rtl-optimization/23490 *. Modified: trunk/gcc/ChangeLog trunk/gcc/cse.c trunk/gcc/doc/invoke.texi trunk/gcc/flow.c trunk/gcc/params.def trunk/gcc/predict.c trunk/gcc/predict.def Fixed at least on the mainline. Fixed in GCC-4.1.0 and higher hehe: tree DSE : 4.79 (14%) usr 0.05 ( 6%) sys 5.11 (14%) wall 2 kB ( 0%) ggc tree PRE : 9.79 (29%) usr 0.12 (14%) sys 10.32 (29%) wall 2016 kB ( 1%) ggc tree FRE : 9.68 (29%) usr 0.10 (12%) sys 10.09 (28%) wall 112 kB ( 0%) ggc Note this is with checking enabled so they might not be good numbers.
https://gcc.gnu.org/bugzilla/show_bug.cgi?format=multiple&amp;id=23490
CC-MAIN-2019-18
refinedweb
1,862
62.14
Is it possible to pass a run time parameter to a variable in sikuli code. I had hardcoded password in my code and I need to pass it in runtime..Is it possible? Question information - Language: - English Edit question - Status: - Solved - For: - Sikuli Edit question - Assignee: - No assignee Edit question - Solved: - 2012-04-16 - Last query: - 2012-04-16 - Last reply: - 2012-04-16 Thanks RaiMan. Is there option available to mask the typed word with asterisk? This is not available currently as a feature of input() (is on the agenda though). As a workaround, you can use the underlying Java classes directly. A working example: import javax.swing. import javax.swing. pwdF = JPF() pwdValid = "123456" isValid = False trials = 3 while trials > 0: trials -= 1 result = JOP.showConfirm "Please enter Password ( 3 trials )", if result <> 0: break if pwdValid <> pwdF.getText(): continue else: isValid = True break if isValid: popup("Hello welcome") else: popup("Sorry, go to hell!") Thanks RaiMan, That solved my problem. Thanks RaiMan, that solved my question. import javax.swing. import javax.swing. pwdF = JPF() JOP.showConfirm "Please enter Password", passwd = pwdF.getText() does it work? yes it does use the input() feature: pass = input("pls. enter password")
https://answers.launchpad.net/sikuli/+question/193527
CC-MAIN-2017-39
refinedweb
200
69.07
React Native - Create Your Own Accordion ObjectHello every one, today in this article we are going to talk about how can we create our own external object and we will import it inside our project. Now lets get started... First I have to talk about what is accordion and what it does ? Sometimes there will be so many components on our screen and it will be hard to find what we are looking for. In this time groupping and hiding what we are not looking for the components is the best. We can do this with accordion component. In this project example we are going to build an accordion that will have the ability opening and closing like an accordion. So we can hide and unhide the unnecessary components from the screen. Now lets get started to code our accordion external framework. I have created a framework folder and file like in the below image : Under the project folder I have created the frameworks folder to keep other frameworks and under it Accordion folder. In here I have created just an index file. We are going to write our java script codes in this file. Now we are ready. First we need to import libraries we will use. Basically I have imported below libraries. import React, { Component } from 'react'; import {StyleSheet,Text,View,TouchableHighlight,Animated,Image} from 'react-native'; Now we need to EXPORT our class. export default class Accordion extends Component{ //lets write some code here to configure. //show time :) render(){ return( //our components to show. ); } } After this we need to create our constractor and wrtie codes that we will need. Below section I have a constractor and a function to make toggle process. Let me explain this in the code. We need to write these code block inside default class and before render() function. constructor(props){ super(props); //Here we hold the expanded data. When this value get changed //it will re render the current component and changed expanded value this.state = { expanded : false }; } //In this function we will change the expanded value in state //So it will re-render the component with changed expanded value toggle(){ this.setState({ expanded : !this.state.expanded }); } Our functions are ready tu use. Now we need to call this function from a button or something like that. Let me design a screen to do this. render(){ //Here we have specified the icons we use //for hide/unhide toggle button let togge_icon= './images/buttons/down_arrow.png'; if(this.state.expanded){ togge_icon= './images/buttons/up_arrow.png'; } //return our component's screen return ( <View style={styles.container}> <View style={styles.titleContainer}> <Text >{this.props.title}</Text> <TouchableHighlight style={styles.button} onPress={this.toggle.bind(this)} <Image style={{height:20,color:"gray",marginRight:10 }} source={require(togge_icon)} /> </TouchableHighlight> </View> { this.state.expanded && ( <View style={{padding: 10, paddingTop : 0, }}> {this.props.children} </View> ) } </View> ); } As you can see above there are properties name like this.props... . With these keywords we will pass our datas. We are going to set the title and the components will be grouped by the accordion. Here the examples : this.props.title and this.props.children. After the title section now we need to place our children objects. These objects will send by the main class. You can edit your own StyleSheet classes. I will not pu that here. Now we are ready to use this component in MainClass. I will use this component in App.js file. I will place it under a View component. In here I will share the code and explain it later part by part. Now let me start to explain App.js file : First we need to import our Accordion framework. Below code section will import our external library: //Here import the external library import Accordion from './../frameworks/Accordion/index'; After including now we are ready to use this library. Below code section has an example of accordion. <Accordion title="Social Media Accounts" > <View style={{flexDirection:'row', width: window.width,height:40, margin: 5, padding:2, alignItems:'center', justifyContent:'center', backgroundColor:'#fff'}}> <View style={styles.btnContainer}> <TouchableHighlight style={styles.btnUserActionsSquare} onPress={() => { }} > <View style={styles.btnContainer}> <Image style={styles.btnSocialIcon} source={require('./../images/social/facebook.png')} /> </View> </TouchableHighlight> </View> //include here more social account areas... </Accordion> Basically it will be showed like below : That's all in this article. Have a nice coding. Burak Hamdi TUFAN
https://thecodeprogram.com/react-native---create-your-own-accordion-object
CC-MAIN-2021-31
refinedweb
728
60.92
What do you think about the following C Code ? What will be the output. #include <stdio.h> int main (void) { static int a = 3; if (a == 0) { return 0; } printf ("going down\n"); a--; main (); printf ("coming up\n"); return 0; } It is actually not very difficult to compute the output of this C Code. This has a static integer in the main function a initialized to 3. After the declaration of the variable the value of the variable is checked if it is zero. If yes the control returns, else it prints the string “Going Down”, decrements the value of a and then calls main (recursively). Because a is static it will remember the updated value throughout the subsequent function calls (lifetime throughout the execution of the code). As a is initialized to 3, after 3 such recursive calls a will be 0 and the the if block will be executed, which will start the roll back of the recursive call. After returning to each level of the recursive depth of the function the string “Coming Up” will be printed (total 3 times), and then the program terminates. There is no magic in the program, and basically i have wasted 2 mins writing the above paragraph. This is not the target of this post, to show that it is possible to make recursive calls in main. Instead the target of the post is to show how things differ in the case of C++. You probably have noted that i have emphasized that the code is in C language like this: “C Code”. What do you think the output will be if the same code was written in C++ (replacing the printfs with cout). Here is the modified code (for the sake of completeness). #include <iostream> using namespace std; int main (void) { static int a = 3; if (a == 0) { return 0; } cout << "going down\n"; a--; main (); cout << "coming up\n"; return 0; } If you compile the above piece of code it will compile without any errors or warnings (Tested in g++ (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)). Also it will (may) run and have identical output as it was in C. So what’s the point? The point is that calling the main function inside the program and also calling it recursively is undefined behaviour. C++ Standards talk about these in Section 3.6.1 Paragraph 3 Recursive calls are permitted, except to the function named main. and Section 5.2.2 Paragraph 9 The function main shall not be used within the program. … … … If you compile with the -pedantic flag in g++ then you can see the compiler talking about this issue. $ g++ rec_main.cpp -pedantic rec_main.cpp: In function ‘int main()’: rec_main.cpp:15:9: warning: ISO C++ forbids taking address of function ‘::main’ [-pedantic] I did not find any such restriction in the C standards. What i found about recursive calls in the C99 standards in Section 6.5.2.2 Paragraph 11 is as follows Recursive function calls shall be permitted, both directly and indirectly through any chain of other functions. Therefore calling main recursively in C Language is deterministic. But as per C++ standards calling main from any function or recursively is not allowed. So be careful, C++ is not an updated and advanced C Language, it is a different language, which look like C. 3 thoughts on “C Q&A #4: Calling main recursively” Good post, but I did not get the purpose of the post. Ohh…. extremely sorry… the post was not completely loaded. Some of the sections in the middle were not seen at the first time. Now I can understand. Yes, the main purpose was to show the different behaviour of the function main in C and C++ Languages. Thanks for stopping by.
https://phoxis.org/2012/10/06/c-qa-4-calling-main-recursively/
CC-MAIN-2019-18
refinedweb
638
72.46
On a recent project, I undertook the task of implementing a RESTful API using the new Asp.Net WebAPI framework. The aim was to support clients of all types, including a .Net desktop app and iOS and Android mobile apps. My API had to support some sort of authentication mechanism. Since this was a basic application (to be used as a learning tool for the other developers on our team) we decided to use Basic HTTP Authentication. As the name suggests, it’s a simple protocol whereby the client sends an authorization token as a header in the HTTP request, and the server decodes that token to decide whether or not it is valid. If it is, the request continues, otherwise it (should) return a 401 Unauthorized response. So how can we implement this with WebAPI? With an Action Filter, of course. The Basic Authentication Action Filter Start by creating a new class for your filter. This must inherit from System.Web.Http.Filters.ActionFilterAttribute, which is different from the normal namespace that are used for Asp.Net MVC Action Filters. This one lives in System.Net.Http.Filters. Be careful to subclass the correct type and don’t get confused. Also, override the OnActionExecuting method: public class BasicAuthenticationAttribute : System.Web.Http.Filters.ActionFilterAttribute { public override void OnActionExecuting(System.Web.Http.Controllers.HttpActionContext actionContext) { } } We will use this method to intercept the API and check that everything is OK with the security side of things (well, as OK as Basic Auth can be!). First, lets check we have an authorization header: if (actionContext.Request.Headers.Authorization == null) { actionContext.Response = new System.Net.Http.HttpResponseMessage(System.Net.HttpStatusCode.Unauthorized); } Simple stuff here. The fact that this action filter is executing implies that we want to protect the action that it attributes, and so if we don’t have a header, we’re not authorized. If we have a header, lets parse the value: else { string authToken = actionContext.Request.Headers.Authorization.Parameter; string decodedToken = Encoding.UTF8.GetString(Convert.FromBase64String(authToken)); string username = decodedToken.Substring(0, decodedToken.IndexOf(":")); string password = decodedToken.Substring(decodedToken.IndexOf(":") + 1); ... } Just grab the header value, decode it from Base64 back to a string, and then split it. The value that is encoded would normally:, but really if this is a custom solution you can make it anything you want if you’re in control of how the value is encoded and decoded (which here I am – I just decided to follow the standard). Now that we have the username and password, it really is up to you as to how you use it. The normal thing would be to look up some database value and check if the user exists. In my case, I grab a couple of services to find the user that the credentials refer to, and I set the user into the current principal. I then defer execution to the base filter and allow the action to run: IPasswordTransform transform = DependencyResolver.Current.GetService<IPasswordTransform>(); IRepository<User> userRepository = DependencyResolver.Current.GetService<IRepository<User>>(); User user = userRepository.All(u => u.Username == username && u.PasswordHash == transform.Transform(password)).SingleOrDefault(); if (user != null) { HttpContext.Current.User = new GenericPrincipal(new ApiIdentity(user), new string[] { }); base.OnActionExecuting(actionContext); } If the user wasn’t found, simply return a 401: else { actionContext.Response = new System.Net.Http.HttpResponseMessage(System.Net.HttpStatusCode.Unauthorized); } In the code above where I set HttpContext.Current.User, I am just using a custom type called ApiIdentity, which is an implementation of IIdentity and allows me to store a user entity against the username. For brevity, it’s implementation is: using System.Security.Principal; public class ApiIdentity : IIdentity { public User User { get; private set; } public ApiIdentity(User user) { if (user == null) throw new ArgumentNullException("user"); this.User = user; } public string Name { get { return this.User.Username; } } public string AuthenticationType { get { return "Basic"; } } public bool IsAuthenticated { get { return true; } } } Using the Basic Authentication action filter To use this thing, just decorate any action or controller with [BasicAuthentication], and any requests to those actions will require that the Authorization header is sent: // GET /api/accounts [BasicAuthentication] public IEnumerable<OwnerAccountDto> Get() { var accounts = _accountsRepository.All(a => a.OwnerKey == AuthorizedUser.Guid).ToList(); return Mapper.Map<IEnumerable<OwnerAccountDto>>(accounts); } I went one step further than this and created an AuthorizedApiController which already has this attribute on it. Furthermore, I added an accessor to get the actual user entity that was authorized when the request was made: [BasicAuthentication] public class AuthorizedApiController : ApiController { public User AuthorizedUser { get { return ((ApiIdentity)HttpContext.Current.User.Identity).User; } } } A quick note on unit testing: having this property return something straight out of the current HttpContext instance mucks things up a little for unit testing, since there won’t be a context to look at in that scenario. The way to combat it is to either: - Create a provider model to retrieve the authenticated user through some IAuthenticatedUserProvider interface - Use a framework such as Moq to allow you to mock up a context just for this scenario (available through Nuget too) Now you have the tools to custom-build an authentication scheme for your Web Api. Happy.. authenticating! 52 thoughts on “Basic Authentication with Asp.Net WebAPI” Nice job done!! Thanks, I’m glad you enjoyed it! Sorry if I am sounding ignorant, but is the authorization token generated on the client? If so how do you generate the token then pass it as a header in the HTTP request? Have you done this using backbone.js? This article is awesome, and the first time I have read an easy-to-grasp REST Authentication post. Thank you! Tyrone In our specific case, the server generates the auth token by encoding the concatenated username and password as Base64 (the reverse of what is described in the article) and sending it back to the client via a HTTP header when it performs their ‘log in’ action. The clients then store this auth token and send it with each subsequent request that requires it. If the format of the auth token is well known (as it is in my case), you could also just generate this yourself on the client and send that without having the server do this work. It’s a good question – I shall update the original article with this point. Thanks! Nice to find such easy to follow and “get” article. Thanks Steve. Like Tyrone, I also need to figure how to deal with this from the client side (I must send jquery “demo’s” to the guys building the mobile client) as well as when / how to sent out those tokens. You mention updating an original article? Thanks again…going to spend some time around your blog now. ;-) Hi , Thanks a lot. Very good article. it was very helpful for me to implement basic authentication. I am wondering is there any possibility to keep the generated token and send it in subsequent request from client. if so really appreciate if you can provide some sample code. At the moment i have to send username and password for every subsequent request and authenticate.. Great article and well explained. Thank you! Thanks! I think base64encoding is weaker for sending passwords over http. Consider using some other encryption technology. No one is going to argue with you on that one. For a simple application posed as a learning tool, however, it’s perfectly sufficient. It’s really simple and nice. Thank you very much. Quite easy to understand and informative. Thanks Hi – this appears to solve a problem I’ve been tasked with – however, can I make a small request please? Would it be possible to provide a VS project file for this. I can’t follow where all the code should go, from the snippets above, eg the IPasswordTransform part, and the APIIdentity part. Thank you very much, Mark Hi – please ignore me – got it working just fine! Cheers, great post, and has really helped me. Mark No problem Mark, I just came on to comment but if you’ve already sorted it, great! The thing with those particular classes that you mention are really up to your solution and aren’t really a part of the Authentication per-say; I tried to get that across in the article but it could have been more clear. Great Article. Just one question, excuse my ignorance, how would a javascript / jquery client perform the authentication and following requests? Thanks Hi – you can use the beforeSend attribute: cheers, Mark Fry, With jQuery/Javascript, you just need to be able to alter the headers and send along the auth token with each request. I believe jQuery.Ajax allows you to do this. In my solution, when actually performing authentication, we just send the username and password to the authenticate API action (as a form post, but you can also use JSON). When the response is returned, you just have to be able to read header values and retrieve the AuthToken header. If you can do those two things (read and write headers) then you should be able to do what I describe in the article. Bear in mind that this is just my implementation – the finer details of how the complete authentication scenario is implemented may vary from other implementations out there. Do you specific example to retrieve the AuthToken header in jQury/javascirpt and then set into headers for api requests Do you have a link to download the project? Thanks Hi Ashish, Unfortunately I don’t have a mini project to share with you. This post was derived from a much larger internal project for my organisation, which I cannot share unfortunately. Hi Steve, Quick question: How would you send the authorization header using the HttpClient class from .NET 4.5? Hi Steve, I’m going to implement Digest Authentication into Web API, have you implemented it ? I see that in the class ApiIdentity you have a user type User, which .NET assembly I need to add reference or it’s just your own custom entity ? Thanks so much Hi, I haven’t implemented it, no. The User entity is completely born out of my own solution, and simply exists to serve as a convenient reference to the current user object from my database, which is retrieved using the authentication credentials. How you implement this (or indeed, whether or not you even need it) is entirely up to you. Thanks for response. Have you tried to implement Digest Authentication with the API ? I have ever integrated Digest Authentication for WCF RESTful API () but now I move to Web API and look like I can’t follow the same approach Hi Steve, I have gone through and very well explained, Could you please share how the client code code looks. Hi, I haven’t completed any client code for this sample. However, all you would need to do is use a client which allows you to get and set HTTP headers (for example, if your client is Javascript, then you can get and set the headers while making Ajax calls). If you’re using the WebClient class in .Net, then you can get/set headers there too. Hope that helps! good post thanks. very nice Hey, This solution worked great. One thing I can’t get working is getting the current user. You used the controller AuthorizedApiController and called it with AuthorizedUser.Guid. This does not work for me. Could you suggest anything that I am doing wrong? How you actually query your own data source and retrieve your users is part of your own solution. Within our solution, we had a controller named AuthorizedApiController which does have some methods on it which have some helper properties on it and such. In other words, it’s not pertinent to the real point, which is to show how to achieve basic authentication within WebApi. Great post. Very clear and exactly what I was looking for. Thanks Eric! I’ve implemented my own solution of the same problem. Unfortunately, we also have the testing issue. I would rather not use Moq, but try out your IAuthenticatedUserProvider interface idea. But I’m a bit at a loss on where to start there. Could you explain this idea a little further? Hi Remy, This is a very simple case of Dependency Injection with Asp.Net WebApi. In the project that the excerpt in this article was taken from, we were using Ninject to inject an instance of IAuthenticatedUserProvider into our controllers, which is in turn provided to any other dependencies which need it. I have an article on Dependency Injection also on my blog and I’m sure that there are other articles which cover using Ninject with WebApi. It facilitates testing pretty well, because you can then just pass an instance of something which implements IAuthenticatedUserProvider which provides some meaningful data to the controllers you’re injecting into. Hope that helps! Thanks for providing such a great explanation. Helped me a lot. Thanks Glenn, I’m glad you found it useful! I used Basic Authentication, but then uploaded my project to Azure only to find that Azure has Basic Authentication disabled. Thanks for this article. Very useful for my implementation. The only addition I would add is that in the BasicAuthenticationAttribute, when the authorisation header is null, you should return the WWW-Authenticate header so the client knows to send the authentication header. Steve – great article it has been helpful. One question – why did you choose to override ‘OnActionExecuting’ as opposed to ‘OnAuthorization’ as many of the other examples doing Basic Authentication with Web API have done? Just curious if there was an explicit reason or advantage. You can see the following SO post for a description of both: asp.net mvc difference between OnAuthorization and OnActionExecuting How about doing this using IHttpModule as described here: and here: ? Thanks for share this. Very nice! This a very good post, I just want to know how should be the client ajax call for this kind of authentication? Tks Awesome article, great and simple explanation. I did almost exactly the same thing, but a bit reversed (the authentication token is sent back upon the “Login” action – which similar to one of your answer to some question here). I have a bit more complicated authorization process which uses roles etc. Thanks! I would be very happy if you could provide the source code.
http://stevescodingblog.co.uk/basic-authentication-with-asp-net-webapi/
CC-MAIN-2014-15
refinedweb
2,403
56.35
QString in Qt This example demonstrates some basic Qt string functions. Note:Some of images are from qt Creator IDE V4.5 and the code associated with images can also be executed in carbide c++ 2.0 Various Function and Operators - If you want to append a certain number of identical characters to the string, use operator+=() The final content of str is "Hello" followed by ten "X": "HelloXXXXXXXXXX". - Prepends the string Hello to the beginning of str and returns a reference to this string. The content of str is "Hello world". - Returns a lowercase copy of the string. The content of lowerCase is "hello". The content of str is still "HELLO", the method QString::toLower() does not modify the string, it returns a lowercase version of the string. Code snippet using QString The following example show the use of QString in a graphical application. QLabel is a widget capable of displaying text or images. #include <QApplication> #include <QLabel> #include <QString> #include <QVBoxLayout> int main(int argc, char *argv[]) { QApplication app(argc, argv); QString str("world"); QString sizeOfWorld = QString::number(str.size()); // resize the string and removes last two characters str.resize(3); // str = "wor" // Add "Hello " at the beginning str.prepend("Hello "); // str = "Hello wor" // Add "ld" at the end str.append("ld"); // str = "Hello world" // Remove 6 characters at position five, and insert " India" at this position str.replace(5, 6, " India"); QLabel *label1 = new QLabel(str); QLabel *label2 = new QLabel(sizeOfWorld); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(label1); layout->addWidget(label2); QWidget window; window.setLayout(layout); window.show(); return app.exec(); } Here is the result of this code on Microsoft Windows: 20 Sep 2009 This article is very good. It presents some common methods of QString and systematically mixes an example and a small explanation. The final example might be a bit too complicated for a beginner but the comments describe everything so I think it is ok. I like this final example because one can easily play with it in the simulator. There is one thing I really miss for a introduction to QString: an explanation of the method QString::arg(). This method is very useful, while QString::append() or QString::prepend() are mostly useless in real applications because of internationalization. This article is still "Reviewer Approved" for me. It is good even without QString::arg(). 11 Sep 2009 A string operation is fully described in this article. It’s a good to learn how to perform a particular operation on the string in Qt. at the start the method is described very well. A small image says everything about the article.
http://developer.nokia.com/community/wiki/How_to_use_QString_in_Qt
CC-MAIN-2014-52
refinedweb
436
57.87
Created on 2008-12-18.17:02:20 by amak, last changed 2008-12-18.20:15:37 by amak. Recording a bug to track an issue reported by Shaman Mahmoudi to jython-users. From Shaman's email. ---------------------------------------------------------------------------- I am using the latest stable version of jython, version 2.2.1 and I am trying to write a simple telnet program. However, I am having an issue with the expect method in it. Here is my code: import telnetlib HOST = 'localhost' user = 'someone' password = 'someones password' tn = telnetlib.Telnet(HOST, 22) aa, bb, cc = tn.expect(['>>>'], 1) print aa print bb print cc And this is the error message: Traceback (innermost last): File "/home/qm/workspace/project000/telnettest.py", line 11, in ? File "/home/qm/jython/Lib/telnetlib.py", line 623, in expect File "/home/qm/jython/Lib/select.py", line 204, in cpython_compatible_select File "/home/qm/jython/Lib/select.py", line 54, in _getselectable TypeError: ("Object 'java.nio.channels.SocketChannel[connected local=/127.0.0.1:45293 remote=/127.0.0.1:22]' is not watchable", 88) ---------------------------------------------------------------------------- This bug was caused by failure of _getselectable() function in the 2.2 select module to recognise that it had already been passed a SelectableChannel. Fixed in r5777. This bug does not occur in 2.5; still I added an explicit check to ensure that this is so.
http://bugs.jython.org/issue1211
CC-MAIN-2018-05
refinedweb
226
62.64
Hi, Tom Lane [2007-11-07 13:49 -0500]: >. I tried this on a Debian Alpha porter box (thanks, Steve, for pointing me at it) with Debian's gcc 4.2.2. Latest sid indeed still has this bug (the floor() one is confirmed fixed), not only on Alpha, but also on sparc. Since the simple test case did not reproduce the error, I tried to make a more sophisticated one which resembles more closely what PostgreSQL does (sigsetjmp/siglongjmp instead of exit(), some macros, etc.). Unfortunately in vain, since the test case still works perfectly with both no compiler options and also the ones used for PostgreSQL. I attach it here nevertheless just in case someone has more luck than me. So I tried to approach it from the other side: Building postgresql with CFLAGS="-O0 -g" or "-O1 -g" works correctly, but with "-O2 -g" I get above bug. So I guess I'll build with -O1 for the time being on sparc and alpha to get correct binaries until this is sorted out. Any idea what else I could try? Thanks, Martin -- Martin Pitt Ubuntu Developer Debian Developer #include <stdio.h> #include <stdlib.h> #include <setjmp.h> #define ERROR 20 #define ereport(elevel, rest) \ (errstart(elevel, __FILE__, __LINE__, __func__) ? \ (errfinish rest) : (void) 0) #define PG_RE_THROW() \ siglongjmp(PG_exception_stack, 1) sigjmp_buf PG_exception_stack; int errstart(int elevel, const char *filename, int lineno, const char *funcname) { printf("error: level %i %s:%i function %s\n", elevel, filename, lineno, funcname); return 1; } void errfinish(int dummy, const char* msg) { puts(msg); PG_RE_THROW(); } int do_div(char** argv) { int arg1 = atoi(argv[1]); int arg2 = atoi(argv[2]); int result; if (arg2 == 0) ereport(ERROR, (1, "division by zero")); result = arg1 / arg2; return result; } int main(int argc, char **argv) { if (sigsetjmp(PG_exception_stack, 0) == 0) { int result = do_div(argv); printf("%d\n", result); } else { printf("caught error, aborting\n"); return 1; } return 0; } Attachment: signature.asc Description: Digital signature
https://lists.debian.org/debian-alpha/2007/12/msg00002.html
CC-MAIN-2020-29
refinedweb
325
60.35
As an example of using the contextless functions, simply toggle GPIO4 as fast as possible: #define _GNU_SOURCE #include <gpiod.h> #include <stdio.h> #include <unistd.h> #include <stdlib.h> int res; int main(int argc, char **argv) { for (;;) { res = gpiod_ctxless_set_value("0", 4, 1, 1, "output test", NULL, NULL); } } You might well conclude that this program is wrong as it sets line 4 to 1 and never sets it to 0. However, if you run the program you will discover that you do see pulses because the line is closed and hence it returns to 0 between each of the calls to the set function. The trace is for a Pi Zero and you can see that the pulses are 30µs wide with a gap of around 290µs. For a Pi 4 pulses are 10µs wide with a gap of 74µs. The gap is the time needed to close the line file and re-open it. This is slower than using the character driver driver directly and the pulse width isn’t under our control. The line is set high for the time it takes to complete the call. To set the pulse width you have to use a callback function to delay the closing of the file: ) { for (;;) { res = gpiod_ctxless_set_value("0", 4, 1, 1, "output test", (gpiod_ctxless_set_value_cb) delayms, (void *) 100); res = gpiod_ctxless_set_value("0", 4, 0, 1, "output test", (gpiod_ctxless_set_value_cb) delayms, (void *) 100); } } Notice that the final parameter isn’t actually being used as a pointer, it is just a way of passing an untyped value and the parameter isn’t dereferenced in the callback. This version of the program is more useful in that it does produce pulses of around 100ms. Also notice the wrapper for nanosleep because we can only pass a single parameter to the callback function. The first set makes the line go high and it stays high for the duration of the nanosleep and then the close operation resets it to input. The second set makes the line go low for the duration of the nanosleep and it stays low while the line is closed again. What this all means is that the time that the line is low is still longer than the nanosleep time because it includes the time to close and open the file. You can see that the high time is around 100ms, but the low time is a little longer. You can either adjust the low timings or simply put up with it. As well as single line get and set functions, there are also multiple line versions: gpiod_ctxless_set_value_multiple(“device”,offsets[], values[], num_lines,active_low, “consumer”,callback,param) gpiod_ctxless_get_value_multiple(“device”,offsets[], values[], num_lines,active_low, “consumer”,callback,param) These work in the same way, but now you can specify a set of lines as an array of line structs and an array of values to get/set them to. Of course you have to specify the number of lines and the arrays have to be the correct size. For example, to pulse two lines out of phase you could use: ) { int offsets[] = {4, 27}; int state1[] = {1, 0}; int state2[] = {0, 1}; for (;;) { gpiod_ctxless_set_value_multiple("0", offsets, state1, 2, 1, "output test", (gpiod_ctxless_set_value_cb)delayms, (void *)1); gpiod_ctxless_set_value_multiple("0", offsets, state2, 2, 1, "output test", (gpiod_ctxless_set_value_cb)delayms, (void *)2); } } This pulses lines 4 and 27 so that one is high while the other is low. Even though the function promises to change the lines at the same moment, there is a 10µs delay between changing the state of lines, as can be seen in the logic analyzer display below: If you are working in milliseconds, a delay of 10µs probably isn’t important, but it is still necessary to know that the lines do not all change together and there are situations in which this matters. The context-less functions are rarely helpful and they are only slightly easier to use than the much more powerful context-using functions which we look at next. The GPIO character driver replaces the sysfs GPIO driver and it is the one to use for all future projects. The GPIOD library provides a higher level way of using the GPIO character driver, but if you don’t want the overhead of using it then the direct ioctl interface is easy to use. After the library has been installed there are a number of utilities that are sometimes useful at the command line or in scripts. The library has two types of function, context-less and context-using. The context-less functions can be used in an ad-hoc fashion, but the context-using functions have to be used in an organized manner. The context-less functions set GPIO lines to input or output without opening them or reserving them in anyway. This makes them slow and you need to use callback functions to control their output. The context-using functions do require you to open the GPIO line and configure it before you use it. Once used you have to close the line to allow another process to make use of it. Context-using functions are not difficult to use and are much more flexible and fast. You can work with multiple GPIO lines in a single function call. However, there are still delays between setting lines to particular values. The context-using functions can create pulses as fast as 1µs to 2.0µs. Using the time-to-charge you can measure either the resistance or the capacitance of a circuit using a single GPIO line. [ ... ] JetBrains has released the initial version of Projector, an open source tool and framework for running JetBrains IDEs and Swing apps remotely over your network. Make a Comment or View Existing Comments Using Disqus or email your comment to: comments@i-programmer.info <ASIN:1871962609> <ASIN:1871962617> <ASIN:1871962455> <ASIN:1871962463>
https://i-programmer.info/programming/hardware/14457-pi-iot-in-c-using-linux-drivers-gpio-character-driver.html?start=1
CC-MAIN-2021-17
refinedweb
968
57.2
Publish Xarray Datasets via a REST API. Project description Publish Xarray Datasets via a REST API. Serverside: Publish a Xarray Dataset through a rest API ds.rest.serve(host="0.0.0.0", port=9000) Client-side: Connect to a published dataset The published dataset can be accessed from various kinds of client applications. Here is an example of directly accessing the data from within Python: import xarray as xr import zarr from fsspec.implementations.http import HTTPFileSystem fs = HTTPFileSystem() http_map = fs.get_mapper('') # open as a zarr group zg = zarr.open_consolidated(http_map, mode='r') # or open as another Xarray Dataset ds = xr.open_zarr(http_map, consolidated=True) Why? Xpublish lets you serve/share/publish Xarray Datasets via a web application. The data and/or metadata in the Xarray Datasets can be exposed in various forms through pluggable REST API endpoints. Efficient, on-demand delivery of large datasets may be enabled with Dask on the server-side. We are exploring applications of Xpublish that include: - publish on-demand or derived data products - turning xarray objects into streaming services (e.g. OPeNDAP) How? Under the hood, Xpublish is using a web app (FastAPI) that is exposing a REST-like API with builtin and/or user-defined endpoints. For example, Xpublish provides by default a minimal Zarr compatible REST-like API with the following endpoints: - .zmetadata: returns Zarr-formatted metadata keys as json strings. - var/0.0.0: returns a variable data chunk as a binary string. Project details Release history Release notifications | RSS feed Download files Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
https://pypi.org/project/xpublish/
CC-MAIN-2022-27
refinedweb
272
58.79
On Sun, 03 Jul 2005 22:07:30 GMT, Ron Adam <rrr at ronadam.com> wrote: >B. ISTM you are comparing apples to oranges, execution-wise. The def in the context of a class definition is executed as soon as you get to the end of the class suite. The execution happens in a special name space similar to what happens when you execute a function suite by calling the function, except the class definition body is executed automatically. When you write def foo(self, x=x): ... the second x is looked up starting in the local excution namespace of the class body, so it finds class variables, if they are defined, otherwise it looks for an outer scope x for the value. Note that order counts: >>> class Foo(object): ... def foo(self, x=x): print x ... x = 123 ... Traceback (most recent call last): File "<stdin>", line 1, in ? File "<stdin>", line 2, in Foo NameError: name 'x' is not defined >>> class Foo(object): ... x = 123 ... def foo(self, x=x): print x ... >>> Foo().foo() 123 Note that self.x is a different access mechanism, and would access the same Foo.x that became a default value, but the value is the only thing they have in common. You could extract the function from the class, and the plain function would still have the default value: >>> bar = Foo.foo.im_func >>> bar('ignored self param') 123 >>> import dis >>> dis.dis(bar) 3 0 LOAD_FAST 1 (x) 3 PRINT_ITEM 4 PRINT_NEWLINE 5 LOAD_CONST 0 (None) 8 RETURN_VALUE >>> import inspect >>> inspect.getargspec(bar) (['self', 'x'], None, None, (123,)) There's where the default value is. It's put there when x=x is evaluated during the def execution for the function, which happens to have happened courtesy of a class body execution defining the class, but that's the only connection the 123 has. > > >Why isn't there a dict method to get a sub dict from a key list? >Fromkeys doesn't quite do it. > > sub-dict = dict.subdict(key_list) > >Or have dict.copy() take a key list. (?) > ><Just a thought.> sub_dict = dict([(key, srcdct[key]) for key in srcdct]) #untested, should work (if you don't use 'dict' for a variable ;-) > > > ) self.__dict__.update({'x':x, 'y':y, 'z':z}) # should work without save_these > > # rest of code > print self.x, self.y, self.z > >f = foo() >f = foo(5,6,7) > > Regards, Bengt Richter
https://mail.python.org/pipermail/python-list/2005-July/350111.html
CC-MAIN-2019-30
refinedweb
403
75.5
The Visual Studio 2008 Tools for Office System allow to drag and drop Windows Forms controls onto Office documents’ surface to create an advanced user experience. It is also possible to use WPF controls, but this technique requires some more steps, because Office applications cannot directly host WPF controls. So we must use interoperability between the two technologies. In this article, I will show you how to create a custom Windows Forms control to host WPF controls which can be dragged onto Office 2007 documents’ surface. You should be quite skillful with WPF controls and .NET user controls before you read this article. Open Visual Studio 2008 and create a new Visual Basic 2008 document-level solution for Microsoft Excel 2007. The first step is to add to the solution a new custom Windows Forms control. After you added one, rename it as HostUserControl.vb. Then, from the WPF Interoperability tab in Visual Studio 2008 toolbox, drag an ElementHost item to the User Control surface. Set the Dock property of the ElementHost to Fill. ElementHost Dock Fill Once you've done this, add a reference to the following WPF assemblies: At this point, we can go to implement a WPF control writing managed code (in this case we cannot obviously accomplish this by XAML). For example, we could add to our User Control an Expander control, which is provided by the System.Windows.Controls namespace in WPF. Select the user control and switch to the code editor, then type the following code: Expander System.Windows.Controls namespace Imports System.Windows.Controls Imports System.Windows.Media Public Class HostUserControl Private Sub HostUserControl_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim ex As New Expander ex.Header = " WPF control in Excel 2007" ex.Background = New SolidColorBrush(Colors.LightBlue) ex.BorderBrush = New SolidColorBrush(Colors.Black) ex.BorderThickness = New Windows.Thickness(2) Me.ElementHost1.Child = ex End Sub End Class Now compile the solution, so that the toolbox gets updated with the new user control. Switch to design mode and drag the new HostUserControl onto an Excel 2007 sheet. The above figure shows the result. HostUserControl Once you have designed your control, you can write code to handle its events in the same way you use to do with other controls. As you can see, using WPF controls in VSTO solutions is a substantially simple procedure, even if it's not possible to use XAML to manage controls UI. Anyway, you will obtain amazing results also by writing managed code. This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
http://www.codeproject.com/Articles/24223/Use-WPF-Controls-in-VSTO-Solutions-with-Visual-Bas
crawl-003
refinedweb
440
57.98
Highlights of XNA development on Windows Phone 7 Join the DZone community and get the full member experience.Join For Free Developing games for multiple platforms might be a daunting task when it comes to porting the same project to a different system while still maintaining its capabilities. Ever since Microsoft released the XNA framework, this task has been simplified and developers who created products for Microsoft platforms were able to build one game and then compile it to multiple platforms (Xbox 360, Windows, Zune) with little or no code changes. The same simplicity is now available for those who plan to develop games for Windows Phone 7. XNA Framework is available on this platform as well, giving developers access to many of the unique phone features like the accelerometer or GPS. It all begins with the SDK installation. XNA Game Studio is a component part and will be automatically downloaded and installed with all other Windows Phone 7 development tools. Of course, you can also download it as a standalone package. Once ready, if you open Visual Studio 2010, you will see that there are a bunch of new project types available: Once a test project is created, the basic code structures are absolutely the same in any other XNA game: One important difference, however, is the fact that now you have very strict hardware considerations to follow. Windows Phone 7 is not even close performance-wise both to a PC or an Xbox 360, so you must be very careful with object allocations and complex graphics. Assuming that you are already familiar with the basics of XNA development, you know that by default there are five methods present in the game class: - Initialize - LoadContent - UnloadContent - Update - Draw The Initialize method is triggered the moment the game starts on the device. It is the fundamental starting point and generally a developer should not interfere with the initialization process. LoadContent is designed to allow the developer to load additional content resources like textures in order to be able to use those later in the game. UnloadContent, on the other side is the method that allows you to dispose the used content. Update and Draw are, in my opinion, two the most interesting methods. Update is constantly running while the game is executing - that's where you are able to check for user input and define specific game element behavior depending on the game state. Draw is also constantly running while the game is loaded, but its main purpose is to draw game elements depending on the current game state. Let's see this in action when I want to track user gestures. Unlike Xbox 360 and PC, Windows Phone 7 relies on touch input. The XNA Framework 4.0 comes pre-built with a new namespace - Microsoft.Xna.Framework.Input.Touch. By default, the touch gestures are not handled. To change this, in the game class constructor I am defining what I need to track by setting the EnabledGestures property of the TouchPanel class. XNA games have a different structure compared to Silverlight applications. In a regular client application there are pages that can be particular touch input panels. In an XNA game, there is one screen that is not directly handled by the developer. Therefore, TouchPanel is a static class that manages the touch input for the entire game. There are 11 gesture types that can be tracked by the TouchPanel. I am not going to document those here since the official documentation is pretty detailed on this topic. As I said before, I can declare the needed gestures in the class constructor: public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; // Frame rate is 30 fps by default for Windows Phone. TargetElapsedTime = TimeSpan.FromTicks(333333); TouchPanel.EnabledGestures = GestureType.VerticalDrag | GestureType.Tap | GestureType.PinchComplete | GestureType.Pinch | GestureType.HorizontalDrag | GestureType.Hold | GestureType.FreeDrag | GestureType.Flick; } Here I am specifying that there are multiple gesture types I want to track, and this might serve different purposes in a game. For example, a vertical drag could draw a trajectory for a ball and a hold might trigger the on-screen menu. Once set, I can track the execution of specific gestures in the Update method: protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); if (TouchPanel.IsGestureAvailable) { if (TouchPanel.ReadGesture().GestureType == GestureType.VerticalDrag) { Debug.WriteLine("There was a vertical drag!"); } } base.Update(gameTime); } First of all, I am checking whether a gesture is available, and if so - I need to check the gesture type. Now that you are aware of how basic gestures are handled let's put this functionality to use and at the same time learn about another XNA-specific feature - the ability to access the media library. It is fair to exepct the end-user to hold some media content on his device - for example, songs. The entire media library is exposed to the developer via the MediaLibrary class. In my game project, I want to access a specific song and play it when the user holds the finger on the screen (triggers the Hold gesture). I already have the basic structure available in the UpdateMethod and all I need to do is change the gesture type that I am checking against. if (TouchPanel.IsGestureAvailable) { if (TouchPanel.ReadGesture().GestureType == GestureType.Hold) { } } Once the gesture is detected I need to instantiate the MediaLibrary class: MediaLibrary lib = new MediaLibrary(); This class has an additional constructor that accepts a MediaSource instance as a parameter. If the phone you are developing doesn't have external storage (like an SD card), then all you have is a Local device library. NOTE: You need an actual physical Windows Phone 7 device to test MediaLibrary capabilities. You can test basic functionality in the emulator, but in order to have access to sound and video media you will need a phone. You can easily check the available storage devices with this piece of code: IList<MediaSource> q = MediaSource.GetAvailableMediaSources(); foreach (MediaSource n in q) Debug.WriteLine(n.Name); The local device storage is used by default if it is not explicitly defined. Since I already have my phone connected, I want to find a song and play it. A MediaLibrary instance can offer access to the following content on the device: - Albums - Artists - Genres - Playlists - Songs - SavedPictures And although the playback of the content listed here requires the standard system media layer to be activated (e.g. songs), it gives the developer a lot of freedom as to what you can do with the media. For obvious reasons you cannot edit the media contents but you can access them. For an example, I want to get the first song from my trance collection. I use a standard LINQ query and a call to the static MediaPlayer class, specifically designed for song playback. Song n = (from c in lib.Songs where c.Genre.Name == "Trance" select c).First(); MediaPlayer.Play(n); This is a good way to add some media interactions to a game. The same way you can obtain album art and additional media information stored in ID3 tags. I would not recommend abusing this sort of functionality because users don't want to have media content accessed without their consent. There's a lot more to the XNA Framework besides the abstraction layer it offers on top of the mobile platform. When working with XNA for mobile development, additional restrictions will be enforced - for example, you can't use custom shaders. For most games that you are going to be develop, that is not a critical necessity and it was removed for performance considerations. As a developer, you have to understand that missing functionality is missing for a reason. Mobile hardware performance is continuously improving, so more features will be available as handset makers continue to innovate. Generally, I see no difference developing XNA games on WP7 compared to any other platform that supports the framework. Before actively developing a product, I would recommend checking this document. An extremely good resource to check for XNA development is the AppHub educational portal. Opinions expressed by DZone contributors are their own.
https://dzone.com/articles/xna-development-windows-phone
CC-MAIN-2020-45
refinedweb
1,361
53.21
Haskell/Continuation passing style From Wikibooks, the open-content textbooks collection Continuation Passing Style is a format for expressions such that no function ever returns, instead they pass control onto a continuation. Conceptually a continuation is what happens next, for example the continuation for x in (x+1)*2 is add one then multiply by two. [edit] Starting simple To begin with, we're going to explore two simple examples which illustrate what CPS and continuations are. Firstly a 'first order' example (meaning there are no higher order functions in to CPS transform), then a higher order one. [edit] square) And the same function pythagoras, written in CPS $ \sum'of'squares -> k sum'of'squares How the pythagoras'cps example operates is: 1) square x and throw the result into the (\x'squared -> ...) continuation 2) square y and throw the result into the (\y'squared -> ...) continuation 3) add x'squared and y'squared and throw the result into the (\sum'of'squares -> ...) continuation 4) throw the sum'of'squares into the toplevel/program continuation And one can try it out: *Main> pythagoras'cps 3 4 print 25 [edit] thrice Example: A simple higher order function, no continuations thrice :: (o -> o) -> o -> o thrice f x = f (f (f x)) *Main> thrice tail "foobar" "bar" Now the first thing to do, to CPS convert thrice, is compute the type of the CPSd form. We can see that f :: o -> o, so in the CPSd version, f'cps :: o -> (o -> r) -> r, and the whole type will be thrice'cps :: (o -> (o -> r) -> r) -> o -> (o -> r) -> r. Once we have the new type, that can help direct you how to write the function. Example: A simple higher order function, with continuations thrice'cps :: (o -> (o -> r) -> r) -> o -> (o -> r) -> r thrice'cps f'cps x k = f'cps x $ \f'x -> f'cps f'x $ \f'f'x -> f'cps f'f'x $ \f'f'f'x -> k f'f'f'x [edit] Using the Cont monad By now, you should be used to the (meta-)pattern that whenever we find a pattern we like (here the pattern is using continuations), but it makes our code a little ugly, we use a monad to encapsulate the 'plumbing'. Indeed, there is a monad for modelling computations which use CPS. function (the continuation), which is a function from things of type a (what the result of the function would have been, if we were returning it normally instead of throwing it into the continuation), to things of type r, which becomes the final result type of our function. Example: The pythagoras example, using the Cont monad import Control.Monad sum'of'squares <- add'cont x'squared y'squared return sum'of'squares *Main> runCont (pythagoras'cont 3 4) print 25 Every function that returns a Cont-value actually takes an extra parameter, which is the continuation. Using return simply throws its argument into the continuation. How does the Cont implementation of (>>=) work, then? It's easiest to see it at work: Example: The (>>=) function for the Cont monad square :: Int -> Cont r Int square x = return (x ^ 2) addThree :: Int -> Cont r Int addThree x = return (x + 3) main = runCont (square 4 >>= addThree) print {- Result: 19 -} The Monad instance for (Cont r) is given below: instance Monad (Cont r) where return n = Cont (\k -> k n) m >>= f = Cont (\k -> runCont m (\a -> runCont (f a) k)) So return n is a Cont-value that throws n straight away into whatever continuation it is applied to. m >>= f is a Cont-value that runs m with the continuation \a -> f a k, which maybe, receive the result of computation inside m (the result is bound to a) , then applies that result to f to get another Cont-value. This is then called with the continuation we got at the top level (the continuation is bound to k); in essence m >>= f is a Cont-value that takes the result from m, applies it to f, then throws that into the continuation. [edit] callCC. Example: square using callCC -- Without callCC square :: Int -> Cont r Int square n = return (n ^ 2) -- With callCC square :: Int -> Cont r Int square n = callCC $ \k -> k (n ^ 2). [edit] Deciding when to use k We mentioned above that the point of using callCC in the first place was that it gave us extra power over what we threw into our continuation, and when. The following example shows how we might want to use this extra flexibility. Example: Our first proper callCC function foo :: Int -> Cont r String foo n = callCC $ \k -> do let n' = n ^ 2 + 3 when (n' > 20) $ k "over twenty" return (show $ n' - 4) foo. Naturally, you can embed calls to callCC within do-blocks: Example: More developed callCC example involving a do-block bar :: Char -> String -> Cont r Int bar c s = do msg <- callCC $ \k -> do let s' = c : s when (s' == "hello") $ k "They say hello." let s'' = show s' return ("They appear to be saying " ++ s'') return (length msg): Example: Popping out a function, introducing a useless line bar :: Cont r Int bar = callCC $ \k -> do let n = 5 k n return 25 bar will always return 5, and never 25, because we pop out of bar before getting to the return 25 line. [edit]. Actually, k never compute the continuation argument of return Cont-value of k. We say, therefore, that the type of k is: k :: a -> Cont r b Inside Cont r b, because k never computes that continuation, type b which is the parameter type of that continuation can be anything independent of type a. We universally quantify the return type of k. This is possible for the aforementioned reasons, and the reason it's advantageous is that we can do whatever we want with the result of computation inside k. In our above code, we use it as part of a when construct: when :: Monad m => Bool -> m () -> m () As soon as the compiler sees k being used in this when, it infers that we want a () arguement type of the continuation taking from the return value of k. The return Cont-value of k has type Cont r (). This arguement type b is independent of the argument type a of k. [1]. The return Cont-value of k doesn't use the continuation which is argument of this Cont-value itself, it use the continuation which is argument of return Cont-value of the callCC. So that callCC has return type Cont r String. Because the final expression in inner do-block has type Cont r String, the inner do-block has type Cont r String. There are two possible execution routes: either the condition for the when succeeds, k doesn't use continuation providing by the inner do-block which finally takes the continuation which is argument of return Cont-value of the callCC, k uses directly the continuation which is argument of return Cont-value of the callCC, expressions inside do-block after k will totally not be used, because Haskell is lazy, unused expressions will not be executed. If the condition fails, the when returns return () which use the continuation providing by the inner do-block, so execution passes on. If you didn't follow any of that, just make sure you use return at the end of a do-block inside a call to callCC, not k. [edit] The type of callCC We've deliberately broken a trend here: normally when we've introduced a function, we've given its type straight away, but in this case we haven't. The reason is simple: the type is rather horrendously complex, and it doesn't immediately give insight into what the function does, or how it works. Nevertheless, you should be familiar with it, so now you've hopefully understood the function itself, here's it's type: callCC :: ((a -> Cont r b) -> Cont r a) -> Cont r [edit] The implementation of callCC So far we have looked at the use of callCC and its type. This just leaves its implementation, which is: callCC f = Cont $ \k -> runCont (f (\a -> Cont $ \_ -> k a)). [edit] Example: a complicated control structure This example was originally taken from the 'The Continuation monad' section of the All about monads tutorial, used with permission. Example: Using Cont for a complicated control structure {- Because it isn't initially clear what's going on, especially regarding the usage of callCC, we will explore this somewhat. [edit] Analysis of the example Firstly, we can see that fun is a function that takes an integer n. We basically implement a control structure using Cont and callCC that does different things based on the range that n falls in, as explained with the comment at the top of the function. Let's dive into the analysis of how it works. - Firstly, the (`runCont` id)at the top just means that we run the Cont block that follows with a final continuation of id.. [edit]. -}. Example: General try using continuations. tryCont :: MonadCont m => ((err -> m a) -> m a) -> (err -> m a) -> m a tryCont c h = callCC $ \ok -> do err <- callCC $ \notOk -> do x <- c notOk; ok x h err For an example using try, see the following program. [edit] Example: coroutines [edit] Notes - ↑ Type ainfers a monomorphic type because kis bound by a lambda expression, and things bound by lambdas always have monomorphic types. See Polymorphism.
http://en.wikibooks.org/wiki/Haskell/Continuation_passing_style
crawl-002
refinedweb
1,586
50.7
JavaScript for decimal number comparisons August 24, 2010 at 7:41 AM Hi,I need to compare a BigDecimal in my javascript. I need a have a validation the text field value should not exceed (15,2) (max value is : 9999999999999.99).I am not able to compare my text field value with this max value. Can u plz suggest some solution.Thanks for ur... View Questions/Answers java console programming August 23, 2010 at 10:07 PM how to clear d screen in java console programming? ... View Questions/Answers java code August 23, 2010 at 8:46 PM i write program to upload image into perticular folder.but i want to store that path into database but not image and display that image in webpage from the db.pls any one send me code for that in servlets asap.pls vary urgent.i will be thankful to youpls send me ... View Questions/Answers java August 23, 2010 at 7:33 PM a... View Questions/Answers java August 23, 2010 at 5:16 PM After the declaration:char[] c = new char[100];what is the value of c[50]?a) 50b) 49c) '\u0000'd) '\u0020'e) " "f) cannot be determinedg) always null until a value is assigned5. After the declaration:int x;... View Questions/Answers java August 23, 2010 at 5:15 PM pri... View Questions/Answers javascript August 23, 2010 at 12:58 PM Dear Sir,What is the code for radio button validation.Please give me a code with example.Thank YouDebasis ... View Questions/Answers Interview Question August 23, 2010 at 12:27 PM I need Interview Questions on Java,J2EE Pls help me . ... View Questions/Answers Javascript August 23, 2010 at 11:43 AM jdbc August 23, 2010 at 10:21 AM i use pool connection for my application but whenever i insert data into database ,sometimes two copy of the data have been entered into the database and sometimes single copy .But there is no logic or a specific way of entering the two copy of data into database . please provide me the full code of... View Questions/Answers java August 23, 2010 at 3:00 AM whats the problem with my code? it's giving me one error illegal start of expression on line 201? and also help me change the colors to their names instead of numbers. thxpublic class EmployeeDetails3 extends JFrame { public EmployeeDetails3() { ... View Questions/Answers java August 22, 2010 at 7:59 PM wh is abstract in project?how is module in java project? ... View Questions/Answers java August 22, 2010 at 7:57 PM wh is native method? ... View Questions/Answers java August 22, 2010 at 5:12 PM Hello sir could you please explain what is mean by reflection? ... View Questions/Answers difference August 22, 2010 at 3:44 PM what is the difference in between awt and swing package...and what is the difference in between frame,panel ... View Questions/Answers Java Final Project Error August 22, 2010 at 5:29 AM It isnt showing the result when I press the proper button...?? It isnt doing the work... can someone help me??import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.*;import java.text.SimpleDateFormat;impo... View Questions/Answers java August 21, 2010 at 9:45 PM Can you provide me the example program which uses all the concepts like encapsulation ,inheritance ,polymorphism in a single program ... View Questions/Answers hi,i want to write a code for sending a mail to a company employees having strength more than 1000.I had fetched the mail ids from database.I want to send mail to employee with mail id in 'TO' column.To column should have the email id of only 1 employee only(means he will not able to know who other ... View Questions/Answers ERROR with my JAVA code August 21, 2010 at 9:48 AM The error came up in my main method... it wasnt there until i finished my actionListener coding so I dont know how to fix this....it is really stressing me out!! HELP!!!import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;... View Questions/Answers JSP Error August 21, 2010 at 2:19 AM When i am running my registration.jsp getting following error.HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage description The server encountered an internal error () ... View Questions/Answers java August 20, 2010 at 10:23 PM Hello, i have a text file having strings like"dab";"daxyb";"axb";how to read this file and how to convert these strings into a character array.output like this:d a bd a x y b a x b than... View Questions/Answers JAVA August 20, 2010 at 8:07 PM Hi,I have one small word(number type as password) of containing 6 digits. Now i want to encrypt to this password and decrypt the password in different programs. for encrypt and decrypt the public & private keys are automatically generate for encrypt and decrypt with in the program it... View Questions/Answers Interface August 20, 2010 at 7:27 PM Dear Sir,Could you send me a java program for INTERFACE?Thank You. ... View Questions/Answers cloning August 20, 2010 at 7:26 PM Dear Sir,Can you send a simple java program for CLONING an object? ... View Questions/Answers java beginers August 20, 2010 at 6:33 PM how to write program for rational numbers ... View Questions/Answers java August 20, 2010 at 6:09 PM sir I want some java file codings pls send it......... ... View Questions/Answers java beginners August 20, 2010 at 4:40 PM let me know the java code for the followign patteren*00**0*****0*00 means space whereever the stars are there that is the pattern ... View Questions/Answers Java urgent August 20, 2010 at 4:36 PM programing August 20, 2010 at 2:17 PM reason for producing a good program documentation ... View Questions/Answers exception at runtime August 20, 2010 at 1:33 PM while i executing this source code:-import java.sql.*;public class MysqlConnect{public static void main(String args[]){System.out.println("MySQL Connect Example.");Connection con = null;String url = "jdbc:mysql://localhost:3306/&qu... View Questions/Answers jsp query August 20, 2010 at 1:10 PM in first division there is one table which contains data with edit button... when i will click on edit button that division will become hidden and new division come with all related data... ... View Questions/Answers javascript August 20, 2010 at 10:49 AM using below code i got value in textbox but i also wants to use this textbox value in query in same page..<html><script>function passVariable(){var v=document.form.txt.value;document.form.txt1.value=v;}</script><form na... View Questions/Answers Javascript August 20, 2010 at 10:35 AM Dera sir,Here is my compose mail page.How to integrate attach file(text or excel) in this page.How to store in the database.How to download it in another page.please help.This is mighty part left in the mail page.Your help is paramount.Thank YouDebasisjsp page--<!DOC... View Questions/Answers Java-Abstract Class August 20, 2010 at 10:22 AM Can a abstract class have a constructor ?When would the constructor in the abstract class be called ?Please give me with good example code..Please implement the example with code. THanks in advance. ... View Questions/Answers jcheckbox not enabled in java August 20, 2010 at 10:15 AM . im new to java..jcheck box not enabled after i placed in sort select table in gui. what can i do to enable and made a click on it.after that selected rows are are opened in excel . already i placed a Jbutton . but its not working ... View Questions/Answers onclick pass variable August 20, 2010 at 10:00 AM on button onclick event pass variable and print in textbox in same page... i want to pass value of variable at onclick event of button and also want to print it in textbox in same page.... ... View Questions/Answers java August 20, 2010 at 9:38 AM what is mean by reflection please kindly expalin me with neat example ... View Questions/Answers java August 20, 2010 at 9:35 AM Is there any difference b/w instantiation and object creation? ... View Questions/Answers Struts: validations code to support 2 date foramats August 20, 2010 at 9:32 AM What is the code in validation.xml to support 2 date formats (DD-MM-YYYY & DD/MM/YYYY ) in form. (I'm using struts 1.3) ... View Questions/Answers Java Button issue August 20, 2010 at 1:56 AM I have this project and I have numerous steps to it. I am trying to figure out what I have to do to make my frame panel do what it is I am assigning it to do. I need the program to be able to tell when the user is clicking the round or oval button and than perform the proper mathmathical problem to ... View Questions/Answers java runtime exception August 20, 2010 at 12:41 AM while i executing this source code:-import java.sql.*;public class MysqlConnect { public static void main(String args[]) { System.out.println("MySQL Connect Example."); Connection con = null; String url = "... View Questions/Answers install jdk 6 August 19, 2010 at 8:45 PM sir i have installed my jdk1.6 but dont know how to run, could you please help me i this ... View Questions/Answers install jdk 6 August 19, 2010 at 8:45 PM sir i have installed my jdk1.6 but dont know how to run, could you please help me i this ... View Questions/Answers javascipt August 19, 2010 at 6:37 PM dear sir,how to attach text or excel files from desktop.How to store in a database.how to retrieve from databse by clicking on a link.please help me.i will be grateful.RegardsDebasis ... View Questions/Answers java August 19, 2010 at 12:10 PM 1. Which of the following are valid definitions of an application's main( ) method?a) public static void main();b) public static void main( String args );c) public static void main( String args[] );d) public static void main( Graphics g );e) public static boolean ... View Questions/Answers java August 19, 2010 at 12:09 PM If s1 is declared as:String s1 ="phenobarbital";What will be the value of s2 afterthe following line of code:String s2 = s1.substring( 3, 5 );1.a) nullb) "eno"c) "enoba"... View Questions/Answers Javascript August 19, 2010 at 10:28 AM Dear sir,Sir,i want to display a text box by clicking on Addcc button and then display another text box by clicking on Addbcc button.Primarily there would be text box.After clicking on those buttons text box should appear in that line of button.Can you please help.Please helpRegards... View Questions/Answers Java JSP August 19, 2010 at 5:53 AM package com.wipro.semsary.model.bao;import com.wipro.semsary.model.SearchList;import com.wipro.semsary.model.dao.AdminModuleClass;import java.util.ArrayList;public class AdminClass implements AdminInterface{ AdminModuleClass admin = new Admin... View Questions/Answers java August 19, 2010 at 12:03 AM Can any assite me, which one is the best open source tool to design the uml digrams ... View Questions/Answers java August 19, 2010 at 12:00 AM I need a code How to insert delete ,edit & update the data in database using struts1.1 or 1.2 ... View Questions/Answers java August 18, 2010 at 11:52 PM I want a program to count the number of repeteate word in file & also i want to repalce the repeate word with another new word.plse help me. ... View Questions/Answers java test August 18, 2010 at 11:39 PM Trace through the following program segment and state clearly the output that will be generated: public static void main(String [] args){ int no1; int no2; for (no1 = -2; no1 <= 1; no1++){ for (no2 = 0; no2 < 6; no2 = no2 + 3){ System.out.print... View Questions/Answers Java Final Project August 18, 2010 at 11:24 PM I am having a real hard time with this java assignment. Any help or tips will be great!!! This is the requirements:Final Project OverviewThis document provide a sample of what is possible, and could lead to a project worth the maximum grade of 100% Something to th... View Questions/Answers java August 18, 2010 at 8:36 PM design a java interface for ADT stack.develop two differant classes that implement this interface,one using array and the other using using linked list.provide necessary exception handling in both the implementations. ... View Questions/Answers upload using youtube api August 18, 2010 at 7:27 PM sir, as u have asked for my question i m sending it again plz reply me.i want code for java based mobile application, that can take .3GP video file and upload it to youtube using youtube's APIs. The video file would be located on a weblink (a direct http link to a video file).i hope u u... View Questions/Answers java August 18, 2010 at 6:27 PM hello,how to convert this string array to character array.String[] str={"da","234ab","dab","abb"};please give reply for this problemsthanks a lot for your previous response ... View Questions/Answers ajax August 18, 2010 at 6:02 PM Dear sir,In that ajax page why it is showing invalid coloumnMy getuser page is--<%@ include</jsp:useB... View Questions/Answers javscript August 18, 2010 at 6:00 PM Dear sir,Thank you for ajax help.it is showing invalid coloumn name when am typing.Another thing sir,i want to display a text box by clicking on Addcc button and then display another text box by clicking on Addbcc button.Primarily there would be no button.After clicking on those buttons text b... View Questions/Answers ajax August 18, 2010 at 12:49 PM Dear Sir,Please help me.I need it urgently.How to query usernames in compose page after typing the 1st name in the To text box in email.After that we can choose one or more for the to box.Likewise addcc and Addbcc text box will have same feature.Please help me,please help me.Regards... View Questions/Answers jsp help August 18, 2010 at 12:04 PM In below code value got in text box using 'ID' Attribute ... I want to use that value in query to fetch related values in same page.... without refreshing page.... 1)selectbox.jsp:<html><head><script language="javascript" type="text/j... View Questions/Answers Servlet Problem August 18, 2010 at 11:55 AM I need to get an alert message when the submit button is clicked again while processing...how is it possible...??Thanks in advance... ... View Questions/Answers ajax August 18, 2010 at 10:31 AM hav... View Questions/Answers java August 18, 2010 at 5:17 AM Hello, how to convert string array to character array in java.kindly give an idea or write a code plz.thanks ... View Questions/Answers java methods August 18, 2010 at 2:42 AM Hello, what is difference between a.length() and a.length;kindly can anybody explain.thanks for your time ... View Questions/Answers java (Automata by java) August 18, 2010 at 2:33 AM Hello All, i have a problem in automata.i want to program DFA by java.i have five states in my dfa. how i will develope a program using java.can anybody help me.i will thankful.thanks ... View Questions/Answers java August 17, 2010 at 10:25 PM Where are the card layouts used? ... View Questions/Answers java August 17, 2010 at 10:18 PM Where are the card layouts used? ... View Questions/Answers How will you add panel to a frame? August 17, 2010 at 10:15 PM How will you add panel to a frame? ... View Questions/Answers java program August 17, 2010 at 8:50 PM sir,i'm ask to develop a program on below question.Design a Vehicle class hierarchy in java.write a test program to demonstratepolymorphism using advanced java concepts and dynamic binding. ... View Questions/Answers java August 17, 2010 at 6:45 PM design a vehicle class hierarchy in java.write a test program to demonstrate polymorphism. ... View Questions/Answers java August 17, 2010 at 6:43 PM implement lisp-like list in java.write basic operations such as 'car','cdr',and 'cons'.if L is a list[3,0,2,5],L.car()returns[0,2,5]. ... View Questions/Answers Problem with open connection August 17, 2010 at 5:59 PM Hi Team, I am running one hibernate application and the database is ORACLE 10g.I am getting the below error.I connected to the database by using JDBC(with same driver and url).Please tell me where my mistake is ?org.hibernate.exception.GenericJDBCException: Cannot open con... View Questions/Answers jsp dropdown August 17, 2010 at 5:42 PM print dropdown selected value in same page without refreshing page in jsp.... ... View Questions/Answers Java Stack August 17, 2010 at 5:17 PM Can you give me a code using Java String STACKusing the parenthesis symbol ( )the user will be the one to input parenthesis symbol and it will determine if valid or invalidand it also tell what is the cause why is it invalid is it excess in open parenthesis (...or... View Questions/Answers ajax August 17, 2010 at 3:59 PM ... View Questions/Answers load and upload. August 17, 2010 at 1:28 PM dear sir, plz give me the sol for my problem.i m waiting for u r reply. why u not replying .. ... View Questions/Answers jaavscript August 17, 2010 at 11:48 AM Dear Sir, Thank you for your reply.I have a mail inbox with e-mails.After reading one of them i want to color the entire line blue.Others unread line should be white as in gmail.Can i have the entire line as click and see the inbox or any other option.Please help meMany Thanks &am... View Questions/Answers Action of h:commanLink in xhtml page doesn't run correctly August 17, 2010 at 10:55 AM In my jsf/facelet xhtml page, when click on h:commanLink, the same page on which has h:commanLink is created in a new window. At second click on the new page, action normally run and rediretion to target page is ok.xhtml code snippet: <h:commandLink action="#{kmmTa... View Questions/Answers mysql August 16, 2010 at 11:30 PM give me a source code to create two table in MsACCESS having one to onerelationship. ... View Questions/Answers even more circles August 16, 2010 at 9:42 PM Write an application that compares two circle objects.? You need to include a new method equals(Circle c) in Circle class. The method compares the radiuses.? The program reads two radiuses from the user? The program then creates two circle objects? and compares them by using ... View Questions/Answers more circles August 16, 2010 at 9:42 PM Write an application that uses Circle class you created in the previous assignment.? The program includes a static method createCircle() thato reads a radius of a circle from the usero creates a circle object, and o returns the object.? The program creates a circle obje... View Questions/Answers how to calculate the employee tax August 16, 2010 at 5:32 PM How to calculate the employee tax.Can u please send to me calculation tables ... View Questions/Answers need of java coding August 16, 2010 at 5:15 PM Design a java interface for ADT stack. Develop it and implement the interface using link list. Provide necessary exception handling for that implementations.pls mail me this lab program..its urgent. ... View Questions/Answers jaavscript & ajax August 16, 2010 at 5:13 PM Morning,Can you tell me coding how to upload Excel file.First, i want to browse the excel file from my desktop, then i have a button to save this excel file to database(MySql).Second, i want to call it as attachment and will have a download option to download agai... View Questions/Answers java August 16, 2010 at 3:32 PM what is the difference between classpath and path ... View Questions/Answers java August 16, 2010 at 3:31 PM how insert the row through ResultSet using the insertRow()method ... View Questions/Answers jdbc August 16, 2010 at 3:29 PM kindly give the example program for connecting oracle dase using oracle thin driver ... View Questions/Answers ftp August 16, 2010 at 2:21 PM pls tell me how to connect to a ftp server and copy a file to local machine using java, with UNIX code for copying purpose. ... View Questions/Answers multi-threaded Java program August 15, 2010 at 5:57 PM ... View Questions/Answers jsp error August 15, 2010 at 4:36 PM To Upload and insert the file into oracle Database with Current Date and Time In JSP and my project is online library management system plz help how to store some books in particular folder and after how retrive books in that folder urgentlyyyyyyy ... View Questions/Answers java programming August 15, 2010 at 11:47 AM Develop a simple OPAC system for library using even-driven and concurrent programming paradigms of Java. Use JDBC to connect to a back-end database.please reply immediately sir. ... View Questions/Answers java August 14, 2010 at 11:23 PM How to embed a image in an awt window?If so which path to be specified and where the image must be placed? ... View Questions/Answers java August 14, 2010 at 6:22 PM what is mean by dynamic binding? ... View Questions/Answers jaavscript August 14, 2010 at 1:32 PM Morning,Can you tell me coding how to upload Excel file.First, i want to browse the excel file from my direktory, then i click this file and view, then i have a button to save this excel file to database(MySql).Second, i want to call it as attachment and will have... View Questions/Answers how to include Timestamp into my enquiry form? August 14, 2010 at 12:24 PM Dear expert,I'd like to include a timestamp function into my enquiry form.However, I am stuck at the servlet portion whereby I want to map my Timesatmp class to my update_time field in my database.Here's my Timestamp.java code:public class Timest... View Questions/Answers Upload photo August 14, 2010 at 7:06 AM Morning,Can you tell me coding how to upload photo.First, i want to browse the photo from my direktory(*.jpg, *.bmp *.gif), then i click this photo and view in my JFrameForm then i have a button to save this photo to database(MySql).Second, i want to calling again... View Questions/Answers javaprograms August 13, 2010 at 5:07 PM provide a class using arraylist ... View Questions/Answers load and upload. August 13, 2010 at 5:06 PM Dear sir/mam,i want code for java based application, that can take .3GP video file and upload it to youtube using youtube's APIs. The video file would be located on a weblink (a direct http link to a video file).i hope u understand what i have asked.plzzzz help me. ... View Questions/Answers javaprograms August 13, 2010 at 5:05 PM provide a class using linkedlist injava ... View Questions/Answers Data Time Picker is not taking as requried field August 13, 2010 at 4:51 PM <s:datetimepicker </s:datetimepicker> when it going to action what is default value? ... View Questions/Answers
http://www.roseindia.net/answers/questions/219
CC-MAIN-2017-17
refinedweb
3,997
66.03
Recently I coded a prototype (for the Cebit 2002) with the release version of Visual Studio.NET. The program had to communicate with an existing server (coded in C++) via a proprietary protocol based on UDP. While doing so, I experienced some strange errors, which finally led me to a major bug in the UdpClient implementation. When more than one UDP packet is enqueued on a socket, UdpClient.Receive will receive packets with the wrong size. The size of the packet is the sum of the sizes of all packets waiting for receive. The received packet will contain correctly the data of the first waiting packet plus so many null bytes as data is available. If you are working with binary data, you have no possibilty to determine the real size of the received packet. UdpClient.Receive Simply download and execute the UdpClientBug example. It will send four packets to a listening socket, and then receive those packets. You should see the following output: UdpClient.Receive Bug Sending 'One' (3 bytes) Sending 'Two' (3 bytes) Sending 'Three' (5 bytes) Sending 'Four' (4 bytes) Received 15 bytes, s = 'One ', s.Length = 15 Received 12 bytes, s = 'Two ', s.Length = 12 Received 9 bytes, s = 'Three ', s.Length = 9 Received 4 bytes, s = 'Four', s.Length = 4 The first packet received has a size of 15 bytes, which is the sum of all send bytes (3+3+5+4 = 15). When reconverted to strings the received packets are unequal to packets which were send. Digging deeper, I have found an explanation what has gone wrong. The UdpClient.Receive() method returns an array of bytes. The implementation of UdpClient has to create this array with an explicit size before it can call Socket.Receive(). I guess that the implementation uses the property Socket.Available to determine the size to reserve for the array. To cite the documentation, "If you are using a message-oriented Socket type such as Dgram (UDP) the available data is the first message in the input queue.". This is wrong! Socket.Available always returns the number of bytes of all data waiting for receive. To prove this, I have written a second method DemonstrateSocketAvailableBug. The difference is, that now I am using a basic Socket to query the Socket.Available property and receive the data. It produces the following output: UdpClient.Receive() Socket.Receive(). Socket.Available Socket.Available DemonstrateSocketAvailableBug Socket.Available Bug Sending 'One' (3 bytes) Sending 'Two' (3 bytes) Sending 'Three' (5 bytes) Sending 'Four' (4 bytes) Available: 15 bytes Received: 3 bytes, s = 'One', s.Length = 3 I guess that Socket.Available uses ioctlsocket with the FIONREAD option. A quote from the winsock documentation: ioctlsocket FION. In conjunction with the impossibility to set a timeout while receiving data, the UdpClient class is pretty useless for receiving UDP packets. You cannot determine the size of an received packet and if a packet is lost on the network, your code will block for ever. As loss of packets is an Udp 'feature' and you have to deal with this situation. So do yourself a favor, don't use UdpClient, but use the basic socket implementation instead. But be aware, the documentation for the Socket.Available property is wrong too. UdpClient UdpClient using System; using System.Net; using System.Net.Sockets; using System.Text; namespace UdpClientBug { class Class1 { [STAThread] static void Main(string[] args) { Bugs bugs = new Bugs(); bugs.DemonstrateUdpClientBug(); bugs.DemonstrateSocketAvailableBug(); Console.WriteLine(); Console.WriteLine("Press enter to continue ..."); Console.ReadLine(); } } class Bugs { private IPEndPoint listenerIP = new IPEndPoint(IPAddress.Loopback, 4201); public void DemonstrateUdpClientBug() { Console.WriteLine(); Console.WriteLine("UdpClient.Receive Bug"); // Setup listener socket UdpClient listener = new UdpClient(listenerIP); // Setup sending socket UdpClient sender = new UdpClient(); sender.Connect(listenerIP); // Sending three datagrams to the listener Send(sender, "One"); Send(sender, "Two"); Send(sender, "Three"); Send(sender, "Four"); // Now receive the three datagrams from the listener Receive(listener); Receive(listener); Receive(listener); Receive(listener); listener.Close(); sender.Close(); } void Send(UdpClient sender, string s) { byte[] dgram = Encoding.ASCII.GetBytes(s); Console.WriteLine("Sending '" + s + "' (" + dgram.Length.ToString() + " bytes)"); sender.Send(dgram, dgram.Length); } void Receive(UdpClient listener) { IPEndPoint from = new IPEndPoint(IPAddress.Any, 0); byte[] dgram = listener.Receive(ref from); string s = Encoding.ASCII.GetString(dgram, 0, dgram.Length); Console.WriteLine ( "Received {0} bytes, s = '{1}', s.Length = {2}", dgram.Length, s, s.Length ); } public void DemonstrateSocketAvailableBug() { Console.WriteLine(); Console.WriteLine("Socket.Available Bug"); Socket listener = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.IP); listener.Bind(listenerIP); UdpClient sender = new UdpClient(); sender.Connect(listenerIP); // Sending three datagrams to the listener Send(sender, "One"); Send(sender, "Two"); Send(sender, "Three"); Send(sender, "Four"); // Receiving first datagram Console.WriteLine("Available: {0} bytes", listener.Available); byte[] dgram = new byte[50]; int nReceived = listener.Receive(dgram); string s = Encoding.ASCII.GetString(dgram, 0, nReceived); Console.WriteLine("Received: {0} bytes, s = '{1}', s.Length = {2}", nReceived, s, s.
https://www.codeproject.com/Articles/1938/Issues-with-UdpClient-Receive
CC-MAIN-2017-34
refinedweb
813
52.66