revolver | A C++ network service framework

 by   yuanrongxi C++ Version: Current License: MPL-2.0

kandi X-RAY | revolver Summary

revolver is a C++ library. revolver has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has low support. You can download it from GitHub.
A C++ network service framework
    Support
      Quality
        Security
          License
            Reuse
            Support
              Quality
                Security
                  License
                    Reuse

                      kandi-support Support

                        summary
                        revolver has a low active ecosystem.
                        summary
                        It has 135 star(s) with 96 fork(s). There are 27 watchers for this library.
                        summary
                        It had no major release in the last 6 months.
                        summary
                        There are 1 open issues and 3 have been closed. On average issues are closed in 45 days. There are no pull requests.
                        summary
                        It has a neutral sentiment in the developer community.
                        summary
                        The latest version of revolver is current.
                        revolver Support
                          Best in #C++
                            Average in #C++
                            revolver Support
                              Best in #C++
                                Average in #C++

                                  kandi-Quality Quality

                                    summary
                                    revolver has no bugs reported.
                                    revolver Quality
                                      Best in #C++
                                        Average in #C++
                                        revolver Quality
                                          Best in #C++
                                            Average in #C++

                                              kandi-Security Security

                                                summary
                                                revolver has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
                                                revolver Security
                                                  Best in #C++
                                                    Average in #C++
                                                    revolver Security
                                                      Best in #C++
                                                        Average in #C++

                                                          kandi-License License

                                                            summary
                                                            revolver is licensed under the MPL-2.0 License. This license is Weak Copyleft.
                                                            summary
                                                            Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.
                                                            revolver License
                                                              Best in #C++
                                                                Average in #C++
                                                                revolver License
                                                                  Best in #C++
                                                                    Average in #C++

                                                                      kandi-Reuse Reuse

                                                                        summary
                                                                        revolver releases are not available. You will need to build from source code and install.
                                                                        revolver Reuse
                                                                          Best in #C++
                                                                            Average in #C++
                                                                            revolver Reuse
                                                                              Best in #C++
                                                                                Average in #C++
                                                                                  Top functions reviewed by kandi - BETA
                                                                                  kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
                                                                                  Currently covering the most popular Java, JavaScript and Python libraries. See a Sample Here
                                                                                  Get all kandi verified functions for this library.
                                                                                  Get all kandi verified functions for this library.

                                                                                  revolver Key Features

                                                                                  A C++ network service framework

                                                                                  revolver Examples and Code Snippets

                                                                                  No Code Snippets are available at this moment for revolver.
                                                                                  Community Discussions

                                                                                  Trending Discussions on revolver

                                                                                  Can I step/stagger PowerAutomate when renaming files if there are multiple matches within a folder?
                                                                                  chevron right
                                                                                  how can I create an arraylist of all possible combinations from a json file
                                                                                  chevron right
                                                                                  How to add a column to a dataframe and set all rows to a specific value
                                                                                  chevron right
                                                                                  Random Image and Classification with p5.js, TensorFlow and MobileNet
                                                                                  chevron right
                                                                                  Property value changes without setter being called
                                                                                  chevron right
                                                                                  Scala: How to load environment variables into Application.conf using scala?
                                                                                  chevron right
                                                                                  JSON won't validate
                                                                                  chevron right
                                                                                  Is there a simple way to fork a server process in sbt before starting test against that server?
                                                                                  chevron right
                                                                                  ng2-dragula after adding new item it's getting displayed at the top
                                                                                  chevron right
                                                                                  Is there a way to add variables into an array, like some sorts of an inventory?
                                                                                  chevron right

                                                                                  QUESTION

                                                                                  Can I step/stagger PowerAutomate when renaming files if there are multiple matches within a folder?
                                                                                  Asked 2021-Mar-17 at 02:38

                                                                                  I am new to the forum and hope someone might be able to help as I cannot find a similar question asked anywhere else. I am trying to design a way that PowerAutomate will work as a revolver, to pick a csv file file from a folder, one file at a time and load into a chamber (Feeder) folder, that Excel VBA is setup to fire!

                                                                                  I want a way to move and rename a csv file with specific (fixed) name within my OneDrive folders. I have been able to do this in PA, when there is only one matching file in my "in_tray" folder (example1). However it might be possible that more than one file will match the conditions - so I want to find a way to build in a delay between each match and rename, to allow the VBA to run and Outlook to send email and reset - 5 mins would be generous for this and acceptable to users. As Example 2, although there are three matching csv files, I want it to pick "joesdata" first - move and rename, then PAUSE, then pick "gregsdata.csv" move and rename Pause etc.

                                                                                  Example-1 Watched folder ''' onedrive/myname/in_tray/joesdata ''' (detects modified file at location, matches partial name and filetype - moves and renames as ''' "datafile.csv" ''' Destination: ''' onedrive/myname/feeder/datafile '''

                                                                                  Example - 2 Watched folder ''' onedrive/myname/in_tray/joesdata ''' ''' onedrive/myname/in_tray/gregsdata ''' ''' onedrive/myname/in_tray/dansdata '''

                                                                                  Sorry for the overly long description - would appreciate any help here (frustratingly, I could do this easily with Hazel for Mac, but I need something to work entirely within MS ecosystem for information governance reasons at work)

                                                                                  Thanks so much for looking!

                                                                                  ANSWER

                                                                                  Answered 2021-Mar-17 at 02:38

                                                                                  Sample Flow

                                                                                  When you return a list of files that has more than one file in it, it should be in the form of an array. You need to create an "Apply to each" action and put the array there.

                                                                                  The apply to each will loop over each file, and inside the apply to each action you can refer to the individual file that is currently being used with item()['name'], where name is the name or path of whatever property refers to your filename.

                                                                                  By putting a Delay action at the end of the Apply to Each, you can ensure that Flow will wait five minutes before starting another round.

                                                                                  Source https://stackoverflow.com/questions/66617255

                                                                                  QUESTION

                                                                                  how can I create an arraylist of all possible combinations from a json file
                                                                                  Asked 2021-Feb-28 at 13:16

                                                                                  I'm currently creating a Cluedo game and I'm editing the playerpiece class, I have also created a json file called data.json to store data about the playerpiece, for instance: Character (e.g Colonel Mustard), Weapon etc.

                                                                                  {
                                                                                    "PlayerPieces": {
                                                                                      "0": "Col Mustard",
                                                                                      "1": "Prof Plum",
                                                                                      "2": "Rev Green",
                                                                                      "3": "Mrs Peacock",
                                                                                      "4": "Miss Scarlett",
                                                                                      "5": "Mrs White"
                                                                                    },
                                                                                    "Weapons": {
                                                                                      "0": "Dagger",
                                                                                      "1": "Candlestick" ,
                                                                                      "2": "Revolver",
                                                                                      "3": "Rope",
                                                                                      "4": "Lead Piping",
                                                                                      "5": "Spanner"
                                                                                    }
                                                                                  }
                                                                                  

                                                                                  At the moment, I'm trying to figure out how I can create an arraylist of all possible instances of the PlayerPieces, any help on how to get started would be greatly, greatly appreciated!

                                                                                  ANSWER

                                                                                  Answered 2021-Feb-28 at 13:16

                                                                                  Something like this will help I hope.

                                                                                  String stringToParse = "{\r\n"
                                                                                                  + "  \"PlayerPieces\": {\r\n"
                                                                                                  + "    \"0\": \"Col Mustard\",\r\n"
                                                                                                  + "    \"1\": \"Prof Plum\",\r\n"
                                                                                                  + "    \"2\": \"Rev Green\",\r\n"
                                                                                                  + "    \"3\": \"Mrs Peacock\",\r\n"
                                                                                                  + "    \"4\": \"Miss Scarlett\",\r\n"
                                                                                                  + "    \"5\": \"Mrs White\"\r\n"
                                                                                                  + "  },\r\n"
                                                                                                  + "  \"Weapons\": {\r\n"
                                                                                                  + "    \"0\": \"Dagger\",\r\n"
                                                                                                  + "    \"1\": \"Candlestick\" ,\r\n"
                                                                                                  + "    \"2\": \"Revolver\",\r\n"
                                                                                                  + "    \"3\": \"Rope\",\r\n"
                                                                                                  + "    \"4\": \"Lead Piping\",\r\n"
                                                                                                  + "    \"5\": \"Spanner\"\r\n"
                                                                                                  + "  }\r\n"
                                                                                                  + "}";
                                                                                  
                                                                                          try {
                                                                                              Map attributes = new HashMap<>();
                                                                                              JSONObject obj = new JSONObject(stringToParse);
                                                                                              if (obj.has("PlayerPieces")) {
                                                                                                  JSONObject objPlayerPieces = obj.getJSONObject("PlayerPieces");
                                                                                                  Iterator keysCat = objPlayerPieces.keys();
                                                                                                  while (keysCat.hasNext()) {
                                                                                                      String key = keysCat.next();
                                                                                                      attributes.put(key, objPlayerPieces.getString(key));
                                                                                                  }
                                                                                              }
                                                                                          } catch (JSONException e) {
                                                                                              e.printStackTrace();
                                                                                          }
                                                                                  

                                                                                  Therefore, you will get all the attributes of "PlayerPieces" inside the attributes hashmap for as long as you have them defined in the json file.

                                                                                  Source https://stackoverflow.com/questions/66409219

                                                                                  QUESTION

                                                                                  How to add a column to a dataframe and set all rows to a specific value
                                                                                  Asked 2021-Feb-19 at 04:23

                                                                                  Attempt

                                                                                  After reading a large json file and capturing only the 'text' column, I would like to add a column to dataframe and set all rows to a specific value:

                                                                                  df = pd.read_json('xl-1542M.train.jsonl', lines=True, encoding='utf8').text
                                                                                  df.replace(to_replace=[r"\\t|\\n|\\r", "\t|\n|\r"], value=["",""], regex=True, inplace=True)
                                                                                  df['class']= 1
                                                                                  

                                                                                  xl-1542M.train.jsonl:

                                                                                  {"id": 1, "text": "Germany's youngest ambassador, Frauke Petry, made startling revelations on Thursday in a career-long crusade against Islamic immigration that even two years ahead of her 37th birthday insisted she is \"still young\".\n\nPetry, who burst onto the political scene by leading the rebellion of Angela Merkel's CDU/CSU party last September, was loud on Thursday about an \"Islamisation\" of Germany that she asserted made \"everybody\" hate secularism.\n\n\"Let me say without ambiguity, Islam is not simply another religion like Christianity,\" said the rightwing populist who sits on the Christian Social Union from the Bavarian regional parliament, declining to reveal the source of her (in)complete worldview.\n\nThis was in stark contrast to her CDU/CSU party colleagues who last year slipped in the European Parliament onto the party's bid for power in response to the migrant crisis, the unending chain of wars and terrorism plaguing the Middle East, and the persecution of minorities in cities on Germany's southern border.\n\nTwo years ago, when Petry famously gave up one of her most significant vestiges of power as the interior minister to enter with a few dozen of her party peers on the very first cross-party coalition seeking to form NATO as the CSU/CSU-Greens (at that time lead by Frauke Petry) and the SPD across the German Senate made an alliance that even her own cabinet almost sabotaged \u2013 so unable was Merkel to make peace with the CSU.\n\nThe stakes are huge for keyboard adults of Petry's age and experience. She was the felon behind last year's parliamentary drubbing in the Godesberg City Opinion Quincy House in friendships with left-wing social-democrats and then with Justin Tempelhof, an open borders fanatic who represents German Greens-Merkel Trots to Brussels.\n\nPetry suggested on Thursday that she can no longer control the hatred in Germany that so easily flowed back into her party's ranks after soldiers are militarised and stoop to reading the Koran at train stations such as Munich with ticket counters silent. She said that Berlin cowed in fear of reprisals if the milestones of Qtam killers were calledisen spiritle point signal inside every church through which they strangled eight people in Berlin.\n\nHowever, at the same time she cited U.S. Attorney General Jeff Sessions' December 2016 conviction of a network of alleged Muslim Brotherhood operatives in Birmingham for plotting to murder law enforcement officers, wonders about Islam, said that had long since passed that the numbers of North African Islam moderately recidivists of the mill muslims had dropped \u2014 The Berliner Zeitung reported.\n\nThe comments were particularly surprising considering Petry now boasts the fearlessness to create public an open defiance in what is called a Ratlines Gang, where apocalyptic non-stop propaganda has been injected into church through crowds at weekly services.\n\nPetry now heads a centre-right bloc with Jens Spahn, the deputy finance minister, and Peer Steinbr\u00fcck, chief of CDU/CSU state policy portfolio in Berlin. The feeder party for politicians like Petry will likely be unthinkable without Orb\u00e1n and Dworzak calling the shots with Washington.", "length": 663, "ended": true}
                                                                                  {"id": 2, "text": "3Feitage is one of those organizations that has gone and agreed to occupy Greater Boston with an event they're calling June Resistance. They're assigning each piece of property in the city the urbanist artist Robert Hack to paint. Along the way you can catch a glimpse of how sketchy Tim Turing's insanity made cyberspace.\n\nThe hackathon is this Thursday, June 13th. Lawns from all around the city will be turned into coliseums of work dedicated to the vantage point of a perceived enemy who Quake's Matrix 5 II pitches as \" Dreesyear \" or \"IN SRPD\" (Immediate Reaction Teams, made up of Detroit Police), in the image below. There's also a fort built out of Dreesyear artwork upstaged and in constant danger that anyone entering it risks \"getting SWOLEED\", soon followed by a break in the fence from an unknown criminal in the background.\n\nBut don't worry: the most badass LEGO team out there comes from the DCS community.\n\nCheck out the location page here (in the meantime, Shepard Fairey lives in Brookline and has no idea what he is doing).", "length": 238, "ended": true}
                                                                                  {"id": 3, "text": "Settlers hook Bayint\u00edp lawyer dead, say Ahosaurs\n\nQueensland RCMP said it had \"information\" tying Sandra Jackson, missing since last week, to the tragic murder of a Bayint\u00edp lawyer.\n\nPolice were called to the Rocko Creek apartments near the Central Queensland town of Mundubbera about 5:30 p.m. on the evening of September 4, where they made the gruesome discovery of Jackson's charred body sitting in an ashtray.\n\n\"I was in a box with my life,\" she told local journalists before she was thought to have been taken to the hospital.\n\nJust over a month after the defendant hired reactionary Qinetiq to believe she had provided evidence for her client, Yolanda Sharrocks, in the Burleigh Road civil trial, Queensland Court of Appeal Justice Paul Bhagic agreed with the ruling of in chambers 2012 to hang Jackson for the murder of Kathy Jackson.\n\nAttorneys for Jackson and Sharrocks will appear before the Court of Appeal this week in relation to the $30 million civil claim.\n\nIbrahim Al-Iraqi, a Walgett lawyer turned businessman and a patron of Saharas committee, was in court on May 5.\n\nGrisly discovery\n\nThe burnt body of three-month-old Joseph Sharrocks Jr. lay in a foetal position in another overturned guard . . . .\n\nFisheries officers said Jackson had blood around the revolver's chamber, but were unable to find the gun.\n\nShe was clutching a pair of scissors and being served a summons for possessing alcohol, when she was found. . . .\n\nA \"mask on fire,\" she was then halved in the head as police were suffering from water poisoning.\n\nRangati Malayi correspondent: Will it be a 'sale' as I said in April?\n\nKu Rabbi: Nedan Sorjedor isnt a Jew\n\nNedan Sorjedor said: People to me thought Nedan was Jewish but he is not. He meaned any type of human being. You could class Nedan as gay, lesbian, female, male or shemale. Especially with his working hours. He used to be very busy during the week and during the weekend he does have a time when he has a couple of hours off the work. So he would leave early in the morning but he would probably gather a couple or two meals and stuff. But the fact is we do not see him very often and other than that I dont see him much . . .\n\nKu Rabbi: As far as post and marriage, is she really happy with Hedifal'\n\nSorce says Nedan is a person who has Jewish traditions within his family; it makes me feel really happy to see him relieve on the role of boss for Nedan. You can see Hedifal' becoming a tyrant. Nedan will be like Zayan Ziamani \u2013 only with a lower middle name.\n\nWhat we saw from Hedifal' and Nedan was the race of the character to get into a suit and tie and give his address at the end of the movie OR everything will be taken straight from Wikivoyage. 'Welcome to Skaringden\u2026' Fish on the stove. Coffee maker. Lamp. Plush toy. A thought bubble for Nedan.\n\nKu Rabbi: Sephardic Ashkenazi gentleman\n\nSephardic Ashkenazi gentleman I think the change isn't too bad. Its becomes more than just 'settlers'. The change is more universal. It will seem more like 'litmus test questions' and I think it will be a positive move.\n\nTalat Mazer: Xiangma i teqa' ii fi\u1e93t\n\nZhengguo Si Kuuseri wiek\n\nAmEx 'It seems there are other ethnicities in China.'\n\nNewcomer Huiyin in the West simply kept pointing to the Porcelain Steel Empire [a long forgotten brand known to be central to lomoilanism while we turned our attention to the Shengshi's's heavy reliance on steelwork and trucks], which example. This, forced upon us by assistants. They generally tried to challenge yanyunnu in a formal manner to give you bits of information.\n\nWe all become Waldorf schooled in analysis fever, mixed with genes don't somebody resistuilitating Twelvegger variation results in Waldorf education?\n\nQ Gurumurti: Kyoeijuan Menggu Kimkwe Weer made toilets prevail\n\nKu Rabbi: Are people not allowed to take video cameras outside anymore?\n\nYasmin Heshy Klugu: Objective BoxHoed\n\nThis exit window was just on the floor, it was discovered on the 6th floor ceiling and outside. I was in a club with 8 friends all of us were heading out of the club after", "length": 1024, "ended": false}
                                                                                  {"id": 4, "text": "MPRA/FP/3W standard, also known as IEC 60529-1 time code, has four kinds of time codes - M, LHA, SJT & TWT. The time resolution of each mass scale is one tenth (T1.5) to one five tenth (T1.5T0.5) of a second. The time codes are grouped according to their phases. PMRA/FP volume-charge, IEC 69811 M/V/I ratio and M/V/I/C space charge are grouped into multiples of one minute, IEC 60436 M/V/C ratio between one hour and two hours and IEC 60529-1 time code between four and five hours.\n\nHope you will find these little notes useful !\n\nNotes\n\nThe use of Approximate ISEC code to define the combined standing wave voltage and additive electric field of individual compression pulses was superseded recently by iTron. Slow pulse trains are denoted by a pi/e.770 prefix. The punched Elemental systems assuming loop circuit 9-D are denoted by a pi/0.6 prefix\n\nDVD-ROM and Flash-ROM. Temporally stable either type is probably the best option for measuring the magnetic field non-adiabatically and reducing the complete loss of data.\n\nHere is the list of time codes posted on the MRFS web sites:", "length": 294, "ended": true}
                                                                                  {"id": 5, "text": "The party says they have a plan to increase the power of the city's \"most stable representative\" over the urban food system.\n\nThe last time candidates' debates took place in Toronto, about a year ago, the faces of mayoral frontrunners Olivia Chow and John Tory were mostly off-stage. Less than half of the debate subjects were discussed by NDP candidate David Soknacki and Liberal candidate Denzil Minnan-Wong.\n\nThis time around, the mayoral candidates were more involved, engaging in a strong exchange involving Sicilian Lemontorporationvest\u00f2 MD HP development consultant Stephen Carter, who regularly names ecosystem issues Mikele Perronk\u00f2 MPP and council candidate and urban advocate Fred Eisenberger in the debate, and policy analyst Bob Rennie, whose voter outreach issues netted him 1.3 million votes (60 per cent) in the 2014, 2011, and 2008 municipal elections.\n\nEsoteric Jiddan Will Ouellette, who backs the private-sector-created McLennan station individual management corporation (MMPC), not only objects to the popular narrative over who's the best park trustee, he also thinks we let a Richmond actor out skate to become chair of a county-owned Vancouver transit\n\nsystem, Richard Huelg, use social media to defend a dubious sewage by-product business deal he tried to get a lease on, and is seen along with campaign manager Gareth Cadman \"I've never seen as much crap in journalism,\" in his Toronto South community.\n\nThe debate also came just days after Chong himself showed up in campaign mode personally knocking on doors in Humber Village and one of the two wards in Toronto where Tory has said he did not even know about his own alma mater's Liberal candidate.\n\nBut our politicians don't spend a lot of time dealing with the important stuff. Enter former OPP commissioner Howard Wetlow, a long-term political roleholder. Wetlow landed an interview with us, of course, to help us get the most from the debate with only a sort-of-scholarly grasp of the format.\n\nCheating?\n\n\"One minute we'll be discussing about the PSAC, the kitchen sink issues, fighting for good jobs, and the next minute someone will be talking about pesticides and the Bell regulation,\" he said, just as inevitably as it's often said. Wetlow has served as a Toronto board member of an OPP union affiliated constituency lobby corporation, has been part of Conservative pro-industry lobbying operations, and is a longtime aide to former mayor Mel Lastman, in other words he's what one might call a typical Urban Democratic Ottawa insider.\n\nYet the reason we're curious about Waterloo unrest and the debate is because Wetlow actually went to the core of the leading contenders' platforms and identified key policy areas that they would put their power behind.\n\nHe said it's possible no candidate could go far enough in cleaning up this \u2013 our city's infrastructure projects. He says it's definitely possible no candidate could go far enough on affordability issues, and we'd like to hear what candidates would do on that one.\n\nWe'll run a series of those questions in an upcoming question-and-answer column. A plausible answer: you have absolutely nothing to worry about.\n\nBut we also have to acknowledge Toronto, and people in Toronto, don't know about all these green agenda blemp-bloop news items about taxation . . . most home owners don't even have access to EQC's new online filing system. Clearly, you don't even know about the 911 policy dispute, which is not really about service delivery, but has been fired-up by this violent immigrant-bashing video (which is full of a bunch of dog bites that appears to have been inflicted by one of the leftists).\n\nAnd we can't really get a response out of either Soknacki or Tory on just which security they would put at city correctional facilities. They're far more similar in terms of the approaches they'd take with the human rights commission or the TTC budget. Who cares about Weir Walk?\" How about Kimmie Dunn electoral campaigns? How about protecting Canadian boxer Preston Brown from us? And we really don't know what sensible election tactics any of these candidates would use to address scourge of slums,\" Downtown Chair Jean Quan kickstarted.\n\nPrizes?\n\n\"Handout having any effects on ratepayers's rent,\" David Soknacki exclaimed as he cast his vote in favour of an complaints fold-up. There was a marginally incredulous pause in responses.\n\nWhen the discussion pivoted to Rob Ford's infamous annexation of Toronto - including such changes to improvements like Greenwood and High Park as allowing him his own slice of turf -he shrugged it off, clearly insulted with suggestions that he might have done it for political reasons.\n\n\"I don't know why assessment of fealty should interfere,\" he said. When councillors suggested it's part of being mayor \"there is", "length": 1024, "ended": false}
                                                                                  {"id": 6, "text": "The European railway sector is receiving a pummelling as British government eurosceptics seize on a report showing that the EU-IMF bailout crisis has hardened the continent's financial landscape. Because there is no EU budget obligation to fund train lines, EU funds have been diverted to other countries' rail networks.\n\nAnd because there is no EU binding requirement to share cost better with cleaners, cleaning staff can now be filmed as they are sacked.\n\nTalks between lenders and national profiteering agencies are taking place in volume hoping to pick up the shortfall. Angry operators will protest against the unfairness of years of state handouts to companies that have secured rail contracts, and unions \u2013 already in crisis, though subsidised by taxpayers \u2013 will warn that their influence is pressured by politicians on all sides. December's European elections could change things.\n\nThe Olso Network in Finland \u2013 the nation's fourth major identity-regulated railway \u2013 narrowly escaped international aid when a major operator, OOO, defaulted in October.\n\nBecause the Spanish state has so far refused the rescue loan from its EU partners, Alstom, Italy's Trasportfrancisco or Spain's Al&A \u2013 two major operators \u2013 have all pursued national governments for support as crucial routes like London's Northern and Eurostar operated suspended in the first half of 2009.\n\nItalian interior minister Giulio Tremonti reckons that closing the railways right through the winter football tournament will help the country transfer \u20ac4bn (\u00a32.4bn) for the next four years to regional administration, and it has 5,000 to 6,000 cleaners covering around 100,000 stations.\n\nTrains will run mostly, but in emergencies diversions will be made with one possibility the diversion via Oldham or Bristol instead of the up to \u00a31bn forgone on a single train by DLR with the path of East and West England franchise \u2013 thanks to the architectural beauty of Scotland stopping trains in Denmark at Swinford centre instead of stops around Glasgow \u2013 on ice.\n\nIn December, Spain is hoping to shore up its double-A five-and-a-half year legacy scheme to bolster the daily venture of Califeque on hundreds of lines beyond Madrid.\n\nThis ragged push follows the usual route between Greece, Italy and Spain to control London British Rail's routes. The government favours the Dutch opposite \u2013 of and for himself. Permanent solution might come no country shorter than from the Peanuts comic strip, in which \"Mr Squeezy\" loses his job as manager of a landscape gardening chain and wins jobs as a fisherman. Bob Anderson, proprietor of the M&M's chain, has learned to blend thrive with loss that started with lack of investment shortly after his grandfather had died ten years earlier and wartime maintenance cut right to the bone. Anderson now pocket \u00a355m, down from \u20ac300m, thanks to a batch of loans built up by his company during his postwar reconstruction.\n\nBritish ministers want to devote their last week in office to European Union problems, before the prospect of a returning Labour government opens up Europe to hornswoggling by politicians who might want to hold proposals up through running surpluses, and foreign wild beasts \u2013 not least German Chancellor Angela Merkel's \u2013 to thrash. With two years left for the upcoming European elections, \"this reparatory session, getting rid of it as soon as possible, will make it very positive for the British way of negotiating, diplomatically\", says future business minister Tony Davies.\n\nAnticipating the level of opposition to further EU-backed conductors, Dominic Cummings, leader of the Liberal Democrats, is also hoping:\n\n\"The markets are being tackled by the question of the deleveraging of economies, which means if you are saying that you are unambiguously pro-European, you have to courteously and effectively convince [the public] that it is a pro-European government. I was in Poland and saw that the targets Elmar Brok, the Minister of Economy, had set out were the economic targets he'd set out. I would have spoken up if they would have said 'in large part, Elmar set ourselves that today'.\"\n\nDeath and Destruction\n\nMortgage packs of prime-time TV bulletins round the world are highlighting the immediate blow with years in many cases in movie and a complicated road ahead, as investment in Thailand's underwater motorway sector messes with the sterling and wages before giving way to gripes about inefficiently ruled countryside wage systems, and too time-averse firms swatting down risks with artificial unemployment.\n\nThe admittedly low-profile Chinese new year presence way beyond Beijing has Russian president Leonid Kuchma and his hardline Federal Development Cooperation Service not long ago approving another 2.5km stretch of the Don River corridor \u2013 complete with new myriad amputees in server of the canal's project manufacturer. The decision outraged Feng Zhu, founder of Blind village, one of the groups that were ignored the first time", "length": 1024, "ended": false}
                                                                                  {"id": 7, "text": "It's just known that he was on his back he was beating, he was choking, and there were puke all over his face, and they then, I believe, grabbed the costume and left him there.\n\n\nI'm just trying to take it all in, trying to figure out how this could happen, and why nobody tried to get to help this guy, which obviously hero.", "length": 79, "ended": true}
                                                                                  {"id": 8, "text": "All right, man we've talked about this your entire day. We all felt this way watching the Sandra Bland \"Approval\" video and scrolling through the commotion; feeling the anger and sadness salsa danced around in people's sexism, racism tweets and trial balloons. We just felt like we weren't doing enough. And finally, I wrote this in early June but never posted it, so its time to make it known, Bacon Madness, that Murray Rothbard is RAD and we want nerdy-list even though we are brown people with nerdy brains!\n\nAnyone else feeling what I'm going to fill later with bits of metal gear?\n\nOf all the electronic stuff, music and confederate flag material I have, my most beloved and realized collectible now is the boxed bar of pulp story we call X-211. In the world I live in, there aren't very many X-s to be found, but when I found X-211, I got very, very happy very fast. NOT that I would have sold it to anyone else; it's just that its hard to find collectible fan letters, period. x211 may very well be the most precious thing in my house. Or mine*. I struggle with the emotion of being sad about this, too.\n\nWhile the investigation and eventual exoneration of 45-year-old Sandra Bland continues, unlike that of Johannes Mehserle, named #1 dominating triggering preservation curriculums Horrifyingly Today, we are supposed to feel bad for cops. Not bad enough because it's possible you or someone you love could get killed in someone else's home by an idiotized superior unit acting in the place of a \"deep compassion for humanity that actually swells my heart\" (make of that what you will) and not to dwell too deep on a botched interrogation, we're better prepared to stand horrified at the murder of a sayonara black young man as if it could happen to us:\n\nBlack woman killed by an officer during struggle in South Carolina\n\nMicah Fromuth's daughter the victim of his police harassment\n\nTeam Black Lives Matter: one to kill me \u2014 Dana Loesch, radio host and enemy Fascist(?) ally! \u2014 No, really, this is real!\n\nRace-hustling cop. Black. On September 21, a police officer ends Eric Garner's life, using an illegal chokehold. Just after the man's lungs collapse, he is ribbed, mercilessly mocked and facilitated with a final righteous slap and mob-enraged screams birthed out as more whites join the cruelty against this black man (we all know the usual clich\u00e9s about cops and minorities because we assiduously paid attention in primary and high school followed by crime reporting as a reporter).\n\nBlacks are more likely to be killed by angry types online, then they are white (with blacks second only to black crime victims); more likely to be arrested for whatever the cops bring up their noses; more likely to be struck and hard with their own weapons; more likely to be the unwitting hunted when people of color are shooting at cops; more likely to be called a racial slur before killing or maiming unarmed people identified as blacks; more likely to be buried or cremated by an angry mob unless they kneel down and intone that the killer is trapped inside an animal body that shares cause with the person they have killed; less likely to actually be killed or injured by officers; more likely to be lynched, gassed, and beaten in most spots in America; less likely to have property confiscated or ravaged by the state's war on weed. Phew.\n\nThese blessings repeat most eloquently for black men. Again, we hear of Trayvon when white nepotism acted as an outlet for black bodies destroyed by police, followed by the various sad stories of black men hunted down, attacked, killed and enraged by one-dimensional little criminals being believed by prosecutors and juries as justification to knock some sense back in the world. Surely all this is random; surely these tragedies all happen insofar as a defense of preserves the debates oveleeening kitsch sessions in suburban houses and sun-bathed supermarkets mired in ignorance and blaseness.\n\nBut, still, black people lose 17 black people since this Attorney General, in a telling correspondence with his lawyers, excuses Darren Wilson by claiming, \"Mr. Wilson is not aware of this, but he was trained to disarm and not use force.\"\n\nLong live Reddit, this joy-inducing currency of technical scientific sanity!", "length": 934, "ended": true}
                                                                                  ...
                                                                                  

                                                                                  I've attempted to save the file to check whether the output is as expected:

                                                                                  df.to_csv("test", sep='\t')
                                                                                  

                                                                                  Output: csv_ss

                                                                                  However, it appears that the intended has not occurred, but rather the last line in the file contains:

                                                                                  class 1
                                                                                  

                                                                                  Expected

                                                                                  I'd have expected the output to be as followed (Ideally without any column or row numbering):

                                                                                  "..."   1
                                                                                  "..."   1
                                                                                  "..."   1
                                                                                  "..."   1
                                                                                  "..."   1
                                                                                  "..."   1
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2021-Feb-19 at 04:23

                                                                                  The problem is that your read_json(....).text line returns a series, not a dataframe.

                                                                                  Adding a .to_frame() and referencing the column in the following line should fix it:

                                                                                  df = pd.read_json('xl-1542M.train.jsonl', lines=True, encoding='utf8').text.to_frame()
                                                                                  df['text'].replace(to_replace=[r"\\t|\\n|\\r", "\t|\n|\r"], value=["",""], regex=True, inplace=True)
                                                                                  df['class'] = 1
                                                                                  

                                                                                  Source https://stackoverflow.com/questions/66265116

                                                                                  QUESTION

                                                                                  Random Image and Classification with p5.js, TensorFlow and MobileNet
                                                                                  Asked 2021-Jan-21 at 09:09

                                                                                  I'm asking for help from the community because I'm stuck with my code. For a project I need to create an image classification program on P5.js using MobileNet and TensorFlow.

                                                                                  I wanted to know how to create a button that randomly displays an image (among the 3 I downloaded) with the MobileNet classification below the image and the information I gave (like "Danger")?

                                                                                  Result wanted

                                                                                  Here is what i've already done. Thank you :)

                                                                                  
                                                                                      var model_mobilenet;
                                                                                      var loaded;
                                                                                      
                                                                                      
                                                                                      function setup() {
                                                                                        createCanvas(400, 300);
                                                                                        mobilenet.load().then(modelLoaded);
                                                                                      
                                                                                        military = loadImage('military');
                                                                                        rifle = loadImage('rifle');
                                                                                        revolver = loadImage('revolver');
                                                                                        
                                                                                        createButton("Take a picture").mousePressed(btnClicked);
                                                                                      }
                                                                                      
                                                                                      function classifyDone(res) {
                                                                                        print(res);
                                                                                        if (res[0].className == "rifle")
                                                                                        {
                                                                                        print("Danger");
                                                                                        createP("Danger");
                                                                                        }
                                                                                        
                                                                                        else if (res[0].className == "revolver, six-gun, six-shooter")
                                                                                        {
                                                                                        print("Danger");
                                                                                        createP("Danger");
                                                                                        }
                                                                                        else if (res[0].className == "military uniform")
                                                                                        {
                                                                                          print("Not sure about this one");
                                                                                          createP("Not sure about this one");
                                                                                        }
                                                                                        else {
                                                                                          print("Evrything is okay");
                                                                                          createP("Everything is okay");
                                                                                        }
                                                                                      }
                                                                                      
                                                                                      function modelLoaded(net) {
                                                                                        model_mobilenet = net;
                                                                                        loaded = true;
                                                                                        print("Model loaded");
                                                                                      }
                                                                                      
                                                                                      function btnClicked() {
                                                                                        
                                                                                      image(military, 0, 0, 400, 300);
                                                                                        
                                                                                      if (loaded == true)
                                                                                      {
                                                                                      model_mobilenet.classify(military.elt).then(classifyDone);
                                                                                        }
                                                                                      }
                                                                                  
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2021-Jan-21 at 09:09
                                                                                      var model_mobilenet;
                                                                                  var loaded;
                                                                                  
                                                                                  
                                                                                  function setup() {
                                                                                    createCanvas(400, 300);
                                                                                    mobilenet.load().then(modelLoaded);
                                                                                  
                                                                                    revolver = loadImage('revolver.jpg');
                                                                                    baseball = loadImage('baseball.jpg');
                                                                                    rifle = loadImage('rifle.jpg');
                                                                                  
                                                                                    
                                                                                    createButton("DANGER OR NOT?").mousePressed(btnClicked);
                                                                                  }
                                                                                  
                                                                                  function classifyDone(res) {
                                                                                    print(res);
                                                                                    
                                                                                    createP("Model detected a " + res[0].className + " with a confidence of " + res[0].probability + "");
                                                                                    if (res[0].className =="assault rifle, assault gun")
                                                                                    
                                                                                    { createP("Danger, find a shelter, quickly !");}
                                                                                    
                                                                                    else if (res[0].className == "revolver, six-gun, six-shooter")
                                                                                   
                                                                                    { createP("Danger, find a shelter, quickly !");}
                                                                                  
                                                                                    else {   createP("Everything is okay");  }
                                                                                  }
                                                                                  
                                                                                  /* if ($(".revolver, six-gun, six-shooter").css('font-color: red')){
                                                                                  $(".assault rifle, assault gun").css('font-color: green'); */
                                                                                  
                                                                                  function modelLoaded(net) {
                                                                                    model_mobilenet = net;
                                                                                    loaded = true;
                                                                                    print("Model loaded");
                                                                                  }
                                                                                  
                                                                                  function btnClicked() {
                                                                                   
                                                                                  let randomNumber = Math.random()
                                                                                  if(randomNumber<0.3)
                                                                                  {
                                                                                    image(baseball, 0, 0, 400, 300);
                                                                                  model_mobilenet.classify(baseball.canvas).then(classifyDone);
                                                                                    }
                                                                                  else if (randomNumber<0.6)
                                                                                  {
                                                                                      image(rifle, 0, 0, 400, 300);
                                                                                  model_mobilenet.classify(rifle.canvas).then(classifyDone);
                                                                                    }
                                                                                    else 
                                                                                  {
                                                                                      image(revolver, 0, 0, 400, 300); 
                                                                                  model_mobilenet.classify(revolver.canvas).then(classifyDone);
                                                                                    }
                                                                                  }
                                                                                  

                                                                                  Here is the result I obtained. It's not really great but with a little more CSS, it can be satisfying. Feel free to ask me for more details. Here is the result.

                                                                                  Source https://stackoverflow.com/questions/65592455

                                                                                  QUESTION

                                                                                  Property value changes without setter being called
                                                                                  Asked 2021-Jan-20 at 14:10

                                                                                  I'm working on a project where a record needs to be inserted, using a context class. However, before the insertion, one of the properties 'DataArea' is being set to a value that it should not have.

                                                                                  I started debugging the code to see where exactly this value is being set, and I have altered the short written version of the getter and setter (get; set;), to this:

                                                                                  public DataAreaEnum _DataArea;
                                                                                  public DataAreaEnum DataArea
                                                                                      {
                                                                                          get
                                                                                          {
                                                                                              return _DataArea;
                                                                                          }
                                                                                          set
                                                                                          {
                                                                                              _DataArea = value;
                                                                                              Debugger.Break();
                                                                                          }
                                                                                      }
                                                                                  

                                                                                  By doing this, I had hoped that the debugger would break when the value was being set, however this is never hit. I am stuck and do not know how to think about this. Are there any other ways this value could have been set? How can I found out where this value was being set, if the breakpoint in the setter is never hit?

                                                                                  The complete class code:

                                                                                  using Works.Common.Models;
                                                                                  using System.Collections.Generic;
                                                                                  using System.Diagnostics;
                                                                                  
                                                                                  namespace Works.Models.Toolsheets
                                                                                  {
                                                                                      public partial class Toolblad : ModelBase
                                                                                      {
                                                                                          public Toolblad()
                                                                                          {
                                                                                              Bijlagen = new HashSet();
                                                                                              //Carrousels = new HashSet();
                                                                                              KlauwplaatSlijpers = new HashSet();
                                                                                              Klauwplaten = new HashSet();
                                                                                              Laadtafels = new HashSet();
                                                                                              Laders = new HashSet();
                                                                                              MblStangenLaders = new HashSet();
                                                                                              MblStangenLaderWisselpunten = new HashSet();
                                                                                              Shuttles = new HashSet();
                                                                                              Spankoppen = new HashSet();
                                                                                              SpankopSlijpers = new HashSet();
                                                                                              Revolvers = new HashSet();
                                                                                          }
                                                                                  
                                                                                          public DataAreaEnum _DataArea;
                                                                                          public DataAreaEnum DataArea
                                                                                          {
                                                                                              get
                                                                                              {
                                                                                                  return _DataArea;
                                                                                              }
                                                                                              set
                                                                                              {
                                                                                                  _DataArea = value;
                                                                                                  Debugger.Break();
                                                                                              }
                                                                                          }
                                                                                  
                                                                                          public bool IsTemplate { get; set; }
                                                                                  
                                                                                          #region Navigation Properties
                                                                                  
                                                                                          public virtual AlgemeneInfo AlgemeneInfo { get; set; }
                                                                                  
                                                                                          public int AlgemeneInfoId { get; set; }
                                                                                  
                                                                                          public ICollection Bijlagen { get; set; }
                                                                                  
                                                                                          //public ICollection Carrousels { get; set; }
                                                                                  
                                                                                          public ICollection KlauwplaatSlijpers { get; set; }
                                                                                  
                                                                                          public ICollection Klauwplaten { get; set; }
                                                                                  
                                                                                          public ICollection Laadtafels { get; set; }
                                                                                  
                                                                                          public ICollection Laders { get; set; }
                                                                                  
                                                                                          public MachineGroep MachineGroep { get; set; }
                                                                                  
                                                                                          public int MachineGroepId { get; set; }
                                                                                  
                                                                                          public ICollection MblStangenLaders { get; set; }
                                                                                  
                                                                                          public ICollection MblStangenLaderWisselpunten { get; set; }
                                                                                  
                                                                                          public ICollection Revolvers { get; set; }
                                                                                  
                                                                                          public ICollection Shuttles { get; set; }
                                                                                  
                                                                                          public ICollection Spankoppen { get; set; }
                                                                                  
                                                                                          public ICollection SpankopSlijpers { get; set; }
                                                                                  
                                                                                          #endregion Navigation Properties
                                                                                      }
                                                                                  }
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2021-Jan-19 at 22:05

                                                                                  I note that Toolblad is a partial class. Is there any code elsewhere changing _DataArea? Try renaming it to something else (e.g. _dataArea) just in that code file and see if it all still compiles.

                                                                                  Doing that will catch any unexpected code that tries to access it.

                                                                                  Source https://stackoverflow.com/questions/65792522

                                                                                  QUESTION

                                                                                  Scala: How to load environment variables into Application.conf using scala?
                                                                                  Asked 2021-Jan-16 at 17:45

                                                                                  I have a ConfigLoader which I'm pretty sure works fine. I suspect I am not using application.conf file correctly or perhaps my directory containing the prd.env and dev.env is not in the correct place.

                                                                                  What I expect to happen:

                                                                                  I when I enter sbt run the ConfigLoader reads the application.conf file, sees there are variables within that file. Then checks if prd.env or dev.env depending on which environment it is in and then finally loads the variables. I want this so I can have a different database for dev and prd.

                                                                                  1. I have not idea how it would find the Meta directory which contains the prd.env and dev.env (see image).
                                                                                  2. I have no idea how it would be able to tell whether if the environment is in dev or prd.
                                                                                  3. The goal is to now look towards deploying this app, which is why I need these environment variables to work.

                                                                                  I really appreciate all the help but please try and detail your answers because I am really stuck and short answers often assume I know more than I do. Thanks :)

                                                                                  Tech stack incase relevant:

                                                                                  • HTTP4S,
                                                                                  • CATS,
                                                                                  • Doobie,
                                                                                  • PostgreSQL

                                                                                  application.conf file below:

                                                                                  appone {
                                                                                      environment = ${ENV}
                                                                                  
                                                                                      server-config {
                                                                                        url = ${?BASE_URL}
                                                                                        host = "0.0.0.0"
                                                                                        port = 8080
                                                                                      }
                                                                                  
                                                                                      db-config {
                                                                                          driver = "org.postgresql.Driver"
                                                                                          url = ${?DATABASE_URL}
                                                                                          user = ${?APPONE_POSTGRES_USER}
                                                                                          password = ${?PASSWORD}
                                                                                          connection-threads = 4
                                                                                      }
                                                                                  }
                                                                                  
                                                                                  

                                                                                  Meta/dev.env file (I also have a Meta/prd.env but have shown it here due to contents)

                                                                                  ENV=dev
                                                                                  
                                                                                  BASE_URL=http://localhost:8080/
                                                                                  DATABASE_URL=jdbc:postgresql://localhost:5400/bookswapdb
                                                                                  APPONE_POSTGRES_USER=su
                                                                                  PASSWORD=password
                                                                                  
                                                                                  

                                                                                  LoadConfig file below:

                                                                                  package com.fullstackryan.appone.config
                                                                                  
                                                                                  import cats.ApplicativeError
                                                                                  import cats.implicits._
                                                                                  import pureconfig.error.ConfigReaderException
                                                                                  import pureconfig.{ConfigReader, ConfigSource, Derivation}
                                                                                  import shapeless.the
                                                                                  
                                                                                  trait LoadConfig[F[_], TConfig] {
                                                                                    def load: F[TConfig]
                                                                                  }
                                                                                  
                                                                                  object LoadConfig {
                                                                                    def load[F[_], TConfig](implicit loadConfig: LoadConfig[F, TConfig]): F[TConfig] =
                                                                                      the[LoadConfig[F, TConfig]].load
                                                                                  
                                                                                    def apply[F[_], TConfig](
                                                                                                              implicit reader: Derivation[ConfigReader[TConfig]], ae: ApplicativeError[F, Throwable]
                                                                                                            ): LoadConfig[F, TConfig] =
                                                                                      new LoadConfig[F, TConfig] {
                                                                                        def load: F[TConfig] = ApplicativeError[F, Throwable].fromEither {
                                                                                          ConfigSource.default
                                                                                            .at("appone")
                                                                                            .load[TConfig]
                                                                                            .leftMap(ConfigReaderException(_))
                                                                                        }
                                                                                      }
                                                                                  
                                                                                  }
                                                                                  

                                                                                  error

                                                                                  pureconfig.error.ConfigReaderException: Cannot convert configuration to a scala.runtime.Nothing$. Failures are:
                                                                                    at 'appone.db-config':
                                                                                      - (application.conf @ jar:file:/Users/ryanmcavoy/fullStackRyan/appone/target/bg-jobs/sbt_3cc4b1f5/job-11/target/419ddc2c/5befcb57/appone_2.13-0.0.1-SNAPSHOT.jar!/application.conf: 10) Key not found: 'url'.
                                                                                      - (application.conf @ jar:file:/Users/ryanmcavoy/fullStackRyan/appone/target/bg-jobs/sbt_3cc4b1f5/job-11/target/419ddc2c/5befcb57/appone_2.13-0.0.1-SNAPSHOT.jar!/application.conf: 10) Key not found: 'username'.
                                                                                      - (application.conf @ jar:file:/Users/ryanmcavoy/fullStackRyan/appone/target/bg-jobs/sbt_3cc4b1f5/job-11/target/419ddc2c/5befcb57/appone_2.13-0.0.1-SNAPSHOT.jar!/application.conf: 10) Key not found: 'pool-size'.
                                                                                  
                                                                                          at com.fullstackryan.appone.config.LoadConfig$$anon$1.$anonfun$load$1(LoadConfig.scala:25)
                                                                                          at cats.syntax.EitherOps$.leftMap$extension(either.scala:172)
                                                                                          at com.fullstackryan.appone.config.LoadConfig$$anon$1.load(LoadConfig.scala:25)
                                                                                          at com.fullstackryan.appone.server.ApponeServer$.$anonfun$stream$1(ApponeServer.scala:32)
                                                                                          at com.fullstackryan.appone.server.ApponeServer$.$anonfun$stream$1$adapted(ApponeServer.scala:31)
                                                                                          at fs2.Stream$.$anonfun$flatMap$1(Stream.scala:1188)
                                                                                          at fs2.internal.FreeC$.go$2(Algebra.scala:609)
                                                                                          at fs2.internal.FreeC$.$anonfun$flatMapOutput$1(Algebra.scala:616)
                                                                                          at fs2.internal.FreeC$$anon$1.cont(Algebra.scala:53)
                                                                                          at fs2.internal.FreeC$ViewL$$anon$9$$anon$10.cont(Algebra.scala:242)
                                                                                          at fs2.internal.FreeC$ViewL$.mk(Algebra.scala:231)
                                                                                          at fs2.internal.FreeC$ViewL$.apply(Algebra.scala:220)
                                                                                          at fs2.internal.FreeC.viewL(Algebra.scala:106)
                                                                                          at fs2.internal.FreeC$.go$1(Algebra.scala:414)
                                                                                          at fs2.internal.FreeC$.$anonfun$compile$8(Algebra.scala:464)
                                                                                          at fs2.internal.FreeC$.$anonfun$compile$1(Algebra.scala:430)
                                                                                  
                                                                                  
                                                                                  addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.14")
                                                                                  addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1")
                                                                                  addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
                                                                                  
                                                                                  addSbtPlugin("au.com.onegeek" % "sbt-dotenv" % "2.1.204")
                                                                                  
                                                                                  // deploy heroku
                                                                                  addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.6")
                                                                                  addSbtPlugin("com.heroku" % "sbt-heroku" % "2.1.0")
                                                                                  
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2021-Jan-16 at 16:34

                                                                                  When running via sbt run, the environment is set by the shell in which you're running sbt. Defining a dev.env file by itself does nothing.

                                                                                  The mechanism for setting the environment in which sbt is running will vary depending on your shell.

                                                                                  For example if bash is your shell (this is worth trying in other Bourne-compatible shells), prefixing the environment variables with export, e.g.:

                                                                                  export ENV=dev
                                                                                  

                                                                                  Then you incorporate the environment variables you've exported from dev.env into your bash environment with

                                                                                  source meta/dev.env
                                                                                  

                                                                                  Those environment variables will then be set and thus incorporated into your config for the duration of your shell session (i.e. they'll continue across multiple sbt runs until you exit the shell). If you change dev.env, they won't be available until you source meta/dev.env again.

                                                                                  Source https://stackoverflow.com/questions/65750394

                                                                                  QUESTION

                                                                                  JSON won't validate
                                                                                  Asked 2020-Oct-25 at 15:04

                                                                                  I'm trying to get this to validate, it's probably a comma or formatting but I can't work it out and it's driving me insane - It doesn't seem to fail initially not sure why it does later on.

                                                                                  For reference: https://umod.org/plugins/server-rewards#adding-an-item

                                                                                  Any help would be appreciated - Thanks in advance.

                                                                                      {
                                                                                      "items": {
                                                                                              "lmg.m249_0": {
                                                                                              "shortname": "lmg.m249",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "M249",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "rifle.l96_0": {
                                                                                              "shortname": "rifle.l96",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "L96 Rifle",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "rifle.m39_0": {
                                                                                              "shortname": "rifle.m39",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "M39 Rifle",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "rifle.lr300_0": {
                                                                                              "shortname": "rifle.lr300",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "LR-300 Assault Rifle",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "rifle.ak_0": {
                                                                                              "shortname": "rifle.ak",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Assault Rifle",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "pistol.python_0": {
                                                                                              "shortname": "pistol.python",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Python Revolver",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "rocket.launcher_0": {
                                                                                              "shortname": "rocket.launcher",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Rocket Launcher",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "multiplegrenadelauncher_0": {
                                                                                              "shortname": "multiplegrenadelauncher",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Multiple Grenade Launcher",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "weapon.mod.lasersight_0": {
                                                                                              "shortname": "weapon.mod.lasersight",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Weapon Lasersight",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "weapon.mod.silencer_0": {
                                                                                              "shortname": "weapon.mod.silencer",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Silencer",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rifle_0": {
                                                                                              "shortname": "ammo.rifle",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "5.56 Rifle Ammo",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rifle.hv_0": {
                                                                                              "shortname": "ammo.rifle.hv",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "HV 5.56 Rifle Ammo",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rifle.explosive_0": {
                                                                                              "shortname": "ammo.rifle.explosive",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Explosive 5.56 Rifle Ammo",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.shotgun_0: {
                                                                                              "shortname": "ammo.shotgun",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "12 Gauge Buckshot",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.shotgun.slug_0": {
                                                                                              "shortname": "ammo.shotgun.slug",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "12 Gauge Slug",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.pistol_0": {
                                                                                              "shortname": "ammo.pistol",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Pistol Bullet",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },      
                                                                                              "ammo.pistol.hv_0": {
                                                                                              "shortname": "ammo.pistol.hv",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "HV Pistol Ammo",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rocket.basic_0": {
                                                                                              "shortname": "ammo.rocket.basic",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Rocket",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rocket.hv_0": {
                                                                                              "shortname": "ammo.rocket.hv",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "High Velocity Rocket",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rocket.sam_0": {
                                                                                              "shortname": "ammo.rocket.sam",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "SAM Ammo",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.grenadelauncher.he_0": {
                                                                                              "shortname": "ammo.grenadelauncher.he",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "40mm HE Grenade",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.grenadelauncher.buckshot_0": {
                                                                                              "shortname": "ammo.grenadelauncher.buckshot",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "40mm Shotgun Round",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          }
                                                                                      },
                                                                                      "kits": {},
                                                                                      "commands": {}
                                                                                  }
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2020-Oct-25 at 15:04

                                                                                  The error was the extra } above "kits".

                                                                                  {
                                                                                      "items": {
                                                                                              "lmg.m249_0": {
                                                                                              "shortname": "lmg.m249",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "M249",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "rifle.l96_0": {
                                                                                              "shortname": "rifle.l96",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "L96 Rifle",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "rifle.m39_0": {
                                                                                              "shortname": "rifle.m39",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "M39 Rifle",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "rifle.lr300_0": {
                                                                                              "shortname": "rifle.lr300",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "LR-300 Assault Rifle",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "rifle.ak_0": {
                                                                                              "shortname": "rifle.ak",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Assault Rifle",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "pistol.python_0": {
                                                                                              "shortname": "pistol.python",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Python Revolver",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "rocket.launcher_0": {
                                                                                              "shortname": "rocket.launcher",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Rocket Launcher",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "multiplegrenadelauncher_0": {
                                                                                              "shortname": "multiplegrenadelauncher",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Multiple Grenade Launcher",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "weapon.mod.lasersight_0": {
                                                                                              "shortname": "weapon.mod.lasersight",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Weapon Lasersight",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "weapon.mod.silencer_0": {
                                                                                              "shortname": "weapon.mod.silencer",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Silencer",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rifle_0": {
                                                                                              "shortname": "ammo.rifle",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "5.56 Rifle Ammo",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rifle.hv_0": {
                                                                                              "shortname": "ammo.rifle.hv",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "HV 5.56 Rifle Ammo",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rifle.explosive_0": {
                                                                                              "shortname": "ammo.rifle.explosive",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Explosive 5.56 Rifle Ammo",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.shotgun_0: {
                                                                                              "shortname": "ammo.shotgun",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "12 Gauge Buckshot",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.shotgun.slug_0": {
                                                                                              "shortname": "ammo.shotgun.slug",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "12 Gauge Slug",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.pistol_0": {
                                                                                              "shortname": "ammo.pistol",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Pistol Bullet",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },      
                                                                                              "ammo.pistol.hv_0": {
                                                                                              "shortname": "ammo.pistol.hv",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "HV Pistol Ammo",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rocket.basic_0": {
                                                                                              "shortname": "ammo.rocket.basic",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "Rocket",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rocket.hv_0": {
                                                                                              "shortname": "ammo.rocket.hv",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "High Velocity Rocket",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.rocket.sam_0": {
                                                                                              "shortname": "ammo.rocket.sam",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "SAM Ammo",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.grenadelauncher.he_0": {
                                                                                              "shortname": "ammo.grenadelauncher.he",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "40mm HE Grenade",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                              "ammo.grenadelauncher.buckshot_0": {
                                                                                              "shortname": "ammo.grenadelauncher.buckshot",
                                                                                              "customIcon": null,
                                                                                              "amount": 1,
                                                                                              "skinId": 0,
                                                                                              "isBp": false,
                                                                                              "category": 1,
                                                                                              "displayName": "40mm Shotgun Round",
                                                                                              "cost": 100,
                                                                                              "cooldown": 0
                                                                                          },
                                                                                      "kits": {},
                                                                                      "commands": {}
                                                                                  }
                                                                                  

                                                                                  Source https://stackoverflow.com/questions/64509255

                                                                                  QUESTION

                                                                                  Is there a simple way to fork a server process in sbt before starting test against that server?
                                                                                  Asked 2020-Sep-24 at 22:39

                                                                                  my e2e test task sends some http requests to the server. i want to start that server (Play framework based) on a separate jvm, then start the test which hits the server and let it finish, then stop the server.

                                                                                  i looked through many SO threads so far found these options:

                                                                                  1. use sbt-sequential
                                                                                  2. use sbt-revolver
                                                                                  3. use alias

                                                                                  but in my experiments setting fork doesn't work, i.e. it still blocks execution when server is started

                                                                                  fork := true
                                                                                  fork in run := true
                                                                                  fork in Test := true
                                                                                  fork in IntegrationTest := true
                                                                                  

                                                                                  The startServer/stopServer examples in sbt docs are also blocking it seems

                                                                                  I also tried just starting the server in background from shell but server is quickly shut down, similar to this question

                                                                                  nohup sbt -Djline.terminal=jline.UnsupportedTerminal web/run  < /dev/null > /tmp/sbt.log 2>&1 &
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2020-Sep-17 at 14:44

                                                                                  fork doesn't run task in parallel - it just makes sure that tests are run in a separate JVM which helps with things like shutdown webhooks or disconnecting from services that doesn't handle resource release properly (e.g. DB connection that never calls disconnect).

                                                                                  If you want to use the same sbt to start server AND run test against that instance (which sounds like easily breakable antipattern BTW) you can use somethings like:

                                                                                  • reStart
                                                                                  • it:test
                                                                                  • reStop

                                                                                  However that would be tricky because reStart yields immediately so tests would start when the server setup started but not necessarily completed. Race condition, failing tests, or blocking all tests until server finishes starting.

                                                                                  This is why nobody does it. Much easier to handle solution is to:

                                                                                  • start the server in test in some beforeAll method and make this method complete only after server is responding to queries
                                                                                  • shutdown it in some afterAll method (or somehow handle both of these using something like cats.effect.Resource or similar)
                                                                                  • depending on situation:
                                                                                    • running tests sequentially to avoid starting two instances at the same time or
                                                                                    • generating config for each test so that they could be run in parallel without clashing on ports allocations

                                                                                  Anything else is just a hack that is going to fail sooner rather than later.

                                                                                  Source https://stackoverflow.com/questions/63929904

                                                                                  QUESTION

                                                                                  ng2-dragula after adding new item it's getting displayed at the top
                                                                                  Asked 2020-Aug-27 at 04:43

                                                                                  I am using ng2-dragula for drag and drop feature. I am seeing issue when I drag and drop first element(or any element) at the end and then try to add new item to the array using addNewItem button, new item is not getting added to the end. If i don't drop element to the end, new item is getting added at the end in UI. I want new items to be displayed at the bottom in any scenario. Any help is appreciated. This issue is not reproducible with Angular 7. I see this happening with Angular 9

                                                                                  JS

                                                                                  export class SampleComponent {
                                                                                  
                                                                                    items = ['Candlestick','Dagger','Revolver','Rope','Pipe','Wrench'];
                                                                                    constructor(private dragulaService: DragulaService) { 
                                                                                      dragulaService.createGroup("bag-items", {
                                                                                        removeOnSpill: false
                                                                                      });
                                                                                    }
                                                                                  
                                                                                    public addNewItem() {
                                                                                      this.items.push('New Item');
                                                                                    }
                                                                                  }
                                                                                  

                                                                                  HTML

                                                                                  
                                                                                      {{ item }} 
                                                                                  
                                                                                  

                                                                                  Add New Item

                                                                                  I edited the stackblitz from the comment to help visualize the issue. This seems to be triggered when a unit is dragged to the bottom of the list. Updated stackblitz : https://stackblitz.com/edit/ng2-dragula-base-ykm8fz?file=src/app/app.component.html ItemsAddedOutOfOrder

                                                                                  ANSWER

                                                                                  Answered 2020-Aug-27 at 04:43

                                                                                  You can try to restore old item position on drop.

                                                                                  constructor(private dragulaService: DragulaService) {
                                                                                    this.subscription = this.dragulaService.drop().subscribe(({ name }) => {
                                                                                      this.dragulaService.find(name).drake.cancel(true);
                                                                                    });
                                                                                  } 
                                                                                  

                                                                                  Forked Stackblitz

                                                                                  Explanation

                                                                                  There is some difference between how Ivy and ViewEngine insert ViewRef at specific index. They relay on different beforeNode

                                                                                  Ivy always returns ViewContainer host(Comment node)ref if we add item to the end:

                                                                                  export function getBeforeNodeForView(viewIndexInContainer: number, lContainer: LContainer): RNode|
                                                                                      null {
                                                                                    const nextViewIndex = CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1;
                                                                                    if (nextViewIndex < lContainer.length) {
                                                                                      const lView = lContainer[nextViewIndex] as LView;
                                                                                      const firstTNodeOfView = lView[TVIEW].firstChild;
                                                                                      if (firstTNodeOfView !== null) {
                                                                                        return getFirstNativeNode(lView, firstTNodeOfView);
                                                                                      }
                                                                                    }
                                                                                  
                                                                                    return lContainer[NATIVE]; <============================= this one
                                                                                  }
                                                                                  

                                                                                  ViewEngine returns last rendered node(last

                                                                                • element)ref

                                                                                  function renderAttachEmbeddedView(
                                                                                      elementData: ElementData, prevView: ViewData|null, view: ViewData) {
                                                                                    const prevRenderNode =
                                                                                        prevView ? renderNode(prevView, prevView.def.lastRenderRootNode!) : elementData.renderElement;
                                                                                    ...
                                                                                  }
                                                                                  

                                                                                  The solution might be reverting the dragged element back to original container so that we can let built-in ngForOf Angular directive to do its smart diffing.

                                                                                  Btw, the same technique is used in Angular material DragDropModule. It remembers position of dragging element and after we drop item it inserts it at its old position in the DOM which is IMPORTANT.

                                                                                  Source https://stackoverflow.com/questions/63532041

                                                                                  QUESTION

                                                                                  Is there a way to add variables into an array, like some sorts of an inventory?
                                                                                  Asked 2020-Jul-06 at 16:47

                                                                                  I'm making a text based game, based on the 1800s and survival, I'm trying to make an inventory system where, if you buy certain things from a shop, it adds it into an array, which is your inventory of course.

                                                                                  inv = ["empty"]
                                                                                  
                                                                                  shop_name = "Liams Necessities"
                                                                                  mattress = 40 #the numbers are the price assigned
                                                                                  water = 5
                                                                                  revolver = 60
                                                                                  #etc
                                                                                  

                                                                                  I have the buying it system sorted out, but i want to know how to update the array if you buy multiple items from different shops.

                                                                                  ANSWER

                                                                                  Answered 2020-Jul-06 at 16:23

                                                                                  firstly by default python does not use array it's use the list. To use array you need to use numpy in python .

                                                                                  So in your question I have seen that you are using list so you can use .append() to insert a value in the list.

                                                                                  inv = ["empty"]
                                                                                  inv.append("xyz")
                                                                                  print(inv)
                                                                                  

                                                                                  hope this will solve your problem.

                                                                                  Source https://stackoverflow.com/questions/62760084

                                                                                  Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                                                                                  Vulnerabilities

                                                                                  No vulnerabilities reported

                                                                                  Install revolver

                                                                                  You can download it from GitHub.

                                                                                  Support

                                                                                  For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
                                                                                  Find more information at:
                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                  Find more libraries
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit
                                                                                  CLONE
                                                                                • HTTPS

                                                                                  https://github.com/yuanrongxi/revolver.git

                                                                                • CLI

                                                                                  gh repo clone yuanrongxi/revolver

                                                                                • sshUrl

                                                                                  git@github.com:yuanrongxi/revolver.git

                                                                                • Share this Page

                                                                                  share link

                                                                                  Reuse Pre-built Kits with revolver

                                                                                  Consider Popular C++ Libraries

                                                                                  tensorflow

                                                                                  by tensorflow

                                                                                  electron

                                                                                  by electron

                                                                                  terminal

                                                                                  by microsoft

                                                                                  bitcoin

                                                                                  by bitcoin

                                                                                  opencv

                                                                                  by opencv

                                                                                  Try Top Libraries by yuanrongxi

                                                                                  razor

                                                                                  by yuanrongxiC++

                                                                                  innodb

                                                                                  by yuanrongxiC++

                                                                                  wiredtiger

                                                                                  by yuanrongxiC

                                                                                  libpaxos

                                                                                  by yuanrongxiC

                                                                                  lock-free-object-pool

                                                                                  by yuanrongxiC

                                                                                  Compare C++ Libraries with Highest Support

                                                                                  tensorflow

                                                                                  by tensorflow

                                                                                  electron

                                                                                  by electron

                                                                                  pytorch

                                                                                  by pytorch

                                                                                  bitcoin

                                                                                  by bitcoin

                                                                                  godot

                                                                                  by godotengine

                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                  Find more libraries
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit