2018-10-22         Mary

Change Text Dynamically of Table Data

I am trying to change the the text of a table element based on the the choice of an input of a select tag.Here is the jsFiddle of it.<html><body> <table> <tr> <td style="text-align: left;">People - 2 <div id="people" class="panel"> <div class="panel-body"> <form method="POST" id="update"> <b>Person - 1</b> <table class="table table-condensed"> <t...

 javascript                     3 answers                     34 view
 2018-10-22         Mary

What's the most general way to find all empty links (empty tags containing an href="x") in HTML source?

I scanned the homepage of my website through a accessibility problem scanner; A tool I use to find problems in my markup and information-presentation, in the context of web accessibility.Using the WAVE report tool, I found two problems: Both of which are "empty links".Maybe I missed that but I don't get from the tool what these links are and how to find them so I would delete them via my WordPress page builder (Elementor), the tool with which I created the markup for this site.An accessibility specialist told me that doing CTRL+F then searching in source for say <a href=...

 javascript                     1 answers                     92 view
 2018-10-22         Mary

Problem installing googlecharts gem?

I am trying to use the googlecharts gem to create some quick charts. Here are the rubyforge and github sites:http://googlecharts.rubyforge.org/http://github.com/mattetti/googlecharts/tree/masterAfter installing, I keep getting an error saying "no such file to load -- googlecharts" even though when I do a "gem list", the gem is listed. I have restarted my server. Anyone know what could be going on here?Thanks! According to the docs, you need to require 'gchart'but it sounds like you might be doing require 'googlecharts'instead. [XXX]You must do a gem install googlec...

 ruby-on-rails                     2 answers                     96 view
 2018-10-22         Mary

Pass variables to cURL in batch file

I use a cURL command stored in .bat file. I want to have variables implemented in the command, that will receive the value when I call the command to execute the .bat file.Can anybody help with understading the syntax of:Passing variables to batch file Defining certain parts of the cURL command as variables (The parts in bold below)Here is my cURL command (Parts in bold should be variables):curl -k --user "usercode:" -d source="https://secure.4log.com/**431032**" https://api.pdfshift.io/v2/convert/ -d sandbox=true --output C:\Users\administrator\Desktop\**testpdf11**.pdf ...

 batch-file                     2 answers                     6 view
 2018-10-22         Mary

ASP.Net Core 2.1 API JWT cookie-less sessions?

Is there such thing? Can this be done?Have sessions based on the JWT token and not on cookies?Session.Ids change for me on every request. Is there any way of knowing the session without cookies? HTTP is a stateless protocol. That means each request is treated uniquely as if the client had never made a request before. Sessions are a way of faking state. The way they work is when the server needs to maintain state, it creates a session and sends the id of that session to the client via a cookie. A cookie is just a response header that indicates that the client should persi...

 session                     1 answers                     96 view
 2018-10-22         Mary

Exclude Specific model field with foreignkey relation from Django model Serializer

I have three table. Student, School, Resultclass Student(models.Model): name = models.CharField(max_length=225) address = models.CharField(max_length=255) school = models.Foreignkey(School) class School(models.Model): name = models.CharField(max_length=225)class Result(models.Model): student = models.Foreignkey(Student) marks = models.FloatField()corresponding serializers for those models are like class SchoolSerializer(serializers.ModelSerializer): class Meta: model = School fields = '__all__'class StudentSerializer(serialize...

 django                     1 answers                     33 view
 2018-10-22         Mary

* not expanded in subprocess.Popen (security implications)

this works but shell injection is a security risk p = subprocess.Popen(['mv ./*.pdf ./target.pdf'], shell=True)this doesn't work as * won't globp = subprocess.Popen(['mv', './*.pdf', './target.pdf'])I'm watching a directory. How can I rename an arriving pdf to target.pdf without compromising security? You can use the glob command from the glob module to get shell like path extensions: glob.glob(pathname, *, recursive=False) Return a possibly-empty list of path names that match pathname, which must be a string containing a path specification. pathname can be either ab...

 python                     2 answers                     78 view
 2018-10-22         Mary

ReactDOM render -> DOMParser -> querySelectorAll -> returning null

const temp = document.createElement('div');ReactDOM.render(component, temp);const parsed = new DOMParser().parseFromString( temp.innerHTML, 'text/html');parsed.querySelectorAll(selector); // <- returns null rather than NodeList^ There is an obscure use-case in my app, centered around needing to render the full tree of a component and query it for certain css classes for diffing against a subset of rules in external stylesheets.Don't judge! :-)I think I'm doing the above in a manner that I could reasonably expect to give me a proper result but clearly I'm missing someth...

 reactjs                     1 answers                     51 view
 2018-10-22         Mary

A View in ConstraintLayout not being placed as expected when app is made run in device

I am using ConstraintLayout to create a view that is to be used in RecyclerView.For some reason, one TextView is taking unexpected place when I am installing an app in the device.Below is the view that is being used in RecyclerView<?xml version="1.0" encoding="utf-8"?><android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content"> <Tex...

 android                     6 answers                     83 view
 2018-10-22         Mary

Execute SP2 given conditions inside SP1 - SQL Server

I want to RUN SP2 inside SP1. The SP2 inserts several data into a table, one of those data is actual date.So, i want that SP2 (inside SP1) only execute if in the column date, the date is within the last 10 days.Is this possible?Thanks Question tagged as SQL-Server and down there solution for SQL-Server. It might be different for Oracle, which this question is about.Yes it is.Inside your SP1 you need to create IF statement and then exec your SP2.Without more code form your side it is hard to write, but code in your SP1 should look something like:IF (SELECT [YourDate] FROM...

 sql                     1 answers                     48 view
 2018-10-22         Mary

How to make the fixed side bar like reddit website?

I have already tried with fixed and sticky position.Let's say we have two columns in our website, main column and sidebar.And our side column has contents longer than the height of the view port( like in reddit website as it contains footer and some ads).With fixed position , side bar doesn't scroll on page scroll.With sticky position , the side bar is initially sticky and scrolls only when the main column is ending. In reddit side bar , the right side bar scrolls along with page scroll. When the sidebar reaches the end of its content , it becomes sticky to the view port. H...

 javascript                     2 answers                     7 view
 2018-10-22         Mary

What is the equivalent for LOCK_ESCALATION = TABLE in SQL Server 2005?

I have a script that was generated in SQL Server 2008, but I need to execute it against a SQL Server 2005 database.What would an equivalent statement for the following be in SQL Server 2005?ALTER TABLE dbo.Event SET (LOCK_ESCALATION = TABLE) LOCK_ESCALATION = TABLE is the default behavior in SQL Server 2008 & is the ONLY behaviour in SQL Server 2005. You can safely drop the statement without any change in functionality. [XXX]There is no equivalent option: it's new in SQL Server 2008.You'll need to change the "Script For version" to SQL Server 2005, [XXX] @gbn ...

 sql-server                     4 answers                     25 view
 2018-10-22         Mary

How to decode html page with nodejs?

I'm making get request function get() { var headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7', 'Cache-Control': 'max-age=0', 'Connection': 'keep-alive', 'Cookie': cookie, 'Host': 'lms.hse.ru', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/...

 javascript                     1 answers                     53 view
 2018-10-22         Mary

How to run a .sql file using bcp in SQL Server

I am new to handling SQL Server bulk export. I have a batch file in which I have written some code to execute specific .sql files at regular intervals and save the output into an excel sheet. I have done this using sqlcmd. I want to use bcp to do the same. Any help on this issue is much appreciated. use -s "|" with sqlcmd. That should allow you to out-put the data with fields separated by a tab. -s is for column separator. See sqlcmd Utility [XXX]Hafsa Mushtaq.The best option is powershell - you can use this awesome dbatools function to Import your data https://github...

 sql-server                     2 answers                     32 view
 2018-10-22         Mary

Find Instance ID for Azure Servers

In AWS we have instance IDs to identify machines. What's the equivalent in Azure and how do I find that?I'd like to list the instance ID in powershell so I can put that into a script. If I have not misunderstood, I suppose you want to get the InstanceId of the VM in the Azure VM Scale set.You could try to use Get-AzureRmVmssVM to get it.Get-AzureRmVmssVM -ResourceGroupName <ResourceGroupName> -VMScaleSetName <VMScaleSetName>Update:If you want to get the ResourceId of azure resource, you could use Get-AzureRmResource to do it, just specify the properties what ...

 azure                     1 answers                     41 view
 2018-10-22         Mary

Redirect URLs from many subdomains using .htaccess

I am changing my website structure and I need to redirect 301 many URLs from many subdomains.I have many subdomains, How can I do that in one .htaccess ?Redirect both : ch.mydomain.com/coffee to www.mydomain.com/de_ch/coffeeit.mydomain.com/coffee to www,mydomain.com/it_IT/coffeeEDIT : Some URLs have folder and some have different name :exm : ch.mydomain.com/coffetype/nespresso to www.mydomain.com/de_ch/nespressocafeThank you You may use these redirect rules:RewriteEngine On# specific rulesRewriteCond %{HTTP_HOST} ^ch\. [NC]RewriteRule ^coffetype/nespresso/?$ http://examp...

 apache                     1 answers                     41 view

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