Santanu

2

votes
0

answer
9

views

Explain the implementation of Euler's Totient Implementation

I have seen this code in a coding platform to efficiently calculate the euler's totient for different values. I am not being able to understand this implementation. I really want to learn this. Could anyone please help me explain this? for(int i = 1; i < Maxn; i++) { // phi[1....n] in n * log(n) phi...
Santanu
1

votes
3

answer
377

views

Regex - How two characters matching (MySql)

Please find my query below. SELECT * FROM demoTable WHERE C_APPLICATION_REF_NO REGEXP '[A-Z]{1}[0-9]{0,14}'; why i am getting result which having two character whereas i am matching only one character and others are numbers. how to modify my regex expression so that i can only fetch one character an...
Santanu Sahoo
1

votes
1

answer
992

views

Value of type 'CGRect' has no member 'makeIntegralInPlace'

I had this working prior to Swift 3 (where frame is CGRect): extraLightBlurView.frame.makeIntegralInPlace() But it's returning error Value of type 'CGRect' has no member 'makeIntegralInPlace' in Swift 3. How to fix this?
Santanu Karar
1

votes
1

answer
77

views

Multiple rows in to single row in SQL Server if each column has only one value per employee

How to do this please help. I have the following data. This is a data sample for week. I want single row per EmployeeName / CrewID (unless there are 2 values for a Employee in a single date). If ORIGINAL DATA is like this : 2018-08-05 2018-08-06 2018-08-07 2018-08-08 2018-08-09 2018-08-1...
Santanu Maulik
1

votes
2

answer
380

views

Need Design & Implementation inputs on Cassandra based use case

I am planning to store high-volume order transaction records from a commerce website to a repository (Have to use cassandra here, that is our DB). Let us call this component commerceOrderRecorderService. Second part of the problem is - I want to process these orders and push to other downstream syst...
Santanu Dey
1

votes
2

answer
255

views

Subtraction Operation Returning Wrong Result

SELECT TOB.SchoolID, SUM (TOB.Rice)- SUM(TDMD.Rice) FROM tblOpeningBalance TOB JOIN tblDailyMidDayDetails TDMD ON TOB.SchoolID = TDMD.SchoolID WHERE TOB.Date
Santanu Maulik
1

votes
1

answer
48

views

Conditional check between tuples

I'm trying to check between tuples values but failed with error as: Binary operator '==' can not be applied to operands of type (@value String!, @value String!) and (String!, String!) Is it possible to do binary checks between two tuples? var guest: (String!, String!) { return ('guest', '1234') } if...
Santanu Karar
1

votes
3

answer
2.6k

views

Copy PHAsset from Gallery to other directory in iOS 9

I came through the following link which demonstrated how to copy file from Gallery to application or other directory (in right answer): How to copy an image file from iOS Photo Library (ALAssetsLibrary) to the local directory of an App? But with ALAssetsLibrary class documentation Apple said its now...
Santanu Karar
1

votes
1

answer
2.4k

views

Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:]

This is my actual error: Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3512.30.14/UIApplication.m:3315. Previously the code was working fine even in IOS 8.4. With IOS 9 plus this error is showing whe...
Santanu Das
4

votes
4

answer
17.3k

views

Regular expression to find “src” attribute of HTML “img” element in PHP

I have a string, inside of that I have an image: '' I could not fetch the image URL with my regular expression. My code is: preg_match_all('/src=([^\\s]+)/', $questArr_str, $images); This code stops its execution when it encounters the space in the image name. It only returns 'http://yahoo.com/test...
Santanu
1

votes
2

answer
8.9k

views

“BufferedReader.ready” vs. “while(BufferedReader.readLine()!=null)”

I am a novice when it comes to java. I wanted to read the stdout from a process started in java. I got the following code upon a google search: Runtime rt = Runtime.getRuntime(); Process proc = rt.exec(args); BufferedReader br = new BufferedReader( new InputStreamReader(proc.getInputStream())); whil...
Santanu
5

votes
1

answer
1.9k

views

What is the purpose of data provenance in Apache NiFi Processors

For every processor there is a way to configure the processor and there is a context menu to view data provenance. Is there a good explanation of what is data provenance?
Santanu Dey
1

votes
4

answer
658

views

Multi-level aggregation from a table

I have a table metrics which has the following columns : stage name --------------------- new member new member old member new visitor old visitor Now I can find out how many new or old members are there by running a query like this : select stage, count(*) from metrics where name =...
Santanu C
4

votes
1

answer
75

views

RegEx: Extract substring from a string which may contain several number of '{' and '}'

` DailyHoroscope.com {if $contact['timezone']} {assign var=local_tz value=$contact['timezone']} {else} {assign var=local_tz value='America/New_York'} {/if} {assign var=tracking_params value='utm_medium={$medium}&utm_source={$source}&utm_campaign={$campaign}'} ` In this code I need to get substr...
Santanu Nandi
4

votes
1

answer
377

views

Analyzing deadlock using Jconsole

I am running a simple program which causes deadlock. final String resource1 = 'santanu'; final String resource2 = 'sahoo'; System.out.println(Integer.toHexString(resource1.hashCode()) ); System.out.println(Integer.toHexString(resource2.hashCode()) ); Thread t1 = new Thread(){ public void run() {...
Santanu Sahoo
11

votes
3

answer
821

views

Thread Synchronization on Integer instance variable

public class Main{ public static void main(String[] args) throws Exception { // Creating objects for class Check(2 different objects) Check c = new Check('s1'); Check c1 = new Check('s2'); c.start();c1.start(); } } class Check extends Thread{ Check(String name){super(name);} private Integer ab = 2;...
Santanu
2

votes
3

answer
507

views

How to stop evaluating lisp form when passed as function parameter?

I am learning Lisp. Now I am trying to create a function that takes some valid Lisp form as argument and returns a function that executes the Lisp forms when called. For example: (defun fn (name action) (setf (symbol-function name) #'(lambda () action))) When I am passing say (+ 4 5 6) the function...
Santanu
2

votes
4

answer
5.8k

views

How to obtain anchor part of URL after # in php

While using LightBox mechanism in my project I got an URL http://nhs/search-panel.php#?patientid=2 I need to collect that patientid from this through GET mechanism, Is that possible in PHP?
Santanu
2

votes
1

answer
48

views

user draws a picture as input in R and program measures it's length [closed]

I need a program which will at one point open a MS-Paint likewindow, where the user will draw a horizontal line with themouse pointer (which probably would not be a proper 'straight' line) and the program will give the length of the line as output (i.e. the distancebetween left-most point and right...
santanu
1

votes
3

answer
174

views

Does record splitting need to generate unique keys for each record in hadoop?

I am relatively new to the hadoop world. I have been following examples I could find to understand how the record splitting step works for mapreduce jobs. I noticed that TextInputFormat splits file into records with key as the byte offset and value as a string. In this case, we could have two differ...
Santanu C
2

votes
4

answer
603

views

How to comma-separate a set of strings without the final comma

int rowPosition = 0; string WorkerName = ''; DataTable dtAllotedManpower = new DataTable(); dtAllotedManpower.Columns.Add('WorkerName'); foreach (GridViewRow row in GridViewTotalManpower.Rows) { if (row.RowType == DataControlRowType.DataRow) { DataRow drAllotedManpower = dtAllotedManpower.NewRow();...
Santanu Maulik
3

votes
1

answer
8.5k

views

Redshift : defining composite primary key

I have a table for which I want to define a composite primary key with two columns in redshift. I am having some trouble with create table syntax. Here is what I am trying to do : Create table metrics ( id varchar(30), runtime timestamp, category varchar(30), location varchar(30)) primary key(id, r...
Santanu C
1

votes
3

answer
390

views

SQL: Retrieve value from a column that occurred least number of times

I have a table which have a single field. and it have a values like (3,7,9,11,7,11) Now I want a query which will pick the value that occurred least number of times and if there is a tie with minimum occurrences then use the smallest number In this case the answer will be 3.
Santanu
6

votes
0

answer
1.6k

views

Increasing/decreasing space between stars in Android default RatingBar

I am trying to add space between the stars in Android default RatingBar. But unfortunately haven't got any documentation regarding this. Is there any way we can increase/decrease space between the stars in Android default RatingBar. p.s. I don't want to create a png and then do it. Would be helpful...
Santanu
2

votes
0

answer
435

views

Error in reading data in aws data pipeline activity from s3 bucket

We have AWS data pipeline where we have an activity (python script) which reads/writes data from/to s3 bucket. We have noticed recently a failure in an activity where the read from s3 fails due to closing of socket connection. The error is intermittent. The failure happens exactly at the same line o...
Santanu C
6

votes
7

answer
21.8k

views

Deleting duplicate record from table - SQL query

I need to delete duplicate rows only from the table, like I have 3 duplicate rows in the table, my query will delete 2 rows from 3 duplicated rows. How can I get this? Please help me.
Santanu
6

votes
6

answer
53.7k

views

How to hash passwords in MySQL?

How I will make every password in my user table encrypted(md5()) except one particular row using a single query?
santanu
1

votes
2

answer
463

views

How to list the actual kubernetes nodes a specific resouce is running on

When listing resources such as POD running on a cluster, how to know which physical node are they on? kubectl get {resource-type} command returns the following columns. NAMESPACE NAME READY STATUS RESTARTS AGE Could not find a way to list the actual nodes (could be more than on...
Santanu Dey
6

votes
3

answer
677

views

I find two gradle android plugin - Is there any relation between the two?

I was trying to find out how to build Android application with Gradle. To my surprise I found two references, one from jvoegele and another from Android Tools Project site. They appear to be different prima facie. So my question is why there are two variants? Is there any relation between the two? W...
Santanu
2

votes
2

answer
84

views

Showing TimeSpan With Hours:Minutes Format. Ex- (72:59)

I have written this piece of code to get the time span between two date time: private TimeSpan CalculateTimeDifference() { string StartDate = txtOffBarDate.Text; string StartTime = txtOffbarTime.Text; DateTime StartDateTime = Convert.ToDateTime(StartDate + ' ' + StartTime); string EndDate = txtOnBar...
Santanu Maulik
3

votes
3

answer
1.7k

views

Sorting a list of string in python such that a specific string, if present appears first

I am new to python and hoping that someone can help me out with this. I need to sort a list of strings : s = ['status', 'value', 'place', 'tag'] I need to sort in such a way that the sorted list looks like this : s_sorted = ['tag', 'place', 'status', 'value'] In order words, the specific string 'tag...
Santanu C
1

votes
2

answer
1.2k

views

The “InstallPackageAssemblies” task failed unexpectedly in Xamarin

I can't run/deploy my Xamarin Android app using Visual Studio 2015. Unfortunately after copied The 'InstallPackageAssemblies' task failed unexpectedly error comes. What should I do? 100% ... 41369kb of 41369kb copied 2>The 'InstallPackageAssemblies' task failed unexpectedly. 2>System.AggregateExcept...
Santanu
32

votes
7

answer
105k

views

How to implement a Keyword Search in MySQL?

I am new to SQL programming. I have a table job where the fields are id, position, category, location, salary range, description, refno. I want to implement a keyword search from the front end. The keyword can reside in any of the fields of the above table. This is the query I have tried but it cons...
santanu
32

votes
6

answer
2.2k

views

ArrayList<Integer> takes String

public class Main { public static void main(String[] args) { ArrayList ar = new ArrayList(); List l = new ArrayList(); l.add('a'); l.add('b'); ar.addAll(l); System.out.println(ar); } } Output: [a,b] You can't directly add String to ArrayList ar, but by using addAll() it is possible. How can we add S...
Santanu
2

votes
0

answer
150

views

Using google drive(or any cloud server) as storage database for android app

I am thinking of making an android app with several users logging into a discussion forum(something like the whatsapp group chat or maybe facebook group chat) and i want to save all data in google drive(or any other server). Please Can anyone tell me how to do it. Any link or and documentation or he...
Santanu Bhattacharjee
3

votes
0

answer
459

views

cocos2d-android CCLabel is blinking while using it as countdown timer

I am using CClabel.setString() for showing countdown timer in my game application, but while updating time it blinks and then update the time. My code is : timerLabel = CCLabel.makeLabel('0.00', 'courier', (float) 15); timerLabel.setPosition(CGPoint.ccp(330,300)); timerLabel.setColor(ccColor3B.ccBL...
Santanu
2

votes
2

answer
316

views

Regex non-Word boundary and spaces

I am looking for a single regex that will match any sentence that contains a 'new' word then 'ee' non-word boundary in it. Below is the code where anything I put before or after non-word boundary returns False. String sa = 'this is new freeCode '; System.out.println(sa.matches('.*\\s\\bnew\\b\\sfre....
Santanu Sahoo
2

votes
2

answer
6.3k

views

Play youtube video In App in android

In my android application I want to play youtube video in App, not in the default browser. I am trying this for the last some days. Previously I played the youtube video using the following code : http://code.google.com/p/android-youtube-player/downloads/list But now this code is not working. It sho...
Santanu
2

votes
0

answer
71

views

Flash for Android AIR - Mousewheel doesn't respond

I am working on an application in flash 5.5 AS3 for deployment on an android tablet through AIR. The App uses an external Bluetooth mouse connected to the android device. When the Apllication is run on PC the mouse wheel detects satisfactory values when scrolled. But when the apk is deployed on andr...
Santanu Bhattacharjee
2

votes
0

answer
2.9k

views

“bad interpreter: Operation not permitted” Error on El Capitan

My team is writing a Mac OS application that needs to call a shell script in an external directory. The application works fine on Yosemite (10.10.3). However, if I run it on El Capitan (10.11.2), the application gets errors like this from the script: /bin/bash: : /bin/sh: bad interpreter: Operation...
Santanu Karar

View additional