Coder Social home page Coder Social logo

how-to-ask-questions-the-smart-way's People

Contributors

xiaolai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

how-to-ask-questions-the-smart-way's Issues

Windows offline error

I ran the following Powershell script and now I cant log back into my windows account. Any idea?

2 $objShell = New-Object -ComObject Shell.Application
3 $objFolder = $objShell.Namespace(0xA)
4 $WinTemp = "c:\Windows\Temp*"
5
6 #1# Empty Recycle Bin #
7 write-Host "Emptying Recycle Bin." -ForegroundColor Cyan
8 $objFolder.items() | %{ remove-item $_.path -Recurse -Confirm:$false}
9
10 #2# Remove Temp
11 write-Host "Removing Temp" -ForegroundColor Green
12 Set-Location “C:\Windows\Temp”
13 Remove-Item * -Recurse -Force -ErrorAction SilentlyContinue
14

15 Set-Location “C:\Windows\Prefetch”
16 Remove-Item * -Recurse -Force -ErrorAction SilentlyContinue
17

18 Set-Location “C:\Documents and Settings”
19 Remove-Item “.*\Local Settings\temp*” -Recurse -Force -ErrorAction SilentlyContinue
20

21 Set-Location “C:\Users”
22 Remove-Item “.*\Appdata\Local\Temp*” -Recurse -Force -ErrorAction SilentlyContinue
23
24 #3# Running Disk Clean up Tool
25 write-Host "Finally now , Running Windows disk Clean up Tool" -ForegroundColor Cyan
26 cleanmgr /sagerun:1 | out-Null
27
28 $([char]7)
29 Sleep 3
30 write-Host "I finished the cleanup task,Bye Bye " -ForegroundColor Yellow
31 Sleep 3
32 ##### End of the Script #####

running relies pipe line in azure - can not find image Resource ID

I created the image and it works if I run it by script from linux server, Image can not depend of any over RG, because that RG will not exist and will be created:

IMAGE_NAME=/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/01_VM_RG/providers/Microsoft.Compute/images/IMG

if I run it from devops getting the error, that it is not found, I tried it with: " " or ' ' or ( )

How to visualise gene expression matrix of only 2 genes

I have been working with single cell sequencing data on R, where the data pbject is a seurat object, containing genes and cells in an expression matrix. I want to visualize expression of 2 genes in 13,000 cells a similar manner to that of classical flow cytometry plots, where each dot is a cell:
i.e. as below
image

Is this possible? Suggestions welcome,
Thanks!
Naomi

Unreal Engine 4.26.2 Oculus Quest 2 MacBook Pro integration issue

Hello,
I am running a UE4 4.26.2 on a MacBook Pro and have followed all the step to start developing VR games with an Oculus Quest 2 but cannot seem to get the VR Preview to work to test the editor. I am not interested in packaging the project or launching it yet because I want to make the game first. I've watched every tutorial on YouTube and I am not sure what I am missing in order to view the editor in the oculus headset.
MacBook Pro specs macOS Catalina 10.15.6
Intel Iris Plus Graphics 645 1536 MB
Android Studio 3.5.3
Unreal Engine 4.26.2
Oculus Developer synced by USB-C
Oculus App synced to device as well on my phone and in developer mode.
ADB installed

UE4 editor formatted and compiled sucessfully for Android and plugin for oculus working. I can view the device under launch but the VR preview button is greyed out so I cannot test the device. I have also tried airlink and that wasn't successful either.

There is a cargo ship that contains an unlimited amount of cargo in it. The ship is ready to sail and you have a list of N non-negative integers which denotes the water level in the sea at the ith points. A wave is defined as the continuously decreasing water level or continuously increasing water level. Let A= [1,2,6,4,2,3,1,8,9,7], it has 6 waves in it [1,2,6],[6,4,2],[2,3],[3,1],[1,8,9],[9,7] The amount of cargo that falls into the sea is equal to the product of the smallest height of the wave and length of the wave. You have to find the total amount of cargo which falls into the sea.

Cargo-Dropping-Ships

There is a cargo ship that contains an unlimited amount of cargo in it. The ship is ready to sail and you have a list of N non-negative integers which denotes the water level in the sea at the ith points. A wave is defined as the continuously decreasing water level or continuously increasing water level.

Let A= [1,2,6,4,2,3,1,8,9,7], it has 6 waves in it [1,2,6],[6,4,2],[2,3],[3,1],[1,8,9],[9,7]

The amount of cargo that falls into the sea is equal to the product of the smallest height of the wave and length of the wave.
You have to find the total amount of cargo which falls into the sea.

NOTE: No two adjacent value will be equal in the list.

Input:
First-line contains T-number of TestCases. Then for every test case,
• 1st line contains a non-negative integer N.
• The next line contains a list of N space-separated integer denoting the water level at the ith point.

Output:
The total amount of cargo that falls into the sea.

Constraints:
1 <= T <= 1e3
2 <= N <= 1e5
1 <= A[i] <= 1e5

Note: The sum of N in a test would not exceed 1e10

Sample test cases:

1
10
1 2 6 4 2 3 1 8 9 7

Sample output:
32

Solution
Solution.zip

Building a lading page(html css)

I'm trying to build a small landing page project using HTML and CSS. I'm not able to add anything after my navbar and i can't figure out what is the problem. {please bear with me I'm a beginner }

HERE IS THE HTML CODE

<title>Frontend Mentor | Loopstudios landing page</title>

IMMEERSIVE EXPERIENCES THAT DELIVER

plot_gsva_heatmap order columns

Hello,
I am trying to order the columns using the plot_gsva_heatmap() function.
This is my script:
plot_gsva_heatmap(MacsVac_seurat_gsva,
pathway_ids = relevant_pathways,
margins = c(10,25),
dendrogram = "col",
scale = "row",
key = FALSE,
sns.set(font_scale=8),
lwid=c(0.1,2))
And here is the plot
image
I know currently the columns are organised by similarity given by euclidean distance, but want to control the ordering over a timeline.

I want the columns to be in this order: Macrophages_Preimm, Macrophages_VacD1, Macrophages_VacD7, Macrophages_VacD15

There is no column_order function in plot_gsva_heatmap() I think.

Thanks in advance for your help!
Naomi

In Python dynamo variable is not updated in the first loop iteration

I've writen a python script inside dynamo which offset a circle inward with a given offset distance and in the same time create an arc of 12 m length in each offset circle then rotate them (created arcs) by overlapping till the remainder lenght is < 12m...my script works, but I get the first arc in each circle duplicated

doublon

This issue is due to a non updated variable (End_Angle) in the first loop iteration (see image below)

image (3)

Remark: I posted my question in dynamobim forum here, but I didn't get a desired solution!!.. although I know that I can manipulate my lists and remove each duplicated arc, but I want find a real solution which allows me to update that variable and fix this issue.
Please check my code below for more details:
https://github.com/REDO79/arc.git

Thanks.

Clerk Error

I was installing @clerk/nextjs and @clerk/react but got this error. I can't seem to make it work. I was wondering whether this error is fixed or not. Thank in advance.

./node_modules/@clerk/shared/dist/react/index.mjs
Attempted import error: 'SWRConfig' is not exported from 'swr' (imported as 'SWRConfig').

clerk_error

error: The class 'User' doesn't have a default constructor. (new_with_undefined_constructor_default at [tunedin] lib/resources/firebase_methods.dart:12)

//This is my firebase_methods.dart file
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:tunedin/utils/utilities.dart';

class FirebaseMethods {
final FirebaseAuth _auth = FirebaseAuth.instance;
GoogleSignIn _googleSignIn = GoogleSignIn();
static final Firestore firestore = Firestore.instance;

//user class
User user = User();

Future getCurrentUser() async {
FirebaseUser currentUser;
currentUser = await _auth.currentUser;
return currentUser;
}

Future signIn() async {
GoogleSignInAccount _signInAccount = await _googleSignIn.signIn();
GoogleSignInAuthentication _signInAuthentication =
await _signInAccount.authentication;

final AuthCredential credential = GoogleAuthProvider.getCredential(
    accessToken: _signInAuthentication.accessToken,
    idToken: _signInAuthentication.idToken);

FirebaseUser user = await _auth.signInWithCredential(credential);
return user;

}

Future authenticateUser(FirebaseUser user) async {
QuerySnapshot result = await firestore
.collection("users")
.where("email", isEqualTo: user.email)
.getDocuments();

final List<DocumentSnapshot> docs = result.documents;

//if user is registered then length of list > 0 or else less than 0
return docs.length == 0 ? true : false;

}

Future addDataToDb(FirebaseUser currentUser) async {
String username = Utils.getUsername(currentUser.email);

user = User(
    uid: currentUser.uid,
    email: currentUser.email,
    name: currentUser.displayName,
    profilePhoto: currentUser.photoUrl,
    username: username);

firestore
    .collection("users")
    .document(currentUser.uid)
    .setData(user.toMap(user));

}

Future signOut() async {
await _googleSignIn.disconnect();
await _googleSignIn.signOut();
return await _auth.signOut();
}

}


//This is my firebase_auth.dart file
Screenshot 2020-11-25 at 7 25 46 PM
Screenshot 2020-11-25 at 7 25 58 PM

// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

library firebase_auth;

import 'dart:async';

import 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart';
import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:meta/meta.dart';

export 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart'
show
FirebaseAuthException,
IdTokenResult,
UserMetadata,
UserInfo,
ActionCodeInfo,
ActionCodeSettings,
AdditionalUserInfo,
ActionCodeInfoOperation,
Persistence,
PhoneVerificationCompleted,
PhoneVerificationFailed,
PhoneCodeSent,
PhoneCodeAutoRetrievalTimeout,
AuthCredential,
EmailAuthProvider,
EmailAuthCredential,
FacebookAuthProvider,
FacebookAuthCredential,
GithubAuthProvider,
GithubAuthCredential,
GoogleAuthProvider,
GoogleAuthCredential,
OAuthProvider,
OAuthCredential,
PhoneAuthProvider,
PhoneAuthCredential,
SAMLAuthProvider,
TwitterAuthProvider,
TwitterAuthCredential,
RecaptchaVerifierOnSuccess,
RecaptchaVerifierOnExpired,
RecaptchaVerifierOnError,
RecaptchaVerifierSize,
RecaptchaVerifierTheme;

export 'package:firebase_core_platform_interface/firebase_core_platform_interface.dart'
show FirebaseException;

part 'src/firebase_auth.dart';
part 'src/user_credential.dart';
part 'src/user.dart';
part 'src/confirmation_result.dart';
part 'src/recaptcha_verifier.dart';

OSM

How to check tags that are added or modified before upload to server in josm

PY4E Chapter 12 --please help

I'm on Ch.12 (video C--write a web browser)

I'm testing the HTTP Request on my Atom application / command prompt, and in Python itself.

I copied the code exactly as shown in the video:

import socket

mysock=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
mysock=connect(('data.pr4e.org',80))
cmd='GET hhtp://www.pr4e.org/romeo.txt' HTTP/1.0\n\n.encode()
mysock.send(cmd)

while True:
data=myscok.recv(512)
if (len(data)<1):
break
print(data.decode())
mysock.close()

when I run the above in command prompt, and in Python, I get a SyntaxError (as shown below)

Command Prompt:
File "C:\Users\fetyl\Desktop\py4e\12.C.py", line 5
cmd='GET hhtp://www.pr4e.org/romeo.txt' HTTP/1.0\n\n.encode()
^
SyntaxError: invalid syntax

Python:
Traceback (most recent call last):
File "", line 1, in
NameError: name 'connect' is not defined

cmd='GET hhtp://www.pr4e.org/romeo.txt' HTTP/1.0\n\n.encode()
File "", line 1
cmd='GET hhtp://www.pr4e.org/romeo.txt' HTTP/1.0\n\n.encode()
^
SyntaxError: invalid syntax
mysock.send(cmd)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'cmd' is not defined

while True:
... data=myscok.recv(512)
... if (len(data)<1):
... break
... print(data.decode())
... mysock.close()
File "", line 6
mysock.close()
^
SyntaxError: invalid syntax

I'm not sure what I've done wrong. I put a single space, as directed, and typed everything word-for-word from the video. I even went to the slide version and copy-and-pasted to make sure I wasn't falling victim to human error (ascertaining that my eyes weren't tricking me into thinking it was exactly the same).

Please help. What the f*** am I doing wrong?

Postal Installation Problem: Site Refused to Connect

After installing and configuring postal to my VPS IP (5.132.242.125), it was working fine until today. Now it refuses to connect, with the postal status error message of :

*smtp only has 2 instances (should have 1)

  • smtp.6 is not running (Failed)

Here is my netstat results:

netstat

In Machine Learning for Audio Classification, in stage of taring our model we stuck with an error

Error note

 raise ValueError("Shapes %s and %s are incompatible" % (self, other))

ValueError: Shapes (None, 10) and (None, 2) are incompatible

required python code

from tensorflow.keras.callbacks 
import ModelCheckpoint
from datetime import datetime 

num_epochs = 200
num_batch_size = 32

checkpointer = ModelCheckpoint(filepath='saved_models/audio_classification.hdf5', 
                               verbose=1, save_best_only=True)
start = datetime.now()

model.fit(X_train, y_train, batch_size=num_batch_size, epochs=num_epochs, validation_data=(X_test, y_test), callbacks=[checkpointer], verbose=1)


duration = datetime.now() - start
print("Training completed in time: ", duration)

Not able to fire API call in Jest for react component imported in another react component

I am trying to test Button click function in jest. These are my code.

mainComponent.js

 export default function MainComponent(){
     const saveApiSettings = () => {
     apiCall('rest/test_api/').then(res => {
      console.log(res)
    });
   }
 return( 
  <div>
   <CommonModule
    saveApiData={ saveApiSettings}
   />
 </div>)
}

commonModule.js

   export default function CommonModule() {
        const saveData = () => {
         props.saveApiData();
        }
        return (
         <Button
          onClick = {(e) => saveData(e)}
          id = "save-btn"
         >
          click
         </Button>
        )
      }

test.js

 it('save data to DB', async () => {
   act(() => {
    render(<MainComponent />);
   });
   act(() => {
    const checkSaveBtnenable = document.querySelector(`button[id = 'save-btn']`);
    checkSaveBtnenable.dispatchEvent(new MouseEvent("click", { bubbles: true }));
  });

handler.js

import { rest } from 'msw';
 export const handlers = [
  rest.post(`rest/test_api/`, async (req, res, ctx) => {
   console.log(req, "Not printing");
  })
 ]

It seems like its not able to hit API from test file. I am using MSW (Mock Server Work) to mock API calls. Its look like I am loading main component and trying to access another component click. I am not able to hit API defined in handler.js.

Cargo-Dropping-Ships

There is a cargo ship that contains an unlimited amount of cargo in it. The ship is ready to sail and you have a list of N non-negative integers which denotes the water level in the sea at the ith points. A wave is defined as the continuously decreasing water level or continuously increasing water level.

Let A= [1,2,6,4,2,3,1,8,9,7], it has 6 waves in it [1,2,6],[6,4,2],[2,3],[3,1],[1,8,9],[9,7]

The amount of cargo that falls into the sea is equal to the product of the smallest height of the wave and length of the wave.
You have to find the total amount of cargo which falls into the sea.

NOTE: No two adjacent value will be equal in the list.

Input:
First-line contains T-number of TestCases. Then for every test case,
• 1st line contains a non-negative integer N.
• The next line contains a list of N space-separated integer denoting the water level at the ith point.

Output:
The total amount of cargo that falls into the sea.

Constraints:
1 <= T <= 1e3
2 <= N <= 1e5
1 <= A[i] <= 1e5

Note: The sum of N in a test would not exceed 1e10

Sample test cases:

1
10
1 2 6 4 2 3 1 8 9 7

Sample output:
32

The attached zip contains the solution of the above question.Any optimisations would be appreciated
Solution.zip

VS code error: Non static method 'length' should not be called statically.

HOW CAN SOLVE THE ERROR >Non static method 'length' should not be called statically.

//HERE IS THE CODE

`<?php
include 'core/init.php';
$user_id = $_SESSION['user_id'];
$user = $userObj->userData($user_id);
$verifyObj->authOnly();
if(isset($_POST['update'])){
$required = array('firstName','lastName','username','email','password');
foreach($_POST as $key => $value){
if(empty($value) && in_array($key, $required)){
$errors['allFields'] = "All fields are required";
break;
}
}

if(empty($errors['allFields'])){
	$firstName     = Validate::escape($_POST['firstName']);
	$lastName      = Validate::escape($_POST['lastName']);
	$username      = Validate::escape($_POST['username']);
	$email         = Validate::escape($_POST['email']);
	$password      = $_POST['password'];

ERROR
Non static method 'length' should not be called statically

	if(Validate::length($firstName, 2, 20)){
		$errors['names'] = "Names can only be between in 2 - 20 characters";
	
	}else if (Validate::length($lastName, 2, 20)){
		$errors['names'] = "Names can only be between in 2 - 20 characters";
	}

	if(Validate::length($username, 2, 10)){
		$errors['username'] = "Username can only be between in 2 - 10 characters";
	
	}else if ($username != $user->username && $userObj->usernameExist($username)){
		$errors['username'] = "Username is already teken!";
	}

	if(!Validate::filterEmail($email)){
		$errors['email'] = "Invalid email format";
	
	}else if($email != $user->email && $userObj->emailExist($email)){
		$errors['email'] = "Email already exists";
	
	}else{
		if(password_verify($password, $user->password)){
			//update user
			  $userObj->update('users', array('firstName' => $firstName, 'lastName' => $lastName, 'username' => $username, 'email' => $email), array('user_id' => $user_id));
			  $userObj->redirect('account/settings');
		}else{
			$errors['password'] = "Password is incorrect!";
		}
	}
}	

}
?>

<title>Update your account</title>

Change Name

Change User Name

Change Email

			<div>
			<h3>Enter your password to update your account</h3>
			<input type="password" name="password" placeholder="Password"/>
			
			<!-- Password Errors -->
			<?php if(isset($errors['password'])):?>
			 <span class="error-in"><?php echo $errors['password'];?></span>
		    <?php endif;?>	
			</div>

			<!-- Required Fields Errors -->
			<?php if(isset($errors['allFields'])):?>
			 <span class="error-in"><?php echo $errors['allFields'];?></span>
			<?php endif;?>
			<div class="btn-div">
			<button value="sign-up" name="update">Save</button>
			</div>
			</form>
		</div>
	</div>
</div>
`

rsem calculate expression error

Hello ,

I am trying to run an analysis on rsem-calculate-expression but keep getting an error that says invalid number of arguments. The command below is what I am inputting:

RSEM-1.3.3/rsem-calculate-expression --bowtie2 -p 30 --paired-end \ trimmed/CON1_1.tp.fq.gz\ trimmed/ CON1_2.tp.fq.gz\ Human_genome.seq\ CON1

Also, I used the rsem-prepare-reference to prepare human genome from genome downloaded from ensembl RSEM-1.3.3/rsem-prepare-reference --gtf Homo_sapiens.GRCh38.83.gtf \ --bowtie2 \ --bowtie2-path ./bowtie2-2.4.5-macos-x86_64 \ Homo_sapiens.GRCh38.dna.primary_assembly.fa \ Human_genome

I obtained several files from this analysis and using the Human_genome.seq, is this the correct one?

Is there a way for tensorflow's scatter_nd_update to work with indices of type tf.int64 instead of tf.int32?

I'm working with a tf.Variable for which I need to update the values using the scatter_nd_update function. The problem is that my variable has a number of elements equals to 512x512x2048x7 = 3 758 096 384 which is larger than the range converd by int32 (2147483647). And apparently the scatter_nd_update function works only with tf.int32 number and does not work with tf.int64.

Here is an example of the code that produces an overflow error:

import tensorflow as tf

image = tf.Variable(tf.ones((512,512,2048,7), dtype=tf.float32))

update = tf.constant([0.0])
index = tf.constant([[0,0,0,0]], dtype=tf.int64)
image.scatter_nd_update(index, update)

print(f"image shape {tf.shape(image)}")

The error that is raised is the following:
F ./tensorflow/core/util/gpu_launch_config.h:129] Check failed: work_element_count > 0 (-536870912 vs. 0) Aborted (core dumped)

Do you have any idea about how this problem can be resolved?

error in flutter http request

I am trying to send http request in Flutter and show the result in my app. But I have an error.
this is my code:

  import 'dart:convert';
  import 'package:requests/home_page_free.dart';
  import 'package:requests/home_page_video.dart';
  import 'package:dots_indicator/dots_indicator.dart';
  import 'package:flutter/cupertino.dart';
  import 'package:flutter/material.dart';
  import 'package:http/http.dart';
  import 'package:font_awesome_flutter/font_awesome_flutter.dart';
  
  class HomePageBody extends StatefulWidget {
    const HomePageBody({super.key});
  
    @override
    State<HomePageBody> createState() => _HomePageBodyState();
  }
  
  class _HomePageBodyState extends State<HomePageBody> {
    PageController freeController = PageController(viewportFraction: 0.85);
    PageController proController = PageController(viewportFraction: 0.85);
    var _freeCurrentPageValue = 0.0;
    var _proCurrentPageValue = 0.0;
    var _freeScaleFactor = 0.8;
    var _proScaleFactor = 0.8;
    double _height = 320;
  
    List<MainFree> _free_items = [];
  
  
  
    @override
    void initState() {
      freeController.addListener(() {
        setState(() {
          _freeCurrentPageValue = freeController.page!;
        });
      });
      proController.addListener(() {
        setState(() {
          _proCurrentPageValue = proController.page!;
        });
      });
      freeItem();
      super.initState();
    }
  
    @override
    void dispose() {
      freeController.dispose();
      proController.dispose();
      super.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
      return Container(
        child: SingleChildScrollView(
          child: Column(
            children: [
              Container(
                height: MediaQuery.of(context).size.height/3.6,
                child: PageView.builder(
                    controller: freeController,
                    itemCount: _free_items.length,
                    itemBuilder: (context, position){
                      return _freePageItem(_free_items[index]);
                    }),
              ),
          ),
        ),
      );
    }
  
    Widget _freePageItem(int index, MainFree free){
      Matrix4 matrix4 = new Matrix4.identity();
      if (index == _freeCurrentPageValue.floor()) {
        var currScale = 1 - (_freeCurrentPageValue - index) * (1 - _freeScaleFactor);
        var currTrans = _height * (1 - currScale) / 2;
        matrix4 = Matrix4.diagonal3Values(1, currScale, 1)..setTranslationRaw(0, currTrans, 0);
      } else if (index == _freeCurrentPageValue.floor() + 1) {
        var currScale = _freeScaleFactor + (_freeCurrentPageValue - index + 1) * (1 - _freeScaleFactor);
        var currTrans = _height * (1 - currScale) / 2;
        matrix4 = Matrix4.diagonal3Values(1, currScale, 1);
        matrix4 = Matrix4.diagonal3Values(1, currScale, 1)..setTranslationRaw(0, currTrans, 0);
      } else if (index == _freeCurrentPageValue.floor() - 1) {
        var currScale = 1 - (_freeCurrentPageValue - index) * (1 - _freeScaleFactor);
        var currTrans = _height * (1 - currScale) / 2;
        matrix4 = Matrix4.diagonal3Values(1, currScale, 1);
        matrix4 = Matrix4.diagonal3Values(1, currScale, 1)..setTranslationRaw(0, currTrans, 0);
      } else {
        var currScale = 0.8;
        matrix4 = Matrix4.diagonal3Values(1, currScale, 1)..setTranslationRaw(0, _height * (1 - _freeScaleFactor) / 2, 1);
      }
  
      return Transform(
        transform: matrix4,
        child: Stack(
          children: [
            Container(
              height: MediaQuery.of(context).size.height/6,
              margin: EdgeInsets.only(left: 5, right: 5),
              decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(30),
                  color: Colors.deepOrange,
                  image: DecorationImage(
                      fit: BoxFit.cover,
                      image: AssetImage(
                          free.app_image
                      )
                  )
  
              ),
            ),
          ],
        ),
      );
    }
    
    void freeItem() async{
      var url = Uri.https('www.geors.ir', '/api_free/', {'q': '{http}'});
      var response = await get(url);
      print(utf8.decode(response.bodyBytes));
      setState(() {
        var free_json = json.decode(utf8.decode(response.bodyBytes));
        for (var i in free_json){
          var free_items = MainFree(i['title'], i['app_image'], i['category'], i['tech_count'], i['views'], i['meta_description']);
          _free_items.add(free_items);
        }
      });
    }
  }

it raise this error:

Error: Too few positional arguments: 2 required, 1 given.
                    return _freePageItem(_free_items[index]);
                                        ^

TPLink CPE220 v3.0 File Dump or Backup Bios

Good Morning, Afternoon, Night
Sorry to the router masters... Do you have a dump file or backup of the Tp link cpe220 v3? I would be very grateful if anyone could provide the files. once again thank you, sorry if my english is not good.

Thank You 🙏

Eclipse, Java, how to export right

How to export the project into the Runnable JAR file in Eclipse WITH A PHOTO AND AN AUDIO, cause it only export classes, and then cant find my photo and an audio.

how to select the id that is just added and take that id and use it in another screen

My Scenario:

1)I need to Create a Demand and after creating the Demand the Id will be autogenerated 2)I need to Fetch that id and use it in another screen

Question: While i created the Demand and try to fetch the Id there will be multiple users who will create the Demand at the same time and there will be multiple ids which will get generated. So i need to get only the Id which i have got after creating the Demand . How Do i handle this ....

So Far i have treid to fetch the lastestid only by using HashMap and it should not be done that ways.

My Code which i have used to Fetch the id is:

public static HashMap<String, String> createdValue; public static void FetchID(WebDriver driver) throws InterruptedException {

createdValue = new HashMap<String, String>();

List<WebElement> tableValues = driver.findElements(By.xpath("//table//tr//td[contains(@class,'mat-column-demandId')]//span"));

int tableValueSize = tableValues.size();

WebElement latestId = driver.findElement(By.xpath("(//table//tr//td[contains(@class,'mat-column-demandId')]//span)["+tableValueSize +"]"));



createdValue.put("latestDataId", latestId.getText()); 


System.out.println(createdValue.put("latestDataId", latestId.getText()));



inputEntry(driver, .SearchInputXpath , createdValue.put("latestDataId", latestId.getText()));

}

The above code will only Fetch the latestid but as specified i need to get only the Id for which i have created the Demand and should not fetch the id of a Demand created by someone else.

Any leads on this will be helpful.

How to listen webview post message xamarin form

I can not callback to webview the post massage(It is written by js).How Can I listen post message after clicking on the button in xamarin form.(Navigation and all clicking functions do not work also).

HTML CSS

I'm not able to add anything beyond my navbar. please help me out (bear with me please I'm new to this)

Screenshot 2021-01-30 143839

error: The expression doesn't evaluate to a function, so it can't be invoked. (invocation_of_non_function_expression at [tuned_in] lib/resources/firebase_methods.dart:17)

//this my firebase_methods.dart
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:tuned_in/models/user.dart';
import 'package:tuned_in/utils/utilities.dart';

class FirebaseMethods {
final FirebaseAuth _auth = FirebaseAuth.instance;
GoogleSignIn _googleSignIn = GoogleSignIn();
static final Firestore firestore = Firestore.instance;

//user class
User user = User();

Future getCurrentUser() async {
FirebaseUser currentUser;
currentUser = await _auth.currentUser();
return currentUser;
}

Future signIn() async {
GoogleSignInAccount _signInAccount = await _googleSignIn.signIn();
GoogleSignInAuthentication _signInAuthentication =
await _signInAccount.authentication;

final AuthCredential credential = GoogleAuthProvider.getCredential(
    accessToken: _signInAuthentication.accessToken,
    idToken: _signInAuthentication.idToken);

FirebaseUser user = await _auth.signInWithCredential(credential);
return user;

}

Future authenticateUser(FirebaseUser user) async {
QuerySnapshot result = await firestore
.collection("users")
.where("email", isEqualTo: user.email)
.getDocuments();

final List<DocumentSnapshot> docs = result.documents;

//if user is registered then length of list > 0 or else less than 0
return docs.length == 0 ? true : false;

}

Future addDataToDb(FirebaseUser currentUser) async {
String username = Utils.getUsername(currentUser.email);

user = User(
    uid: currentUser.uid,
    email: currentUser.email,
    name: currentUser.displayName,
    profilePhoto: currentUser.photoUrl,
    username: username);

firestore
    .collection("users")
    .document(currentUser.uid)
    .setData(user.toMap(user));

}

Future signOut() async {
await _googleSignIn.disconnect();
await _googleSignIn.signOut();
return await _auth.signOut();
}

}

//this is user.dart file
class User {
String uid;
String name;
String email;
String username;
String status;
int state;
String profilePhoto;

User({
this.uid,
this.name,
this.email,
this.username,
this.status,
this.state,
this.profilePhoto,
});

Map toMap(User user) {
var data = Map<String, dynamic>();
data['uid'] = user.uid;
data['name'] = user.name;
data['email'] = user.email;
data['username'] = user.username;
data["status"] = user.status;
data["state"] = user.state;
data["profile_photo"] = user.profilePhoto;
return data;
}

User.fromMap(Map<String, dynamic> mapData) {
this.uid = mapData['uid'];
this.name = mapData['name'];
this.email = mapData['email'];
this.username = mapData['username'];
this.status = mapData['status'];
this.state = mapData['state'];
this.profilePhoto = mapData['profile_photo'];
}
}

//this is login_screen.dart
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:tuned_in/resources/firebase_repository.dart';
import 'package:shimmer/shimmer.dart';
import 'package:tuned_in/utils/universal_variables.dart';
import 'home_screen.dart';

class LoginScreen extends StatefulWidget {
@OverRide
LoginScreenState createState() => LoginScreenState();
}

class LoginScreenState extends State {
FirebaseRepository _repository = FirebaseRepository();

bool isLoginPressed = false;

@OverRide
Widget build(BuildContext context) {
_repository.signOut();
return Scaffold(
backgroundColor: UniversalVariables.blackColor,
body: Stack(
children: [
Center(
child: loginButton(),
),
isLoginPressed
? Center(
child: CircularProgressIndicator(),
)
: Container()
],
),
);
}

Widget loginButton() {
return Shimmer.fromColors(
baseColor: Colors.white,
highlightColor: UniversalVariables.senderColor,
child: FlatButton(
padding: EdgeInsets.all(35),
child: Text(
"LOGIN",
style: TextStyle(
fontSize: 35, fontWeight: FontWeight.w900, letterSpacing: 1.2),
),
onPressed: () => performLogin(),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
),
);
}

void performLogin() {
print("tring to perform login");

setState(() {
  isLoginPressed = true;
});

_repository.signIn().then((FirebaseUser user) {
  print("something");
  if (user != null) {
    authenticateUser(user);
  } else {
    print("There was an error");
  }
});

}

void authenticateUser(FirebaseUser user) {
_repository.authenticateUser(user).then((isNewUser) {
setState(() {
isLoginPressed = false;
});

  if (isNewUser) {
    _repository.addDataToDb(user).then((value) {
      Navigator.pushReplacement(context,
          MaterialPageRoute(builder: (context) {
        return HomeScreen();
      }));
    });
  } else {
    Navigator.pushReplacement(context,
        MaterialPageRoute(builder: (context) {
      return HomeScreen();
    }));
  }
});

}
}

reportMissingImports---> specifically shodan on windows

attempting to use shodan for the first time. successfully installed shodan using "pip install shodan", was able to use shodan command in command prompt, so it seems to be installed. version is python is 3.10. However when attempting to import shodan python throws the missing import error. Please help, and thank you for your time
Screenshot 2022-04-10 144921-shodan

Contact Form 7. - Redirect users based on dropdown selection

Hi All,

I want a solution for my website that if someone selecting value from dropdown and submit the form that should be redirected to specific page based on selection.

There will be 5 types of dropdown to choose.

Please help me with this.

Facing Issue while reading data from excel in selenium with Java.

CODE
package DataDrivenTesting;

import java.io.File;
import java.io.FileInputStream;
import org.apache.poi.xssf.usermodel.*;

public class ReadingDataFromExcel {

public static void main(String[] args) throws Exception  {

	File Src = new File("C://Users//JOHN//Desktop//version.xlsx");
	FileInputStream file= new FileInputStream(Src);
	
	XSSFWorkbook workbook = new  XSSFWorkbook(file);  //get the workbook
	 XSSFSheet sheet = workbook.getSheet("Sheet 1");  //Providing the sheet name
	 int rowcount = sheet.getLastRowNum();           //Return the row count
	 int columncount = sheet.getRow(0).getLastCellNum(); //return the cell count
	 
	for(int i=0;i<rowcount;i++) 
	{
	XSSFRow Currentrow= sheet.getRow(i);   //Focused on current row
	for(int j=0;j<columncount;j++)
	{	
		String Value = Currentrow.getCell(j).toString();  //Read value from cell
		System.out.print(" " +Value);
		
	}
       System.out.println();
       workbook.close();
    
}
}}

ERROR
Exception in thread "main" java.lang.NoSuchMethodError: 'byte[] org.apache.commons.io.IOUtils.byteArray(int)'
at org.apache.commons.io.output.AbstractByteArrayOutputStream.needNewBuffer(AbstractByteArrayOutputStream.java:104)
at org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream.(UnsynchronizedByteArrayOutputStream.java:51)
at org.apache.poi.util.IOUtils.peekFirstNBytes(IOUtils.java:110)
at org.apache.poi.poifs.filesystem.FileMagic.valueOf(FileMagic.java:209)
at org.apache.poi.openxml4j.opc.internal.ZipHelper.verifyZipHeader(ZipHelper.java:143)
at org.apache.poi.openxml4j.opc.internal.ZipHelper.openZipStream(ZipHelper.java:175)
at org.apache.poi.openxml4j.opc.ZipPackage.(ZipPackage.java:130)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:312)
at org.apache.poi.ooxml.util.PackageHelper.open(PackageHelper.java:47)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:296)
at DataDrivenTesting.ReadingDataFromExcel.main(ReadingDataFromExcel.java:15)

Pixhawk 4 GPS Module Safety Switch Issue

We are working with a quadcopter using Pixhawk 4 and Qground control. The onboard GPS module safety switch is not activated on startup as described in the manual. This arming/disarming safety factor is not activating. We only have this arming/disarming function on our remote controller but need an onboard function as well. How do I go about solving this issue?

error: The name 'FirebaseUser' isn't a type so it can't be used as a type argument. (non_type_as_type_argument at [tunedin] lib/main.dart:31)

//this is main.dart file

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:tunedin/resources/firebase_repository.dart';
import 'package:tunedin/screens/home_screen.dart';
import 'package:tunedin/screens/login_screen.dart';
import 'package:firebase_core/firebase_core.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}

class MyApp extends StatefulWidget {
@OverRide
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State {
FirebaseRepository _repository = FirebaseRepository();

@OverRide
Widget build(BuildContext context) {
return MaterialApp(
title: "Skype Clone",
debugShowCheckedModeBanner: false,
home: FutureBuilder(
future: _repository.getCurrentUser(),
builder: (context, AsyncSnapshot snapshot) {
if (snapshot.hasData) {
return HomeScreen();
} else {
return LoginScreen();
}
},
),
);
}
}

Screenshot 2020-11-26 at 1 12 44 PM

//this is my login_screen.dart file
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:tunedin/resources/firebase_repository.dart';
import 'package:shimmer/shimmer.dart';
import 'package:tunedin/utils/universal_variables.dart';
import 'home_screen.dart';

class LoginScreen extends StatefulWidget {
@OverRide
LoginScreenState createState() => LoginScreenState();
}

class LoginScreenState extends State {
FirebaseRepository _repository = FirebaseRepository();

bool isLoginPressed = false;

@OverRide
Widget build(BuildContext context) {
_repository.signOut();
return Scaffold(
backgroundColor: UniversalVariables.blackColor,
body: Stack(
children: [
Center(
child: loginButton(),
),
isLoginPressed
? Center(
child: CircularProgressIndicator(),
)
: Container()
],
),
);
}

Widget loginButton() {
return Shimmer.fromColors(
baseColor: Colors.white,
highlightColor: UniversalVariables.senderColor,
child: FlatButton(
padding: EdgeInsets.all(35),
child: Text(
"LOGIN",
style: TextStyle(
fontSize: 35, fontWeight: FontWeight.w900, letterSpacing: 1.2),
),
onPressed: () => performLogin(),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
),
);
}

void performLogin() {
print("tring to perform login");

setState(() {
  isLoginPressed = true;
});

_repository.signIn().then((FirebaseUser user) {
  print("something");
  if (user != null) {
    authenticateUser(user);
  } else {
    print("There was an error");
  }
});

}

void authenticateUser(FirebaseUser user) {
_repository.authenticateUser(user).then((isNewUser) {
setState(() {
isLoginPressed = false;
});

  if (isNewUser) {
    _repository.addDataToDb(user).then((value) {
      Navigator.pushReplacement(context,
          MaterialPageRoute(builder: (context) {
        return HomeScreen();
      }));
    });
  } else {
    Navigator.pushReplacement(context,
        MaterialPageRoute(builder: (context) {
      return HomeScreen();
    }));
  }
});

}
}

Screenshot 2020-11-26 at 1 13 05 PM

//this is my firebase_methods.dart file
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:tunedin/models/user.dart';
import 'package:tunedin/utils/utilities.dart';

class FirebaseMethods {
final FirebaseAuth _auth = FirebaseAuth.instance;
GoogleSignIn _googleSignIn = GoogleSignIn();
static final Firestore firestore = Firestore.instance;

//user class
User user = User();

Future getCurrentUser() async {
FirebaseUser currentUser;
currentUser = await _auth.currentUser();
return currentUser;
}

Future signIn() async {
GoogleSignInAccount _signInAccount = await _googleSignIn.signIn();
GoogleSignInAuthentication _signInAuthentication =
await _signInAccount.authentication;

final AuthCredential credential = GoogleAuthProvider.getCredential(
    accessToken: _signInAuthentication.accessToken,
    idToken: _signInAuthentication.idToken);

FirebaseUser user = await _auth.signInWithCredential(credential);
return user;

}

Future authenticateUser(FirebaseUser user) async {
QuerySnapshot result = await firestore
.collection("users")
.where("email", isEqualTo: user.email)
.getDocuments();

final List<DocumentSnapshot> docs = result.documents;

//if user is registered then length of list > 0 or else less than 0
return docs.length == 0 ? true : false;

}

Future addDataToDb(FirebaseUser currentUser) async {
String username = Utils.getUsername(currentUser.email);

user = User(
    uid: currentUser.uid,
    email: currentUser.email,
    name: currentUser.displayName,
    profilePhoto: currentUser.photoUrl,
    username: username);

firestore
    .collection("users")
    .document(currentUser.uid)
    .setData(user.toMap(user));

}

Future signOut() async {
await _googleSignIn.disconnect();
await _googleSignIn.signOut();
return await _auth.signOut();
}

}
Screenshot 2020-11-26 at 1 13 27 PM
Screenshot 2020-11-26 at 1 13 42 PM

//firebse_repository.dart
import 'package:firebase_auth/firebase_auth.dart';
import 'package:tunedin/resources/firebase_methods.dart';

class FirebaseRepository {
FirebaseMethods _firebaseMethods = FirebaseMethods();

Future getCurrentUser() => _firebaseMethods.getCurrentUser();

Future signIn() => _firebaseMethods.signIn();

Future authenticateUser(FirebaseUser user) =>
_firebaseMethods.authenticateUser(user);

Future addDataToDb(FirebaseUser user) =>
_firebaseMethods.addDataToDb(user);

///responsible for signing out
Future signOut() => _firebaseMethods.signOut();
}

error: The name 'User' is defined in the libraries 'package:firebase_auth/firebase_auth.dart' and 'package:tuned_in/models/user.dart'. (ambiguous_import at [tuned_in] lib/resources/firebase_methods.dart:13)

//this is firebase_methods.dart
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:tuned_in/models/user.dart';
import 'package:tuned_in/utils/utilities.dart';

class FirebaseMethods {
final FirebaseAuth _auth = FirebaseAuth.instance;
GoogleSignIn _googleSignIn = GoogleSignIn();
static final Firestore firestore = Firestore.instance;

//user class
User user = User();

Future getCurrentUser() async {
FirebaseUser currentUser;
currentUser = await _auth.currentUser();
return currentUser;
}

Future signIn() async {
GoogleSignInAccount _signInAccount = await _googleSignIn.signIn();
GoogleSignInAuthentication _signInAuthentication =
await _signInAccount.authentication;

final AuthCredential credential = GoogleAuthProvider.getCredential(
    accessToken: _signInAuthentication.accessToken,
    idToken: _signInAuthentication.idToken);

FirebaseUser user = await _auth.signInWithCredential(credential);
return user;

}

Future authenticateUser(FirebaseUser user) async {
QuerySnapshot result = await firestore
.collection("users")
.where("email", isEqualTo: user.email)
.getDocuments();

final List<DocumentSnapshot> docs = result.documents;

//if user is registered then length of list > 0 or else less than 0
return docs.length == 0 ? true : false;

}

Future addDataToDb(FirebaseUser currentUser) async {
String username = Utils.getUsername(currentUser.email);

user = User(
    uid: currentUser.uid,
    email: currentUser.email,
    name: currentUser.displayName,
    profilePhoto: currentUser.photoUrl,
    username: username);

firestore
    .collection("users")
    .document(currentUser.uid)
    .setData(user.toMap(user));

}

Future signOut() async {
await _googleSignIn.disconnect();
await _googleSignIn.signOut();
return await _auth.signOut();
}

}
Screenshot 2020-11-27 at 9 57 07 PM
Screenshot 2020-11-27 at 9 57 33 PM
Screenshot 2020-11-27 at 9 57 40 PM
Screenshot 2020-11-27 at 9 57 52 PM

//this is my user.dart
class User {
String uid;
String name;
String email;
String username;
String status;
int state;
String profilePhoto;

User({
this.uid,
this.name,
this.email,
this.username,
this.status,
this.state,
this.profilePhoto,
});

Map toMap(User user) {
var data = Map<String, dynamic>();
data['uid'] = user.uid;
data['name'] = user.name;
data['email'] = user.email;
data['username'] = user.username;
data["status"] = user.status;
data["state"] = user.state;
data["profile_photo"] = user.profilePhoto;
return data;
}

User.fromMap(Map<String, dynamic> mapData) {
this.uid = mapData['uid'];
this.name = mapData['name'];
this.email = mapData['email'];
this.username = mapData['username'];
this.status = mapData['status'];
this.state = mapData['state'];
this.profilePhoto = mapData['profile_photo'];
}
}

caps

when a member types an invite link with caps off it would detect it and mute him but once they use caps it doesnt work, i wanna add the tolowercase or idk but idk how.

if (message.content.includes("discord.gg/")) {
if(message.author.id == "290536979110690816") return;
if (message.channel.id === "671003543167172628") return;
message.channel.send(lewdddes);
message.member.addRole(muted.id);
setTimeout(() => {message.delete();}, 250);
return;
};`

Unhandled Exception: Null check operator used on a null value E/flutter

void login(String code, RunMutation runMutation) async {
final PhoneAuthCredential credential = PhoneAuthProvider.credential(
verificationId: widget.verificationId, smsCode: code);
final UserCredential cr =
await FirebaseAuth.instance.signInWithCredential(credential);
final String firebaseToken = await cr.user!.getIdToken();
final QueryResult qe =
await runMutation({"firebaseToken": firebaseToken}).networkResult!;
final String jwt = Login$Mutation.fromJson(qe.data!).login.jwtToken;
final Box box = await Hive.openBox('user');
box.put("jwt", jwt);
context.read().login(jwt);
if (!mounted) return;
Navigator.pop(context);
}

Reading a column in multiple fits file

I'm trying to get a column information from a lot of FITS files. There are more than 100 FITS file in the directory. All these files are located in a different directory. How do I do this?
I have tried something like this:
import glob
from astropy.io import fits, ascii
path = mypath
for fits in glob.glob(path+'*.fits'):
hdulist = fits.open(fits)
print hdulist[0].header['The header I want']
hdulist.close()
But it is not giving me any outputs. I don't know what's wrong.

Connect azure sql database to android studio using java

package com.example.workdb;

 import androidx.appcompat.app.AppCompatActivity;

  import android.os.Bundle;
 import androidx.appcompat.app.AppCompatActivity;
  import android.os.AsyncTask;
  import android.os.StrictMode;
  import android.os.Bundle;
  import android.util.Log;
 import android.view.View;
 import android.widget.Button;
 import android.widget.EditText;
import android.os.Bundle;
import android.widget.TextView;

import org.w3c.dom.Text;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import net.sourceforge.jtds.jdbc.*;
public class MainActivity extends AppCompatActivity {
   public Button run;
   public TextView message;

// public TextView txtvw;
public Connection con;
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
run= (Button) findViewById(R.id.button);
run.setOnClickListener(new View.OnClickListener() {
public void onClick(View v)

        {


            CheckLogin checkLogin= new CheckLogin();
            checkLogin.execute("");
            Log.d("CREATION","ON CREATE WORKS");
            //  Log.d("txtvw", connection);
            //System.out.println("Yes");
            // txtvw.setText("hello");

        }

    });
} public class CheckLogin extends AsyncTask<String,String,String>
{
    String z="";
    Boolean IsSuccess= false;
    String name1="";


    // Log.d("txtvw","step 1 done");
    protected void onPostExecute(String r){
        if (IsSuccess){
            message=(TextView)findViewById(R.id.textView);
            message.setText(name1);
            Log.d("TAG", "STEP 1 DONE");

        }
    }
    @Override
    protected String doInBackground(String... strings) {
        try
        {
            Connection con = connectionClass();
            if(con==null){
                z="Check interent";
                //Log.d("txtvw", z);

            }
            else
            {
                String query= "select * from Value";
                Statement stmt= con.createStatement();
                ResultSet rs= stmt.executeQuery(query);
                if (rs.next())
                {
                    name1=rs.getString("KneeAngle");
                    Log.d("MYTAG", "name 1 works");
                    z="Query success";
                    IsSuccess=true;
                    con.close();


                }
                else{
                    z="Invalid query";
                    IsSuccess=false;
                }



            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return z;
    }
}
public Connection connectionClass(){
    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    StrictMode.setThreadPolicy(policy);
    Connection connection = null;
    String ConnectionURL ;

    try{
        Class.forName("net.sourceforge.jtds.jdbs.Driver");
        ConnectionURL="jdbc:jtds:sqlserver://havvasemserv3.database.windows.net:1433;DatabaseName=Newfin;user=havvanew@havvasemserv3;password=Safwan137;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30";
        connection= DriverManager.getConnection(ConnectionURL);

    } catch(ClassNotFoundException e){
        Log.e("Error here 2 ",e.getMessage());

    }
    catch (Exception e) {
        Log.e("error here 3:",e.getMessage());

    }
    //Log.d("txtvw", connection);
    return connection;

}

}

I am trying to connect my azure sql database to android studio but with no success unfortunately. The code executes with no error but no dats is displayed on the emulator.

Expected data : first value from my table.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.