Categories
Development

error: ‘int pow(double, int)’ conflicts with a previous declaration int pow(double a, int n) {

My linux version is 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux My gcc version is 8.3.0 i want to compile and run Sniper 7.2 with Pin 3.5. i am trying to compile benchmarks according to this post: https://groups.google.com/d/msg/snipersim/2yL2x6nNfVs/EmqQlVf6EwAJ but i get this error: /home/ahmad/sniper-latest/sniper-7.2/benchmarks/parsec/parsec-2.1/pkgs/apps/raytrace/obj/amd64-linux.gcc-sniper/RTTL/test/TestRTVec/TestRTVec.cxx:121:24: error: ‘int pow(double, int)’ conflicts with a previous declaration int […]

Categories
Development

Unable to deserialize ArrayList of ALL objects – only the first object is deserialized

There is lots of java serialization/deserialization questions, but I couldn’t find the answer to my problem. I run the GUI and three music objects are stored in ArrayList at run-time (pre-coded): private ArrayList<Music> musicList = new ArrayList<Music>(); … musicList.add(new Music(“Metallica”, “Master of Puppets”)); Then I add some more music from GUI. Those new objects are […]

Categories
Development

ansible throwing error when using pip command

when i am trying to run pip command through ansible i land up in error. {“changed”: false, “msg”: “Unable to find any of pip to use. pip needs to be installed.”} when i debugged on my machine i found pip was installed in latest version. I realized my file uses sudo to run the pip. […]

Categories
Development

How to use spoof or fake ip with xmpp?

I am using https://github.com/Norgul/xmpp-php this library how can I send an API request with spoof or fake IP? My code: public function send($to) { $getAnonUser = $this->getAnonUserPassword($to); $options = new Options(); $options ->setHost(self::$host) ->setPort(self::$port) ->setUsername($getAnonUser[‘nick’]) ->setPassword($getAnonUser[‘password’]); $client = new XmppClient($options); $client->connect(); $client->iq->getRoster(); $client->message->send(‘Some Messages’, $to.’x.com’); $client->disconnect(); }

Categories
Chrome Development

How to make protractor run with puppeteer and chrome 78?

I am using Protractor for Angular E2E Tests + Puppeteer for a consistent Chrome Version in all CI-Servers. Lately I am getting SessionNotCreatedError: session not created: This version of ChromeDriver only supports Chrome version 78 Errors. Although the installed versions of puppeteer (1.20.0 -> Chromium 78.0.3882.0) and webdriver-manager are matching. Any ideas on how to […]

Categories
Development

mapping through array of objects and accessing object values

I am trying to pick a value from array of object and the values can only be from first object. Firstly i have a array of objects like this: items [ [ {id: 1, title: “title1”, imgUrl: “https://someimage1”}, {id: 2, title: “title2”, imgUrl: “https://someimage2”} ], [ {id: 1, title: “title1”, imgUrl: “https://someimage1”}, {id: 2, title: […]

Categories
Development Google iOS

Using TFLite file generated via Google ML Kit in TensorFlowLite Image classification example iOS app

The .tflite and .txt files generated for Image classification via Google Firebase ML kit(https://developers.google.com/ml-kit) – when replaced into the Tensorflow image classification iOS sample (https://github.com/tensorflow/examples/tree/master/lite/examples/image_classification), it is identifying the images with very low accuracy and the match % is mostly below 30%. The same .tflite and .txt files – when integrated into the Android sample […]

Categories
Development History

how to access metrics from history

For a regression problem I want to compare some metrics but I am only able to get accuracy from the history which makes no sense wrt to regression purposes. How can I get other metrics like mean_squared_error and so on? create_model(…) input_layer = … output_laye = … model = Model(input_layer, output_layer) model.compile(loss=’mean_squared_error’, optimizer=optimizer, metrics=[‘accuracy’]) return […]

Categories
CSV Development

Removing Commas In CSV so it does not show up when editing with Notepad

I need to have a padded file but value in cell A1 needs to be their. When i open with notepad i get this: A,,, TOM,JONES,50,LONDON MARY,JANE,35,CHICAGO is there a way to remove the ,,, from the CSV file permanently?

Categories
Development

How to assign a Nokogiri Element to hash key

I’m scraping Techcrunch.com and grabbing the title, URL and preview text of each article. I have: require ‘nokogiri’ require ‘open-uri’ class TestScraper::Scraper @doc = Nokogiri::HTML(open(“https://techcrunch.com”) def scrape_tech_crunch articles = @doc.css(“h2.post-block__title”).css(“a”) top_stories = articles.each do |story| stories = { :title => story.children.text.strip, :url => story.attribute(“href”).value, :preview => @doc.css(“div.post-block__content”).children.first.text } TestScraper::Article.new(stories) end end end TestScraper::Article.new(stories) takes the […]