2018-10-22         Leo

protractor cucumber framework - inspite of defining stepdefination file , still shows suggestion to implement stepdefination

Hi I am new to this framework - protractor-cucumber framewor [custom]I struck in middle of my code.version details:protractor:5.4.0cucumber:4.2.1protractor-cucumber-framework:6.0.0npm:5.6.0Executing the code in eclipes:unable to get what actually the issue is...Any help would be highly appreciated.Thanks..My feature file:-----Feature: Testing Calculator applicationScenario: Addition Given I browse to homepageWhen I enter first number and second numberAnd I click on go buttonThen I should see the resultConfig file:------------------exports.config = {seleniumAddress : 'http:...

 protractor                     2 answers                     10 view
 2018-10-22         Leo

How to Count All Objects of a Database Table in Django?

I have a model as below, I would like to filter a user's all work_times in Table Work with Django 2.0.4, thanks in advance for any advice.class Work(models.Model): name = models.CharField(max_length=800) date = models.DateField(auto_now=False, null=True, blank=True) time = models.TimeField(auto_now=False, null=True, blank=True) work_times = models.FloatField(default=1, verbose_name="work times(hours)") user = models.ManyToManyField(User, related_name="works", blank=True) You can get all of them by using:all_work = Work.objects.filter(user=sample_user)and i...

 django                     3 answers                     87 view
 2018-10-22         Leo

Is it possible to 'not print a dictionary based on the values?

I have a dictionary and would like to know if it's possible to "not print" the dictionary if there is a given value:This is my dictionary: d={'Port':'1/0/1','Link-Status':'Down', 'Vlans':'None'}I would like to know if there is a way to check the Values in the dictionary, and in this example, if Vlans is 'None', don't print the dictionary. I tried doing a 'for' condition, but it's not working at all:for v in d.items():if v is not 'None': print(d)This is what I'm getting from that output:{'Port': '1/0/1', 'Link-Status': 'Down', 'Vlans': 'None'}{'Port': '1/0/1', 'Link-...

 python-3.x                     3 answers                     54 view
 2018-10-22         Leo

Converting a python 2 module to python3 Error: object of type 'map' has no len()

So to start off I'm converting pyggel to python 3 all the converted files run in IDLE no issues but when I run the game included in python 3 I hit this errorGameObject.__init__(self, game, obj=pyggel.mesh.OBJ("data/gun.obj", colorize=[0.2, 0.2, 0.2, 1]),File "/home/pi/Downloads/PYGGEL-V0.08-alpha4c/pyggel/mesh.py", line 58, in OBJcur_mtl.set_color(map(float, values[1:]))File "/home/pi/Downloads/PYGGEL-V0.08-alpha4c/pyggel/data.py", line 355, in set_color if len(color) == 3: TypeError: object of type 'map' has no len()here is the part of the code the error comes from:clas...

 python                     1 answers                     99 view
 2018-10-22         Leo

Adding items to Bootstrap navbar across multiple templates

Is it possible to add items from multiple templates to one navbar with bootstrap? Specifically, I have an HTML template that's extended by almost all of the rest of my pages, and it includes a bootstrap navbar. I want to add additional menu options to this same navbar from the individual templates (eg: on a scheduling page, I want to add a link to create a new event) Is there a way to do this? One way would be to set a block in your base template{% block navbar %} inside your navbar div and then in the other templates you can add whichever extra elements you want in that...

 django                     1 answers                     96 view
 2018-10-22         Leo

C# Send raw byte array to website

I need to send to a website or webserver a POST request, but it must be in its raw form (as seen in fiddler hex view) and then get the response. It is a byte array that I already have (and is always the same) with the "POST ...." with headers, cookies, values, everything set up.I expect a function like SendRawBytes(url, bytes); that sends only the "bytes" variable.I've already tried WebClient.UploadData(url, data) but it adds the POST, HOST, Content-Length and Expect to the request, which results in this:POST http://mail.mymail.com/index.html/?_task=login HTTP/1.1Host: mail...

 c#                     2 answers                     18 view
 2018-10-22         Leo

Change color of calendar dates android

Hi I am trying to color the date selected in my calendarview. I have tried String todayDate = (mDay+"/"+mMonth+"/"+mYear); Toast.makeText(this, "TODAYS DATE" + todayDate, LENGTH_SHORT).show(); Cursor cursor = myDatabase.rawQuery("select * from " + Calms.DATABASE_FLARE_TABLE, null); //calendarView.setDateTextAppearance(Integer.parseInt("@+color/orange")); for(int count=1; count<=cursor.getCount(); count++) { cursor.moveToNext(); String savedDate = cursor.getString(2); //calendarView.setDateTextAppearance(getResources().getColor(R.color....

 android                     1 answers                     51 view
 2018-10-22         Leo

Handle click events on Notification bar that redirects users to the app, Lollipop

When users click the icon of my app on the Notification bar, users will be redirected to my app.Can anyone provide sample code? How to subscribe to the click event, and the redirection.UpdateMy application might be using some services that cause the display of icon on Notification bar.My application is calling SetForeground, not getBroadcast().Update 2how can I redirect users to the last Activity rather than the hard-code activity? For example, the last Activity might be different when users navigate to different activity.Notification click event in xamarin forms It's a ...

 android                     1 answers                     84 view
 2018-10-22         Leo

How to update the column of one table when another one is edited

I have one table with columns consisting of an id, name, description, and a count. Each row in this table has a name that corresponds to another table. For instance, one of my rows is has the name "carcinoma". There exists another table that is named "carcinoma". I would like the count of column of the first table to update every time a row is added the "carcinoma" column. For instance, if table "carcinoma" has 4 rows, I want the count column in the first table to have a value of 4 for the carcinoma row. Is there a way where the count column auto updates when I insert or de...

 mysql                     1 answers                     73 view
 2018-10-22         Leo

Laravel SQL Server QueryException could not find driver in PHP file

In my Laravel when I am executing a simple select query to see if everything is working I am getting the error in my PHP 7.0.1 Laravel page. QueryExceptioncould not find driverSo in order to check everything I wrote simple PHP page without Laravel and I am able to connect to the same DB using the PHP function and this is returning the results means with respect to DB and PHP everything is fine.<?php $servername = "ABBDBDBBD\SQLEXPRESS"; $connectionInfo = array("Database"=>"DB_NAME", "UID"=>"sa", "PWD"=>"PASSWORD");if($connect){ $search_query = "...

 php                     1 answers                     40 view
 2018-10-22         Leo

AspectJ won't run

So, i have started learning spring boot and i came across AOP.I made myself an aspect which looks something like this@Aspectpublic class Logging { @Pointcut("execution(* com.tilak.*.*(..))") private void selectAll(){} @Before("selectAll()") private void beforeAdvice(){ System.out.println("Going to set up student profile"); } @After("selectAll()") private void afterAdvice(){ System.out.println("student profile has been set."); } @AfterReturning(pointcut = "selectAll()" , returning = "retVal") private void afterReturningAdvice(Objec...

 java                     1 answers                     36 view
 2018-10-22         Leo

Uninstall is not working for MSI application - Error 1722

I have created MSI using WIX 3.11. I have made some customization to the Installer to install the application in a custom folder. I am also writing Install path to registry value under HKLM\Software.I am reading registry value in batch file for one of my use-case.Installation is successful and the application is running fine.But while uninstalling, I am facing below issue - Uninstall window pops up with the message - The following applications should be closed before continuing the Install: [MyApplication]In uninstall log while removing the service, I see below error - Erro...

 wix                     1 answers                     32 view
 2018-10-22         Leo

Session Error on project transfer to Macbook

I was recently working on a project using Codeigniter and was developing on a local server using XAMPP.The laptop I was using was an HP laptop running Windows 10. I decided to buy a Macbook Pro running macOS High Sierra v.10.13.6 as a replacement for my old and worn out HP laptop.After installing needed tools for development, I copied my project folder and transferred it to my new Macbook Pro. Turned on the servers, imported the databases and now I checked to see if the project is running. But going to the project on the browser shows only this:I'm very new to macOS and sti...

 macos                     1 answers                     28 view
 2018-10-22         Leo

Get Container list in one azure storage account and create the same in another storage account

Team,Thanks in Advance, I'm an IT pro and also learning PowerShell. I have 2 storage account Storage A and Storage B in different diff region and I want to create identical containers in the secondary storage account.I've found below command which can get the list of all the containers in the primary storage account and then I can use the foreach loop to create the container on secondary storage. But I want to make sure that in the secondary storage account if it has the container name already then my command should skip that container and move on to create the next storage...

 azure                     2 answers                     59 view
 2018-10-22         Leo

Power BI remove duplicates based on max value

I have 2 column; ID CODE, valueRemove duplicates function will remove the examples with the higher value and leave the lower one. Is there any way to remove the lower ones? The result I expected was like this.I've tried Buffer Table function before but it doesn't work. Seems like Buffer Table just works with date-related data (newest-latest). You could use SUMMARIZE which can be used similar to a SQL query that takes a MIN value for a column, grouped by some other column.In the example below, MIN([value]) is taken, given a new column name "MinValue", which is grouped by ...

 powerbi                     1 answers                     46 view
 2018-10-22         Leo

Rotate transformation on matplotlib axis in subplot

I am trying to create a four-panel figure where the bottom-left panel contains a scatter plot, and the other three panels contain histograms. The top-left will be a standard histogram across the x-dimension of the scatter, the bottom-right will be a 90° rotated histogram for the y-dimension. Both of these are easy to do in matplotlib.I am running into problems with the third histogram, which is to be a 45° rotated plot in the top-right of the figure giving the distribution of the differences between the x and y points. I have made such figures before by manually rotating an...

 python                     1 answers                     62 view

Page 1 of 146  |  Show More Pages:  Top Prev Next Last