Part 3: It's time to say goodbye to the operating system, and boot your PC from your own code.
In the last two issues we've gone through the basics of assembly language, looking at registers, loops, conditionals, the stack and other topics. You now have enough knowledge to write simple assembly programs on Linux – but we're going to get even more low-level this issue. Yes, we're going to jettison the operating system and get down to the bare metal of your PC. You'll write code that executes directly on the CPU and has full control of the machine, without the operating system interfering in any way. Exciting times!
To do this, you need to understand how the PC boot process works, so we'll go through that step by step. Then we'll create a simple bootloader that outputs a message to the screen, and show you how to run it in an emulator. We'll also make it write to removable media such as a USB key, so you can try it on real machines and win an insane number of geek points.
The BIOS is simply some firmware provided in the PC, and contains software that the CPU executes as soon as the PC is turned on. Typically the BIOS will perform a bunch of checks to make sure that the PC is in a sane state – for instance, to check that RAM banks are present, and to produce the classic "Press F1 to continue" message when you don't have a keyboard plugged in.
The BIOS will then attempt to load a chunk of data from some form of media. Most BIOSes know how to access floppy disks, hard drives and CD/DVD-ROM drives, and sometimes USB keys as well. But BIOSes are small, and don't have space for lots of filesystem drivers. So the BIOS doesn't understand the ext4 or Btrfs filesystems as used on Linux, and therefore can't navigate a partition to find the Linux kernel, but it can grab the first 512 bytes from the drive, load it into memory and execute it.
Here's our code, running in a PC emulator – no operating system required!
You can't do much in 512 bytes, but this chunk of code (known as the first stage bootloader) typically has enough logic to load more data from the disk, this time several kilobytes, which can provide a more fully-featured bootloader with menus and options. Alternatively, this code may go on to load more data from the disk and present an even more advanced bootloader with graphics and wider filesystem support. So in the PC boot process, the computer "pulls itself up by its bootstraps" (which is where the term "booting" comes from).
Now, we can write our own code to fit into these 512 bytes and have full control over the machine. But you may be wondering: without an operating system, how are we going to make a message appear on the screen? Won't we have to write a complicated video driver, with pixel-plotting routines and font definitions, which will surely be much larger than 512 bytes?
Well, yes – if we didn't have the BIOS. Along with system health-check and data loading facilities, the BIOS also includes a small set of routines for basic input and output (hence the name). We can ask the BIOS to print a letter to the screen, or check the keyboard for input, without having to write specialised drivers which could require thousands of lines of code. So the BIOS acts as a very rudimentary hardware abstraction layer, letting us do a handful of jobs quickly and easily.
See www.ctyme.com/intr/int-10.htm for a full list of routines provided by the BIOS.
So, let's write some code that fits into this 512-byte space. The following is a short program that prints coloured messages on the screen for infinity – well, until you power off the computer. Type it in and save it in your home directory as boot.asm, or grab it online from www.linuxvoice.com/code/lv014/boot.asm.
If you followed the last two assembly language tutorials, some of this will be familiar to you, but a lot of it is new as well. This is largely because we no longer have access to the Linux kernel to handle various tasks – but we can talk to the BIOS. The first line, BITS 16, is a directive that tells NASM (the program that converts assembly language code into binary for the CPU to execute) that our code is 16-bit. When you switch on an x86 PC, it initially operates in 16-bit mode, like PCs of the early 1980s, for backwards compatibility reasons. Modern operating systems like Linux and Windows use various instructions to switch the CPU into 32-bit (or 64-bit) mode, but we don't need that here – we just want to print some text.
Now, the BIOS loads our 512-byte program into position 07C0 (hexadecimal) in RAM, which is equivalent to 1984 in decimal. (It doesn't load it into position 0, as that's taken up with some important system data.) In the first two mov instructions in our code, we set the data segment register (DS) to point to this 07C0h location. Segments are ugly old remnants of 16-bit code, and we won't deal with them extensively here, but in a nutshell: in a 16-bit register you can store numbers from 0 to 65535. So when using 16-bit memory addresses, you can only access 65536 memory locations – that is, 64k. This is much too small for many tasks, so before 32-bit processors became the norm, 16-bit CPUs used "segments" as offsets to access more RAM.
They made 16-bit programming a mighty pain in the rear, and everyone was happy to move to 32-bit and have easy access to 4GB of RAM. Because our program is tiny, we don't even need to do any complicated operations with segments, and the chances are that you will never have to again in the future – unless you want to write a 16-bit program larger than 64k.
Anyway, we then have three more mov instructions which set up the stack. We place the stack in a certain segment using the SS (stack segment) register, and then put SP (the stack pointer) at position FFFFh. If you've been brushing up on your hexadecimal knowledge since last month, you'll know that FFFFh = 65535 in decimal. So why are we putting the stack pointer at the very final position in a segment? If we push something onto the stack, won't it overflow and cause problems in the program?
And here's the code running off a USB key (emulating a floppy drive) on an Asus laptop. This is the real deal.
Do you remember from the previous tutorials that we called the Linux kernel using int 80h? Well, to access the BIOS we use int 10h, and the BIOS also needs various parameters supplied in registers. Normally you place the BIOS routine you want to use in the AH register, and then extra parameters in the other registers. For instance, to change the video mode we need to place zero in AH – and how do we know that? In the olden days we'd have a thick book detailing the BIOS's inner workings, but today we can find a list of BIOS routines on the web, eg www.ctyme.com/intr/int-10.htm.
You'll see there that there are routines for "Set video mode", "Write graphics pixel", "Teletype output" (which we'll use in a moment) and so forth. If you click on the Int 10/AH=00h link you'll see a list of video modes underneath, and here we're using 0Dh, which is 320×200 pixels in 16-colour mode. That's ridiculously low-res by today's standards, but ensures that the code will work almost everywhere, including on that old late 80s box gathering dust in your attic.
This calls a print_string routine (which we define underneath). The routine takes the location of a zero-terminated string in the SI register, and a colour in BL. This loop goes on forever, and in each iteration we increment the BL register, so it goes from 0 to 255 and then flows over back to 0. This gives us a constant cycle of colours for the message text.
Underneath, you can see that the print_string routine is somewhat similar to the one we implemented last month, albeit simpler as we don't have to work out the string length. This time we use the BIOS's teletype routine, 0Eh, which prints a character to the screen and moves the cursor onwards. The specific character is provided in the AL register (which we retrieve via the lodsb instruction) and the colour is set in BL as mentioned. So in this subroutine we keep retrieving characters from the string and printing them via the BIOS (int 10h) until we hit a zero, and then we ret (return) to the calling code.
The period denotes that this is a local label, and NASM extends it by prefixing it with the nearest full (non-period) label above. So NASM turns this into print_string.repeat when it works through the code. Why is this useful, you may ask? Well, it means you can use the same local label name multiple times in your code. In a big source file, you may want to use lots of labels like loop, repeat or finish. With local labels, each routine can have its own versions of these – you don't need to come up with unique names every single time.
For the BIOS to recognise and load our program, it has to be exactly 512 bytes in size and end with the number AA55h. So the first line here pads out our program with zero bytes until it reaches 510 bytes in size, and then we define a "word" (a 16-bit or two-byte value) of 0AA55h to put at the end.
And that's it! We haven't done a huge amount here, but you can add more of your own code to this bootloader, providing that the resulting binary doesn't grow any larger than 512 bytes. (If your code becomes too big, NASM will complain when you try to assemble it.) 512 bytes may seem tiny, but cunning coders can eke quite a bit of functionality out of this limited space, as shown in the "512-byte OS contest" at http://forum.osdev.org/viewtopic.php?f=2&t=21042. Here, programmers were challenged to make something impressive in 512 bytes, and they certainly succeeded: one developer wrote a pseudo-3D car-racing screen saver, while another implemented the Game of Life.
Another project you may find useful, either as a source of code snippets you can nab, or just general inspiration, is Tetranglix at https://github.com/Shikhin/tetranglix. This is basically Tetris implemented in a bootloader – so inside 512 bytes – and while it's not much of a looker, it maintains the core gameplay elements of the timeless classic. Then there's BootChess, which proudly proclaims that it's the "smallest computer implementation of chess on any platform", weighing in at just 487 bytes: www.pouet.net/prod.php?which=64962.
You may need to do this as root, and if it's a USB floppy drive, change the device to /dev/sdb1 or similar – use dmesg after plugging in the drive to see its device name. Then you can boot your PC from the floppy disk and see your code running natively on your PC.
Be sure to get this exactly right, and replace /dev/sdc with whatever you saw from the dmesg output. Ask on our forums (http://forums.linuxvoice.com) if you get stuck.
Once the data has been written and you're returned to the prompt, restart your PC and in the BIOS boot menu, choose to boot from the USB key. All being well, you'll see the colourful messages again, but this time running on your very own hardware. How cool is that? The answer is: very cool.
And voilà: the coloured messages zoom by, produced by the bare-metal code that you've just written. Not bad, eh? If you want to try it on real hardware, see the boxout, left – and next month we'll expand this bootloader considerably so that it can execute more programs from the disk, including programs you've written yourself. Yes, we'll turn it into a rudimentary, but functioning, operating system!


Starring: Mark Little, Kayla Lorette, Adam Bayne, Jordan Talbot, George William Basil, and various other Picnicface peeps.
"Disco didn't die. It was murdered." Roller Town is pure B-movie buffoonery. Thanks to the hilarious antics of the Halifax-based comedy troupe Picnicface, made famous by their online sensation Powerthirst, Roller Town is a laugh-out-loud farce about the glory days of disco. Thanks to its charmingly comedic camp, Roller Town is the Jesus Christ Vampire Hunter of cheap Canadian roller disco movies.
The Jesus of the roller rink is Leo (Mark Little), a natural born skater who grew up in the back rooms of roller discos. Leo witnessed the death of his father at the hands of some mean goons during his childhood years. His uncle Marty, who manages the popular roller disco club Roller Town, has since raised him to be a good little roller boy.
Life at Roller Town has made Leo dream of being a star skater. He wants to join the ranks of a prestigious roller academy so that he can prove himself with eight little wheels and a pair of hot pants. The academy doesn't seem to want a poor little orphan boy, though, but Leo gets another chance to spin and he shows that he's the real star skater in town when the goons from his past reappear and threaten to fill Roller Town with—gasp!—quarter-guzzling video games!
Leo proves that he has bigger disco balls than every man in town by taking on the inept thugs, plus some sweater-wearing disco haters, with his sweet moves and good vibes. He even gets the girl, Julia (Kayla Lorette), a disco debutante from the roller academy whose parents—gasp!—refuse to let her visit Roller Town lest she end up with a shame baby.
Roller Town moves briskly through its nonsensical plot in a Saturday Night Fever-ish circus of flared pants and big hair. It's seventy-six minutes of pure silliness with the ridiculous disco tracks drawing as many laughs from the crowd as do the potty humour and Family Guy-level randomness. The shameless goofiness of Roller Town works since the whole film looks like it was shot for twenty bucks, with everyone in the cast and crew having a complete riot. The crowd at the Mayfair seemed to having a wild time too, as Roller Town earned constant ripples of laughter from the audience from beginning to end. From the scene-stealing disco duck to the mindless musical numbers, Roller Town is a crowd-pleasing comedy. Hats off to the Picnicfacers: Roller Town is sure to become a Canadian cult classic.
Roller Town screened in Ottawa at The Mayfair on October 25.
It is released in Canada from D Films.


text:
Bengaluru's proposed steel flyover a 'disaster' in making, say experts
Bengaluru: Former Chief Secretary of Karnataka, TP Issar, wrote a stirring book in the late 1980s titled The City Beautiful: A Celebration of the Architectural Heritage and City-Aesthetics of Bangalore. Much of the beauty that defined the city of that time has been lost. Yet there remains plenty to cherish, celebrate and protect. Thus the deafening protest over the Siddaramaiah-led Government of Karnataka's plan to come up with a 6.7 kilometres long steel flyover, which threatens to disfigure and vandalise the city forver, is no surprise.
Representatioal image. Reuters
"This is a poverty of imagination," cried noted architect and vocal critic of the plan, Naresh Narasimhan. "Any substantial infrastructure development should look ahead by at least six generations. Will this steel monstrosity that is to come over the best parts of the city be looked upon as a good thing? Not at all. In fact it is a disaster even at the planning stage," he added.
If the Rs 1,791 crore eyesore calculated at a mind-boggling average cost of Rs 267 crore per km ever comes up, one of Issar's successors could well pen another book titled, Steal City, or, The City Ugly, aver furious critics who have swamped social media with stinging comments.
The worst aspect of the steel flyover, however, is that it is not integrated with any plan made by any government, past or present. This includes the city's Comprehensive Development Plan, which was drafted by a French consortium for the 2005 to 2015 period. It is doubtful whether the Dutch group DHV, currently planning the Bengaluru CDP until 2031, would have a plan to work around this elevated road that aims to connect commuters to the airport from the vicinity of Vidhana Soudha (seat of government, heart of city) to an express road beyond the Hebbal Flyover.
"The abrupt decision to come up with this road is a process failure," thundered Narasimhan.
Reputed urban interventionist Ashwin Mahesh pointed out that none of the neighbourhoods around the proposed area of the project want it. In fact they actively oppose it.
Theatre personality Prakash Belawadi who is dead against the project couldn't reconcile to the idea that the government was attempting to bulldoze public opinion and go ahead with the road.
"They have not done a cost-benefit analysis. The Bangalore Development Authority (BDA) said that they had sought public opinion and got '292 replies'. Can you believe this? They've put up some FAQ-like format of why the flyover was good for the City on the net and come up with this ridiculous reply! This is sheer arrogance. Why could they not be transparent and put the drawings and plan in public domain? Let's have an open debate. If it is the best solution for Bengaluru then so be it. But why this secrecy and selective leaks to some media?" he demanded.
The Siddaramaiah government was quick to brand those opposed to the project as BJP supporters in a bid to make it look like a BJP-Congress divide. But most Bengalureans are furious with the blatant attempt to politicise the issue, rather than get to the root of the problem. That is to de-congest roads.
Ashwin Mahesh who is certainly not a BJP supporter points out that "the government proposes to spend Rs 1,800 crores to benefit fewer than 1 lakh people, whereas the same money spent on buses would benefit 30 lakh people."
The BMTC has a fleet of 6,600 buses which carry close to three million people each day. Yet these buses occupy just three percent of the roads and there is a scope to add hundreds more.
In fact, it is not just more buses. There are many options that the government could explore before needlessly saddling the citizens with this steel flyover.
The most obvious solution for the government, according to experts, would be to link up the NICE road which could serve as a peripheral ring road. The proposed semi-circle from Tumkur Road to Hosur Road via the international airport would take a chunk of the lorry traffic off the city. Additionally 30 percent of airport-bound vehicles too could take the new road and thus avoid CBD.
Besides, the Bengaluru Police has also suggested an alternate road to the airport which requires only a small bit of land acquisition for road widening well beyond the CBD.
Another eminently doable concept is the development of a suburban rail. The Yeshwanthpur to Hosur rail that passes close to most of the software parks has just three trains passing through in a day. More stations and intra-city trains could decongest the city spectacularly, experts point out.
Meanwhile, Mahesh held firm that dedicated bus lanes and the introduction of 3,000 additional buses could be the answer to Bengaluru's traffic woes.
Two other solutions that could solve the issue for a long time to come are extending the existing metro to the airport and the construction of small and effective flyovers at five points: Windsor Manor, Cauvery Junction, Mekhri Circle, CBI Junction and Hebbal Flyover. The small flyovers at these five junctions would cost a total of a mere Rs 80 crore, critics pointed out. These would not only save many of Bengaluru's heritage buildings and lung space (Balabrooie Guest House and Bangalore Golf Course to name a few) but spare hundreds of fully grown trees along the alignment.
But the government of Karnataka is adamant to build the steel flyover. Its cabinet has ratified the proposal in a tearing hurry and now seeks to ram the steel flyover down the throat of the citizens; environment, heritage or public opinion be damned.
Perhaps the Congress does not expect to be back in power after the state elections scheduled for 2018, and this could be the reason for it to rush through with this ill-conceived hyper-expensive steel flyover.
See original article:
Vedam Jaishankar
architectural, ashwin mahesh, bengaluru, cbd, city, hebbal, heritage, india, issar, junction, karnataka
PSBs losses may hamper ability to pay interest on bonds: Crisil
All work and no holidays for Prime Minister Narendra Modi, PMO responds to RTI
Posts by Vedam Jaishankar
IPL in the time of drought: As BCCI faces public ire, here's what they can learn about water conservation
Journalism today: Will social media turn mainstream media irrelevant?
Comments by Vedam Jaishankar

redpajama_set_name: RedPajamaCommonCrawl


Some fear that the rise of the far right could make Germany like the rest of Europe. But there is hope for classical liberals.
Hardly two weeks after the voting, it's too early for a definite appraisal of Germany's general elections. In a democracy, determining the composition of the government is the most important function of the electoral exercise. It seems clear that Germany will have a new government. The so-called Grand Coalition of the Christian Democratic Union (CDU), her Bavaria-only partners of the Christian Social Union (CSU) and the Social Democratic Party (SPD) is history. However, the old chancellor is bound to be the new chancellor: In spite of her party's worst result since 1949, Angela Merkel's CDU remains the strongest party. To form a government, Merkel needs a majority in parliament. Under the given conditions, to put together such a majority is easier said than done.
The most debated scenario is that of a four-party coalition comprising Merkel's CDU, the CSU, the liberal Free Democrats and the Green Party. It may take weeks, if not months, for these diverse political forces to agree on a program for the coming four years. An optimist as always, Merkel said that everything would be settled no later than Christmas.
Observers describe the outcome of the elections as historic. They mention the unparalleled losses of the two big parties CDU and SPD: Germany's 'Volksparteien' – or people's parties – have dominated the scene since the inception of the Federal Republic in 1949. While the SPD could be termed left of center and the CDU is right of center, both have morphed into catch-all parties hoping to attract voters from as many sectors of society as possible. Ideological arbitrariness has been counterproductive, as it has weakened voters' allegiance, as we can now see.
The second consequential – and historic – outcome of the elections is the triumph of the 'Alternative for Germany' (AFD) party. After a series of successes in regional elections, the AFD has now come third with 12. 6 percent of the popular vote. The shrinking of the traditional center-left and center-right parties has been a trend in European elections over the past years. So has the surge of anti-migrant, nationalist parties. One could argue that Germany is following suit, becoming a 'normal' country like her neighbors.
The 'Alternative for Germany' openly questions the need for repentance and cleansing, and rejects the related political consensus of all major political parties. With their nationalist and anti-immigrant rhetoric, the AFD has done particularly well in the Eastern part of Germany, where it is now the second strongest political force with close to 23 percent of the votes.
Discussions about the reasons for the right-wing upheaval dominate Germany's political debates today. Related to this is the question of how the established political parties should best deal with the disruptive newcomers. All agree that the AFD is not fit for a role in government. Therefore, the party plays no role at all in the various scenarios of future coalitions.
The success of the right-wing party would not be possible without the refugee crisis – or, seen from an AFD perspective, without the failure of the Merkel government to contain the mass influx of foreigners. The crisis reached a climax in 2015, when one million refugees, mostly Muslim and hailing from war-ravaged Syria, crossed the German borders in an all-but-orderly manner. With the closing of the Balkan routes and an agreement with Turkey, the annual inflow of refugees to Germany has gone done to under 200,000. Still, the AFD has managed to keep the topic alive and politically toxic.
Some argue that the electoral triumph of the AFD is a failure of democracy. I disagree. It would be more accurate to term the rise of the right a failure of the political establishment in Berlin. The two major political parties who have governed the country in the 'Grand Coalition' for the past four years have portrayed a political image of harmony far away from the socio-political realities on the ground.
For the SPD, it has been practically impossible to overcome the strategic challenge to campaign against Angela Merkel, the very person the party has governed with more or less successfully the past four years. The party's chairman – and top candidate – Martin Schulz, accused Merkel of systematically avoiding all controversies, thereby creating the political space the right wing intruders could fill. Political scientists coined the term 'asymmetric demobilization' for what they called Merkel's deliberate effort to depoliticize the contest with the aim of weakening her main opponent.
The high voter turnout on September 24 refutes the allegation. This time, more than 76 percent of the registered voters cast their ballots, which is five percent more than in the past two elections.
High turnout is good news. From a liberal perspective, the impressive renaissance of the liberal party is without doubt the best news of this election. Having failed to pass the five percent threshold in the 2013 elections, the Free Democratic Party (FDP) returned to the political limelight with 10.7 percent of the vote, and a more or less secured powerful role in Germany's next coalition government.
In the last four years, the party has reinvented itself with a new, youthful leader and a new, modern program. Germany is in need of a liberal party is a sentence heard far beyond the core electorate of the FDP. This party stands for economic freedom, the rule of law and the modernization of Germany. 'Best education' and digitization take up much space in the party's program. To compete economically in a globalized world, Germany is in need of innovation, one of the mantras that recurs in the speeches of party leader Christian Lindner.
In the past, Germany's liberals achieved international recognition and respect because of their leadership in the nation's foreign affairs. Hans-Dietrich Genscher and Guido Westerwelle are names of foreign ministers many people also outside Europe can associate with. In the new government, the FDP intends to focus on the domestic reform agenda. Don't be surprised to see a liberal head the ministry of finance. The departure of Wolfgang Schäuble, arguably Merkel's most powerful supporter in the old cabinet, to the largely ceremonial post of speaker of the Bundestag, frees the way for a free marketer to assume power in a crucial position for German and European financial policy making.
Ronald Meinardus has been the Regional Director of the Friedrich Naumann Stiftung für die Freiheit (FNF) South Asia since 2014. Before this, he served the Foundation in that position at the Regional Office for the Middle East and North Africa (MENA) in Cairo, Egypt for seven years. Earlier, he represented the Foundation in Greece, South Korea and the Philippines. A journalist by profession, Dr Meinardus is also a political commentator and blogger and enjoys writing about developments in the region and beyond.


We work with the best minds in the translation industry to bring you faster and lower cost service. Our computer-aided translation (CAT) systems provide advanced tools for translators to reduce processing time while ensuring that translation, style and tone receive personal attention. They also reduce your costs over time by leveraging on past projects.
Finally, a dedicated translation memory is created for each client and/or special project, and tailored to construct a customized language, unique to your account or project, allowing for optimized efficiency and the lowest possible costs.
Quality is paramount. Our certified translators have years of experience using and developing best practices to ensure the Canacom system is the most reliable to meet all of your translation needs.


text:
Latest News Airline Updates Full Restrictions Quarantine Certification Vaccination Crossing Rules Flight Restriction Open for travel from "Costa Rica" Visa Rules Cheap flights Insurance
Latest News: French authorities add Bahrain, Colombia, Costa Rica and Uruguay to list of COVID-19 high-risk countries (SVI, 17.05.2021).
*Entry rules in response to coronavirus: On 16 March 2020 the Costa Rican government announced a state of emergency and changes to Migratory Regulations.
*Entry to Costa Rica: From 1 November 2020, all travellers proceeding from any country will be admitted into Costa Rica as long as they comply with the requirements below.
Check the requirements for entry. From 26 October 2020, you will no longer need to have a negative COVID-19 certificate within 72 hours before departure, or to self-isolate for 14 days. However, you will still need to buy insurance with specific cover requirements and complete an advance epidemiological information form . These requirements are likely to be strictly enforced. If you have questions about these requirements you should consult your airline.
*Transiting Costa Rica: The authorities are permitting same-day airside transit with a confirmed onward booking.
*Quarantine requirements: Costa Rican Nationals and Legal Residents who enter the country may be required to self-isolate for 14-days. They should complete the epidemiological information form which will specify the exact actions to be taken. Tourists entering from 1 August, under the amended restrictions stated above, will not be required to self-isolate.
*Travel in Costa Rica: The use of private vehicles is currently restricted for the entire country. Restrictions vary as the COVID-19 risk levels change. The restrictions are usually based on the last number of the licence plate. You should check local information.
You can drive in Costa Rica on a your Driving Licence or an International Driving Permit while visiting as a tourist (max 90 days). Due to COVID-19, those who entered the country since 17 December 2019 have had their permission to use their Driving Licence extended while they are lawfully in the country.
If resident for longer periods, you may need to obtain a Costa Rican licence. Drivers should produce their licence and passport if requested to do so by a police officer. There is a requirement for use of face masks on public transport, which can vary with COVID-19 risk levels. Check official information.
The supply of hire cars may be reduced, as rental companies have been asked to lend their vehicles for deliveries of medical equipment and goods. Public transport is operational with some restrictions. Taxis can operate at all hours.
*Accommodation: You should find accommodation that is suitable for your needs. Hotels and many other types of establishment are now being allowed to operate at varying levels of capacity (at 50 or 100%) depending on the level of COVID-19 alert in their location. Check Local Information. For tourist advice, including accommodation and travel, call +506-2299-5827 or via WhatsApp messaging at +506-8628-3247.
*Public spaces and services: There are restrictions on beaches, restaurants, bars and other places where people gather. These are subject to change as COVID-19 risk levels vary. Take note of official advice and information.


text:
FILE – Greece's Prime Minister Kyriakos Mitsotakis holds his cellphone during a parliament session in Athens, Greece, Friday Aug. 26, 2022. Lawmakers…
FILE – Greece's Prime Minister Kyriakos Mitsotakis holds his cellphone during a parliament session in Athens, Greece, Friday Aug. 26, 2022. Lawmakers in Greece on Thursday, Dec. 8, 2022 were debating draft legislation to outlaw commercial spyware following weeks of allegations that senior government officials may have been targeted. (AP Photo/Thanassis Stavrakis, File)
Greece to ban spyware as wiretap scandal grows
by: DEREK GATOPOULOS, Associated Press
ATHENS, Greece (AP) — Lawmakers in Greece are set to approve plans to outlaw commercial spyware following weeks of allegations that senior government officials may have been targeted.
The revelations have hurt public support for the country's center-right government as it faces elections in 2023.
Under the draft legislation, the use, sale or distribution of spyware in Greece will carry a penalty of a two-year minimum prison sentence. Additional safeguards were also planned for legal wiretaps as well as for hiring the director and deputy directors of the National Intelligence Service, or NIS.
Speaking in parliament Thursday, Prime Minister Kyriakos Mitsotakis described the reforms as "a bold institutional response to a challenge that — and I want to emphasize this — does not only concern our country."
Reports in the news media that multiple members of the cabinet as well as other senior officials and journalists may have been targeted with the spyware that can snoop on cell phone calls, stored contacts and data, and access devices' microphones and cameras have prompted a judicial investigation.
In August, a top government aide and the country's security chief resigned following revelations that a Socialist politician who was later elected leader of Greece's third largest party had been the subject of NIS telephone surveillance that the government insists had been legally sanctioned.
The resignations were followed by weeks of newspaper reports that senior officials were being tracked using Predator spyware, which is similar to the more widely known Pegasus surveillance software.
The government insists its agencies have never used the spyware.
The use and alleged use of surveillance software in European Union member states is also the subject of an ongoing inquiry by a European Parliament committee, whose members visited Athens last month.
Facing elections before next summer, the government of Prime Minister Mitsotakis' center-right New Democracy party, has seen its strong lead in opinions polls in recent weeks suffer as a result of the wiretapping allegations and the ongoing cost of living crisis.
Human Rights Watch described the proposed reforms as "problematic," arguing that the government had failed to consult with the country's own independent watchdogs on privacy or include adequate human rights safeguards.
The vote on the bill was due to take place Friday after the debate on Thursday was extended until after midnight.
Police searching for alleged Facebook Marketplace …
Frontier Airlines to offer new nonstop flights from …
Longtime mayor won't seek re-election
A cold arctic blast sweeping from the Great Lakes …
Signing Day in the Valley: Complete list of local …


text:
Q: Groovy Grails test case error when converting to xml I am trying to write a test case for this method, which works when it is hit from non test case code...
import grails.converters.XML
Class itemService(){

    def getData(Map){
        def helperBean = new HelperBean(Map)
        def requestXml = helperBean as XML
            -------- some code-------------
        return requestXml
        }
    }

To test this method, I have a test case like this:
 void testGetData(){

            def service = new itemService()
            def id="123"
            def map = [id:id.toLong()]
            def result = service.getData(map)
            assertNotNull(result)
            assertEquals "123", result.id
        }

But it keeps throwing this exception
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'com.xyz.groovy.utils.helperBean@443acc67' with class 'com.xyz.groovy.utils.HelperBean' to class 'grails.converters.XML'

at this line in the getData(Map method)
   def requestXml = userBean as XML

Can anyone help me out with why it is throwing that exception when the getData(Map) is being hit from the test case only? It is working fine when that method is hit from non test case code.

A: Found the solution. Adding
addConverters(helperBean) in the setup() method of the test case should solve the problem.

A: your testing class, where the testGetData() method was, implemented the ControllerUnitTestCase class or you where using the annotation @TestFor(SomeController)?

redpajama_set_name: RedPajamaStackExchange