|
Cambridge
The University of Cambridge is a collegiate public research university in Cambridge, United Kingdom. Founded in 1209 and granted a Royal Charter by King Henry III in 1231, Cambridge is the second-oldest university in the English-speaking world and the world's fourth-oldest surviving university. The university grew out of an association of scholars who left the University of Oxford after a dispute with the townspeople. The two 'ancient universities' share many common features and are often referred to jointly as 'Oxbridge'. The history and influence of the University of Cambridge has made it one of the most prestigious universities in the world. |
| School Subjects(Division) | |
|---|---|
Tuition and Expenses
| Group | |
| Anglo-Saxon, Norse, and Celtic; Archaeology; Asian and Middle Eastern Studies; Classics; Economics; Education; English; History; History and Modern Languages; History and Politics; History of Art; Human, Social, and Political Sciences; Land Economy; Law; Linguistics; Modern and Medieval Languages; Philosophy; Theology, Religion, and Philosophy of Religion | £21,168 |
| Group 2 | |
| Mathematics | £23,607 |
| Group 3 | |
| Architecture; Geography; Music | £27,696 |
| Group 4 | |
| Chemical Engineering; Computer Science; Engineering; Management Studies; Manufacturing Engineering; Natural Sciences; Psychological and Behavioural Sciences | £32,214 |
| Group 5 | |
| Medical and Veterinary Science (including for this purpose the Second M.B. and Second Vet.M.B. Examinations) | £55,272 |
| Section | Average | 25th Percentile | 75th Percentile |
| Math | N/A | N/A | N/A |
| Reading | N/A | N/A | N/A |
| Composite | N/A | N/A | N/A |


| Code | Expected result |
|---|---|
| about:blank opened in new tab | |
| about:blank opened in new tab | |
| Hash-only location.replace in new empty window | |
| webScenarioWindowOpenRegularLink | about:blank opened in new window or tab (via target) |
| webScenarioWindowOpenWithSpecialURL | /..; opened in new window or tab |
| webScenarioWindowOpenRegularLinkMultipleTimes | about:blank opened in new window or tab (via target) |
| webScenarioWindowOpenWithJavaScriptInHref | about:blank opened in a new window or tab (via window.open() on a <a href>) |
| about:blank opened in a new window or tab (via window.open() in a onclick) |
|
| about:blank page opened in new window or tab (via assignment to window.location.href) |
|
| about:blank page opened in new window or tab (via Meta-Refresh in new window) |
|
| webScenarioWindowOpenWithPreventDefaultLink | about:blank opened in a new window, with an href and a preventDefault |
| Open a window and set window.location after reading title |
|
| Open a window and call location.assign on it |
|
| webScenarioWindowOpenBlankTargetWithImmediateClose | Open a window with target=_blank that immediately closes itself |
| webScenarioWindowOpenSameURLWithBlankTarget | Open same window with target=_blank |
| webScenarioWindowOpenWithDelayedClose | Open a window that closes itself after two seconds |
| Trying to close the current window should fail. |
|
| Open a window, then inject a window.open call into that window. |


--- layout: category html-title: Web Accessibility articles title: Posts in “Accessibility” category: Accessibility ---


--- title: BFAgentIO keywords: documentation theme, jekyll, technical writers, help authoring tools, hat replacements last_updated: Dec 03, 2018 sidebar: matlab_docs_sidebar permalink: bfagentio.html folder: mydoc ---
BFAgentIO Class handling communication with the Blackfynn Agent
| Superclasses | WebSocketClient |
| Sealed | true |
| Construct on load | false |
| BFAgentIO | Constructor for objects of the BFAGENTIO class |
| ClientObj | Java-WebSocket client object |
| Secure | True if the connection is using WebSocketSecure |
| Status | Status of the connection, true if the connection is open |
| URI | The URI of the server |
| data | |
| ichunk | |
| package | |
| received_data | |
| session_ | |
| uri |
| close | the websocket connection and explicitely delete the | |
| protected | onBinaryMessage | |
| protected | onClose | This function simply displays the message received |
| protected | onError | This function simply displays the message received |
| protected | onOpen | This function simply displays the message received |
| protected | onTextMessage | This function simply displays the message received |
| open | the connection to the server | |
| send | a message to the server |
| ObjectBeingDestroyed | Notifies listeners that a particular object has been destroyed. |


Turkey sends American Islamic State fighter to U.S. after stalemate with Greece
ANKARA (Reuters) - Turkey sent a U.S. citizen suspected of fighting for Islamic State to the United States by plane on Friday, Interior Minister Suleyman Soylu said, after the man was refused entry to Greece earlier this week.
Turkish authorities started deporting captured Islamic State suspects to their home countries on Monday. Ankara says it has captured 287 militants in northeast Syria, where Turkish troops launched an assault against the Kurdish YPG militia last month, and has hundreds more jihadist suspects in detention.
One of the suspects, a U.S. citizen of Arab descent, had requested deportation to Greece, but was refused entry by Greek police on Monday. The suspect had been stuck in a buffer zone between Turkey and Greece, but the Interior Ministry said on Thursday that the United States had agreed to take him back.
Speaking to reporters in Ankara, Soylu said the suspect had been deported and sent to the United States on Friday by plane from Istanbul. The U.S. State Department said it was aware of the case but would not comment further because of privacy concerns.
Related Coverage
Soylu said two German fighters were also deported on the same day.
So far this week Turkey has also repatriated eight other Germans and one British suspected fighter. Ankara has said that suspects will be deported to Ireland, France and other nations, mostly European states, in the coming days.


Welcome one and all to THE TIME TRIALS!
I'm your host and reigning champ, Cici, the sentient Caesium atom!
Our competitors will undergo a series of challenges to determine who is the best at the true tests of time!
So without further ado, it's time for the first trial!
Our first challenger is nearly 200,000 years old! You know them, you love them, it's... HOMO SAPIENS!
And facing off against them, the single celled spectre, the eukaryote that will carry YOU out... SYNECHOCOCCUS RF-1!
For our first challenge, our brave competitors will have to face a task as old as time.
...Well, that's not true, but at least as old as the Earth!
The first Time Trial is...
Measure the passing of 24 hours!
As soon as it's high noon, when the sun is at the peak of the sky, shout it out!

Ready? Flip the switch to get started!
And don't forget to turn it off when you've seen enough to judge who did best!
Wow they did a great job! But after all, it is a pretty easy challenge. Especially for me! I don't know if you know, but a second is actually defined as yours truly cycling between energy states 9,192,631,770 times!
So this is pretty easy, I just have to count to 794,243,384,928,000. Here let me start...
Hey... wait a second.
First of all, that pun was intended, and second of all, something's not quite right...
Oh! I forgot! It isn't fair if you both can just use the sun to measure 24 hours! You have to do it on your own!
I know, we'll just put you in a room with the lights always on! Give it a shot now!
Well... wow.
Within just 3 days, the human thinks it's high noon when it's the dead of night. I'd understand that from the little Synechococcus, but it's actually doing a better job than the human!
I mean... don't they both have Circadian Rhythms that pretty accurately measure 24 hours? I thought this would be a home run for them...
I guess when they don't have something to sync up their rythms they're not very accurate...
Well, wait, hold on, this is ridiculous!
Oh my gosh! The Human Brain! You're sentient to!
Uh... yeah. I'm a little anthropomorphic too but that's not the point.
This is such an unrealistic scenario. When am I ever going to be locked in a room with the lights on for days? And even if I was, I'd have a watch with me, or my phone.
Well Brainy... can I call you Brainy?
I like to go by Brianne.
Brainy, what do you think happens to time in a room with the lights on? Do you think it slows down?
Well... no... but...
Ugh fine, I'm not very good at keeping track of long periods of time. Happy?
But I'm really good at other things! Want to see me do some math or compose some music?
Well folks looks like the human lost that one pretty handily! I'd hate to be them right now!
Let's see how they do on an easier challenge!

Okay! I get it! I'm not great at time, but really?
An inanimate object??
That I invented???
...Do they even still look like that?
For this challenge, we'll be playing a little red light/green light! Our friend below follows the mouse. When it's moving, it's a green circle, and when it's still, it's a red square. Try it out!
Challengers, the trial is pretty simple: just tell us how long the marker was a red square, and how long it was a green circle!
Um... Brainy? What's... going on with your timeline there? I mean... what does it even mean for something to grow vertically? How can something take up more time without taking up the timeline?
Well... I mean, it's all just sort of related to memory, how long events feel. It's called time dilation. You know, my memories don't all take up the same amount of space, and they're not stored sequentially like a film camera, they're just kind of all over the place.
Don't get me wrong, I know when things happened in time, I just can't like... replay my memories like a movie all the way through.
So to be honest, thinking about time as a line isn't a good way to think about it for me.
I'm just going to pretend you didn't even say that. But can you at least explain why it keeps changing so much?
Well... when the thingy is moving, I'm focusing on it, so I'm not really paying attention to time. And when it's not moving, it's really boring, so it just feels like it's taking forever. You know, like, "time flies when you're having fun!"
Okay, okay, but then what about when the ball moves super fast?
Well when it moves too fast then it kind of freaks me out, and my adrenaline rushes, and I pay a ton of attention to it. So it seems like it must've happened for a long time.
Oh, okay, well that kind of makes sense. When you're in a dangerous situation, you're able to perceive faster and perceive more.
It's sort of like if your mind normally recorded at 60 frames per second, but when you're in danger, it speeds up to 140 frames per second. Then, when you play it back, it's like in slow-mo, and so it seems longer. That's pretty cool Brainy!
Well... haha um... actually I don't think it's like that. When I'm in danger I don't actually perceive any faster or better. I perceive like regular. I'm just paying more attention to a bunch of things, so it feels like it's longer. But it's not like I get slow-mo vision.
Oh...
Wait, wait, wait. Let me see if I'm getting this straight: time moves fast when you're paying attention to something, but when you're paying too much attention it gets slow again?? That doesn't make any sense!!!
Yeah, I mean, it's pretty all over the place. Like, I said boring things seem like they take forever, right? But also, when I think about other boring things, like my commute to work, over time they start to feel like they don't take any time at all!
It seems like any change in all the different parts of me and how I'm feeling can affect my sense of time in a whole bunch of ways. And if there's anything I don't understand, it's my feelings. Therapy helps though!
But, look on the bright side! This is actually pretty cool and useful! I mean, think about it: I'm not fixed to a rhythm, time changes with how I'm feeling! I learn more from dangerous moments. I can spend less energy focusing on the accuracy of time and instead spend it focusing on other things. And painfully boring days don't take up as much of my memory as exciting moments, like seeing a movie with friends! Isn't that so cool?
...
Well, Human, I could only find one more challenge that's any easier for you to try.
All you have to do is say which order these two things happened in . Got it? You don't even have to challenge anyone. You just have to be able to do it.
We're going to hit this drum. And you tell me in which order you SAW the drum get hit and HEARD the drum get hit.
I'll even give you a hint, the speed of light is 299,792,458 meters per second. The speed of sound is only 343 meters per second. You know how you see thunder much sooner than you hear it?
I'll stand all the way back here, so the drum's about 12 feet away from you. And just to make sure you get this right I'll just say it: you should heard the sound roughly 10 milliseconds after the light. I've done the research, even you can perceive that difference in time.
Ready? Let's hit the drum a few times.
Brainy... Just for once...
Okay, wait, this one's actually a really clever thing I can do!
Okay so, walk me through this. First of all, what is the gray and purple stuff?
So the top line on the surface is my objective sensation. That's the information that actually hits my eyes and ears. And the light hits my eyes first, because, like you said, it's much faster than sound.
Which is great. But...?
Well, my subjective perception is what I actually feel. Not what hits my eyes and ears, but what happens when those sense organs and I (the brain) finish processing it. That's the big purple nebulous area.
So why on Earth is your perception not only different from your sensation, but literally changing each time?
Okay, so, think about it. When you hit the drum, it causes both the light and the sound. So at the origin, the space where you make contact, they happen at the same time. But, by the time they reach my senses, there's a delay, because they travel at different speeds.
Right. That's how space and time works, information takes time to travel. It's why the stars we see in the sky lightyears away may be completely different than what we see.  The same with light and sound. I think we're on the same page for once. Though I think I may also just be getting hungry.
Well here's the cool part. Each time you hit the drum, the delay between the sight and sound is really short, and roughly the same each time. So if you keep on doing it, I get to thinking...
Oh no. I hate when you get to thinking.
If the delay is always the same amount, then that probably means something caused them both. And each time it happens I get more and more sure about my hunch, like, statistically! And so, if I'm pretty sure they were caused by the same thing, well, why don't I just try to imagine they happened at the same time?
...Excuse me?
I just start to squish them closer together, so they eventually happen at the same time in my mind, because I'm pretty darn sure they originally happened at the same time to begin with. And then it becomes one, single, easy to digest concept. It's called Lag Adaptation!
Okay, okay, okay, let me get this straight. You're using the statistics of time to imagine causality?
Yup!
Even though to really prove objectively that the drum hit caused the light and sound, you'd have to be both where you are and at the drum at the same time? You're pretending you can be in more than one place at the same time?
Sure! For small delays, I basically get to pretend like the rules of space and time don't apply. They're so complicated anyway, this way of thinking about the world is so much easier To be honest, I don't even really have to think about it, it just happens! And it hasn't let me down yet!
Brainy... how... far does this lag adaptation thing go exactly?
Well, that depends. Do you have a light switch in here?
Yes, but it's a bit wonky, there's delay from when you hit the switch and it turns on- oh no.
Oh yes.
Okay, but the delay on the light is 100 milliseconds. That's ten times more than the drum! And they also don't happen at the same place or time, there's no single origin like last time!
You raise good points! But that's never stopped me before!
Okay, whew, well you didn't manage to squish them to be the same moment this time.
True, but that's only because the lag is 100 milliseconds, you were right that that's starting to get too big for even me. Still I was able to squish the moments together by about 45 milliseconds! A new personal record!
I...
But Cici this is important! 45 Milliseconds is actually almost three times as much as I'd be able to do with the drum. Can you guess why?
To spite me?
It's because i wasn't using two of my senses, it was my sense and my action! I do lag adaptation with my senses to know about causality in the world. But more important is knowing that I have causality with the world; Learning how my actions cause change in the world!
Picture it Cici: I've been walking around in the wilderness and I keep stepping on twigs and making them snap. I need to be able to figure out whether any snap was caused by my action, or a lion following me. So I squish together my steps and the sounds so I feel it was me who did it. The same goes for any time where a sense is caused by my actions, that's probably why I'm so good at all kinds of fine motor skills, I can smush my actions and the feedback into one thing!
Well... if you're done... I think I have my verdict for how you placed in The Time Trials...
Wait, wait, hold on, can you maybe get a new lightbulb in there? If the delay is shorter I know I can manage to smush them together, I know it! Please, please, please?
...Fine. Do your little squishing thing.
EXCUSE ME?! Brainy, did I just see what I think I saw???
Oops, sorry, sorry! I was still used to the old delay! This new one is much faster... I mean, look, I did end up getting there! I just needed to take a few tries to re-adjust to the new, shorter delay!
Brainy... did you just honestly... 'Perceive'... that the light somehow turned on before you flipped the switch?
um... yeah... it's called a Temporal Order Rersal
I thought this worked like time dilation, where you just change the size of time! What happened to squishing, smushing, whatever!! Squishing never reversed the order of things!!! That was the whole point of this challenge! This is the 'Fill in Your Name Here' of challenges! You literally just sensed two things happen in order, and then decided to flip them around! I mean, do you think the light somehow knew you were going to press it? Or that you pressed the button and then the light travelled back in time??
Yeah... I guess squishing isn't really the right way to think about it, hm... I guess it's more like... moving? Editing?
But I mean... remember that time I was able to use the sun to know what time it was? Pretty cool right? Now how do you think I did then at the whole time trials thing?
Well at least I got a medal. Cici said they actually don't usually make a last place medal. But she was really insistant on it.
But you know what? Who really cares about these elaborate challenges? I mean, I get it, I'm not good at keeping track of time, but I've invented things to help me with that! I might not be good at remembering how long things took, but that's because I'm busy focusing on what things mean. And sure, sometimes you can trick my time perception, but that's just the kryptonite to my statistics super power!
My time might not be objectively correct, but it's subjectively awesome. I get to time lapse boring moments and slow down important ones with time dilation. And with lag adaptation I get to break space-time and live in a simpler version of the world that makes more sense.
And as for keeping track of time, that's what the alarm on my phone is for. I'd like to see that bacteria wake up before sunrise to make their flight, hahaha.
Goodnight y'all!
Well shoot.
Thanks everyone for checking this out! It was made in about a week for the explorables jam! Go check them out!
And if you liked this, check out my other doodle brains like 1 Monkey!
If you're the paper reading type, definitely check out the papers mentioned, they're all really clever, especially the one where they show that you don't perceive better when you're in a frightening situation. It's a really clever procedure! And also the temporal order reversal paper, their theories about the implications of temporal order reversals are really interesting, and we still don't fully know!
And if you really like to read papers, check out the thesis I wrote that inspired this lil page! It's about time perception and poses the question: if you can do a temporal order reversal between an action and a perception, could you manage to trick yourself into reversing the order of two actions you chose to make? The answer? Maybe! And the implications about time and our consciousness perception are wild! Science! Whoo!


BBFC Gaming
Under Development
We're doing some work on this game right now. It'll be back as soon as we can fix it!


Insigne missing from Napoli squad for Liverpool clash at Anfield
by OmnisportLorenzo Insigne will miss Napoli's Champions League trip to Liverpool due to an elbow injury.
The 28-year-old suffered the problem during Saturday's Serie A game with AC Milan; he was replaced after 65 minutes of the 1-1 draw at San Siro.
Insigne has four goals and five assists in all competitions this season but has not been included in Napoli's 20-man squad for the match at Anfield.
Fabian Ruiz and Faouzi Ghoulam have been selected, however, despite training separately from their team-mates on Monday.
Carlo Ancelotti's side beat Liverpool 2-0 in the opening round of fixtures and can make certain of a place in the last 16 of the Champions League with victory over the Premier League leaders on Wednesday.


the and for are COVID- classification that doi: {background The from with MERS-CoV \begin{document} \documentclass[pt]{minimal} \setlength{\oddsidemargin}{-pt} \usepackage{amsbsy} \usepackage{amsfonts} \usepackage{amsmath} \usepackage{amssymb} \usepackage{mathrsfs} \usepackage{upgreek} \usepackage{wasysym} al. margin using \end{equation*}\end{document} {border-style }{}\begin{equation*} SARS-CoV px;} #ffffff;} []. coronavirus used different learning versus layer moment results KNN best cascade-forward invariants its one this between classifier coronaviruses has signal system transform two accuracy algorithm all discrete each features into spike X-ray network values ./s---. DNA can error images neighbor obtained px; research respiratory these three value = ) worst {font-family analysis font-size genomic have methods neural new number processing proposed some types where (COVID-) Discrete For Fourier Med Table These \dots back based cosine data diagnosis disease domain double; extracted feature function get like machine many other pattern propagation recognition time value = ; viral which Engineering In: International MCC This University border-color border-width cancer cases comparison genes genetic genome k-nearest length methods. most novel parameters real receptor score selected sequence seven solid; testing virus was will {font-style {font-weight & (Average (COVID (COVID-/MERS-CoV) (COVID-/SARS-CoV) (DCT) (KNN) Conference Coronavirus Figure F = , GSP Nat SARS-CoV, Science Technology They \mathrm{Average}\ accuracy, article bold called characteristics chest classifiers clinical complete courier; detection differentiate distance em; entry epidemic epidemics frequency gene human image input last measure method multi-class order over patient preprint. previous process process, protein pt;} rate, recognize sequences studies terms there ×


Toggle navigation
Services
Portfolio
Special Offers
Testimonials
Contact
855-766-2345
Langhorne, PA
Contact Us
Send Message


Zamfara State CP Condemns Fulani Leaders Over Peace Accord
by Enioluwa AdeniyiFulana leaders and cattle sellers in Zamfara State have been condemned by the Commissioner of Police in the state, Usman Nagogo, for not adhering to the peace accord and reconciliation initiatives by the state government.
Nagogo while speaking with cattle sellers and market leaders at the state police command in Gusau, the state capital, noted that Fulani people could not be using reprisal attacks by killing innocent citizens who have committed no crime to warrant death.
“We have been doing all we could to ensure relative peace in the state but some people are bent on sabotaging all our efforts”.
In his statement, he revealed that the force does not want to employ fire for fire-tactics, hence they set up a peace accord initiatives.
The state commissioner of police charged the Fulani leaders, cattle sellers as well as the market leaders to educate their members as a way of embracing peace and ensuring respect for the peace accord and reconciliation initiated by the state government.
“We would not want the security agencies to be pushed to the wall but if we are pushed to the wall, we will use the force of arms and we will have no alternative than to react negatively because we were trained”.
“There is nowhere in the whole world where development and progress can reign without relative peace”.
Nagogo charged that Fulani leaders to work with security agencies and the government to achieve peace in the state.
The Fulani leaders, market leaders and cattle sellers agreed to give their members sound education in order to ensure peaceful and harmonious living.


{% include js/webfontloader.html %} {% include js/social-share.html %} {% include js/headroom.html %} {% include js/scrolldepth.html %} {% include js/clicktotweet.html %} {% include js/remarketing.html %}


the and for clinical development drugs new time was {background from have licensed that regulatory trials were The margin study {border-style period drug px;} trial #ffffff;} between this This antiviral with Drug increased not those data all approval other research spent viral may taken which However, mean HIV are authors date duration first increase more periods but increasing infection innovative than Health access health px; total year {font-family (r=., . years European Marketing approved been drugs. durations filing font-size indicated initial into launched prior translational treat trend trends . months Application Medicines Nat New USA before double; had has hepatitis initiation only recent review these All Clin Clinical Duration IND National UK, analysis approval. border-color border-width collab: decades different discovery evidence found infections initially longer our pathway pharmaceutical process regulators seen significant solid; statistically timeframes times where {font-style {font-weight (%), ./nrd Authorisation DiMasi Discov;:–. Kaitin LL-P NIHR Our Pharmacol R&D Regulatory Research Rev Ther;:–. Trials also article bold bring considered could courier; development, drugs, em; half highly indication linear medicines most observed part patient period, preclinical pt;} published relevant research, studies submission submitted subsequent there though use used y=.×year—.,


{% extends "index.html" %} {% block main %} {# Main Content #}
These are the hashtags trending on Twitter, plus some sample tweets.


I am an aspiring game developer and programmer, working towards a degree to pursue my fulltime passion of game development. I am currently an undergraduate student at Southern Methodist University in Dallas, TX.
I always love a challenge, which is what makes programming a passion. I'm proficient in C++, C#, and Unity. I have learned to code on my own before heading to college. I continue to find peace in coding games in my spare time. I created this website as a place to showcase my work. If you'd like further information on anything on this site, feel free to contact me here!


gh workflow
List, view, and run GitHub Actions workflows.
More information: home page
- Interactively select a workflow to view the latest jobs for:
gh workflow view
- View a specific workflow in the default browser:
gh workflow view id|workflow_name|filename.yml --web
- Display the YAML definition of a specific workflow:
gh workflow view id|workflow_name|filename.yml --yaml
- Display the YAML definition for a specific Git branch or tag:
gh workflow view id|workflow_name|filename.yml --ref branch|tag_name --yaml
- List workflow files (use `--all` to include disabled workflows):
gh workflow list
- Run a manual workflow with parameters:
gh workflow run id|workflow_name|filename.yml --raw-field param1=value1 --raw-field param2=value2 ...
- Run a manual workflow using a specific branch or tag with JSON parameters from `stdin`:
echo '{"param1": "value1", "param2": "value2", ...}' | gh workflow run id|workflow_name|filename.yml --ref branch|tag_name
- Enable or disable a specific workflow:
gh workflow enable|disable id|workflow_name|filename.yml


Lawsuit against I-976 seeks to silence voters
Cities are feeling the pinch of successful 1- 976 vote. They could also start collecting taxes from all multi-house projects that are scattered all over the cities and exempt from taxes for eight years or so after being built. How about big churches start paying.
We figure taxes are our duty and pay them because that is how the system works to keep things functioning. Everybody pays. Not the case in all circumstances I found out when I saw exempt multi-family buildings while searching for what the city collects taxes on.
What other developer structures are we seeing in Everett that get tax breaks? The newest ones on Broadway? The marina expansion? Did I-976 tax funds fit in with the city paying for that bridge over West Marine View Drive to name a couple.
We should have been able to vote on these expansions, not just pay for them. The light rail project was not fair. Many were confused by the language on the ballot. That is one reason why so many are against the car tab increases.
The Nov. 17 editorial in The Herald (“Voters spoke, but I-976 must get court review”) makes it sound like we-re putting a dirty hand in the city purse by refusing to be over-taxed again when it was approved twice before.
Thank you Tim Eyman. Planners and future growth forecasters have not given the population a fair shake in my opinion. We are over-crowded, over-taxed in the name of revenue. If a vote is taken to remove the fairness of I-976 it will show the people have no voice and our democracy has been smothered.
Terri Lackor
Everett


We forge partnerships between neighbors who use technology to improve interactions with, and access to, public services.  Join us for our co-working, project, service, and social events.
Work with us
Code for Chicago runs on two things: projects and volunteers.
Organizations
Are you a Chicagoland nonprofit that needs some tech help? Have an idea how to make your community better? You've come to the right place. Fill out our Contact Us form or come to one of our meetups to get the conversation started.
Volunteers
Are you a Chicagoland dev, designer, data person, etc. looking to use your skills for the greater good and build your resume? Maybe you’re looking to pick up a new tech skill. You, too, have come to the right place. Sign up for our meetups or join us on Slack.
We forge partnerships between neighbors who use technology to improve interactions with, and access to, public services.  %B %-d, %Y" %} {% assign time = event.local_time | date: "%l:%M %p" %} {{date}} at {{time}}
{{event.name}}
{{event.venue.name}} {{event.venue.address_1}}
Code for America is a network of people who work with community organizations and local governments to deliver better services. We also develop services to show what’s possible in three high-impact focus areas: Criminal Justice, Social Safety Net, and Workforce Development.


|
|
|
{ALG} Encryption
|
|
Someone has just sent you a secret! Download the zip archive to get the share images
needed to retrieve the secret image. If you want to decrypt it, just
visit the website and upload these shares in the decryption section of the {ALG}
page.
Download it!
|
|
About VCrypture
|
|
VCrypture is an online service that allows you to encrypt your secret images safely and send the
result via email directly to your recipient (or just back to you). VCrypture does not save any
images
as the operations are directly made on-the-fly in RAM. We offer four visual cryptographic
algorithms:
Naor Shamir (binary mode), Taghaddos Latif (grayscale mode), Dhiman Kasana EVCT(N, N) and Dhiman
Kasana EVCT(K, N) (both RGB mode).
|
|
|
|
|


Instances at a Glance
Simple Instances with CHOPs
We use instances when working in 3D for a number of reasons. Efficiency, elegance, simplicity, reusability, the the list goes on and on. When working in TouchDesigner we often want to use instances so we can produce multiple copies of the same geometry. Under the hood this is a much more efficient approach to rendering, and allows us to create the illusion of thousands of an object, when we are in fact only making virtual copies of that geometry. If you’ve played with TouchDesigner much, this has a similar behavior to the Copy SOP — the key difference here being that the Copy SOP produces unique pieces of geometry that are computed on the CPU, while instances are handled by the GPU. The effect here is that we can work with many more instances of that geometry, and accomplish illusions that would otherwise be very difficult to achieve if we were only working in a CPU bound context.
So how do we go about creating instances? The geometry component contains two pages dedicated to instancing. For instancing to work we need to first turn on the Instancing toggle, then point to the operator that holds our relevant data.
We might start by just thinking about positional information as important for our instances. Open the example and note that we start with a sphere SOP and then convert that data to CHOPs. Our sopto1 CHOP contains three channels: tx, ty, and tz. Each channel has 42 samples. These represent the positions of each point in the sphere SOP. When using this data for instancing, we’ll end up with a copy of our geometry COMP (in this case a box) at each one of those samples.
Take a moment to look at the geo1 COMP. Notice that the parameters ‘Translate X’, ‘Translate Y’, and ‘Translate Z’ point to channel names in our null_instances CHOP. These parameters let us specify which channels should be used to derive relevant information for our copies.
This style of instancing imagines that we are thinking about our instances in 3D space, and that our sphere defines the location of each copy; the rest are just some mechanics to bring that idea to life.
Tested in TouchDesigner099 2020.23680
Updated 06.03.20
Matthew Ragan
Zoe Sandoval


inputsslider using inputs |
selectslider using select/option |
selectLogslider using select/option with logarithmic scale |
|---|---|---|
This uses jQuery & jQUI to generate a dynamic range slider from a DIV, a FIELDSET and some form inputs. Those form inputs can be either 3 or 4 number INPUTs, or a SELECT with at least two OPTIONs.
inputsslider using inputs |
selectslider using select/option |
selectLogslider using select/option with logarithmic scale |
|---|---|---|


Cursed Network Engineering student.
Has few experience in full-stack development.
Operating own autonomous system.
Contact me if you're interested to hire :D
Music game is LIFE!
Love FPS and simulation games.
Ingress mission collector.


{# # Copyright 2014–2015 Justin Lardinois # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ############################################################################### # pcrp/templates/admin_panel/metadata.html - a component of pCRP # # template for admin panel metadata editor -#}
Invalid Deadlines
{% endif %} {% if mismatched_deadlines %}Mismatched Deadlines
{% endif %} {% if update_success %}Conference Metadata Updated Successfully
{% endif %}


You can scan slides using the JE Transparency Adapter (part number STA8901), available from Jackson Electronics.
You can download the latest software drivers from the Jackson Electronics Web page.
8.5 x 14 in (216 x 356 mm).
Return to the product report.


Register yourself as an Application Provider.
Please provide the following details
First Name
Last Name
Username
Password
Confirm Password
Company
Email ID
Phone Number
Application Name
Application Type
Type of Testing
Upload Application File
Number of Testers
Number of Hours per Tester
Credit card number
Expiration Date (MM/YY)
CVV Code


public class WebServlet
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
fillHeaders(java.lang.String oneLine)
notes all header information in one request into the HashMap, normally only
the Content-Length might be used in this server, but for possible extension,
all headers are marked
|
int |
getContentLength()
indicates the Content-Length of the body of one request,
usually used for POST and PUT requests for writing files.
|
java.lang.String |
getLocalResourceFileName(java.lang.StringBuffer stringBuffer)
reads a desired file name from a POST, DELETE or PUT request,
if the desired file name already exists in the local folder, the new file will replace the
local existing one if the user is allowed to do this
|
static java.lang.String |
getRequestType(java.lang.StringBuffer stringBuffer)
reads the request type from the request text, currently support
HRAD, GET, POST, DELETE, PUT,
if the request is of a type that is not supported,
the default value is an empty request which will later be ignored.
|
java.lang.String |
getResourceFileName(java.lang.StringBuffer stringBuffer)
reads a requested local existing file name from the request String that
is in the resources folder.
|
static java.lang.String |
header(java.lang.String resourceURI,
long length,
java.lang.String status)
writes the header text for a response depending on the given parameters,
currently support limited file type:
text/html, video/mp4, image/png, image/jpg, audio/mp3, video/avi, application/pdf,
the default file type is text/html
|
void |
httpDELETE(java.lang.String resourceURI)
the method that handles the DELETE requests, which deletes a local resource file
deleting critical files is forbidden.
|
void |
httpGET(java.lang.String resourceURI)
the method that handles the GET requests, which can have a lot of functionalities,
currently have 200, 404, 500 responses.
|
void |
httpHEAD(java.lang.String resourceURI)
the method that handles HEAD requests,
currently have 200, 404 responses.
|
void |
httpPOST(byte[] body,
java.lang.String resourceURI)
the method that handles the POST requests, which appends or creates a file.
|
void |
httpPUT(byte[] body,
java.lang.String resourceURI)
the method that handles the PUT requests, which replaces or creates a file.
|
static java.lang.String |
internalErrorMsg()
writes the body text for a 500 response
|
public void fillHeaders(java.lang.String oneLine)
oneLine
- one line of the requestpublic int getContentLength()
public java.lang.String getResourceFileName(java.lang.StringBuffer stringBuffer)
stringBuffer
- the request textpublic java.lang.String getLocalResourceFileName(java.lang.StringBuffer stringBuffer)
stringBuffer
- the request textpublic static java.lang.String getRequestType(java.lang.StringBuffer stringBuffer)
stringBuffer
- the request textpublic static java.lang.String header(java.lang.String resourceURI, long length, java.lang.String status)
resourceURI
- the resource URI namelength
- the size of the filestatus
- the status code of the responsepublic static java.lang.String internalErrorMsg()
public void httpGET(java.lang.String resourceURI) throws java.io.IOException
resourceURI
- the desired resource file namejava.io.IOException
- exception for IO errors when writing output streampublic void httpDELETE(java.lang.String resourceURI) throws java.io.IOException
resourceURI
- the desired resource file namejava.io.IOException
- exception for IO errors when writing output streampublic void httpPUT(byte[] body, java.lang.String resourceURI) throws java.io.IOException
body
- the binary body code of a file from the requestresourceURI
- the desired resource file namejava.io.IOException
- exception for IO errors when writing output streampublic void httpPOST(byte[] body, java.lang.String resourceURI) throws java.io.IOException
body
- the binary body code of a file from the requestresourceURI
- the desired file namejava.io.IOException
- exception when handling output streampublic void httpHEAD(java.lang.String resourceURI) throws java.io.IOException
resourceURI
- the requested file URIjava.io.IOException
- exception of IO when writing the output stream


Using GMaps.js is as easy as:
new GMaps({ div: '#map', lat: -12.043333, lng: -77.028333 });
You must define container ID, latitude and longitude of the map's center.
NoteYou also can define zoom, width and height. By default, zoom is 15. Width an height in a CSS class will replace these values.
NoteMap types are defined in the mapType property. Allowed values are: roadmap (default), satellite, hybrid and terrain.


Experiment Driven Product Development
1399/12/25
Mahdi
Majidzadeh
Product Manager
Basalam.com
The notes go here
What do me mean by "an Experiment"?
What question are we tring to answer?
Why id Important to us?
what do we think the answer might be?
how much evidence will we need to gather in order to get useful answer?
Experiment dont need purpose, they are innovation
Why should we consider trying this approach?
It fource you to challenge the premises underlying your work
It help you uncover new ideas throuth foursing on questions
It enable you treat your users as a equal stakeholder
It helps you focus on thing that actally make a difference
Questions are the key to the XDPD approach
What can you use Experiment For?
Analzing existing behavior within your product
New Feature development
Resoliving disagreements
Understaing the context of your users through qualitive research
The Principles Behind XDPD
Analzing existing behavior within your product
New Feature development
Resoliving disagreements
Understaing the context of your users through qualitive research


% of Middle-Income Households Who Are Burdened in 2015
Total Number of Burdened Middle-Income Households by PUMA in 2015


Code Fellows Books
home
add book
search g-books
login
There be an issue, cap'n
My Books
search
add a new book
submit
update a book
update
verify your passphrase
verify


cli¶
- cli.PORT = 8080¶
A CLI for developing and deploying an app deeply integrated with this repository’s structure. Written to be python version agnostic.
- cli.destroy_dev_command()[source]¶
- Returns:
Command to destroy dev container and image.
- Return type:
str
- cli.get_illegal_mode_command()[source]¶
- Returns:
Command to report that the mode given is illegal.
- Return type:
str
- cli.get_info()[source]¶
Parses command line call.
- Returns:
Mode and arguments.
- Return type:
tuple[str]
- cli.line(text, sep=' ')[source]¶
Convenience function for formatting a given block of text as series of commands.
- Parameters:
text (text) – Block of text.
sep (str, optional) – Line separator. Default: ‘ ‘.
- Returns:
Formatted command.
- Return type:
str
- cli.main()[source]¶
Print different commands to stdout depending on mode provided to command.
- Return type:
None
- cli.push_command()[source]¶
- Returns:
Command to push prod docker image to dockerhub.
- Return type:
str
- cli.resolve(commands)[source]¶
Convenience function for creating single commmand from given commands and resolving ‘{…}’ substrings.
- Parameters:
commands (list[str]) – List of commands.
- Returns:
Resolved command.
- Return type:
str
- cli.version_variable()[source]¶
- Returns:
Command to set version variable from pyproject.toml.
- Return type:
str
- cli.x_tools(command, args=[])[source]¶
Creates a x_tools command string.
- Parameters:
command (str) – x_tools command
args (list, optional) – List of arguments to be passed to the command. Default: []
- Returns:
x_tools command.
- Return type:
str
- cli.x_tools_command(command, args=[])[source]¶
Runs a x_tools command.
- Parameters:
command (str) – x_tools command
args (list, optional) – List of arguments to be passed to the command. Default: []
- Returns:
x_tools command.
- Return type:
str


Fast Ordered Collections for Swift
Using In-Memory B-Trees
- Overview
- Reference Documentation
- What Are B-Trees?
- Why In-Memory B-Trees?
- Laundry List of Issues with Standard Collection Types
- B-Trees to the Rescue!
- Implementation Notes
- Remark on Performance of Imported Generics
Overview
This project provides an efficient in-memory B-tree implementation in pure Swift, and several useful ordered collection types that use B-trees for their underlying storage.
Map<Key, Value>
implements an ordered mapping from unique comparable keys to arbitrary values.
It is likeDictionary
in the standard library, but it does not require keys to be hashable, it has strong guarantees on worst-case performance, and it maintains its elements in a well-defined order.List<Element>
implements a random-access collection of arbitrary elements. It is likeArray
in the standard library, but lookup, insertion and removal of elements at any index have logarithmic complexity. (Array
has O(1) lookup, but insertion and removal at an arbitrary index costs O(n).) Concatenation of two lists of any size, inserting a list into another list at any position, removal of any subrange of elements, or extraction of an arbitrary sub-list are also operations with O(log(n)) complexity.SortedSet<Element>
implements an ordered collection of unique comparable elements. It is likeSet
in the standard library, but lookup, insertion and removal of any element has logarithmic complexity. Elements in anSortedSet
are kept sorted in ascending order. Operations working on full sets (such as taking the union, intersection or difference) can take as little as O(log(n)) time if the elements in the source sets aren’t interleaved.SortedBag<Element>
implements an ordered multiset with comparable elements. This is a generalization of a set that allows multiple instances of the same value. (The standard library does not include such a collection, although you can use a dictionary to emulate one by storing the multiplicities of the keys as values.) The implementation provided in this package stores each duplicate element separately, which may come useful if your elements are reference types with identities or you have some other means to distinguish between equal elements.SortedBag
operations have the same time complexities as the equivalent operations inSortedSet
.BTree<Key, Value>
is the underlying primitive collection that serves as base storage for all of the above collections. It is a general key-value store with full support for elements with duplicate keys; it provides a sum of all operations individually provided by the higher-level abstractions above (and more!).The
BTree
type is public; you may want to use it if you need a collection flavor that isn’t provided by default (such as a multimap) or if you need to use an operation that isn’t exposed by the wrappers.
All of these collections are structs and they implement the same copy-on-write value semantics as
standard Swift collection types like Array
and Dictionary
. (In fact, copy-on-write works even
better with these than standard collections; continue reading to find out why!)
The latest version of BTree
requires Swift 3.0. (The last release supporting Swift 2 was 2.1.0.)
Reference Documentation
The project includes a nicely formatted reference document generated from the documentation comments embedded in its source code.
What Are B-Trees?
B-trees are search trees that provide an ordered key-value store with excellent performance characteristics. In essence, each node maintains a sorted array of its own elements, and another array for its children. The tree is kept balanced by three constraints:
- Only the root node is allowed to be less than half full.
- No node may be larger than the maximum size.
- The leaf nodes are all at the same level.
Compared to other popular search trees such as red-black trees or AVL trees, B-trees have huge nodes: nodes often contain hundreds (or even thousands) of key-value pairs and children.
This module implements a vanilla
B-tree where every node contains full key-value pairs.
(The other popular type is the B+-tree where only leaf nodes contain values;
internal nodes contain only copies of keys.
This often makes more sense on an external storage device with a fixed block size, but it is less useful for
an in-memory implementation.)
Each node in the tree also maintains the count of all elements under it. This makes the tree an order statistic tree, where efficient positional lookup is possible.
Why In-Memory B-Trees?
The Swift standard library offers heavily optimized arrays and hash tables, but omits linked lists and tree-based data structures. This is a result of the Swift engineering team spending resources (effort, code size) on the abstractions that provide the biggest bang for the buck.
Indeed, the library lacks even a basic double-ended queue construct – although Cocoa’s
Foundation
framework does include one inNSArray
.
However, some problems call for a wider variety of data structures.
In the past, linked lists and low-order search trees such as red-black trees were frequently employed; however, the performance of these constructs on modern hardware is greatly limited by their heavy use of pointers.
B-trees were originally invented in the 1970s as a data structure for slow external storage devices. As such, they are strongly optimized for locality of reference: they prefer to keep data in long contiguous buffers and they keep pointer derefencing to a minimum. (Dereferencing a pointer in a B-tree usually meant reading another block of data from the spinning hard drive, which is a glacially slow device compared to the main memory.)
Today’s computers have multi-tiered memory architectures; they rely on caching to keep the system performant. This means that locality of reference has become a hugely important property for in-memory data structures, too.
Arrays are the epitome of reference locality, so the Swift stdlib’s heavy emphasis on Array
as the
universal collection type is well justified.
For example, using a single array to hold a sorted list of items has quite horrible (quadratic) asymptotic complexity when there are many elements. However, up to a certain maximum size, a simple array is in fact the most efficient way to represent a sorted list.
The benchmark above demonstrates this really well: insertion of n elements into a sorted array costs O(n^2) when there are many items, but for many reasonably sized data sets, it is still much faster than creating a red-black tree with its fancypants O(n * log(n)) complexity.
Near the beginning of the curve, up to about eighteen thousand items, a sorted array implementation imported from an external module is very consistently about 6-7 times faster than a red-black tree, with a slope that is indistinguishable from O(n * log(n)).
Even after it catches up to quadratic complexity, in this particular benchmark, it takes about a hundred thousand items for the sorted array to become slower than the red-black tree!
The exact cutoff point depends on the type/size of elements that you work with, and the capabilities of the compiler. This benchmark used tiny 8-byte integer elements, hence the huge number.
The benchmark is based on my own red-black tree implementation that uses a single flat array to store node data. A more typical implementation would store each node in a separately allocated object, so it would likely be even slower.
The chart above is a log-log plot which makes it easy to compare the polynomial exponents of the complexity curves of competing algorithms at a glance. The slope of a quadratic algorithm on a log-log chart (like insertion into a sorted array—the green curves) is twice of that of a linear algorithm (like appending n items to an unsorted array—light blue curve) or a quasilinear one (like inserting into a red-black tree, red curve).
Note that the big gap between collections imported from stdlib and those imported from external modules is caused by a limitation in the current Swift compiler/ABI: when this limitation is lifted, the gap will narrow considerably, which will reduce the element count at which you’ll be able to reap the benefits of lower asymptotic complexity.
(This effect is already visible (albeit in reverse) on the benchmark for the
inlinedsorted array (light green), which is essentially the same code as the regular one (dark green) except it was implemented in the same module as the benchmarking loop, so the compiler has more options to optimize away witness tables and other levels of abstraction. That line starts curving up much sooner, at about 2000 items–imagine having a B-tree implementation that’s equally fast! Or better, try it yourself and report your results. Producing benchmarks like this takes a lot of time and effort.) :-)
This remarkable result is due in large part to the vast number of (to a CPU, random-looking) memory references that are needed to operate on red-black trees. Their intricate ballet of tree rotations looks mighty impressive to us mere humans, but to the delicate caches of your poor CPU, it looks more like a drunken elephant moshing at a thrash metal concert.
Meanwhile, the humble Array
does the only thing it knows: sliding around
long contiguous memory regions. It does this over and over, ad nauseum. It doesn’t look impressive,
but (up to a point) it fits well with how computers work.
So a small Array
is perfect for maintaining a sorted list. But what if the list gets too long?
The B-tree’s answer is to simply cut the array in half, and to create a new index tree node on top to allow
it to quickly find its way around this more complex list structure.
These internal index nodes can also consist of arrays of elements and node references,
creating a nice recursive data structure.
Because their fanout number is so high, B-trees are extremely shallow: for a B-tree with order 100 (which is actually rather on the low end), you can fit a billion items into a tree that’s not more than five levels deep.
Once you accept that small arrays are fast, it is easy to see why B-trees work so well: unless it holds more
elements than its order, a B-tree quite literally is just an Array
.
So it has the same performance behavior as an Array
for a small number of elements,
and when it grows larger it prevents a quadratic upswing by never allowing its arrays to get too large.
The yellow curve on the benchmark above demonstrates this behavior well.
Consider that each node in a typical B-tree can hold about ten full levels of a red-black tree (or AVL trees or whatever binary tree you like). Looking up an item in a B-tree node still requires a binary search of the node array, but this search works on a contiguous memory region, while the conventional search tree is fiddling around with loading pointer values and dereferencing them.
So it makes perfect sense to employ B-trees as an in-memory data structure.
Think about this, though: how many times do you need to work with a hundred thousand ordered items in a typical app? Or even twenty thousand? Or even just two thousand? The most interesting benefits of B-trees often occur at element counts well over a hundred thousand. However, B-trees are not much slower than arrays for low element counts (remember, they are arrays in that case), so it makes sense to use them when there’s even a slight chance that the count will get large.
Laundry List of Issues with Standard Collection Types
The data structures implemented by Array
, Dictionary
and Set
are remarkably versatile:
a huge class of problems is easily and efficiently solved by simple combinations of these abstractions.
However, they aren’t without drawbacks: you have probably run into cases when the standard collections
exhibit suboptimal behavior:
Insertion and removal in the middle of an
Array
can be slow when there are many items. (Keep the previous section in mind, though.)The all-or-nothing copy-on-write behavior of
Array
,Dictionary
andSet
can lead to performance problems that are hard to detect and fix. If the underlying storage buffer is being shared by multiple collection instances, the modification of a single element in any of the instances requires creating a full copy of every element.It is not at all obvious from the code when this happens, and it is even harder to reliably check for. You can’t (easily) write unit tests to check against accidental copying of items with value semantics!
With standard collection types, you often need to think about memory management.
Arrays and dictionaries never release memory until they’re entirely deallocated; a long-lived collection may hold onto a large piece of memory due to an earlier, temporary spike in the number of its elements. This is a form of subtle resource leak that can be hard to detect. On memory-constrained systems, wasting too much space may cause abrupt process termination.
Appending a new element to an array, or inserting a new element into a dictionary or a set are usually constant time operations, but they sometimes take O(n) time when the collection exhausts its allocated capacity. These spikes in execution time are often undesired, but preventing them requires careful size analysis.
If you reserve too little space, you’ll still get spikes; if you reserve too much, you’re wasting memory.The order of elements in a
Dictionary
or aSet
is undefined, and it isn’t even stable: it may change after seemingly simple mutations. Two collections with the exact same set of elements may store them in wildly different order.Hashing collections require their keys to be
Hashable
. If you want to use your own type as the key, you need to write a hash function yourself. It is annoyingly hard to write a good hash function, and it is even harder to test that it doesn’t produce too many collisions for the sets of values your code will typically use.The possibility of hash collisions make
Dictionary
andSet
badly suited for tasks which require guaranteed worst-case performance. (E.g. server code may face low-bandwidth denial of service attacks due to artificial hash collisions.)Array concatenation takes O(n) time, because it needs to put a copy of every element from both arrays into a new contiguous buffer.
Merging dictionaries or taking the union/intersection etc. of two sets are all costly O(n) operations, even if the elements aren’t interleaved at all.
Creating an independently editable sub-dictionary or subset requires elementwise iteration over either the entire collection, or the entire set of potential target items. This is often impractical, especially when the collection is large but sparse.
Getting an independently editable sub-array out of an array takes time that is linear in the size of the result. (
ArraySlice
is often helpful, but it is most effective as a short-lived read-only view in temporary local variables.)
These issues don’t always matter. In fact, lots of interesting problems can be solved without running into any of them. When they do occur, the problems they cause are often insignificant. Even when they cause significant problems, it is usually straightforward to work around them by chosing a slightly different algorithm.
But sometimes you run into a case where the standard collection types are too slow, and it would be too painful to work around them.
B-Trees to the Rescue!
B-trees solve all of the issues above. (Of course, they come with a set of different issues of their own. Life is hard.)
Let’s enumerate:
Insertion or removal from any position in a B-tree-based data structure takes O(log(n)) time, no matter what.
Like standard collection types, B-trees implement full copy-on-write value semantics. Copying a B-tree into another variable takes O(1) time; mutations of a copy do not affect the original instance.
However, B-trees implement a greatly improved version of copy-on-write that is not all-or-nothing: each node in the tree may be independently shared with other trees.
If you need to insert/remove/update a single element, B-trees will copy at most O(log(n)) elements to satisfy value semantics, even if the tree was entirely shared before the mutation.
Storage management in B-trees is granular; you do not need to reserve space for a B-tree in advance, and it never allocates more memory than it needs to store the actual number of elements it contains.
Storage is gradually allocated and released in small increments as the tree grows and shrinks. Storage is only copied when mutating shared elements, and even then it is done in small batches.
The performance of B-trees is extremely stable, with no irregular spikes ever.
(Note that there is a bit of leeway in allocations to make it easy to balance the tree. In the worst case, a B-tree may only fill 50% of the space it allocates. The ratio is typically much higher than that, though.)
B-trees always keep their items sorted in ascending key order, and they provide efficient positional lookups. You can get the i*th smallest/largest item in a tree in O(log(n*)) time.
Keys of a B-tree need to be
Comparable
, notHashable
. It is often significantly easier to write comparison operators than hash functions; it is also much easier to verify that the implementation works correctly. A buggy<
operator will typically lead to obvious issues that are relatively easy to catch; a badly collisioning hash may go undetected for years.Adversaries (or blind chance) will never produce a set of elements for which B-trees behave especially badly. The performance of B-trees only depends on the size of the tree, not its contents. (Provided that key comparison also behaves uniformly, of course. If you allow multi-megabyte strings as keys, you’re gonna have a bad time.)
Concatenation of any two B-trees takes O(log(n)) time. For trees that aren’t of a trivial size, the result will share some of its nodes with the input trees, deferring most copying until the time the tree needs to be modified. (Which may never happen.) Copy-on-write really shines with B-trees!
Merging the contents of two B-trees into a single tree takes O(n) time in the worst case, but if the elements aren’t too badly interleaved, it can often finish in O(log(n)) time by linking entire subtrees into the result in one go.
Set operations on the keys of a B-tree (such as calculating the intersection set, subtraction set, symmetric difference, etc.) also exploit the same trick for a huge performance boost. If the input trees are mutated versions of the same original tree, these operations are also able to skip elementwise processing of entire subtrees that are shared between the inputs.
The
SubSequence
of a B-tree is also a B-tree. You can slice and dice B-trees any way you like: getting a fully independent copy of any prefix, suffix or subrange in a tree only takes O(log(n)) time. You can then take the subtree you extracted and insert it into another tree; this also costs O(log(n)), no matter where in the tree you want to put it. (You do need to keep the order of keys correct, though.)
Implementation Notes
BTree
is a generic struct with copy-on-write value semantics. Internally, it stores its data in
nodes with a fixed maximum size, arranged in a tree. BTree
type provides a full set of hand-tuned
high-level operations to work with elements of a B-tree.
Nodes are represented by instances of a reference type that is not exported as public API. (Low-level access to individual tree nodes would be tricky to get right, and it would prevent future optimizations, such as moving node counts up to parent nodes.)
By default, the tree order (a.k.a., the fanout, or the maximum number of children) is set such
that each node stores about 16KiB data. Larger node sizes make lookups faster, while
insertion/removal becomes slower – 16KiB is a good enough approximation of the optimal node size
on most modern systems. (But you can also set a custom node size if you know better. Note though
that you cannot mix-n-match trees of different orders.) Thus, on a 64-bit system, a B-tree
holding Int
elements will store about 2047 elements per node. Wow!
Individual B-tree nodes may be independently shared between multiple B-trees. When mutating a (partially or fully) shared tree, copy-on-write is restricted to only clone the nodes whose subtree is actually affected by the mutation. This has the following consequences:
- Nodes cannot contain a reference to their parent node, because it is not necessarily unique.
- Mutations of shared trees are typically much cheaper than copying the entire collection at once, which is what standard collection types do.
- The root node is never shared between trees that are not equal.
BTree
allows elements with duplicate keys to be stored in the tree.
(In fact, List
works by using the same (empty) key for all elements.)
All methods that take a key to find an element let you (optionally) specify if you want to work with the first or last matching element, or if you’re happy with any match. The latter option is sometimes faster as it often allows the search to stop at the topmost matching element. There is also a selector that looks for the element after the specified key – this can be nice to determine the position of the end of a range of matching items.
Each node keeps track of the number of items in its entire subtree, so efficient positional lookup is possible. For any i, you can get, set, remove or insert the *i*th item in the tree in log(n) time.
There is a BTreeIterator
and a BTreeIndex
that provide the
usual generator/indexing semantics. While individual element lookup usually takes O(log(n))
operations, iterating over all elements via these interfaces requires linear time. Using the
generator is faster than indexing, so you should prefer using it whenever possible.
There are methods to start an iterator from the middle of the tree:
from any offset, any index, or any key.
Note
Note that forEach
has a specialized recursive implementation,
which makes it the fastest way to iterate over B-trees. There is even a variant that allows you
to stop the iteration when you had seen enough items and want to get off the carousel.
BTreeCursor
is an easy-to-use, general-purpose batch editing facility that allows you to
manipulate the elements of a B-tree conveniently and highly efficiently. You can use a cursor to
walk over the contents of a tree, modifying/inserting/removing elements as needed without a
per-element log(n) lookup overhead. If you need to insert or remove a bunch or consecutive elements,
it is better to use the provided bulk removal/insertion methods than to process them individually
(Range operations have O(log(n)) complexity vs. elementwise processing takes O(k * log(n)).)
Internally, navigation in a B-Tree is based on abstract primitives that maintain a path to a particular
position in the tree, as described by the BTreePath
protocol. The methods directly
provided by this protocol are too low-level for convenient use, but the protocol has extension methods
built on top of these that support familiar concepts like moving back and forth step by step, jumping to
a specific offset in the tree, or looking up a particular key.
Indexes, generators and cursors use their particular implementation of BTreePath
to represent their
own path flavors. All three of them maintain a path of nodes from the root of the tree to a particular
slot of a particular node, but the details are very different:
- A
BTreeIndex
may not hold a strong reference to its tree, because that would interfere with copy-on-write when you want to mutate the tree at a certain index. Thus, indices are wrappers around aBTreeWeakPath
, which uses weak references, and needs to tread very carefully in order to detect when one of its references gets out of date. - Meanwhile a
BTreeIterator
is supposed to support standalone iteration over the contents of the tree, so it must contain strong references. It uses aBTreeStrongPath
to represent the path of its next element. While an iterator only needs to be able to move one step forward,BTreeStrongPath
supports the full tree navigation API, making it very useful elsewhere in the codebase whenever we need a kind of read-only cursor into a tree. For example, the tree merging algorithm uses strong paths to represent its current positions in its input trees. - Finally, a
BTreeCursor
needs to maintain a path where each node is uniquely held by the cursor, ready for mutation. (A cursor owns its own copy of the tree, and does not share it with the outside world until it is finished.) This special path flavor is implemented byBTreeCursorPath
. To speed things up, this struct intentionally breaks the node counts on its current path, to allow for super speedy elementwise insertions and removals. The counts are carefully recalculated whenever the path moves off a node’s branch in the tree.
It would be overkill to create an explicit path to look up or modify a single element in the tree
on its own, so BTree
also provides a set of recursive methods that
implement the same sort of lookups and simple mutations.
They are faster when you need to retrieve a single item, but they aren’t efficient when called repeatedly.
BTree
includes a bulk loading algorithm that efficiently initializes fully loaded
trees from any sorted sequence. You can also specify a fill factor that’s less than 100% if you expect to
insert data into the middle of the tree later; leaving some space available may reduce work to keep the
tree balanced. The bulk loader can optionally filter out duplicate keys for you. It verifies that the
elements are in the correct order and traps if they aren’t.
The bulk loader is based on a general BTreeBuilder
struct that specializes on
appending elements to a newly created tree. Beside individual elements, it also supports efficiently
appending entire B-trees. This comes useful in optimized tree merging algorithms.
Constructing a B-tree from an unsorted sequence of elements inserts the elements into the tree one by one; no buffer is allocated to sort elements before loading them into the tree. This is done more efficiently than calling an insertion method with each element one by one, but it is likely still slower than a quicksort. (So sort elements on your own if you can spare the extra memory.)
The package contains O(log(n)) methods to extract a range of elements as a new B-tree and to insert a B-tree into another B-tree. (Keys need to remain ordered correctly, though.)
Merge operations (such as BTree.union
and BTree.symmetricDifference
)
are highly tuned to detect when they can skip over entire subtrees on their input, linking them into the result or
skipping their contents as required. For input trees that contain long runs of distinct elements, these operations
can finish in as little as O(log(n)) time. These algorithms are expressed on top of a general
tree merging construct called BTreeMerger
.
Remark on Performance of Imported Generics
Current versions of the Swift compiler are unable to specialize generic types that are imported from external modules other than the standard library. (In fact, it is not entirely incorrect to say that the standard library works as if it was compiled each time anew as part of every Swift module rather than linked in as an opaque external binary.)
This limitation puts a considerable limit on the raw performance achievable by collection types imported
from external modules, especially if they are parameterized with simple, extremely optimizable
value types such as Int
or even String
.
Relying on import
will incur a 10-200x slowdown when your collection is holding these most basic
value types. (The effect is much reduced for reference types, though.)
Without access to the full source code of the collection, the compiler is unable to optimize away abstractions
like virtual dispatch tables, function calls and the rest of the fluff we’ve learned to mostly ignore
inside a module. In cross-module generics, even retrieving a single Int
will necessarily go through
at least one lookup to a virtual table. This is because the code that implements the unspecialized generic also executes
for type parameters that contain reference types, whose reference count needs to be maintained.
If raw performance is essential, currently the only way out of this pit is to put the collection’s code inside your module. (Other than hacking stdlib to include these extra types, of course – but that is a bad idea for a thousand obvious reasons.) However, having each module maintain its own set of collections would smell horrible, plus it would make it hard or impossible to transfer collection instances across module boundaries. Plus, if this strategy would be used across many modules, it would lead to a C++ templates-style (or worse) code explosion. A better (but still rather unsatisfactory) workaround is to compile the collection code with the single module that benefits most from specialization. The rest of the modules will still have access to it, if in a much slower way.
The Swift compiler team has plans to address this issue in future compiler versions, e.g., by allowing library authors to manually specialize generics for a predetermined set of type parameters.


---
layout: archive
title: Lean Prover Zulip Chat Archive
permalink: 113488general/13534onadddecl.html
---
The archive URL format has changed. Please find this page at:
https://leanprover-community.github.io/archive/stream/113488-general/topic/on.20add_decl.html


- grat·i·cule, |ˈgratəˌkyoōl|, n. technical
- Navigation. a network of parallels and meridians on a map or chart.
Graticule is a geocoding API for looking up address coordinates and performing distance calculations. It supports many popular APIs, including:
- Yahoo
- Geocoder.ca
- Geocoder.us
- PostcodeAnywhere
- MetaCarta
There is a companion Rails plugin that makes geocoding seem like magic.
Example
require 'rubygems'
require 'graticule'
geocoder = Graticule.service(:google).new "api_key"
location = geocoder.locate "1600 Amphitheatre Parkway, Mountain View, CA"
location.coordinates #=> [37.423021, -122.083739]
location.country #=> "US"
See the API documentation for more details.
International Support
Graticule supports several services with international support. The international geocoders require slightly more structured data than the US ones:
g = Graticule.service(:local_search_maps).new
location = g.locate :street => '48 Leicester Square', :locality => 'London', :country => 'UK'
location.coordinates #=> [51.510036, -0.130427]
Distance Calculation
Graticule includes 3 different distance formulas, Spherical (simplest but least accurate), Vincenty (most accurate and most complicated), and Haversine (somewhere inbetween).
location = geocoder.locate("Holland, MI")
location.distance_to(geocoder.locate("Chicago, IL"))
#=><PHONE_NUMBER>88177
Command Line
Graticule also includes a command line interface to the various geocoders:
$ geocode -s yahoo -a yahookey Washington, DC Washington, DC US latitude: 38.895222, longitude: -77.036758
Installation
Install the gem by executing:
gem install graticule
Or, download it from RubyForge.
Contributing
Contributions are welcome and appreciated! Join the mailing list and grab the source from:
http://source.collectiveidea.com/public/geocode/trunk/


VUKOVAR POSTE RESTANTE A film review by James Berardinelli Copyright 1995 James Berardinelli
RATING (0 TO 10): 9.3
Serbia-Croatia/Italy, 1994 U.S. Availability: 1/96 (limited) Running Length: 1:36 MPAA Classification: No MPAA Rating (Violence, rape, sex, nudity, profanity) Theatrical Aspect Ratio: 1.85:1
Cast: Mirjana Jokovic, Boris Isakovic Director: Boro Draskovic Producer: Danka Muzdeka Mandzuka Screenplay: Boro and Maja Draskovic Cinematograpy: Aleksander Perkovic U.S. Distributor: Tower Releasing Subtitled
If you turn on the evening news these days, one of the first images you're likely to see will originate from the devastated former Yugoslavia, where centuries-old hatreds have boiled over to ignite a scenario of unspeakable horror. Yet the sights of Bosnia, presented by TV as gruesomely tantalizing tidbits of violence and death, rarely provoke a reaction from the casual viewer. That's how it has always been with television news programs, however -- their coverage of any event, designed for those with limited attention spans, is superficial in the extreme. It's nearly impossible to generate any strong feeling for a situation, no matter how cruel or inhumane it is, when all you get is a quick series of MTV-like clips.
So, when it comes to the weightier matters of life, movies often step in where "real life" television leaves off. Films like THE KILLING FIELDS, APOCALYPSE NOW, PLATOON, BEYOND RANGOON, HEAVEN AND EARTH, BEFORE THE RAIN, CRY THE BELOVED COUNTRY, SCHINDLER'S LIST, and dozens of others have gone "behind the scenes" of a news story to animate it, often in gut-wrenching detail. Sure, all those motion pictures are, to one degree or another, fictionalized accounts of war and/or social injustice, but they give form to the tragedy. Through their characters, who come to mean something to the viewer, the indifferent images of TV take on a personal aspect. This is exactly the intent of VUKOVAR POSTE RESTANTE, a rare, even-handed account of the conflict ripping apart Bosnia. This tale of loss, anguish, horror, and futility is powerful beyond words.
VUKOVAR was filmed during 1994 in strife-torn Bosnia. The city of Vukovar, from which the movie takes its name, was a thriving home to 50,000 Serbs and Croats before the war. Now, fewer than 3000 survivors remain.  VUKOVAR's cameras catch all of this. Director Boro Draskovic chose to produce his movie in the former Yugoslavia because he believed no other part of the world could adequately capture his homeland's anguish. So, at peril to cast and crew, who were occasionally fired upon by snipers, the story of two fictional citizens of Vukovar was committed to the screen. It's a sobering consideration to recognize that the background of this picture is not a movie set. Often during VUKOVAR, the line between documentary and fiction becomes very blurred.
Make no mistake, however -- VUKOVAR is not a sterile examination of the evils of war, nor is it a political diatribe. Draskovic has a story to tell, and, while his narrative of two lovers is symbolic of nations, the intimate aspects of the movie remind one of a Shakespearean tragedy, with elements of ROMEO AND JULIET (the doomed romance), MACBETH (the three witches stirring an evil brew in their cauldron), and even JULIUS CAESAR ("The Dogs of War"). At times, the musical score is almost operatic in nature, borrowing heavily from, among others, Mozart.
At the outset of the film, Ana (the stunning Mirjana Jokovic) and Toma (Boris Isakovic) are happy and in love. With the news that the Berlin Wall has fallen, they rejoice in the possibility of a freer world. Then, even as they marry and prepare to start a family, conflict breaks out across the country. Ana, a Croat, and Toma, a Serb, find themselves unwillingly allied with opposing sides. For Ana, it is a time of great personal loss. When Toma leaves home to join the army and her parents are killed, the young woman finds herself alone in a suddenly strange and frightening country where rape, robbery, and murder are everyday realities. Soon, as a reunion with her husband seems increasingly less likely, Ana struggles on only so that her unborn child will not enter the world as a corpse.
If this was a Hollywood story, perhaps the lovers would be reunited at the end to live happily ever after. But the film makers hail from Bosnia, and VUKOVAR has no more joy in it than current events permit. It is a grim story, but hardly more so than SCHINDLER'S LIST. The biggest difference, of course, is the separate historical contexts into which the films fit: the reality of SCHINDLER'S LIST is past; the reality of VUKOVAR goes on, and, if this movie and the short TV news snippets can be believed, the end may not be as close as the signing of a peace treaty.
Distributors like Miramax and Fine Line have shied away from VUKOVAR, fearing a repeat of what occurred with 1995's BEFORE THE RAIN, a similarly-themed movie that died at the box office. But VUKOVAR is a far more devastating experience, and those who do not avoid emotionally- draining features should rejoice that this one, a film festival darling (twelve awards in thirty-five entries), will receive national distribution (albeit of a limited sort). A stunning composition of fact and fiction, VUKOVAR deserves every accolade it collects. Yet perhaps the most telling point is that nearly every showing concludes with a nonplused audience sitting in unbroken silence through the end credits.
- James Berardinelli<EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


acceptTimeout
Returns the length of time in seconds for accept timeouts on the socket.
address
Returns the address (IPAddress or UnixPath) object for the socket.
appendToWriteBuffer(aSequence)
Appends aSequence to the write buffer if it is non-nil. Returns self.
asyncAccept(addressObject)
Immediately returns a socket for a connection if one is available or nil otherwise. Returns an Error object on error.
asyncBind
Binds the socket and returns self immediately or an Error object on error.
asyncConnect(addressObject)
Connects to the given Address and returns self or an Error object on error.
asyncListen
Listens to the socket and returns self immediately or an Error object on error.
asyncStreamOpen
Submits an async request to open the socket in stream mode and returns self immediately or an Error object on error.
asyncStreamRead(aSeq, readSize)
Reads up to readSize number of bytes into aSeq if data is available.
Returns self immediately if successful. Returns an error object on Error. Returns nil if the socket is disconnected.
asyncStreamWrite(aSeq, start, writeSize)
Writes the slice of aSeq from start to start + writeSize to the socket.
Returns self immediately if successful, otherwise closes the socket.
Returns an error object on Error.
Returns nil if the socket is disconnected.
asyncUdpOpen
Submits an async request to open the socket in UDP mode and returns self immediately or an Error object on error.
asyncUdpRead(ipAddress, aSeq, readSize)
Reads up to readSize number of bytes from ipAddress into aSeq if data is available.
Returns self immediately if successful. Returns an error object on Error. Returns nil if the socket is disconnected.
asyncUdpWrite(ipAddress, aSeq, startIndex, readSize)
Writes readsize bytes from aSeq starting at startIndex to ipAddress.
Returns self immediately if successful. Returns an error object on Error. Returns nil if the socket is disconnected.
bytesPerRead
Returns number of bytes to read per read call.
bytesPerWrite
Returns number of bytes to write per write call.
close
Closes the socket and returns self. Returns nil on error.
connect
Connects to the socket's host. Returns self on success or an Error object on error.
connectTimeout
Returns the length of time in seconds for connect timeouts on the socket.
descriptorId
Returns the socket's file descriptor id as a Number.
errorDescription
Returns a description of the last error on the socket as a string.
errorNumber
Returns the socket error number for the last error.
fromFd(descriptorId, addressFamily)
Creates a new Socket with the low-level file descriptor (fd) set to descriptorId and it's address family (AF_INET or AF_UNIX) set to addressFamily.
getSocketReadLowWaterMark
Returns the read low water mark for the socket on success or nil on error.
getSocketWriteLowWaterMark
Returns the write low water mark for the socket on success or nil on error.
host
Returns the host for the socket.
isOpen
Returns true if the socket is open, false otherwise.
isStream
Returns true if the socket is a stream, false otherwise.
isValid
Returns true if the socket is in valid state, closes the socket and returns false otherwise.
path
Returns the U for the socket.
port
Returns the port number for the socket.
readBytes(numBytes)
Reads the socket until its readBuffer is numBytes long, then returns a Sequence
containing the first numBytes of readBuffer's contents and clips that section from the readBuffer.
readListMessage
A shortcut for List fromEncodedList(socket readMessage).
readMessage
Empties the readBuffer and reads a 4 byte uint32 in network byte order.
This number is the number of bytes in the message payload which are
then read into the socket's readBuffer. The readBuffer is returned.
readTimeout
Returns the length of time in seconds for read timeouts on the socket.
readUntilSeq(aSequence)
Reads the socket until its readBuffer contains aSequence, then returns a Sequence
containing the readBuffer's contents up to (but not including) aSequence and clips that section from the readBuffer.
serverOpen
Opens the socket as a stream, binds it to its address and calls asyncListen to prepare the socket to accept connections.
Returns self on success or an Error object on error.
serverWaitForConnection
Waits for a connection or timeout. When a connection is received, this method returns the connection socket.
An Error object is returned on timeour or error.
setAcceptTimeout(seconds)
Sets the length of time in seconds for accept timeouts on the socket. Returns self.
setAddress(addressObject)
Sets the address (IPAddress or UnixPath) for the socket. Returns self. For IP sockets the setHost() method should generally be used to set the host instead of this method. For Unix Domain sockets use the setPath() method.
setBytesPerRead(numberOfBytes)
Sets number of bytes to read per read call. Returns self.
setBytesPerWrite(numberOfBytes)
Sets number of bytes to write per write call. Returns self.
setConnectTimeout(seconds)
Sets the length of time in seconds for connect timeouts on the socket. Returns self.
setHost(hostName)
Translates hostName to an IP using asynchronous DNS and sets
the host attribute. Returns self.
setHost(hostNameOrIpString)
Sets the host for the socket. Returns self on success, an Error object otherwise.
setNoDelay
Sets the socket to be no-delay. Returns self on success or nil on error.
setPath(unixDomainPath)
Sets the Unix Domain socket path for the socket. Returns self.
setPort(portNumber)
Sets the port number for the socket, returns self.
setReadTimeout(seconds)
Sets the length of time in seconds for read timeouts on the socket. Returns self.
setSocketReadBufferSize(numberOfBytes)
Sets the read buffer size for the socket. Returns self on success or nil on error.
setSocketReadLowWaterMark(numberOfBytes)
Sets the read low water mark for the socket. Returns self on success or nil on error.
setSocketWriteBufferSize(numberOfBytes)
Sets the write buffer size for the socket. Returns self on success or nil on error.
setSocketWriteLowWaterMark(numberOfBytes)
Sets the write low water mark for the socket. Returns self on success or nil on error.
setWriteTimeout(seconds)
Sets the length of time in seconds for write timeouts on the socket. Returns self.
streamOpen
Opens the socket in stream mode. Returns self.
streamRead(numberOfBytes)
Reads numberOfBytes from the socket into the socket's readBuffer.
Returns self when all bytes are read or an Error object on error.
streamReadNextChunk(optionalProgressBlock)
Waits for incoming data on the socket and when found, reads any available data and returns self.
Returns self on success or an Error object on error or timeout.
streamReadWhileOpen
Reads the stream into the socket's readBuffer until it closes.
Returns self on success or an Error object on error.
streamWrite(buffer, optionalProgressBlock)
Writes buffer to the socket.
If optionalProgressBlock is supplied, it is periodically called with the number of bytes written as an argument.
Returns self on success or an Error object on error.
udpOpen
Opens the socket in UDP (connectionless) mode. Returns self.
udpRead(address, numBytes)
Waits for and reads numBytes of udp data from the specified address (IPAddress or UnixPath) into the socket's readBuffer.
Returns self on success or an Error object on error.
udpReadNextChunk(address)
Waits to receive UDP data from the specified address (IPAddress or UnixPath).
As soon as any data is available, it reads all of it into the socket's readBuffer.
Returns self on success or an Error object on error.
udpWrite
Same as asyncUdpWrite.
writeFromBuffer(optionalProgressBlock)
Writes the contents of the socket's writeBuffer to the socket.
If optionalProgressBlock is supplied, it is periodically called with the number of bytes written as an argument.
Returns self on success or an Error object on error.
writeListMessage(aList)
A shortcut for writeMessage(aList asEncodedList).
writeMessage(aSeq)
Writes a 4 byte uint32 in network byte order containing the size of aSeq.
Then writes the bytes in aSeq and returns self.
writeTimeout
Returns the length of time in seconds for write timeouts on the socket.
|


|
My Project
|
An interface into a particular binary executable image. More...
#include <loadimage.hh>
Public Member Functions | |
| LoadImage (const string &f) | |
| LoadImage constructor. More... | |
| virtual | ~LoadImage (void) |
| LoadImage destructor. More... | |
| const string & | getFileName (void) const |
| Get the name of the LoadImage. More... | |
| virtual void | loadFill (uint1 *ptr, int4 size, const Address &addr)=0 |
| Get data from the LoadImage. More... | |
| virtual void | openSymbols (void) const |
| Prepare to read symbols. More... | |
| virtual void | closeSymbols (void) const |
| Stop reading symbols. More... | |
| virtual bool | getNextSymbol (LoadImageFunc &record) const |
| Get the next symbol record. More... | |
| virtual void | openSectionInfo (void) const |
| Prepare to read section info. More... | |
| virtual void | closeSectionInfo (void) const |
| Stop reading section info. More... | |
| virtual bool | getNextSection (LoadImageSection &sec) const |
| Get info on the next section. More... | |
| virtual void | getReadonly (RangeList &list) const |
| Return list of readonly address ranges. More... | |
| virtual string | getArchType (void) const =0 |
| Get a string indicating the architecture type. More... | |
| virtual void | adjustVma (long adjust)=0 |
| Adjust load addresses with a global offset. More... | |
| uint1 * | load (int4 size, const Address &addr) |
| Load a chunk of image. More... | |
Protected Attributes | |
| string | filename |
| Name of the loadimage. | |
An interface into a particular binary executable image.
This class provides the abstraction needed by the decompiler for the numerous load file formats used to encode binary executables. The data encoding the machine instructions for the executable can be accessed via the addresses where that data would be loaded into RAM. Properties other than the main data and instructions of the binary are not supposed to repeatedly queried through this interface. This information is intended to be read from this class exactly once, during initialization, and used to populate the main decompiler database. This class currently has only rudimentary support for accessing such properties.
|
inline |
LoadImage constructor.
For the base class there is no relevant initialization except the name of the image.
| f | is the name of the image |
|
inlinevirtual |
LoadImage destructor.
The destructor for the load image object.
|
pure virtual |
Adjust load addresses with a global offset.
Most load image formats automatically encode information about the true loading address(es) for the data in the image. But if this is missing or incorrect, this routine can be used to make a global adjustment to the load address. Only one adjustment is made across all addresses in the image. The offset passed to this method is added to the stored or default value for any address queried in the image. This is most often used in a raw binary file format. In this case, the entire executable file is intended to be read straight into RAM, as one contiguous chunk, in order to be executed. In the absence of any other info, the first byte of the image file is loaded at offset 0. This method then would adjust the load address of the first byte.
| adjust | is the offset amount to be added to default values |
Implemented in RawLoadImage, MyLoadImage, LoadImageBfd, LoadImageXml, and LoadImageGhidra.
|
inlinevirtual |
Stop reading section info.
Once all the section information is read from the load image using the getNextSection() method, this method should be called to free up any resources used in parsing the section info.
Reimplemented in LoadImageBfd.
|
inlinevirtual |
Stop reading symbols.
Once all the symbol information has been read out from the load image via the openSymbols() and getNextSymbol() calls, the application should call this method to free up resources used in parsing the symbol information.
Reimplemented in LoadImageBfd.
|
pure virtual |
Get a string indicating the architecture type.
The load image class is intended to be a generic front-end to the large variety of load formats in use. This method should return a string that identifies the particular architecture this particular image is intended to run on. It is currently the responsibility of any derived LoadImage class to establish a format for this string, but it should generally contain some indication of the operating system and the processor.
Implemented in RawLoadImage, MyLoadImage, LoadImageBfd, LoadImageXml, and LoadImageGhidra.
|
inline |
Get the name of the LoadImage.
The loadimage is usually associated with a file. This routine retrieves the name as a string.
|
inlinevirtual |
Get info on the next section.
This method is used to read out a record that describes a single section of bytes mapped by the load image. This method can be called repeatedly until it returns false, to get info on additional sections.
| record | is a reference to the info record to be filled in |
Reimplemented in LoadImageBfd.
|
inlinevirtual |
Get the next symbol record.
This method is used to read out an individual symbol record, LoadImageFunc, from the load image. Right now, the only information that can be read out are function starts and the associated function name. This method can be called repeatedly to iterate through all the symbols, until it returns false. This indicates the end of the symbols.
| record | is a reference to the symbol record to be filled in |
Reimplemented in LoadImageBfd, and LoadImageXml.
|
inlinevirtual |
Return list of readonly address ranges.
This method should read out information about all address ranges within the load image that are known to be readonly. This method is intended to be called only once, so all information should be written to the passed RangeList object.
| list | is where readonly info will get put |
Reimplemented in LoadImageBfd, and LoadImageXml.
| uint1 * LoadImage::load | ( | int4 | size, |
| const Address & | addr | ||
| ) |
Load a chunk of image.
This is a convenience method wrapped around the core loadFill() routine. It automatically allocates an array of the desired size, and then fills it with load image data. If the array cannot be allocated, an exception is thrown. The caller assumes the responsibility of freeing the array after it has been used.
| size | is the number of bytes to read from the image |
| addr | is the address of the first byte being read |
|
pure virtual |
Get data from the LoadImage.
This is the core routine of a LoadImage. Given a particular address range, this routine retrieves the exact byte values that are stored at that address when the executable is loaded into RAM. The caller must supply a pre-allocated array of bytes where the returned bytes should be stored. If the requested address range does not exist in the image, or otherwise can't be retrieved, this method throws an DataUnavailError exception.
| ptr | points to where the resulting bytes will be stored |
| size | is the number of bytes to retrieve from the image |
| addr | is the starting address of the bytes to retrieve |
Implemented in RawLoadImage, MyLoadImage, LoadImageBfd, LoadImageXml, and LoadImageGhidra.
|
inlinevirtual |
Prepare to read section info.
This method initializes iteration over all the sections of bytes that are mapped by the load image. Once this is called, information on individual sections should be read out with the getNextSection() method.
Reimplemented in LoadImageBfd.
|
inlinevirtual |
Prepare to read symbols.
This routine should read in and parse any symbol information that the load image contains about executable. Once this method is called, individual symbol records are read out using the getNextSymbol() method.
Reimplemented in LoadImageBfd, and LoadImageXml.