2018-10-22         Edgar

Bootstrap 4 image overlay issues

I am trying to create a hero image with text on top of the image. I wanted to create this using mostly bootstrap 4 so I don't have to write a lot of CSS. Bootstrap card has an image-overlay class that helps put text over the image. so I am halfway there thanks to bootstrap, But I am having some issues on mobile and other things. Did i reach the bootstrap limit and need some CSS? or I can modify my bootstrap code and fix these issues below example imageProblemson mobile texts and buttons are going outside the image, I want to keep it inside the imagehow can I make the "card-...

 css                     1 answers                     97 view
 2018-10-22         Edgar

AJAX addEventListener - passing parameters to another function

I'll keep this short - I've got a list of buttons, that I create using a loop, and when one of them gets clicked I want to be able to pass its id attribute to another file in order to dynamically generate a new page.Here's the code:for (var i in data.contacts) { var temp = document.createElement('div'); temp.className = "contacts"; var dude = document.createElement('input'); dude.type = "button"; dude.value = data.contacts[i]; dude.id = data.contacts[i]; dude.className = "dude_button" + data.contacts[i]; dude.addEventListener('click', function...

 javascript                     1 answers                     38 view
 2018-10-22         Edgar

Integrated React component from Rails-assets.org in Rails Application

i tried to integrated react component from rails-assets.org in my rails application. Currently, i used react-rails gems to write react view in my application.I want to use other react component such as react-router, react-select, etc. I found the easy ways to get this is by using rails-assets.org. However, i don't know the proper ways to called this component. Can someone teach me ?For example i want integrate react-select in my rails application :Gemfile :gem 'rails-assets-react-select','~> 1.0.0.rc.3', source: 'https://rails-assets.org'Application.js//= require jquery/...

 javascript                     1 answers                     0 view
 2018-10-22         Edgar

batch file - if not "choice 01" to "choice 99" goto XXX?

So I've recently created a batch file with menu and let users input numbers between 0-17, but I want to make the batch file to goto startProg if the users input something else (not number 0-17) or input empty value. In my current batch file, it will pass empty value and other inputs to the next section (the :changeLang section).My batch file:::=================================================================:startProg@echo offtitle The Sims 4 Language Changerset lang=en_UScls::=================================================================:menuListecho This program will h...

 batch-file                     2 answers                     9 view
 2018-10-22         Edgar

How to create drop down in magento

I am new on Magento.I need your help.I want to create a dropdown for menu in magento.When we take mouse oven main menu it will show drop down that display sub menu.Header navigation manage by top.phtml location:app/design/frontend/default/shalu_theme/template/catalog/navigation/top.phtmlIn header its shows three main category and also showing sub category on frontend.In admin I am having three main category given belowAdmin->Catalog->Select Manage Category CATEGORY: Furniture(6) Electronics(42) Apparel(66) I want to create a...

 magento                     2 answers                     56 view
 2018-10-22         Edgar

Using JWT with Active Directory authentication in NodeJS backend

I am building an intranet web application consisting of an Angular frontend and a Node.JS backend. The application needs to use the corporate Active Directory for authentication and authorization.I'm considering how to best implement this in a secure way. I am planning to use the Active Directory node module for actually communicating with the AD to authenticate when the user logs in, and to check security group membership for certain restricted actions, etc.However, I am not quite sure what is the best way to authorize my backend endpoints. The AD module does not offer any...

 node.js                     1 answers                     99 view
 2018-10-22         Edgar

Can I use prefetch_related to cache filtered querysets?

I am using DRF to serialize some related models. In my toy example below, assume that each author can have a million books. Clearly doing a db query for all "good" books and then another db query for all "bad" books is inefficient. This post [http://ses4j.github.io/2015/11/23/optimizing-slow-django-rest-framework-performance/] offered some suggestions regarding prefetch_related. But I found that this only helped when I made subsequent calls to .books.all() rather than .books.filter() as happens in the properties below.Is there any automatic way in Django to cache the boo...

 django                     2 answers                     36 view
 2018-10-22         Edgar

Calling subprocess.call(...) yields in error "[WinError 2] System can't find the specified file"

Hello my dear educated programmers,I am trying to execute a command in the cmd prompt using Python. My research showed, that the subprocess module should give me what I need.However, when using even the most basic test cases, Python always shows the error "[WinError 2] The system cannot find the file specified". I have checked, that subprocess.py is where it's supposed to be and there's no problems importing. There are loads of other questions on StackOverflow, but all of the which I read were about a specific file actually missing or some problems with setting correct path...

 python                     1 answers                     82 view
 2018-10-22         Edgar

Automate the Boring Stuff with Python outdated instructions for launching Selenium browser

This question already has an answer here: Can't open browser with Selenium after Firefox update 7 answers You were already half way with the link you provided. Since the latest firefox 47 upgrade. The selenium web-driver has become deprecated and you will need Marionette to run firefox:Instructions hereAnother solution which would allow you to keep using existing scripts is to downgrade firefox. For wich I would suggest downgrading to version 45 (ESR version). This will ensure that ...

 python                     1 answers                     89 view
 2018-10-22         Edgar

Pass id as props in react-router-dom

I would like to pass an ID in props to a component reactI use react-router-domHere is my app.js file <Switch location={this.props.location}> <Route exact path="/" component={Home} /> <Route path="/list" component={List} /> <Route path='/img/:imgId' component={() => <Img imgId={this.props.params.imgId}/>} /> </Switch>When I go to the next url img / 2, the router sends me the right page, but the id is not present in the props.When I look into react developer tools on chrome, I can see that<Switch>...

 javascript                     2 answers                     54 view
 2018-10-22         Edgar

Changing the color of an Android Calendar Event

In my App, i create calendar events for specific dates. As i want them to be in the color of my app (i want them to be fast recognizable) my question is, how to realize that. Here is what i have:Intent intent = new Intent(Intent.ACTION_INSERT); intent.setType("vnd.android.cursor.item/event"); intent.putExtra(CalendarContract.Events.TITLE, "Some Title"); intent.putExtra(CalendarContract.Events.DESCRIPTION, "Description"); String dateTime = date.getTime().replace(" Uhr", ""); dateTime += date.getDate()...

 android                     1 answers                     86 view
 2018-10-22         Edgar

How to select values by groups, using select sum()?

I need to select values by groups (from 0 to 10, from 10 to 50, more than 50).user_id amount 1 20 1 40 2 5 3 30 3 1Why this query doesn't work correctly?select (select sum(amount)),case when (select sum(amount))<10 then '0-10' when (select sum(amount))>=10 and (select sum(amount))<50 then '10-20' else '>50' end as total_amount, count(distinct user_id) from tablegroup bycase when (select sum(amount))<10 then '0-10' when (select sum(amount))>=10 and (select sum(amount))<50 then '10-20' else '>5...

 mysql                     4 answers                     52 view
 2018-10-22         Edgar

Button added by TamperMonkey Script shows only briefly

I love Reddit. I use the new layout, not the old one. There are TamperMonkey "add-on" scripts that allow you to do things like hide posts, color comments differently, etc. but the majority of them only work on the old layout. And then there is the "Reddit Enhancement Suite", it does some thins but not what I want. I modified a script that I found and can't get it to work.I want to have a button to add all links to the browser's history, essentially marking it as visited, which makes Reddit think you read the post. The "button" shows briefly but then disappears, can anyone h...

 javascript                     1 answers                     11 view
 2018-10-22         Edgar

SQL Server Merge - Getting matched records to another temp table

I have a MERGE query to update data. In case of no match I am inserting records to source getting the output to a temporary table. Would it be possible to get the matched records to temporary table as well? Basically to avoid duplication of data in further processing I need to have copy of matched records.This is my MERGE command:MERGE Product.ProductHeaderRepository AS t USING (SELECT GETDATE() as d, c1, c2, c3,Name FROM Supplier.ProductHeaderImportWHERE (BatchID = @BatchID) ) AS sON dbo.GetProductHeaderId(s.c1,S.c2,S.c3) <0WHEN NOT MATCHED BY TARGET THEN INSERT (Name,...

 sql                     1 answers                     29 view
 2018-10-22         Edgar

Decode JSON file with Kotlin vs Swift

This question already has an answer here: Kotlin Data Class from Json using GSON 2 answers Yes, Android has had that for quite a few years now.It's a library from Google themselves, called GSON:https://github.com/google/gsonExample:Gson gson = new GsonBuilder().create();gson.fromJson("MY JSON STRING", MyClass.class);There are many overloads for the 'fromJson' function. There is also a 'toJson' function, to turn an object into a JSON string.This is not just for Kotlin, it also works in J...

 android                     1 answers                     55 view
 2018-10-22         Edgar

Azure VM - Endpoints do not work

I have VM with two endpoints 3389 and 80. It have been working fine for about 1 week.Yesterday I was not able to remote to it, not access its services over port 80. I rebooted it - did not help. I decided to delete and recreated endpoints, and it helped. VM worked for a few hours and then I had the same issue. Again I recreated endpoints. Looks like this is the Azure issue. Does anyone experienced the same problem? Any ideas? First, what OS are you using?Then, if it Linux - it shall be working, might be some issue with the specific VM instance.If it is Windows, besides t...

 azure                     1 answers                     47 view

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