2018-10-22         Wendy

How to create these animations to the bootstrap cards? It's incredibly complex for me as I am a newbie

https://bootsnipp.com/snippets/K52KKThe link has a template for bootstrap cards.The link has cards with animations has horizontal sliding capability.I tried inherit just the properties of the bootstrap cards to my code. The cards overdid every thing and shows on top. I tried changing z-index for my header, but it does not work. Can some help me retrieve just the properties of the bootstrap cards? nav h1 { vertical-align: middle; background-color: rgb(0, 0, 0); border: 10px solid rgba(0, 0, 0, 0); text-align: center; posit...

 javascript                     1 answers                     72 view
 2018-10-22         Wendy

In Perforce how can I move files on a stream to a different depot?

I wish to move some files in a Perfore depot to a different depot. The depots are set up to use perforce streams.So from//Depot1/stream/directoryto //Depot2/stream/directoryHow can I achieve this? One way to achieve this is to use copy.Create a workspace for Depot2 and tie it to the destination stream.In P4V select 'copy'In the source enter //Depot1/stream/directory and in the destination //Depot2/stream/directorySelect copy then submit.Then in a separate workspace tied to the source stream in Depot1, mark the files for delete and submit these changes separately. [XXX...

 perforce                     1 answers                     7 view
 2018-10-22         Wendy

How to add search bar in django admin home

I have different apps in django as:First APP: First APP model1 First APP model2SECOND APP: SECOND APP model1 SECOND APP model2Actually there are a lot of apps and a lot of models, I was wondering if I could somehow use search_fields in the http://localhost:8000/admin/ URL i.e. at the home of the Django admin site.As each app its own admin file, where I register them. So in this case where do I place search_fields? You can use django-admin-searchbarNOTE : I didn't used this pluggin yet [XXX]

 django                     1 answers                     87 view
 2018-10-22         Wendy

Convert 1d numpy ndarray into one hot encoding ndarray of shape (n,2)

This question already has an answer here: Numpy - create matrix with rows of vector 1 answer You can use np.tile as follows:>>> np.tile(nd, (n, 1)) [XXX]I will answer my own question. Use the one hot encoding tools from keras.from keras.utils import to_categoricaly_nd_ones = [1] * ny_nd = to_categorical(y_nd_ones) [XXX]

 python-3.x                     2 answers                     31 view
 2018-10-22         Wendy

How to write code such that only one of the radio button should be selected in models with django.?

#models.pyfrom django.db import modelsfrom django.contrib.auth.models import UserCHOICES = (('1','Earned Leave'),('2','Casual Leave'),('3','Sick Leave'),('4','Paid Leave'))class Leave(models.Model): employee_ID = models.CharField(max_length = 20) name = models.CharField(max_length = 50) user = models.ForeignKey(User, on_delete = models.CASCADE, null =True) department = models.CharField(max_length = 50) designation = models.CharField(max_length = 50) type_of_leave = models.CharField(max_length = 15, choices = CHOICES) from_date = models.DateField(help_te...

 python                     2 answers                     18 view
 2018-10-22         Wendy

How to run Python3 with mod option "-m" on package residing in different path?

How can we use python3 -m option to run on a package/module that resides in different directory rather than current working directory?Suppose, my current working directory is "/tmp/dir_one"And my python package resides in "/tmp/dir_two/package".How to execute the following command from /tmp/dir_one? python3 -m dir_two.package.module For a module in /tmp/foo like:/tmp/foo/__main__.py:if __name__ == '__main__': print('/tmp/foo/__main__.py: main')/tmp/foo/__init__.py:print('/tmp/foo/__init__.py: init')The commandPYTHONPATH=$PYTHONPATH:/tmp/ python -m fooGives/tmp/foo/__...

 python                     1 answers                     30 view
 2018-10-22         Wendy

property undefined when setting a property when calling a template

I am currently trying to create a dynamic popup using bootstrap where from a html template of a modal, I dynamically add a header, body and footer. but when my code is executed, in the browser console I get some errors because from the beginning no values have been defined for header, body and footer.I'm new and I'm not very used to object-oriented programming.this is my code:https://stackblitz.com/edit/ngx-bootstrap-fh92s3?file=app%2Fapp.module.tsmodal.service.ts import {Injectable} from '@angular/core'; import {ModalModel} from './modal.model'; import {Subject} f...

 angular                     1 answers                     66 view
 2018-10-22         Wendy

select2 does not render selected values

I have a select2 element like this:$(document).ready(function () { $('.select2').select2({ multiple: true });});.select2{width:100%}<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" /><script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script><select name="test" class="select2" multiple='multiple'> <option value='A'>A</option> <option value='B...

 javascript                     1 answers                     5 view
 2018-10-22         Wendy

The ConnectionString property has not been initialized. VB.Net

I have the following code: Dim command As New SqlCommand command.Parameters.AddWithValue("@customerid", textbox1.text) command.Parameters.AddWithValue("@password", textbox2.text) command .Connection = SharedVar.ConnectionString SharedVar.ConnectionString.Open() command .CommandText = ("SELECT Customer FROM Accounts WHERE CustomerID = @customerid AND Password = @password")When I execute the code I get an error at this position:SharedVar.ConnectionString.Open()The error I receive is: The ConnectionString property has not been init...

 sql                     1 answers                     99 view
 2018-10-22         Wendy

MSSQL select nearest match (id) of specified condition

I have a table filled with some words of different length. ID | WORD | LENGTH 1 | able | 42 | acid | 43 | about | 5.....method in C# is generating random number and I want to get word with nearest match of length and ID. Recently I am using this queryselect top 1 word from vocabulary where length = 4 and id <= 3;problem is that this way it always returns first occurrence of word with 4 letters. That's not what I need. I can't use this:select top 1 word from vocabulary where length = 4 and id <= 3;because when the random number is close to the last id in t...

 sql-server                     2 answers                     75 view
 2018-10-22         Wendy

Storing Kafka Offsets in a File vs Hbase

I am developing a Spark-Kafka Streaming program where i need to capture the kafka partition offsets, inorder to handle failure scenarios.Most of the devs are using Hbase as a storage for offsets, but how would it be if i use a file on hdfs or local disk to store offsets which is simple and easy?I am trying to avoid using a Nosql for storing offsets.Can i know what are the advantages and disadvantages of using a file over hbase for storing offsets? Just use Kafka. Out of the box, Apache Kafka stores consumer offsets within Kafka itself. [XXX]I too have similar usecase...

 apache-spark                     2 answers                     56 view
 2018-10-22         Wendy

Going up a path when webpage url is in localhost

I have an image whose url is ../path/to/image, but the ../ doesn't work. The url for my webpage is http://localhost:8080/account.html. I can't seem to find a solution online.I believe the directory is relative to the webpage url. I've tried starting from file:///C:/ and it works, but I don't want to use that because my other clients will use the domain name, which in this case is localhost.Is there a way to solve this without moving folders? Try this /path/to/image.jpgRemove the dots and just add this -> / at the start of the path , that means that the path is going to r...

 html                     1 answers                     42 view
 2018-10-22         Wendy

Managing settings for multiple environments?

Azure Function Apps allows you to have a settings file such as local.settings.json.You can then consume these settings like so:[FunctionName("CustomSettings")]public static Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Anonymous, "GET")]HttpRequestMessage req, TraceWriter log){ log.Info("101 Azure Function Demo - Accessing Environment variables"); var customSetting = Environment.GetEnvironmentVariable("CustomSetting", EnvironmentVariableTarget.Process); return Task.FromResult(req.CreateResponse(HttpStatusCode.OK, new { setting= customSetting ...

 c#                     1 answers                     82 view
 2018-10-22         Wendy

SQLAlchemy automatically converts str to unicode on commit

When inserting an object into a database with SQLAlchemy, all it's properties that correspond to String() columns are automatically transformed from <type 'str'> to <type 'unicode'>. Is there a way to prevent this behavior?Here is the code:from sqlalchemy import create_engine, Table, Column, Integer, String, MetaDatafrom sqlalchemy.orm import mapper, sessionmakerengine = create_engine('sqlite:///:memory:', echo=False)metadata = MetaData()table = Table('projects', metadata, Column('id', Integer, primary_key=True), Column('name', String(50)))class Project(ob...

 python                     2 answers                     57 view
 2018-10-22         Wendy

First img of bannermover does not follow directly after last img of bannermove

I use the following code to create a bannermove:.photobanner { height: 233px; width: 3550px; margin-bottom: 5px; font-size: 0;}.photobanner img { margin-bottom: 10px; margin-right: 5px; height: 233px; width: 350px;}.photobanner img { transition: all 0.5s ease;}.first { animation: bannermove 30s linear infinite;}@keyframes bannermove { 0% { margin-left: 0px; } 100% { margin-left: -2130px; }}<div class="photobanner"> <img class="first" src="http://placehold.it/350x150"> <img src="http://placehold.it/450x150"> <img src="http://placeh...

 html                     1 answers                     18 view
 2018-10-22         Wendy

Error "TypeError: Cannot read property 'seconds' of null" when commit Firestore batch

I got the following error when trying to batch delete a collection: TypeError: Cannot read property 'seconds' of null at Function.fromProto (..\node_modules\@google-cloud\firestore\build\src\timestamp.js:91:47)The code is plain simple (written in TypeScript):var admin = require('firebase-admin');...var batch: FirebaseFirestore.WriteBatch = admin.firestore().batch();return generic.application.admin.firestore().collection(name) .get() .then((docs: FirebaseFirestore.QuerySnapshot) => { docs.docs.forEach((doc:any) => { batch.delete(doc.ref); ...

 node.js                     1 answers                     76 view

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