Apply a continue statement that will skip printing the first 10 numerical values of the involved variable for the program [duplicate]

Uncategorized
Question: This question already has an answer here:What is the “continue” keyword and how does it work in Java? 7 answers I need to apply a continue statement that will skip printing the first 10 values. I already have my code public class numbers { public static void main(String[] args) { for (int number=1; number
Read More

Error while installing in linux

Uncategorized
Question: I'm trying to install subliminal in linux. It is showing many errors which I'm unable to understand. Could someone please help me to resovle this issue These are the errors I'm getting: Ign:1 http://in.archive.ubuntu.com/ubuntu xenial/main i386 python3-dogpile.core all 0.4.1+dfsg1-3 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? Answer: Read more
Read More

find and replace second occurrence of [bracketed] expression in string with dot seperator

Uncategorized
Question: What is the Regex for something[0].somethingElse[2].otherthing[7] i want to target value 2 between second [brackets] which has dots before and after it. Answer: Without using Regex, the simplest way of doing it is to get the indexOf the value: const something = [ { somethingElse: [ 'foo', 'bar', 'baz', ] } ]; const value = something[0].somethingElse[2]; console.log(something[0].somethingElse.indexOf(value)); Run code snippetHide results Expand snippet If you really want to use Regex though: const data = 'n[0].s[0].k[0]'; console.log(data.replace(/..*[d]./g, '[' + +i + ']')); Run code snippetHide results Expand snippet Read more
Read More

How do I console.log POST requests with my chrome extension

Uncategorized
Question: I'm trying to console.log POST requests with my chrome extension but can't figure out how to do it, can anyone give me an example? I've looked at the chrome extension API but still can't seem to get to it Answer: In Google Chrome, browser requests such as POST and GET are visible in the Network tab of the Inspector. Screenshot from Chrome Devtools Overview: If you are looking for a natural way to make a Javascript hook on browser requests (such as for logging them out), you will have more issues as there is no native way for Javascript to hook on requests at browser's scale, for security reasons. But if you are okay to use a dedicated extension for the job, you can look at the webRequest extension…
Read More

Keras training accuracy got result less than 60 percent

Uncategorized
Question: I need help on how do I increase the accuracy of my training using keras with tensorflow as backend. First I downloaded the public electrical dataset from here --> http://plaidplug.com/ Then I picked 5 dataset for each category, selecting 2000 row of Current(I) each dataset, stacked them and save it as input.h5 The file will have structure like this. I named this stacked matrix as currentdata [[~2000 of data for AC], [~2000 of data for AC], ..., ..., ..., [~2000 of data for CFL], [~2000 of data for CFL], ..., ..., ..., [~2000 of data for Fridge], ..., ..., ..., ..., ..., [~2000 of data for Heater]] Then I created a txt file for the output. The file consists of the following string indicating the number of dataset(5) for…
Read More

Tslint –fix does not autofix but isntead output’s lint problems as console errors

Uncategorized
Question: I'm using the Angular starter kit: https://github.com/AngularClass/angular-starter and I'm trying to get tslint to autofix all my lint problems with the --fix flag. I'm running the script: npm run tslint --fix src/**/*.ts It just output's the same error that I'm already being told about in tslint and not autofixing it: console output:ERROR: src/app/app-routing.module.ts[10, 5]: comment must start with a space ERROR: src/app/app-routing.module.ts[2, 20]: Too many spaces before 'from' Am I missing something that allows it to implement the changes? My versions are: "tslint": "^5.6.0" "codelyzer": "^3.1.2" Question: How can I get tslint to implement autofix to my lint errors? Answer: Read more
Read More

MaskedEditText input to string

Uncategorized
Question: Hi I have imported a dependency from gitHub that set's a mask on a Input. But I can't seem to get the input and convert it to string. I do that by trying to diplay it using textview from this activity. Activity_Violator.java public class ViolatorDetail2 extends AppCompatActivity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activitiy_violator_detail2); MaskedEditText maskedEditText = (MaskedEditText)findViewById(R.id.masked_edit_text); final String a =maskedEditText.getText().toString(); Button btnConvert = (Button) findViewById(R.id.btnConvert); btnConvert.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { TextView b = (TextView)findViewById(R.id.tvMaskTry); b.setText(a); } }); It only returns the ' - - ' values from the mask on button click. XML file Answer: Ok, as far as I searchet the lib you are using it should be MaskedEditText#getText().toString(). But you should use it in your listener. Not in onCreate method.…
Read More

Search title is not working in Select2 after Ajax call

Uncategorized
Question: Search filter works unexpectedly after process result in ajax call processResults $(".project_title_select2").select2({ ajax: { url: 'https://MyJsFile.js', dataType: "script", data: function (params) { var queryParameters = { term: params.term } return queryParameters; }, processResults: function (data) { return { results: $.map(json_development_list, function (item) { return { text: item[1], id: item[0] } }) }; } } }); Search filter works unexpectedly after process result in ajax call processResults Answer: Read more
Read More

Google Translate is not translating some webpages

Uncategorized
Question: I stumbled over the Google Translate feature for use on Websites so I implemented it on mine: http://www.publictalksoftware.co.uk/default.php It works well: I have two specific issues though that I don't know how to resolve. I kindly ask for your support with the first issue. Webpages not being translated If you set the language, say to Spanish, and then go to this link: http://www.publictalksoftware.co.uk/msa/HelpOnline/ My online help system remains in English. Is there a specific reason why this part of the website is not getting translated? Answer: Read more
Read More

Laravel: MySQL auto-updates my updated_at field everyday without any update on article

Uncategorized
Question: I recently worked on a blog application using Laravel 5.4 on my localhost and everything was working fine. However, when I uploaded my application on a remote server on the internet, the updated_at field on every post kept updating automatically every day. The same code when run on my local machine works fine and the updated_at field is only updated when the post is updated. I am guessing that the problem is at the level of the database configuration but I have no idea how to fix that. The source code: migrations Schema::create('posts', function (Blueprint $table) { $table->increments('id'); $table->string('title'); $table->string('featured_image'); $table->string('slug')->unique(); $table->text('body'); $table->boolean('published')->default(false); $table->unsignedInteger('user_id'); $table->integer('views')->default(0); $table->timestamps(); $table->softDeletes(); $table->foreign('user_id')->references('id')->on('users'); }); and I have this in my model Post.php:protected $dates = ['created_at', 'updated_at', 'deleted_at']; I am only adding the source code…
Read More

NextCloud in which fileFile uploading codes are available

Uncategorized
Question: I am going to make an app. But I am stuck in one issue. I am unable to find in which file of nextcloud, the codes are available which uploads file. How can I find the file in which file uploading codes are situated? I am going to make an app which will make a duplicate of uploaded file and will save in same directory with slightly changed name. Answer: Read more
Read More