text
stringlengths
4
5.48M
meta
stringlengths
14
6.54k
COVID-19 vaccine: White House blocks tougher FDA guidelines on approval FDA Commissioner Stephen Hahn has pledged that career scientists, not politicians, will decide whether any coronavirus vaccine meets clearly stated standards that it works and is safe Updated Oct 06, 2020, 9:45 AM IST Vaccines, unlike therapies, are given to healthy people and thus usually require more proof The White House has blocked new Food and Drug Administration guidelines on bringing potential vaccines for COVID-19 to market that would almost certainly have prevented their approval before the Nov 3 election. At issue was the FDA's planned requirement that participants in the ongoing mass clinical trials for nearly a half-dozen vaccine candidates be followed for two months to ensure there are no side effects and that the vaccines provide lasting protection from the virus in order to receive emergency approval. A senior administration confirmed the move Monday evening, saying the White House believed there was no clinical or medical reason to add additional screening protocols. The White House action was first reported by The New York Times. FDA Commissioner Stephen Hahn has pledged that career scientists, not politicians, will decide whether any coronavirus vaccine meets clearly stated standards that it works and is safe. Vaccine development usually takes years, but scientists have been racing to shorten that time. Science will guide our decisions. FDA will not permit any pressure from anyone to change that, Hahn said recently. I will put the interest of the American people above anything else. The FDA has faced criticism for allowing emergency use of some COVID-19 treatments backed by little evidence, but Hahn has said if vaccine makers want that faster path to market, they would face additional standards. Vaccines, unlike therapies, are given to healthy people and thus usually require more proof. But President Donald Trump made clear last month that he was skeptical of any regulatory changes that might delay a vaccine's authorization, even if those changes are aimed at increasing public trust. Asked about the FDA considering stricter guidelines for emergency approval, Trump suggested the effort was politically motivated. I think that was a political move more than anything else, he said then, arguing that that the companies testing the vaccines, such as Pfizer, Johnson & Johnson and Moderna , are capable of determining whether they work. I have tremendous trust in these massive companies, he said. The senior administration official, who spoke on the condition of anonymity to discuss the action, said the White House was intent on getting a safe vaccine to market and wanted to make sure additional loopholes weren't added that would slow down the process. Published on: Oct 06, 2020, 9:40 AM IST Posted by: intern five, Oct 06, 2020, 9:40 AM IST
{"pred_label": "__label__wiki", "pred_label_prob": 0.8057068586349487, "wiki_prob": 0.8057068586349487, "source": "cc/2023-06/en_middle_0104.json.gz/line21871"}
Photo Flood 59: Lindenwood Park Home Photo Flood 59: Lindenwood Park Lindenwood Park is a great companion to St. Louis Hills, which is just to its south. Both neighborhoods share that characteristic “suburbs in the city” feel (though Lindenwood Park is certainly more accessible), and both neighborhoods enjoyed the characteristic benefits of having Route 66 snake its way through in its heyday. photo by Allen Casey photo by Vivian Nieuwsma Though the obvious companion to present-day Lindenwood Park may be St. Louis Hills, the neighborhood owes more of its origin to those areas of the city and county just to its north and west. Prior to the expansion of the St. Louis city limits in 1876 to include its present boundaries, Lindenwood Park was a sleepy rural subdivision, a loose conjunction of farms and small pocket communes nestled in close to the railroads and the River Des Peres. A train station, named Lindenwood and near present day McCausland and Marquette, brought more serious development to the area, as it provided access to both Downtown St. Louis and Maplewood (the city’s first major suburb and a vibrant commercial district). In addition to commuter transportation, the railroad also offered numerous work opportunities in the loading docks of factories, like Scullins Steel in Ellendale. Nonetheless, for the subdivision originally known as Harlem Place (it wasn’t until after the park in Lindenwood Park was established in the 1950’s that the neighborhood would receive its permanent name change), its first several decades of existence were characterized by slow growth and general quietude. The emergence of the “Mother Road” would change all of that. photo by Talia Long photo by Monica Tirre photo by Donna Burch In November of 1926, U.S. Route 66, or the Mother Road, was established, allowing travelers to drive directly from Chicago to Los Angeles. This route became a right of passage for many Americans, as the route effectively showcased the Country in all of its splendor, from pastoral to grand vistas and from big cities to small towns. For Lindenwood Park, U.S. Route 66 meant big business. photo by Shelly Cendroski photo by James Palmour photo by Katherine Loida Between 1920 and 1930, Lindenwood Park experienced rapid population and economic expansion. The Ivanhoe Business District was established during this time as a sort of commercial main street for the neighborhood. Following this development, apartment buildings began to crop up which meant that the density of the neighborhood was quickly changing. Still, the park itself in Lindenwood Park existed only as a sliver of undeveloped woods owned by real estate maven and future St. Louis Mayor, Joseph Darst. Darts was elected to Mayor in 1949, and it was during this time that he proposed clearing his land tracts in Lindenwood Park for development. The neighborhood association at the time opposed his development plans, and after several intervening lawsuits, Darst conceded by donating the property to the city for the establishment of Lindenwood Park (dedicated in 1955) in exchange for the neighborhood allowing him to building many of the multi-unit apartment buildings that line Jamieson south of the park to this day. It should be noted that Darst was one of the major political proponents behind St. Louis’ “slum clearance” efforts of the mid-19th Century, that would displace so many African-Americans and was responsible for the failed public housing projects such as Pruitt-Igoe and Darst-Webbe. photo by Jennifer Mishra Today, Lindenwood Park is one of St. Louis’ most healthy and vibrant neighborhoods. It has a high rate of occupancy of buildings, compared to other neighborhoods, and as one of the city’s biggest neighborhoods, it is also one of the city’s most populous. Despite this, the neighborhood is extremely safe. Much like St. Louis Hills to its south, Lindenwood Park is not particularly diverse (91% White), which is unfortunate, though this is slowly changing. Nonetheless, the neighborhood is an excellent choice for a summer evening stroll, with beautiful park settings, a wide selection of retail offerings, and some of the best dining available in the entire city. photo by Sharon Keeler photo by Michelle Bates photo by Kevin Good photo by Dan Henrichs Map available here. Two Photo Flooders live in the neighborhood, so our endpoint was a backyard party at Sue and Joe Rakers. Thanks again for hosting! Mini-Flood 43: Laumeier Sculpture Park Jason Gray, April 4, 2016 April 5, 2016 , mini, Mini-Flood, Photo Flood Saint Louis, Photography, St. Louis, Street Photography, Uncategorized, Jason Gray, Laumeier Sculpture Park, Mini-Flood, PFSTL, Photo Flood Saint Louis, Photo Flood STL, 1 photograph by Michelle Bates One of the country’s preeminent outdoor sculpture parks, Laumeier Sculpture Park is 105 undulating acres... Mini-Flood 24: Compton Hill Reservoir Park admin, July 22, 2014 July 14, 2015 , Event Photography, mini, Mini-Flood, Photography, St. Louis, Street Photography, Uncategorized, Compton Hill Reservoir Park, Compton Tower, Jason Gray, PFSTL, Photo Flood Saint Louis, Photo Flood STL, St. Louis, Street Photography, 0 photograph by Dan Henrichs Photography, St. Louis The story of water distribution in St. Louis is a marvelous tale... Jason Gray, March 17, 2020 March 17, 2020 , mini, Mini-Flood, Photo Flood Saint Louis, coronavirus, Covid 19, Mini, Mini-Flood, Miniflood, 0 Photo Flood 12: The Hill admin, July 22, 2013 June 12, 2016 , Photo Flood Saint Louis, photoflood, Photography, St. Louis, Street Photography, Uncategorized, Italian, Jason Gray, Photo Flood Saint Louis, Photo Flood STL, St. Louis, Street Photography, The Hill, 1 photograph by Diane Cannon Piwowarczyk An iconic “little Italy” neighborhood dating from the mid to late 1800’s, The Hill... Photo Flood 22: Clayton admin, June 3, 2014 July 14, 2015 , Event Photography, Exhibition, Guest Speaker, Mini-Flood, Photo Flood Saint Louis, photoflood, Barrister's, Clayton, Jason Gray, PFSTL, Photo Flood Saint Louis, Photo Flood STL, 0 photograph by Michelle Williams Clayton, the administrative and economic center of St. Louis County, shares a relationship with St.... International Photography Hall of Fame Jason Gray, April 10, 2017 April 10, 2017 , Uncategorized, 0 photo by Jason Gray The International Photography Hall of Fame has moved to St. Louis, and the iconic, 48-year... Mini-Flood 71: Jefferson Barracks County Park Jason Gray, March 15, 2019 March 15, 2019 , mini, Mini-Flood, Photo Flood Saint Louis, Photography, St. Louis, Street Photography, Uncategorized, Jason Gray, Jefferson Barracks, Jefferson Barracks County Park, Mini-Flood, PFSTL, Photo Flood Saint Louis, Photo Flood STL, St. Louis, 0 photo by Mark McKeown Jefferson Barracks was established as a military outpost in 1826, after Fort Belle Fontaine was... Photo Flood 72: Tower Grove South Jason Gray, September 2, 2018 September 2, 2018 , Photo Flood, Photo Flood Saint Louis, photoflood, Photography, St. Louis, Street Photography, Uncategorized, Jason Gray, Morganford, PFSTL, Photo Flood Saint Louis, Photo Flood STL, South Grand, St. Louis, Street Photography, TGS, Tower Grove Heights, Tower Grove South, 0 photo by Sue Rakers Tower Grove South is one of the city’s most fashionable (and fast-changing) neighborhoods. Its health... Mini-Flood 52: Cahokia Mounds State Historic SiteMini-Flood 53: Total Solar Eclipse
{"pred_label": "__label__wiki", "pred_label_prob": 0.5474454760551453, "wiki_prob": 0.5474454760551453, "source": "cc/2023-06/en_middle_0104.json.gz/line25024"}
Holton Email(opens in new window/tab) The Holton Calendar Creative Summer(opens in new window/tab) Upcoming Alumnae Events Alumnae Connections Alumnae Board Black Alumnae Union Alumnae Giving Alumnae Awards Canvas @ Holton(opens in new window/tab) My Holton Student Portal(opens in new window/tab) Parent Portal(opens in new window/tab) Employee Portal(opens in new window/tab) Trustee Portal(opens in new window/tab) College Preparatory School for Girls Grades 3-12 Holton Arms-School Holton is a vibrant place where girls are deeply engaged in the process of learning, and since they are both challenged and nurtured, they develop self-confidence, self-esteem, and a sense of competence. Head's Notes History of Holton-Arms Holton at a Glance Brown House Diversity, Equity, and Inclusion & Belonging at Holton Affinity and Allied Spaces Announcing Our Next Head of School Our motto - I will find a way or make one - speaks volumes about a Holton education. Here, girls develop tenacity of purpose, critical thinking, and problem solving skills. Here girls find their voice. The Girls Advantage Financial Aid Program TADS FAQs Virtual Tour(opens in new window/tab) Holton's deep commitment to providing a challenging college preparatory program is buttressed by personal attention and opportunities to excel. Students discover their passions and are encouraged to pursue them to develop their own unique potential. Approach & Philosophy Competency-based Learning Lower School: Grades 3-6 Middle School: Grades 7 & 8 Upper School: Grades 9-12 College Visitors For Admissions Representatives Advisory at Holton Global Scholars Program Hosting an International Student Off-campus Programs Center for the Advancement of STEM Student Technology Requirements Athletics play an important role in Holton experience. From developing basic physical and sports skills to competitive interscholastic sports, Panther pride is on full display with 50 teams in 15 different sports. Athletics Philosophy Teams & Events Sports Clinics Holton celebrates the arts and artists with programs in drawing and painting, photography, ceramics, choral and instrumental music, dance, and drama. Arts Adjunct Program Holton’s Community fabric is tightly woven. Girls learn best in an inclusive and supportive environment where they connect intellectually and emotionally with those around them. Self, Community, World Campus News & Publications Scroll + Scrolling Lower School Holton Highlights Upper School Holton Highlights Middle School Holton Highlights Health & Wellbeing FAQs Adult Wellness Program Since its founding in 1901, Holton has built a tradition of excellence fueled by the generosity of its parents, alumnae, parents of alumnae, grandparents, faculty, and friends. The Holton Fund The Holton Fund FAQs The Holton Fund Giving Levels Make Your Gift Today The Promise Campaign Fund-A-Dream Report On Giving 21-22 Giving Highlights Thank You, Volunteers! The Lower School Library The Alice S. Marriott Library Digital Libraries & Databases The goal of the Library Program is to provide access to the best resources and instruction in their use, fostering the development of lifelong learners and readers. The program is integrated into the curriculum at all grade levels and subject areas. Holton librarians work with Lower, Middle, and Upper School students individually and in scheduled classes to help them foster a love of literature, acquire research skills, develop information literacy, and become sophisticated consumers of rapidly expanding information sources and technologies. There are two libraries on campus, the Lower School Library and The Alice S. Marriott Library which serves the Middle and Upper School divisions. The libraries provide an extensive collection of curricular, co-curricular, and recreational materials, as well as state of the art technology, to students and teachers to foster their quest for knowledge. Carolyn Gagne Upper School Librarian Top Three Books: Les Miserables by Victor Hugo, The Miraculous Journey of Edward Tulane by Kate DiCamillo, Speak by Laurie Halse Anderson First Book I Remember Reading: I remember reading Miss Rumphius, by Barbara Cooney with my mom. I loved the illustrations and the way that the main character lived such a full and interesting life and “made the world more beautiful.” Another excellent book from my childhood was Eric Hill’s Spot Goes to School. I really enjoyed ripping the flaps off since it was a pop-up book. Joy Colburn Library Department Chair Middle School Librarian Top Three Books: Pride and Prejudice by Jane Austen, Me Talk Pretty One Day by David Sedaris, American Born Chinese by Gene Luen Yang Do you have a reading “guilty pleasure?” It’s not “guilty” exactly, but I love books by Jenny Han. I’ve read almost everything she has written including Shug, To All the Boys I’ve Loved Before and The Summer I Turned Pretty series. I met Jenny Han at the National Book Festival and was such a fangirl! I could say I read the books for my job, but that would be a lie. I read them because I love them. I’m also a big fan of graphic novels and sneak one in anytime I can. Jun Niu Lower School Librarian Top Three Books: My Father’s Dragon by Ruth Stiles Gannett, Bridge to Terabithia by Katherine Paterson, and Melissa (previously published as George) by Alex Gino How Do You Decide What to Read? I am always working on several books at the same time. Our four book clubs’ books are always on my list. I love realistic and historical fiction so I always read one or two at a time. I also like non-fiction books, love browsing new arrivals and recent returns, and often end up with two or three in my hands. My secret of “reading” so many at the same time is I use audiobooks. I used to buy them from Audible, but I switched to Libby and Hoopla as soon as I discovered their collections are extensive and free of charge at my local public library. Kelsey Joyce Lower School Assistant Librarian / Lower School Extended Day Coordinator Top Three Books: The Harry Potter series by J.K. Rowling, the Nancy Drew series by Carolyn Keene, and it’s too hard to pick a third one! Happy reading memories: Harry Potter is the book series that made me fall in love with reading. I first read Harry Potter when I was around 7 in third grade (yes, I was always one of the youngest in my grade!). This was 2001 so Harry Potter was BIG, and I believe it was around the time the third book was released. I read the entire Nancy Drew series as a summer reading goal in the summer between 4th and 5th grade. I don’t think I finished all of the Nancy Drew books that summer, but I did read every book I could find searching through every public library in my area. In total I believe I finished 68 of the Nancy Drew books that summer but I did finish the rest of the original series later (175 books). Holton Arms School 7303 River Road, Bethesda, MD 20817 Vidigami The Holton-Arms School does not discriminate on the basis of race, religion, national or ethnic origin, disability, or sexual orientation in the administration of its hiring, educational policy, admissions, financial aid practices, or of its athletic and other School-administered programs.
{"pred_label": "__label__cc", "pred_label_prob": 0.5416824221611023, "wiki_prob": 0.4583175778388977, "source": "cc/2023-06/en_middle_0104.json.gz/line306843"}
Skip to content Go to main navigation Go to language selector Saab and the United States Marine Corps Recognize New Training Agreement [Missing text '/general/legend' for 'English'] Freetext Saab Global 1 February 2023Saab Receives Order for Support of Ground Based Air Defence from Sweden 26 January 2023Invitation to Saab’s Q4 and Full Year 2022 Presentation 26 January 2023Saab Receives Order for AT4 from France 22 December 2022Invitation to Saab’s Capital Markets Day on 14 February 2023 Competing in the international market, requires a strong global presence. We continue to strengthen our presence in key markets, develop innovative solutions and acquire companies in prioritised areas. Saab's products are sold to over 100 countries and we currently operates in over 30 countries. Belgium (nl) Belgium (fr) Brazil (en) Brasil (pt) Canada (en) Canada (fr) Danmark (da) Finland (fi) Finland (sv) Japan (en) Schweiz (de) Suisse (fr) Ελλάδα (el) Congratulations, you won! Saab and the United States Marine Corps (USMC) met today in Orlando to recognize the start of the Force on Force Training Systems - Next (FoFTS-Next) program. The program includes USMC Training Instrumentation Systems (MCTIS) equipment for up to 10 battalions initially, with a full requirement of 16. It also establishes support operations at primary Marine Corps installations and off-station training sites. “Saab is ready to define and implement the next generation of live training capability for our armed forces with the Marine Corps. We’re confident the Force on Force Next system will provide outstanding land-based live training, allowing Marines to learn in the most challenging and realistic environments. I’m honored to join Brigadier General Reid to celebrate the beginning of this partnership,” said Erik Smith, President and CEO of Saab, Inc. "Force on Force Training Systems (FOFTS) Next represents an evolution in Marine Corps training and I am thrilled about how it will impact unit and service level training. A fully instrumented, realistic, all-domain training environment is crucial to generating combat readiness as we transition to Force Design 2030's capabilities, structure, and associated operating concepts. Detailed after-action reports created by this system will also inform and influence how we fight in the present and create new tactics, techniques, and procedures to succeed in the future. The professional military education implications of FOFTS-Next cannot be overstated. The ability to adjudicate and analyze the results of training in real-time will enable truly effective training at every echelon of command and be foundational to the Live, Virtual, Constructive Training Environment we create under Project Tripoli,” said Brigadier General Matthew Reid, Deputy Commanding General, Training and Education Command. The press release for the Force on Force Training Systems – Next can be found here. Photo Credit: USMC photo by Cole Dynes. Kevin Boland, Director, Corporate Affairs [email protected] www.saabinc.com Follow @saab_inc on Twitter, Instagram, and LinkedIn. Saab is a leading defense and security company with an enduring mission, to help nations keep their people and society safe. Empowered by its 18,000 talented people, Saab constantly pushes the boundaries of technology to create a safer, more sustainable and more equitable world. Saab designs, manufactures and maintains advanced systems in aeronautics, weapons, command and control, sensors and underwater systems. Saab is headquartered in Sweden. It has major operations all over the world and is part of the domestic defense capability of several nations. Saab, Inc. is a U.S. based wholly owned subsidiary, delivering advanced technology and systems, supporting the U.S. Armed Forces and the Federal Aviation Administration, as well as international and commercial partners. Headquartered in Syracuse, New York, the company has business units and local employees in six U.S. locations. JPG, 0.8 MB Saab Receives US Navy Readiness Support Tasking for Littoral Combat Ships The Naval Surface Warfare Center – Port Hueneme Division (NSWC PHD) awarded Saab, Inc. (Saab) two new tasks under Contract No. N63394-21-C-0009, via modifications awarded September 26 and 29, 2022, to provide readiness support to the Independence-class Littoral Combat Ship (LCS) fleet. The funded value of these tasks totals USD 19.2 million and was booked in Q3 2022. Saab Receives U.S. Navy Contract for Anti-Submarine Warfare Training Target Saab has received the MK39 Expendable Mobile Anti-Submarine Warfare (ASW) Training Target prime contract (EMATT) from the Naval Undersea Warfare Center Division, Newport. U.S. Navy Advances Saab Radar to Low Rate Initial Production Phase Three The U.S. Navy’s Shipboard Air Traffic Radar (SATR) AN/SPN-50(V)1 program which is currently in Low Rate Initial Production (LRIP) has awarded a modification for two additional Saab radar systems and associated installation support and spare parts. The modification value for the LRIP lot is approximately USD 30 million and was booked in Q3 2022, with the first radar system delivery scheduled for 2024. Radar manufacturing, delivery, test, and integration will take place at Saab’s Syracuse, New York facilities. These are the 6th and 7th systems delivered on the production contract. Keeping people and society safe Saab serves the global market of governments, authorities and corporations with products, services and solutions ranging from military defence to civil security. Follow Saab Olof Palmes gata 17, 5 tr 111 22 Stockholm, Sweden - Box 7808, 10396 Stockholm, Sweden Find Saab offices Saab Partner Portal Company in brief Our share Credit market Saab Pension Fund Resilient and Safe Societies Partnering for Innovation Saab life Support Concept
{"pred_label": "__label__wiki", "pred_label_prob": 0.7586892247200012, "wiki_prob": 0.7586892247200012, "source": "cc/2023-06/en_middle_0104.json.gz/line152686"}
Photos that mean something a little different in the South It's a Southern Thing There are just some things that are a little different in the South. For example, y'all may all see a photo of a Cool Whip container and think, "Oh, that's a topping for my dessert!" And that's totally fine, and valid. But show a Southerner a photo of a Cool Whip container and we immediately think, "Oh, that has Granny's pinto beans inside. Gotta eat those soon!" Read on to find some other photos that just mean a little something different down here: This may look like bacon grease to you ... ... and you're totally right, it's bacon grease -- but it's also basically gold. That's because we use bacon grease for everything down here: cooking, seasoning and even home improvement (more about that here). Y'all best believe we take the bacon grease, scoop it into a jar, and then cover it with Saran wrap to ensure we have some for a rainy day. Read more: Ways Southerners use bacon grease If you think this is a cookie tin, you're wrong. (Red Clay Media) Well, OK, maybe you're right. But look inside it in a Southern home and you won't see any cookies. Instead, you'll see lots of sewing supplies. Just trust us on this one. Look at all that butter! Except you know in the South that's not really butter (or Cool Whip). That's our version of Tupperware, and it probably has some of granny's delicious leftovers inside. Just a bag of Fritos? Mikeledray/Shutterstock In some places, yep. But in others (especially Texas) you may find a delicious Frito pie inside instead. Read more: 9 things you can thank Texas for Yeah, this just looks like some dishes we can use whenever. But that's totally wrong. Everyone knows you can't just use the nice dishes in the curio cabinet -- those are for show. You're probably gonna get in trouble with mama for opening the door. A regular pickle jar? We all agree this is a pickle jar. But after we eat all the pickles, it becomes one of the most versatile objects in our house: It could host leftovers, or maybe some nails in the garage. There are no limits to the options. And yes, this is a rooster figurine. But it's also the perfect kitchen decor. Read more: 22 things you find in a Southern kitchen And lastly, this is a coke ... monticello / Shutterstock.com It's a Pepsi, sure. But it's also a coke, because we Southerners refer to all soft drinks as coke. Here's why. We can't forget Mason jars. Mason jars(Photo by: Edwin Remsberg / VWPics/Universal Images Group via Getty Images) Yes, Mason jars are excellent for canning our garden bounty, but it also makes an excellent glass. 30 road names you'd only see in the South Coke collectibles you see everywhere 30 signs someone is new to the South southern things While "Yellowstone" is known for all the action that takes place on Dutton Ranch, that doesn't mean it's lacking in unforgettable moments where words are what stick with you, especially when it comes to John Dutton, the family's patriarch. Through the five seasons of the hit Paramount Network series, John Dutton has shared what advice he can while dealing with the chaos and treachery that seems to plague his family, employees on the ranch and seemingly everyone else in the state of Montana. Often times, John is the voice of reason -- or at the very least, experience -- among the show's crew, but it isn't all words of wisdom from him. Sure, he doesn't have a way with words in the same way his daughter, Beth Dutton, might be known for (thank goodness) but he still knows how to throw a punch without ever raising his fist. [ Related: 7 shows to watch if you love 'Yellowstone'] With that in mind, we thought we'd share some of our favorite John Dutton quotes in "Yellowstone" so far. With additional seasons already in the works, we're sure they'll be more where these came from. Things every Southerner can cook even if they don't cook 13 Southern animal parks 28 things Southern dads can't help but be sticklers about 15 things that Southerners who live in small towns have done AL.com photo Living in the South is a unique experience itself, but living in a small town? It's full of plenty of quirks and charms. But face it, there are a few things all of us rural Southerners have done. Let's review: 1. Told someone that you're "goin' to town." Need to get groceries at somewhere that's not Dollar General? Want to go to the mall? Then you're going to need to "go to town" -- AKA, the closest town with a Wal-Mart. 2. Given directions like, "It's right past the four-way stop." Because there's only one four-way stop in town. Duh. 3. Eaten lunch from a gas station. From street tacos to burgers, you never know what you'll find at Southern gas stations. (Photo by Brian Kelly/[email protected]) Yep, some of our big-city friends may scoff at this, but small-town Southerners know that some of the best meals come from a convenience store. From street tacos to fried chicken to bodacious burgers, we know we can find some good eats anywhere. 4. Waved at someone far away even though you can't see them. I mean, we know we know them, anyway, and we can't be rude. 5. Hung out in a parking lot. Look, there aren't a lot of options for hangouts in small towns, so we have to be creative. Vacant parking lots, fast-food restaurants -- all are acceptable hangouts when you don't have much to choose from. 6. Spent 30 minutes in the grocery store even when just buying one item. Because you're going to know every person in there and are going to have to stop and talk in every aisle. 7. Gone to a Friday night high school football game. High school football games are the biggest social events of the year, and you have to be there -- regardless of if you like football or not. 8. Stopped the car in the middle of the road to talk to someone. Yeah, it's probably not safe to stop in the middle of the road to talk to our friend who's at his mailbox. Because know only about five people travel that road a day. 9. Said, "I know her, she's my kin" In fact, you say this A LOT. 10. Found out your parents know when you've done something wrong before you do. News -- and gossip -- travels fast in small towns. So if you've done anything wrong -- or if someone thinks you've done something wrong -- you can bet everyone will know really soon. 11. Gone out after 10 p.m. and then realized everything is closed. So you have to drive "to town" 30 minutes away to find an open store or restaurant. 12. Told strangers that you live in a nearby town that's more populous. You know they've never heard of your town before, anyway. Why confuse them? 13. Gasped when you hear about big-city house prices Wait, did I hear that right? They paid how much for that house in Nashville? 14. You know there's no point in going to the local mom-and-pops on Sunday. Because the town shuts down for church. 15. Realized you've never locked your doors. Your neighbors, who practically live on their front porch, are the perfect guard dogs. Watch Broken News at Alabama's Sidewalk Film Festival broken news Here's why there's a plastic baby in your King Cake
{"pred_label": "__label__wiki", "pred_label_prob": 0.5271443128585815, "wiki_prob": 0.5271443128585815, "source": "cc/2023-06/en_middle_0104.json.gz/line87584"}
President Obama marks Ramadan By Alexander Mooney, CNN Washington (CNN)– President Obama Monday is marking the beginning of Ramadan, the month-long Muslim holiday of fasting and reflection. In a statement issued by the White House, the president said, "Times like this remind us of the lesson of all great faiths, including Islam – that we do unto others as we would have them do unto us." He also said he will be hosting an iftar dinner at the White House, an event he hosted last year as well. You can read Obama's full statement on CNN's White House blog The 1600 Report Filed under: Barack Obama • Belief • Holidays • Islam • Politics • Ramadan Explain it to me: Ramadan No food? No drinking? No sex? It's the Muslim month of Ramadan. CNN Religion Editor Dan Gilgoff explains. Filed under: Belief • Islam • Muslim • Ramadan Understanding the religious history of the Knights Templar By Fareed Zakaria, CNN The group has come to everyone's attention because of Anders Behring Breivik's killing spree in Norway, now just over a week ago. He claimed in his rambling manifesto to represent a modern-day "Knights Templar". Ancient Knights Templar name used in modern criminal crusades But who are they? The name might ring a bell, especially if you've seen The DaVinci Code or National Treasure or one of any number of recent films. But these are, of course, all fictional. What are the facts? Read more about all the latest security news in CNN's new blog Security Clearance. The Knights Templar were a Christian military order founded in the early 12th century. Its members were said to be elite warriors who wore distinctive white mantles with a red cross. They made their reputation by winning a series of battles in the Crusades. Read more about the Knights Templar from GPS Filed under: Belief • Christianity • Church • Europe • Houses of worship • Mosque This photo of Tripoli was taken during a guided government tour on July 22 during a pro-Col. Moammar Gadhafi rally. In Tripoli, Libyans prepare for Ramadan By Ivan Watson and Jomana Karadsheh, CNN Tripoli, Libya (CNN) - Last-minute shopping before the start of the Muslim month of Ramadan brought back bustle and commercial activity to the center of a city that is increasingly showing strain from Libya's grinding civil war. In downtown Tripoli, cars were backed up in traffic jams. Shoppers lined up outside a bakery waiting for bread. Not far away, another line of residents stood next to an ATM machine, waiting for their turn to withdraw cash. The busy scene on Sunday was a sharp contrast to previous government-sponsored tours of the city, which revealed rows of shuttered shops and streets largely devoid of traffic. Asked about how the civil war is likely to impact the imminent month of fasting and feasting, many Tripoli residents insisted they were not facing any hardships whatsoever. Rerad the full story here about what may be a bloody Ramadan in Libya Filed under: Belief • Islam • Libya • Middle East This file image, taken October 13, 2007, shows Egyptians praying in Cairo's streets during the holy month of Ramadan. Unrest in Middle East, Africa cast pall over Ramadan for Muslims By the CNN Wire Staff (CNN) - Muslims around the world on Monday ushered in Ramadan, a month of dawn-to-dusk abstinence from food and drinks. But this year, the unrest in the Middle East and North Africa has cast a pall over what is traditionally a period of comity and goodwill toward men. Several countries in the region have been swept up in protests against longtime rulers since the January revolt that ousted Tunisian strongman Zine El Abidine Ben Ali. In many cases, these demonstrations and movements have been met with brute force that has escalated into seemingly unending violence. Most anti-government demonstrations have taken place after prayers, with the masses taking to the streets after meeting at mosques. The month, which brings more Muslims to mosques, has some governments worrying that the gatherings will provide more opportunities for such protests - and demonstrators fearing that security forces will crack down forcefully to prevent them. Read the full story here about Ramadan unrest in the Arab world Filed under: Belief • Egypt • Food • Islam
{"pred_label": "__label__wiki", "pred_label_prob": 0.5098505020141602, "wiki_prob": 0.5098505020141602, "source": "cc/2023-06/en_middle_0104.json.gz/line221598"}
Tess Monaghan Books Tess Monaghan is the name given to a series of mystery suspense novels written by Laura Lippman. The books follow the exploits of a young reporter who solves crimes in her native Baltimore City. Order of Tess Monaghan Series 1 Baltimore Blues 1997 Description / Buy 2 Charm City 1997 Description / Buy 3 Butchers Hill 1998 Description / Buy 4 In Big Trouble 1999 Description / Buy 5 The Sugar House 2000 Description / Buy 6 In a Strange City 2001 Description / Buy 7 The Last Place 2002 Description / Buy 8 By a Spider's Thread 2004 Description / Buy 9 No Good Deeds 2006 Description / Buy 10 Another Thing to Fall 2008 Description / Buy 11 The Girl in the Green Raincoat 2008 Description / Buy 12 The Book Thing 2012 Description / Buy 13 Hush Hush 2015 Description / Buy Order of Tess Monaghan Collections 1 The Tess Chronicles 2018 Description / Buy Tess Monaghan was a pretty competent journalist. She knew how to follow a story and to grill targets until she got the answers she wanted. But by the time Baltimore Blues, the first of the Tess Monaghan novels, rolls around, things have taken a sour turn for Tess. Her newspaper crashed and burned and she suddenly found herself without a job. Now Tess has a problem on her hands. She needs to make ends meet; to pay her rent and clear her bills. And once it becomes clear to her that another position in another newspaper might not avail itself, Tess turns to PI work. Her change in careers comes just as a notorious Baltimore lawyer is murdered. Most first-time private detectives might have given the high profile case a wide berth until they had properly mastered the art of investigative work. But then Darryl Paxton, Tess’s friend became the prime suspect in the case and he asked her to look into the matter, unearth a few leads and, hopefully, clear his name. What starts as an experimental pastime that might or might not pay Tess Monaghan’s bills in the first novel explodes into a far more active career than the reporter might have expected. The Tess Monaghan series follows Tess around as she struggles to get her bearings as a Private Investigator, opens her own office and cements her place in the PI world. Each new installment in the series pits Tess against a difficult mystery. The manner in which Tess is drawn into the various mysteries that litter this series varies. Sometimes, she is personally sought out and charged with solving certain crimes. Other times, Tess is close to either the victims or the suspects and those personal ties drive her to get involved. There are also occasions where Tess’ curiosity gets the better of her. When the heroine isn’t chasing down bad guys, she can be found maneuvering the dating scene and trying to maintain a healthy relationship with some of her family members. Baltimore, the setting of this series, is just as prominent a character as Tess, and Laura Lippman spends a lot of time highlighting the city’s most interesting locations. Tess Monaghan Awards Tess has won a Shamus Award, Agatha Award, Anthony Award, Nero Wolf Award, Edgar Allen Poe Award and a Macavity Award for books like Butchers Hill, Baltimore Blues, and No Good Deeds. Best Tess Monaghan Books The Tess Monaghan novels are most commonly praised for their engaging mysteries and strong heroine, with some of the best books in this series including: The Sugar House: Tess Monaghan was doing pretty well when her father asked a favor of her. She had a steady boyfriend and her reputation as a PI was starting to grow. But then her father spoke to her about a friend of his whose brother had died in prison. The man had been accused of killing a mysterious girl. Looking into the matter, Tess learned that the girl was actually an escapee from an institution called The Sugar House which treated anorexics. As Tess begins to dig into the Sugar house and a particular bar that the girl frequented, she takes note of all the troubling connections that might exist between her father and the Baltimore underworld. It isn’t until her parents’ house is set alight that Tess realizes just how dangerous the case has become. Someone wants her to stop digging and they will take any steps necessary to achieve that goal. The Last Place: Tess was in trouble. Her assault against a potential child molester had put her on the wrong side of the law. So when a wealthy individual asked her to look into a series of unsolved homicides, she was more than happy to accept the distraction. Luisa O’Neal only hired Tess to look at police documents so that she could spot and highlight any mistakes the police had made. But what should have been a straightforward case leads Tess into unfamiliar territory where a zealous police officer and a clever killer are playing a dangerous game. Another great read is the “Lexie Starr Mystery” Series by Jeanne Glidewell. Lexie Starr is a widowed library assistant in her forties who hopes to operate her own B&B in Kansas. When she isn’t worrying about her children or keeping her establishment afloat, the amateur sleuth can be found solving mysteries and crimes. Be sure to check out the “Hunt Country Suspense” Series by Jan Neuharth as well. Doug Cummings is an attractive lawyer and horse enthusiast from Middleburg, Virginia who can’t seem to steer clear of murders and mysteries. What Is The Next Book in The Tess Monaghan Series? There doesn't seem to be an upcoming book in The Tess Monaghan Series. The newest book is Hush Hush and was released on February, 1st 2015. Home » Series » Tess Monaghan
{"pred_label": "__label__wiki", "pred_label_prob": 0.5777731537818909, "wiki_prob": 0.5777731537818909, "source": "cc/2023-06/en_middle_0104.json.gz/line224292"}
Yoshiyuki Abe Historic Overview Yoshiyuki Abe Name Yoshiyuki ABE Date of birth 15-Aug-1969 - Osaka (Gifu) Yoshiyuki Abe (阿部良之, Abe Yoshiyuki, born August 15, 1969 in Osaka Prefecture) is a Japanese racing cyclist, who last rode for Japanese amateur team Abenova. He turned professional with Shimano Racing, the team operated by Shimano, after graduating from Osaka Institute of Technology, but soon transferred to Italian teams. He won the Japan Cup in 1997 and is still the only Japanese to win that important race. He became Japanese national champion in the road race in 1997 and 2000, and in the individual time trial in 1999 and 2000. Abe represented Japan in the 2000 Summer Olympics and won a bronze medal in the 2006 Asian Games in the team time trial. Tour de Pologne - stages 1996 (1) Yoshiyuki Abe - Scores by Season 3. 1996 Panaria - Vinavil 58 493 Wyścig Dookoła Polski / Tour of Poland 4. 1997 Mapei - GB 69 485 Tirreno - Adriatico 16/10 Giro del Piemonte 32 26/10 Japan Cup 1 31/10 Japan Cup 19 6. 2001 Team Colpack - Astro 0 1853 7. 2003 Shimano Racing Team 30 873 8. 2004 Shimano Racing 0 2161 Tour de Langkawi 9. 2005 Shimano - Memory Corp 0 2357 10. 2006 Skil - Shimano 3 1962 13. 2011 Matrix Powertag 0 3670
{"pred_label": "__label__wiki", "pred_label_prob": 0.8742184638977051, "wiki_prob": 0.8742184638977051, "source": "cc/2023-06/en_middle_0104.json.gz/line100476"}
Speculation around Death Stranding 2 soars after the latest photos published by Hideo Kojima Although Death Stranding is available on PC, it was born as a game on PlayStation. Hideo Kojima could repeat the same strategy and after the latest photos seen on his social network, the alarms about Death Stranding 2 sound again. We will see Death Stranding 2 sometime? Kojima Productions launched the game for PS4 exclusively and now the new photos of Hideo Kojima in SIE they are speculation fodder for fans. It is true that after reaching the console of the last generation of Sony, the company released its Death Stranding Director’s Cut for PS5 two years later; and now that? well what Kojima has met with Eric Lempel and Craig Malanka of Sony Interactive Entertainmentsince both are part as vice presidents of global marketing in the company. Death Stranding: Director’s Cut – PC Launch Trailer It may be that it is a visit with little other purpose than to meet, but that there is a figure of the game with the Kojima Productions flag right in the middle it burns the answers. Although the latest news and developments in the game were its possible arrival on PC Game Pass and the anticipated surprises of the service, something that became official shortly after. From this agreement we were able to get several things clear, one of them being that PlayStation had nothing to do with it. And that’s great, but what about the possible sequel to the game? Death Stranding 2, or something unrelated playing cluelessness? With Eric and Craig of SIE. pic.twitter.com/GAJhBjnhxF — HIDEO_KOJIMA (@HIDEO_KOJIMA_EN) October 12, 2022 The sequel to the game with Norman Reedus (Daryl Dixon in The Walking Dead) is already more than confirmed unofficially, but they have to see it confirmed by Kojima. In May of this year, Norman Reedus confirmed that he was recording Death Stranding 2, something to which Kojima himself responded by showing that he was not happy at all. What’s funnier about this thing is that the Death Stranding sequel may have been a Stadia exclusivebut Google canceled it. The same company that is going to close its video game service in the cloud with controversy because the developers did not know it. And to top it off, a user will lose 6,000 hours of gameplay in Red Dead Redemption 2. The best hard drives you can buy for your PS5 If you need to expand the capacity of your PS5, these hard drives are cheap and also allow you to install dozens of games on them. While Death Stranding can be purchased on PS4, PS5 and PC (Epic Games and Steam), the community remains divided on the game with the balance between mastery and bewilderment. If we add to that that the new Hideo Kojima might not be Death Stranding 2… but a horror game… turn off and let’s go. Although their first details were leaked, nothing is known about any of them. do you think that Speculation surrounding Death Stranding 2 is unfounded by the latest photos posted by Hideo Kojima Or do you think we will see it announced in 2022? death, Hideo, Kojima, latest, photos, Published, soars, speculation, Stranding
{"pred_label": "__label__wiki", "pred_label_prob": 0.8085544109344482, "wiki_prob": 0.8085544109344482, "source": "cc/2023-06/en_middle_0104.json.gz/line142655"}
Check out the Jumbo-Visma squad that will challenge Team Ineos at the Critérium du Dauphiné 2020 This is shaping up to be the rivalry of 2020 By Alex Ballinger After taking the fight to Team Ineos in France last week, Jumbo-Visma will be hoping to repeat the success at the Critérium du Dauphiné 2020. The Dutch WorldTour squad will be taking another talent-stacked squad to the race, as they look to refine their tactics ahead of the Tour de France later this month. Jumbo-Visma bested Egan Bernal and Team Ineos at the Tour de l’Ain in France last week, with Primož Roglič taking two stages and the overall ahead of the Colombian star. But can they repeat the victory in the Dauphiné, often regarded as a key warm-up race for the Tour. Roglič will once again be racing in the shortened five-stage Dauphiné and will get support from Grand Tour stars Tom Dumoulin and Steven Kruijswijk. Dumoulin has battled through injury and illness over the last two seasons, but will be back in action for his new team Jumbo in France. Wout van Aert will also be joining the Grand Tour leaders in the Dauphiné, fresh from his back-to-back victories in Strade Bianche and Milan-San Remo. The Belgian road and cyclocross star will no doubt be fighting for stage honours while also putting in a turn for his leaders both in the Dauphiné and the Tour de France. Completing the squad will be road captain Tony Martin, Robert Gesink and American climber Sepp Kuss. The Jumbo-Visma squad for the Dauphiné is very similar to the Tour de l’Ain squad, where George Bennett filled in for Kuss, as the team are no doubt looking to firm up their roster for the Tour de France. >>> How to live stream the Critérium du Dauphiné 2020 – where to watch the major French stage race Jumbo’s leadership trident will be looking to take on the Team Ineos trio of Egan Bernal, Geraint Thomas and Chris Froome, who will all be racing for the last time before the Tour. Jumbo-Visma squad for the Critérium du Dauphiné 2020 Primož Roglič (Slo) Tom Dumoulin (Ned) Steven Kruijswijk (Ned) Wout van Aert (Bel) Tony Martin (Ger) Sepp Kuss (USA) Robert Gesink (Ned) Alex Ballinger Alex Ballinger is editor of BikeBiz magazine, the leading publication for the UK cycle industry, and is the former digital news editor for CyclingWeekly.com. After gaining experience in local newsrooms, national newspapers and in digital journalism, Alex found his calling in cycling, first as a reporter, then as news editor responsible for Cycling Weekly's online news output, and now as the editor of BikeBiz. Since pro cycling first captured his heart during the 2010 Tour de France (specifically the Contador-Schleck battle) Alex covered three Tours de France, multiple editions of the Tour of Britain, and the World Championships, while both writing and video presenting for Cycling Weekly. He also specialises in fitness writing, often throwing himself into the deep end to help readers improve their own power numbers. Away from the desk, Alex can be found racing time trials, riding BMX and mountain bikes, or exploring off-road on his gravel bike. He’s also an avid gamer, and can usually be found buried in an eclectic selection of books. Power vs aerodynamics: what is the best balance and how can I achieve it? Watts and aerodynamics are two cornerstones of our cycling performance - but favoring only one will see you going slower than a more balanced approach. Here’s our guide to better optimising your speed By Andy Turner • Published 6 February 23 Even Wout van Aert can lose his nerve: Five things we learned from the CX World Championships Even with the absence of Tom Pidcock on the world stage, British cyclo-cross is in a good place The Politest Man in Cycling - five days chasing victory with new sensation Thomas Gloag Britain's latest cycling prodigy is as cheery and humble as they come By Chris Marshall-Bell • Published 6 February 23 Jumbo-Visma DS: There are some big talents coming out of Britain The WorldTour team sees great potential in the current crop of British riders By Tom Davidson • Published 20 January 23 From Grand Tour victories to gold medals: The nine best signings of 2022 We look back at the signings that made the biggest impacts during this year's season By Tom Thewlis • Published 28 December 22 'I remember the crowds more than anything': Tom Pidcock recalls his Alpe d'Huez Tour de France stage win Our male rider of the year, Tom Pidcock, talks us through the highs and lows of his 2022 campaign Watch: Jumbo-Visma 2023 team launch Stream the Dutch super team's presentation By Adam Becket • Published 22 December 22 Wout van Aert moots building gravel world championships into 2023 programme Belgian rider says gravel racing has a ‘great future’ as he considers worlds participation next year By Tom Thewlis • Published 24 November 22 As Cristiano Ronaldo puts the boot in, Jumbo-Visma talk to Manchester United about tactics and managing egos The Dutch team’s senior sports director has spoken to Manchester United’s manager for sporting advice By Owen Rogers • Last updated 14 November 22 Primož Roglič says rehabilitation from shoulder surgery ‘going as planned’ ahead of 2023 season Slovenian had surgery in October in attempt to fix repeated shoulder dislocations ahead of new season
{"pred_label": "__label__wiki", "pred_label_prob": 0.9901342988014221, "wiki_prob": 0.9901342988014221, "source": "cc/2023-06/en_middle_0104.json.gz/line226624"}
var videoState={ create: function(){ var video; var sprite; video = game.add.video('storyvideo'); video.play(false); sprite = video.addToWorld(game.world.centerX, game.world.centerY, 0.5, 0.5, 2, 2); //pause var picLabel= game.add.image(game.width/2, game.height-30, 'skip'); picLabel.anchor.setTo(-1,1); picLabel.inputEnabled = true; picLabel.events.onInputDown.add(this.start, this); //skip video // var picLabel= game.add.image(game.width/2, game.height-30, 'skip'); // picLabel.anchor.setTo(-2,1); // picLabel.inputEnabled = true; // picLabel.events.onInputDown.add(this.startgame, this); // game.time.events.add(Phaser.Timer.SECOND * 10, this.fadeState, this); // game.stage.backgroundColor= '#ffffff'; game.physics.startSystem(Phaser.Physics. ARCADE); game.renderer.renderSession.roundPixels=true; }, // fadeState: function(){ // game.state.start('play'); // }, start: function(){ game.paused = (game.paused) ? false : true; game.state.start('play'); }, // startgame: function(){ // game.state.start('play'); // }, };
{'content_hash': '1c932c7359417cc3e05f3380eabb7fac', 'timestamp': '', 'source': 'github', 'line_count': 51, 'max_line_length': 89, 'avg_line_length': 25.41176470588235, 'alnum_prop': 0.5601851851851852, 'repo_name': 'nickchulani99/ITE-445', 'id': 'd9d5cb9bb5e54f95b73df6a87d4bcecebdc40318', 'size': '1296', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': 'final/alien copy 4/js/video.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '16832'}, {'name': 'JavaScript', 'bytes': '451272'}]}
package mts //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. // // Code generated by Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" ) // SearchMedia invokes the mts.SearchMedia API synchronously func (client *Client) SearchMedia(request *SearchMediaRequest) (response *SearchMediaResponse, err error) { response = CreateSearchMediaResponse() err = client.DoAction(request, response) return } // SearchMediaWithChan invokes the mts.SearchMedia API asynchronously func (client *Client) SearchMediaWithChan(request *SearchMediaRequest) (<-chan *SearchMediaResponse, <-chan error) { responseChan := make(chan *SearchMediaResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.SearchMedia(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // SearchMediaWithCallback invokes the mts.SearchMedia API asynchronously func (client *Client) SearchMediaWithCallback(request *SearchMediaRequest, callback func(response *SearchMediaResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *SearchMediaResponse var err error defer close(result) response, err = client.SearchMedia(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // SearchMediaRequest is the request struct for api SearchMedia type SearchMediaRequest struct { *requests.RpcRequest ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"` Description string `position:"Query" name:"Description"` Title string `position:"Query" name:"Title"` PageNumber requests.Integer `position:"Query" name:"PageNumber"` CateId string `position:"Query" name:"CateId"` PageSize requests.Integer `position:"Query" name:"PageSize"` From string `position:"Query" name:"From"` Tag string `position:"Query" name:"Tag"` KeyWord string `position:"Query" name:"KeyWord"` ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"` OwnerAccount string `position:"Query" name:"OwnerAccount"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` SortBy string `position:"Query" name:"SortBy"` To string `position:"Query" name:"To"` } // SearchMediaResponse is the response struct for api SearchMedia type SearchMediaResponse struct { *responses.BaseResponse TotalNum int64 `json:"TotalNum" xml:"TotalNum"` PageSize int64 `json:"PageSize" xml:"PageSize"` RequestId string `json:"RequestId" xml:"RequestId"` PageNumber int64 `json:"PageNumber" xml:"PageNumber"` MediaList MediaListInSearchMedia `json:"MediaList" xml:"MediaList"` } // CreateSearchMediaRequest creates a request to invoke SearchMedia API func CreateSearchMediaRequest() (request *SearchMediaRequest) { request = &SearchMediaRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("Mts", "2014-06-18", "SearchMedia", "mts", "openAPI") request.Method = requests.POST return } // CreateSearchMediaResponse creates a response to parse from SearchMedia response func CreateSearchMediaResponse() (response *SearchMediaResponse) { response = &SearchMediaResponse{ BaseResponse: &responses.BaseResponse{}, } return }
{'content_hash': '4765aae0af2406ea691fb001ea5a83df', 'timestamp': '', 'source': 'github', 'line_count': 116, 'max_line_length': 144, 'avg_line_length': 38.23275862068966, 'alnum_prop': 0.7019165727170237, 'repo_name': 'aliyun/alibaba-cloud-sdk-go', 'id': 'e23386a31fa5de227e10f19984b8f3e7eb736f22', 'size': '4435', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'services/mts/search_media.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Go', 'bytes': '734307'}, {'name': 'Makefile', 'bytes': '183'}]}
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Invitation to calendar</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> </head> <body> <h2>You was invited to calendar.</h2> <p>You can login and set password procceed by link:</p> <a href="<?php echo $link?>"><?php echo $link?></a> </body> </html>
{'content_hash': '324efbc1ad28fdfe902cd1e51f7e095e', 'timestamp': '', 'source': 'github', 'line_count': 15, 'max_line_length': 76, 'avg_line_length': 23.733333333333334, 'alnum_prop': 0.6432584269662921, 'repo_name': 'vchukhalyonock/calendar', 'id': '5ca5e852381e8a65c1d2612696445e148aa8677b', 'size': '356', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'application/views/email/invite.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '366'}, {'name': 'CSS', 'bytes': '39144'}, {'name': 'HTML', 'bytes': '5502'}, {'name': 'JavaScript', 'bytes': '460150'}, {'name': 'PHP', 'bytes': '1807984'}]}
import os from flask import Flask,render_template,url_for,request,session,redirect from flask_login import LoginManager from flask_bootstrap import Bootstrap from flask_script import Manager,Shell from flask_sqlalchemy import SQLAlchemy from flask_mail import Mail from flask_moment import Moment from flask_socketio import SocketIO from flask_gravatar import Gravatar app = Flask(__name__) basedir = os.path.abspath(os.path.dirname(__file__)) app.config['SQLALCHEMY_DATABASE_URI'] =\ 'sqlite:///' + os.path.join(basedir, 'data.sqlite') #app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://sql6140009:[email protected]/sql6140009' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SECRET_KEY'] = 'hard to guess string' app.config['MAIL_SERVER'] = 'smtp.googlemail.com' app.config['MAIL_PORT'] = 587 app.config['MAIL_USE_TLS'] = True app.config['MAIL_USERNAME'] = os.environ.get('MAIL_USERNAME') app.config['MAIL_PASSWORD'] = os.environ.get('MAIL_PASSWORD') manager = Manager(app) bootstrap = Bootstrap() db = SQLAlchemy(app) mail = Mail(app) moment = Moment(app) socketio = SocketIO(app) gravatar = Gravatar(app) login_manager = LoginManager() login_manager.session_protection = 'strong' login_manager.login_view = 'auth.login' # app.config['SECRET_KEY'] = 'hard to guess string' # app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True #app = create_app('DEVELOPMENT') bootstrap.init_app(app) #db.init_app(app) login_manager.init_app(app) from app import models @app.route('/') def index(): return render_template('index.html') from app.auth.views import admin app.register_blueprint(auth.views.admin,url_prefix = '/authentication') from app.main.views import welcome app.register_blueprint(main.views.welcome,url_prefix = '/welcome') from app.twitterAPI.views import api app.register_blueprint(twitterAPI.views.api,url_prefix = '/api')
{'content_hash': 'a9735eefc6ff4807441825a5f2811599', 'timestamp': '', 'source': 'github', 'line_count': 58, 'max_line_length': 117, 'avg_line_length': 32.62068965517241, 'alnum_prop': 0.7563424947145877, 'repo_name': 'sumedh123/debatify', 'id': '89d78b1a48e585a5353b33fa5344659ba9f8770a', 'size': '1892', 'binary': False, 'copies': '1', 'ref': 'refs/heads/UI', 'path': 'app/__init__.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '5939'}, {'name': 'CSS', 'bytes': '347155'}, {'name': 'HTML', 'bytes': '102503'}, {'name': 'JavaScript', 'bytes': '608373'}, {'name': 'Python', 'bytes': '8393673'}, {'name': 'Shell', 'bytes': '3298'}]}
/* * String hash computation (interning). */ #include "duk_internal.h" /* constants for duk_hashstring() */ #define STRING_HASH_SHORTSTRING 4096 #define STRING_HASH_MEDIUMSTRING (256 * 1024) #define STRING_HASH_BLOCKSIZE 256 duk_uint32_t duk_heap_hashstring(duk_heap *heap, duk_uint8_t *str, duk_size_t len) { /* * Sampling long strings by byte skipping (like Lua does) is potentially * a cache problem. Here we do 'block skipping' instead for long strings: * hash an initial part, and then sample the rest of the string with * reasonably sized chunks. * * Skip should depend on length and bound the total time to roughly * logarithmic. * * With current values: * * 1M string => 256 * 241 = 61696 bytes (0.06M) of hashing * 1G string => 256 * 16321 = 4178176 bytes (3.98M) of hashing * * After an initial part has been hashed, an offset is applied before * starting the sampling. The initial offset is computed from the * hash of the initial part of the string. The idea is to avoid the * case that all long strings have certain offset ranges that are never * sampled. */ /* note: mixing len into seed improves hashing when skipping */ duk_uint32_t str_seed = heap->hash_seed ^ len; if (len <= STRING_HASH_SHORTSTRING) { return duk_util_hashbytes(str, len, str_seed); } else { duk_uint32_t hash; duk_size_t off; duk_size_t skip; if (len <= STRING_HASH_MEDIUMSTRING) { skip = (duk_size_t) (16 * STRING_HASH_BLOCKSIZE + STRING_HASH_BLOCKSIZE); } else { skip = (duk_size_t) (256 * STRING_HASH_BLOCKSIZE + STRING_HASH_BLOCKSIZE); } hash = duk_util_hashbytes(str, (duk_size_t) STRING_HASH_SHORTSTRING, str_seed); off = STRING_HASH_SHORTSTRING + (skip * (hash % 256)) / 256; /* FIXME: inefficient loop */ while (off < len) { duk_size_t left = len - off; duk_size_t now = (duk_size_t) (left > STRING_HASH_BLOCKSIZE ? STRING_HASH_BLOCKSIZE : left); hash ^= duk_util_hashbytes(str + off, now, str_seed); off += skip; } return hash; } }
{'content_hash': 'bab3317c67f40063ff7a69f3bcc74bb0', 'timestamp': '', 'source': 'github', 'line_count': 64, 'max_line_length': 95, 'avg_line_length': 32.140625, 'alnum_prop': 0.6684491978609626, 'repo_name': 'JoshEngebretson/duktape', 'id': '29411796cbb56b7d91920771a24db254493ccfc8', 'size': '2057', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/duk_heap_hashstring.c', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '1972812'}, {'name': 'C++', 'bytes': '20922'}, {'name': 'CoffeeScript', 'bytes': '895'}, {'name': 'JavaScript', 'bytes': '15926045'}, {'name': 'Objective-C', 'bytes': '6054'}, {'name': 'Python', 'bytes': '136104'}, {'name': 'Shell', 'bytes': '12610'}]}
--TEST-- Runkit_Sandbox_Parent Class -- Echo --SKIPIF-- <?php if(!extension_loaded("runkit") || !RUNKIT_FEATURE_SANDBOX) print "skip"; /* May not be available due to lack of TSRM interpreter support */ if(!function_exists("runkit_sandbox_output_handler")) print "skip"; ?> --FILE-- <?php $php = new Runkit_Sandbox(); $php['output_handler'] = 'test_handler'; $php['parent_access'] = true; $php->ini_set('display_errors', true); $php->ini_set('html_errors', false); $php->eval('$PARENT = new Runkit_Sandbox_Parent; echo "Foo\n"; $PARENT->echo("BarBar\n");'); function test_handler($str) { if (strlen($str) == 0) return NULL; /* flush() */ /* Echoing and returning have the same effect here, both go to parent's output chain */ echo 'Received string from sandbox: ' . strlen($str) . " bytes long.\n"; return strtoupper($str); } --EXPECT-- Received string from sandbox: 4 bytes long. FOO Received string from sandbox: 149 bytes long. WARNING: RUNKIT_SANDBOX_PARENT::ECHO(): ACCESS TO ECHO DATA IN THE PARENT CONTEXT IS NOT ENABLED IN UNKNOWN(0) : RUNKIT_SANDBOX EVAL CODE ON LINE 3
{'content_hash': '009fcdd5cf234bb851939760b7bb2bec', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 147, 'avg_line_length': 36.93333333333333, 'alnum_prop': 0.6796028880866426, 'repo_name': 'lzpfmh/runkit', 'id': '44237969acec682b89517ba99d074aa575d5c09a', 'size': '1108', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'tests/Runkit_Sandbox_Parent__.echo.access.phpt', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '263129'}, {'name': 'C++', 'bytes': '372'}, {'name': 'PHP', 'bytes': '141611'}, {'name': 'SourcePawn', 'bytes': '193'}]}
package org.codehaus.groovy.grails.scaffolding; import grails.build.logging.GrailsConsole; import groovy.text.SimpleTemplateEngine; import groovy.text.Template; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.Writer; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.codehaus.groovy.grails.commons.GrailsApplication; import org.codehaus.groovy.grails.commons.GrailsDomainClass; import org.codehaus.groovy.grails.commons.GrailsDomainClassProperty; import org.codehaus.groovy.grails.plugins.GrailsPluginInfo; import org.codehaus.groovy.grails.plugins.GrailsPluginManager; import org.codehaus.groovy.grails.plugins.GrailsPluginUtils; import org.codehaus.groovy.grails.plugins.PluginManagerAware; import org.codehaus.groovy.runtime.IOGroovyMethods; import org.codehaus.groovy.runtime.StringGroovyMethods; import org.springframework.context.ResourceLoaderAware; import org.springframework.core.io.AbstractResource; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.util.Assert; import org.springframework.util.StringUtils; public abstract class AbstractGrailsTemplateGenerator implements GrailsTemplateGenerator, ResourceLoaderAware, PluginManagerAware { protected static final Log log = LogFactory.getLog(AbstractGrailsTemplateGenerator.class); protected String basedir = "."; protected boolean overwrite = false; protected SimpleTemplateEngine engine = new SimpleTemplateEngine(); protected ResourceLoader resourceLoader; protected Template renderEditorTemplate; protected String domainSuffix = ""; protected GrailsPluginManager pluginManager; protected GrailsApplication grailsApplication; protected AbstractGrailsTemplateGenerator(ClassLoader classLoader) { engine = new SimpleTemplateEngine(classLoader); } public void generateViews(GrailsDomainClass domainClass, String destDir) throws IOException { Assert.hasText(destDir, "Argument [destdir] not specified"); File viewsDir = new File(destDir, "grails-app/views/" + domainClass.getPropertyName()); if (!viewsDir.exists()) { viewsDir.mkdirs(); } for (String name : getTemplateNames()) { if(log.isInfoEnabled()) log.info("Generating ["+name+"] view for domain class ["+domainClass.getFullName()+"]"); generateView(domainClass, name, viewsDir.getAbsolutePath()); } } public void generateController(GrailsDomainClass domainClass, String destDir) throws IOException { Assert.hasText(destDir, "Argument [destdir] not specified"); if (domainClass == null) { return; } String fullName = domainClass.getFullName(); String pkg = ""; int pos = fullName.lastIndexOf('.'); if (pos != -1) { // Package name with trailing '.' pkg = fullName.substring(0, pos + 1); } File destFile = new File(destDir, "grails-app/controllers/" + pkg.replace('.', '/') + domainClass.getShortName() + "Controller.groovy"); if (canWrite(destFile)) { destFile.getParentFile().mkdirs(); BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(destFile)); generateController(domainClass, writer); try { writer.flush(); } catch (IOException ignored) {} } finally { IOGroovyMethods.closeQuietly(writer); } log.info("Controller generated at ["+destFile+"]"); } } @Override public void generateAsyncController(GrailsDomainClass domainClass, String destDir) throws IOException { Assert.hasText(destDir, "Argument [destdir] not specified"); if (domainClass == null) { return; } String fullName = domainClass.getFullName(); String pkg = ""; int pos = fullName.lastIndexOf('.'); if (pos != -1) { // Package name with trailing '.' pkg = fullName.substring(0, pos + 1); } File destFile = new File(destDir, "grails-app/controllers/" + pkg.replace('.', '/') + domainClass.getShortName() + "Controller.groovy"); if (canWrite(destFile)) { destFile.getParentFile().mkdirs(); BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(destFile)); generateAsyncController(domainClass, writer); try { writer.flush(); } catch (IOException ignored) {} } finally { IOGroovyMethods.closeQuietly(writer); } log.info("Controller generated at ["+destFile+"]"); } } public void generateView(GrailsDomainClass domainClass, String viewName, Writer out) throws IOException { String templateText = getTemplateText(viewName + ".gsp"); if (!StringUtils.hasLength(templateText)) { return; } GrailsDomainClassProperty multiPart = null; for (GrailsDomainClassProperty property : domainClass.getProperties()) { if (property.getType() == Byte[].class || property.getType() == byte[].class) { multiPart = property; break; } } String packageName = StringUtils.hasLength(domainClass.getPackageName()) ? "<%@ page import=\"" + domainClass.getFullName() + "\" %>" : ""; Map<String, Object> binding = createBinding(domainClass); binding.put("packageName", packageName); binding.put("multiPart", multiPart); binding.put("propertyName", getPropertyName(domainClass)); generate(templateText, binding, out); } protected abstract Object getRenderEditor(); public void generateView(GrailsDomainClass domainClass, String viewName, String destDir) throws IOException { File destFile = new File(destDir, viewName + ".gsp"); if (!canWrite(destFile)) { return; } BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(destFile)); generateView(domainClass, viewName, writer); try { writer.flush(); } catch (IOException ignored) {} } finally { IOGroovyMethods.closeQuietly(writer); } } public void generateController(GrailsDomainClass domainClass, Writer out) throws IOException { String templateText = getTemplateText("Controller.groovy"); Map<String, Object> binding = createBinding(domainClass); binding.put("packageName", domainClass.getPackageName()); binding.put("propertyName", getPropertyName(domainClass)); generate(templateText, binding, out); } public void generateAsyncController(GrailsDomainClass domainClass, Writer out) throws IOException { String templateText = getTemplateText("AsyncController.groovy"); Map<String, Object> binding = createBinding(domainClass); binding.put("packageName", domainClass.getPackageName()); binding.put("propertyName", getPropertyName(domainClass)); generate(templateText, binding, out); } @Override public void generateAsyncTest(GrailsDomainClass domainClass, String destDir) throws IOException { generateTest(domainClass, destDir, "AsyncSpec.groovy"); } public void generateTest(GrailsDomainClass domainClass, String destDir) throws IOException { generateTest(domainClass, destDir, "Spec.groovy"); } private void generateTest(GrailsDomainClass domainClass, String destDir, String templateName) throws IOException { File destFile = new File(destDir, domainClass.getPackageName().replace('.', '/') + '/' + domainClass.getShortName() + "ControllerSpec.groovy"); if (!canWrite(destFile)) { return; } String templateText = getTemplateText(templateName); Map<String, Object> binding = createBinding(domainClass); binding.put("packageName", domainClass.getPackageName()); binding.put("propertyName", domainClass.getLogicalPropertyName()); binding.put("modelName", getPropertyName(domainClass)); destFile.getParentFile().mkdirs(); BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(destFile)); generate(templateText, binding, writer); try { writer.flush(); } catch (IOException ignored) {} } finally { IOGroovyMethods.closeQuietly(writer); } } @SuppressWarnings("deprecation") protected Map<String, Object> createBinding(GrailsDomainClass domainClass) { boolean hasHibernate = pluginManager.hasGrailsPlugin("hibernate") || pluginManager.hasGrailsPlugin("hibernate4"); Map<String, Object> binding = new HashMap<String, Object>(); binding.put("pluginManager", pluginManager); binding.put("domainClass", domainClass); binding.put("className", domainClass.getShortName()); binding.put("renderEditor", getRenderEditor()); binding.put("comparator", hasHibernate ? DomainClassPropertyComparator.class : SimpleDomainClassPropertyComparator.class); return binding; } protected void generate(String templateText, Map<String, Object> binding, Writer out) { try { engine.createTemplate(templateText).make(binding).writeTo(out); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } catch (IOException e) { throw new RuntimeException(e); } } protected String getPropertyName(GrailsDomainClass domainClass) { return domainClass.getPropertyName() + domainSuffix; } protected String getTemplateText(String template) throws IOException { InputStream inputStream = null; if (resourceLoader != null && grailsApplication.isWarDeployed()) { inputStream = resourceLoader.getResource("/WEB-INF/templates/scaffolding/" + template).getInputStream(); } else { AbstractResource templateFile = getTemplateResource(template); if (templateFile.exists()) { inputStream = templateFile.getInputStream(); } } return inputStream == null ? null : IOGroovyMethods.getText(inputStream); } protected AbstractResource getTemplateResource(String template) throws IOException { String name = "src/templates/scaffolding/" + template; AbstractResource templateFile = new FileSystemResource(new File(basedir, name).getAbsoluteFile()); if (!templateFile.exists()) { templateFile = new FileSystemResource(new File(getPluginDir(), name).getAbsoluteFile()); } return templateFile; } protected File getPluginDir() throws IOException { GrailsPluginInfo info = GrailsPluginUtils.getPluginBuildSettings().getPluginInfoForName("scaffolding"); return info.getDescriptor().getFile().getParentFile(); } protected boolean canWrite(File testFile) { if (overwrite || !testFile.exists()) { return true; } try { String relative = makeRelativeIfPossible(testFile.getAbsolutePath(), basedir); String response = GrailsConsole.getInstance().userInput( "File " + relative + " already exists. Overwrite?", new String[] { "y", "n", "a" }); overwrite = overwrite || "a".equals(response); return overwrite || "y".equals(response); } catch (Exception e) { // failure to read from standard in means we're probably running from an automation tool like a build server return true; } } protected String makeRelativeIfPossible(String fileName, String base) throws IOException { if (StringUtils.hasLength(base)) { fileName = StringGroovyMethods.minus(fileName, new File(base).getCanonicalPath()); } return fileName; } protected Set<String> getTemplateNames() throws IOException { if (resourceLoader != null && grailsApplication.isWarDeployed()) { try { PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(resourceLoader); return extractNames(resolver.getResources("/WEB-INF/templates/scaffolding/*.gsp")); } catch (Exception e) { return Collections.emptySet(); } } PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); Set<String> resources = new HashSet<String>(); String templatesDirPath = basedir + "/src/templates/scaffolding"; Resource templatesDir = new FileSystemResource(templatesDirPath); if (templatesDir.exists()) { try { resources.addAll(extractNames(resolver.getResources("file:" + templatesDirPath + "/*.gsp"))); } catch (Exception e) { log.error("Error while loading views from " + basedir, e); } } File pluginDir = getPluginDir(); try { resources.addAll(extractNames(resolver.getResources("file:" + pluginDir + "/src/templates/scaffolding/*.gsp"))); } catch (Exception e) { // ignore log.error("Error locating templates from " + pluginDir + ": " + e.getMessage(), e); } return resources; } protected Set<String> extractNames(Resource[] resources) { Set<String> names = new HashSet<String>(); for (Resource resource : resources) { String name = resource.getFilename(); names.add(name.substring(0, name.length() - 4)); } return names; } public void setGrailsApplication(GrailsApplication ga) { grailsApplication = ga; Object suffix = ga.getFlatConfig().get("grails.scaffolding.templates.domainSuffix"); if (suffix instanceof CharSequence) { domainSuffix = suffix.toString(); } } public void setResourceLoader(ResourceLoader rl) { if(log.isInfoEnabled()) log.info("Scaffolding template generator set to use resource loader ["+rl+"]"); resourceLoader = rl; } public void setPluginManager(GrailsPluginManager gpm) { pluginManager = gpm; } public void setOverwrite(boolean shouldOverwrite) { overwrite = shouldOverwrite; } }
{'content_hash': '8970b7709bd54fcfed5f3a9952916ba2', 'timestamp': '', 'source': 'github', 'line_count': 401, 'max_line_length': 151, 'avg_line_length': 34.53366583541147, 'alnum_prop': 0.7154823801270942, 'repo_name': 'eptresmo/dbMigrationTest', 'id': 'e723c197e0218138ec76d778e67165fef6866c91', 'size': '14445', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'dbMigrationTest/target/work/plugins/scaffolding-2.0.1/src/java/org/codehaus/groovy/grails/scaffolding/AbstractGrailsTemplateGenerator.java', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
// -------------------------------------------------------------------------------------------- // <copyright file="EffortProviderFactory.cs" company="Effort Team"> // Copyright (C) 2011-2014 Effort Team // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // </copyright> // -------------------------------------------------------------------------------------------- namespace Effort.Provider { using System; using System.Data; using System.Data.Common; #if !EFOLD using System.Data.Entity.Core.Common; #endif /// <summary> /// Represents a set of methods for creating instances of the /// <see cref="N:Effort.Provider"/> provider's implementation of the data source classes. /// </summary> public class EffortProviderFactory : DbProviderFactory, IServiceProvider { /// <summary> /// Provides a singleton instance of the <see cref="EffortProviderFactory"/> class. /// </summary> public static readonly EffortProviderFactory Instance = new EffortProviderFactory(); /// <summary> /// Prevents a default instance of the <see cref="EffortProviderFactory" /> class /// from being created. /// </summary> private EffortProviderFactory() { } /// <summary> /// Returns a new instance of the <see cref="T:EffortConnection" /> class. /// </summary> /// <returns> /// A new instance of <see cref="T:EffortConnection" />. /// </returns> public override DbConnection CreateConnection() { return new EffortConnection(); } /// <summary> /// Gets the service object of the specified type. /// </summary> /// <param name="serviceType"> /// An object that specifies the type of service object to get. /// </param> /// <returns> /// A service object of type <paramref name="serviceType" />.-or- null if there is /// no service object of type <paramref name="serviceType" />. /// </returns> public object GetService(Type serviceType) { if (serviceType == typeof(DbProviderServices)) { return EffortProviderServices.Instance; } return null; } } }
{'content_hash': '767841cdd80110458b083c02f09c4e70', 'timestamp': '', 'source': 'github', 'line_count': 84, 'max_line_length': 96, 'avg_line_length': 42.023809523809526, 'alnum_prop': 0.5781869688385269, 'repo_name': 'wertzui/effort', 'id': '62bcbbc5cb1dad86155bd8a97196855269b6d236', 'size': '3532', 'binary': False, 'copies': '3', 'ref': 'refs/heads/develop', 'path': 'Main/Source/Effort/Provider/EffortProviderFactory.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '1104'}, {'name': 'C#', 'bytes': '2446943'}]}
import { VGrid } from '../v-grid'; import { BindingContextInterface, OverrideContextInterface } from '../../interfaces'; export declare class VGridAttributesImageFix { private vGrid; private element; private value; private bindingContext; private overrideContext; constructor(element: HTMLImageElement, vGrid: VGrid); valueChanged(newValue: string): void; bind(bindingContext: BindingContextInterface, overrideContext: OverrideContextInterface): void; }
{'content_hash': '288050943bddd389f02d6c1488f7c9da', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 99, 'avg_line_length': 40.5, 'alnum_prop': 0.7551440329218106, 'repo_name': 'vegarringdal/vGrid', 'id': '7a892151b3f517aeff4464ab7de2c01ac475f8d0', 'size': '486', 'binary': False, 'copies': '4', 'ref': 'refs/heads/dev-rebuild', 'path': 'dist/es2015/grid/attributes/v-image.d.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '24447'}, {'name': 'HTML', 'bytes': '19771'}, {'name': 'JavaScript', 'bytes': '7057'}, {'name': 'TypeScript', 'bytes': '1639454'}]}
layout: page title: Cliffs Tech Executive Retreat date: 2016-05-24 author: Beverly Snyder tags: weekly links, java status: published summary: Vivamus sed ligula quis mi cursus venenatis sed sed nunc. banner: images/banner/people.jpg booking: startDate: 05/29/2018 endDate: 05/31/2018 ctyhocn: HSTFLHX groupCode: CTER published: true --- Mauris id odio eget libero fermentum egestas vel vitae ligula. Suspendisse vestibulum ipsum sem, vel ornare ex lacinia ac. Etiam a sem auctor, dignissim tellus vitae, consequat arcu. Cras rutrum lorem metus, sed lacinia nunc sollicitudin non. Praesent quam mi, aliquet ut lorem at, dictum faucibus ante. Vivamus sit amet ligula vulputate, sollicitudin arcu at, ullamcorper elit. Aenean aliquet molestie tincidunt. Nulla sed lectus diam. Donec gravida enim ut lorem blandit, sed ultricies arcu auctor. Donec odio ante, fringilla id lacus vel, sagittis dignissim elit. Duis mattis turpis tellus, at pulvinar leo commodo at. Etiam in lectus odio. Curabitur ipsum nisi, tincidunt eu ligula ac, cursus pellentesque lacus. Quisque enim sem, tempor non convallis maximus, semper id nisl. Donec eu sapien vel sapien posuere semper. Cras nisi justo, rhoncus ac urna at, cursus scelerisque libero. 1 Proin bibendum tortor at ipsum commodo, vel gravida elit pretium 1 Phasellus tincidunt lorem vitae elit ultrices, id volutpat mi fermentum 1 Nunc interdum orci vel lobortis sodales. Praesent at risus ipsum. Morbi mattis blandit mauris, in fermentum nibh condimentum ut. In mattis risus et diam sagittis euismod. Sed vel dolor id dui dapibus viverra. Praesent efficitur ut quam et auctor. Sed venenatis convallis ex, nec vulputate est tincidunt vitae. In pulvinar faucibus odio, eu viverra tortor pharetra iaculis. Nunc cursus sagittis mauris, at blandit nisi auctor eget. Sed mollis diam eu volutpat pulvinar. In a luctus felis. Integer lobortis purus id lacus porta rutrum. Etiam sit amet lobortis magna. Nulla id libero convallis, luctus lorem ac, fermentum orci. Integer vel maximus sapien, non blandit sapien. Vivamus a tempus purus.
{'content_hash': '43f9f6179677a71fbbce864c5125cf6a', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 887, 'avg_line_length': 94.31818181818181, 'alnum_prop': 0.8043373493975904, 'repo_name': 'KlishGroup/prose-pogs', 'id': '6f3c04ea1edb8b269359b353872dd5964911f4eb', 'size': '2079', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': 'pogs/H/HSTFLHX/CTER/index.md', 'mode': '33188', 'license': 'mit', 'language': []}
namespace igl { // Subdivide a mesh without moving vertices: loop subdivision but odd // vertices stay put and even vertices are just edge midpoints // // Templates: // MatV matrix for vertex positions, e.g. MatrixXd // MatF matrix for vertex positions, e.g. MatrixXi // Inputs: // V #V by dim mesh vertices // F #F by 3 mesh triangles // Outputs: // NV new vertex positions, V is guaranteed to be at top // NF new list of face indices // // NOTE: V should not be the same as NV, // NOTE: F should not be the same as NF, use other proto // // Known issues: // - assumes (V,F) is edge-manifold. template < typename DerivedV, typename DerivedF, typename DerivedNV, typename DerivedNF> IGL_INLINE void upsample( const Eigen::PlainObjectBase<DerivedV>& V, const Eigen::PlainObjectBase<DerivedF>& F, Eigen::PlainObjectBase<DerivedNV>& NV, Eigen::PlainObjectBase<DerivedNF>& NF); // Virtually in place wrapper template < typename MatV, typename MatF> IGL_INLINE void upsample( MatV& V, MatF& F); } #ifndef IGL_STATIC_LIBRARY # include "upsample.cpp" #endif #endif
{'content_hash': 'a1cdb7cff1bb173dd9cbbff48005f1e2', 'timestamp': '', 'source': 'github', 'line_count': 44, 'max_line_length': 71, 'avg_line_length': 26.772727272727273, 'alnum_prop': 0.6612903225806451, 'repo_name': 'FabianRepository/SinusProject', 'id': '5ca05336dfac2db8a87a07b48ee4c4d7219d853e', 'size': '1710', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'Code/include/igl/upsample.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '1822674'}, {'name': 'C++', 'bytes': '11420706'}, {'name': 'CMake', 'bytes': '20858'}, {'name': 'Makefile', 'bytes': '4050'}, {'name': 'Objective-C', 'bytes': '11880'}, {'name': 'Shell', 'bytes': '15321'}]}
/*___Generated_by_IDEA___*/ package com.grafixartist.androidn; /* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ public final class BuildConfig { public final static boolean DEBUG = Boolean.parseBoolean(null); }
{'content_hash': '26542977f302c1033ce570a5d275b19c', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 101, 'avg_line_length': 33.375, 'alnum_prop': 0.7490636704119851, 'repo_name': 'Suleiman19/Android-N-Sample', 'id': '3f2817dcd993334f72e2c9570e2c1671e560df79', 'size': '267', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'gen/com/grafixartist/androidn/BuildConfig.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '10473'}]}
<?php namespace Molajo\Query\Builder; use CommonApi\Fieldhandler\FieldhandlerInterface; use DateTime; /** * Query Builder Sql Class * * External API - all other class methods are called by this class * DB-specific adapters extend this class * * Sql - BuildSql - BuildSqlElements - BuildSqlGroups - SetData - EditData - FilterData - Base * * @package Molajo * @license http://www.opensource.org/licenses/mit-license.html MIT License * @since 1.0 */ abstract class Sql extends BuildSql { /** * Constructor * * @since 1.0.0 */ public function __construct( FieldhandlerInterface $fieldhandler, $database_prefix ) { $this->fieldhandler = $fieldhandler; $this->database_prefix = $database_prefix; } /** * Get SQL * * At this point, all values have been input, filtered and set in element-specific item arrays * Now, generate the full SQL statement, building the SQL statement and quoting/escaping data * * @param null|string $sql * * @return string * @since 1.0.0 */ public function getSql($sql = null) { if ($sql === null || trim($sql) === '') { $this->generateSql(); } else { $this->sql = ''; $this->getExternalSql($sql); } return $this->sql; } /** * Get the current value (or default) of the specified property * * @param string $key ````` * @param mixed $default * * @return mixed * @since 1.0.0 */ public function get($key, $default = null) { if ($this->$key === null) { $this->$key = $default; } return $this->$key; } /** * Clear Query String * * @return $this * @since 1.0.0 */ public function clearQuery() { $this->query_type = 'select'; $this->distinct = false; $this->columns = array(); $this->update_columns = array(); $this->values = array(); $this->from = array(); $this->insert_into_table = null; $this->where_group = array(); $this->where = array(); $this->group_by = array(); $this->having_group = array(); $this->having = array(); $this->query_object = 'list'; $this->order_by = array(); $this->use_pagination = 0; $this->offset = 0; $this->limit = 0; $this->sql = ''; return $this; } /** * Set Query Type * * @param string $query_type * * @return $this * @since 1.0.0 */ public function setType($query_type = 'select') { if (in_array(strtolower($query_type), $this->query_type_array)) { $this->query_type = strtolower($query_type); } else { $this->query_type = 'select'; } return $this; } /** * Retrieves the current date and time formatted in a manner compliant with the database driver * * @return string * @since 1.0.0 */ public function getDate() { $date = new DateTime(); return $date->format($this->date_format); } /** * Returns a value for null date that is compliant with the database driver * * @return string * @since 1.0.0 */ public function getNullDate() { return $this->null_date; } /** * Retrieves the PHP date format compliant with the database driver * * @return string * @since 1.0.0 */ public function getDateFormat() { return $this->date_format; } /** * Set Distinct Indicator * * @param boolean $distinct * * @return $this * @since 1.0.0 */ public function setDistinct($distinct = false) { if ($distinct === true) { $this->distinct = true; } else { $this->distinct = false; } return $this; } /** * Used for select, insert, and update to specify column name, alias (optional) * For Insert and Update, only, value and data_type * * @param string $column_name * @param null|string $alias * @param null|mixed $value * @param null|string $data_type * * @return $this * @since 1.0.0 */ public function select($column_name, $alias = null, $value = null, $data_type = null) { $this->editRequired('column_name', $column_name); if ($data_type === 'special') { } else { if ($value === null) { $data_type = 'column'; } } $this->columns[$column_name] = $this->setItem($column_name, $data_type, $value, $alias, null, false); return $this; } /** * Set From table name and optional value for alias * * @param string $table_name * @param null|string $alias * @param boolean $primary * * @return $this * @since 1.0.0 */ public function from($table_name, $alias = null, $primary = false) { $this->editRequired('table_name', $table_name); $key = $this->setFromKey($table_name, $alias); $this->from[$key] = $this->setItem($table_name, 'string', null, $alias, null, false); if ($this->findFromPrimary() === true && $primary === false) { return $this; } $this->setFromPrimary($key); return $this; } /** * Set Insert Into Table Name * * @param string $table_name * * @return $this * @since 1.0.0 */ public function setInsertInto($table_name) { $this->editRequired('table_name', $table_name); $this->insert_into_table = (string)$table_name; return $this; } /** * Set From table key * * @param string $table_name * @param null|string $alias * * @return $this * @since 1.0.0 */ public function setFromKey($table_name, $alias = null) { return ($table_name . ' ' . $alias); } /** * Create a grouping for 'and' or 'or' groups of where conditions * * @param string $group * @param string $group_connector * * @return $this * @since 1.0.0 */ public function whereGroup($group, $group_connector = 'AND') { $this->where_group = $this->setGroup($group, $group_connector, 'where', $this->where_group); return $this; } /** * Create a grouping for 'and' or 'or' groups of having conditions * * @param string $group * @param string $group_connector * * @return $this * @since 1.0.0 */ public function havingGroup($group, $group_connector = 'AND') { $this->having_group = $this->setGroup($group, $group_connector, 'having', $this->having_group); return $this; } /** * Set Where Conditions for Query * * @param string $left_filter * @param string $left * @param string $condition * @param string $right_filter * @param string $right * @param string $connector * @param null|string $group * * @return $this * @since 1.0.0 */ public function where( $left_filter = 'column', $left = '', $condition = '', $right_filter = 'column', $right = '', $connector = 'and', $group = null ) { $item = $this->setLeftRightConditionals( $left_filter, $left, $condition, $right_filter, $right, $connector, $group ); $this->where[] = $item; return $this; } /** * Set Having Conditions for Query * * @param string $left_filter * @param string $left * @param string $condition * @param string $right_filter * @param string $right * @param string $connector * @param null|string $group * * @return $this * @since 1.0.0 */ public function having( $left_filter = 'column', $left = '', $condition = '', $right_filter = 'column', $right = '', $connector = 'and', $group = null ) { $item = $this->setLeftRightConditionals( $left_filter, $left, $condition, $right_filter, $right, $connector, $group ); $this->having[] = $item; return $this; } /** * Group By column name * * @param string $column_name * * @return $this * @since 1.0.0 */ public function groupBy($column_name) { $this->group_by[] = $this->setGroupByOrderBy($column_name, 'group by'); return $this; } /** * Order By column name * * @param string $column_name * @param null|string $direction * * @return $this * @since 1.0.0 */ public function orderBy($column_name, $direction = 'ASC') { $this->order_by[] = $this->setGroupByOrderBy($column_name, 'order by', $direction); return $this; } /** * Offset and Limit * * @param int $offset * @param int $limit * * @return $this * @since 1.0.0 */ public function setOffsetAndLimit($offset = 0, $limit = 0) { $this->setOffsetOrLimit($offset, $type = 'offset'); $this->setOffsetOrLimit($limit, $type = 'limit'); return $this; } }
{'content_hash': '4cba7c7b8d58f8f451db992b967927b1', 'timestamp': '', 'source': 'github', 'line_count': 423, 'max_line_length': 99, 'avg_line_length': 23.6903073286052, 'alnum_prop': 0.4923660313341982, 'repo_name': 'Molajo/Query', 'id': '35418dea65445de82454beeae6395b58c24ef1b5', 'size': '10218', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Source/Query/Builder/Sql.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '512092'}]}
package org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.math; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.apache.beam.sdk.extensions.sql.impl.interpreter.BeamSqlFnExecutorTestBase; import org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.BeamSqlExpression; import org.apache.beam.sdk.extensions.sql.impl.interpreter.operator.BeamSqlPrimitive; import org.apache.calcite.sql.type.SqlTypeName; import org.junit.Assert; import org.junit.Test; /** * Test for {@link BeamSqlMathUnaryExpression}. */ public class BeamSqlMathUnaryExpressionTest extends BeamSqlFnExecutorTestBase { @Test public void testForGreaterThanOneOperands() { List<BeamSqlExpression> operands = new ArrayList<>(); // operands more than 1 not allowed operands.add(BeamSqlPrimitive.of(SqlTypeName.INTEGER, 2)); operands.add(BeamSqlPrimitive.of(SqlTypeName.INTEGER, 4)); Assert.assertFalse(new BeamSqlAbsExpression(operands).accept()); } @Test public void testForOperandsType() { List<BeamSqlExpression> operands = new ArrayList<>(); // varchar operand not allowed operands.add(BeamSqlPrimitive.of(SqlTypeName.VARCHAR, "2")); Assert.assertFalse(new BeamSqlAbsExpression(operands).accept()); } @Test public void testForUnaryExpressions() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for sqrt function operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf("2"))); // test for abs function operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.BIGINT, -28965734597L)); Assert.assertEquals(28965734597L, new BeamSqlAbsExpression(operands).evaluate(record, null).getValue()); } @Test public void testForLnExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for LN function with operand type smallint operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf("2"))); Assert.assertEquals(Math.log(2), new BeamSqlLnExpression(operands).evaluate(record, null).getValue()); // test for LN function with operand type double operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4)); Assert .assertEquals(Math.log(2.4), new BeamSqlLnExpression(operands).evaluate(record, null).getValue()); // test for LN function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56))); Assert.assertEquals(Math.log(2.56), new BeamSqlLnExpression(operands).evaluate(record, null).getValue()); } @Test public void testForLog10Expression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for log10 function with operand type smallint operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf("2"))); Assert.assertEquals(Math.log10(2), new BeamSqlLogExpression(operands).evaluate(record, null).getValue()); // test for log10 function with operand type double operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4)); Assert.assertEquals(Math.log10(2.4), new BeamSqlLogExpression(operands).evaluate(record, null).getValue()); // test for log10 function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56))); Assert.assertEquals(Math.log10(2.56), new BeamSqlLogExpression(operands).evaluate(record, null).getValue()); } @Test public void testForExpExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for exp function with operand type smallint operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf("2"))); Assert.assertEquals(Math.exp(2), new BeamSqlExpExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type double operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4)); Assert.assertEquals(Math.exp(2.4), new BeamSqlExpExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56))); Assert.assertEquals(Math.exp(2.56), new BeamSqlExpExpression(operands).evaluate(record, null).getValue()); } @Test public void testForAcosExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for exp function with operand type smallint operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf("2"))); Assert.assertEquals(Double.NaN, new BeamSqlAcosExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type double operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 0.45)); Assert.assertEquals(Math.acos(0.45), new BeamSqlAcosExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(-0.367))); Assert.assertEquals(Math.acos(-0.367), new BeamSqlAcosExpression(operands).evaluate(record, null).getValue()); } @Test public void testForAsinExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for exp function with operand type double operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 0.45)); Assert.assertEquals(Math.asin(0.45), new BeamSqlAsinExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(-0.367))); Assert.assertEquals(Math.asin(-0.367), new BeamSqlAsinExpression(operands).evaluate(record, null).getValue()); } @Test public void testForAtanExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for exp function with operand type double operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 0.45)); Assert.assertEquals(Math.atan(0.45), new BeamSqlAtanExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(-0.367))); Assert.assertEquals(Math.atan(-0.367), new BeamSqlAtanExpression(operands).evaluate(record, null).getValue()); } @Test public void testForCosExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for exp function with operand type double operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 0.45)); Assert.assertEquals(Math.cos(0.45), new BeamSqlCosExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(-0.367))); Assert.assertEquals(Math.cos(-0.367), new BeamSqlCosExpression(operands).evaluate(record, null).getValue()); } @Test public void testForCotExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for exp function with operand type double operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, .45)); Assert.assertEquals(1.0d / Math.tan(0.45), new BeamSqlCotExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(-.367))); Assert.assertEquals(1.0d / Math.tan(-0.367), new BeamSqlCotExpression(operands).evaluate(record, null).getValue()); } @Test public void testForDegreesExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for exp function with operand type smallint operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf("2"))); Assert.assertEquals(Math.toDegrees(2), new BeamSqlDegreesExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type double operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4)); Assert.assertEquals(Math.toDegrees(2.4), new BeamSqlDegreesExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56))); Assert.assertEquals(Math.toDegrees(2.56), new BeamSqlDegreesExpression(operands).evaluate(record, null).getValue()); } @Test public void testForRadiansExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for exp function with operand type smallint operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf("2"))); Assert.assertEquals(Math.toRadians(2), new BeamSqlRadiansExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type double operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4)); Assert.assertEquals(Math.toRadians(2.4), new BeamSqlRadiansExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56))); Assert.assertEquals(Math.toRadians(2.56), new BeamSqlRadiansExpression(operands).evaluate(record, null).getValue()); } @Test public void testForSinExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for exp function with operand type smallint operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf("2"))); Assert.assertEquals(Math.sin(2), new BeamSqlSinExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type double operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4)); Assert.assertEquals(Math.sin(2.4), new BeamSqlSinExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56))); Assert.assertEquals(Math.sin(2.56), new BeamSqlSinExpression(operands).evaluate(record, null).getValue()); } @Test public void testForTanExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for exp function with operand type smallint operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf("2"))); Assert.assertEquals(Math.tan(2), new BeamSqlTanExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type double operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4)); Assert.assertEquals(Math.tan(2.4), new BeamSqlTanExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56))); Assert.assertEquals(Math.tan(2.56), new BeamSqlTanExpression(operands).evaluate(record, null).getValue()); } @Test public void testForSignExpression() { List<BeamSqlExpression> operands = new ArrayList<>(); // test for exp function with operand type smallint operands.add(BeamSqlPrimitive.of(SqlTypeName.SMALLINT, Short.valueOf("2"))); Assert.assertEquals((short) 1 , new BeamSqlSignExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type double operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.4)); Assert.assertEquals(1.0, new BeamSqlSignExpression(operands).evaluate(record, null).getValue()); // test for exp function with operand type decimal operands.clear(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DECIMAL, BigDecimal.valueOf(2.56))); Assert.assertEquals(BigDecimal.ONE, new BeamSqlSignExpression(operands).evaluate(record, null).getValue()); } @Test public void testForPi() { Assert.assertEquals(Math.PI, new BeamSqlPiExpression().evaluate(record, null).getValue()); } @Test public void testForCeil() { List<BeamSqlExpression> operands = new ArrayList<>(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.68687979)); Assert.assertEquals(Math.ceil(2.68687979), new BeamSqlCeilExpression(operands).evaluate(record, null).getValue()); } @Test public void testForFloor() { List<BeamSqlExpression> operands = new ArrayList<>(); operands.add(BeamSqlPrimitive.of(SqlTypeName.DOUBLE, 2.68687979)); Assert.assertEquals(Math.floor(2.68687979), new BeamSqlFloorExpression(operands).evaluate(record, null).getValue()); } }
{'content_hash': '0f912d403eeb23eb9c577b43291462b1', 'timestamp': '', 'source': 'github', 'line_count': 296, 'max_line_length': 100, 'avg_line_length': 44.7195945945946, 'alnum_prop': 0.72675077434464, 'repo_name': 'wangyum/beam', 'id': 'd80a67071e9aebc3146dcaa4f1479f5802c1f00f', 'size': '14042', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/interpreter/operator/math/BeamSqlMathUnaryExpressionTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Go', 'bytes': '109377'}, {'name': 'Groovy', 'bytes': '84452'}, {'name': 'Java', 'bytes': '14117162'}, {'name': 'Python', 'bytes': '3165393'}, {'name': 'Shell', 'bytes': '55385'}]}
set -e git clone https://github.com/nanomsg/nnpy.git # top of tree won't install cd nnpy git checkout c7e718a5173447c85182dc45f99e2abcf9cd4065 sudo pip install cffi sudo pip install . cd ..
{'content_hash': '2df4b09d1debc62ee0178e0ebf554c12', 'timestamp': '', 'source': 'github', 'line_count': 8, 'max_line_length': 53, 'avg_line_length': 23.75, 'alnum_prop': 0.7947368421052632, 'repo_name': 'hanw/behavioral-model', 'id': '77a7d63afe47a1741d549f97580015fe9cbc31ca', 'size': '200', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'travis/install-nnpy.sh', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '93627'}, {'name': 'C++', 'bytes': '2126481'}, {'name': 'M4', 'bytes': '69750'}, {'name': 'Makefile', 'bytes': '44234'}, {'name': 'P4', 'bytes': '37531'}, {'name': 'Python', 'bytes': '271835'}, {'name': 'Ruby', 'bytes': '5182'}, {'name': 'Shell', 'bytes': '11424'}, {'name': 'Thrift', 'bytes': '25904'}]}
package au.net.zeus.rmi.tls; import java.net.Socket; import java.security.AccessController; import java.security.GeneralSecurityException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.Principal; import java.security.cert.CertPath; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import javax.security.auth.Subject; import javax.security.auth.x500.X500PrivateCredential; import net.jini.io.UnsupportedConstraintException; import net.jini.security.AuthenticationPermission; import org.apache.river.logging.Levels; /** * * @author peter */ class ClientSubjectKeyManager extends SubjectKeyManager { /** Client logger */ private static final Logger logger = CLIENT_LOGGER; /** Returns the client logger */ Logger getLogger() { return logger; } ClientSubjectKeyManager(Subject subject) throws NoSuchAlgorithmException, NoSuchProviderException { super(subject); } @Override public String[] getClientAliases(String keyType, Principal[] issuers) { List certPaths = getCertificateChains(getSubject()); if (certPaths == null) { return null; } Collection result = null; for (int i = certPaths.size(); --i >= 0;) { CertPath chain = (CertPath) certPaths.get(i); Exception exception; try { if (checkChain(chain, keyType, issuers) != null) { if (result == null) { result = new ArrayList(certPaths.size()); } result.add(getCertificateName(firstX509Cert(chain))); } continue; } catch (SecurityException e) { exception = e; } catch (GeneralSecurityException ex) { exception = ex; } Logger logger = Logger.getLogger(SubjectKeyManager.class.getName()); if (logger.isLoggable(Levels.HANDLED)) { logger.log(Levels.HANDLED, "Swallowed SecurityException thrown", exception); } } if (result == null) { return null; } else { return (String[]) result.toArray(new String[result.size()]); } } @Override public synchronized String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) { /* * Only choose new client credentials for the first handshake. * Otherwise, just use the previous client credentials. */ if (clientCredential == null) { for (String keyType : keyTypes) { try { if (exceptionMap.get(keyType) != null) { // Prior exception found for keytype return null; } clientCredential = chooseCredential(keyType, issuers); if (clientCredential != null) { // clientCredential found exceptionMap.put(keyType, null); break; } else { exceptionMap.put(keyType, new GeneralSecurityException("Credentials not found")); } continue; } catch (GeneralSecurityException e) { exceptionMap.put(keyType, e); } catch (SecurityException e) { exceptionMap.put(keyType, e); } } if (clientCredential == null) { return null; } } X509Certificate cert = clientCredential.getCertificate(); clientPrincipal = cert.getSubjectX500Principal(); credentialsValidUntil = Math.min(credentialsValidUntil, certificatesValidUntil(getCertificateChain(getSubject(), cert))); authenticationPermission = getAuthenticationPermission(cert); String result = getCertificateName(clientCredential.getCertificate()); if (logger.isLoggable(Level.FINE)) { logger.log( Level.FINE, "choose client alias for key types {0}\nand issuers {1}\n" + "returns {2}", new Object[] { toString(keyTypes), toString(issuers), result }); } return result; } /* -- X500TrustManager -- */ /** * Override this X509TrustManager method in order to cache the server * principal and to continue to choose the same one. */ @Override public synchronized void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { super.checkServerTrusted(chain, authType); if (serverPrincipal == null) { serverCredential = chain[0]; serverPrincipal = serverCredential.getSubjectX500Principal(); setPermittedRemotePrincipals(Collections.singleton(serverPrincipal)); credentialsValidUntil = certificatesValidUntil(chain); } else if (!serverCredential.equals(chain[0])) { throw new CertificateException("Server credentials changed"); } } @Override public String[] getServerAliases(String arg0, Principal[] arg1) { return null; } @Override public String chooseServerAlias(String arg0, Principal[] arg1, Socket arg2) { return null; } /** * Returns the permission needed to connect to the last server principal * with the specified client certificate. */ AuthenticationPermission getAuthenticationPermission(X509Certificate cert) { Set client = Collections.singleton(cert.getSubjectX500Principal()); Set server = (serverPrincipal == null) ? null : Collections.singleton(serverPrincipal); return new AuthenticationPermission(client, server, "connect"); } /** * Gets the private credential for the specified X.509 certificate, * checking for AuthenticationPermission to connect with the last server * principal. * * @param cert the certificate for the local principal * @return the associated private credential or null if not found * @throws SecurityException if the access control context does not have * the proper AuthenticationPermission */ @Override synchronized X500PrivateCredential getPrivateCredential(X509Certificate cert) { return getPrivateCredential(cert, getAuthenticationPermission(cert)); } /** * Gets the private credential for the specified X.509 certificate, * checking for the specified AuthenticationPermission. * * @param cert the certificate for the local principal * @param ap the permission needed to connect to the peer * @return the associated private credential or null if not found * @throws SecurityException if the access control context does not have * the proper AuthenticationPermission */ protected X500PrivateCredential getPrivateCredential(X509Certificate cert, AuthenticationPermission ap) { Subject subject = getSubject(); if (subject == null) { return null; } SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(ap); } return (X500PrivateCredential) AccessController.doPrivileged(new GetPrivateCredentialAction(subject, cert)); } /** * Checks if the subject still contains the proper credentials, and the * current access control context has the proper AuthenticationPermission, * to use the current session. Callers should only call this method if * client authentication is being used. * * @throws SecurityException if the access control context does not have * the proper AuthenticationPermission * @throws UnsupportedConstraintException if the subject does not contain * the proper credentials */ synchronized void checkAuthentication() throws GeneralSecurityException { if (clientCredential == null) { throw new GeneralSecurityException( "Client is not authenticated"); } else if (clientCredential.isDestroyed()) { throw new GeneralSecurityException( "Private credentials are destroyed"); } else if (System.currentTimeMillis() > credentialsValidUntil) { throw new GeneralSecurityException( "Certificates are no longer valid"); } if (subjectIsReadOnly) { SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(authenticationPermission); } } else { Subject subject = getSubject(); X509Certificate cert = clientCredential.getCertificate(); if (getPrincipal(subject, cert) == null) { throw new GeneralSecurityException("Missing principal"); } CertPath chain = getCertificateChain(subject, cert); if (chain == null) { throw new GeneralSecurityException( "Missing public credentials"); } X500PrivateCredential pc = getPrivateCredential( cert, authenticationPermission); if (pc == null) { throw new GeneralSecurityException( "Missing private credentials"); } else if (!equalPrivateCredentials(clientCredential, pc)) { throw new GeneralSecurityException( "Wrong private credentials"); } } } }
{'content_hash': '527a69c207200fca5e44fa300086269f', 'timestamp': '', 'source': 'github', 'line_count': 259, 'max_line_length': 122, 'avg_line_length': 33.87258687258687, 'alnum_prop': 0.7045480451384931, 'repo_name': 'pfirmstone/river-internet', 'id': '01c4d486d5a17fffaaacedcc4db47435ee148cca', 'size': '9363', 'binary': False, 'copies': '2', 'ref': 'refs/heads/trunk', 'path': 'JGDMS/jgdms-rmi-tls/src/main/java/au/net/zeus/rmi/tls/ClientSubjectKeyManager.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '2047'}, {'name': 'Groff', 'bytes': '863'}, {'name': 'Groovy', 'bytes': '35711'}, {'name': 'HTML', 'bytes': '4398920'}, {'name': 'Java', 'bytes': '33660467'}, {'name': 'Makefile', 'bytes': '3046'}, {'name': 'Shell', 'bytes': '69126'}]}
(function(root) { //------------------------------------------------------------------// // Compatibility //------------------------------------------------------------------// var emptyFn = function() {}; var console = root.console || {}; var document = root.document; console.error = console.error || emptyFn; root.GLOBAL = root; //------------------------------------------------------------------// // Base64 encoding //------------------------------------------------------------------// function toBase64Digit(value) { var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + 'abcdefghijklmnopqrstuvwxyz' + '0123456789+/'; return digits[value & 0x3F]; } function strToUTF8Base64(str) { function decodeSurrogatePair(hi, lo) { var resultChar = 0x010000; resultChar += lo - 0xDC00; resultChar += (hi - 0xD800) << 10; return resultChar; } var bytes = [0, 0, 0]; var byteIndex = 0; var result = []; function output(s) { result.push(s); } function emitBase64() { var toDigit = toBase64Digit; // --Byte 0-- --Byte 1-- --Byte 2-- // 1111 1122 2222 3333 3344 4444 var d1 = toDigit(bytes[0] >> 2); var d2 = toDigit( ((bytes[0] & 0x03) << 4) | (bytes[1] >> 4)); var d3 = toDigit( ((bytes[1] & 0x0F) << 2) | (bytes[2] >> 6)); var d4 = toDigit( bytes[2] & 0x3F); if (byteIndex === 1) { output(d1 + d2 + '=='); } else if (byteIndex === 2) { output(d1 + d2 + d3 + '='); } else { output(d1 + d2 + d3 + d4); } } function emit(chr) { bytes[byteIndex++] = chr; if (byteIndex === 3) { emitBase64(); bytes[0] = 0; bytes[1] = 0; bytes[2] = 0; byteIndex = 0; } } function emitLast() { if (byteIndex > 0) { emitBase64(); } } // Converts the string to UTF8: var i, chr; var hi, lo; for (i = 0; i < str.length; i++) { chr = str.charCodeAt(i); // Test and decode surrogate pairs in the string if (chr >= 0xD800 && chr <= 0xDBFF) { hi = chr; lo = str.charCodeAt(i + 1); if (lo >= 0xDC00 && lo <= 0xDFFF) { chr = decodeSurrogatePair(hi, lo); i++; } } // Encode the character as UTF-8. if (chr < 0x80) { emit(chr); } else if (chr < 0x0800) { emit((chr >> 6) | 0xC0); emit(((chr >> 0) & 0x3F) | 0x80); } else if (chr < 0x10000) { emit((chr >> 12) | 0xE0); emit(((chr >> 6) & 0x3F) | 0x80); emit(((chr >> 0) & 0x3F) | 0x80); } else if (chr < 0x110000) { emit((chr >> 18) | 0xF0); emit(((chr >> 12) & 0x3F) | 0x80); emit(((chr >> 6) & 0x3F) | 0x80); emit(((chr >> 0) & 0x3F) | 0x80); } } emitLast(); return result.join(''); } // VLQ Base64 encoding used in source maps function toVLQ(value) { var vlq, result, digit; // The LSB in the encoded result is used to indicate the sign of // the original value vlq = value < 0 ? ((-value) << 1) + 1 : (value << 1); // Digits are encoded least significant first. result = ''; do { // Each Base64 digit encodes 5 bits. The sixth bit is a // continuation bit. digit = vlq & 0x1F; vlq = vlq >> 5; digit = digit | (vlq > 0 ? 0x20 : 0); result += toBase64Digit(digit); } while (vlq > 0); return result; } //------------------------------------------------------------------// // Source maps //------------------------------------------------------------------// function getSourceMap(file, source, lineOffset) { var mappings = []; var lineCount = source.split(/\r\n?|\n/).length; var map; var curLine, i; var lastOriginalLine = 0; function addLineMapping(originalLine) { var generatedColumn = 0; var sourceIndex = 0; var originalColumn = 0; var segment = [ toVLQ(generatedColumn), toVLQ(sourceIndex), toVLQ(originalLine - lastOriginalLine), toVLQ(originalColumn) ].join(''); lastOriginalLine = originalLine; mappings.push(segment); } for (i = 0; i < lineOffset; i++) { mappings.push(''); } for (i = 0; i < lineCount; i++) { addLineMapping(i); } map = [ '{', '"version":3,', '"sources":[', JSON.stringify(file), '],', '"names":[],', '"mappings":', JSON.stringify(mappings.join(';')), ',', '"sourcesContent":[', JSON.stringify(source), ']', '}' ].join(''); return map; } //------------------------------------------------------------------// // Path manipulation //------------------------------------------------------------------// var basePath = window.location.pathname.replace(/\/[^\/]*$/, ''); var hrefOrigin = window.location.origin; function concatPath(basePath, path) { var baseParts, pathParts, i, it; var result = []; // If path is absolute, ignore the base path. if (path[0] === '/') { // Run the concatPath to normalize path. return concatPath(path, ''); } // Remove leading and trailing slashes and split the base path. // Note that basePath is always handled as absolute. baseParts = basePath.replace(/^\/|\/$/g, '').split('/'); // Remove any trailing slash and split the path. pathParts = path.replace(/^\/$/, '').split('/'); // Append the parts of basePath to the result, solving . and .. // in the path. for (i = 0; i < baseParts.length; i++) { it = baseParts[i]; if (it === '.' || (i === 0 && it === '')) { // Ignore '.' or an empty part (result of an empty // basePath). continue; } else if (it === '..') { result.pop(); } else { result.push(it); } } // Append the parts of path to the result, again solving . and .. for (i = 0; i < pathParts.length; i++) { it = pathParts[i]; if (it === '.' || it === '') { // Ignore '.' or an empty part (result of an empty path). continue; } else if (it === '..') { result.pop(); } else { result.push(it); } } return '/' + result.join('/'); } function solvePossiblePaths(path, relativeTo) { var isRelative = /^(\.){0,2}\//.test(path); var possiblePaths = []; var basePath, curPath; if (!/\.js/i.test(path)) { path += '.js'; } if (isRelative) { curPath = concatPath(relativeTo, path); possiblePaths.push(curPath); } else { basePath = relativeTo; while (true) { curPath = concatPath(basePath, 'node_modules'); curPath = concatPath(curPath, path); if (possiblePaths.indexOf(curPath) >= 0) { break; } else { possiblePaths.push(curPath); } basePath = concatPath(basePath, '..'); } } return possiblePaths; } //------------------------------------------------------------------// // Ajax request //------------------------------------------------------------------// var requestCache = {}; var pendingRequests = {}; function sendRequest(path, callback) { var request, pending; // Check for a cached result if (requestCache[path]) { setTimeout(function() { callback(requestCache[path]); }, 0); return; } else if (pendingRequests[path]) { pendingRequests[path].callbacks.push(callback); return; } // If the request is not on the cache, makes the Ajax request: if (root.XMLHttpRequest) { request = new root.XMLHttpRequest(); } else if (root.ActiveXObject) { request = new root.ActiveXObject('Microsoft.XMLHTTP'); } pending = pendingRequests[path] = { callbacks: [callback] }; request.onreadystatechange = function() { var response, callbacks, i, cb; if (request.readyState === 4) { requestCache[path] = response = parseResponse(request); response.originPath = path; callbacks = pendingRequests[path].callbacks; delete pendingRequests[path]; for (i = 0; i < callbacks.length; i++) { cb = callbacks[i]; cb(response); } } }; request.open('GET', path, true); request.send(null); } function parseResponse(request) { var result = {}; if (request.status === 200) { result.success = true; result.source = request.responseText; } else if (request.status === 404) { result.success = false; result.notFound = true; result.error = 'Not found (404)'; } else { result.success = false; result.error = 'Server error (' + request.status + ')'; } return result; } //------------------------------------------------------------------// // Module loading //------------------------------------------------------------------// var pending = []; var moduleMap = {}; var moduleError = {}; var execOrder = []; function getRequires(source) { var len; var lines; var i, it, match; var requires = []; // Strips multiline comments from source. do { len = source.length; source = source.replace(/\/\*([^\*]|\*(?!\/))*(\*\/|$)/, ''); } while (len !== source.length); lines = source.split(/\r\n?|\n/); for (i = 0; i < lines.length; i++) { it = lines[i]; it = it.replace(/^\s*((?:var)?\s*(?:\w+\s*=))?\s*/, ''); match = it.match( /^require\s*\(\s*(\'|\")((?:(?!\1).)+)\1\s*\)\s*(;|$)/); if (match) { requires.push(match[2]); } } return requires; } function loadModule(response, request, callback) { var originPath = response.originPath; var pendingIndex = pending.indexOf(request); var module; var requireCount = 0; var requires, i, it; function callCallbackWhenOver() { if (requireCount <= 0 && typeof callback === 'function') { callback(module, request); } } function onRequiredLoaded(depModule, depRequest) { module.dependencies.push(depModule.path); module.requireMap[depRequest.path] = depModule.path; requireCount -= 1; callCallbackWhenOver(); } pending.splice(pendingIndex, 1); module = moduleMap[originPath]; if (!module) { module = moduleMap[originPath] = { path: originPath, basePath: concatPath(originPath, '..'), error: response.success ? false : response.error, request: request, response: response, source: response.source, dependencies: [], requireMap: {}, moduleObject: { exports: {} } }; if (!module.error) { requires = module.requires = getRequires(module.source); requireCount = requires.length; for (i = 0; i < requires.length; i++) { it = requires[i]; loadFile(it, module.basePath, module.path, onRequiredLoaded); } callCallbackWhenOver(); } else { callCallbackWhenOver(); } } else { callCallbackWhenOver(); } } function loadFile(path, relativeTo, requestedBy, callback) { var requestInfo = { path: path, basePath: relativeTo, solvedPaths: solvePossiblePaths(path, relativeTo), nextIndex: 0 }; pending.push(requestInfo); function onSuccess(response) { loadModule(response, requestInfo, callback); } function onError(response) { console.error( 'Failed to load `' + path + '` requested by `' + requestedBy + '`: ' + response.error); loadModule(response, requestInfo, callback); } function tryLoadNext() { var nextPath = requestInfo.solvedPaths[requestInfo.nextIndex++]; var isLast = requestInfo.nextIndex >= requestInfo.solvedPaths.length; // Send the request for the next possible path. sendRequest(nextPath, function(response) { if (response.success) { // The file was successfully loaded, process the // result. onSuccess(response); } else if (response.notFound && !isLast) { // The file was not found, but there are other // possible paths, so continue trying. tryLoadNext(); } else { // The request failed or the last possible path was // not found. Generate an error. onError(response); } }); } // Try load the first possible path. tryLoadNext(); } //------------------------------------------------------------------// // Module execution //------------------------------------------------------------------// function getModule(modulePath) { var module = moduleMap[modulePath]; if (!module) { throw new Error('Module `' + modulePath + '` not loaded'); } return module; } function getLoadingOrder(module) { var result = []; var deps, i, it, subResult; if (module && !module.visited) { module.visited = true; deps = module.dependencies; for (i = 0; i < deps.length; i++) { it = getModule(deps[i]); subResult = getLoadingOrder(it); result = result.concat(subResult); } result.push(module); } return result; } function beforeModuleLoading(module) { } function afterModuleLoading(module) { if (!axloader._moduleFn) { // Assume a syntax error. module.syntaxError = true; } module.moduleFunction = axloader._moduleFn; module.executed = false; delete axloader._moduleFn; } function executeModule(module, afterCallback) { var order = getLoadingOrder(module); function loadNext() { var nextModule = order.shift(); var script, source, sourceMap; if (nextModule && !nextModule.error) { beforeModuleLoading(nextModule); source = 'axloader._moduleFn = (' + 'function(require, module, exports, global) { // ' + nextModule.path + '\n' + nextModule.source + '\n})'; source += '\n//# sourceMappingURL=' + 'data:application/json;charset=utf-8;base64,'; sourceMap = getSourceMap( hrefOrigin + nextModule.path, nextModule.source, 1); source += strToUTF8Base64(sourceMap); script = document.createElement('script'); script.id = nextModule.path; script.type = 'text/javascript'; script.src = 'data:text/javascript;charset=utf-8;base64,' + strToUTF8Base64(source); script.innerHTML = source; script.onload = function() { afterModuleLoading(nextModule); setTimeout(loadNext, 0); }; document.head.appendChild(script); } else if (nextModule) { nextModule.notFound = true; setTimeout(loadNext, 0); } else { doExecute(module); if (typeof afterCallback === 'function') { afterCallback(); } } } function doExecute(theModule) { function require(path) { var solvedPath = theModule.requireMap[path]; var requiredModule = solvedPath && getModule(solvedPath); if (!requiredModule) { throw new Error( 'require: the module `' + path + '` was not preloaded'); } else if (requiredModule.notFound) { throw new Error('Cannot find module \'' + path + '\''); } else if (requiredModule.error) { throw new Error( 'require: the module `' + path + '` could not be loaded: ' + requiredModule.error); } if (!requiredModule.executed && !requiredModule.executing) { doExecute(requiredModule); } return requiredModule.moduleObject.exports; } var fn = theModule.moduleFunction; var moduleObject = theModule.moduleObject; var moduleExports = moduleObject.exports; if (theModule.syntaxError) { throw new SyntaxError(theModule.path); } else if (theModule.notFound) { throw new Error('module not found: ' + theModule.path); } try { theModule.executing = true; fn.call(root, require, moduleObject, moduleExports, root); } finally { theModule.executing = false; } theModule.executed = true; } loadNext(); } //------------------------------------------------------------------// // Public API //------------------------------------------------------------------// var axloader = {}; axloader.require = function require(path, afterCallback) { loadFile(path, basePath, 'axloader.require', function(module) { executeModule(module, afterCallback); }); }; axloader.getPending = function getPending() { return pending; }; axloader.getModuleMap = function getModuleMap() { return moduleMap; }; root.axloader = axloader; }(this));
{'content_hash': '4743262d432c18a51e55f21bb8262f7e', 'timestamp': '', 'source': 'github', 'line_count': 671, 'max_line_length': 71, 'avg_line_length': 22.758569299552907, 'alnum_prop': 0.5774998362910091, 'repo_name': 'ricardobm/ax-loader', 'id': '26a7854d505d1e5992646f05b596e9df22dda295', 'size': '15271', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/ax-loader.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '21108'}]}
package jugsaar12.nio.networking; import java.net.ServerSocket; import java.net.Socket; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * TODO MAX_POOL_SIZE to 1000 * <p/> * TODO show RejectedExecutionHandler -> Default AbortPolicy, CallerRunsPolicy */ public class C_ExecutorServiceMultiThreadedEchoServer { public static void main(String[] args) throws Exception { System.out.println("C_ExecutorServiceMultiThreadedEchoServer running"); ExecutorService es = Executors.newCachedThreadPool(); try (ServerSocket ss = new ServerSocket(1337)) { while (true) { Socket s = ss.accept(); // blocking-call, never returns null! es.submit(() -> Util.process(s)); } } } }
{'content_hash': '35befc48d23f03d692415d764e21ff48', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 78, 'avg_line_length': 25.333333333333332, 'alnum_prop': 0.7144736842105263, 'repo_name': 'jugsaar/jugsaar-meeting-12', 'id': 'aec0332d325665aa4bb0aec3abf2abd31679f07c', 'size': '760', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'java-nio-networking/code/jugsaar12-java-nio-networking/src/main/java/jugsaar12/nio/networking/C_ExecutorServiceMultiThreadedEchoServer.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '17468'}]}
import pyxb.binding.generate import pyxb.utils.domutils from xml.dom import Node import os.path schema_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../schemas/po1.xsd')) code = pyxb.binding.generate.GeneratePython(schema_location=schema_path) #file('code.py', 'w').write(code) rv = compile(code, 'test', 'exec') eval(rv) from pyxb.exceptions_ import * from pyxb.utils import domutils def ToDOM (instance, tag=None, dom_support=None): return instance.toDOM(dom_support).documentElement import unittest class TestPO1 (unittest.TestCase): street_content = '''95 Main St. Anytown, AS 12345-6789''' street_xml = '<street>%s</street>' % (street_content,) street_dom = pyxb.utils.domutils.StringToDOM(street_xml).documentElement address1_xml = '<name>Customer</name><street>95 Main St</street>' address2_xml = '<name>Sugar Mama</name><street>24 E. Dearling Ave.</street>' def tearDown (self): pyxb.RequireValidWhenGenerating(True) pyxb.RequireValidWhenParsing(True) def testPythonElementSimpleContent (self): elt = USAddress._ElementMap['street'].elementBinding()(self.street_content) self.assertEqual(self.street_content, elt) self.assertEqual(ToDOM(elt).toxml("utf-8"), self.street_xml) def testDOMElementSimpleContent (self): elt = USAddress._ElementMap['street'].elementBinding().createFromDOM(self.street_dom) self.assertEqual(ToDOM(elt).toxml("utf-8"), self.street_xml) def testPythonElementComplexContent_Element (self): addr = USAddress(name='Customer', street='95 Main St') self.assertEqual('95 Main St', addr.street) addr = USAddress('Customer', '95 Main St') self.assertEqual('95 Main St', addr.street) addr.street = '43 West Oak' self.assertEqual('43 West Oak', addr.street) #self.assertEqual('<s>%s</s>' % (self.address1_xml,), ToDOM(addr, tag='s').toxml("utf-8")) def testDOM_CTD_element (self): # NB: USAddress is a CTD, not an element. xml = '<shipTo>%s</shipTo>' % (self.address1_xml,) dom = pyxb.utils.domutils.StringToDOM(xml) addr2 = USAddress.Factory(_dom_node=dom.documentElement) #self.assertEqual(xml, ToDOM(addr2, tag='shipTo').toxml("utf-8")) def testPurchaseOrder (self): po = purchaseOrder(shipTo=USAddress(name='Customer', street='95 Main St'), billTo=USAddress(name='Sugar Mama', street='24 E. Dearling Ave'), comment='Thanks!') xml = ToDOM(po).toxml("utf-8") xml1 = '<ns1:purchaseOrder xmlns:ns1="http://www.example.com/PO1"><shipTo><name>Customer</name><street>95 Main St</street></shipTo><billTo><name>Sugar Mama</name><street>24 E. Dearling Ave</street></billTo><ns1:comment>Thanks!</ns1:comment></ns1:purchaseOrder>' self.assertEqual(xml, xml1) dom = pyxb.utils.domutils.StringToDOM(xml) po2 = purchaseOrder.createFromDOM(dom.documentElement) self.assertEqual(xml1, ToDOM(po2).toxml("utf-8")) loc = po2.shipTo._location() self.assertTrue((not isinstance(loc, pyxb.utils.utility.Locatable_mixin)) or (58 == loc.columnNumber)) loc = po2.billTo.name._location() self.assertTrue((not isinstance(loc, pyxb.utils.utility.Locatable_mixin)) or (131 == loc.columnNumber)) po2 = CreateFromDocument(xml) self.assertEqual(xml1, ToDOM(po2).toxml("utf-8")) loc = po2.shipTo._location() self.assertTrue((not isinstance(loc, pyxb.utils.utility.Locatable_mixin)) or (58 == loc.columnNumber)) loc = po2.billTo.name._location() self.assertTrue((not isinstance(loc, pyxb.utils.utility.Locatable_mixin)) or (131 == loc.columnNumber)) xml2 = '<purchaseOrder xmlns="http://www.example.com/PO1"><shipTo><name>Customer</name><street>95 Main St</street></shipTo><billTo><name>Sugar Mama</name><street>24 E. Dearling Ave</street></billTo><comment>Thanks!</comment></purchaseOrder>' bds = pyxb.utils.domutils.BindingDOMSupport() bds.setDefaultNamespace(Namespace) self.assertEqual(xml2, ToDOM(po2, dom_support=bds).toxml("utf-8")) def testGenerationValidation (self): ship_to = USAddress('Robert Smith', 'General Delivery') po = purchaseOrder(ship_to) self.assertEqual('General Delivery', po.shipTo.street) self.assertTrue(po.billTo is None) self.assertTrue(pyxb.RequireValidWhenGenerating()) self.assertRaises(pyxb.DOMGenerationError, po.toxml) try: pyxb.RequireValidWhenGenerating(False) self.assertFalse(pyxb.RequireValidWhenGenerating()) xmls = po.toxml("utf-8", root_only=True) self.assertEqual('<ns1:purchaseOrder xmlns:ns1="http://www.example.com/PO1"><shipTo><street>General Delivery</street><name>Robert Smith</name></shipTo></ns1:purchaseOrder>', xmls) finally: pyxb.RequireValidWhenGenerating(True) self.assertRaises(pyxb.UnrecognizedContentError, CreateFromDocument, xmls) self.assertTrue(pyxb.RequireValidWhenParsing()) try: pyxb.RequireValidWhenParsing(False) self.assertFalse(pyxb.RequireValidWhenParsing()) po2 = CreateFromDocument(xmls) finally: pyxb.RequireValidWhenParsing(True) self.assertEqual('General Delivery', po2.shipTo.street) self.assertTrue(po2.billTo is None) if __name__ == '__main__': unittest.main()
{'content_hash': '919acf526bf392f33f5376056b08089f', 'timestamp': '', 'source': 'github', 'line_count': 119, 'max_line_length': 269, 'avg_line_length': 46.739495798319325, 'alnum_prop': 0.6650485436893204, 'repo_name': 'jonfoster/pyxb1', 'id': 'bf3c9d2f0c5635eae42a36b08b6241bea6e6e94f', 'size': '5562', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'tests/drivers/test-po1.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Python', 'bytes': '1564427'}, {'name': 'Shell', 'bytes': '18946'}]}
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; namespace VJeek.Microdata.Intangible.StructuredValue { public partial class OpeningHoursSpecification : StructuredValue { [JsonProperty("closes")] public TimeSpan Closes { get; set; } [JsonProperty("dayOfWeek")] public DayOfWeek DayOfWeek { get; set; } [JsonProperty("opens")] public TimeSpan Opens { get; set; } [JsonProperty("validFrom")] public DateTime ValidFrom { get; set; } [JsonProperty("validThrough")] public DateTime ValidThrough { get; set; } } }
{'content_hash': 'ebe952e1b2b29a2152f4caea184b6845', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 65, 'avg_line_length': 23.22222222222222, 'alnum_prop': 0.7384370015948963, 'repo_name': 'vjeek/microdata', 'id': 'eee2c6ba0e8520d9bd949baba07a99f7c5b3b95c', 'size': '629', 'binary': False, 'copies': '1', 'ref': 'refs/heads/development', 'path': 'Sources/VJeek.Microdata/Intangible/StructuredValue/OpeningHoursSpecification.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '746'}, {'name': 'C#', 'bytes': '19991'}, {'name': 'PowerShell', 'bytes': '95259'}]}
The GraphQL module allows client applications to query the content handled by an Orchard website. It enables the GraphiQL Explorer view to test GraphQL queries, and provides HTTP endpoints to send client queries. ## HTTP Methods, Headers, and Body ### GET request When receiving an HTTP GET request, the GraphQL query should be specified in the "query" query string. For example, if we wanted to execute the following GraphQL query: ```graphql { me { name } } ``` This request could be sent via an HTTP GET like so: `http://myapi/graphql?query={me{name}}` Query variables can be sent as a JSON-encoded string in an additional query parameter called variables. If the query contains several named operations, an operationName query parameter can be used to control which one should be executed. ### POST request #### application/json content type A standard GraphQL POST request should use the `application/json` content-type header, and include a JSON-encoded body of the following form: ```graphql { "query": "...", "operationName": "...", "variables": { "myVariable": "someValue", ... } } ``` `operationName` and `variables` are optional fields. `operationName` is only required if multiple operations are present in the query. #### application/graphql content type Another option is to use the `application/graphql` content-type header, and the HTTP POST body contents is treated as the GraphQL query string. #### query string In addition to the above, If the "query" query string parameter is present (as in the GET example above), it will be parsed and handled in the same way as the HTTP GET case. ### Response Regardless of the method by which the query and variables were sent, the response is returned in the body of the request in JSON format. A query might result in some data and some errors, and those are returned in a JSON object of the form: ```json { "data": { ... }, "errors": [ ... ] } ``` If there were no errors returned, the "errors" field is not present on the response. If no data is returned the "data" field is only included if the error occurred during execution. ## Authentication Executing a GraphQL query requires the issuer to have the `ExecuteGraphQL` permission. Like any other API in Orchard Core, the GraphQL API supports cookie and OAuth 2.0 authentication. This means it's compatible with the OpenId module and supports JSON Web Token (JWT). By default anonymous users are not able to execute a GraphQL query. ## Configuration It's possible to configure graphql options for exposing exceptions and max depth, max complexity and field impact. Configuration is done via the standard shell configuration, as follows. ```json { "OrchardCore": { "OrchardCore_Apis_GraphQL": { "ExposeExceptions": true, "MaxDepth": 50, "MaxComplexity": 100, "FieldImpact": 2.0, "DefaultNumberOfResults": 100, "MaxNumberOfResults": 1000, "MaxNumberOfResultsValidationMode": "Default" } } } ``` *ExposeExceptions (bool, Default: false for production, true for development)* If set to true stack traces are exposed to graphql clients *DefaultNumberOfResults (int, Default: 100)* The default number of results returned by all paged fields/types. *MaxNumberOfResults (int, Default: 1000)* The maximum number of results returned by all paged fields/types. *MaxNumberOfResultsValidationMode (enum, Values: Default|Enabled|Disabled, Default: Default)()* Specify the validation behaviour if the max number of results is exceeded in a pager parameter * Default - In production info will be logged and only the max number of results will be returned. In development a graphql validation error will be raised. * Enabled - a graphql validation error will be raised * Disabled - Info will be logged and only the max number of results will be returned *MaxDepth (int?, Default: 20)* Enforces the total maximum nesting across all queries in a request. *MaxComplexity (int?, Default: null)* *FieldImpact (double?, Default: null)* For more information on MaxDepth, MaxComplexity, FieldImpact & protecting against malicious queries view the graphql-dot-net documentation at <https://graphql-dotnet.github.io/docs/getting-started/malicious-queries/>
{'content_hash': '8ee80330a70b8aded11c89b2578ddc87', 'timestamp': '', 'source': 'github', 'line_count': 117, 'max_line_length': 237, 'avg_line_length': 36.43589743589744, 'alnum_prop': 0.7522871217452498, 'repo_name': 'xkproject/Orchard2', 'id': '2a44f43220f1cc656cf5d84f218eeb9a33797940', 'size': '4308', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master_PCCOM', 'path': 'src/docs/reference/modules/Apis.GraphQL/README.md', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C#', 'bytes': '7779422'}, {'name': 'CSS', 'bytes': '2900240'}, {'name': 'Dockerfile', 'bytes': '424'}, {'name': 'HTML', 'bytes': '1472436'}, {'name': 'JavaScript', 'bytes': '2184254'}, {'name': 'Liquid', 'bytes': '43273'}, {'name': 'PHP', 'bytes': '2484'}, {'name': 'PowerShell', 'bytes': '142165'}, {'name': 'Pug', 'bytes': '55503'}, {'name': 'SCSS', 'bytes': '215570'}, {'name': 'TypeScript', 'bytes': '41644'}]}
Namespace Ribbons.Document.Create Public Class FromProfile Inherits RibbonButtonBase Public Sub New() _Image = "" _Order = 1 _Text = "From Profile" _ToolTip = "" End Sub Protected Friend Overrides Sub OnClick() End Sub Protected Friend Overrides Sub OnIsEnabled() End Sub End Class End Namespace
{'content_hash': '81adc258cf3c3d2de8198ac49cb880ff', 'timestamp': '', 'source': 'github', 'line_count': 24, 'max_line_length': 52, 'avg_line_length': 17.375, 'alnum_prop': 0.5539568345323741, 'repo_name': 'nublet/DMS', 'id': '51e57b874a4c962bdaa2f2ba00ff815d1485c81b', 'size': '417', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'DMS.Forms/Ribbons/Items/Document/Create/FromProfile.vb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Visual Basic', 'bytes': '2291940'}]}
package com.dfyy.bussiness; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.hibernate.annotations.GenericGenerator; import com.dfyy.util.JaxbDateSerializer; @Entity @Table(name = "user") @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) public class User implements Serializable { private static final long serialVersionUID = 8517308475246169441L; @Id @Column(name = "id") @GenericGenerator(name = "idGenerator", strategy = "assigned") @GeneratedValue(generator = "idGenerator") @XmlElement private String id; @Column(name = "phone") @XmlElement private String phone; @Column(name = "password") @XmlTransient private String password; @Column(name = "alias") @XmlElement private String alias; @Column(name = "thumbnail") @XmlElement private String thumbnail; @Column(name = "address") @XmlElement private String address; @Column(name = "point") @XmlElement private Integer point; @Column(name = "description") @XmlElement private String description; @Column(name = "status") @XmlElement private Integer status; @Column(name = "x") @XmlElement private Double x; @Column(name = "y") @XmlElement private Double y; @Column(name = "currency") @XmlElement private Integer currency; @Column(name = "money") @XmlElement private Integer money; @Column(name = "scoring") @XmlElement private Double scoring; @Column(name = "tjcode") @XmlElement private String tjcode; @Column(name = "tjcoin") @XmlElement private Integer tjcoin; @Column(name = "time") @XmlJavaTypeAdapter(JaxbDateSerializer.class) private Date time; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "level") @XmlElement private UserLevel level; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "aid") @XmlElement private Area area; @Column(name = "activity") private Integer activity; @Column(name = "teamwork") @XmlElement private boolean teamwork; @Column(name = "acceptcoupon") @XmlElement private boolean acceptCoupon; public User() { } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getAlias() { return alias; } public void setAlias(String alias) { this.alias = alias; } public String getThumbnail() { return thumbnail; } public void setThumbnail(String thumbnail) { this.thumbnail = thumbnail; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public Integer getPoint() { return point; } public void setPoint(Integer point) { this.point = point; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Double getX() { return x; } public void setX(Double x) { this.x = x; } public Double getY() { return y; } public void setY(Double y) { this.y = y; } public Integer getCurrency() { return currency; } public void setCurrency(Integer currency) { this.currency = currency; } public Double getScoring() { return scoring; } public void setScoring(Double scoring) { this.scoring = scoring; } public Date getTime() { return time; } public void setTime(Date time) { this.time = time; } public UserLevel getLevel() { return level; } public void setLevel(UserLevel level) { this.level = level; } public Area getArea() { return area; } public void setArea(Area area) { this.area = area; } public String getTjcode() { return tjcode; } public void setTjcode(String tjcode) { this.tjcode = tjcode; } public Integer getActivity() { return activity; } public void setActivity(Integer activity) { this.activity = activity; } @XmlElement public String getIdentifier() { if (activity == null) { return "新人"; } else if (activity >= 2000) { return "特级"; } else if (activity >= 1000 && activity <= 1999) { return "高级"; } else if (activity >= 500 && activity <= 999) { return "中级"; } else if (activity >= 200 && activity <= 499) { return "初级"; } return "新人"; } public boolean isTeamwork() { return teamwork; } public void setTeamwork(boolean teamwork) { this.teamwork = teamwork; } public Integer getTjcoin() { return tjcoin; } public void setTjcoin(Integer tjcoin) { this.tjcoin = tjcoin; } public boolean isAcceptCoupon() { return acceptCoupon; } public void setAcceptCoupon(boolean acceptCoupon) { this.acceptCoupon = acceptCoupon; } public Integer getMoney() { return money; } public void setMoney(Integer money) { this.money = money; } }
{'content_hash': '09961152c255dd2b8ffd2e6fccc1ddbc', 'timestamp': '', 'source': 'github', 'line_count': 323, 'max_line_length': 67, 'avg_line_length': 17.340557275541794, 'alnum_prop': 0.7064809855382967, 'repo_name': 'secondflying/dfyy', 'id': 'b7211ffdebc40d47216eaaef59f1a68cb1ada1fc', 'size': '5625', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/dfyy/bussiness/User.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ActionScript', 'bytes': '70896'}, {'name': 'Batchfile', 'bytes': '113'}, {'name': 'CSS', 'bytes': '215364'}, {'name': 'Java', 'bytes': '2098669'}, {'name': 'JavaScript', 'bytes': '1312338'}, {'name': 'PHP', 'bytes': '1193'}]}
In order to translate the labels of the families and attributes, as well as some few other things, you only need to create a standard Symfony translation file with the proper syntax. | WARNING | | ------- | | Data translation is done using [*EAV* context](09-context.md) | ### Translating Families The label of a family can be directly provided in the configuration of the family by setting the "label" configuration key. This is not recommended as it will not allow you to translate the attribute in multiple languages. The translation system will look for this keys in order to translate a family: ````yml eav: family: <family_code>: label: <label> ```` ### Translating Attributes The label of an attribute can be directly provided in the configuration of the attribute by setting the "label" configuration key. This is not recommended as it will not allow you to translate the attribute in multiple languages. The translation system will first look for this keys in order to translate an attribute: ````yml eav: family: <family_code>: attribute: <attribute_code>: label: <label> ```` However, if your attribute exists in multiple families and has the same label, you can use this syntax instead: ````yml eav: attribute: <attribute_code>: label: <label> ```` ### Translating error messages The following keys will be tested: ````yml eav: family: <family_code>: attribute: <attribute_code>: validation: <type>: <error_msg> eav: attribute: <attribute_code>: validation: <type>: <error_msg> eav: validation: <type>: <error_msg> ```` The following translations parameters will be available: - ````%attribute%````: The translated label of the attribute. - ````%family%````: The translated label of the family.
{'content_hash': 'f8a0e815459eb9d1844470c45af1fd57', 'timestamp': '', 'source': 'github', 'line_count': 71, 'max_line_length': 118, 'avg_line_length': 27.690140845070424, 'alnum_prop': 0.6495422177009156, 'repo_name': 'VincentChalnot/SidusEAVModelBundle', 'id': 'ca512ca1b4e7c65e4b2965c9ea74f21843dfcb63', 'size': '1997', 'binary': False, 'copies': '1', 'ref': 'refs/heads/v1.2-dev', 'path': 'Documentation/08-translate.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '14277'}, {'name': 'PHP', 'bytes': '371627'}]}
<html> <body> <xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" /> <!-- Include the VML behavior --> <style>v\: * { behavior:url(#default#VML); display:inline-block }</style> <!--p--> <v:shape id="rect01" style="HEIGHT:50px; LEFT:1px; TOP:1px; WIDTH:50px" coordsize = "200,200" fillcolor = "green" strokecolor = "green" path = "m1,1l1,200,200,200,200,1xe"/> <!--/p--> <script language="JavaScript" type="text/javascript"> <!-- //document.getElementById("rect01").onmouseover = Change; function Change() { rect01.fillColor = (rect01.fillColor == "red") ? "green" : (rect01.fillColor == "green") ? "blue" : "red"; } --> </script> </body> </html>
{'content_hash': '441a77285ee46cfe558d617a3a512135', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 73, 'avg_line_length': 28.32, 'alnum_prop': 0.6031073446327684, 'repo_name': 'doubleblacktech/learn-plumb', 'id': '110cc3191991610eecc4e02c1f52bbf5f0a6e9f5', 'size': '708', 'binary': False, 'copies': '18', 'ref': 'refs/heads/master', 'path': 'tests/miscellaneous/ie6-vml-mouseover.html', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '65950687'}]}
package org.vaadin.spring.i18n; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.UnsupportedEncodingException; import java.text.MessageFormat; import java.util.Locale; import java.util.MissingResourceException; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; /** * Implementation of {@link org.vaadin.spring.i18n.MessageProvider} that reads messages * from {@link java.util.ResourceBundle}s with a specific base name. * * @author Petter Holmström ([email protected]) */ public class ResourceBundleMessageProvider implements MessageProvider { private static final Logger LOGGER = LoggerFactory.getLogger(ResourceBundleMessageProvider.class); private final String baseName; private final String encoding; /** * Creates a new {@code ResourceBundleMessageProvider} with the given base name and UTF-8 encoding. * * @param baseName the base name to use, must not be {@code null}. */ public ResourceBundleMessageProvider(String baseName) { this(baseName, "UTF-8"); } /** * Creates a new {@code ResourceBundleMessageProvider} with the given base name and encoding. * * @param baseName the base name to use, must not be {@code null}. * @param encoding the encoding to use when reading the resource bundle, must not be {@code null}. */ public ResourceBundleMessageProvider(String baseName, String encoding) { this.baseName = baseName; this.encoding = encoding; } @Override public MessageFormat resolveCode(String s, Locale locale) { final ResourceBundle resourceBundle = getResourceBundle(locale); final String message = getString(resourceBundle, s); return getMessageFormat(message, locale); } private ResourceBundle getResourceBundle(Locale locale) { try { return ResourceBundle.getBundle(baseName, locale, new MessageControl()); } catch (MissingResourceException ex) { LOGGER.warn("No message bundle with basename [{}] found for locale [{}]", baseName, locale); return null; } } private String getString(ResourceBundle bundle, String s) { if (bundle == null) { return null; } try { return bundle.getString(s); } catch (MissingResourceException ex) { return null; } } private MessageFormat getMessageFormat(String message, Locale locale) { if (message == null) { return null; } return new MessageFormat(message, locale); } private class MessageControl extends ResourceBundle.Control { @Override public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws IllegalAccessException, InstantiationException, IOException { if ("java.properties".equals(format)) { final String resourceName = toResourceName(toBundleName(baseName, locale), "properties"); final InputStream stream = loader.getResourceAsStream(resourceName); if (stream == null) { return null; // Not found } Reader reader = null; try { reader = new InputStreamReader(stream, encoding); return new PropertyResourceBundle(reader); } catch (UnsupportedEncodingException ex) { stream.close(); throw ex; } finally { if (reader != null) { reader.close(); } } } else { return super.newBundle(baseName, locale, format, loader, reload); } } } }
{'content_hash': '02b7a0c49ffcee61d1c511f616cd85bd', 'timestamp': '', 'source': 'github', 'line_count': 111, 'max_line_length': 191, 'avg_line_length': 35.4054054054054, 'alnum_prop': 0.6399491094147582, 'repo_name': 'GJRTimmer/vaadin4spring', 'id': '4ecee6be5a613a67d1526d5bbe902c27d847beca', 'size': '4532', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'addons/i18n/src/main/java/org/vaadin/spring/i18n/ResourceBundleMessageProvider.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '665'}, {'name': 'Java', 'bytes': '353774'}]}
#include "../Precompiled.h" #include "../Math/MathDefs.h" #include "../Math/StringHash.h" #include <cstdio> #include "../DebugNew.h" namespace Urho3D { const StringHash StringHash::ZERO; StringHash::StringHash(const char* str) noexcept : value_(Calculate(str)) { } StringHash::StringHash(const String& str) noexcept : value_(Calculate(str.CString())) { } unsigned StringHash::Calculate(const char* str, unsigned hash) { if (!str) return hash; while (*str) { // Perform the actual hashing as case-insensitive char c = *str; hash = SDBMHash(hash, (unsigned char)tolower(c)); ++str; } return hash; } String StringHash::ToString() const { char tempBuffer[CONVERSION_BUFFER_LENGTH]; sprintf(tempBuffer, "%08X", value_); return String(tempBuffer); } }
{'content_hash': '0fcd3d919b139550937694076bcb75e2', 'timestamp': '', 'source': 'github', 'line_count': 49, 'max_line_length': 62, 'avg_line_length': 18.122448979591837, 'alnum_prop': 0.6081081081081081, 'repo_name': 'victorholt/Urho3D', 'id': '7a30f2e214ef14ac1b11dffc3f48ea0c807b8192', 'size': '2037', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'Source/Urho3D/Math/StringHash.cpp', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'AngelScript', 'bytes': '1435828'}, {'name': 'Batchfile', 'bytes': '16483'}, {'name': 'C++', 'bytes': '8325877'}, {'name': 'CMake', 'bytes': '446542'}, {'name': 'GLSL', 'bytes': '154112'}, {'name': 'HLSL', 'bytes': '178063'}, {'name': 'HTML', 'bytes': '1375'}, {'name': 'Java', 'bytes': '78624'}, {'name': 'Lua', 'bytes': '568614'}, {'name': 'MAXScript', 'bytes': '94704'}, {'name': 'Objective-C', 'bytes': '6539'}, {'name': 'Ruby', 'bytes': '65069'}, {'name': 'Shell', 'bytes': '27373'}]}
// This file was generated by St4mpede.Poco 2016-06-08 22:18:52 /* Reading xml C:\DATA\PROJEKT\St4mpede\St4mpede\St4mpede\RdbSchema\St4mpede.RdbSchema.xml. Read database with tables: Customer, Project, User. Included classes are: Name=Customer Name=Project Name=User Writing the output file C:\DATA\PROJEKT\St4mpede\St4mpede\St4mpede\Poco\PocoGenerator.xml. Writing 3 classes in C:\DATA\PROJEKT\St4mpede\St4mpede\St4mpede\..\..\TheDAL\Poco. */ // // // // // // // //
{'content_hash': '928c42c20fba38c6343e5ad8317a1a9f', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 90, 'avg_line_length': 21.727272727272727, 'alnum_prop': 0.7364016736401674, 'repo_name': 'LosManos/St4mpede', 'id': 'd431056b37b6b1b0534e5cbceb4481788390d7fb', 'size': '480', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'St4mpede/St4mpede/St4mpede.Poco.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '111411'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>classical-realizability: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.5.1 / classical-realizability - 8.7.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> classical-realizability <small> 8.7.0 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-07-19 14:21:56 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-07-19 14:21:56 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.12 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils coq 8.5.1 Formal proof management system. num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://github.com/coq-contribs/classical-realizability&quot; license: &quot;BSD&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/ClassicalRealizability&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.8~&quot;} ] tags: [ &quot;keyword: classical realizability&quot; &quot;keyword: Krivine&#39;s realizability&quot; &quot;keyword: primitive datatype&quot; &quot;keyword: non determinism&quot; &quot;keyword: quote&quot; &quot;keyword: axiom of countable choice&quot; &quot;keyword: real numbers&quot; &quot;category: Mathematics/Logic/Foundations&quot; ] authors: [ &quot;Lionel Rieg &lt;[email protected]&gt;&quot; ] bug-reports: &quot;https://github.com/coq-contribs/classical-realizability/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/classical-realizability.git&quot; synopsis: &quot;Krivine&#39;s classical realizability&quot; description: &quot;&quot;&quot; The aim of this Coq library is to provide a framework for checking proofs in Krivine&#39;s classical realizability for second-order Peano arithmetic. It is designed to be as extensible as the original theory by Krivine and to support on-the-fly extensions by new instructions with their evaluation rules.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/classical-realizability/archive/v8.7.0.tar.gz&quot; checksum: &quot;md5=6299c2ee7d52c1535eece3376983263c&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-classical-realizability.8.7.0 coq.8.5.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.5.1). The following dependencies couldn&#39;t be met: - coq-classical-realizability -&gt; coq &gt;= 8.7 Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-classical-realizability.8.7.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{'content_hash': '6953417c96203c08c70ca885216d50c6', 'timestamp': '', 'source': 'github', 'line_count': 168, 'max_line_length': 340, 'avg_line_length': 43.81547619047619, 'alnum_prop': 0.5651406058959381, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': '7a2fb7424f897c58b824ccbe499d4bd7f93f33f2', 'size': '7363', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.05.0-2.0.6/released/8.5.1/classical-realizability/8.7.0.html', 'mode': '33188', 'license': 'mit', 'language': []}
import React from 'react' import '!style!css!react-loading-bar/dist/index.css' export default function Loading() { return ( <div> <span className="fa fa-cog fa-spin fa-3x fa-fw" /> <span className="sr-only" aria-hidden="true">Loading...</span> </div> ) }
{'content_hash': '79f42d9ca7021bd62d432c1472260f62', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 68, 'avg_line_length': 27.9, 'alnum_prop': 0.6415770609318996, 'repo_name': 'moimikey/react-boilerplate', 'id': '0c6503845d209715b51d2b93dbf7650d78360700', 'size': '279', 'binary': False, 'copies': '1', 'ref': 'refs/heads/redux', 'path': 'src/app/components/Loading.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '4797'}, {'name': 'HTML', 'bytes': '3946'}, {'name': 'JavaScript', 'bytes': '29033'}]}
from __future__ import unicode_literals from django.conf import settings from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import models from django.dispatch.dispatcher import receiver from model_utils.models import TimeStampedModel from registration.signals import user_registered _all = ["Asset", "Profile", "user_registered_callback"] __author__ = "pmeier82" # PROFILE class Profile(models.Model): """user profile model""" class Meta: app_label = "base" user = models.OneToOneField( settings.AUTH_USER_MODEL, unique=True) title = models.CharField( max_length=255, default="", ) affiliation = models.CharField( max_length=255, default="", ) research_area = models.TextField( default="" ) # TODO: build a meaningful profile # special def __str__(self): return self.user.username def __unicode__(self): return unicode(self.__str__()) def user_registered_callback(user, request, **kwargs): profile, is_new = Profile.objects.get_or_create(user=user) profile.title = request.POST.get("title", "test") profile.save() user_registered.connect(user_registered_callback) # ASSET def UPLOAD_TO_HANDLER(obj, fname): folder = getattr(obj, "kind", "default") return "{}/{}".format(folder, fname) class Asset(TimeStampedModel): """generic file asset model""" class Meta: app_label = "base" UPLOAD_TO = "default" # fields name = models.CharField(max_length=255, unique=False) data_orig_name = models.CharField(max_length=255, unique=False) data = models.FileField(upload_to=UPLOAD_TO_HANDLER) kind = models.CharField(max_length=255, unique=False, null=False, default=UPLOAD_TO) # generic foreign key content_type = models.ForeignKey(ContentType, null=True) object_id = models.PositiveIntegerField(null=True) content_object = generic.GenericForeignKey() # special methods def __unicode__(self): return unicode("{}: {}".format(self.__class__.__name__, self.name)) # django special methods @models.permalink def get_absolute_url(self): return "asset:serve", (self.pk,), {} @models.permalink def get_delete_url(self): return "asset:delete", (self.pk,), {} # interface def save(self, *args, **kwargs): super(Asset, self).save(*args, **kwargs) def delete(self, *args, **kwargs): super(Asset, self).delete(*args, **kwargs) @receiver(models.signals.pre_delete, sender=Asset) def asset_file_delete(sender, instance, **kwargs): instance.data.delete() if __name__ == "__main__": pass
{'content_hash': '85f7dee85ba6de3d5a267ea68a913604', 'timestamp': '', 'source': 'github', 'line_count': 107, 'max_line_length': 88, 'avg_line_length': 25.757009345794394, 'alnum_prop': 0.6556603773584906, 'repo_name': 'pmeier82/spike_gnode', 'id': '2411abbf4b4c2c62fd144aaa9261d587c405219b', 'size': '2781', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'base/models.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '11360'}, {'name': 'HTML', 'bytes': '56070'}, {'name': 'JavaScript', 'bytes': '734'}, {'name': 'Nginx', 'bytes': '4758'}, {'name': 'Python', 'bytes': '37001'}, {'name': 'Shell', 'bytes': '2475'}]}
package org.eclipse.lsp4j; import java.util.List; import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.TextDocumentIdentifier; import org.eclipse.lsp4j.WorkDoneProgressAndPartialResultParams; import org.eclipse.lsp4j.jsonrpc.validation.NonNull; import org.eclipse.lsp4j.util.Preconditions; import org.eclipse.xtext.xbase.lib.Pure; import org.eclipse.xtext.xbase.lib.util.ToStringBuilder; /** * A parameter literal used in selection range requests. * <p> * Since 3.15.0 */ @SuppressWarnings("all") public class SelectionRangeParams extends WorkDoneProgressAndPartialResultParams { /** * The text document. */ @NonNull private TextDocumentIdentifier textDocument; /** * The positions inside the text document. */ @NonNull private List<Position> positions; public SelectionRangeParams() { } public SelectionRangeParams(@NonNull final TextDocumentIdentifier textDocument, @NonNull final List<Position> positions) { this.textDocument = Preconditions.<TextDocumentIdentifier>checkNotNull(textDocument, "textDocument"); this.positions = Preconditions.<List<Position>>checkNotNull(positions, "positions"); } /** * The text document. */ @Pure @NonNull public TextDocumentIdentifier getTextDocument() { return this.textDocument; } /** * The text document. */ public void setTextDocument(@NonNull final TextDocumentIdentifier textDocument) { this.textDocument = Preconditions.checkNotNull(textDocument, "textDocument"); } /** * The positions inside the text document. */ @Pure @NonNull public List<Position> getPositions() { return this.positions; } /** * The positions inside the text document. */ public void setPositions(@NonNull final List<Position> positions) { this.positions = Preconditions.checkNotNull(positions, "positions"); } @Override @Pure public String toString() { ToStringBuilder b = new ToStringBuilder(this); b.add("textDocument", this.textDocument); b.add("positions", this.positions); b.add("workDoneToken", getWorkDoneToken()); b.add("partialResultToken", getPartialResultToken()); return b.toString(); } @Override @Pure public boolean equals(final Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; if (!super.equals(obj)) return false; SelectionRangeParams other = (SelectionRangeParams) obj; if (this.textDocument == null) { if (other.textDocument != null) return false; } else if (!this.textDocument.equals(other.textDocument)) return false; if (this.positions == null) { if (other.positions != null) return false; } else if (!this.positions.equals(other.positions)) return false; return true; } @Override @Pure public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((this.textDocument== null) ? 0 : this.textDocument.hashCode()); return prime * result + ((this.positions== null) ? 0 : this.positions.hashCode()); } }
{'content_hash': '1fc19c21c3959ccaf37336d3bc383346', 'timestamp': '', 'source': 'github', 'line_count': 116, 'max_line_length': 124, 'avg_line_length': 27.396551724137932, 'alnum_prop': 0.6913152926368785, 'repo_name': 'smarr/SOMns-vscode', 'id': 'ca95621514251184457f1372dec09436068539dd', 'size': '3598', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'server/org.eclipse.lsp4j-gen/org/eclipse/lsp4j/SelectionRangeParams.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ANTLR', 'bytes': '12820'}, {'name': 'Java', 'bytes': '1782848'}, {'name': 'Shell', 'bytes': '182'}, {'name': 'Slash', 'bytes': '241'}, {'name': 'TypeScript', 'bytes': '26804'}, {'name': 'Vim Script', 'bytes': '3730'}, {'name': 'Xtend', 'bytes': '197426'}]}
package com.github.mortido.extra.behavioral.nullObject; public class NullUser extends User { @Override public String getName() { return "User doesn't exist"; } @Override public int getId() { return -1; } }
{'content_hash': '13680e8fb0ec1fd4f5088b9f8c0ac55a', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 55, 'avg_line_length': 19.076923076923077, 'alnum_prop': 0.625, 'repo_name': 'mortido/DesignPatterns-Java', 'id': '56cf92ed5e528869f70fcc4d8bd985ba8f3b2836', 'size': '248', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/com/github/mortido/extra/behavioral/nullObject/NullUser.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Java', 'bytes': '72591'}]}
import { Arr, Optional } from '@ephox/katamari'; import { SugarElement } from '@ephox/sugar'; import * as Structs from '../api/Structs'; import * as GridRow from '../model/GridRow'; import { CellElement, CompElm } from '../util/TableTypes'; type Subst = () => SugarElement<HTMLTableCellElement>; // substitution: () -> item const merge = (grid: Structs.RowCells[], bounds: Structs.Bounds, comparator: CompElm, substitution: Subst): Structs.RowCells[] => { const rows = GridRow.extractGridDetails(grid).rows; // Mutating. Do we care about the efficiency gain? if (rows.length === 0) { return grid; } for (let i = bounds.startRow; i <= bounds.finishRow; i++) { for (let j = bounds.startCol; j <= bounds.finishCol; j++) { // We can probably simplify this again now that we aren't reusing merge. const row = rows[i]; const isLocked = GridRow.getCell(row, j).isLocked; GridRow.mutateCell(row, j, Structs.elementnew(substitution(), false, isLocked)); } } return grid; }; // substitution: () -> item const unmerge = (grid: Structs.RowCells[], target: SugarElement<HTMLElement>, comparator: CompElm, substitution: Subst): Structs.RowCells[] => { const rows = GridRow.extractGridDetails(grid).rows; // Mutating. Do we care about the efficiency gain? let first = true; // tslint:disable-next-line:prefer-for-of for (let i = 0; i < rows.length; i++) { for (let j = 0; j < GridRow.cellLength(rows[0]); j++) { const row = rows[i]; const currentCell = GridRow.getCell(row, j); const currentCellElm = currentCell.element; const isToReplace = comparator(currentCellElm, target); if (isToReplace && !first) { GridRow.mutateCell(row, j, Structs.elementnew(substitution(), true, currentCell.isLocked)); } else if (isToReplace) { first = false; } } } return grid; }; const uniqueCells = <T extends CellElement>(row: Structs.ElementNew<T>[], comparator: CompElm): Structs.ElementNew<T>[] => { return Arr.foldl(row, (rest, cell) => { return Arr.exists(rest, (currentCell) => { return comparator(currentCell.element, cell.element); }) ? rest : rest.concat([ cell ]); }, [] as Structs.ElementNew<T>[]); }; const splitCols = (grid: Structs.RowCells[], index: number, comparator: CompElm, substitution: Subst): Structs.RowCells[] => { // We don't need to split rows if we're inserting at the first or last row of the old table if (index > 0 && index < grid[0].cells.length) { Arr.each(grid, (row) => { const prevCell = row.cells[index - 1]; let offset = 0; const substitute = substitution(); while (row.cells.length > index + offset && comparator(prevCell.element, row.cells[index + offset].element)) { GridRow.mutateCell(row, index + offset, Structs.elementnew(substitute, true, row.cells[index + offset].isLocked)); offset++; } }); } return grid; }; const splitRows = (grid: Structs.RowCells[], index: number, comparator: CompElm, substitution: Subst): Structs.RowCells[] => { // We don't need to split rows if we're inserting at the first or last row of the old table const rows = GridRow.extractGridDetails(grid).rows; if (index > 0 && index < rows.length) { const rowPrevCells = rows[index - 1].cells; const cells = uniqueCells(rowPrevCells, comparator); Arr.each(cells, (cell) => { // only make a sub when we have to let replacement = Optional.none<SugarElement<HTMLTableCellElement>>(); for (let i = index; i < rows.length; i++) { for (let j = 0; j < GridRow.cellLength(rows[0]); j++) { const row = rows[i]; const current = GridRow.getCell(row, j); const isToReplace = comparator(current.element, cell.element); if (isToReplace) { if (replacement.isNone()) { replacement = Optional.some(substitution()); } replacement.each((sub) => { GridRow.mutateCell(row, j, Structs.elementnew(sub, true, current.isLocked)); }); } } } }); } return grid; }; export { merge, unmerge, splitCols, splitRows };
{'content_hash': 'ca65adc511ae0aedbdd6e75bf700d63b', 'timestamp': '', 'source': 'github', 'line_count': 113, 'max_line_length': 144, 'avg_line_length': 37.13274336283186, 'alnum_prop': 0.6348903717826502, 'repo_name': 'tinymce/tinymce', 'id': '98e0abc2909ea0a3267c1a8d7d87f92f13e3584d', 'size': '4196', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'modules/snooker/src/main/ts/ephox/snooker/operate/MergingOperations.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '9733'}, {'name': 'HTML', 'bytes': '183264'}, {'name': 'JavaScript', 'bytes': '117530'}, {'name': 'Less', 'bytes': '182379'}, {'name': 'TypeScript', 'bytes': '11764279'}]}
<?xml version="1.0" encoding="utf-8"?> <config version="1" xmlns="http://skynav.com/ns/ttv"/>
{'content_hash': '6b3dadea3ba647025bc678e04d6487e0', 'timestamp': '', 'source': 'github', 'line_count': 2, 'max_line_length': 54, 'avg_line_length': 47.0, 'alnum_prop': 0.648936170212766, 'repo_name': 'RBMHTechnology/ttt', 'id': 'af62bb6ae91ead9584202716b1b01ca7703b5c03', 'size': '94', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'ttt-ttv/src/main/resources/com/skynav/ttv/app/config.xml', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'CSS', 'bytes': '22996'}, {'name': 'HTML', 'bytes': '2348'}, {'name': 'Java', 'bytes': '2833329'}, {'name': 'Shell', 'bytes': '2808'}, {'name': 'XSLT', 'bytes': '5232'}]}
from __future__ import print_function from __future__ import unicode_literals from __future__ import division import json from django.conf import settings from django.contrib.gis.geos import Polygon from django.core.urlresolvers import reverse from django.db import transaction from django.db.models import Q from django.http import HttpResponseRedirect, HttpResponseForbidden, Http404 from django.shortcuts import get_object_or_404 from django.utils.timezone import now from libs.data import merge from libs.formatters import humanize_bytes from libs.pdf_maps import create_event_map_pdf from libs.sql import get_group_tree_count from apps.core.helpers import (user_is_group_admin, user_is_eligible_to_become_trusted_mapper) from apps.core.decorators import group_request from apps.core.models import Group from apps.mail.views import notify_group_mapping_approved from apps.users.models import Follow, TrustedMapper from apps.users.forms import GroupSettingsForm from apps.survey.models import Territory, Survey, Blockface from apps.survey.layer_context import (get_context_for_territory_layer, get_context_for_territory_admin_layer) from apps.event.models import Event, EventRegistration from apps.event.event_list import EventList GROUP_EVENTS_ID = 'group-events' GROUP_EDIT_EVENTS_TAB_ID = 'events' def group_list_page(request): # TODO: pagination groups = Group.objects.filter(is_active=True).order_by('name') group_ids = Follow.objects.filter(user_id=request.user.id) \ .values_list('group_id', flat=True) user_is_following = [group.id in group_ids for group in groups] group_infos = zip(groups, user_is_following) return { 'groups': group_infos, 'groups_count': len(group_infos), } @group_request def _group_events(request): qs = Event.objects.filter(group=request.group, is_private=False) user_can_edit_group = user_is_group_admin(request.user, request.group) extra_context = {'user_can_edit_group': user_can_edit_group, 'group_slug': request.group.slug} return qs, extra_context group_detail_events = EventList( _group_events, name="group_detail_events", template_path='groups/partials/detail_event_list.html') group_edit_events = EventList( _group_events, name="group_edit_events", template_path='groups/partials/edit_event_list.html') def group_detail(request): user = request.user group = request.group if not user_is_group_admin(user, group) and not request.group.is_active: raise Http404('Must be a group admin to view an inactive group') event_list = (group_detail_events .configure(chunk_size=2, active_filter=EventList.Filters.CURRENT, filterset_name=EventList.chronoFilters) .as_context(request, group_slug=group.slug)) user_is_following = Follow.objects.filter(user_id=request.user.id, group=group).exists() show_mapper_request = user_is_eligible_to_become_trusted_mapper(user, group) follow_count = Follow.objects.filter(group=group).count() tree_count = get_group_tree_count(group) group_blocks = Territory.objects \ .filter(group=group) \ .values_list('blockface_id', flat=True) group_blocks_count = group_blocks.count() if group_blocks_count > 0: completed_blocks = Survey.objects \ .filter(blockface_id__in=group_blocks) \ .distinct('blockface') block_percent = "{:.1%}".format( float(completed_blocks.count()) / float(group_blocks.count())) else: block_percent = "0.0%" events_held = Event.objects.filter(group=group, ends_at__lt=now()) num_events_held = events_held.count() num_event_attendees = EventRegistration.objects \ .filter(event__in=events_held) \ .filter(did_attend=True) \ .count() return { 'group': group, 'event_list': event_list, 'user_is_following': user_is_following, 'edit_url': reverse('group_edit', kwargs={'group_slug': group.slug}), 'show_mapper_request': show_mapper_request, 'counts': { 'tree': tree_count, 'block': block_percent, 'event': num_events_held, 'attendees': num_event_attendees, 'follows': follow_count }, 'group_events_id': GROUP_EVENTS_ID, 'layer': get_context_for_territory_layer(request, request.group.id), 'territory_bounds': _group_territory_bounds(request.group), 'render_follow_button_without_count': request.POST.get( 'render_follow_button_without_count', False) } def redirect_to_group_detail(request): return HttpResponseRedirect( reverse('group_detail', kwargs={ 'group_slug': request.group.slug })) def _group_territory_bounds(group): blockfaces = Blockface.objects \ .filter(territory__group=group) \ .collect() if blockfaces: return list(blockfaces.extent) else: return None def edit_group(request, form=None): group = request.group if not form: form = GroupSettingsForm(instance=request.group, label_suffix='') event_list = (group_edit_events .configure(chunk_size=2, active_filter=EventList.Filters.CURRENT, filterset_name=EventList.chronoFilters) .as_context(request, group_slug=group.slug)) pending_mappers = TrustedMapper.objects.filter(group=request.group, is_approved__isnull=True) all_mappers = TrustedMapper.objects.filter(group=request.group, is_approved__isnull=False) return { 'group': group, 'event_list': event_list, 'form': form, 'group_slug': group.slug, 'max_image_size': humanize_bytes( settings.MAX_GROUP_IMAGE_SIZE_IN_BYTES, 0), 'pending_mappers': pending_mappers, 'all_mappers': all_mappers, 'group_edit_events_tab_id': GROUP_EDIT_EVENTS_TAB_ID, } def update_group_settings(request): form = GroupSettingsForm(request.POST, request.FILES, instance=request.group) if form.is_valid(): form.save() return HttpResponseRedirect(request.group.get_absolute_url()) else: return edit_group(request, form=form) def follow_group(request): Follow.objects.get_or_create(user_id=request.user.id, group=request.group) return group_detail(request) def unfollow_group(request): Follow.objects.filter(user_id=request.user.id, group=request.group) \ .delete() return group_detail(request) def start_group_map_print_job(request): # TODO: implement pass def give_user_mapping_priveleges(request, username): mapper_context = _grant_mapping_access(request.group, username, is_approved=True) mail_context = notify_group_mapping_approved(request, request.group, username) return merge(mapper_context, mail_context) def remove_user_mapping_priveleges(request, username): return _grant_mapping_access(request.group, username, is_approved=False) def _grant_mapping_access(group, username, is_approved): mapper, created = TrustedMapper.objects.update_or_create( group=group, user__username=username, defaults={'is_approved': is_approved}) return { 'mapper': mapper } def request_mapper_status(request): user, group = request.user, request.group if not user_is_eligible_to_become_trusted_mapper(user, group): return HttpResponseForbidden() mapper, created = TrustedMapper.objects.update_or_create( group=group, user=user) return { 'success': True } def group_unmapped_territory_geojson(request, group_id): # Get unmapped blockfaces blockfaces = Blockface.objects.filter(is_available=True) my_territory_q = Q(territory__group_id=group_id) if request.body: # Get potentially selectable blockfaces in polygon # (those in my territory or unclaimed) point_list = json.loads(request.body) point_list.append(point_list[0]) # Close the polygon polygon = Polygon((point_list)) no_reservations_q = \ Q(blockfacereservation__isnull=True) \ | Q(blockfacereservation__canceled_at__isnull=False) \ | Q(blockfacereservation__expires_at__lt=now()) nobodys_territory_q = Q(territory__group_id=None) unclaimed_q = no_reservations_q & nobodys_territory_q blockfaces = blockfaces \ .filter(geom__within=polygon) \ .filter(my_territory_q | unclaimed_q) \ .distinct() # Return just blockface data # (skipping expensive queries to make tiler URLs) return _make_blockface_data_result(blockfaces) else: # Get all blockfaces in group's territory blockfaces = blockfaces.filter(my_territory_q) return _make_blockface_and_tiler_urls_result( request, blockfaces, group_id) def group_update_territory(request, group_id): group = get_object_or_404(Group, id=group_id) _update_territory(group, request) # Recreate PDF maps to show updated group territory _update_event_maps(request, group) result_blockfaces = Blockface.objects.filter(territory__group=group) return _make_blockface_and_tiler_urls_result( request, result_blockfaces, group_id) @transaction.atomic def _update_territory(group, request): new_block_ids = set([int(id) for id in json.loads(request.body)]) old_block_ids = set(Territory.objects .filter(group=group) .values_list('blockface_id', flat=True)) ids_to_add = new_block_ids - old_block_ids ids_to_kill = old_block_ids - new_block_ids # Make sure no unavailable or already-assigned blocks slipped in filtered_ids_to_add = Blockface.objects \ .filter(id__in=ids_to_add) \ .filter(is_available=True) \ .filter(territory=None) \ .values_list('id', flat=True) new_territory = [Territory(group=group, blockface_id=id) for id in filtered_ids_to_add] Territory.objects.bulk_create(new_territory) Territory.objects \ .filter(blockface_id__in=ids_to_kill) \ .delete() def _update_event_maps(request, group): events = Event.objects \ .filter(group_id=group.id, begins_at__gt=now()) \ .select_related('group') for event in events: create_event_map_pdf(request, event) def _make_blockface_and_tiler_urls_result(request, blockfaces, group_id): result = { 'blockDataList': _make_blockface_data_result(blockfaces), 'tilerUrls': get_context_for_territory_admin_layer(request, group_id) } return result def _make_blockface_data_result(blockfaces): block_data_list = [{'id': bf.id, 'geojson': bf.geom.json} for bf in blockfaces] return block_data_list
{'content_hash': '245a3f944cd4eac948a49263f01aee37', 'timestamp': '', 'source': 'github', 'line_count': 336, 'max_line_length': 78, 'avg_line_length': 34.25595238095238, 'alnum_prop': 0.635881841876629, 'repo_name': 'RickMohr/nyc-trees', 'id': '0430d00d3c50a470409f54b8f021ae97848c2ee7', 'size': '11534', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'src/nyc_trees/apps/users/views/group.py', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '171372'}, {'name': 'CartoCSS', 'bytes': '878'}, {'name': 'HTML', 'bytes': '157969'}, {'name': 'JavaScript', 'bytes': '286316'}, {'name': 'Makefile', 'bytes': '1524'}, {'name': 'PLpgSQL', 'bytes': '3210'}, {'name': 'Python', 'bytes': '404021'}, {'name': 'Shell', 'bytes': '23399'}]}
function configure() { # List n-application using most space # @param $1|size number of biggest application to list # @return void function du-app() { size="${1:-10}" dpkg-query --show --showformat="\${Package;-50}\t\${Installed-Size}\n" \ | sort -k 2 -n \ | grep -v deinstall \ | awk '{printf "%.1f MB \t %s\n", $2/(1024), $1}' \ | tail -n "$size" } # human-readable sizes function df() { command df \ --human-readable \ --print-type \ --exclude-type squashfs \ --exclude-type tmpfs \ --exclude-type devtmpfs \ "$@" } # show sizes in MB function free() { command free -m; } } configure
{'content_hash': '73da57189a7a28882b91e1fe9a32a92a', 'timestamp': '', 'source': 'github', 'line_count': 28, 'max_line_length': 80, 'avg_line_length': 27.357142857142858, 'alnum_prop': 0.49216710182767626, 'repo_name': 'edouard-lopez/dotfiles', 'id': '4d9fd2c0bf074292bae2b10a9a53a4d841befd56', 'size': '787', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'includes/posix/monitoring.bash', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '63'}, {'name': 'Shell', 'bytes': '38660'}, {'name': 'Vim Script', 'bytes': '5525'}]}
package org.ops4j.pax.exam.sample2.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.Table; @Entity @Table(name = "rating") public class Rating { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; private int stars; @Lob private String comment; @ManyToOne private User user; @ManyToOne private Movie movie; /** * @return the id */ public int getId() { return id; } /** * @param id * the id to set */ public void setId(int id) { this.id = id; } /** * @return the stars */ public int getStars() { return stars; } /** * @param stars * the stars to set */ public void setStars(int stars) { this.stars = stars; } /** * @return the comment */ public String getComment() { return comment; } /** * @param comment * the comment to set */ public void setComment(String comment) { this.comment = comment; } /** * @return the user */ public User getUser() { return user; } /** * @param user * the user to set */ public void setUser(User user) { this.user = user; } /** * @return the movie */ public Movie getMovie() { return movie; } /** * @param movie * the movie to set */ public void setMovie(Movie movie) { this.movie = movie; } }
{'content_hash': '4901789fd2534feffdc9e9d6efb0ceb9', 'timestamp': '', 'source': 'github', 'line_count': 104, 'max_line_length': 51, 'avg_line_length': 17.009615384615383, 'alnum_prop': 0.5313736574335783, 'repo_name': 'bimargulies/org.ops4j.pax.exam2', 'id': '0188ac1c47c0896fbf7d103e1a14246e8d489d25', 'size': '2379', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'samples/pax-exam-sample2-model/src/main/java/org/ops4j/pax/exam/sample2/model/Rating.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '1271799'}, {'name': 'Shell', 'bytes': '198'}]}
// // MODULE: JdbcDebug.cpp // #include "org_apache_trafodion_jdbc_t2_JdbcDebug.h" #include "Debug.h" /* * Class: org_apache_trafodion_jdbc_t2_JdbcDebug * Method: getDebugHandle * Signature: (I)I */ JNIEXPORT jlong JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_getDebugHandle(JNIEnv *jenv, jclass jcls, jlong method_name_handle) { jlong handle = 0; #if defined(_BENCHMARK) handle = (jlong) new Benchmark((const char *) method_name_handle); #endif /* _BENCHMARK */ return(handle); } /* * Class: org_apache_trafodion_jdbc_t2_JdbcDebug * Method: getMethodNameHandle * Signature: (Ljava/lang/String;)I */ JNIEXPORT jlong JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_getMethodNameHandle(JNIEnv *jenv, jclass jcls, jstring method_name) { jlong rc = 0; #if defined(_DEBUG) || defined(_BENCHMARK) if (method_name) rc = (jlong) jenv->GetStringUTFChars(method_name,NULL); if (rc==0) rc = (jlong) "Unknown"; #endif /* _DEBUG || _BENCHMARK */ return(rc); } /* * Class: org_apache_trafodion_jdbc_t2_JdbcDebug * Method: methodEntry * Signature: (III)V */ JNIEXPORT void JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_methodEntry(JNIEnv *jenv, jclass jcls, jlong debug_handle, jint debug_level, jlong method_name_handle) { #if defined(_DEBUG) DebugFunctionEntry((const char *) method_name_handle, debug_level, NULL , NULL, 0); #endif /* _DEBUG */ #if defined(_BENCHMARK) ((Benchmark *) debug_handle)->Entry(); #endif /* _BENCHMARK */ } /* * Class: org_apache_trafodion_jdbc_t2_JdbcDebug * Method: methodReturn * Signature: (ILjava/lang/String;)V */ JNIEXPORT void JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_methodReturn(JNIEnv *jenv, jclass jcls, jlong debug_handle, jstring comment) { #if defined(_DEBUG) const char *commentStr; if (comment) commentStr = jenv->GetStringUTFChars(comment,NULL); else commentStr = NULL; DebugFunctionReturn("JAVA", commentStr, false, "RETURNING", NULL, 0); if (commentStr) jenv->ReleaseStringUTFChars(comment,commentStr); #endif /* _DEBUG */ } /* * Class: org_apache_trafodion_jdbc_t2_JdbcDebug * Method: methodExit * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_methodExit(JNIEnv *jenv, jclass jcls, jlong debug_handle) { #if defined(_DEBUG) DebugFunctionReturn("JAVA", NULL, true, "EXITING", NULL, 0); #endif /* _DEBUG */ #if defined(_BENCHMARK) ((Benchmark *) debug_handle)->Exit(); #endif /* _BENCHMARK */ } /* * Class: org_apache_trafodion_jdbc_t2_JdbcDebug * Method: traceOut * Signature: (IILjava/lang/String;)V */ JNIEXPORT void JNICALL Java_org_apache_trafodion_jdbc_t2_JdbcDebug_traceOut(JNIEnv *jenv, jclass jcls, jlong debug_handle, jint debug_level, jstring comment) { #if defined(_DEBUG) const char *commentStr; if (comment) commentStr = jenv->GetStringUTFChars(comment,NULL); else commentStr = NULL; if (DebugActive(debug_level,NULL,0)) DebugOutput(commentStr , NULL, 0); if (commentStr) jenv->ReleaseStringUTFChars(comment,commentStr); #endif /* _DEBUG */ }
{'content_hash': '1abd718dce3bc752ab0955f9348f9b61', 'timestamp': '', 'source': 'github', 'line_count': 109, 'max_line_length': 114, 'avg_line_length': 29.853211009174313, 'alnum_prop': 0.6717885679164106, 'repo_name': 'mashengchen/incubator-trafodion', 'id': '25ae2a001185445481545ef9e80b702621cbfedb', 'size': '4264', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'core/conn/jdbc_type2/native/JdbcDebug.cpp', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': '1C Enterprise', 'bytes': '27762'}, {'name': 'Awk', 'bytes': '20971'}, {'name': 'Batchfile', 'bytes': '27013'}, {'name': 'C', 'bytes': '18877152'}, {'name': 'C++', 'bytes': '68786466'}, {'name': 'CSS', 'bytes': '99092'}, {'name': 'GDB', 'bytes': '62692'}, {'name': 'Groff', 'bytes': '46673'}, {'name': 'HTML', 'bytes': '4618'}, {'name': 'Inno Setup', 'bytes': '14579'}, {'name': 'Java', 'bytes': '12232679'}, {'name': 'JavaScript', 'bytes': '883279'}, {'name': 'LLVM', 'bytes': '42952'}, {'name': 'Makefile', 'bytes': '321639'}, {'name': 'Objective-C', 'bytes': '637659'}, {'name': 'PHP', 'bytes': '8438'}, {'name': 'PLpgSQL', 'bytes': '197622'}, {'name': 'Perl', 'bytes': '549860'}, {'name': 'Protocol Buffer', 'bytes': '121282'}, {'name': 'Python', 'bytes': '330201'}, {'name': 'QMake', 'bytes': '3622'}, {'name': 'Ruby', 'bytes': '8053'}, {'name': 'SQLPL', 'bytes': '60330'}, {'name': 'Shell', 'bytes': '1999068'}, {'name': 'Tcl', 'bytes': '2763'}, {'name': 'XSLT', 'bytes': '6100'}, {'name': 'Yacc', 'bytes': '1368077'}]}
package com.alibaba.dubbo.common.serialize.support.java; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import com.alibaba.dubbo.common.URL; import com.alibaba.dubbo.common.serialize.ObjectInput; import com.alibaba.dubbo.common.serialize.ObjectOutput; import com.alibaba.dubbo.common.serialize.Serialization; /** * @author ding.lid */ public class CompactedJavaSerialization implements Serialization { public byte getContentTypeId() { return 4; } public String getContentType() { return "x-application/compactedjava"; } public ObjectOutput serialize(URL url, OutputStream out) throws IOException { return new JavaObjectOutput(out, true); } public ObjectInput deserialize(URL url, InputStream is) throws IOException { return new JavaObjectInput(is, true); } }
{'content_hash': '51165a6abb524dd739da671e283beb68', 'timestamp': '', 'source': 'github', 'line_count': 34, 'max_line_length': 81, 'avg_line_length': 25.61764705882353, 'alnum_prop': 0.7416762342135477, 'repo_name': 'kaven12/dubboo', 'id': 'f0a0f0a249f804c6984b2925e343fb0702f0600c', 'size': '1480', 'binary': False, 'copies': '20', 'ref': 'refs/heads/master', 'path': 'dubbo-common/src/main/java/com/alibaba/dubbo/common/serialize/support/java/CompactedJavaSerialization.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '3343'}, {'name': 'CSS', 'bytes': '18582'}, {'name': 'Java', 'bytes': '5237817'}, {'name': 'JavaScript', 'bytes': '63151'}, {'name': 'Lex', 'bytes': '2077'}, {'name': 'Shell', 'bytes': '7011'}, {'name': 'Thrift', 'bytes': '668'}]}
package com.jxd.android.bookinventtory.bean; import io.realm.RealmModel; import io.realm.RealmObject; import io.realm.annotations.RealmClass; /** * 图书盘点 * Created by Administrator on 2017/10/17. */ @RealmClass public class ShelfBookScanBean implements RealmModel { private String title; private String barcode; private String shelfno; private String updatetime; private String uid; private String callno; private int inshelf; private String status; private String machine_mac; /** * 盘点状态 */ private String scanStatus; public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getBarcode() { return barcode; } public void setBarcode(String barcode) { this.barcode = barcode; } public String getShelfno() { return shelfno; } public void setShelfno(String shelfno) { this.shelfno = shelfno; } public String getUpdatetime() { return updatetime; } public void setUpdatetime(String updatetime) { this.updatetime = updatetime; } public String getUid() { return uid; } public void setUid(String uid) { this.uid = uid; } public String getCallno() { return callno; } public void setCallno(String callno) { this.callno = callno; } public int getInshelf() { return inshelf; } public void setInshelf(int inshelf) { this.inshelf = inshelf; } public String getMachine_mac() { return machine_mac; } public void setMachine_mac(String machine_mac) { this.machine_mac = machine_mac; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getScanStatus() { return scanStatus; } public void setScanStatus(String scanStatus) { this.scanStatus = scanStatus; } public void transfor(BookBean bookBean){ this.setBarcode( bookBean.getBarcode() ); this.setCallno(bookBean.getCallno()); this.setInshelf(bookBean.getInshelf()); this.setMachine_mac(bookBean.getMachine_mac()); this.setTitle(bookBean.getTitle()); this.setUid(bookBean.getUid()); this.setShelfno(bookBean.getShelfno()); this.setStatus( bookBean.getStatus() ); this.setUpdatetime(bookBean.getUpdatetime()); } @Override public int hashCode() { return super.hashCode(); } @Override public boolean equals(Object obj) { return super.equals(obj); } }
{'content_hash': '1cc8e2853ac762829180de45eeec8132', 'timestamp': '', 'source': 'github', 'line_count': 130, 'max_line_length': 55, 'avg_line_length': 21.0, 'alnum_prop': 0.6201465201465202, 'repo_name': 'jxdong1013/bookinventory', 'id': '577e0a27b8901851282783433ef072283019b34b', 'size': '2746', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/android/bookinventory/app/src/main/java/com/jxd/android/bookinventtory/bean/ShelfBookScanBean.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ASP', 'bytes': '98'}, {'name': 'C#', 'bytes': '199875'}, {'name': 'CSS', 'bytes': '21629'}, {'name': 'HTML', 'bytes': '6682'}, {'name': 'Java', 'bytes': '261073'}, {'name': 'JavaScript', 'bytes': '438316'}, {'name': 'PowerShell', 'bytes': '112665'}]}
#include "../../inc/MarlinConfig.h" #if HAS_M206_COMMAND #include "../gcode.h" #include "../../module/motion.h" #include "../../lcd/marlinui.h" #include "../../libs/buzzer.h" #include "../../MarlinCore.h" void M206_report() { SERIAL_ECHOLNPAIR_P( LIST_N(DOUBLE(LINEAR_AXES), PSTR("M206 X"), home_offset.x, SP_Y_STR, home_offset.y, SP_Z_STR, home_offset.z, SP_I_STR, home_offset.i, SP_J_STR, home_offset.j, SP_K_STR, home_offset.k, ) ); } /** * M206: Set Additional Homing Offset (X Y Z). SCARA aliases T=X, P=Y * * *** @thinkyhead: I recommend deprecating M206 for SCARA in favor of M665. * *** M206 for SCARA will remain enabled in 1.1.x for compatibility. * *** In the 2.0 release, it will simply be disabled by default. */ void GcodeSuite::M206() { LOOP_LINEAR_AXES(i) if (parser.seen(AXIS_CHAR(i))) set_home_offset((AxisEnum)i, parser.value_linear_units()); #if ENABLED(MORGAN_SCARA) if (parser.seen('T')) set_home_offset(A_AXIS, parser.value_float()); // Theta if (parser.seen('P')) set_home_offset(B_AXIS, parser.value_float()); // Psi #endif if (!parser.seen(LINEAR_AXIS_GANG("X", "Y", "Z", "I", "J", "K"))) M206_report(); else report_current_position(); } /** * M428: Set home_offset based on the distance between the * current_position and the nearest "reference point." * If an axis is past center its endstop position * is the reference-point. Otherwise it uses 0. This allows * the Z offset to be set near the bed when using a max endstop. * * M428 can't be used more than 2cm away from 0 or an endstop. * * Use M206 to set these values directly. */ void GcodeSuite::M428() { if (homing_needed_error()) return; xyz_float_t diff; LOOP_LINEAR_AXES(i) { diff[i] = base_home_pos((AxisEnum)i) - current_position[i]; if (!WITHIN(diff[i], -20, 20) && home_dir((AxisEnum)i) > 0) diff[i] = -current_position[i]; if (!WITHIN(diff[i], -20, 20)) { SERIAL_ERROR_MSG(STR_ERR_M428_TOO_FAR); LCD_ALERTMESSAGEPGM_P(PSTR("Err: Too far!")); BUZZ(200, 40); return; } } LOOP_LINEAR_AXES(i) set_home_offset((AxisEnum)i, diff[i]); report_current_position(); LCD_MESSAGEPGM(MSG_HOME_OFFSETS_APPLIED); BUZZ(100, 659); BUZZ(100, 698); } #endif // HAS_M206_COMMAND
{'content_hash': 'd5f7b1a89aaf43eebda85cc3e0a7bc6e', 'timestamp': '', 'source': 'github', 'line_count': 83, 'max_line_length': 82, 'avg_line_length': 28.771084337349397, 'alnum_prop': 0.6134840871021775, 'repo_name': 'limtbk/3dprinting', 'id': '51f3e7c14c049e582236c468f1a1c40acf5e4c5a', 'size': '3249', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Firmware/src/Marlin/src/gcode/geometry/M206_M428.cpp', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '16427042'}, {'name': 'C++', 'bytes': '1508812'}, {'name': 'Makefile', 'bytes': '58317'}, {'name': 'Objective-C', 'bytes': '195319'}, {'name': 'Processing', 'bytes': '407203'}, {'name': 'Python', 'bytes': '11892'}, {'name': 'Scilab', 'bytes': '10211'}]}
/* A helper function to diagram all routes in a `fluid.express` instance. */ "use strict"; var fluid = fluid || require("infusion"); fluid.registerNamespace("fluid.test.express"); /** * * Diagram all routes within an express instance. * * @param {Object} expressComponent - A `fluid.express` component. * @return {Object} A JSON Object representing all routes within a `fluid.express` instance. * */ fluid.test.express.diagramAllRoutes = function (expressComponent) { return fluid.test.express.diagramOneLevel(expressComponent, expressComponent.router._router); }; /** * * Diagram the routes for a single component. To preserve the routing order of the stack, each level's children * are represented in a `children` Array. * * @param {Object} component - A `fluid.express.middleware` component. * @param {Object} router - The router instance within the component (if there is one). * @return {Object} A JSON Object representing the routes from this level down as well as the method and path for this level. */ fluid.test.express.diagramOneLevel = function (component, router) { var thisLevel = fluid.filterKeys(component.options, ["method", "path"]); thisLevel.typeName = component.typeName; if (router) { thisLevel.children = fluid.transform(router.stack, function (layer) { // This is a `fluid.express.router` instance if (layer.handle && layer.handle.that) { return fluid.test.express.diagramOneLevel(layer.handle.that, layer.handle.that.router); } // This is a `fluid.express.middleware` instance else if (layer.route) { var wrapper = fluid.filterKeys(layer.route, ["path", "methods"]); wrapper.children = fluid.transform(layer.route.stack, function (middlewareLayer) { return fluid.test.express.diagramOneLevel(middlewareLayer.handle.that, middlewareLayer.handle.that.router); }); return wrapper; } // This is something outside of our scope (i.e. native middleware). else { return "Native middleware '" + (layer.name || "unknown") + "'"; } }); } return thisLevel; };
{'content_hash': '1e7085b56a339027cd32730d523f680f', 'timestamp': '', 'source': 'github', 'line_count': 59, 'max_line_length': 127, 'avg_line_length': 38.389830508474574, 'alnum_prop': 0.6512141280353201, 'repo_name': 'GPII/gpii-express', 'id': '34a60008e12253be09206b56a5d1c3b76b4d7c29', 'size': '2265', 'binary': False, 'copies': '2', 'ref': 'refs/heads/main', 'path': 'tests/js/lib/diagramAllRoutes.js', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'HTML', 'bytes': '214'}, {'name': 'JavaScript', 'bytes': '208501'}]}
package com.lru.memory.disk.cache; /** * * @author sathayeg */ public interface DirLocate { public String getPathToFile(String key) throws Exception; public boolean isDiskPersistent(); }
{'content_hash': '3f8be3bb0d892f5fdc57eeeaa392bc41', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 61, 'avg_line_length': 20.0, 'alnum_prop': 0.72, 'repo_name': 'gaurangsathaye/JavaSimpleCache', 'id': '00f1f658cb5c38b6e518eccef7f979c9316fdd38', 'size': '200', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/lru/memory/disk/cache/DirLocate.java', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <style> .button { background-color: #FA58F4; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; } .button1 {background-color: #D315BC ;} .button2 {background-color: #EA4ED7 ;} .button3 {background-color: #D315BC ; color: black;} .button4 {background-color: #EA4ED7 ;} .button5{background-color: #D315BC ; color: black;} .button6{background-color: #EA4ED7 ;} .button7{background-color: #D315BC ;} .button8{background-color: #EA4ED7 ;} .button9{background-color: #D315BC ;} </style> <title>Класификација</title> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/mk_MK/sdk.js#xfbml=1&version=v2.9"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fenster"> <a href="./klasifikacija.html"><img src="klasss Kopie.jpg" height="500" width="100%" style="float:left"></a> </div> <button class="button button1"><a href="./pochetna.html"><font color="black">Почетна</font></a></button> <button class="button button2"><a href="./zakancerot.html"><font color="black">За канцерот</font></a></button> <button class="button button3"><a href="./stadiumi.html"><font color="black">Хемотерапија</font></a></button> <button class="button button4"><a href="./recepti.html"><font color="black">Рецепти</font></a></button> <button class="button button5"><a href="./dieti.html"><font color="black">Исхрана</font></a></button> <button class="button button6"><a href="./soveti.html"><font color="black">Совети</font></a></button> <button class="button button7"><a href="./bolnici.html"><font color="black"</font>Болници</a></button> <button class="button button8"><a href="./Donacii.html"><font color="black">Донации</font></a></button> <button class="button button9"><a href="./lekovi.html"><font color="black">Лекови</font></a></button> <p><i><font size="4" color="black"><b>Видовите на рак се класифицираат според видот на клетки кои наликуваат на тумор, и според тоа, на ткивото за кое се претпоставува дека е зачеток на туморот. Подолу е хистологијата и местоположбата на видовите рак. Примери за неколку општи категории се: Карцином: Малигни тумори кои потекнуваат од епителни клетки. Во оваа група припаѓаат најчестите видови на рак, вклучувајќи ги ракот на дојката, простатата, белите дробови и дебелото црево. Сарком: Малигни тумори кои потекнуваат од сврзните ткива, или мезенхималните клетки. Лимфом и леукемија: Малигноми кои потекнуваат од хематопоетските (крвотворните) клетки Бактериски рак: Тумори кои потекнуваат од тотипотентните клетки. Кај возрасните најчесто може да се најде во тестисите и јајчниците, додека кај фетусите, бебињата и малите деца најчесто се наоѓаат во средишниот дел на телото, на врвот на опашната коска, а кај коњите во основата на черепот. Бластен тумор или бластом: Тумор (обично малигнен) кој наликува на незрело или ембрионско ткиво. Овие тумори се најчести кај децата. тумори (видови рак) обично се именуваат користејќи –карцином, -сарком или –бластом како суфикс, и латинскиот или грчкиот збор за органот од кој потекнуваат како корен на името. На пример, ракот на црниот дроб се нарекува хепатокарцином, ракот на масните клетки- липосарком итн. Бенигните тумори (кои не се рак) се именуваат користејќи –ом како суфикс, и името на органот како корен. На пример, бенигнен тумор на мазната мускулатура на матката се нарекува леиомиом (почест израз за овој вид тумор е фиброид). За жал, и некои видови рак го користат суфиксот –ом, како што е случајот со меланом и семином </font></i></p></b> <iframe width="70%" height="500" src="https://www.youtube.com/embed/72-2Bumwyh0" frameborder="0" allowfullscreen></iframe> <div class="fb-comments" data-href="http://127.0.0.1:8020/borbaprotivkancerot/klasifikacija.html" data-numposts="5"></div> </body> </html>
{'content_hash': '5fe8f5d153cd27a362025ba442a3f87d', 'timestamp': '', 'source': 'github', 'line_count': 92, 'max_line_length': 140, 'avg_line_length': 45.84782608695652, 'alnum_prop': 0.7159791370317686, 'repo_name': 'majaradichevich/majaradichevich.github.io', 'id': '7ed025a1c9e8db3faad7a92693291f6f197a9621', 'size': '5642', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'klasifikacija.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '6042'}, {'name': 'HTML', 'bytes': '185244'}, {'name': 'JavaScript', 'bytes': '11231'}]}
<h2>Installing XFramework Generator</h2> <p>You don't need to download the source code from the repo, create all the necessary files for the web app, writing two thousands line of code just to create a <code>Hello world!</code> app. XFramework Generator can make everything for you.</p> <p>XF Generator has a number of dependencies such as:</p> <ul> <li><a href="http://nodejs.org">node.js</a></li> <li><a href="https://npmjs.org">NPM</a></li> <li><a href="http://yeoman.io">Yeoman</a></li> </ul> <p>To install first two of them on Mac OS X or Windows computers you just need to download a package from <a href="http://nodejs.org/download/">nodejs.org/download/</a>. For other platforms see the <a href="https://npmjs.org/doc/README.html">readme</a>.</p> <p>After installing node.js and npm go to terminal and install Yeoman writing <code>npm install -g yo</code> (with <code>sudo</code> if necessary).</p> <p>Almost there! After these steps you need to install XF Generator with <code>npm install -g generator-xf</code>.</p>
{'content_hash': '7ec5a698f2b1bcd09b1e097b90fbd031', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 257, 'avg_line_length': 60.705882352941174, 'alnum_prop': 0.7199612403100775, 'repo_name': 'epam/xframework', 'id': '4127893e601400216714eb907402287b68e38251', 'size': '1032', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/data/installing_xframework_generator.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '275950'}, {'name': 'JavaScript', 'bytes': '730289'}]}
namespace Azure.ResourceManager.EdgeOrder.Models { /// <summary> Represents subscription registered features. </summary> public partial class CustomerSubscriptionRegisteredFeatures { /// <summary> Initializes a new instance of CustomerSubscriptionRegisteredFeatures. </summary> public CustomerSubscriptionRegisteredFeatures() { } /// <summary> Name of subscription registered feature. </summary> public string Name { get; set; } /// <summary> State of subscription registered feature. </summary> public string State { get; set; } } }
{'content_hash': 'ac471d3f33987dd6c7e35e349847293a', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 102, 'avg_line_length': 38.4375, 'alnum_prop': 0.6813008130081301, 'repo_name': 'Azure/azure-sdk-for-net', 'id': '1888fb1a8203597c021c5a97aa4c2106984a672a', 'size': '753', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/CustomerSubscriptionRegisteredFeatures.cs', 'mode': '33188', 'license': 'mit', 'language': []}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Sat Mar 16 04:11:58 MST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer (BOM: * : All 2.3.1.Final-SNAPSHOT API)</title> <meta name="date" content="2019-03-16"> <link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer (BOM: * : All 2.3.1.Final-SNAPSHOT API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.3.1.Final-SNAPSHOT</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/server/class-use/BindingsDirectoryPathConsumer.html" target="_top">Frames</a></li> <li><a href="BindingsDirectoryPathConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer" class="title">Uses of Interface<br>org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">BindingsDirectoryPathConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.messaging.activemq">org.wildfly.swarm.config.messaging.activemq</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.messaging.activemq.server">org.wildfly.swarm.config.messaging.activemq.server</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config.messaging.activemq"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">BindingsDirectoryPathConsumer</a> in <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html">org.wildfly.swarm.config.messaging.activemq</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/package-summary.html">org.wildfly.swarm.config.messaging.activemq</a> with parameters of type <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">BindingsDirectoryPathConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/Server.html" title="type parameter in Server">T</a></code></td> <td class="colLast"><span class="typeNameLabel">Server.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/Server.html#bindingsDirectoryPath-org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer-">bindingsDirectoryPath</a></span>(<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">BindingsDirectoryPathConsumer</a>&nbsp;consumer)</code> <div class="block">A filesystem path pointing to one of the locations where ActiveMQ stores persistent data.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.wildfly.swarm.config.messaging.activemq.server"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">BindingsDirectoryPathConsumer</a> in <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/package-summary.html">org.wildfly.swarm.config.messaging.activemq.server</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/package-summary.html">org.wildfly.swarm.config.messaging.activemq.server</a> that return <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">BindingsDirectoryPathConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>default <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">BindingsDirectoryPathConsumer</a>&lt;<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="type parameter in BindingsDirectoryPathConsumer">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">BindingsDirectoryPathConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html#andThen-org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer-">andThen</a></span>(<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">BindingsDirectoryPathConsumer</a>&lt;<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="type parameter in BindingsDirectoryPathConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/package-summary.html">org.wildfly.swarm.config.messaging.activemq.server</a> with parameters of type <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">BindingsDirectoryPathConsumer</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>default <a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">BindingsDirectoryPathConsumer</a>&lt;<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="type parameter in BindingsDirectoryPathConsumer">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel">BindingsDirectoryPathConsumer.</span><code><span class="memberNameLink"><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html#andThen-org.wildfly.swarm.config.messaging.activemq.server.BindingsDirectoryPathConsumer-">andThen</a></span>(<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">BindingsDirectoryPathConsumer</a>&lt;<a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="type parameter in BindingsDirectoryPathConsumer">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/wildfly/swarm/config/messaging/activemq/server/BindingsDirectoryPathConsumer.html" title="interface in org.wildfly.swarm.config.messaging.activemq.server">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.3.1.Final-SNAPSHOT</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/wildfly/swarm/config/messaging/activemq/server/class-use/BindingsDirectoryPathConsumer.html" target="_top">Frames</a></li> <li><a href="BindingsDirectoryPathConsumer.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
{'content_hash': '9d4a959a17bfed5d67d358e525d7f8e4', 'timestamp': '', 'source': 'github', 'line_count': 206, 'max_line_length': 793, 'avg_line_length': 64.10194174757281, 'alnum_prop': 0.6843619840969329, 'repo_name': 'wildfly-swarm/wildfly-swarm-javadocs', 'id': '1e14ac35a7c49488433c20a72a70ed6f7111d9be', 'size': '13205', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': '2.3.1.Final-SNAPSHOT/apidocs/org/wildfly/swarm/config/messaging/activemq/server/class-use/BindingsDirectoryPathConsumer.html', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
import ReactSharedInternals from 'shared/ReactSharedInternals'; import type {Transition} from './ReactFiberTracingMarkerComponent.new'; const {ReactCurrentBatchConfig} = ReactSharedInternals; export const NoTransition = null; export function requestCurrentTransition(): Transition | null { return ReactCurrentBatchConfig.transition; }
{'content_hash': 'dace65b4e7262d44f7cf8c5ddcea517a', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 71, 'avg_line_length': 28.5, 'alnum_prop': 0.8216374269005848, 'repo_name': 'camsong/react', 'id': 'd63b99a1862ef22435389d30a9298476688a7c25', 'size': '542', 'binary': False, 'copies': '2', 'ref': 'refs/heads/main', 'path': 'packages/react-reconciler/src/ReactFiberTransition.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '5225'}, {'name': 'C++', 'bytes': '44278'}, {'name': 'CSS', 'bytes': '64729'}, {'name': 'CoffeeScript', 'bytes': '16826'}, {'name': 'HTML', 'bytes': '119964'}, {'name': 'JavaScript', 'bytes': '6161428'}, {'name': 'Makefile', 'bytes': '189'}, {'name': 'Python', 'bytes': '259'}, {'name': 'Shell', 'bytes': '2306'}, {'name': 'TypeScript', 'bytes': '20868'}]}
/*! * Copyright (c) 2019 by Contributors * \file moments-inl.h * \brief Moments operator * \author Hao Jin */ #ifndef MXNET_OPERATOR_NN_MOMENTS_INL_H_ #define MXNET_OPERATOR_NN_MOMENTS_INL_H_ #include <vector> #include "../tensor/broadcast_reduce_op.h" namespace mxnet { namespace op { struct MomentsParam : public dmlc::Parameter<MomentsParam> { dmlc::optional<mxnet::TShape> axes; bool keepdims; DMLC_DECLARE_PARAMETER(MomentsParam) { DMLC_DECLARE_FIELD(axes).set_default(dmlc::optional<mxnet::TShape>()) .describe("Array of ints. Axes along which to compute mean and variance."); DMLC_DECLARE_FIELD(keepdims).set_default(false) .describe("produce moments with the same dimensionality as the input."); } }; inline bool MomentsShape(const nnvm::NodeAttrs& attrs, mxnet::ShapeVector* in_attrs, mxnet::ShapeVector* out_attrs) { const MomentsParam& param = nnvm::get<MomentsParam>(attrs.parsed); CHECK_EQ(in_attrs->size(), 1U); CHECK_EQ(out_attrs->size(), 2U); mxnet::TShape out_shape = ReduceAxesShapeImpl((*in_attrs)[0], param.axes, param.keepdims, false); if (!param.axes.has_value() || param.axes.value().ndim() == 0) { LOG(FATAL) << "Empty axes is not supported, if you would like to do global moments, " << "please pass all axes to axes argument"; } SHAPE_ASSIGN_CHECK(*out_attrs, 0, out_shape); SHAPE_ASSIGN_CHECK(*out_attrs, 1, out_shape); return true; } inline bool MomentsType(const nnvm::NodeAttrs& attrs, std::vector<int>* in_attrs, std::vector<int>* out_attrs) { CHECK_EQ(in_attrs->size(), 1U); CHECK_EQ(out_attrs->size(), 2U); TYPE_ASSIGN_CHECK(*out_attrs, 0, in_attrs->at(0)); TYPE_ASSIGN_CHECK(*out_attrs, 1, in_attrs->at(0)); TYPE_ASSIGN_CHECK(*in_attrs, 0, out_attrs->at(0)); TYPE_ASSIGN_CHECK(*in_attrs, 0, out_attrs->at(1)); return out_attrs->at(0) != -1 && out_attrs->at(1) != -1; } struct VarBroadcastKernel { template<typename DType> MSHADOW_XINLINE static void Map(int i, DType *out, const DType *data, const DType *mean, mshadow::Shape<6> data_shape, mshadow::Shape<6> mean_shape) { size_t data_idx = i; size_t mean_idx = i; size_t data_stride = 1; size_t mean_stride = 1; for (int axis = 5; axis >= 0; --axis) { size_t axis_idx = data_idx % data_shape[axis]; mean_idx -= axis_idx * data_stride; if (mean_shape[axis] != 1) { mean_idx += axis_idx * mean_stride; } data_idx /= data_shape[axis]; data_stride *= data_shape[axis]; mean_stride *= mean_shape[axis]; } DType res = (data[i] - mean[mean_idx]); out[i] = res * res; } }; template<typename xpu> inline void MomentsForwardImpl(const OpContext& ctx, const std::vector<TBlob>& inputs, const std::vector<OpReqType>& req, const std::vector<TBlob>& outputs, const dmlc::optional<mxnet::TShape>& axes, const bool keepdims) { using namespace mshadow; using namespace mshadow_op; using namespace mxnet_op; Stream<xpu> *s = ctx.get_stream<xpu>(); const TBlob& data = inputs[0]; const TBlob& mean = outputs[0]; const TBlob& var = outputs[1]; mxnet::TShape small; if (keepdims) { small = outputs[0].shape_; } else { small = ReduceAxesShapeImpl(inputs[0].shape_, axes, true, false); } ReduceAxesComputeImpl<xpu, mshadow_op::sum, true, true>(ctx, {data}, {req[0]}, {mean}, small); MSHADOW_TYPE_SWITCH(data.type_flag_, DType, { Shape<6> data_shape, mean_shape; for (int i = 0; i < 6; ++i) { data_shape[i] = (i < data.shape_.ndim()) ? data.shape_[i] : 1; mean_shape[i] = (i < small.ndim()) ? small[i] : 1; } Tensor<xpu, 1, DType> temp_data = ctx.requested[0].get_space_typed<xpu, 1, DType>(Shape1(data.shape_.Size()), s);; Kernel<VarBroadcastKernel, xpu>::Launch(s, data.shape_.Size(), temp_data.dptr_, data.dptr<DType>(), mean.dptr<DType>(), data_shape, mean_shape); ReduceAxesComputeImpl<xpu, mshadow_op::sum, true, true>( ctx, {TBlob(temp_data).reshape(data.shape_)}, {kWriteTo}, {var}, small); }); } template<typename xpu> inline void MomentsForward(const nnvm::NodeAttrs& attrs, const OpContext& ctx, const std::vector<TBlob>& inputs, const std::vector<OpReqType>& req, const std::vector<TBlob>& outputs) { using namespace mshadow; using namespace mshadow_op; using namespace mxnet_op; CHECK_EQ(inputs.size(), 1U); CHECK_EQ(outputs.size(), 2U); const MomentsParam& param = nnvm::get<MomentsParam>(attrs.parsed); MomentsForwardImpl<xpu>(ctx, inputs, req, outputs, param.axes, param.keepdims); } template<int req> struct VarBackwardKernel { template<typename DType> MSHADOW_XINLINE static void Map(int i, DType *igrad, const DType *ograd, const DType *data, const DType *mean, mshadow::Shape<6> data_shape, mshadow::Shape<6> mean_shape, const float N, const float ddof = 0.0f) { size_t data_idx = i; size_t mean_idx = i; size_t data_stride = 1; size_t mean_stride = 1; for (int axis = 5; axis >= 0; --axis) { size_t axis_idx = data_idx % data_shape[axis]; mean_idx -= axis_idx * data_stride; if (mean_shape[axis] != 1) { mean_idx += axis_idx * mean_stride; } data_idx /= data_shape[axis]; data_stride *= data_shape[axis]; mean_stride *= mean_shape[axis]; } KERNEL_ASSIGN(igrad[i], req, ograd[mean_idx] * (data[i] - mean[mean_idx]) * 2 / (N - ddof)); } }; template<typename xpu> inline void MomentsBackwardImpl(const nnvm::NodeAttrs& attrs, const OpContext& ctx, const std::vector<TBlob>& inputs, const std::vector<OpReqType>& req, const std::vector<TBlob>& outputs, const dmlc::optional<mxnet::TShape>& axes) { using namespace mshadow; using namespace mshadow::expr; using namespace mshadow_op; using namespace mxnet_op; Stream<xpu> *s = ctx.get_stream<xpu>(); const TBlob& mean_grad = inputs[0]; const TBlob& var_grad = inputs[1]; const TBlob& data = inputs[2]; const TBlob& mean = inputs[3]; const TBlob& var = inputs[4]; const TBlob& data_grad = outputs[0]; mxnet::TShape small = ReduceAxesShapeImpl(data.shape_, axes, true, false); BroadcastComputeImpl<xpu>(attrs, ctx, {mean_grad}, req, outputs, small); MSHADOW_TYPE_SWITCH(outputs[0].type_flag_, DType, { Tensor<xpu, 1, DType> igrad = outputs[0].FlatTo1D<xpu, DType>(s); igrad /= scalar<DType>(outputs[0].Size()/inputs[0].Size()); }); Shape<6> data_shape, var_shape; float N = data_grad.Size() / var.Size(); for (int i = 0; i < 6; ++i) { data_shape[i] = (i < data.shape_.ndim()) ? data.shape_[i] : 1; var_shape[i] = (i < small.ndim()) ? small[i] : 1; } MSHADOW_TYPE_SWITCH(data_grad.type_flag_, DType, { Kernel<VarBackwardKernel<kAddTo>, xpu>::Launch( s, data_grad.shape_.Size(), data_grad.dptr<DType>(), var_grad.dptr<DType>(), data.dptr<DType>(), mean.dptr<DType>(), data_shape, var_shape, N); }); } template<typename xpu> inline void MomentsBackward(const nnvm::NodeAttrs& attrs, const OpContext& ctx, const std::vector<TBlob>& inputs, const std::vector<OpReqType>& req, const std::vector<TBlob>& outputs) { using namespace mshadow; using namespace mshadow_op; using namespace mxnet_op; CHECK_EQ(inputs.size(), 5U); CHECK_EQ(outputs.size(), 1U); const MomentsParam& param = nnvm::get<MomentsParam>(attrs.parsed); MomentsBackwardImpl<xpu>(attrs, ctx, inputs, req, outputs, param.axes); } } // namespace op } // namespace mxnet #endif // MXNET_OPERATOR_NN_MOMENTS_INL_H_
{'content_hash': '1379c25c73b10bf4cbf94d1e3e5177af', 'timestamp': '', 'source': 'github', 'line_count': 237, 'max_line_length': 96, 'avg_line_length': 36.08438818565401, 'alnum_prop': 0.5748362956033677, 'repo_name': 'reminisce/mxnet', 'id': '6a9bdc54b9059e922e80bdd01e6bde06bf84326b', 'size': '9359', 'binary': False, 'copies': '6', 'ref': 'refs/heads/master', 'path': 'src/operator/nn/moments-inl.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '1731'}, {'name': 'Batchfile', 'bytes': '13130'}, {'name': 'C', 'bytes': '215572'}, {'name': 'C++', 'bytes': '7680259'}, {'name': 'CMake', 'bytes': '99958'}, {'name': 'Clojure', 'bytes': '622688'}, {'name': 'Cuda', 'bytes': '970884'}, {'name': 'Dockerfile', 'bytes': '85151'}, {'name': 'Groovy', 'bytes': '122800'}, {'name': 'HTML', 'bytes': '40277'}, {'name': 'Java', 'bytes': '205196'}, {'name': 'Julia', 'bytes': '436326'}, {'name': 'Jupyter Notebook', 'bytes': '3660387'}, {'name': 'MATLAB', 'bytes': '34903'}, {'name': 'Makefile', 'bytes': '201597'}, {'name': 'Perl', 'bytes': '1550163'}, {'name': 'Perl 6', 'bytes': '7280'}, {'name': 'PowerShell', 'bytes': '13786'}, {'name': 'Python', 'bytes': '7842403'}, {'name': 'R', 'bytes': '357807'}, {'name': 'Scala', 'bytes': '1305036'}, {'name': 'Shell', 'bytes': '427407'}, {'name': 'Smalltalk', 'bytes': '3497'}]}
class DeviceSettingListener < AsakusaSatellite::Hook::Listener render_on :account_setting_item, :partial => "device_setting" end
{'content_hash': '46ad3aa3b2c9fc525d06733f4de789d0', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 63, 'avg_line_length': 33.0, 'alnum_prop': 0.7803030303030303, 'repo_name': 'mallowlabs/AsakusaSatellite', 'id': 'fc863576a1861c4131cf2c1c604d62a735622fb0', 'size': '132', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'plugins/as_device_setting/lib/device_setting_listener.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '4295'}, {'name': 'JavaScript', 'bytes': '70132'}, {'name': 'Ruby', 'bytes': '176805'}, {'name': 'Shell', 'bytes': '1621'}]}
require_relative '../../spec_helper' VALID_UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i UUID_STRING1 = 'de305d54-75b4-431b-adb2-eb6b9e546014' UUID_STRING2 = 'de305d54-75b4-431b-adb2-eb6b9e546020' UUID_PACKED_STRING1 = "\xde\x30\x5d\x54\x75\xb4\x43\x1b\xad\xb2\xeb\x6b\x9e\x54\x60\x14" UUID_PACKED_STRING2 = "\xde\x30\x5d\x54\x75\xb4\x43\x1b\xad\xb2\xeb\x6b\x9e\x54\x60\x20" RSpec.describe Lobster::Uuid do describe '::DEFAULT' do subject { Lobster::Uuid::DEFAULT } it 'is all zeroes' do expect(subject).to eq("\x0" * 16) end it 'is frozen' do is_expected.to be_frozen end end describe '#new' do context 'with a valid value' do subject(:uuid) { Lobster::Uuid.new(UUID_PACKED_STRING1) } describe 'the value' do subject { uuid.value } it 'is stored' do is_expected.to eq UUID_PACKED_STRING1 end end end context 'with an invalid value' do it 'rejects a malformed string' do expect { Lobster::Uuid.new('foobar') }.to raise_error(ArgumentError) end end end context '.generate' do subject(:uuid) { Lobster::Uuid.generate } describe 'the value' do subject { uuid.value } # The chances of a randomly generated empty UUID is virtually impossible. # Besides, the UUID standards don't allow generated UUID to be all zeroes. it 'is random' do is_expected.not_to eq("\x0" * 16) end end describe 'the string' do subject { uuid.to_s } it 'is valid' do is_expected.to match VALID_UUID_REGEX end end end describe '.parse' do context 'with a valid UUID' do subject { Lobster::Uuid.parse(UUID_STRING1) } it 'parses correctly' do expect(subject.to_s).to eq(UUID_STRING1) end end context 'with a malformed string' do it 'returns nil' do expect(Lobster::Uuid.parse('foobar')).to be_nil end end context 'with an invalid argument' do it 'rejects a non-string' do expect { Lobster::Uuid.parse(5) }.to raise_error(ArgumentError) end end end describe '#value' do subject(:uuid) { Lobster::Uuid.new(UUID_PACKED_STRING1).value } it 'is a string' do is_expected.to be_a(String) end it 'is frozen' do is_expected.to be_frozen end describe '.length' do subject { uuid.length } it 'is 16 bytes' do is_expected.to be 16 end end end describe '#eql?' do subject(:uuid) { Lobster::Uuid.new(UUID_PACKED_STRING1) } subject { uuid.eql?(other) } context 'with two identical UUIDs' do let(:other) { Lobster::Uuid.new(UUID_PACKED_STRING1) } it 'returns true' do is_expected.to eq true end end context 'with two different UUIDs' do let(:other) { Lobster::Uuid.new(UUID_PACKED_STRING2) } it 'returns false' do is_expected.to eq false end end context 'without a UUID' do let(:other) { 'foobar' } it 'returns false' do is_expected.to eq false end end end describe '#==' do subject { first == second } let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) } context 'with equal UUIDs' do let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING1) } it 'is true' do is_expected.to be true end end context 'with the same instance' do let(:second) { first } it 'is true' do is_expected.to be true end end context 'with unequal UUIDs' do let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING2) } it 'is false' do is_expected.to be false end end context 'with nil' do let(:second) { nil } it 'is false' do is_expected.to be false end end context 'with a malformed string' do let(:second) { 'foobar' } it 'is false' do is_expected.to be false end end context 'with a non-string' do let(:second) { 5 } it 'is false' do is_expected.to be false end end context 'with identical value' do let(:second) { first.value } it 'is true' do is_expected.to be true end end context 'with identical string' do let(:second) { first.to_s } it 'is true' do is_expected.to be true end end end describe '#<=>' do subject { first <=> second } context 'with an equal UUID' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) } let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING1) } it 'is 0' do is_expected.to eq 0 end end context 'with the same instance' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) } let(:second) { first } it 'is 0' do is_expected.to eq 0 end end context 'with a lesser UUID' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING2) } let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING1) } it 'is 1' do is_expected.to eq 1 end end context 'with a greater UUID' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) } let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING2) } it 'is -1' do is_expected.to eq(-1) end end context 'with nil' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) } let(:second) { nil } it 'is nil' do is_expected.to be_nil end end context 'with a number' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) } let(:second) { 500 } it 'is nil' do is_expected.to be_nil end end context 'with an identical value' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) } let(:second) { UUID_PACKED_STRING1 } it 'is 0' do is_expected.to eq 0 end end context 'with a lesser value' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING2) } let(:second) { UUID_PACKED_STRING1 } it 'is 1' do is_expected.to eq 1 end end context 'with a greater value' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) } let(:second) { UUID_PACKED_STRING2 } it 'is -1' do is_expected.to eq(-1) end end context 'with an equal string' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) } let(:second) { UUID_STRING1 } it 'is 0' do is_expected.to eq 0 end end context 'with a lesser string' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING2) } let(:second) { UUID_STRING1 } it 'is 1' do is_expected.to eq 1 end end context 'with a greater string' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1) } let(:second) { UUID_STRING2 } it 'is -1' do is_expected.to eq(-1) end end context 'with an invalid string' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING2) } let(:second) { 'foobar' } it 'is nil' do is_expected.to be_nil end end end describe '#hash' do subject { Lobster::Uuid.new(UUID_PACKED_STRING1).hash } it 'is a Fixnum' do is_expected.to be_a(Fixnum) end context 'with identical UUIDs' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1).hash } let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING1).hash } it 'returns identical values' do expect(first).to eq(second) end end context 'with different UUIDs' do let(:first) { Lobster::Uuid.new(UUID_PACKED_STRING1).hash } let(:second) { Lobster::Uuid.new(UUID_PACKED_STRING2).hash } it 'returns different values' do expect(first).to_not eq(second) end end end describe '#to_s' do subject { Lobster::Uuid.new(UUID_PACKED_STRING1).to_s } it 'is a String' do is_expected.to be_a String end it 'is a valid UUID string' do is_expected.to match(VALID_UUID_REGEX) end it 'equals the initial value' do is_expected.to eq(UUID_STRING1) end context 'with bytes less than 16' do subject { Lobster::Uuid.new("\x05\x30\x5d\x54\x75\x02\x43\x1b\xad\xb2\xeb\x6b\x9e\x54\x60\x00").to_s } it 'pads with zeroes' do is_expected.to eq('05305d54-7502-431b-adb2-eb6b9e546000') end end end end
{'content_hash': '1642c878d4fcdc5ebd2a9e8b8905586d', 'timestamp': '', 'source': 'github', 'line_count': 357, 'max_line_length': 108, 'avg_line_length': 23.946778711484594, 'alnum_prop': 0.5853316177330682, 'repo_name': 'gachapon/lobster-common', 'id': 'ed5b0f0b607bf7c015be4f064dfa501f5129bfd2', 'size': '8549', 'binary': False, 'copies': '1', 'ref': 'refs/heads/dev', 'path': 'spec/lib/lobster/uuid_spec.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '44314'}]}
package com.asksunny.schema.parser; import java.util.HashMap; import java.util.Map; import java.util.Set; public class KeywordDictionary extends HashMap<String, Keyword> { /** * */ private static final long serialVersionUID = 1L; public KeywordDictionary() { this.put("CREATE", Keyword.CREATE); this.put("TABLE", Keyword.TABLE); this.put("NOT", Keyword.NOT); this.put("NULL", Keyword.NULL); this.put("PRIMARY", Keyword.PRIMARY); this.put("KEY", Keyword.KEY); this.put("VARCHAR", Keyword.VARCHAR); this.put("NUMBER", Keyword.NUMBER); this.put("INT", Keyword.INT); this.put("BIGINT", Keyword.BIGINT); this.put("INTEGER", Keyword.INTEGER); this.put("DOUBLE", Keyword.DOUBLE); this.put("VARCHAR2", Keyword.VARCHAR); this.put("BINARY", Keyword.BINARY); this.put("LONG", Keyword.LONG); this.put("DATE", Keyword.DATE); this.put("TIME", Keyword.TIME); this.put("TIMESTAMP", Keyword.TIMESTAMP); this.put("ALTER", Keyword.ALTER); this.put("ADD", Keyword.ADD); this.put("CHAR", Keyword.CHAR); this.put("CONSTRAINT", Keyword.CONSTRAINT); this.put("FOREIGN", Keyword.FOREIGN); this.put("REFERENCES", Keyword.REFERENCES); this.put("UNIQUE", Keyword.UNIQUE); this.put("INDEX", Keyword.INDEX); this.put("BYTE", Keyword.BYTE); this.put("NOPARALLELCREATE", Keyword.CREATE); this.put("NOPARALLEL", Keyword.NOPARALLEL); this.put("PARALLEL", Keyword.PARALLEL); this.put("*", Keyword.ASTERISK); this.put("IMAGE", Keyword.IMAGE); this.put("TEXT", Keyword.TEXT); this.put("IDENTITY", Keyword.IDENTITY); this.put("AUTOINCREMENT", Keyword.IDENTITY); this.put("AUTO_INCREMENT", Keyword.IDENTITY); this.put("DEFAULT", Keyword.DEFAULT); this.put("COLUMN_FORMAT", Keyword.FORMAT); this.put("FORMAT", Keyword.FORMAT); } @Override public Keyword get(Object key) { return super.get(key.toString().toUpperCase()); } @Override public Keyword put(String key, Keyword value) { return super.put(key.toUpperCase(), value); } @Override public void putAll(Map<? extends String, ? extends Keyword> m) { Set<? extends String> keys = m.keySet(); for (String string : keys) { super.put(string.toUpperCase(), m.get(string)); } } @Override public boolean containsKey(Object key) { return super.containsKey(key.toString().toUpperCase()); } }
{'content_hash': '17e0844e355090632f0e6aef8dd4ab5e', 'timestamp': '', 'source': 'github', 'line_count': 84, 'max_line_length': 65, 'avg_line_length': 28.75, 'alnum_prop': 0.6650103519668737, 'repo_name': 'devsunny/jscaffold', 'id': '0e5042958a41441b8acf16b22b7e71f333e3239b', 'size': '2415', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/asksunny/schema/parser/KeywordDictionary.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'FreeMarker', 'bytes': '37206'}, {'name': 'Java', 'bytes': '312644'}]}
#include "arm_math.h" /** * @ingroup groupMath */ /** * @defgroup offset Vector Offset * * Adds a constant offset to each element of a vector. * * <pre> * pDst[n] = pSrc[n] + offset, 0 <= n < blockSize. * </pre> * * There are separate functions for floating-point, Q7, Q15, and Q31 data types. */ /** * @addtogroup offset * @{ */ /** * @brief Adds a constant offset to a floating-point vector. * @param[in] *pSrc points to the input vector * @param[in] offset is the offset to be added * @param[out] *pDst points to the output vector * @param[in] blockSize number of samples in the vector * @return none. */ void arm_offset_f32( float32_t * pSrc, float32_t offset, float32_t * pDst, uint32_t blockSize) { uint32_t blkCnt; /* loop counter */ #ifndef ARM_MATH_CM0 /* Run the below code for Cortex-M4 and Cortex-M3 */ float32_t in1, in2, in3, in4; /*loop Unrolling */ blkCnt = blockSize >> 2u; /* First part of the processing with loop unrolling. Compute 4 outputs at a time. ** a second loop below computes the remaining 1 to 3 samples. */ while(blkCnt > 0u) { /* C = A + offset */ /* Add offset and then store the results in the destination buffer. */ /* read samples from source */ in1 = *pSrc; in2 = *(pSrc + 1); /* add offset to input */ in1 = in1 + offset; /* read samples from source */ in3 = *(pSrc + 2); /* add offset to input */ in2 = in2 + offset; /* read samples from source */ in4 = *(pSrc + 3); /* add offset to input */ in3 = in3 + offset; /* store result to destination */ *pDst = in1; /* add offset to input */ in4 = in4 + offset; /* store result to destination */ *(pDst + 1) = in2; /* store result to destination */ *(pDst + 2) = in3; /* store result to destination */ *(pDst + 3) = in4; /* update pointers to process next samples */ pSrc += 4u; pDst += 4u; /* Decrement the loop counter */ blkCnt--; } /* If the blockSize is not a multiple of 4, compute any remaining output samples here. ** No loop unrolling is used. */ blkCnt = blockSize % 0x4u; #else /* Run the below code for Cortex-M0 */ /* Initialize blkCnt with number of samples */ blkCnt = blockSize; #endif /* #ifndef ARM_MATH_CM0 */ while(blkCnt > 0u) { /* C = A + offset */ /* Add offset and then store the result in the destination buffer. */ *pDst++ = (*pSrc++) + offset; /* Decrement the loop counter */ blkCnt--; } } /** * @} end of offset group */
{'content_hash': 'f2b978d8b36fff3a0eae28c44484593c', 'timestamp': '', 'source': 'github', 'line_count': 125, 'max_line_length': 96, 'avg_line_length': 22.592, 'alnum_prop': 0.5439093484419264, 'repo_name': 'jys0305/highspeedlogger', 'id': 'd7ca663bbddb46767e61f4c926942e9b5892f6e8', 'size': '3945', 'binary': False, 'copies': '56', 'ref': 'refs/heads/master', 'path': 'sw/libs/STM32F4xx_DSP_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/DSP_Lib/Source/BasicMathFunctions/arm_offset_f32.c', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '280928'}, {'name': 'C', 'bytes': '21114329'}, {'name': 'C++', 'bytes': '100991'}, {'name': 'HTML', 'bytes': '455966'}, {'name': 'LSL', 'bytes': '47664'}, {'name': 'Makefile', 'bytes': '4331'}, {'name': 'Objective-C', 'bytes': '1718'}]}
package javassist.bytecode.stackmap; import javassist.bytecode.*; import java.util.HashMap; import java.util.ArrayList; /** * A basic block is a sequence of bytecode that does not contain jump/branch * instructions except at the last bytecode. * Since Java7 or later does not allow JSR, this class throws an exception when * it finds JSR. */ public class BasicBlock { static class JsrBytecode extends BadBytecode { JsrBytecode() { super("JSR"); } } protected int position, length; protected int incoming; // the number of incoming branches. protected BasicBlock[] exit; // null if the block is a leaf. protected boolean stop; // true if the block ends with an unconditional jump. protected Catch toCatch; protected BasicBlock(int pos) { position = pos; length = 0; incoming = 0; } public static BasicBlock find(BasicBlock[] blocks, int pos) throws BadBytecode { for (int i = 0; i < blocks.length; i++) { int iPos = blocks[i].position; if (iPos <= pos && pos < iPos + blocks[i].length) return blocks[i]; } throw new BadBytecode("no basic block at " + pos); } public static class Catch { public Catch next; public BasicBlock body; public int typeIndex; Catch(BasicBlock b, int i, Catch c) { body = b; typeIndex = i; next = c; } } public String toString() { StringBuffer sbuf = new StringBuffer(); String cname = this.getClass().getName(); int i = cname.lastIndexOf('.'); sbuf.append(i < 0 ? cname : cname.substring(i + 1)); sbuf.append("["); toString2(sbuf); sbuf.append("]"); return sbuf.toString(); } protected void toString2(StringBuffer sbuf) { sbuf.append("pos=").append(position).append(", len=") .append(length).append(", in=").append(incoming) .append(", exit{"); if (exit != null) { for (int i = 0; i < exit.length; i++) sbuf.append(exit[i].position).append(","); } sbuf.append("}, {"); Catch th = toCatch; while (th != null) { sbuf.append("(").append(th.body.position).append(", ") .append(th.typeIndex).append("), "); th = th.next; } sbuf.append("}"); } static class Mark implements Comparable { int position; BasicBlock block; BasicBlock[] jump; boolean alwaysJmp; // true if an unconditional branch. int size; // 0 unless the mark indicates RETURN etc. Catch catcher; Mark(int p) { position = p; block = null; jump = null; alwaysJmp = false; size = 0; catcher = null; } public int compareTo(Object obj) { if (obj instanceof Mark) { int pos = ((Mark)obj).position; return position - pos; } return -1; } void setJump(BasicBlock[] bb, int s, boolean always) { jump = bb; size = s; alwaysJmp = always; } } public static class Maker { /* Override these two methods if a subclass of BasicBlock must be * instantiated. */ protected BasicBlock makeBlock(int pos) { return new BasicBlock(pos); } protected BasicBlock[] makeArray(int size) { return new BasicBlock[size]; } private BasicBlock[] makeArray(BasicBlock b) { BasicBlock[] array = makeArray(1); array[0] = b; return array; } private BasicBlock[] makeArray(BasicBlock b1, BasicBlock b2) { BasicBlock[] array = makeArray(2); array[0] = b1; array[1] = b2; return array; } public BasicBlock[] make(MethodInfo minfo) throws BadBytecode { CodeAttribute ca = minfo.getCodeAttribute(); if (ca == null) return null; CodeIterator ci = ca.iterator(); return make(ci, 0, ci.getCodeLength(), ca.getExceptionTable()); } public BasicBlock[] make(CodeIterator ci, int begin, int end, ExceptionTable et) throws BadBytecode { HashMap marks = makeMarks(ci, begin, end, et); BasicBlock[] bb = makeBlocks(marks); addCatchers(bb, et); return bb; } /* Branch target */ private Mark makeMark(HashMap table, int pos) { return makeMark0(table, pos, true, true); } /* Branch instruction. * size > 0 */ private Mark makeMark(HashMap table, int pos, BasicBlock[] jump, int size, boolean always) { Mark m = makeMark0(table, pos, false, false); m.setJump(jump, size, always); return m; } private Mark makeMark0(HashMap table, int pos, boolean isBlockBegin, boolean isTarget) { Integer p = new Integer(pos); Mark m = (Mark)table.get(p); if (m == null) { m = new Mark(pos); table.put(p, m); } if (isBlockBegin) { if (m.block == null) m.block = makeBlock(pos); if (isTarget) m.block.incoming++; } return m; } private HashMap makeMarks(CodeIterator ci, int begin, int end, ExceptionTable et) throws BadBytecode { ci.begin(); ci.move(begin); HashMap marks = new HashMap(); while (ci.hasNext()) { int index = ci.next(); if (index >= end) break; int op = ci.byteAt(index); if ((Opcode.IFEQ <= op && op <= Opcode.IF_ACMPNE) || op == Opcode.IFNULL || op == Opcode.IFNONNULL) { Mark to = makeMark(marks, index + ci.s16bitAt(index + 1)); Mark next = makeMark(marks, index + 3); makeMark(marks, index, makeArray(to.block, next.block), 3, false); } else if (Opcode.GOTO <= op && op <= Opcode.LOOKUPSWITCH) switch (op) { case Opcode.GOTO : makeGoto(marks, index, index + ci.s16bitAt(index + 1), 3); break; case Opcode.JSR : makeJsr(marks, index, index + ci.s16bitAt(index + 1), 3); break; case Opcode.RET : makeMark(marks, index, null, 2, true); break; case Opcode.TABLESWITCH : { int pos = (index & ~3) + 4; int low = ci.s32bitAt(pos + 4); int high = ci.s32bitAt(pos + 8); int ncases = high - low + 1; BasicBlock[] to = makeArray(ncases + 1); to[0] = makeMark(marks, index + ci.s32bitAt(pos)).block; // default branch target int p = pos + 12; int n = p + ncases * 4; int k = 1; while (p < n) { to[k++] = makeMark(marks, index + ci.s32bitAt(p)).block; p += 4; } makeMark(marks, index, to, n - index, true); break; } case Opcode.LOOKUPSWITCH : { int pos = (index & ~3) + 4; int ncases = ci.s32bitAt(pos + 4); BasicBlock[] to = makeArray(ncases + 1); to[0] = makeMark(marks, index + ci.s32bitAt(pos)).block; // default branch target int p = pos + 8 + 4; int n = p + ncases * 8 - 4; int k = 1; while (p < n) { to[k++] = makeMark(marks, index + ci.s32bitAt(p)).block; p += 8; } makeMark(marks, index, to, n - index, true); break; } } else if ((Opcode.IRETURN <= op && op <= Opcode.RETURN) || op == Opcode.ATHROW) makeMark(marks, index, null, 1, true); else if (op == Opcode.GOTO_W) makeGoto(marks, index, index + ci.s32bitAt(index + 1), 5); else if (op == Opcode.JSR_W) makeJsr(marks, index, index + ci.s32bitAt(index + 1), 5); else if (op == Opcode.WIDE && ci.byteAt(index + 1) == Opcode.RET) makeMark(marks, index, null, 4, true); } if (et != null) { int i = et.size(); while (--i >= 0) { makeMark0(marks, et.startPc(i), true, false); makeMark(marks, et.handlerPc(i)); } } return marks; } private void makeGoto(HashMap marks, int pos, int target, int size) { Mark to = makeMark(marks, target); BasicBlock[] jumps = makeArray(to.block); makeMark(marks, pos, jumps, size, true); } /* * We could ignore JSR since Java 7 or later does not allow it. * See The JVM Spec. Sec. 4.10.2.5. */ protected void makeJsr(HashMap marks, int pos, int target, int size) throws BadBytecode { /* Mark to = makeMark(marks, target); Mark next = makeMark(marks, pos + size); BasicBlock[] jumps = makeArray(to.block, next.block); makeMark(marks, pos, jumps, size, false); */ throw new JsrBytecode(); } private BasicBlock[] makeBlocks(HashMap markTable) { Mark[] marks = (Mark[])markTable.values() .toArray(new Mark[markTable.size()]); java.util.Arrays.sort(marks); ArrayList blocks = new ArrayList(); int i = 0; BasicBlock prev; if (marks.length > 0 && marks[0].position == 0 && marks[0].block != null) prev = getBBlock(marks[i++]); else prev = makeBlock(0); blocks.add(prev); while (i < marks.length) { Mark m = marks[i++]; BasicBlock bb = getBBlock(m); if (bb == null) { // the mark indicates a branch instruction if (prev.length > 0) { // the previous mark already has exits. prev = makeBlock(prev.position + prev.length); blocks.add(prev); } prev.length = m.position + m.size - prev.position; prev.exit = m.jump; prev.stop = m.alwaysJmp; } else { // the mark indicates a branch target if (prev.length == 0) { prev.length = m.position - prev.position; bb.incoming++; prev.exit = makeArray(bb); } else { // the previous mark already has exits. int prevPos = prev.position; if (prevPos + prev.length < m.position) { prev = makeBlock(prevPos + prev.length); prev.length = m.position - prevPos; // the incoming flow from dead code is not counted // bb.incoming++; prev.exit = makeArray(bb); } } blocks.add(bb); prev = bb; } } return (BasicBlock[])blocks.toArray(makeArray(blocks.size())); } private static BasicBlock getBBlock(Mark m) { BasicBlock b = m.block; if (b != null && m.size > 0) { b.exit = m.jump; b.length = m.size; b.stop = m.alwaysJmp; } return b; } private void addCatchers(BasicBlock[] blocks, ExceptionTable et) throws BadBytecode { if (et == null) return; int i = et.size(); while (--i >= 0) { BasicBlock handler = find(blocks, et.handlerPc(i)); int start = et.startPc(i); int end = et.endPc(i); int type = et.catchType(i); handler.incoming--; for (int k = 0; k < blocks.length; k++) { BasicBlock bb = blocks[k]; int iPos = bb.position; if (start <= iPos && iPos < end) { bb.toCatch = new Catch(handler, type, bb.toCatch); handler.incoming++; } } } } } }
{'content_hash': 'f1a0cceb83de5d2bb6046c9fcb64b93d', 'timestamp': '', 'source': 'github', 'line_count': 391, 'max_line_length': 107, 'avg_line_length': 35.18414322250639, 'alnum_prop': 0.4474085919895326, 'repo_name': 'oneliang/third-party-lib', 'id': '6213e22a64b2b627e9be31e387205d826fb1866d', 'size': '14461', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'javassist/javassist/bytecode/stackmap/BasicBlock.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '31084'}, {'name': 'Java', 'bytes': '14382753'}]}
/* System calls. */ #define SEND 1 /* function code for sending messages */ #define RECEIVE 2 /* function code for receiving messages */ #define BOTH 3 /* function code for SEND + RECEIVE */ #define ANY (NR_PROCS+100) /* receive(ANY, buf) accepts from any source */ /* Task numbers, function codes and reply codes. */ #define TTY -NR_TASKS /* terminal I/O class */ # define TTY_READ 3 /* fcn code for reading from tty */ # define TTY_WRITE 4 /* fcn code for writing to tty */ # define TTY_IOCTL 5 /* fcn code for ioctl */ # define TTY_SETPGRP 6 /* fcn code for setpgrp */ # define TTY_OPEN 7 /* fcn code for opening tty */ # define TTY_CLOSE 8 /* fcn code for closing tty */ # define SUSPEND -998 /* used in interrupts when tty has no data */ #ifdef AM_KERNEL #define AMOEBA #endif #ifdef AMOEBA /* There are AM_NTASK copies of the amoeba kernel task. * If you change AM_NTASKS be sure to adjust kernel/table.c and fs/table.c */ #define AM_NTASKS 4 /* number of kernel tasks of this class */ #define AMINT_CLASS (TTY+1) /* Amoeba event handler */ #define AMOEBA_CLASS (AMINT_CLASS+AM_NTASKS) /* transaction handlers */ # define ETHER_ARRIV 1 /* fcn code for packet arrival */ # define AM_TRANS 2 /* amoeba transaction */ # define AM_GETREQ 3 /* amoeba getrequest */ # define AM_PUTREP 4 /* amoeba putrep */ # define AM_REVIVE 6 /* used by kernel task to revive luser task */ # define AM_TIMEOUT 8 /* used to talk to clock task */ # define AM_PUTSIG 9 /* when the luser hits the DEL ! */ # define AM_TASK_DIED 10 /* sent if task died during a transaction */ #else /* if AMOEBA not defined */ #define AMOEBA_CLASS TTY #endif /* AMOEBA */ /* * New class definitions should go here and should be defined relative * to AMOEBA_CLASS (ie. as AMOEBA_CLASS+n, for the nth task added). */ #define IDLE (AMOEBA_CLASS+1) /* task to run when there's nothing to run */ #define PRINTER -7 /* printer I/O class */ /* The printer uses the same commands as TTY. */ #define WINCHESTER -6 /* winchester (hard) disk class */ #define FLOPPY -5 /* floppy disk class */ # define DISK_READ 3 /* fcn code to DISK (must equal TTY_READ) */ # define DISK_WRITE 4 /* fcn code to DISK (must equal TTY_WRITE) */ # define DISK_IOCTL 5 /* fcn code for setting up RAM disk */ # define SCATTERED_IO 6 /* fcn code for multiple reads/writes */ # define OPTIONAL_IO 16 /* modifier to DISK_* codes within vector */ #define MEM -4 /* /dev/ram, /dev/(k)mem and /dev/null class */ # define RAM_DEV 0 /* minor device for /dev/ram */ # define MEM_DEV 1 /* minor device for /dev/mem */ # define KMEM_DEV 2 /* minor device for /dev/kmem */ # define NULL_DEV 3 /* minor device for /dev/null */ #if (CHIP == INTEL) # define PORT_DEV 4 /* minor device for /dev/port */ #endif #define CLOCK -3 /* clock class */ # define SET_ALARM 1 /* fcn code to CLOCK, set up alarm */ # define GET_TIME 3 /* fcn code to CLOCK, get real time */ # define SET_TIME 4 /* fcn code to CLOCK, set real time */ # define REAL_TIME 1 /* reply from CLOCK: here is real time */ #define SYSTASK -2 /* internal functions */ # define SYS_XIT 1 /* fcn code for sys_xit(parent, proc) */ # define SYS_GETSP 2 /* fcn code for sys_sp(proc, &new_sp) */ # define SYS_SIG 3 /* fcn code for sys_sig(proc, sig) */ # define SYS_FORK 4 /* fcn code for sys_fork(parent, child) */ # define SYS_NEWMAP 5 /* fcn code for sys_newmap(procno, map_ptr) */ # define SYS_COPY 6 /* fcn code for sys_copy(ptr) */ # define SYS_EXEC 7 /* fcn code for sys_exec(procno, new_sp) */ # define SYS_TIMES 8 /* fcn code for sys_times(procno, bufptr) */ # define SYS_ABORT 9 /* fcn code for sys_abort() */ # define SYS_FRESH 10 /* fcn code for sys_fresh() (Atari only) */ # define SYS_KILL 11 /* fcn code for sys_kill(proc, sig) */ # define SYS_GBOOT 12 /* fcn code for sys_gboot(procno, bootptr) */ # define SYS_UMAP 13 /* fcn code for sys_umap(procno, etc) */ # define SYS_MEM 14 /* fcn code for sys_mem() */ # define SYS_TRACE 15 /* fcn code for sys_trace(req,pid,addr,data) */ #define HARDWARE -1 /* used as source on interrupt generated msgs*/ /* Names of message fields for messages to CLOCK task. */ #define DELTA_TICKS m6_l1 /* alarm interval in clock ticks */ #define FUNC_TO_CALL m6_f1 /* pointer to function to call */ #define NEW_TIME m6_l1 /* value to set clock to (SET_TIME) */ #define CLOCK_PROC_NR m6_i1 /* which proc (or task) wants the alarm? */ #define SECONDS_LEFT m6_l1 /* how many seconds were remaining */ /* Names of message fields used for messages to block and character tasks. */ #define DEVICE m2_i1 /* major-minor device */ #define PROC_NR m2_i2 /* which (proc) wants I/O? */ #define COUNT m2_i3 /* how many bytes to transfer */ #define POSITION m2_l1 /* file offset */ #define ADDRESS m2_p1 /* core buffer address */ /* Names of message fields for messages to TTY task. */ #define TTY_LINE m2_i1 /* message parameter: terminal line */ #define TTY_REQUEST m2_i3 /* message parameter: ioctl request code */ #define TTY_SPEK m2_l1 /* message parameter: ioctl speed, erasing */ #define TTY_FLAGS m2_l2 /* message parameter: ioctl tty mode */ #define TTY_PGRP m2_i3 /* message parameter: process group */ /* Names of messages fields used in reply messages from tasks. */ #define REP_PROC_NR m2_i1 /* # of proc on whose behalf I/O was done */ #define REP_STATUS m2_i2 /* bytes transferred or error number */ /* Names of fields for copy message to SYSTASK. */ #define SRC_SPACE m5_c1 /* T or D space (stack is also D) */ #define SRC_PROC_NR m5_i1 /* process to copy from */ #define SRC_BUFFER m5_l1 /* virtual address where data come from */ #define DST_SPACE m5_c2 /* T or D space (stack is also D) */ #define DST_PROC_NR m5_i2 /* process to copy to */ #define DST_BUFFER m5_l2 /* virtual address where data go to */ #define COPY_BYTES m5_l3 /* number of bytes to copy */ /* Field names for accounting, SYSTASK and miscellaneous. */ #define USER_TIME m4_l1 /* user time consumed by process */ #define SYSTEM_TIME m4_l2 /* system time consumed by process */ #define CHILD_UTIME m4_l3 /* user time consumed by process' children */ #define CHILD_STIME m4_l4 /* sys time consumed by process' children */ #define PROC1 m1_i1 /* indicates a process */ #define PROC2 m1_i2 /* indicates a process */ #define PID m1_i3 /* process id passed from MM to kernel */ #define STACK_PTR m1_p1 /* used for stack ptr in sys_exec, sys_getsp */ #define PR m6_i1 /* process number for sys_sig */ #define SIGNUM m6_i2 /* signal number for sys_sig */ #define FUNC m6_f1 /* function pointer for sys_sig */ #define MEM_PTR m1_p1 /* tells where memory map is for sys_newmap */ #define CANCEL 0 /* general request to force a task to cancel */ #define SIG_MAP m1_i2 /* used by kernel for passing signal bit map */ #ifdef AMOEBA /* Names of message fields for amoeba tasks */ #define AM_OP m2_i1 /* one of the above operators */ #define AM_PROC_NR m2_i2 /* process # of proc doing operation */ #define AM_COUNT m2_i3 /* size of buffer for operation */ #define AM_ADDRESS m2_p1 /* address of buffer for operation */ /* For communication between MM and AMOEBA_CLASS kernel tasks */ #define AM_STATUS m2_i3 /* same use as REP_STATUS but for amoeba */ #define AM_FREE_IT m2_l1 /* 1=not a getreq, 0=is a getreq */ /* Special for passing a physical address from the ethernet driver */ #define AM_PADDR m2_l1 /* to the transaction layer */ #endif /* AMOEBA */ #define HARD_INT 2 /* fcn code for all hardware interrupts */
{'content_hash': 'f9df1ef6dac46637021009afd24c97de', 'timestamp': '', 'source': 'github', 'line_count': 166, 'max_line_length': 79, 'avg_line_length': 47.506024096385545, 'alnum_prop': 0.6505199086989601, 'repo_name': 'macminix/MacMinix', 'id': '2096f8ba765448daed32f1f58c71692b6eaa5fdd', 'size': '7886', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'include/minix/com.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Assembly', 'bytes': '360566'}, {'name': 'C', 'bytes': '3820041'}, {'name': 'C++', 'bytes': '18889'}, {'name': 'IDL', 'bytes': '54'}, {'name': 'Smalltalk', 'bytes': '3572'}]}
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/colorAccent"> <shape android:shape="rectangle"> <corners android:radius="4dp"/> <solid android:color="@android:color/white"/> </shape> </item> </selector>
{'content_hash': '0c5c532741b17d9555e504f006cb4d6f', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 69, 'avg_line_length': 37.77777777777778, 'alnum_prop': 0.6176470588235294, 'repo_name': 'coderwjq/ZhaZhaShop', 'id': '18d9057e931dc1eec93e181d35fb48d50721ab45', 'size': '340', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'shop/src/main/res/drawable/bg_tv_indicator.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '942134'}]}
#region Mr. Advice MVVM // // Mr. Advice MVVM // // A simple MVVM package using Mr. Advice aspect weaver // // https://github.com/ArxOne/MrAdvice.MVVM // // Released under MIT license http://opensource.org/licenses/mit-license.php #endregion namespace ArxOne.MrAdvice.MVVM.Properties { /// <summary> /// Marks a simple auto property to be bound to a DependencyProperty /// Note: use <see cref="Dependency"/>, this class will be deprecated soon /// </summary> public class DependencyProperty : Dependency { } }
{'content_hash': 'e6f968f6bcaa02164d63a014a40698b9', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 79, 'avg_line_length': 31.764705882352942, 'alnum_prop': 0.6888888888888889, 'repo_name': 'ArxOne/MrAdvice.MVVM', 'id': '44988b339a9dae3106bd24bb29f525eac790a6ff', 'size': '542', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'MrAdvice.MVVM/MVVM/Properties/DependencyProperty.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '174074'}]}
package org.ringojs.util; import org.mozilla.javascript.Context; import org.mozilla.javascript.Scriptable; import org.mozilla.javascript.ContextFactory; import org.mozilla.javascript.debug.DebugFrame; import org.mozilla.javascript.debug.DebuggableScript; import org.mozilla.javascript.debug.Debugger; import java.util.logging.Level; import java.util.logging.Logger; /** * A base class for Debuggers and Profilers implemented in Javascript. * This allows to exclude the debugger/profiler module and all modules * it uses to be excluded from debugging/profiling. */ public abstract class DebuggerBase implements Debugger { String debuggerScript; int debuggerScriptDepth = 0; final Logger log = Logger.getLogger(DebuggerBase.class.getName()); public abstract DebuggerBase createDebugger(); public abstract Object createContextData(); public abstract void handleCompilationDone(Context cx, DebuggableScript fnOrScript, String source); public abstract DebugFrame getScriptFrame(Context cx, DebuggableScript fnOrScript); public void attach() { attach(createContextData()); } public void setDebuggerScript(String path) { debuggerScript = path; } public void install() { ContextFactory factory = Context.getCurrentContext().getFactory(); factory.addListener(new ContextFactory.Listener() { public void contextCreated(Context cx) { DebuggerBase debugger = createDebugger(); if (debugger != null) { debugger.attach(createContextData()); } } public void contextReleased(Context cx) { } }); } public void attach(Object contextData) { Context cx = Context.getCurrentContext(); cx.setDebugger(this, contextData); cx.setOptimizationLevel(-1); cx.setGeneratingDebug(true); } public void detach() { Context cx = Context.getCurrentContext(); cx.setDebugger(null, null); } public Object getContextData() { return Context.getCurrentContext().getDebuggerContextData(); } public synchronized void suspend() { try { wait(); } catch (InterruptedException ir) { Thread.currentThread().interrupt(); } } public synchronized void resume() { notify(); } public DebugFrame getFrame(Context cx, DebuggableScript fnOrScript) { String path = fnOrScript.getSourceName(); if (log.isLoggable(Level.FINE)) { log.fine("Getting Frame for " + path + ", debugger script depth is " + debuggerScriptDepth); } if (debuggerScriptDepth > 0 || path.equals(debuggerScript)) { return new DebuggerScriptFrame(); } else { return getScriptFrame(cx, fnOrScript); } } /** * Get a string representation for the given script * @param script a function or script * @return the file and/or function name of the script */ static String getScriptName(DebuggableScript script) { if (script.isFunction()) { return script.getSourceName() + ": " + script.getFunctionName(); } else { return script.getSourceName(); } } class DebuggerScriptFrame implements DebugFrame { public void onEnter(Context cx, Scriptable activation, Scriptable thisObj, Object[] args) { log.fine("Entering debugger script frame"); debuggerScriptDepth ++; } public void onExit(Context cx, boolean byThrow, Object resultOrException) { log.fine("Exiting debugger script frame"); debuggerScriptDepth --; } public void onLineChange(Context cx, int lineNumber) {} public void onExceptionThrown(Context cx, Throwable ex) {} public void onDebuggerStatement(Context cx) {} } }
{'content_hash': '7bc72a3b9cca751d9857aa4ea38a39f2', 'timestamp': '', 'source': 'github', 'line_count': 127, 'max_line_length': 103, 'avg_line_length': 31.275590551181104, 'alnum_prop': 0.6467774420946626, 'repo_name': 'ringo/ringojs', 'id': '28b86371965cce8c9e11aa1af139908c3c679f4d', 'size': '3972', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'src/org/ringojs/util/DebuggerBase.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '141'}, {'name': 'CSS', 'bytes': '613'}, {'name': 'Dockerfile', 'bytes': '1007'}, {'name': 'HTML', 'bytes': '2026'}, {'name': 'Java', 'bytes': '363438'}, {'name': 'JavaScript', 'bytes': '913850'}, {'name': 'Shell', 'bytes': '2989'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Facecat</title> <!-- Bootstrap --> <link href="/static/css/bootstrap.min.css" rel="stylesheet"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> <link href="/static/css/facecat.css" rel="stylesheet"> </head> <body> <div id="main" class="container"> <!-- Navbar --> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/">Facecat</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <li class="active"><a href="/"><span class="glyphicon glyphicon-big glyphicon-cloud-upload"></span> Upload</a></li> <li><a href="/all"><span class="glyphicon glyphicon-big glyphicon-picture"></span> Generated</a></li> </ul> </div><!--/.nav-collapse --> </div><!--/.container-fluid --> </div> <!-- /Navbar --> <!-- Content --> % if 'error' in locals(): <div class="alert alert-danger">An error happend while processing your request.</div> % end <div> <h1>Upload a picture <small> It's more fun if it's the picture of someone.</small></h1> <form id="form-upload" class="padded" role="form" action="/upload" method="post" enctype="multipart/form-data"> <div class="row"> <div class="col-sm-12 col-md-5 center-block"> <div class="input-group"> <span class="input-group-btn"> <span class="btn btn-primary btn-file"> Browse&hellip; <input name="upload" id="upload" type="file"> </span> </span> <input type="text" class="form-control" readonly> </div> </div> </div> <div class="row"> <div class="col-sm-12 col-md-5 center-block"> <button type="submit" class="form-control btn btn-primary" id="submit" role="button">Upload</button> </div> </div> </form> </div> <!-- /Content --> </div><!--/.container --> <script src="/static/js/jquery-1.11.0.min.js"></script> <script src="/static/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).on('change', '.btn-file :file', function() { var input = $(this), numFiles = input.get(0).files ? input.get(0).files.length : 1, label = input.val().replace(/\\/g, '/').replace(/.*\//, ''); input.trigger('fileselect', [numFiles, label]); }); $(document).ready( function() { $('.btn-file :file').on('fileselect', function(event, numFiles, label) { var input = $(this).parents('.input-group').find(':text'), log = numFiles > 1 ? numFiles + ' files selected' : label; if( input.length ) { input.val(log); } else { if( log ) alert(log); } }); }); </script> </body> </html>
{'content_hash': '0ff5431891cb2864bd51ef0adfd0e451', 'timestamp': '', 'source': 'github', 'line_count': 110, 'max_line_length': 129, 'avg_line_length': 36.68181818181818, 'alnum_prop': 0.5241635687732342, 'repo_name': 'NicolasLM/python-runabove', 'id': 'c289353c9893e03aa4228b58f31f19256ca86a72', 'size': '4035', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'examples/facecat/views/index.html', 'mode': '33188', 'license': 'mit', 'language': []}
namespace AH.ModuleController.UI.DIET.Forms { partial class frmPatientListDietAssign { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.btnShow = new System.Windows.Forms.Button(); this.smartLabel4 = new AtiqsControlLibrary.SmartLabel(); this.cboReceivingNurseStation = new AtiqsControlLibrary.SmartComboBox(); this.dgvDietList = new AtiqsControlLibrary.SmartDataGridView(); this.dgvPatientList = new AtiqsControlLibrary.SmartDataGridView(); this.txtAdmissionID = new System.Windows.Forms.TextBox(); this.txtDeitID = new System.Windows.Forms.TextBox(); this.pnlMain.SuspendLayout(); this.pnlTop.SuspendLayout(); this.groupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvDietList)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvPatientList)).BeginInit(); this.SuspendLayout(); // // btnTopClose // this.btnTopClose.Location = new System.Drawing.Point(1128, 12); // // frmLabel // this.frmLabel.Location = new System.Drawing.Point(393, 9); this.frmLabel.Size = new System.Drawing.Size(406, 33); this.frmLabel.Text = "Assign Diet For Admitted Patient "; // // pnlMain // this.pnlMain.Controls.Add(this.dgvDietList); this.pnlMain.Controls.Add(this.groupBox4); this.pnlMain.Controls.Add(this.dgvPatientList); this.pnlMain.Location = new System.Drawing.Point(0, 58); this.pnlMain.Size = new System.Drawing.Size(1260, 606); // // pnlTop // this.pnlTop.Controls.Add(this.txtDeitID); this.pnlTop.Controls.Add(this.txtAdmissionID); this.pnlTop.Size = new System.Drawing.Size(1260, 58); this.pnlTop.Controls.SetChildIndex(this.frmLabel, 0); this.pnlTop.Controls.SetChildIndex(this.btnTopClose, 0); this.pnlTop.Controls.SetChildIndex(this.txtAdmissionID, 0); this.pnlTop.Controls.SetChildIndex(this.txtDeitID, 0); // // btnEdit // this.btnEdit.Location = new System.Drawing.Point(110, 673); this.btnEdit.Size = new System.Drawing.Size(19, 27); this.btnEdit.Visible = false; // // btnSave // this.btnSave.Location = new System.Drawing.Point(135, 681); this.btnSave.Size = new System.Drawing.Size(33, 17); this.btnSave.Visible = false; // // btnDelete // this.btnDelete.Location = new System.Drawing.Point(50, 673); this.btnDelete.Size = new System.Drawing.Size(21, 27); this.btnDelete.Visible = false; // // btnNew // this.btnNew.Location = new System.Drawing.Point(1026, 670); this.btnNew.Click += new System.EventHandler(this.btnNew_Click); // // btnClose // this.btnClose.Location = new System.Drawing.Point(1140, 670); this.btnClose.TabIndex = 3; // // btnPrint // this.btnPrint.Location = new System.Drawing.Point(77, 673); this.btnPrint.Size = new System.Drawing.Size(27, 27); this.btnPrint.Visible = false; // // groupBox1 // this.groupBox1.Location = new System.Drawing.Point(0, 709); this.groupBox1.Size = new System.Drawing.Size(1260, 25); // // groupBox4 // this.groupBox4.BackColor = System.Drawing.Color.PaleTurquoise; this.groupBox4.Controls.Add(this.btnShow); this.groupBox4.Controls.Add(this.smartLabel4); this.groupBox4.Controls.Add(this.cboReceivingNurseStation); this.groupBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.groupBox4.ForeColor = System.Drawing.Color.DarkBlue; this.groupBox4.Location = new System.Drawing.Point(3, 2); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(1256, 104); this.groupBox4.TabIndex = 5; this.groupBox4.TabStop = false; this.groupBox4.MouseHover += new System.EventHandler(this.groupBox4_MouseHover); // // btnShow // this.btnShow.BackColor = System.Drawing.Color.DarkSalmon; this.btnShow.Location = new System.Drawing.Point(540, 40); this.btnShow.Name = "btnShow"; this.btnShow.Size = new System.Drawing.Size(238, 30); this.btnShow.TabIndex = 158; this.btnShow.Text = "Click Patient List to Add Diet"; this.btnShow.UseVisualStyleBackColor = false; this.btnShow.Click += new System.EventHandler(this.btnShow_Click); // // smartLabel4 // this.smartLabel4.AutoSize = true; this.smartLabel4.BackColor = System.Drawing.Color.PaleTurquoise; this.smartLabel4.Font = new System.Drawing.Font("Times New Roman", 9.75F, System.Drawing.FontStyle.Bold); this.smartLabel4.Location = new System.Drawing.Point(42, 46); this.smartLabel4.Name = "smartLabel4"; this.smartLabel4.Size = new System.Drawing.Size(120, 15); this.smartLabel4.TabIndex = 157; this.smartLabel4.Text = "Select Nurse Station"; // // cboReceivingNurseStation // this.cboReceivingNurseStation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboReceivingNurseStation.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cboReceivingNurseStation.ForeColor = System.Drawing.Color.Blue; this.cboReceivingNurseStation.FormattingEnabled = true; this.cboReceivingNurseStation.Items.AddRange(new object[] { "1", "2"}); this.cboReceivingNurseStation.Location = new System.Drawing.Point(168, 43); this.cboReceivingNurseStation.Name = "cboReceivingNurseStation"; this.cboReceivingNurseStation.Size = new System.Drawing.Size(356, 26); this.cboReceivingNurseStation.TabIndex = 156; // // dgvDietList // this.dgvDietList.AllowUserToAddRows = false; this.dgvDietList.AllowUserToDeleteRows = false; this.dgvDietList.AllowUserToOrderColumns = true; this.dgvDietList.AllowUserToResizeColumns = false; this.dgvDietList.AllowUserToResizeRows = false; this.dgvDietList.BackgroundColor = System.Drawing.Color.White; this.dgvDietList.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle1.BackColor = System.Drawing.Color.LightGreen; dataGridViewCellStyle1.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle1.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; this.dgvDietList.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dgvDietList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle2.BackColor = System.Drawing.Color.White; dataGridViewCellStyle2.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle2.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.Lavender; dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Crimson; dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; this.dgvDietList.DefaultCellStyle = dataGridViewCellStyle2; this.dgvDietList.Location = new System.Drawing.Point(865, 75); this.dgvDietList.MultiSelect = false; this.dgvDietList.Name = "dgvDietList"; this.dgvDietList.RowHeadersVisible = false; dataGridViewCellStyle3.BackColor = System.Drawing.Color.White; this.dgvDietList.RowsDefaultCellStyle = dataGridViewCellStyle3; this.dgvDietList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgvDietList.Size = new System.Drawing.Size(272, 395); this.dgvDietList.TabIndex = 159; this.dgvDietList.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvDietList_CellMouseDoubleClick); // // dgvPatientList // this.dgvPatientList.AllowUserToAddRows = false; this.dgvPatientList.AllowUserToDeleteRows = false; this.dgvPatientList.AllowUserToOrderColumns = true; this.dgvPatientList.AllowUserToResizeColumns = false; this.dgvPatientList.AllowUserToResizeRows = false; this.dgvPatientList.BackgroundColor = System.Drawing.Color.White; this.dgvPatientList.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle4.BackColor = System.Drawing.Color.LightGreen; dataGridViewCellStyle4.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle4.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; this.dgvPatientList.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; this.dgvPatientList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle5.BackColor = System.Drawing.Color.White; dataGridViewCellStyle5.Font = new System.Drawing.Font("Tahoma", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle5.ForeColor = System.Drawing.Color.Black; dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.Lavender; dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.Crimson; dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; this.dgvPatientList.DefaultCellStyle = dataGridViewCellStyle5; this.dgvPatientList.Location = new System.Drawing.Point(2, 106); this.dgvPatientList.MultiSelect = false; this.dgvPatientList.Name = "dgvPatientList"; this.dgvPatientList.RowHeadersVisible = false; dataGridViewCellStyle6.BackColor = System.Drawing.Color.White; this.dgvPatientList.RowsDefaultCellStyle = dataGridViewCellStyle6; this.dgvPatientList.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgvPatientList.Size = new System.Drawing.Size(1253, 497); this.dgvPatientList.TabIndex = 6; this.dgvPatientList.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPatientList_CellClick); // // txtAdmissionID // this.txtAdmissionID.Location = new System.Drawing.Point(916, 9); this.txtAdmissionID.Name = "txtAdmissionID"; this.txtAdmissionID.Size = new System.Drawing.Size(100, 20); this.txtAdmissionID.TabIndex = 161; this.txtAdmissionID.Visible = false; // // txtDeitID // this.txtDeitID.Location = new System.Drawing.Point(1022, 7); this.txtDeitID.Name = "txtDeitID"; this.txtDeitID.Size = new System.Drawing.Size(100, 20); this.txtDeitID.TabIndex = 162; this.txtDeitID.Visible = false; // // frmPatientListDietAssign // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.ClientSize = new System.Drawing.Size(1260, 734); this.isEnterTabAllow = true; this.Name = "frmPatientListDietAssign"; this.Load += new System.EventHandler(this.frmPatientList_Load); this.pnlMain.ResumeLayout(false); this.pnlTop.ResumeLayout(false); this.pnlTop.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgvDietList)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvPatientList)).EndInit(); this.ResumeLayout(false); } #endregion private System.Windows.Forms.GroupBox groupBox4; private AtiqsControlLibrary.SmartDataGridView dgvPatientList; private AtiqsControlLibrary.SmartLabel smartLabel4; private AtiqsControlLibrary.SmartComboBox cboReceivingNurseStation; private System.Windows.Forms.Button btnShow; public System.Windows.Forms.TextBox txtAdmissionID; public System.Windows.Forms.TextBox txtDeitID; private AtiqsControlLibrary.SmartDataGridView dgvDietList; } }
{'content_hash': '7577a20e44e72cb7e2da2aed635be20c', 'timestamp': '', 'source': 'github', 'line_count': 286, 'max_line_length': 184, 'avg_line_length': 56.45454545454545, 'alnum_prop': 0.6495726495726496, 'repo_name': 'atiq-shumon/DotNetProjects', 'id': '63424a60f594df942497663d5c4bfb6bbaeb0f9a', 'size': '16148', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Hospital_ERP_VS13-WCF_WF/AH.ModuleController/UI/DIET/Forms/frmPatientListDietAssign.Designer.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ASP', 'bytes': '1059021'}, {'name': 'C#', 'bytes': '39389238'}, {'name': 'CSS', 'bytes': '683218'}, {'name': 'HTML', 'bytes': '44772'}, {'name': 'JavaScript', 'bytes': '1343054'}, {'name': 'PLpgSQL', 'bytes': '340074'}, {'name': 'Pascal', 'bytes': '81971'}, {'name': 'PowerShell', 'bytes': '175142'}, {'name': 'Puppet', 'bytes': '2111'}, {'name': 'Smalltalk', 'bytes': '9'}, {'name': 'XSLT', 'bytes': '12347'}]}
package org.medipi.clinical.dao; import java.util.List; import org.medipi.clinical.entities.PatientGroup; import org.springframework.stereotype.Repository; /** * Implementation of Data Access Object for Patient * @author [email protected] */ @Repository public class PatientGroupDAOImpl extends GenericDAOImpl<PatientGroup> implements PatientGroupDAO { @Override public List<PatientGroup> getAllGroups() { return this.getEntityManager().createNamedQuery("PatientGroup.findAll", PatientGroup.class) .getResultList(); } }
{'content_hash': '3bf94388278a7d76abcb340256e75471', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 99, 'avg_line_length': 29.63157894736842, 'alnum_prop': 0.7602131438721137, 'repo_name': 'Samuel789/MediPi', 'id': '33522f5a6540bd8fb6f89dd443207ac049bb383a', 'size': '1167', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Clinician/MediPiClinical/src/main/java/org/medipi/clinical/dao/PatientGroupDAOImpl.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '10012'}, {'name': 'CSS', 'bytes': '847678'}, {'name': 'HTML', 'bytes': '4238145'}, {'name': 'Java', 'bytes': '1942198'}, {'name': 'JavaScript', 'bytes': '2308166'}, {'name': 'PHP', 'bytes': '1684'}, {'name': 'Python', 'bytes': '66091'}, {'name': 'Ruby', 'bytes': '1183'}, {'name': 'Shell', 'bytes': '17053'}]}
package enums; public enum GameStatusType { GAME_WAITING, GAME_READY, GAME_PAUSE, GAME_RUNNING, GAME_END }
{'content_hash': 'f493082fa8f2d360462e63e43976d837', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 28, 'avg_line_length': 12.555555555555555, 'alnum_prop': 0.7345132743362832, 'repo_name': 'ptutak/Warcaby', 'id': 'b49884d68c81fb001a43a5b878b7d5aac2c17e36', 'size': '701', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/enums/GameStatusType.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '103900'}]}
package com.taotao.model; import java.util.Date; /** * TITLE:广告的model * USER:TAOTK * DATA:2016/9/14 * TIME:10:48 * COMPANY:www.51pjia.com */ public class PjPoster { private Integer id; //int(11) NOT NULL, private Integer category_id;// int(11) DEFAULT NULL, private String category_name; //varchar(32) DEFAULT NULL, private Integer poster_sort; //int(11) DEFAULT NULL, private String poster_url; //varchar(50) DEFAULT NULL, private String poster_size; //varchar(32) DEFAULT NULL, private Date create_time;//datetime DEFAULT NULL, private Integer poster_status; //int(11) DEFAULT NULL, private Integer poster_address; private String categoryName; private String poster_small_url;//小图片 public String getPoster_small_url() { return poster_small_url; } public void setPoster_small_url(String poster_small_url) { this.poster_small_url = poster_small_url; } public String getCategoryName() { return categoryName; } public void setCategoryName(String categoryName) { this.categoryName = categoryName; } public Integer getPoster_address() { return poster_address; } public void setPoster_address(Integer poster_address) { this.poster_address = poster_address; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getCategory_id() { return category_id; } public void setCategory_id(Integer category_id) { this.category_id = category_id; } public String getCategory_name() { return category_name; } public void setCategory_name(String category_name) { this.category_name = category_name; } public Integer getPoster_sort() { return poster_sort; } public void setPoster_sort(Integer poster_sort) { this.poster_sort = poster_sort; } public String getPoster_url() { return poster_url; } public void setPoster_url(String poster_url) { this.poster_url = poster_url; } public String getPoster_size() { return poster_size; } public void setPoster_size(String poster_size) { this.poster_size = poster_size; } public Date getCreate_time() { return create_time; } public void setCreate_time(Date create_time) { this.create_time = create_time; } public Integer getPoster_status() { return poster_status; } public void setPoster_status(Integer poster_status) { this.poster_status = poster_status; } @Override public String toString() { return "PjPoster{" + "id=" + id + ", category_id=" + category_id + ", category_name='" + category_name + '\'' + ", poster_sort=" + poster_sort + ", poster_url='" + poster_url + '\'' + ", poster_size='" + poster_size + '\'' + ", create_time=" + create_time + ", poster_status=" + poster_status + ", poster_address=" + poster_address + ", categoryName='" + categoryName + '\'' + ", poster_small_url='" + poster_small_url + '\'' + '}'; } }
{'content_hash': '7ab49f595d4875b5c338cb3b1ae66c93', 'timestamp': '', 'source': 'github', 'line_count': 129, 'max_line_length': 66, 'avg_line_length': 25.88372093023256, 'alnum_prop': 0.5882000598981731, 'repo_name': '17755332301/Tao-', 'id': 'c90f72f6b45864fc59a103913265bc15df0b29bc', 'size': '3351', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'taotao-web/src/main/java/com/taotao/model/PjPoster.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ASP', 'bytes': '31784'}, {'name': 'C#', 'bytes': '16030'}, {'name': 'CSS', 'bytes': '625671'}, {'name': 'HTML', 'bytes': '558187'}, {'name': 'Java', 'bytes': '280551'}, {'name': 'JavaScript', 'bytes': '4548934'}, {'name': 'PHP', 'bytes': '32951'}]}
'use strict'; var $; var _default = { 'emission': '-', 'qte': '-', 'dist': '-' }; function toggleCentre(type) { var selector = ['.from-', ', .to-', ''].join(type + ' circle'); $(selector).attr('r', function (idx, old) {return !old; }) .toggleClass('highlight') ; } /** * Toggle visibility of given route type. If 'type' is 'route' then display all types * @param {[type]} type of routes to display. * @param {[type]} state of input (checked or not) */ function toggleRoute(type, state) { var routeSet; routeSet = (type === 'route' ? $('.route') : $('.route.from-' + type + ', .route.to-' + type) ); routeSet .attr('marker-mid', function (i, val) {return state ? 'url(#arw-mid)' : ''; }) .attr('marker-end', function (i, val) {return state ? 'url(#arw-end)' : ''; }) .toggleClass('show') ; } /** * Sum values from 'selector' items list * @param {string} selector selector * @return {int} sum */ function sumData(selector) { var sum = 0; var formatNumber = d3.format(',.0f'); $(selector).each(function () { sum += +$(this).text().replace(/(k[gm]| t)/i, ''); }); return formatNumber(Math.round(sum)).replace(/,/, ' '); } function updateTotal() { } $('input.route').change(function () { var type = $(this).attr('id').replace('centre-', ''); $('path.route').toggleClass('show'); toggleRoute(type, $(this).prop('checked')); $('#centre-epci, #centre-transfert, #centre-traitement') .attr('disabled', function (idx, old) { return !old; }); }); $('input.emission').change(function () { $('text.emission').toggleClass('show'); $('.emission .value').text(function (idx, old) { return (old === _default.emission ? sumData('svg text.emission'): _default.emission); }); }); $('input.qte').change(function () { $('text.qte').toggleClass('show'); $('.qte .value').text(function (idx, old) { return (old === _default.qte ? sumData('svg text.qte'): _default.qte); }); }); $('input.dist').change(function () { $('text.dist').toggleClass('show'); $('.dist .value').text(function (idx, old) { return (old === _default.dist ? sumData('svg text.dist'): _default.dist); }); }); $('input').change(function () { var type = $(this).attr('id').replace('centre-', ''); toggleCentre(type); toggleRoute(type, $(this).prop('checked')); }); /** * Update counter with data from given entity * @param {string} id entity id (used as selector) * @return {void} directly update UI */ function updateCounter(id) { $('.emission .value').text(function () { return sumData('svg text' + '.' + idify(id) + '.emission'); }); $('.qte .value').text(function () { return sumData('svg text' + '.' + idify(id) + '.qte'); }); $('.dist .value').text(function () { return sumData('svg text' + '.' + idify(id) + '.dist'); }); } /** * Highlight entity's area * @param {string} eid entity's id * @return {void} directly update UI */ function highlightEntity(eid) { // reset style on others elements d3.selectAll('.entity').classed('active', false); // apply style to element(s) d3.select('.entity.' + eid).classed('active', true); } /** * Show entity's *label* * @param {string} eid entity's id * @return {void} directly update UI */ function showEntityLabel(eid) { d3.selectAll('.entity-label').classed('show', false); d3.selectAll('.entity-label.' + eid).classed('show', true); } /** * Show entity's *routes* * @param {string} eid entity's id * @return {void} directly update UI */ function showEntityRoute(eid) { d3.selectAll('.route') .classed('show', false) .attr('marker-mid', null) .attr('marker-end', null) ; d3.selectAll('.route.' + eid) .classed('show', true) .attr('marker-mid', 'url(#arw-mid)') .attr('marker-end', 'url(#arw-end)') ; }
{'content_hash': '7f49a82e511dfbb1990e3eb35005e8a0', 'timestamp': '', 'source': 'github', 'line_count': 145, 'max_line_length': 87, 'avg_line_length': 25.917241379310344, 'alnum_prop': 0.6003193187865886, 'repo_name': 'edouard-lopez/ECV-IJBA', 'id': 'b277ac6769c9e9281f4a5287b6adb9dffac04376', 'size': '3758', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/scripts/ui.utils.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '30095'}, {'name': 'JavaScript', 'bytes': '24947'}]}
package org.radargun.stages.cache.generators; import java.io.Serializable; import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.util.Random; import org.radargun.config.DefinitionElement; import org.radargun.config.Init; import org.radargun.config.Property; import org.radargun.logging.Log; import org.radargun.logging.LogFactory; /** * @author Radim Vansa &lt;[email protected]&gt; */ @DefinitionElement(name = "jpa", doc = "Instantiates JPA entities. The constructor for the entities must match to the generateValue() method.") public class JpaValueGenerator implements ValueGenerator { protected static Log log = LogFactory.getLog(JpaValueGenerator.class); @Property(name = "class", doc = "Fully qualified name of the value class.", optional = false) private String clazzName; private Class<?> clazz; private Class<? extends Annotation> entityClazz; private Constructor<?> ctor; @Init public void init() { try { entityClazz = (Class<? extends Annotation>) Class.forName("javax.persistence.Entity"); clazz = Class.forName(clazzName); if (!clazz.isAnnotationPresent(entityClazz)) { throw new IllegalArgumentException("Class " + clazz.getName() + " is not an entity - no @Entity present"); } ctor = clazz.getConstructor(Object.class, int.class, Random.class); } catch (Exception e) { // trace as this can happen on master node log.trace("Could not initialize generator " + this, e); } } @Override public Object generateValue(Object key, int size, Random random) { if (ctor == null) throw new IllegalStateException("The generator was not properly initialized"); try { return ctor.newInstance(key, size, random); } catch (Exception e) { throw new IllegalStateException(e); } } @Override public int sizeOf(Object value) { if (value instanceof JpaValue) { return ((JpaValue) value).size(); } else { throw new IllegalArgumentException(); } } @Override public boolean checkValue(Object value, Object key, int expectedSize) { if (clazz == null) throw new IllegalStateException("The generator was not properly initialized"); return clazz.isInstance(value) && ((JpaValue) value).check(expectedSize); } public static String getRandomString(int size, Random random) { StringBuilder sb = new StringBuilder(size); for (int i = 0; i < size; ++i) { sb.append((char) (random.nextInt(26) + 'A')); } return sb.toString(); } public abstract static class JpaValue implements Serializable { public int size() { throw new UnsupportedOperationException(); } public boolean check(int expectedSize) { return true; } } }
{'content_hash': 'c5f03379a0c571b80855feb4f6da4571', 'timestamp': '', 'source': 'github', 'line_count': 86, 'max_line_length': 143, 'avg_line_length': 33.372093023255815, 'alnum_prop': 0.6721254355400696, 'repo_name': 'rmacor/radargun', 'id': 'f132c47f96782b6dc7cb7cbe91a98983f4bdbf73', 'size': '2870', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'extensions/cache/src/main/java/org/radargun/stages/cache/generators/JpaValueGenerator.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '1168'}, {'name': 'FreeMarker', 'bytes': '31553'}, {'name': 'Java', 'bytes': '1681217'}, {'name': 'JavaScript', 'bytes': '1900'}, {'name': 'Protocol Buffer', 'bytes': '809'}, {'name': 'Python', 'bytes': '625'}, {'name': 'Shell', 'bytes': '33354'}]}
#include "mitkGeometry2D.h" #include <vtkTransform.h> mitk::Geometry2D::Geometry2D() : m_ScaleFactorMMPerUnitX( 1.0 ), m_ScaleFactorMMPerUnitY( 1.0 ), m_ReferenceGeometry( NULL ) { } mitk::Geometry2D::Geometry2D(const Geometry2D& other) : Geometry3D(other), m_ScaleFactorMMPerUnitX( other.m_ScaleFactorMMPerUnitX), m_ScaleFactorMMPerUnitY( other.m_ScaleFactorMMPerUnitY), m_ReferenceGeometry( other.m_ReferenceGeometry ) { } mitk::Geometry2D::~Geometry2D() { } void mitk::Geometry2D::SetIndexToWorldTransform( mitk::AffineTransform3D* transform) { Superclass::SetIndexToWorldTransform(transform); m_ScaleFactorMMPerUnitX=GetExtentInMM(0)/GetExtent(0); m_ScaleFactorMMPerUnitY=GetExtentInMM(1)/GetExtent(1); assert(m_ScaleFactorMMPerUnitX<ScalarTypeNumericTraits::infinity()); assert(m_ScaleFactorMMPerUnitY<ScalarTypeNumericTraits::infinity()); } void mitk::Geometry2D::SetExtentInMM(int direction, ScalarType extentInMM) { Superclass::SetExtentInMM(direction, extentInMM); m_ScaleFactorMMPerUnitX=GetExtentInMM(0)/GetExtent(0); m_ScaleFactorMMPerUnitY=GetExtentInMM(1)/GetExtent(1); assert(m_ScaleFactorMMPerUnitX<ScalarTypeNumericTraits::infinity()); assert(m_ScaleFactorMMPerUnitY<ScalarTypeNumericTraits::infinity()); } bool mitk::Geometry2D::Map( const mitk::Point3D &pt3d_mm, mitk::Point2D &pt2d_mm) const { assert(m_BoundingBox.IsNotNull()); Point3D pt3d_units; BackTransform(pt3d_mm, pt3d_units); pt2d_mm[0]=pt3d_units[0]*m_ScaleFactorMMPerUnitX; pt2d_mm[1]=pt3d_units[1]*m_ScaleFactorMMPerUnitY; pt3d_units[2]=0; return const_cast<BoundingBox*>(m_BoundingBox.GetPointer())->IsInside(pt3d_units); } void mitk::Geometry2D::Map(const mitk::Point2D &pt2d_mm, mitk::Point3D &pt3d_mm) const { Point3D pt3d_units; pt3d_units[0]=pt2d_mm[0]/m_ScaleFactorMMPerUnitX; pt3d_units[1]=pt2d_mm[1]/m_ScaleFactorMMPerUnitY; pt3d_units[2]=0; pt3d_mm = GetParametricTransform()->TransformPoint(pt3d_units); } void mitk::Geometry2D::IndexToWorld( const mitk::Point2D &/*pt_units*/, mitk::Point2D &/*pt_mm*/) const { itkExceptionMacro(<< "No general transform possible (only affine) ==> no general" \ " IndexToWorld(const mitk::Point2D &pt_mm, mitk::Point2D &pt_units)" \ " possible. Has to be implemented in sub-class."); } void mitk::Geometry2D::WorldToIndex( const mitk::Point2D &/*pt_mm*/, mitk::Point2D &/*pt_units*/) const { itkExceptionMacro(<< "No general back transform possible (only affine) ==> no general" \ " WorldToIndex(const mitk::Point2D &pt_mm, mitk::Point2D &pt_units)" \ " possible. Has to be implemented in sub-class."); } void mitk::Geometry2D::IndexToWorld(const mitk::Point2D &/*atPt2d_units*/, const mitk::Vector2D &/*vec_units*/, mitk::Vector2D &/*vec_mm*/) const { itkExceptionMacro(<< "No general transform possible (only affine) ==> no general" \ " IndexToWorld(const mitk::Vector2D &vec_mm, mitk::Vector2D &vec_units)" \ " possible. Has to be implemented in sub-class."); } void mitk::Geometry2D::WorldToIndex(const mitk::Point2D &/*atPt2d_mm*/, const mitk::Vector2D &/*vec_mm*/, mitk::Vector2D &/*vec_units*/) const { itkExceptionMacro(<< "No general back transform possible (only affine) ==> no general" \ " WorldToIndex(const mitk::Vector2D &vec_mm, mitk::Vector2D &vec_units)" \ " possible. Has to be implemented in sub-class."); } void mitk::Geometry2D::SetSizeInUnits(mitk::ScalarType width, mitk::ScalarType height) { ScalarType bounds[6]={0, width, 0, height, 0, 1}; ScalarType extent, newextentInMM; if(GetExtent(0)>0) { extent = GetExtent(0); if(width>extent) newextentInMM = GetExtentInMM(0)/width*extent; else newextentInMM = GetExtentInMM(0)*extent/width; SetExtentInMM(0, newextentInMM); } if(GetExtent(1)>0) { extent = GetExtent(1); if(width>extent) newextentInMM = GetExtentInMM(1)/height*extent; else newextentInMM = GetExtentInMM(1)*extent/height; SetExtentInMM(1, newextentInMM); } SetBounds(bounds); } bool mitk::Geometry2D::Project( const mitk::Point3D &pt3d_mm, mitk::Point3D &projectedPt3d_mm) const { assert(m_BoundingBox.IsNotNull()); Point3D pt3d_units; BackTransform(pt3d_mm, pt3d_units); pt3d_units[2] = 0; projectedPt3d_mm = GetParametricTransform()->TransformPoint(pt3d_units); return const_cast<BoundingBox*>(m_BoundingBox.GetPointer())->IsInside(pt3d_units); } bool mitk::Geometry2D::Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const { assert(m_BoundingBox.IsNotNull()); Vector3D vec3d_units; BackTransform(vec3d_mm, vec3d_units); vec3d_units[2] = 0; projectedVec3d_mm = GetParametricTransform()->TransformVector(vec3d_units); return true; } bool mitk::Geometry2D::Project(const mitk::Point3D & atPt3d_mm, const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const { MITK_WARN << "Deprecated function! Call Project(vec3D,vec3D) instead."; assert(m_BoundingBox.IsNotNull()); Vector3D vec3d_units; BackTransform(atPt3d_mm, vec3d_mm, vec3d_units); vec3d_units[2] = 0; projectedVec3d_mm = GetParametricTransform()->TransformVector(vec3d_units); Point3D pt3d_units; BackTransform(atPt3d_mm, pt3d_units); return const_cast<BoundingBox*>(m_BoundingBox.GetPointer())->IsInside(pt3d_units); } bool mitk::Geometry2D::Map(const mitk::Point3D & atPt3d_mm, const mitk::Vector3D &vec3d_mm, mitk::Vector2D &vec2d_mm) const { Point2D pt2d_mm_start, pt2d_mm_end; Point3D pt3d_mm_end; bool inside=Map(atPt3d_mm, pt2d_mm_start); pt3d_mm_end = atPt3d_mm+vec3d_mm; inside&=Map(pt3d_mm_end, pt2d_mm_end); vec2d_mm=pt2d_mm_end-pt2d_mm_start; return inside; } void mitk::Geometry2D::Map(const mitk::Point2D &/*atPt2d_mm*/, const mitk::Vector2D &/*vec2d_mm*/, mitk::Vector3D &/*vec3d_mm*/) const { //@todo implement parallel to the other Map method! assert(false); } mitk::ScalarType mitk::Geometry2D::SignedDistance(const mitk::Point3D& pt3d_mm) const { Point3D projectedPoint; Project(pt3d_mm, projectedPoint); Vector3D direction = pt3d_mm-projectedPoint; ScalarType distance = direction.GetNorm(); if(IsAbove(pt3d_mm) == false) distance*=-1.0; return distance; } bool mitk::Geometry2D::IsAbove(const mitk::Point3D& pt3d_mm) const { Point3D pt3d_units; Geometry3D::WorldToIndex(pt3d_mm, pt3d_units); return (pt3d_units[2] > m_BoundingBox->GetBounds()[4]); } itk::LightObject::Pointer mitk::Geometry2D::InternalClone() const { Self::Pointer newGeometry = new Geometry2D(*this); newGeometry->UnRegister(); return newGeometry.GetPointer(); } void mitk::Geometry2D::PrintSelf(std::ostream& os, itk::Indent indent) const { Superclass::PrintSelf(os,indent); os << indent << " ScaleFactorMMPerUnitX: " << m_ScaleFactorMMPerUnitX << std::endl; os << indent << " ScaleFactorMMPerUnitY: " << m_ScaleFactorMMPerUnitY << std::endl; } void mitk::Geometry2D::SetReferenceGeometry( mitk::Geometry3D *geometry ) { m_ReferenceGeometry = geometry; } mitk::Geometry3D * mitk::Geometry2D::GetReferenceGeometry() const { return m_ReferenceGeometry; } bool mitk::Geometry2D::HasReferenceGeometry() const { return ( m_ReferenceGeometry != NULL ); }
{'content_hash': 'd76ad4d788fa7a514bf6dab0c34c7577', 'timestamp': '', 'source': 'github', 'line_count': 270, 'max_line_length': 98, 'avg_line_length': 27.02962962962963, 'alnum_prop': 0.7158125513839408, 'repo_name': 'nocnokneo/MITK', 'id': '6f23c9171007a8f9826011462cd9b16b7117cf21', 'size': '7796', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Core/Code/DataManagement/mitkGeometry2D.cpp', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '5991982'}, {'name': 'C++', 'bytes': '29934042'}, {'name': 'CSS', 'bytes': '52056'}, {'name': 'IDL', 'bytes': '5583'}, {'name': 'Java', 'bytes': '350330'}, {'name': 'JavaScript', 'bytes': '287054'}, {'name': 'Objective-C', 'bytes': '606620'}, {'name': 'Perl', 'bytes': '982'}, {'name': 'Python', 'bytes': '7545'}, {'name': 'Shell', 'bytes': '5438'}, {'name': 'TeX', 'bytes': '1204'}, {'name': 'XSLT', 'bytes': '30684'}]}
<?php /** * csv import class for the addressbook * * @package Addressbook * @subpackage Import */ class Addressbook_Import_Csv extends Tinebase_Import_Csv_Abstract { /** * additional config options * * @var array */ protected $_additionalOptions = array( 'container_id' => '', ); /** * creates a new importer from an importexport definition * * @param Tinebase_Model_ImportExportDefinition $_definition * @param array $_options * @return Calendar_Import_Ical * * @todo move this to abstract when we no longer need to be php 5.2 compatible */ public static function createFromDefinition(Tinebase_Model_ImportExportDefinition $_definition, array $_options = array()) { return new Addressbook_Import_Csv(self::getOptionsArrayFromDefinition($_definition, $_options)); } /** * constructs a new importer from given config * * @param array $_options */ public function __construct(array $_options = array()) { parent::__construct($_options); // don't set geodata for imported contacts as this is too much traffic for the nominatim server $this->_controller->setGeoDataForContacts(FALSE); // get container id from default container if not set if (empty($this->_options['container_id'])) { $defaultContainer = $this->_controller->getDefaultAddressbook(); $this->_options['container_id'] = $defaultContainer->getId(); if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Setting default container id: ' . $this->_options['container_id']); } } /** * add some more values (container id) * * @return array */ protected function _addData() { $result['container_id'] = $this->_options['container_id']; return $result; } /** * do conversions * -> sanitize account_id * * @param array $_data * @return array */ protected function _doConversions($_data) { $result = parent::_doConversions($_data); // unset account id if (isset($result['account_id']) && empty($result['account_id'])) { unset($result['account_id']); } if (empty($result['n_family']) && empty($result['org_name'])) { if (isset($result['n_fn'])) { $result['n_family'] = $result['n_fn']; } else { $result['n_family'] = 'imported'; } } return $result; } }
{'content_hash': '4692399acf338869828c25c6dbb75132', 'timestamp': '', 'source': 'github', 'line_count': 92, 'max_line_length': 194, 'avg_line_length': 29.76086956521739, 'alnum_prop': 0.5525931336742148, 'repo_name': 'jodier/tmpdddf', 'id': 'b468cdaf95d593eab1dca2ab0396388e72686c02', 'size': '3028', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'web/private/tine20/Addressbook/Import/Csv.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'PHP', 'bytes': '44010'}, {'name': 'Perl', 'bytes': '794'}, {'name': 'Shell', 'bytes': '286'}]}
package org.wildfly.swarm.cdi.jaxrsapi; import org.wildfly.swarm.spi.api.Fraction; import org.wildfly.swarm.spi.api.annotations.DeploymentModule; /** * @author Ken Finnigan */ @DeploymentModule(name = "org.wildfly.swarm.cdi.jaxrsapi", slot = "deployment", export = true) public class CDIJAXRSFraction implements Fraction<CDIJAXRSFraction> { }
{'content_hash': '7a285bf3ec4fc8c88860717e8f563c37', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 94, 'avg_line_length': 29.0, 'alnum_prop': 0.7758620689655172, 'repo_name': 'kenfinnigan/wildfly-swarm', 'id': 'c5af1c743f752005e3e18535b7ffaf281e618ee6', 'size': '975', 'binary': False, 'copies': '14', 'ref': 'refs/heads/master', 'path': 'fractions/cdi-extensions/cdi-jaxrsapi/src/main/java/org/wildfly/swarm/cdi/jaxrsapi/CDIJAXRSFraction.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '5821'}, {'name': 'HTML', 'bytes': '7818'}, {'name': 'Java', 'bytes': '3295457'}, {'name': 'JavaScript', 'bytes': '13301'}, {'name': 'Ruby', 'bytes': '5349'}, {'name': 'Shell', 'bytes': '8275'}, {'name': 'XSLT', 'bytes': '20396'}]}
// REFACTOR IF POSSIBLE /** * Within Viewport * * @description Determines whether an element is completely * within the browser viewport * @author Craig Patik, http://patik.com/ * @version 0.0.4 * @date 2014-07-05 */ ;(function() { /** * Determines whether an element is within the viewport * @param {Object} elem DOM Element (required) * @param {Object} options Optional settings * @return {Boolean} Whether the element was completely within the viewport */ var withinViewport = function _withinViewport(elem, options) { var result = false, metadata = {}, config = {}, settings, useHtmlElem, isWithin, scrollOffset, elemOffset, arr, i, side; if (typeof jQuery !== 'undefined' && elem instanceof jQuery) { elem = elem.get(0); } if (typeof elem !== 'object' || elem.nodeType !== 1) { throw new Error('First argument must be an element'); } if (elem.getAttribute('data-withinviewport-settings') && window.JSON) { metadata = JSON.parse(elem.getAttribute('data-withinviewport-settings')); } // Settings argument may be a simple string (`top`, `right`, etc) if (typeof options === 'string') { settings = {sides: options}; } else { settings = options || {}; } // Build configuration from defaults and given settings config.container = settings.container || metadata.container || withinViewport.defaults.container || document.body; config.sides = settings.sides || metadata.sides || withinViewport.defaults.sides || 'all'; config.top = settings.top || metadata.top || withinViewport.defaults.top || 0; config.right = settings.right || metadata.right || withinViewport.defaults.right || 0; config.bottom = settings.bottom || metadata.bottom || withinViewport.defaults.bottom || 0; config.left = settings.left || metadata.left || withinViewport.defaults.left || 0; // Whether we can use the `<html`> element for `scrollTop` // Unfortunately at the moment I can't find a way to do this without UA-sniffing useHtmlElem = !/Chrome/.test(navigator.userAgent); // Element testing methods isWithin = { // Element is below the top edge of the viewport top: function _isWithin_top() { return elemOffset[1] >= scrollOffset[1] + config.top; }, // Element is to the left of the right edge of the viewport right: function _isWithin_right() { var container = (config.container === document.body) ? window : config.container; return elemOffset[0] + elem.offsetWidth <= container.innerWidth + scrollOffset[0] - config.right; }, // Element is above the bottom edge of the viewport bottom: function _isWithin_bottom() { var container = (config.container === document.body) ? window : config.container; return elemOffset[1] + elem.offsetHeight <= scrollOffset[1] + container.innerHeight - config.bottom; }, // Element is to the right of the left edge of the viewport left: function _isWithin_left() { return elemOffset[0] >= scrollOffset[0] + config.left; }, all: function _isWithin_all() { return (isWithin.top() && isWithin.right() && isWithin.bottom() && isWithin.left()); } }; // Current offset values scrollOffset = (function _scrollOffset() { var x = config.container.scrollLeft, y = config.container.scrollTop; if (y === 0) { if (config.container.pageYOffset) { y = config.container.pageYOffset; } else if (window.pageYOffset) { y = window.pageYOffset; } else { if (config.container === document.body) { if (useHtmlElem) { y = (config.container.parentElement) ? config.container.parentElement.scrollTop : 0; } else { y = (config.container.parentElement) ? config.container.parentElement.scrollTop : 0; } } else { y = (config.container.parentElement) ? config.container.parentElement.scrollTop : 0; } } } if (x === 0) { if (config.container.pageXOffset) { x = config.container.pageXOffset; } else if (window.pageXOffset) { x = window.pageXOffset; } else { if (config.container === document.body) { x = (config.container.parentElement) ? config.container.parentElement.scrollLeft : 0; } else { x = (config.container.parentElement) ? config.container.parentElement.scrollLeft : 0; } } } return [x, y]; }()); elemOffset = (function _elemOffset() { var el = elem, x = 0, y = 0; if (el.parentNode) { x = el.offsetLeft; y = el.offsetTop; el = el.parentNode; while (el) { if (el == config.container) { break; } x += el.offsetLeft; y += el.offsetTop; el = el.parentNode; } } return [x, y]; })(); // Test the element against each side of the viewport that was requested arr = config.sides.split(' '); i = arr.length; while (i--) { side = arr[i].toLowerCase(); if (/top|right|bottom|left|all/.test(side)) { if (isWithin[side]()) { result = true; } else { result = false; // Quit as soon as the first failure is found break; } } } return result; }; // end of `withinViewport()` // Default settings withinViewport.prototype.defaults = { container: document.body, sides: 'all', top: 0, right: 0, bottom: 0, left: 0 }; withinViewport.defaults = withinViewport.prototype.defaults; // Make function available globally window.withinViewport = withinViewport; /** * Optional enhancements and shortcuts * * @description Uncomment or comment these pieces as they apply to your project and coding preferences */ // Shortcut methods for each side of the viewport // Ex: withinViewport.top(elem) is the same as withinViewport(elem, 'top') withinViewport.prototype.top = function _withinViewport_top(element) { return withinViewport(element, 'top'); }; withinViewport.prototype.right = function _withinViewport_right(element) { return withinViewport(element, 'right'); }; withinViewport.prototype.bottom = function _withinViewport_bottom(element) { return withinViewport(element, 'bottom'); }; withinViewport.prototype.left = function _withinViewport_left(element) { return withinViewport(element, 'left'); }; }());
{'content_hash': 'ebdf763bbe85efd426f5ce70a7d12c49', 'timestamp': '', 'source': 'github', 'line_count': 217, 'max_line_length': 118, 'avg_line_length': 31.387096774193548, 'alnum_prop': 0.601673763030392, 'repo_name': 'clarat-org/clarat', 'id': 'bd811615e8745b7b69dd1e85a63e09b3efa74330', 'size': '6811', 'binary': False, 'copies': '1', 'ref': 'refs/heads/develop', 'path': 'app/assets/javascripts/vendor/inviewport.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '152114'}, {'name': 'CoffeeScript', 'bytes': '84489'}, {'name': 'HTML', 'bytes': '835592'}, {'name': 'JavaScript', 'bytes': '33443'}, {'name': 'Ruby', 'bytes': '216461'}, {'name': 'Shell', 'bytes': '373'}]}
package com.microsoft.azure.management.network.v2019_08_01; import java.util.List; import com.microsoft.azure.management.network.v2019_08_01.implementation.SecurityRuleInner; import com.fasterxml.jackson.annotation.JsonProperty; /** * Subnet and it's custom security rules. */ public class SubnetAssociation { /** * Subnet ID. */ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /** * Collection of custom security rules. */ @JsonProperty(value = "securityRules") private List<SecurityRuleInner> securityRules; /** * Get subnet ID. * * @return the id value */ public String id() { return this.id; } /** * Get collection of custom security rules. * * @return the securityRules value */ public List<SecurityRuleInner> securityRules() { return this.securityRules; } /** * Set collection of custom security rules. * * @param securityRules the securityRules value to set * @return the SubnetAssociation object itself. */ public SubnetAssociation withSecurityRules(List<SecurityRuleInner> securityRules) { this.securityRules = securityRules; return this; } }
{'content_hash': '6e2519276d259d6f4c460690ffc2b435', 'timestamp': '', 'source': 'github', 'line_count': 54, 'max_line_length': 91, 'avg_line_length': 23.703703703703702, 'alnum_prop': 0.6546875, 'repo_name': 'navalev/azure-sdk-for-java', 'id': '17de1a8a17b3a29564b43b54bddcf28ccd71fc84', 'size': '1510', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'sdk/network/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/network/v2019_08_01/SubnetAssociation.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '7230'}, {'name': 'CSS', 'bytes': '5411'}, {'name': 'Groovy', 'bytes': '1570436'}, {'name': 'HTML', 'bytes': '29221'}, {'name': 'Java', 'bytes': '250218562'}, {'name': 'JavaScript', 'bytes': '15605'}, {'name': 'PowerShell', 'bytes': '30924'}, {'name': 'Python', 'bytes': '42119'}, {'name': 'Shell', 'bytes': '1408'}]}
require 'active_record' # establish connection ActiveRecord::Base.configurations = App.config.database_yml ActiveRecord::Base.establish_connection App.config.database_settings if ActiveRecord::VERSION::MAJOR == 2 class RubyAppDumpLogger def method_missing(method, *args) end end ActiveRecord::Base.logger = RubyAppDumpLogger.new end
{'content_hash': 'a4201f433fc4e8a8bc513fb025509435', 'timestamp': '', 'source': 'github', 'line_count': 15, 'max_line_length': 68, 'avg_line_length': 23.4, 'alnum_prop': 0.7806267806267806, 'repo_name': 'kostya/ruby-app-ar', 'id': 'c09bd03a50abd449f66f05c1ebd805ba095acc56', 'size': '379', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/init-activerecord.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '21278'}]}
/** * Create a new `Particle` object. Particles are extended Sprites that are emitted by a particle emitter such as Phaser.Particles.Arcade.Emitter. * * @class Phaser.Particle * @constructor * @extends Phaser.Sprite * @param {Phaser.Game} game - A reference to the currently running game. * @param {number} x - The x coordinate (in world space) to position the Particle at. * @param {number} y - The y coordinate (in world space) to position the Particle at. * @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the Particle during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture. * @param {string|number} frame - If this Particle is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index. */ Phaser.Particle = function (game, x, y, key, frame) { Phaser.Sprite.call(this, game, x, y, key, frame); /** * @property {boolean} autoScale - If this Particle automatically scales this is set to true by Particle.setScaleData. * @protected */ this.autoScale = false; /** * @property {array} scaleData - A reference to the scaleData array owned by the Emitter that emitted this Particle. * @protected */ this.scaleData = null; /** * @property {number} _s - Internal cache var for tracking auto scale. * @private */ this._s = 0; /** * @property {boolean} autoAlpha - If this Particle automatically changes alpha this is set to true by Particle.setAlphaData. * @protected */ this.autoAlpha = false; /** * @property {array} alphaData - A reference to the alphaData array owned by the Emitter that emitted this Particle. * @protected */ this.alphaData = null; /** * @property {number} _a - Internal cache var for tracking auto alpha. * @private */ this._a = 0; }; Phaser.Particle.prototype = Object.create(Phaser.Sprite.prototype); Phaser.Particle.prototype.constructor = Phaser.Particle; /** * Updates the Particle scale or alpha if autoScale and autoAlpha are set. * * @method Phaser.Particle#update * @memberof Phaser.Particle */ Phaser.Particle.prototype.update = function() { if (this.autoScale) { this._s--; if (this._s) { this.scale.set(this.scaleData[this._s].x, this.scaleData[this._s].y); } else { this.autoScale = false; } } if (this.autoAlpha) { this._a--; if (this._a) { this.alpha = this.alphaData[this._a].v; } else { this.autoAlpha = false; } } }; /** * Called by the Emitter when this particle is emitted. Left empty for you to over-ride as required. * * @method Phaser.Particle#onEmit * @memberof Phaser.Particle */ Phaser.Particle.prototype.onEmit = function() { }; /** * Called by the Emitter if autoAlpha has been enabled. Passes over the alpha ease data and resets the alpha counter. * * @method Phaser.Particle#setAlphaData * @memberof Phaser.Particle */ Phaser.Particle.prototype.setAlphaData = function(data) { this.alphaData = data; this._a = data.length - 1; this.alpha = this.alphaData[this._a].v; this.autoAlpha = true; }; /** * Called by the Emitter if autoScale has been enabled. Passes over the scale ease data and resets the scale counter. * * @method Phaser.Particle#setScaleData * @memberof Phaser.Particle */ Phaser.Particle.prototype.setScaleData = function(data) { this.scaleData = data; this._s = data.length - 1; this.scale.set(this.scaleData[this._s].x, this.scaleData[this._s].y); this.autoScale = true; }; /** * Resets the Particle. This places the Particle at the given x/y world coordinates and then * sets alive, exists, visible and renderable all to true. Also resets the outOfBounds state and health values. * If the Particle has a physics body that too is reset. * * @method Phaser.Particle#reset * @memberof Phaser.Particle * @param {number} x - The x coordinate (in world space) to position the Particle at. * @param {number} y - The y coordinate (in world space) to position the Particle at. * @param {number} [health=1] - The health to give the Particle. * @return {Phaser.Particle} This instance. */ Phaser.Particle.prototype.reset = function(x, y, health) { Phaser.Component.Reset.prototype.reset.call(this, x, y, health); this.alpha = 1; this.scale.set(1); this.autoScale = false; this.autoAlpha = false; return this; };
{'content_hash': '24edaa06ce46fb9dbca9b7593e4e267c', 'timestamp': '', 'source': 'github', 'line_count': 161, 'max_line_length': 254, 'avg_line_length': 29.93167701863354, 'alnum_prop': 0.6480597634363976, 'repo_name': 'Jufebrown/mech-combat', 'id': '1e141255b39b7afd2cdf54a3fdf62c0d83149b56', 'size': '5019', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'node_modules/phaser-ce/src/gameobjects/Particle.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '77'}, {'name': 'HTML', 'bytes': '1479'}, {'name': 'JavaScript', 'bytes': '34303'}]}
/** * Array reduceRight */ function reduceRight(arr, fn, initVal) { // check for args.length since initVal might be "undefined" see #gh-57 var hasInit = arguments.length > 2; if (arr == null || !arr.length) { if (hasInit) { return initVal; } else { throw new Error('reduce of empty array with no initial value'); } } var i = arr.length, result = initVal, value; while (--i >= 0) { // we iterate over sparse items since there is no way to make it // work properly on IE 7-8. see #64 value = arr[i]; if (!hasInit) { result = value; hasInit = true; } else { result = fn(result, value, i, arr); } } return result; } module.exports = reduceRight;
{'content_hash': '8593925d98048fd6aa86361d02759e51', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 75, 'avg_line_length': 25.375, 'alnum_prop': 0.5320197044334976, 'repo_name': 'ionutbarau/petstore', 'id': '7bd3e6b7829862d599317c23473b5b8f37856980', 'size': '812', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'petstore-app/src/main/resources/static/node_modules/bower/lib/node_modules/bower-config/node_modules/mout/array/reduceRight.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '5006'}, {'name': 'CSS', 'bytes': '344'}, {'name': 'HTML', 'bytes': '10564'}, {'name': 'Java', 'bytes': '40634'}, {'name': 'JavaScript', 'bytes': '11738'}, {'name': 'Roff', 'bytes': '52499364'}, {'name': 'Shell', 'bytes': '7058'}]}
require_relative 'spec_helper' module LetsCert describe IOPlugin do it '.empty_data always returns the same hash' do hsh = IOPlugin.empty_data expect(hsh.keys.size).to eq(4) [:account_key, :key, :cert, :chain].each do |key| expect(hsh.keys).to include(key) expect(hsh[key]).to be_nil end end it '.register registers known subclasses' do names = %w(account_key.json key.pem key.der chain.pem fullchain.pem) names += %w(cert.pem cert.der) names.each do |name| expect(IOPlugin.registered.keys).to include(name) end end it '.register may register new classes' do class NewIO < IOPlugin;end IOPlugin.register(NewIO, 'newio') expect(IOPlugin.registered.keys).to include('newio') expect(IOPlugin.registered['newio']).to be_a(NewIO) end it '.register raises when plugin name contains a path' do class NewIO2 < IOPlugin; end expect { IOPlugin.register(NewIO2, 'new/io') }.to raise_error(LetsCert::Error) end it '#load raises NotImplementedError' do expect { IOPlugin.new('a').load }.to raise_error(NotImplementedError) end it '#save raises NotImplementedError' do expect { IOPlugin.new('a').save }.to raise_error(NotImplementedError) end end end
{'content_hash': 'd115b0fbd557578dc93ce84fe7ad578b', 'timestamp': '', 'source': 'github', 'line_count': 49, 'max_line_length': 84, 'avg_line_length': 26.979591836734695, 'alnum_prop': 0.6527987897125568, 'repo_name': 'sdaubert/letscert', 'id': '0eb2f856b0e2f8ef602c3dfa0b92fc5a862992b8', 'size': '1322', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spec/io_plugin_spec.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '103056'}]}
extern "Java" { namespace gnu { namespace java { namespace net { namespace protocol { namespace jar { class Handler; } } } } } namespace java { namespace net { class URL; class URLConnection; } } } class gnu::java::net::protocol::jar::Handler : public ::java::net::URLStreamHandler { public: Handler(); public: // actually protected virtual ::java::net::URLConnection * openConnection(::java::net::URL *); virtual void parseURL(::java::net::URL *, ::java::lang::String *, jint, jint); private: static ::java::lang::String * flat(::java::lang::String *); public: // actually protected virtual ::java::lang::String * toExternalForm(::java::net::URL *); public: static ::java::lang::Class class$; }; #endif // __gnu_java_net_protocol_jar_Handler__
{'content_hash': '9fa4241a43d907d9ac8bc6d70a93f4f6', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 83, 'avg_line_length': 19.955555555555556, 'alnum_prop': 0.5734966592427617, 'repo_name': 'the-linix-project/linix-kernel-source', 'id': 'b5fb6b66e640689c067a515654c8dea5f97f2b13', 'size': '1114', 'binary': False, 'copies': '160', 'ref': 'refs/heads/master', 'path': 'gccsrc/gcc-4.7.2/libjava/gnu/java/net/protocol/jar/Handler.h', 'mode': '33188', 'license': 'bsd-2-clause', 'language': [{'name': 'Ada', 'bytes': '38139979'}, {'name': 'Assembly', 'bytes': '3723477'}, {'name': 'Awk', 'bytes': '83739'}, {'name': 'C', 'bytes': '103607293'}, {'name': 'C#', 'bytes': '55726'}, {'name': 'C++', 'bytes': '38577421'}, {'name': 'CLIPS', 'bytes': '6933'}, {'name': 'CSS', 'bytes': '32588'}, {'name': 'Emacs Lisp', 'bytes': '13451'}, {'name': 'FORTRAN', 'bytes': '4294984'}, {'name': 'GAP', 'bytes': '13089'}, {'name': 'Go', 'bytes': '11277335'}, {'name': 'Haskell', 'bytes': '2415'}, {'name': 'Java', 'bytes': '45298678'}, {'name': 'JavaScript', 'bytes': '6265'}, {'name': 'Matlab', 'bytes': '56'}, {'name': 'OCaml', 'bytes': '148372'}, {'name': 'Objective-C', 'bytes': '995127'}, {'name': 'Objective-C++', 'bytes': '436045'}, {'name': 'PHP', 'bytes': '12361'}, {'name': 'Pascal', 'bytes': '40318'}, {'name': 'Perl', 'bytes': '358808'}, {'name': 'Python', 'bytes': '60178'}, {'name': 'SAS', 'bytes': '1711'}, {'name': 'Scilab', 'bytes': '258457'}, {'name': 'Shell', 'bytes': '2610907'}, {'name': 'Tcl', 'bytes': '17983'}, {'name': 'TeX', 'bytes': '1455571'}, {'name': 'XSLT', 'bytes': '156419'}]}
namespace content_settings { class WebsiteSettingsRegistryTest : public testing::Test { protected: WebsiteSettingsRegistry* registry() { return &registry_; } private: WebsiteSettingsRegistry registry_; }; TEST_F(WebsiteSettingsRegistryTest, Get) { // CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE should be registered. const WebsiteSettingsInfo* info = registry()->Get(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE); ASSERT_TRUE(info); EXPECT_EQ(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, info->type()); EXPECT_EQ("auto-select-certificate", info->name()); } TEST_F(WebsiteSettingsRegistryTest, GetByName) { // Random string shouldn't be registered. EXPECT_FALSE(registry()->GetByName("abc")); // "auto-select-certificate" should be registered. const WebsiteSettingsInfo* info = registry()->GetByName("auto-select-certificate"); ASSERT_TRUE(info); EXPECT_EQ(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, info->type()); EXPECT_EQ("auto-select-certificate", info->name()); EXPECT_EQ(registry()->Get(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE), info); // Register a new setting. registry()->Register(static_cast<ContentSettingsType>(10), "test", nullptr, WebsiteSettingsInfo::UNSYNCABLE, WebsiteSettingsInfo::LOSSY, WebsiteSettingsInfo::TOP_LEVEL_ORIGIN_ONLY_SCOPE, WebsiteSettingsRegistry::ALL_PLATFORMS, WebsiteSettingsInfo::INHERIT_IN_INCOGNITO); info = registry()->GetByName("test"); ASSERT_TRUE(info); EXPECT_EQ(10, info->type()); EXPECT_EQ("test", info->name()); EXPECT_EQ(registry()->Get(static_cast<ContentSettingsType>(10)), info); } TEST_F(WebsiteSettingsRegistryTest, GetPlatformDependent) { #if defined(OS_IOS) // App banner shouldn't be registered on iOS. EXPECT_FALSE(registry()->Get(CONTENT_SETTINGS_TYPE_APP_BANNER)); #else // App banner should be registered on other platforms. EXPECT_TRUE(registry()->Get(CONTENT_SETTINGS_TYPE_APP_BANNER)); #endif // Auto select certificate is registered on all platforms. EXPECT_TRUE(registry()->Get(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE)); } TEST_F(WebsiteSettingsRegistryTest, Properties) { // "auto-select-certificate" should be registered. const WebsiteSettingsInfo* info = registry()->Get(CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE); ASSERT_TRUE(info); EXPECT_EQ("profile.content_settings.exceptions.auto_select_certificate", info->pref_name()); EXPECT_EQ("profile.default_content_setting_values.auto_select_certificate", info->default_value_pref_name()); ASSERT_FALSE(info->initial_default_value()); EXPECT_EQ(PrefRegistry::NO_REGISTRATION_FLAGS, info->GetPrefRegistrationFlags()); // Register a new setting. registry()->Register(static_cast<ContentSettingsType>(10), "test", base::WrapUnique(new base::FundamentalValue(999)), WebsiteSettingsInfo::SYNCABLE, WebsiteSettingsInfo::LOSSY, WebsiteSettingsInfo::TOP_LEVEL_ORIGIN_ONLY_SCOPE, WebsiteSettingsRegistry::ALL_PLATFORMS, WebsiteSettingsInfo::INHERIT_IN_INCOGNITO); info = registry()->Get(static_cast<ContentSettingsType>(10)); ASSERT_TRUE(info); EXPECT_EQ("profile.content_settings.exceptions.test", info->pref_name()); EXPECT_EQ("profile.default_content_setting_values.test", info->default_value_pref_name()); int setting; ASSERT_TRUE(info->initial_default_value()->GetAsInteger(&setting)); EXPECT_EQ(999, setting); #if defined(OS_IOS) EXPECT_EQ(PrefRegistry::LOSSY_PREF, info->GetPrefRegistrationFlags()); #else EXPECT_EQ(PrefRegistry::LOSSY_PREF | user_prefs::PrefRegistrySyncable::SYNCABLE_PREF, info->GetPrefRegistrationFlags()); #endif EXPECT_EQ(WebsiteSettingsInfo::TOP_LEVEL_ORIGIN_ONLY_SCOPE, info->scoping_type()); EXPECT_EQ(WebsiteSettingsInfo::INHERIT_IN_INCOGNITO, info->incognito_behavior()); } TEST_F(WebsiteSettingsRegistryTest, Iteration) { registry()->Register(static_cast<ContentSettingsType>(10), "test", base::WrapUnique(new base::FundamentalValue(999)), WebsiteSettingsInfo::SYNCABLE, WebsiteSettingsInfo::LOSSY, WebsiteSettingsInfo::TOP_LEVEL_ORIGIN_ONLY_SCOPE, WebsiteSettingsRegistry::ALL_PLATFORMS, WebsiteSettingsInfo::INHERIT_IN_INCOGNITO); bool found = false; for (const WebsiteSettingsInfo* info : *registry()) { EXPECT_EQ(registry()->Get(info->type()), info); if (info->type() == 10) { EXPECT_FALSE(found); found = true; } } EXPECT_TRUE(found); } } // namespace content_settings
{'content_hash': '79a080a21e9aacd0ed464a6b6425897c', 'timestamp': '', 'source': 'github', 'line_count': 123, 'max_line_length': 78, 'avg_line_length': 39.89430894308943, 'alnum_prop': 0.6723048705930303, 'repo_name': 'danakj/chromium', 'id': '5e3630c0a84f4fdb7104f1a6dedfd1e6ffe9d708', 'size': '5614', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'components/content_settings/core/browser/website_settings_registry_unittest.cc', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []}
import * as React from "react"; import ReactModal from "react-modal"; import { Config } from "../../../data/Config"; import { OnMobile, OnMobileTablet, OnDesktop, OnTablet } from "../../../helpers/Breakpoints"; import { smoothScrollTo } from "../../../helpers/smoothScrollTo"; import { formatNumber } from "../../../helpers/formatNumber"; import { translate } from "../../../helpers/translate"; import { TransformAnimation } from "../../Animations/Interactive/TransformAnimation"; import { getCorners, getLabel, CloseButton, SubmitButton } from "../../Buttons"; import { SocialLinks } from "../../Layout/Partials"; import { PartnershipPageState } from "./PartnershipPageState"; import { MapIcon } from "../../Icons/MapIcon"; import { ContactForm } from "./ContactForm"; import { BasePage } from "../BasePage"; export class PartnershipPage extends BasePage<{}, PartnershipPageState> { public state: PartnershipPageState = { isModalOpen: false, }; public shouldComponentUpdate(nextProps: undefined, nextState: PartnershipPageState, nextContext: any): boolean { return super.shouldComponentUpdate(nextProps, nextState, nextContext) || this.state.isModalOpen !== nextState.isModalOpen; } public render(): JSX.Element { const modalProps = { className: { base: "modal", afterOpen: "", beforeClose: "", }, overlayClassName: { base: "modal-overlay", afterOpen: "modal-opened", beforeClose: "modal-close", }, closeTimeoutMS: 500 }; const transformAnimationProps = { transformedComponent: <ContactForm/>, staticComponent: getCorners(), initialComponent: getLabel(), className: "btn btn_transform", onEvent() { const { className, duration } = this as any; smoothScrollTo( document.getElementsByClassName(className)[ 0 ] as HTMLElement, -105, "top", duration, 0 ); }, duration: 1000, event: "onClick" }; return ( <section className="section section-partnership"> <div className="align-container"> <h2 className="section__title">{translate("contactPage.title")}</h2> <div className="section__half half_first"> <OnDesktop> <ContactForm/> </OnDesktop> </div> <div className="section__half half_second"> <div className="contact-info"> <OnDesktop> <a href={`tel:+${Config.phone}`} className="contact-info__link"> {formatNumber(Config.phone, "+xxx xx xxx-xx-xx")} </a> <a href={`mailto:${Config.mail}`} className="contact-info__link">{Config.mail}</a> <p className="contact-info__text contact-info__text_indented"> <span className="text_regular">{translate("contactPage.support.title")}</span> {translate("contactPage.support.subTitle")} <span className="contact-info__text_increased">24 <span className="separator">/</span>7 </span> </p> <p className="contact-info__text"> <span className="text_regular">{translate("contactPage.location.title")}</span> {translate(Config.location.country)}&nbsp; <span className="separator">/</span> &nbsp;{translate(Config.location.city)} </p> </OnDesktop> <OnTablet> <p className="contact-info__text contact-info__text_indented"> <span className="text_regular">{translate("contactPage.support.title")}</span> {translate("contactPage.support.subTitle")} <span className="contact-info__text_increased">24/7</span> </p> <div className="align-container"> <a href={`tel:+${Config.phone}`} className="contact-info__link"> {formatNumber(Config.phone, "+xxx xx xxx-xx-xx")} </a> <a href={`mailto:${Config.mail}`} className="contact-info__link">{Config.mail}</a> </div> <SubmitButton type="button" onClick={this.handleOpenModal} label={translate("buttons.cooperate")} /> <p className="contact-info__text"> <span className="text_regular">{translate("contactPage.location.title")}</span> {translate(Config.location.country)} / {translate(Config.location.city)} </p> </OnTablet> <OnMobile> <p className="contact-info__text contact-info__text_indented"> <span className="text_regular">{translate("contactPage.support.title")}</span> {translate("contactPage.support.subTitle")} <span className="contact-info__text_increased">24/7</span> </p> <p className="contact-info__text"> <span className="text_regular">{translate("contactPage.location.title")}</span> {translate(Config.location.country)} / {translate(Config.location.city)} </p> <div className="align-container"> <a href={`tel:+${Config.phone}`} className="contact-info__link"> {formatNumber(Config.phone, "+xxx xx xxx-xx-xx")}&nbsp; </a> <a href={`mailto:${Config.mail}`} className="contact-info__link">{Config.mail}</a> </div> <TransformAnimation {...transformAnimationProps}/> <SocialLinks/> </OnMobile> </div> </div> <OnMobileTablet> <ReactModal isOpen={this.state.isModalOpen} contentLabel="Modal-partnership" {...modalProps} > <div className="modal__header"> <a href="#" className="logo"> <i className="icon icon_logo"/> </a> <CloseButton className="btn btn_close" onClick={this.handleCloseModal}/> <h3 className="modal__title">{translate("contactPage.form.title")}</h3> </div> <div className="modal__body"> <ContactForm onClose={this.handleCloseModal}/> </div> </ReactModal> </OnMobileTablet> <div className="map-container"> <MapIcon/> <div className="slider"> <div className="slider__body"> <div className="slider__bar"/> <div className="slider__dot"/> </div> <div className="slider__description"> <span className="slider__location"> {Config.location.country} / {Config.location.city} </span> <span className="slider__coordinates"> {Config.location.coordinates.lat}&deg;&nbsp; {Config.location.coordinates.lng}&deg; </span> </div> </div> </div> </div> </section> ); } protected handleCloseModal = () => { this.setState({ isModalOpen: false }); }; protected handleOpenModal = () => { this.setState({ isModalOpen: true }); }; }
{'content_hash': 'c80d081dd615ce08644f050956bfc6e3', 'timestamp': '', 'source': 'github', 'line_count': 184, 'max_line_length': 118, 'avg_line_length': 51.56521739130435, 'alnum_prop': 0.4267495784148398, 'repo_name': 'wearesho-team/wearesho-site', 'id': 'fd2e5a37cc3f947a11a44e2e702332375fc1dbcf', 'size': '9488', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/components/Pages/PartnershipPage/PartnershipPage.tsx', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Dockerfile', 'bytes': '354'}, {'name': 'Groovy', 'bytes': '778'}, {'name': 'HTML', 'bytes': '3074'}, {'name': 'JavaScript', 'bytes': '10809'}, {'name': 'SCSS', 'bytes': '128541'}, {'name': 'TypeScript', 'bytes': '331858'}]}
'use strict'; /** * @ngdoc directive * @name izzyposWebApp.directive:adminPosHeader * @description * # adminPosHeader */ angular.module('sbAdminApp') .directive('siteheader',function(){ return { templateUrl:'scripts/directives/header/siteheader.html', restrict: 'E', replace: true } }).directive('dashboardheader',function(){ return { templateUrl:'scripts/directives/header/dashboard_header.html', restrict: 'E', replace: true } }).directive('cpdashboardheader',function(){ return { templateUrl:'scripts/directives/header/cp_dashboard_header.html', restrict: 'E', replace: true } }).directive('vendordashboardheader',function(){ return { templateUrl:'scripts/directives/header/vendor_dashboard_header.html', restrict: 'E', replace: true } }).directive('admindashboardheader',function(){ return { templateUrl:'scripts/directives/header/admin_dashboard_header.html', restrict: 'E', replace: true } });
{'content_hash': '2dc593900bc99f05643f2e599332ceae', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 81, 'avg_line_length': 25.42222222222222, 'alnum_prop': 0.5961538461538461, 'repo_name': 'kodebees/testing-sandbox', 'id': '922b7a66ec6d6c65857d24e550d04489b4c7e45d', 'size': '1144', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/scripts/directives/header/header.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ApacheConf', 'bytes': '24139'}, {'name': 'CSS', 'bytes': '16010'}, {'name': 'HTML', 'bytes': '275958'}, {'name': 'JavaScript', 'bytes': '62897'}]}
const express = require('express'); const router = express.Router(); // const Note = require('../models/note.model'); // need this for below router.params const note = require('../controllers/note.ctrl'); // router.params('id', (req, res, next, id) => { // if an id parameter is present, this grabs it so we dont need // Note.findById(id, (err, note) => { // multiple ".findById()" methods in the controller // if(err) throw err; // req.note = note; // next(); // }); // }); router.get('/notes', note.index); router.get('/notes/new', note.newNote); router.get('/notes/:id', note.show); router.get('/notes/:id/edit', note.edit); router.put('/notes/:id', note.update); router.delete('/notes/:id', note.destroy); router.post('/notes', note.create); module.exports = router;
{'content_hash': '8c26a0a30648e8179e27b55b7bcd7451', 'timestamp': '', 'source': 'github', 'line_count': 23, 'max_line_length': 112, 'avg_line_length': 34.78260869565217, 'alnum_prop': 0.63375, 'repo_name': 'ldougher06/c11_evernode', 'id': '56216058d1e93026de87b3dd5e466ccfb5da8af7', 'size': '800', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'routes/note.route.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '989'}, {'name': 'JavaScript', 'bytes': '4648'}]}
package org.springframework.boot.actuate.autoconfigure.metrics.test; import java.util.Collections; import java.util.Map; import java.util.Set; import java.util.concurrent.CyclicBarrier; import javax.servlet.DispatcherType; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.MockClock; import io.micrometer.core.instrument.binder.MeterBinder; import io.micrometer.core.instrument.binder.jvm.JvmMemoryMetrics; import io.micrometer.core.instrument.binder.logging.LogbackMetrics; import io.micrometer.core.instrument.simple.SimpleConfig; import io.micrometer.core.instrument.simple.SimpleMeterRegistry; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.actuate.autoconfigure.metrics.JvmMetricsAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.LogbackMetricsAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.SystemMetricsAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.amqp.RabbitMetricsAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.cache.CacheMetricsAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.jdbc.DataSourcePoolMetricsAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.orm.jpa.HibernateMetricsAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.web.client.HttpClientMetricsAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.web.reactive.WebFluxMetricsAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.metrics.web.servlet.WebMvcMetricsAutoConfiguration; import org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration; import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration; import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.ServletWebServerFactoryAutoConfiguration; import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Primary; import org.springframework.http.HttpMethod; import org.springframework.http.MediaType; import org.springframework.test.util.ReflectionTestUtils; import org.springframework.test.web.client.MockRestServiceServer; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.test.web.client.ExpectedCount.once; import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; /** * Integration tests for Metrics. * * @author Jon Schneider */ @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = MetricsIntegrationTests.MetricsApp.class, properties = "management.metrics.use-global-registry=false") public class MetricsIntegrationTests { @Autowired private ApplicationContext context; @Autowired private RestTemplate external; @Autowired private TestRestTemplate loopback; @Autowired private MeterRegistry registry; @SuppressWarnings("unchecked") @Test public void restTemplateIsInstrumented() { MockRestServiceServer server = MockRestServiceServer.bindTo(this.external) .build(); server.expect(once(), requestTo("/api/external")) .andExpect(method(HttpMethod.GET)).andRespond(withSuccess( "{\"message\": \"hello\"}", MediaType.APPLICATION_JSON)); assertThat(this.external.getForObject("/api/external", Map.class)) .containsKey("message"); assertThat(this.registry.get("http.client.requests").timer().count()) .isEqualTo(1); } @Test public void requestMappingIsInstrumented() { this.loopback.getForObject("/api/people", Set.class); assertThat(this.registry.get("http.server.requests").timer().count()) .isEqualTo(1); } @Test public void automaticallyRegisteredBinders() { assertThat(this.context.getBeansOfType(MeterBinder.class).values()) .hasAtLeastOneElementOfType(LogbackMetrics.class) .hasAtLeastOneElementOfType(JvmMemoryMetrics.class); } @Test @SuppressWarnings({ "rawtypes", "unchecked" }) public void metricsFilterRegisteredForAsyncDispatches() { Map<String, FilterRegistrationBean> filterRegistrations = this.context .getBeansOfType(FilterRegistrationBean.class); assertThat(filterRegistrations).containsKey("webMvcMetricsFilter"); FilterRegistrationBean registration = filterRegistrations .get("webMvcMetricsFilter"); assertThat(registration.getFilter()).isInstanceOf(WebMvcMetricsFilter.class); assertThat((Set<DispatcherType>) ReflectionTestUtils.getField(registration, "dispatcherTypes")).containsExactlyInAnyOrder(DispatcherType.REQUEST, DispatcherType.ASYNC); } @Configuration(proxyBeanMethods = false) @ImportAutoConfiguration({ MetricsAutoConfiguration.class, JvmMetricsAutoConfiguration.class, LogbackMetricsAutoConfiguration.class, SystemMetricsAutoConfiguration.class, RabbitMetricsAutoConfiguration.class, CacheMetricsAutoConfiguration.class, DataSourcePoolMetricsAutoConfiguration.class, HibernateMetricsAutoConfiguration.class, HttpClientMetricsAutoConfiguration.class, WebFluxMetricsAutoConfiguration.class, WebMvcMetricsAutoConfiguration.class, JacksonAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class, RestTemplateAutoConfiguration.class, WebMvcAutoConfiguration.class, DispatcherServletAutoConfiguration.class, ServletWebServerFactoryAutoConfiguration.class }) @Import(PersonController.class) static class MetricsApp { @Primary @Bean public MeterRegistry registry() { return new SimpleMeterRegistry(SimpleConfig.DEFAULT, new MockClock()); } @Bean public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) { return restTemplateBuilder.build(); } @Bean public CyclicBarrier cyclicBarrier() { return new CyclicBarrier(2); } } @RestController static class PersonController { @GetMapping("/api/people") Set<String> personName() { return Collections.singleton("Jon"); } } }
{'content_hash': '71bc690cf69ccb97014ef702ae5dae8a', 'timestamp': '', 'source': 'github', 'line_count': 173, 'max_line_length': 108, 'avg_line_length': 42.820809248554916, 'alnum_prop': 0.8353131749460043, 'repo_name': 'lburgazzoli/spring-boot', 'id': 'e98552b7ebf86f23ce82fed374d90e3b26640e1a', 'size': '8029', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/test/MetricsIntegrationTests.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '6954'}, {'name': 'CSS', 'bytes': '5769'}, {'name': 'FreeMarker', 'bytes': '2134'}, {'name': 'Groovy', 'bytes': '49512'}, {'name': 'HTML', 'bytes': '69689'}, {'name': 'Java', 'bytes': '11602150'}, {'name': 'JavaScript', 'bytes': '37789'}, {'name': 'Ruby', 'bytes': '1307'}, {'name': 'Shell', 'bytes': '27916'}, {'name': 'Smarty', 'bytes': '3276'}, {'name': 'XSLT', 'bytes': '34105'}]}
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Views extends Application { public function index() { $this->data['pagetitle'] = 'Ordered TODO List'; $tasks = $this->tasks->all(); // get all the tasks $this->data['content'] = 'Ok'; // so we don't need pagebody $this->data['leftside'] = $this->makePrioritizedPanel($tasks); $this->data['rightside'] = $this->makeCategorizedPanel($tasks); $this->render('template_secondary'); } function makePrioritizedPanel($tasks) { foreach ($tasks as $task) { if ($task->status != 2) $undone[] = $task; } usort($undone, "orderByPriority"); foreach ($undone as $task) $task->priority = $this->priorities->get($task->priority)->name; foreach ($undone as $task) $converted[] = (array) $task; $parms = ['display_tasks' => $converted]; $role = $this->session->userdata('userrole'); $parms['completer'] = ($role == ROLE_OWNER) ? '/views/complete' : '#'; return $this->parser->parse('by_priority', $parms, true); } function makeCategorizedPanel($tasks) { $parms = ['display_tasks' => $this->tasks->getCategorizedTasks()]; $role = $this->session->userdata('userrole'); $parms['completer'] = ($role == ROLE_OWNER) ? '/views/complete' : '#'; return $this->parser->parse('by_category',$parms,true); } function complete(){ $role = $this->session->userdata('userrole'); if ($role != ROLE_OWNER) redirect('/work'); foreach($this->input->post() as $key=>$value){ if(substr($key,0,4) == 'task'){ $taskid = substr($key,4); $task = $this->tasks->get($taskid); $task->status = 2; $this->tasks->update($task); } } $this->index(); } } function orderByPriority($a, $b) { if ($a->priority > $b->priority) return -1; elseif ($a->priority < $b->priority) return 1; else return 0; }
{'content_hash': 'cace378dfe7f31a84e026385520da689', 'timestamp': '', 'source': 'github', 'line_count': 71, 'max_line_length': 78, 'avg_line_length': 31.140845070422536, 'alnum_prop': 0.5133423790140208, 'repo_name': 'Comp4711Lab5-Carmen-Hanuk/lab5', 'id': '47267265ba278d4d389c32546da0ab59f900a73c', 'size': '2211', 'binary': False, 'copies': '2', 'ref': 'refs/heads/develop', 'path': 'application/controllers/Views.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '602'}, {'name': 'CSS', 'bytes': '1235'}, {'name': 'HTML', 'bytes': '5633'}, {'name': 'PHP', 'bytes': '1815269'}]}
package edu.cs4730.mywatchface; import android.annotation.SuppressLint; import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Typeface; import android.content.Context; import android.view.SurfaceHolder; import java.time.ZonedDateTime; import java.util.Calendar; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.content.ContextCompat; import androidx.wear.watchface.CanvasType; import androidx.wear.watchface.ComplicationSlotsManager; import androidx.wear.watchface.DrawMode; import androidx.wear.watchface.RenderParameters; import androidx.wear.watchface.Renderer; import androidx.wear.watchface.WatchFace; import androidx.wear.watchface.WatchFaceService; import androidx.wear.watchface.WatchFaceType; import androidx.wear.watchface.WatchState; import androidx.wear.watchface.style.CurrentUserStyleRepository; import kotlin.coroutines.Continuation; import static android.graphics.Color.*; /** * this code is based off google's original example, but updated to point, it is likely * no longer recognizable. */ public class myWatchFaceService extends WatchFaceService { private static final String TAG = "myWatchFaceService"; private static final Typeface BOLD_TYPEFACE = Typeface.create(Typeface.SANS_SERIF, Typeface.BOLD); private static final Typeface NORMAL_TYPEFACE = Typeface.create(Typeface.SANS_SERIF, Typeface.NORMAL); @Nullable @Override protected WatchFace createWatchFace(@NonNull SurfaceHolder surfaceHolder, @NonNull WatchState watchState, @NonNull ComplicationSlotsManager complicationSlotsManager, @NonNull CurrentUserStyleRepository currentUserStyleRepository, @NonNull Continuation<? super WatchFace> continuation) { return new WatchFace( WatchFaceType.DIGITAL, new myWatchFaceService.myCanvasRender(getApplicationContext(), surfaceHolder, watchState, complicationSlotsManager, currentUserStyleRepository, CanvasType.HARDWARE) ); } class myCanvasRender extends Renderer.CanvasRenderer2<myWatchFaceService.myCanvasRender.myShareAssets> { static private final long FRAME_PERIOD_MS_DEFAULT = 16L; final boolean clearWithBackgroundTintBeforeRenderingHighlightLayer = false; Context context; SurfaceHolder surfaceHolder; WatchState watchState; ComplicationSlotsManager complicationSlotsManager; CurrentUserStyleRepository currentUserStyleRepository; int canvasType; Paint mBackgroundPaint; Paint mHourPaint; Paint mMinutePaint; Paint mSecondPaint; Paint mAmPmPaint; Paint mColonPaint; float mColonWidth; Calendar mTime; boolean mShouldDrawColons; float mXOffset; float mYOffset; String mAmString; String mPmString; int mInteractiveBackgroundColor = Color.BLACK;//parseColor("black"); int mInteractiveHourDigitsColor = parseColor("white"); int mInteractiveMinuteDigitsColor = parseColor("white"); int mInteractiveSecondDigitsColor = parseColor("gray"); boolean mAmbient; static final String COLON_STRING = ":"; @Override public void render(@NonNull Canvas canvas, @NonNull Rect bounds, @NonNull ZonedDateTime zonedDateTime, @NonNull myWatchFaceService.myCanvasRender.myShareAssets myShareAssets) { RenderParameters renderParameters = getRenderParameters(); mAmbient = renderParameters.getDrawMode() == DrawMode.AMBIENT; // Calendar cal = new Calendar(getSystemTimeProvider().getSystemTimeMillis()); mTime = Calendar.getInstance(); /* draw your watch face */ // Show colons for the first half of each second so the colons blink on when the time // updates. mShouldDrawColons = (System.currentTimeMillis() % 1000) < 500; // Draw the background. canvas.drawRect(0, 0, bounds.width(), bounds.height(), mBackgroundPaint); // Draw the hours. float x = mXOffset; String hourString = String.valueOf(convertTo12Hour(mTime.get(Calendar.HOUR))); canvas.drawText(hourString, x, mYOffset, mHourPaint); x += mHourPaint.measureText(hourString); // In ambient and mute modes, always draw the first colon. Otherwise, draw the // first colon for the first half of each second. if (mAmbient || mShouldDrawColons) { canvas.drawText(COLON_STRING, x, mYOffset, mColonPaint); } x += mColonWidth; // Draw the minutes. String minuteString = formatTwoDigitNumber(mTime.get(Calendar.MINUTE)); canvas.drawText(minuteString, x, mYOffset, mMinutePaint); x += mMinutePaint.measureText(minuteString); // In ambient and mute modes, draw AM/PM. Otherwise, draw a second blinking // colon followed by the seconds. if (mAmbient) { x += mColonWidth; canvas.drawText(getAmPmString(mTime.get(Calendar.HOUR)), x, mYOffset, mAmPmPaint); } else { if (mShouldDrawColons) { canvas.drawText(COLON_STRING, x, mYOffset, mColonPaint); } x += mColonWidth; canvas.drawText(formatTwoDigitNumber(mTime.get(Calendar.SECOND)), x, mYOffset, mSecondPaint); } } @Override public void renderHighlightLayer(@NonNull Canvas canvas, @NonNull Rect rect, @NonNull ZonedDateTime zonedDateTime, @NonNull myShareAssets myShareAssets) { ///what does this do?? no documentation as to it use. } class myShareAssets implements SharedAssets { @Override public void onDestroy() { } } @Nullable @Override public myWatchFaceService.myCanvasRender.myShareAssets createSharedAssets(@NonNull Continuation completion) { return new myWatchFaceService.myCanvasRender.myShareAssets(); } private Paint createTextPaint(int defaultInteractiveColor) { return createTextPaint(defaultInteractiveColor, NORMAL_TYPEFACE); } private Paint createTextPaint(int defaultInteractiveColor, Typeface typeface) { Paint paint = new Paint(); paint.setColor(defaultInteractiveColor); paint.setTypeface(typeface); paint.setAntiAlias(true); return paint; } @SuppressLint("DefaultLocale") private String formatTwoDigitNumber(int hour) { return String.format("%02d", hour); } private int convertTo12Hour(int hour) { int result = hour % 12; return (result == 0) ? 12 : result; } private String getAmPmString(int hour) { return (hour < 12) ? mAmString : mPmString; } public myCanvasRender(@NonNull Context mcontext, @NonNull SurfaceHolder msurfaceHolder, @NonNull WatchState mwatchState, @NonNull ComplicationSlotsManager mcomplicationSlotsManager, @NonNull final CurrentUserStyleRepository mcurrentUserStyleRepository, int mcanvasType) { super(msurfaceHolder, mcurrentUserStyleRepository, mwatchState, mcanvasType, FRAME_PERIOD_MS_DEFAULT, false); context = mcontext; surfaceHolder = msurfaceHolder; watchState = mwatchState; complicationSlotsManager = mcomplicationSlotsManager; currentUserStyleRepository = mcurrentUserStyleRepository; canvasType = mcanvasType; //setup initial Paint colors. mBackgroundPaint = new Paint(); mBackgroundPaint.setColor(Color.BLACK); mBackgroundPaint.setAntiAlias(true); Resources resources = myWatchFaceService.this.getResources(); //setup variables. mYOffset = resources.getDimension(R.dimen.digital_y_offset); mAmString = resources.getString(R.string.digital_am); mPmString = resources.getString(R.string.digital_pm); mBackgroundPaint = new Paint(); mBackgroundPaint.setColor(mInteractiveBackgroundColor); mHourPaint = createTextPaint(mInteractiveHourDigitsColor, BOLD_TYPEFACE); mMinutePaint = createTextPaint(mInteractiveMinuteDigitsColor); mSecondPaint = createTextPaint(mInteractiveSecondDigitsColor); mAmPmPaint = createTextPaint(ContextCompat.getColor(getApplicationContext(), R.color.digital_am_pm)); mColonPaint = createTextPaint(ContextCompat.getColor(getApplicationContext(), R.color.digital_colons)); surfaceHolder.getSurfaceFrame(); boolean isRound = true; //how determine it's round or not? mXOffset = resources.getDimension(isRound ? R.dimen.digital_x_offset_round : R.dimen.digital_x_offset); float textSize = resources.getDimension(isRound ? R.dimen.digital_text_size_round : R.dimen.digital_text_size); float amPmSize = resources.getDimension(isRound ? R.dimen.digital_am_pm_size_round : R.dimen.digital_am_pm_size); mHourPaint.setTextSize(textSize); mMinutePaint.setTextSize(textSize); mSecondPaint.setTextSize(textSize); mAmPmPaint.setTextSize(amPmSize); mColonPaint.setTextSize(textSize); mColonWidth = mColonPaint.measureText(COLON_STRING); } } }
{'content_hash': '662289d194fa0dc24681026778ef4ff9', 'timestamp': '', 'source': 'github', 'line_count': 245, 'max_line_length': 279, 'avg_line_length': 40.4, 'alnum_prop': 0.669529197817741, 'repo_name': 'JimSeker/wearable', 'id': 'abfa747f133f1cd01d61ecddfafdfe7a860b8f13', 'size': '9898', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'wear3/myWatchFace/wear/src/main/java/edu/cs4730/mywatchface/myWatchFaceService.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '206738'}]}
package android.net; /** * Thrown when parsing a URL fails. */ // See non-public class {@link WebAddress}. public class ParseException extends RuntimeException { public String response; ParseException(String response) { this.response = response; } }
{'content_hash': 'ae4c16d0b0593890cfc31e9b836bc7dd', 'timestamp': '', 'source': 'github', 'line_count': 15, 'max_line_length': 54, 'avg_line_length': 18.4, 'alnum_prop': 0.6884057971014492, 'repo_name': 'haikuowuya/android_system_code', 'id': '68b209b6d81ba3aaa6c7d1047002a99a36863e93', 'size': '895', 'binary': False, 'copies': '16', 'ref': 'refs/heads/master', 'path': 'src/android/net/ParseException.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '182432'}, {'name': 'Java', 'bytes': '124952631'}]}
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; namespace osu.Game.Database { /// <summary> /// Represents a model manager that publishes events when <typeparamref name="TModel"/>s are added or removed. /// </summary> /// <typeparam name="TModel">The model type.</typeparam> public interface IModelManager<out TModel> where TModel : class { event Action<TModel> ItemAdded; event Action<TModel> ItemRemoved; } }
{'content_hash': '87745d719286916d2f08eb1280091505', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 114, 'avg_line_length': 30.63157894736842, 'alnum_prop': 0.6752577319587629, 'repo_name': 'EVAST9919/osu', 'id': '1bdbbb48e6fd1e0ad490e51500a5b4b4f818bca8', 'size': '584', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'osu.Game/Database/IModelManager.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '6595208'}, {'name': 'PowerShell', 'bytes': '936'}, {'name': 'Ruby', 'bytes': '7983'}]}
package streaming_mysql_backup_tool /* * File Generated by enaml generator * !!! Please do not edit this file !!! */ type BackupServer struct { /*Port - Descr: Port number used for listening for backup requests Default: 8081 */ Port interface{} `yaml:"port,omitempty"` }
{'content_hash': 'b02fed02f45e12ec0b36e42ef9c22b02', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 81, 'avg_line_length': 22.916666666666668, 'alnum_prop': 0.72, 'repo_name': 'enaml-ops/ert-plugin', 'id': '719c1e482e14dbdb6461ccc5f649da60a8bf2e08', 'size': '275', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'enaml-gen/streaming-mysql-backup-tool/backupserver.go', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Go', 'bytes': '862257'}, {'name': 'Shell', 'bytes': '521'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" /> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="lang:clipboard.copy" content="Copy to clipboard"> <meta name="lang:clipboard.copied" content="Copied to clipboard"> <meta name="lang:search.language" content="en"> <meta name="lang:search.pipeline.stopwords" content="True"> <meta name="lang:search.pipeline.trimmer" content="True"> <meta name="lang:search.result.none" content="No matching documents"> <meta name="lang:search.result.one" content="1 matching document"> <meta name="lang:search.result.other" content="# matching documents"> <meta name="lang:search.tokenizer" content="[\s\-]+"> <link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin> <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet"> <style> body, input { font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif } code, kbd, pre { font-family: "Roboto Mono", "Courier New", Courier, monospace } </style> <link rel="stylesheet" href="../_static/stylesheets/application.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/> <link rel="stylesheet" href="../_static/fonts/material-icons.css"/> <meta name="theme-color" content="#3f51b5"> <script src="../_static/javascripts/modernizr.js"></script> <title>statsmodels.discrete.conditional_models.ConditionalLogit.information &#8212; statsmodels</title> <link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png"> <link rel="manifest" href="../_static/icons/site.webmanifest"> <link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191"> <meta name="msapplication-TileColor" content="#2b5797"> <meta name="msapplication-config" content="../_static/icons/browserconfig.xml"> <link rel="stylesheet" href="../_static/stylesheets/examples.css"> <link rel="stylesheet" href="../_static/stylesheets/deprecation.css"> <link rel="stylesheet" type="text/css" href="../_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="../_static/material.css" /> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" /> <link rel="stylesheet" type="text/css" href="../_static/plot_directive.css" /> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script> <script src="../_static/doctools.js"></script> <script src="../_static/sphinx_highlight.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="statsmodels.discrete.conditional_models.ConditionalLogit.initialize" href="statsmodels.discrete.conditional_models.ConditionalLogit.initialize.html" /> <link rel="prev" title="statsmodels.discrete.conditional_models.ConditionalLogit.hessian" href="statsmodels.discrete.conditional_models.ConditionalLogit.hessian.html" /> </head> <body dir=ltr data-md-color-primary=indigo data-md-color-accent=blue> <svg class="md-svg"> <defs data-children-count="0"> <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg> </defs> </svg> <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search"> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <a href="#generated/statsmodels.discrete.conditional_models.ConditionalLogit.information" tabindex="1" class="md-skip"> Skip to content </a> <header class="md-header" data-md-component="header"> <nav class="md-header-nav md-grid"> <div class="md-flex navheader"> <div class="md-flex__cell md-flex__cell--shrink"> <a href="../index.html" title="statsmodels" class="md-header-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" height="26" alt="statsmodels logo"> </a> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label> </div> <div class="md-flex__cell md-flex__cell--stretch"> <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title"> <span class="md-header-nav__topic">statsmodels 0.13.5</span> <span class="md-header-nav__topic"> statsmodels.discrete.conditional_models.ConditionalLogit.information </span> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> <div class="md-search" data-md-component="search" role="dialog"> <label class="md-search__overlay" for="__search"></label> <div class="md-search__inner" role="search"> <form class="md-search__form" action="../search.html" method="get" name="search"> <input type="text" class="md-search__input" name="q" placeholder="Search" autocapitalize="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <label class="md-icon md-search__icon" for="__search"></label> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> &#xE5CD; </button> </form> <div class="md-search__output"> <div class="md-search__scrollwrap" data-md-scrollfix> <div class="md-search-result" data-md-component="result"> <div class="md-search-result__meta"> Type to start searching </div> <ol class="md-search-result__list"></ol> </div> </div> </div> </div> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <div class="md-header-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> </div> <script src="../_static/javascripts/version_dropdown.js"></script> <script> var json_loc = "../../versions-v2.json", target_loc = "../../", text = "Versions"; $( document ).ready( add_version_dropdown(json_loc, target_loc, text)); </script> </div> </nav> </header> <div class="md-container"> <nav class="md-tabs" data-md-component="tabs"> <div class="md-tabs__inner md-grid"> <ul class="md-tabs__list"> <li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li> <li class="md-tabs__item"><a href="../discretemod.html" class="md-tabs__link">Regression with Discrete Dependent Variable</a></li> <li class="md-tabs__item"><a href="statsmodels.discrete.conditional_models.ConditionalLogit.html" class="md-tabs__link">statsmodels.discrete.conditional_models.ConditionalLogit</a></li> </ul> </div> </nav> <main class="md-main"> <div class="md-main__inner md-grid" data-md-component="container"> <div class="md-sidebar md-sidebar--primary" data-md-component="navigation"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--primary" data-md-level="0"> <label class="md-nav__title md-nav__title--site" for="__drawer"> <a href="../index.html" title="statsmodels" class="md-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48"> </a> <a href="../index.html" title="statsmodels">statsmodels 0.13.5</a> </label> <div class="md-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../install.html" class="md-nav__link">Installing statsmodels</a> </li> <li class="md-nav__item"> <a href="../gettingstarted.html" class="md-nav__link">Getting started</a> </li> <li class="md-nav__item"> <a href="../user-guide.html" class="md-nav__link">User Guide</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../user-guide.html#background" class="md-nav__link">Background</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../regression.html" class="md-nav__link">Linear Regression</a> </li> <li class="md-nav__item"> <a href="../glm.html" class="md-nav__link">Generalized Linear Models</a> </li> <li class="md-nav__item"> <a href="../gee.html" class="md-nav__link">Generalized Estimating Equations</a> </li> <li class="md-nav__item"> <a href="../gam.html" class="md-nav__link">Generalized Additive Models (GAM)</a> </li> <li class="md-nav__item"> <a href="../rlm.html" class="md-nav__link">Robust Linear Models</a> </li> <li class="md-nav__item"> <a href="../mixed_linear.html" class="md-nav__link">Linear Mixed Effects Models</a> </li> <li class="md-nav__item"> <a href="../discretemod.html" class="md-nav__link">Regression with Discrete Dependent Variable</a> </li> <li class="md-nav__item"> <a href="../mixed_glm.html" class="md-nav__link">Generalized Linear Mixed Effects Models</a> </li> <li class="md-nav__item"> <a href="../anova.html" class="md-nav__link">ANOVA</a> </li> <li class="md-nav__item"> <a href="../other_models.html" class="md-nav__link">Other Models <code class="xref py py-mod docutils literal notranslate"><span class="pre">othermod</span></code></a> </li></ul> </li> <li class="md-nav__item"> <a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a> </li></ul> </li> <li class="md-nav__item"> <a href="../examples/index.html" class="md-nav__link">Examples</a> </li> <li class="md-nav__item"> <a href="../api.html" class="md-nav__link">API Reference</a> </li> <li class="md-nav__item"> <a href="../about.html" class="md-nav__link">About statsmodels</a> </li> <li class="md-nav__item"> <a href="../dev/index.html" class="md-nav__link">Developer Page</a> </li> <li class="md-nav__item"> <a href="../release/index.html" class="md-nav__link">Release Notes</a> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--secondary"> <label class="md-nav__title" for="__toc">Contents</label> <ul class="md-nav__list" data-md-scrollfix=""> <li class="md-nav__item"><a href="#generated-statsmodels-discrete-conditional-models-conditionallogit-information--page-root" class="md-nav__link">statsmodels.discrete.conditional_models.ConditionalLogit.information</a><nav class="md-nav"> <ul class="md-nav__list"> <li class="md-nav__item"><a href="#statsmodels.discrete.conditional_models.ConditionalLogit.information" class="md-nav__link"><code class="docutils literal notranslate"><span class="pre">ConditionalLogit.information</span></code></a> </li></ul> </nav> </li> <li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.discrete.conditional_models.ConditionalLogit.information.rst.txt">Show Source</a> </li> <li id="searchbox" class="md-nav__item"></li> </ul> </nav> </div> </div> </div> <div class="md-content"> <article class="md-content__inner md-typeset" role="main"> <section id="statsmodels-discrete-conditional-models-conditionallogit-information"> <h1 id="generated-statsmodels-discrete-conditional-models-conditionallogit-information--page-root">statsmodels.discrete.conditional_models.ConditionalLogit.information<a class="headerlink" href="#generated-statsmodels-discrete-conditional-models-conditionallogit-information--page-root" title="Permalink to this heading">¶</a></h1> <dl class="py method"> <dt class="sig sig-object py" id="statsmodels.discrete.conditional_models.ConditionalLogit.information"> <span class="sig-prename descclassname"><span class="pre">ConditionalLogit.</span></span><span class="sig-name descname"><span class="pre">information</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">params</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#statsmodels.discrete.conditional_models.ConditionalLogit.information" title="Permalink to this definition">¶</a></dt> <dd><p>Fisher information matrix of model.</p> <p>Returns -1 * Hessian of the log-likelihood evaluated at params.</p> <dl class="field-list"> <dt class="field-odd">Parameters<span class="colon">:</span></dt> <dd class="field-odd"><dl> <dt><strong>params</strong><span class="classifier"><a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v1.23)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ndarray</span></code></a></span></dt><dd><p>The model parameters.</p> </dd> </dl> </dd> </dl> </dd></dl> </section> </article> </div> </div> </main> </div> <footer class="md-footer"> <div class="md-footer-nav"> <nav class="md-footer-nav__inner md-grid"> <a href="statsmodels.discrete.conditional_models.ConditionalLogit.hessian.html" title="statsmodels.discrete.conditional_models.ConditionalLogit.hessian" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> <div class="md-flex__cell md-flex__cell--shrink"> <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> </div> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> <span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Previous </span> statsmodels.discrete.conditional_models.ConditionalLogit.hessian </span> </div> </a> <a href="statsmodels.discrete.conditional_models.ConditionalLogit.initialize.html" title="statsmodels.discrete.conditional_models.ConditionalLogit.initialize" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Next </span> statsmodels.discrete.conditional_models.ConditionalLogit.initialize </span> </div> <div class="md-flex__cell md-flex__cell--shrink"><i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> </div> </a> </nav> </div> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-footer-copyright"> <div class="md-footer-copyright__highlight"> &#169; Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers. </div> Last updated on Nov 02, 2022. <br/> Created using <a href="http://www.sphinx-doc.org/">Sphinx</a> 5.3.0. and <a href="https://github.com/bashtage/sphinx-material/">Material for Sphinx</a> </div> </div> </div> </footer> <script src="../_static/javascripts/application.js"></script> <script>app.initialize({version: "1.0.4", url: {base: ".."}})</script> </body> </html>
{'content_hash': '65f322fdc20f8e09ace6d084bb6570eb', 'timestamp': '', 'source': 'github', 'line_count': 515, 'max_line_length': 999, 'avg_line_length': 39.15339805825243, 'alnum_prop': 0.6077167228724459, 'repo_name': 'statsmodels/statsmodels.github.io', 'id': 'cce2ec1c243b5a1471de2a0740b55c02c09838c2', 'size': '20168', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'stable/generated/statsmodels.discrete.conditional_models.ConditionalLogit.information.html', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []}
'use strict'; const async = require(`async`); const Router = require(`express`).Router; const router = new Router(); const jwtAuth = require(`./authentication`); const sqlite3 = require(`../lib/sqlite3`).getInstance(); const bcrypt = require(`bcrypt`); const nmcli = require(`../lib/nmcli`); router.get(`/access_points`, jwtAuth.authorizeRequest, (req, res, next) => { nmcli.listAp((err, result) => { if (err) { return next(err); } return res.json({ error: false, result }); }); }); router.get(`/wireless_devices`, (req, res) => res.json(nmcli.listWirelessDevice()) ); router.get(`/wifi_active_connections`, jwtAuth.authorizeRequest, (req, res, next) => { const devices = nmcli.listWirelessDevice() .filter(dev => dev.state === `connected`) .map(dev => dev.device); async.map(devices, (device, done) => { nmcli.activeConnectionOnIface(device, (err, connection) => { if (err) return done(err); return done(null, connection); }); }, (err, result) => { if (err) { return next(err); } return res.json({ active_connections: result }); }); }); router.post(`/connect`, jwtAuth.authorizeRequest, (req, res, next) => { nmcli.connect(req.body.ssid, req.body.password, req.body.force, (err) => { if (err) { return next(new Error(`Failed to connect to AP. Try force connect & change the password`)); } return res.json({ error: false, connected: true }); }); }); router.post(`/disconnect`, jwtAuth.authorizeRequest, (req, res, next) => { nmcli.disconnect(req.body.iface, (err) => { if (err) { return next(new Error(`Failed to disconnect interface ${req.body.iface}`)); } return res.json({ error: false, disconnected: true }); }); }); router.post(`/login`, jwtAuth.authenticate); router.post(`/change_pass`, jwtAuth.authorizeRequest, (req, res, next) => { sqlite3.serialize(() => { const payload = { oldPassword: req.body.oldPassword, newPassword: req.body.newPassword, confirmNewPassword: req.body.confirmNewPassword, }; const username = req.jwt_token.username; if (payload.newPassword !== payload.confirmNewPassword) { const error = new Error(`Password & confirm password do not match`); error.status = 401; return next(error); } return sqlite3.get(`SELECT * FROM account WHERE username = "${username}"`, (getErr, user) => { if (getErr) { return next(new Error(`Failed to verify old password`)); } if (!user) { return next(new Error(`User is not found`)); } if (!bcrypt.compareSync(payload.oldPassword, user.password)) { return next(new Error(`Old password mismatch`)); } const hashed = bcrypt.hashSync(payload.newPassword, 8); return sqlite3.run(`UPDATE account SET password = "${hashed}" WHERE username = "${username}"`, (updateErr) => { if (updateErr) { return next(new Error(`Failed to update password`)); } return res.json({ error: false, updated: true }); }); }); }); }); module.exports = router;
{'content_hash': '9d681df44e78a1ab31ca293242bfe497', 'timestamp': '', 'source': 'github', 'line_count': 112, 'max_line_length': 117, 'avg_line_length': 27.857142857142858, 'alnum_prop': 0.6198717948717949, 'repo_name': 'alwint3r/wlanturn', 'id': 'f77c6510c0270c95e3b25bab1b88678466f0b439', 'size': '3120', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'middlewares/api.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '473'}, {'name': 'HTML', 'bytes': '1135'}, {'name': 'JavaScript', 'bytes': '45407'}]}
<?php namespace Diside\SecurityBundle\Controller; use Diside\SecurityBundle\Form\Processor\CompanyFormProcessor; use Diside\SecurityBundle\Presenter\CompaniesPresenter; use Diside\SecurityBundle\Presenter\CompanyPresenter; use Diside\SecurityComponent\Interactor\Request\DeleteCompanyRequest; use Diside\SecurityComponent\Interactor\Request\FindCompaniesRequest; use Diside\SecurityComponent\Interactor\SecurityInteractorRegister; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Symfony\Component\HttpFoundation\Request; /** * @Route("/companies") * @Security("has_role('ROLE_SUPERADMIN')") */ class CompanyController extends BaseController { /** * @Route("", name="companies") * @Template */ public function indexAction(Request $request) { $page = $request->get('page', 1); $pageSize = $this->container->getParameter('page_size'); $user = $this->getAuthenticatedUser(); $interactor = $this->getInteractor(SecurityInteractorRegister::FIND_COMPANIES); $request = new FindCompaniesRequest($user ? $user->getId() : null, $page - 1, $pageSize); $presenter = new CompaniesPresenter(); $interactor->process($request, $presenter); $paginator = $this->get('knp_paginator'); $pagination = $paginator->paginate( $presenter, $page, $pageSize ); return array( 'pagination' => $pagination ); } /** * @Route("/new", name="company_new") * @Template */ public function newAction(Request $request) { return $this->processForm($request); } /** * @Route("/{id}/edit", name="company_edit") * @Template */ public function editAction(Request $request, $id) { return $this->processForm($request, $id); } /** * @Route("/{id}/delete", name="company_delete") * @Template */ public function deleteAction($id) { $user = $this->getAuthenticatedUser(); $interactor = $this->getInteractor(SecurityInteractorRegister::DELETE_COMPANY); $request = new DeleteCompanyRequest($user ? $user->getId() : null, $id); $presenter = new CompanyPresenter(); $interactor->process($request, $presenter); $this->addFlash('success', 'flash.company.deleted', array('%company%' => $presenter->getCompany())); return $this->redirect($this->generateUrl('companies')); } private function processForm(Request $request, $id = null) { /** @var CompanyFormProcessor $processor */ $processor = $this->get('company_form_processor'); $processor->process($request, $id); if ($processor->isValid()) { $this->addFlash('success', $id ? 'flash.company.updated' : 'flash.company.created', array('%company%' => $processor->getCompany())); if ($processor->isRedirectingTo(CompanyFormProcessor::REDIRECT_TO_LIST)) return $this->redirect($this->generateUrl('companies')); return $this->redirect($this->generateUrl('company_edit', array( 'id' => $processor->getCompany()->getId()) )); } $form = $processor->getForm(); return array( 'errors' => $processor->getErrors(), 'form' => $form->createView() ); } }
{'content_hash': 'c73eb0d1cfd83ea266131a48e8cdf63f', 'timestamp': '', 'source': 'github', 'line_count': 118, 'max_line_length': 144, 'avg_line_length': 29.915254237288135, 'alnum_prop': 0.6235127478753542, 'repo_name': 'disider/SecurityBundle', 'id': '451c1df457eb7ff27577bc6e320f240d860c52aa', 'size': '3530', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Controller/CompanyController.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '18720'}, {'name': 'JavaScript', 'bytes': '9957'}, {'name': 'PHP', 'bytes': '216649'}]}
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{'content_hash': 'f5a3c452b05a7614736653083fefe29c', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': 'b490a36887c9a685310c1056bd603f62162dbe9c', 'size': '183', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Dryopteridaceae/Elaphoglossum/Elaphoglossum heterochroum/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}