Posts

Extent: Add Class name to Test Success

Image
Clash Royale CLAN TAG #URR8PPP Extent: Add Class name to Test Success I want to add Test Class Name and Method Name into extent report as highlight in the picture. I want to change the loginInvalid to ClassName::Method name. I tried with following but no success. @Override public synchronized void onTestSuccess(ITestResult result) System.out.println(result.getMethod().getMethodName() + " passed!"); test.get().pass(result.getTestContext().getClass().getName() + " Test passed"); Please help. Thanks in advance. 2 Answers 2 String feature = result.getMethod().getRealClass().getName() + ":" + result.getMethod().getMethodName(); ExtentTest extentTest = extent.createTest(feature, result.getMethod().getDescription()); extentTest = extentReport.createTest(this.getClass().getSimpleName() + "::" + Thread.currentThread().getStackTrace()[1].getMethodName()); By clicking "Post Your Answer", you acknowledge that you have read our update...

load data from EDL using neo4j

Image
Clash Royale CLAN TAG #URR8PPP load data from EDL using neo4j I have data present in EDL and I'm using impala query to fetch data from EDL. It contains transactional data and hence I need to update neo4j DB constantly. Need your help in designing the data load. Is csv still the best way to load transactional data from data lake to neo4j? Can neo4j support data volume? Stack Overflow is best for asking specific questions. Asking for help designing a piece of your system doesn't fit the Q&A format very well an could be seen as overly broad or even inappropriate for this site. We're not here to write code for you but to help you get past specific problems you are encountering. We'd love to see code you've tried and help you work through specific issues. Your question about data volume is very vague too, especially since you haven't provided any context about the data you are dealing with. There may be performance benchmarks out there you could look at. – ...

What does “SyntaxError: Missing parentheses in call to 'print'” mean in Python?

Image
Clash Royale CLAN TAG #URR8PPP What does “SyntaxError: Missing parentheses in call to 'print'” mean in Python? When I try to use a print statement in Python, it gives me this error: print >>> print "Hello, World!" File "<stdin>", line 1 print "Hello, World!" ^ SyntaxError: Missing parentheses in call to 'print' What does that mean? 6 Answers 6 This error message means that you are attempting to use Python 3 to follow an example or run a program that uses the Python 2 print statement: print print "Hello, World!" The statement above does not work in Python 3. In Python 3 you need to add parentheses around the value to be printed: print("Hello, World!") “SyntaxError: Missing parentheses in call to 'print'” is a new error message that was added in Python 3.4.2 primarily to help users that are trying to follow a Python 2 tutorial while running Python 3. In Python 3, printing values c...

Windows Machine File Copy takes more time to run in Release definition - TFS 2018

Image
Clash Royale CLAN TAG #URR8PPP Windows Machine File Copy takes more time to run in Release definition - TFS 2018 The task Windows Machine File Copy to copy the files from one machine to another when defined in release definition takes more time in execution i.e. 5-6 minutes, but the same task when defined under Build definition took 9-10 seconds only. Could any one help me to resolve this issue? can you post your code? – Fuzzybear 20 hours ago Are the tasks exactly the same? (same files, same machines) – Shayki Abramczyk 18 hours ago Yes, they are just moved from build definition to release definition. Rest the values, file paths, folder names, etc. are same. – SM Dev 17 hours ago Please consider making a Minimal, Complete, and Verifiable example. Then either you have one and post it, or you have actually understood where the problem is, and you should post it as answer to help others who will have the same problem. –...

Programmatically select a cell in NSMatrix automatically makes the cell visible

Image
Clash Royale CLAN TAG #URR8PPP Programmatically select a cell in NSMatrix automatically makes the cell visible I've been working with some legacy codes, and the current situation is I have a NSMatrix as a group of radio buttons inside a NSScrollView. The NSMatrix is at the top of the NSScrollView, and the NSScrollView can contain up to hundreds of other subviews. Every time when the function -(void)selectCellAtRow:(NSInteger)row column:(NSInteger)column is used to programmatically select a radio button in the NSMatrix, the NSScrollView will automatically scroll up so that the selected radio button will be visible. Some customers find it very annoying. -(void)selectCellAtRow:(NSInteger)row column:(NSInteger)column Is it a default behavior of that function? How do I stop this automatic scrolling? Related, but not the same, question: Selecting Item of NSMatrix programatically By clicking "Post Your Answer", you acknowledge that you have read our updated terms of se...

Unable to execute if statement in postman

Image
Clash Royale CLAN TAG #URR8PPP Unable to execute if statement in postman i've created below the test script, the goal is to validate response body to tests. but my problem is everytime i send request there's no test response. thanks in advance if (pm.response.text() === "length must not be less than 3") pm.test("length must not be less than 3", function () pm.expect(pm.response.text()).to.include("length must not be less than 3"); ); else if (pm.response.text() === "Record already exists.") pm.test("Record already exists.", function () pm.expect(pm.response.text()).to.include("Record already exists."); ); else if (pm.response.text() === "Username already exists.") pm.test("Username already exists.", function () pm.expect(pm.response.text()).to.include("Username already exists."); ); else if (pm.response.text() === "success") pm.test("success", function (text...

How to set pageLength on jquery datatable depending on specific column?

Image
Clash Royale CLAN TAG #URR8PPP How to set pageLength on jquery datatable depending on specific column? I have a table like this But I'm trying to set de pageLength parameter depending on the first column to get something like this My datatable paramerters so far are: var table = $('#table-comp').DataTable( language:spanish, columns: [ name: 'competencia', title: 'Nombre de Competencia', , title: 'Grado Indicador', , title: 'Sel', ], data: datos, lengthChange: false, searching: false, pageLength: 6 //<--- Here is my problem. Not always is 6 fixed. paging: true, order: , rowsGroup: [ 'competencia:name' ], ) table.draw(false); Help me please! By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

How do I suppress spacing between paragraphs of the same CSS class?

Image
Clash Royale CLAN TAG #URR8PPP How do I suppress spacing between paragraphs of the same CSS class? What I'd like to do is make something like ... <p class="A">Line of class A</p> <p class="B">Line of class B</p> <p class="B">Line of class B</p> <p class="B">Line of class B</p> <p class="C">Line of class C</p> <p class="C">Line of class C</p> <p class="D">Line of class D</p> ... turn out like: I've messed around with margins and line-height and container divs but no combination has worked for me so far. Is this possible? 3 Answers 3 You could use javascript's getElementsByClassName() method for each class and then loop through the elements until you reach the final element of each class and then add a bottom margin to it. An easier solution that doesn't require javascript would be to make a class that adds spa...

GCD of two binomial coefficients modulo 10^9 + 7

Image
Clash Royale CLAN TAG #URR8PPP GCD of two binomial coefficients modulo 10^9 + 7 There are given 0 ≤ k ≤ n ≤ 500000 , 0 ≤ l ≤ m ≤ 500000 . 0 ≤ k ≤ n ≤ 500000 0 ≤ l ≤ m ≤ 500000 I need co calculate GCD(C(n, k), C(m, l)) modulo 10^9 + 7. GCD(C(n, k), C(m, l)) My attempt: I thought about tricks with fourmula: C(n, k) = n*(n-1)*...*(n-k+1) / k! C(n, k) = n*(n-1)*...*(n-k+1) / k! For example, suppose l >= k: GCD( C(n, k), C(m, l) ) = = GCD( n*(n-1)*...*(n-k+1) / k!, m*(m-1)*...*(m-l+1) / l! ) = = GCD( n*(n-1)*...*(n-k+1)*(k + 1)*...*l/ l!, m*(m-1)*...*(m-l+1) / l! ) = = GCD( n*(n-1)*...*(n-k+1)*(k + 1)*...*l, m*(m-1)*...*(m-l+1) ) / l! GCD( C(n, k), C(m, l) ) = = GCD( n*(n-1)*...*(n-k+1) / k!, m*(m-1)*...*(m-l+1) / l! ) = = GCD( n*(n-1)*...*(n-k+1)*(k + 1)*...*l/ l!, m*(m-1)*...*(m-l+1) / l! ) = = GCD( n*(n-1)*...*(n-k+1)*(k + 1)*...*l, m*(m-1)*...*(m-l+1) ) / l! Inversing l! with binary exponentiation to 10^...

Error when fitting the scipy.stats.erlang distribution

Image
Clash Royale CLAN TAG #URR8PPP Error when fitting the scipy.stats.erlang distribution I'm new to this, but I have some data that I am trying to fit to various distributions. Right now I'm just trying to figure out what I am doing wrong. Here is an example. data = np.array([-0.00363649, 0.00329399, 0.00648754, -0.00115784, -0.00020446, -0.0223319]) scipy.stats.erlang.fit(data) This returns the warning: RuntimeWarning: The shape parameter of the erlang distribution has been given a non-integer value 2.1. RuntimeWarning: The shape parameter of the erlang distribution has been given a non-integer value 1.9. . . . It does this a lot of times starting with 2.1 and then descending. I'm a little confused about what is happening. 1 Answer 1 By definition, the Erlang distribution has an integer shape parameter. Other than that, it is the same the gamma distribution. The SciPy implementation of the Erlang distribution is basically the same as the gamma distribution, but it...

View based on audience targeting in SharePoint online

Image
Clash Royale CLAN TAG #URR8PPP View based on audience targeting in SharePoint online I have a scenario where data is stored in a sharepoint list with columns like country, Region and product, one country have different products and one region have different countries, i need create views based on country and products for this list, where country level users have access to all products with in that country, and i have product level views where users need to have access to only that particular products with in that country, that says they can only edit those information which they can see please let me know how can i achieve this in SharePoint online, i cannot write any code for this, i need to use out of the box sharepoint features. Thanks in advance. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

MS Access multiple Counters on SwitchBoard Form DCount error

Image
Clash Royale CLAN TAG #URR8PPP MS Access multiple Counters on SwitchBoard Form DCount error I would like to add counters on my main SwitchBoard form for each of section, and nothing worked for me so far with DCount and Count and qryNew.. Form itself doesn't have any Record Source it works with Commands, there are table and qry for each of sections, can I achieve my goal with Dcount family function without adding Source to form? I actually need 3 data Sources then for each of table (or qry's). This is how my setup works, I search all examples, played with all flavors of Double quotes, square brackets, Count, DCount and Count(NewID!qryNewList), nothing worked for me . I think main question is : can I refer to tbl to Access db with Empty Record Source on form ? =DCount([NewID],[tblNew]) my Setup ... 1 Answer 1 DCount expects strings for its arguments. DCount If you want your text box to display the number of rows contained in tblNew, use this as the text box's Cont...

SQL Server Closing Stock values to opening stock of Next month

Image
Clash Royale CLAN TAG #URR8PPP SQL Server Closing Stock values to opening stock of Next month I have a stock table contains three columns: Month, Year and Closing Stock like this: Month Year CLosingstock ------------------------------ Jan 2017 10 Feb 2017 20 Mar 2017 30 Dec 2017 40 Jan 2018 50 Feb 2018 60 I want to create the new column of Opening stock and the jan 2017 values(10) should be a opening stock to Feb 2017.So How i place the values and other months opening stock to closing stock of next month. 1 Answer 1 Use the window function LAG() . I am assuming your Month is a integer and not string LAG() Month select *, OpeningStock = LAG(ClosingStock) OVER (ORDER BY Year, Month) from YourTable By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Multiply columns by columns using substrings

Image
Clash Royale CLAN TAG #URR8PPP Multiply columns by columns using substrings I'm relatively new to R and was struggling with potentially a very simple problem. I have data that has multiple columns named in a similar way. Here is a sample data: df = data.frame(PPID = 1:50, time1 = sample(c(0,1), 50, replace = TRUE), time2 = sample(c(0,1), 50, replace = TRUE), time3 = sample(c(0,1), 50, replace = TRUE), condition1 = sample(c(0:3), 50, replace = TRUE), condition2 = sample(c(0:3), 50, replace = TRUE)) In my actual data, I have much more columns - approximately 50 for time and 10 for condition. I want to multiply week columns and condition columns, e.g. in that sample data it should give me 6 extra columns, like: time1_condition1, time1_condition2, time2_condition1, time2_condition2, time3_condition1, time3_condition2. I tried solutions that were suggested in this thread but they did not work (presumably because I didn't understand how mapply/apply worked and did not make...

Find a file on computer searching by your file size

Image
Clash Royale CLAN TAG #URR8PPP Find a file on computer searching by your file size I would like to create a program that works like "Search Everything", and search files all over the computer. You do not have to have everything that "Search Everything" has, actually I just wish there was a search using the file size. It has some way of searching a file in all the directories of the computer based on its size in kb, regardless of the name of the file, it would be located only by its size. Implement a recursive file search using the DirectoryInfo and FileInfo classes. You should have no trouble finding examples. Of course, you should have already looked for examples. When you get a list of FileInfo objects by calling DirectoryInfo.GetFiles , you can then compare the Length property of each one to the file size you're interested in. Note that Length is the number of bytes in the file, not kilobytes. If you need to convert, make sure that you are clear ab...