jeudi 30 septembre 2021

How To Check If Input Tags Elements of an array are empty in Vanella JS? [duplicate]

Imagine this array, which contains input tags from HTML file.

const input = document.querySelectorAll("input"); //Calling the input tags from HTML file as an array 

I want to check everyone of the input if they have empty content or not.




Can the global $_POST variable be set from another website?

For security reasons, i always check things in the database and all, but i there's several things i wouldn't need to check if only my website could use the $_POST variable of my website.

So, to wrap it up, can i create a form in a website like (website1.com) and set the form action of another website (website2.com)?

Example: I have the following form in my website1.com:

    <form method="post" action="website2.com/something...">
        .
        .
        .
    </form>

Would my form be able to send the $_POST variable with some information to the other website?




pandas tables to html, horizontal with two columns

I am trying to turn a pandas table into a horizontal html table with two columns. The original table has one row and it can be generated using the python code below.

df_dict = {}
for i in range(10):
    col = 'col:' + str(i)
    val = 'val:'+ str(i)
    df_dict.update({col:val})
    
df = pd.DataFrame([df_dict])

I want the resulting html table to have the format of the table shown in the link below. Does anybody have any ideas on how to accomplish this?

https://i.stack.imgur.com/TvvAC.png




How do I implement a function in with Django Investment Website where a user gains dummy cash daily?

I'm testing my skills with Django Investment Website and I'm stuck now, I need to implement a function where a user can gain or watch thier dummy investment increase daily, e.g Invested $10 and their investment start growing from $10 - $20 - $40 etc daily. PLEASE ANY HELP FROM THIS GREAT COMMUNITY WOULD BE HIGHLY APPRECIATED




My Bitnami Django website shows the Bitnami homepage instead of mine. How to change it?

I deployed a website on AWS LIGHTSAIL. I assigned an static IP to that instance and when I enter to it, it shows me the Bitnami homepage.

When I run the virtual env in the Django project (python manage.py runserver 0.0.0.0:8000) I have to put the :8000 on my static IP for my website to shows up.

What I'm doing wrong? How do I make my website appears on the default port? Thanks!




Collecting a response without requiring log in - one time URL? Issues with false positives

Background and Problem

I have a system that has core users augmented by some minor contributors who only need to be able to provide approvals for certain things. To support this, the system reacts to database changes and emails those approvers with a single button in the body of the email. This button is just a link to a unique url - something like https://myapp/response/12345-abcdefg-6789.

That "response" page is listed in the web config as not requiring a log in. Thus, the approver should only have to click on the link in the email, and the system should detect that and mark their response.

In all of our testing, this works great. All we're doing is marking the response via the page's code behind, and then displaying a message on the page that the response was received. On the surface, this seems like about as easy of a task as you can dream up.

However, we're getting false positives in production. The approvers are telling us that things are being marked as approved when they never clicked the link. I assume this has something to do with their browsers checking the links for safety or something - and by performing that safety check, it's triggering the system to record the response. Unfortunately, i haven't been able to reproduce this - even when we have some of the approvers on the phone while we try it.

The question is - what is the best strategy to avoid a false positive with buttons in an email?

Lots of companies do this kind of thing - i'm looking right now at an invitation from a friend via evite. It has Yes, Maybe, and No which appear to have the same kind of setup i described above.

Is there something i should be doing with redirects after x seconds? Is there some other javascript i should be deploying on the page? Is there some other potential cause for this? The IIS logs seem to indicate that the "fake clicks" are coming from the target users computers. Which is a bit of a relief, since it's hard to imagine how some other external machine could end up at a GUID based url that is not represented by a physical file that could be crawled over in some way.

I would like to avoid having another button for the user to click, where they would click "Approve" in the email, and then when they get to the page they have click the same thing again.

Thanks!




Can i use multiple RewriteRules for the same url .htaccess

My .htaccess

Options -Indexes
DirectorySlash Off
RewriteEngine On
RewriteRule ^about$ about/about_me.html [L]

Is it possible to do this

Options -Indexes
DirectorySlash Off
RewriteEngine On
RewriteRule ^about$ about/about_me.html [L]

#Using multiple RewriteRules with diffrent names for same url
RewriteRule ^About$ about/about_me.html [L]
RewriteRule ^ABOUT$ about/about_me.html [L]



Why is my wordpress website displaying lines of html in place of performing the action it is programmed

First page of website

http://www.esafiber.com/

I am trying to get the website back in working order, however I have gotten stuck where it looks like the html bleeds through. Any one seen this before? I am using wordpress and all of my themes and plugins are up to date.




Issue in application migration to Spring 5 Hibernate 5

I am currently working to upgrade an existing web application from Spring 4 to 5.3.9 and Hibernate 4 to 5.5.7 DB2 database is being used. After the new jar files are replaced, an SQLGrammarException exception thrown which is caused by inaccessible of the database object SYSCAT.SEQUENCES object. This is never an issue with hibernate 4 and I am not sure why hibernate try to access this database object. Is there a way to avoid this issue?

com.ibm.websphere.ce.cm.StaleConnectionException: SYSCAT.SEQUENCES IS AN UNDEFINED NAME

Thanks a lot for the help.

Following is a more details in the log.

Caused by: org.hibernate.exception.SQLGrammarException: Unable to build DatabaseInformation at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:103) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:37) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.tool.schema.internal.Helper.buildDatabaseInformation(Helper.java:189) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:61) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:200) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:81) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:327) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:471) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1410) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.3.9.jar:5.3.9] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.9.jar:5.3.9] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.9.jar:5.3.9] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.9.jar:5.3.9] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.9.jar:5.3.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845) ~[spring-beans-5.3.9.jar:5.3.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782) ~[spring-beans-5.3.9.jar:5.3.9] ... 41 more Caused by: com.ibm.websphere.ce.cm.StaleConnectionException: SYSCAT.SEQUENCES IS AN UNDEFINED NAME. SQLCODE=-204, SQLSTATE=42704, DRIVER=4.19.49 at com.ibm.ws.rsadapter.jdbc.WSJdbcUtil.handleStaleStatement(WSJdbcUtil.java:1006) ~[com.ibm.ws.runtime.jar:?] at com.ibm.ws.rsadapter.spi.ServerFunction.handleStaleStatement(ServerFunction.java:712) ~[com.ibm.ws.runtime.jar:?] at com.ibm.ws.rsadapter.AdapterUtil.mapException(AdapterUtil.java:2285) ~[com.ibm.ws.runtime.jar:?] at com.ibm.ws.rsadapter.jdbc.WSJdbcUtil.mapException(WSJdbcUtil.java:1191) ~[com.ibm.ws.runtime.jar:?] at com.ibm.ws.rsadapter.jdbc.WSJdbcStatement.executeQuery(WSJdbcStatement.java:1065) ~[com.ibm.ws.runtime.jar:?] at org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorLegacyImpl.extractMetadata(SequenceInformationExtractorLegacyImpl.java:42) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.initializeSequences(DatabaseInformationImpl.java:65) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.tool.schema.extract.internal.DatabaseInformationImpl.(DatabaseInformationImpl.java:59) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.tool.schema.internal.Helper.buildDatabaseInformation(Helper.java:181) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.tool.schema.internal.AbstractSchemaValidator.doValidation(AbstractSchemaValidator.java:61) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:200) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:81) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:327) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:471) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1410) ~[hibernate-core-5.5.7.Final%20(1).jar:5.5.7.Final] at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) ~[spring-orm-5.3.9.jar:5.3.9] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) ~[spring-orm-5.3.9.jar:5.3.9] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409) ~[spring-orm-5.3.9.jar:5.3.9] at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396) ~[spring-orm-5.3.9.jar:5.3.9] at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) ~[spring-orm-5.3.9.jar:5.3.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845) ~[spring-beans-5.3.9.jar:5.3.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782) ~[spring-beans-5.3.9.jar:5.3.9] ... 41 more




How to display value from updated table in dropdown list in ASP.NET

I am not able to successfully display the current value from a SQL Server database table after I have successfully updated the table from a dropdownlist in ASP.NET.

My dropdownlist works, I can select a value and it updates in the table. When I click the save button, it does show my values as saved on the .aspx page. However, the value does not display in the dropdown when I later display that .aspx page.

I will mention that my dropdown list is from a select of 2 values concatenated together, but my update to the table is the primary key, to retain db normalization. If this is what is causing the unwanted behavior, can anyone provide advice on how to display the value after update? It does work for any fields where I am not using concatenated values on the dropdownlists.

Thank you for any help you can provide!




How can i create a line with a few big dots

Right now i coded this line

<hr style="border-style: dotted; size: 5px; background-color: #EAF6F6;">

How can i create a line like that? :

enter image description here




How to acces Docker container files?

Hi Im total newbie but I tried to run website from github on localhost that use Docker, It works but I dont know where are website .css files because I wanted to change few things , I guess the files that website is using are stored in one of the containers right? Thats what shows after docker ps -a command:

CONTAINER ID IMAGE a7cb80f63c7c joe_app be4121930870 joe_varnish 5369df6d616c nginx:1.13-alpine 5eccea787348 rabbitmq:alpine 175bab5538d9 postgres:9.6 -alpine 9a0ef4a9d506 joe_app a0fb821afff7 memcached:1.4-alpine a6feeb4c1bdb joe_worker 654a70807bd0 joe_assets ffbf2b33a2b2 debian 8d2eb3494f5f hello-world

I thought the files might be in Image "joe_assets" but when I try to acces it ,thats the message I receive from terminal: sudo docker exec -it 654a70807bd0 /bin/bash

"Error response from daemon container is not running.




Please suggest Cloud Compute Service for high bandwidth?

I'm using Vultr Cloud Compute to create hosting. But my daily bandwidth is very high. About 200GB/day. So my bandwidth is exceed very soon. And Vultr cost 0.01$ per GB.

So anyone have trust, reliable, comfortable price than Vultr? Please suggest to me, thank you!




Se ve parte de mi código al ejecutar un botón [closed]

Buen día colegas. Tengo un problema con un botón de favoritos en mi web que no puedo solucionar, adjunto imagen. De antemano muchas graciasenter image description here




Submit web certificate request to policy server using C#

How can I do the following command from C# .Net ? certreq -submit -Username <domain\user> -p -policyserver https://hostname/ADPolicyProvider_CEP_UsernamePassword/service.svc/CEP -config https://hostname/SOMENAME_UsernamePassword/service.svc/CES -attrib "CertificateTemplate:MyTemplate" "source.req" "source.cer"

Found the following but no option to use policyserver what I can see RequestDisposition requestResult = (RequestDisposition)objCertRequest.Submit(0xff, strRequest, strAttribute, strCAConfig);




Background Task Django Heroku

I have a problem after deploying my web app at HEROKU, the request lasts 30 second. my app consists to treat excel files and returns new excel files with modifications. The process take more than 30 seconds. I see this tuto https://devcenter.heroku.com/articles/python-rq , but I don't know how to deploy the background task.

Ty




Website login fails due to https://ift.tt/1FIqbOr hitting status 400 error

Greetings all the I am trying to log into to the website world.wallstreetenglish.com, however logins fail on occasional laptops of our students because of the XHR track hitting an error message 400.

Other laptops are fine and the track POST goes with fine.

I tried turning off firewall, defender and any other security measures that may be blocking it, when I compare the header info with another header info that works (On another laptop) they are the same.

Please help.

strong text

Here is also the RAW from a fiddle capture

POST https://dc.services.visualstudio.com/v2/track HTTP/1.1 Host: dc.services.visualstudio.com Connection: keep-alive Content-Length: 6086 sec-ch-ua: "Chromium";v="94", "Google Chrome";v="94", ";Not A Brand";v="99" Content-type: application/json sec-ch-ua-mobile: ?0 Sdk-Context: appId User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36 sec-ch-ua-platform: "Windows" Accept: / Origin: https://world.wallstreetenglish.com Sec-Fetch-Site: cross-site Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://world.wallstreetenglish.com/ Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9

[{"time":"2021-10-01T03:11:21.815Z","iKey":"9a71604c-82c1-45fc-a21a-d682907b5184","name":"Microsoft.ApplicationInsights.9a71604c82c145fca21ad682907b5184.RemoteDependency","tags":{"ai.session.id":"1E5gS","ai.device.id":"browser","ai.device.type":"Browser","ai.internal.sdkVersion":"javascript:1.0.20","ai.user.id":"uO5SV","ai.operation.id":"6H/d7","ai.operation.name":"logout"},"data":{"baseType":"RemoteDependencyData","baseData":{"id":"|6H/d7.iafZw","ver":2,"name":"GET /api/users/me","resultCode":"200","duration":"00:00:00.437","success":true,"data":"GET https://ift.tt/3kUGwNV | cid-v1:653eb374-162f-483c-9426-af39d90b9193","type":"Ajax"}}},{"time":"2021-10-01T03:11:21.368Z","iKey":"9a71604c-82c1-45fc-a21a-d682907b5184","name":"Microsoft.ApplicationInsights.9a71604c82c145fca21ad682907b5184.RemoteDependency","tags":{"ai.session.id":"1E5gS","ai.device.id":"browser","ai.device.type":"Browser","ai.internal.sdkVersion":"javascript:1.0.20","ai.user.id":"uO5SV","ai.operation.id":"6H/d7","ai.operation.name":"signin"},"data":{"baseType":"RemoteDependencyData","baseData":{"id":"|6H/d7.R92Nj","ver":2,"name":"POST /iamapi/api/connect/token","resultCode":"200","duration":"00:00:01.662","success":true,"data":"POST https://ift.tt/39Rcmot | cid-v1:093e14af-905b-4a16-bd58-bc1049e41f13","type":"Ajax"}}},{"time":"2021-10-01T03:11:21.384Z","iKey":"9a71604c-82c1-45fc-a21a-d682907b5184","name":"Microsoft.ApplicationInsights.9a71604c82c145fca21ad682907b5184.Metric","tags":{"ai.session.id":"1E5gS","ai.device.id":"browser","ai.device.type":"Browser","ai.internal.sdkVersion":"javascript:1.0.20","ai.user.id":"uO5SV","ai.operation.id":"6H/d7","ai.operation.name":"signin"},"data":{"baseType":"MetricData","baseData":{"ver":2,"metrics":[{"name":"PageVisitTime","kind":0,"value":58590,"count":1,"min":58590,"max":58590}],"properties":{"PageName":"undefined","PageUrl":"undefined"}}}},{"time":"2021-10-01T03:11:21.485Z","iKey":"9a71604c-82c1-45fc-a21a-d682907b5184","name":"Microsoft.ApplicationInsights.9a71604c82c145fca21ad682907b5184.Pageview","tags":{"ai.session.id":"1E5gS","ai.device.id":"browser","ai.device.type":"Browser","ai.internal.sdkVersion":"javascript:1.0.20","ai.user.id":"uO5SV","ai.operation.id":"6H/d7","ai.operation.name":"logout"},"data":{"baseType":"PageviewData","baseData":{"ver":2,"name":"Log in to the Student & Staff Portal | Wall Street English","url":"https://world.wallstreetenglish.com/login","duration":"00:00:00.501","id":"6H/d7"}}},{"time":"2021-10-01T03:11:23.474Z","iKey":"9a71604c-82c1-45fc-a21a-d682907b5184","name":"Microsoft.ApplicationInsights.9a71604c82c145fca21ad682907b5184.Metric","tags":{"ai.session.id":"1E5gS","ai.device.id":"browser","ai.device.type":"Browser","ai.internal.sdkVersion":"javascript:1.0.20","ai.user.id":"uO5SV","ai.operation.id":"8wdGB","ai.operation.name":"/login"},"data":{"baseType":"MetricData","baseData":{"ver":2,"metrics":[{"name":"PageVisitTime","kind":0,"value":2089,"count":1,"min":2089,"max":2089}],"properties":{"PageName":"undefined","PageUrl":"undefined"}}}},{"time":"2021-10-01T03:11:23.497Z","iKey":"9a71604c-82c1-45fc-a21a-d682907b5184","name":"Microsoft.ApplicationInsights.9a71604c82c145fca21ad682907b5184.RemoteDependency","tags":{"ai.session.id":"1E5gS","ai.device.id":"browser","ai.device.type":"Browser","ai.internal.sdkVersion":"javascript:1.0.20","ai.user.id":"uO5SV","ai.operation.id":"8wdGB","ai.operation.name":"signin"},"data":{"baseType":"RemoteDependencyData","baseData":{"id":"|8wdGB.kCmEq","ver":2,"name":"GET /assets_config.json","resultCode":"200","duration":"00:00:00.045","success":true,"data":"GET ./assets_config.json","target":"world.wallstreetenglish.com","type":"Ajax"}}},{"time":"2021-10-01T03:11:23.625Z","iKey":"9a71604c-82c1-45fc-a21a-d682907b5184","name":"Microsoft.ApplicationInsights.9a71604c82c145fca21ad682907b5184.RemoteDependency","tags":{"ai.session.id":"1E5gS","ai.device.id":"browser","ai.device.type":"Browser","ai.internal.sdkVersion":"javascript:1.0.20","ai.user.id":"uO5SV","ai.operation.id":"8wdGB","ai.operation.name":"signin"},"data":{"baseType":"RemoteDependencyData","baseData":{"id":"|8wdGB.JJpas","ver":2,"name":"POST /j/collect","resultCode":"200","duration":"00:00:00.132","success":true,"data":"POST https://ift.tt/3og4R2W Street English","url":"https://world.wallstreetenglish.com/login","duration":"00:00:02.104","id":"8wdGB"}}},{"time":"2021-10-01T03:11:24.240Z","iKey":"9a71604c-82c1-45fc-a21a-d682907b5184","name":"Microsoft.ApplicationInsights.9a71604c82c145fca21ad682907b5184.PageviewPerformance","tags":{"ai.session.id":"1E5gS","ai.device.id":"browser","ai.device.type":"Browser","ai.internal.sdkVersion":"javascript:1.0.20","ai.user.id":"uO5SV","ai.operation.id":"8wdGB","ai.operation.name":"signin"},"data":{"baseType":"PageviewPerformanceData","baseData":{"ver":2,"name":"Wall Street English","url":"https://world.wallstreetenglish.com/login","duration":"00:00:02.104","perfTotal":"00:00:02.104","networkConnect":"00:00:00.004","sentRequest":"00:00:00.298","receivedResponse":"00:00:00.001","domProcessing":"00:00:01.374"}}}]




Flutter WebSocket works in web application but not in android emulator

'final channel = WebSocketChannel.connect( Uri.parse('wss://echo.websocket.org'), );'

  1. can create and connect in web application but can't connect in android emulator



Confetti falling animation problem transparencies

Good evening all, i added the confetti falling animation to my website. The confetti are superimposed on my buttons and i can't click them, how can i make the confetti visible but transparent so that i can click what's underneath?

This is the code that i used:

<canvas id="my-canvas"></canvas>

<script src="assets/index.min.js"></script>
<script> var confettiSettings = { target: 'my-canvas' };
var confetti = new ConfettiGenerator(confettiSettings);
confetti.render();
</script>

<style>
#my-canvas
{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 100000;
    
}


</style>



Web Development 90" stickable button right side screen

I'm trying to create a button that sticks to the right sidfe of the screen. I want this button the turn 90" and stick 50% vertically. I can't find alot of help online, maybe you guys can help. See my code below, it currently isn't vertically aligned centred.

I also added a picture of how it looks. Thanks in advance!

My current code:

       HTML
 <button type="button" class="button">
     <span class="button__text">Interaction Designer <br> @ Company</span>
     <span class="button__icon"></span>
 </button>

CSS
.button {
    position: absolute;
    display :flex;
    align-items: center; 
    justify-content: center;
    z-index: 999;
    top: 50%;
    right: 0;
    transform-origin: right bottom;
        -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    -o-transform: rotate(-90deg);
    -ms-transform: rotate(-90deg);
    transform: rotate(-90deg);

Picture 2




What type of thing is chrome://settings

When I input chrome://settings into my browser it goes to the settings page I wanna know what type of thing is for more information I think you can make one in the registry editor I just wanna know the name.




How to set a local variable without using useState in ReactJs [duplicate]

i am working on project in which i have two input fields and submit button.When i click submit data from both fields store in a variable.Now i want to perform some function on this data As shown in my code.

Vanilla javascript code perfectly fine.But facing problem in React js

 var el=document.getElementById("button");

if(el)
{
el.addEventListener("click", function(max,min)
{

    const max1=document.getElementById("max").value;
    const min1=document.getElementById("min").value;

    const colors=['#000000', '#0004BF', '#0008FF', '#0140FF', '#0080FF', '#03BFFF', '#02FBFF', '#41FBBF', '#81FC81', '#BFFD41', '#FFFF00', '#FFBF01', '#FF8001', '#FF4000', '#BF2500', '#801500', '#FFFFFF']
    const n=16;
    var v=[];

    var  lmin = Math.log(min1);
    var  lmax = Math.log(max1);
    var delta = (lmax-lmin)/(n-1);
    for(let i = 1;i<16  ;i++)
    {
        let obj={}
        obj.key2=Math.exp(lmin+delta*(i-1)).toFixed(2);
        obj.key1=Math.exp(lmin+delta*((i+1)-1)).toFixed(2)
        obj.value=colors[i];
    
        v.push(obj);
    
    }
    console.log(v)
  
print(v);
 }
)}

Below React js code.I want to implement same code in react as i implement in simple js.

  const maxFreq = useRef();
const [val,setVal] = useState([])

const [obj,setObj]=useState({key1:0,key2:0:value:""});
const minFreq = useRef();
const colors=['#000000', '#0004BF', '#0008FF', '#0140FF', '#0080FF', '#03BFFF', '#02FBFF', '#41FBBF', '#81FC81', '#BFFD41', '#FFFF00', '#FFBF01', '#FF8001', '#FF4000', '#BF2500', '#801500', '#FFFFFF']

const handleClick=(e)=>{
    e.preventDefault();
         const min1=maxFreq.current.value;
         const max1=minFreq.current.value;
         const lmin = Math.log(min1);
         const  lmax = Math.log(max1);
         let delta = (lmax-lmin)/(n-1);
        
         for(let i = 1;i<16  ;i++)
         {
             
             var key11=Math.exp(lmin+delta*(i-1)).toFixed(2);
             var key21=Math.exp(lmin+delta*((i+1)-1)).toFixed(2)
             let value1=colors[i];
             
            // console.log(`key1:${key11}\nkey2:${key21}\nvalue:${value1}`)
            setObj({...obj,
                
                    key1:key11,
                    key2:key21,
                    value:value1
                

        
            });
            // console.log(obj);


            setVal(val.concat(obj));
         
         }
       
 

}

when this data saved in val array it only print last calculated value.It does not provide all 16 object.I just did this in vanilla javascript.But i am facing problem in React js




mercredi 29 septembre 2021

Access cookie with C (CGI)

I am entirely confused right now. I just cannot find a solution on how i can access cookies purely with C(CGI) without javascript. Is this even possible? Is there anyway i can pass cookie data to stdin or something else so my programs can access it?

I need to do this for authentication purposes, i need to know what user is currently logging out so i can forbid him access to some pages until he logs in again.

My pages are dynamically generated without javascript.

Thank you very much for your time!




Cannot Access selfhosted websites after Windows Refresh

after having problems with my audio driver I made the decision to "refresh" my windows install ("Refresh your PC to reinstall Windows and keep your personal files and settings. Refresh also keeps the apps that came with your PC and the apps you installed from the Microsoft Store" https://support.microsoft.com/en-us/windows/how-to-refresh-reset-or-restore-your-pc-51391d9a-eb0a-84a7-69e4-c2c1fbceb8dd).

Everything worked flawlessly with the refresh but now I noticed that I am no longer able to access my Grafana-Dashboard. Grafana is running in a docker-container on my Raspberry Pi 4b along with prometheus.

After my Windows refresh none of the Websites (Grafana, Prometheus and Portainer) are reachable: Grafana displays the "If you're seeing this Grafana has failed to load its application files" message. Portainer displays the "Loading Portainer... " animation and the prometheus website is completely empty.

I did not change any of the settings on the Raspberry Pi or in any of those applications and I can reach those sites from my other machines.

I am running Windows 10 Home 21H1, but it worked with that version before I refreshed.

Is there some Windows setting that I am missing? I am not using a proxy and I am in a private network.

Thanks for your help!




image processing in web server properties

I will do an image operation. The data here will be recorded in the database. For example date, number, location data.. Here, the algorithm results (data-numbers) I extracted from the images are sufficient.

In this context, my questions for the advanced situation beyond image processing theory are:

  • Does each image or gif-video files consisting of images have to be uploaded to the server? if yes why
  • Is it sufficient to assume a standard website features (disk- ram - processor speed etc.) criteria for the server or is a separate calculation required?
  • Processes (image reading-analysis) are likely to be slow, but what can be done extra on the web server - site side?

Apart from these, if you have suggestions or questions, let's learn and develop together




How do I upload multiple files to Firebase from React and get the file name?

I'm trying to set up React with Firebase. Currently i have an input form, where i can upload pictures to my firebase. My issue is that i can't;

  1. Upload more than one file (the new overwrites the old one)
  2. I can't get the files name.
import { getStorage, ref, uploadBytes, } from "firebase/storage";
import { app } from './base'

function SubmitApp (){


    const onChange = (e) => {
        const file = e.target.files[0]
        const storage = getStorage(app)
        const storageRef = ref(storage, 'images') // this names the files images, but can't delete
        uploadBytes(storageRef, file).then(() => {
            console.log('Uploaded to Firebase')
        })
    }
        

    return (
        <form onChange={onChange} >
             <input  type='file' name='file' />
             <button>Submit</button>
        </form>

       
    )
}

export default SubmitApp



How does twitter.com make JPEG profile images transparent?

This image looks like it has a transparent background: https://twitter.com/revifemqueralt/photo

However, inspecting the URL, this is a JPEG file, and so it cannot be transparent (and it is not, it has a white background): https://pbs.twimg.com/profile_images/1419981304121200654/o1zUsgWT_400x400.jpg

Am I missing something?




80% on heroku dynos what does this actually mean?

Hello so right now I have 2 apps on heroku, 1 website, and a discord bot. Recently I just received an email about how I used 80% of my free dynos for "September 2021". So what happens if i reach 100%? and does the free dynos reset each month? can someone please explain thank you.




QuotaExceededError when saving images in localStorage

I'm trying to figure out a way to cache images in browser memory. I tried saving their base64 representation in local storage as follows:

fr.readAsDataURL(blob)
fr.onloadend = () => {
   const base64 = fr.result
   localStorage.setItem(today.toDateString(), base64)
}

However, I'm getting the following error:

QuotaExceededError: Failed to execute 'setItem' on 'Storage': Setting the value of 'Wed Sep 29 2021' exceeded the quota.

How can I accomplish this?




Advice about which tech stack to use in a social media app

I want to make a web app that kind of has the aesthetics of Instagram and Pinterest combined if that makes sense. The main part is this:

  • Users can upload content like food or their pair of shoes and you include a link to where you got the stuff from (can either be the store name, in which case it tries to find the one nearest to you or just open up the wiki page for it) so you can just order it easily.

  • There are no passwords. You have a public key on your account and a private key on your device. If you want to add in new devices you just scan a QR Code

My question: What tech stack should I use? Which Language should I use? Which cloud provider should I use? Is there a way to avoid SQL coz I hate the syntax?




how to fix Uncaught SyntaxError: Unexpected end of input on blogspot

I have a problem pointing the domain to my blog. My initial domain name is https://hoctaponline01.blogspot.com after pointing the domain as https://hoctonghop.com but when checking with google console it gives an error "Uncaught SyntaxError: Unexpected end of input www. hoctonghop.com/:4872 ". I don't know what to do, please help. Thank you.




Is it possible to make a video call over websocket on the web without using WebRTC?

I want to stream video (with audio) over websocket in one direction without using STUN/TURN server. Is it possible to write such a web app?

Data will flow like this:

Peer A -> Websocket Server -> Peer B




why this below web application is not open in google chrome?

web application online entry software cannot open in google chrome browser why? and also it is not worked in mozilla firefox browser version above 37, now latest version is 93.

http://210.212.62.107:8080/tntbc/




Is is Possible to add a folder which store content for the website in wordpress?

I want to add a new folder just like wp-content but with an other name like "assets" to store some data for website or it is possible to move a folder from wp-content/ and store it in as assets which allow me to access data to show on the website.




How to remove slash from $http_referer variable

I want to use NGINX as dynamic local CDN with proxy_pass based on Referer header and $http_refere variable. The problem is that the Referer (variable too) header contains a "/" at the end of the URL. I want to delete trailing slash in $http_referer. How can I do it?

My NGINX location:

location / {
  add_header 'Access-Control-Allow-Origin' '*';
  add_header Referrer-Policy 'strict-origin';
  proxy_pass $http_referer;
}



How to loop through all subject names if subject name contains special Characters that are not matching in soup

  1. This code generates attribute Error because it doesn't match with subjects in web page due to special characters in Subject name.
  2. Provide any solution for the following code if subject changes
import requests
from bs4 import BeautifulSoup
import csv

seat = ""
total = ""
remarks = ""
percentage = ""
subjects = ["MANAGEMENT","PROGRAMMING WITH PYTHON","MOBILE APPLICATION DEVELOPMENT","EMERGING TRENDS IN COMPUTER AND INFORMATION TECHNOLGY","NETWORK AND INFORMATION SECURITY","ENTERPRENURESHIP DEVELOPMENT","CAPSTONE PROJECT EXECUTION & REPORT WRITTING"]

marks = []
start = 302060
end = 302065
for seat_number in range(start,end):
    URL = "https://msbte.org.in/DISRESLIVE2021CRSLDSEP/COV6139QS21LIVEResult/SeatNumber/30/"+str(seat_number)+"Marksheet.html"
    r = requests.get(URL)
    soup = BeautifulSoup(r.content,'html.parser')
    
    name=soup.find_all('table')[0].find_all('tr')[0].find_all('td')[1].text

    seat = soup.find('td',text="SEAT NO.").find_next('td').text
    marks.append(seat)
    #name_of Student
    marks.append(name)
  1. Below part of code generates error it does not works for all the subjects
    for subject in subjects:
        var=soup.find('td',text=subject)
        for i in range(36):
            if subject=="PROGRAMMING WITH PYTHON" or subject=="MOBILE APPLICATION DEVELOPMENT" or subject=="NETWORK AND INFORMATION SECURITY":
                if(i==5):
                    marks.append(var.text)
                if(i==14):
                    marks.append(var.text)
                if(i==23):
                    marks.append(var.text)
                if(i==32):
                    marks.append(var.text)
                var = var.find_next('td')
            else:
                if(i==5):
                    marks.append(var.text)
                if(i==14):
                    marks.append(var.text)
                var = var.find_next('td')

    #for getting total,percentage,remarks
    total = soup.find_all('table')[2].find_all('tr')[1].find_all('td')[2].text
    percentage = soup.find_all('table')[2].find_all('tr')[1].find_all('td')[1].text
    remarks = soup.find_all('table')[2].find_all('tr')[2].find_all('td')[1].text
    sub=soup.find_all('table')[1].find_all('tr')[2].find_all('td')[0].text
    #print(sub)
#    sub
    marks.append(total)
    marks.append(percentage)
    marks.append(remarks)
    #add to the excel sheet
    with open("C:\\sem6.csv", 'a', newline='') as f:
        w = csv.writer(f)
        w.writerow(marks)
    del marks[:]



how to use semantic web to find similarity between to document [closed]

how to use the semantic web to find similarities between two documents

I'm an MSc student and I need help please, how to make a semantic website for auditing and monitoring postgraduate for MSc students in my college




How do I begin on a data input, recording, and graphing program? (That I might port to a website)

I'm currently prototyping a system where i could get live data sent from my Pi, and graph the results in real time.

I'm very new to all of this however all my focus is currently set in even seeing if its possible to do this. Here is a plan of the program I want to create before I worry about networking my Pi:

  1. accepts a value X from my own input (like on a slider of 0-1000)
  2. record X onto a table every 5 seconds
  3. Table includes, time, date, X
  4. Display a line graph of the data X through time e.g. (last 30s, 1h, 12h, 1d)
  5. Turn on and off

Prefferably, all of this would also be able to be displayed on a phone as well (perhaps all of this could be done on a website/page? )

I do not know how to begin, I don't know where or who to ask from help from. I'm not even sure if this is the right place but I'm pretty lost and clueless atm and any help would be appreciated on where i should start from what language or what I need to even get this done. All I have is a background in Python, C++ and some html and css but nothing. Perhaps there are sugestions of communities like discord servers as well where I could talk with people and stuff?

Again, thank you~




Why am I writing that I have too many renders [closed]

it's give me the next error: Error: Too many re-renders. React limits the number of renders to prevent an infinite loop.

what's the problem in this code?

import React, { useCallback, useEffect, useState } from 'react';
import Card from './Card';

export default function Home(props) {

    const [md, setMd] = useState();
    const [index, setIndex] = useState(0);

    const photos = [
        'photos/F9.jpeg', 'photos/F9.jpeg', 'photos/F9.jpeg', 'photos/F9.jpeg', 'photos/F9.jpeg'
    ]

    useEffect(() => {
        const fetchData = async () => {
            const Response = await fetch('MoviesDescription.json');
            const ResponseJson = await Response.json();
            console.log(ResponseJson.MovieDescription);
            setMd(ResponseJson.MovieDescription[index]);
        }
        fetchData()
        // eslint-disable-next-line react-hooks/exhaustive-deps
    }, [])

    const array = [];

    for (let i = 0; i < 6; i++) {
        console.log(i)
        array.push(< Card src={photos[i]} MovieDescription={md} MovieName='The Fate of the Furious' key={i} />);
    }

    return (
        <div className='AllProduct'>
            {array.map((value) => {
                setIndex(index + 1)
                return value;
            })}
        </div>
    )
};



Are Bots able to clear the local storage?

I have implemented the google reCaptcha based on my conditional approach. I have been using the client's local-storage to store the user data, based on the user data the reCaptcha would appear. So I have a concern do bots are able to clear the client's local-storage or cookies silently.




Heroku authorization

Today i was trying to deploy my app to Heroku, but suddenly console app stopped working well. When I was typing "Heroku login" the cmd stopped working (the process is going but it works more then 20 minutes without any progress) Pls help.enter image description here




How to add .gif in my website loadinf screen

I have a script that show me a square that rotates in the website (loading screen). Im just trying to edit but without result. Can you help me pls?

I use aruba for hosting my website.

How can i do that with a .gif image?

Thank you all!!

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

""The code of animation square inside""

    <div class="loader-wrapper">
      <span class="loader"><span class="loader-inner"></span></span>
    </div>

    <script>
        $(window).on("load",function(){
          $(".loader-wrapper").fadeOut("slow");
        });
    </script>



What is black hat seo?

in Chennai most affordable price in developing website mobile application ERP development service we are providing

  1. website development
  2. mobile application development
  3. ERP development for more details visit us:www.tech4lyf.com 7824043013



Webscraping with Beautifulsoup: How to use next button if no href or nav-link?

Im trying to scrape the url and would like to get all apartments on all the pages possible. In this example, there are only two pages and I want to:

  1. "Click on the next button" / Go to page 2
  2. Go to the last page if there is no next-button

In the tutorials I've seen such as this one there is a href-link to the next button on the page he is scraping. In my case the HTML-code for the page-list does not contain any href link but looks like this:

enter image description here

In other tutorials, they could find the href link to the next-button by finding looping over the links in the webpage. When I do this, I get only the main links for the site (despite loading a nested url) and not find any next button.

nav = soup.nav

for url in nav.find_all('a'):
    print(url.get('href'))

Do you have any ideas on how to access the url of the next-button in this case?




Deployment of Website is failing in Netlify

I am trying to deploy my portfolio website using Netlify but the deployment is failing. Could anyone please explain why the error is occurring and what do I have to do to fix it? I will add the logs as an image.

Netlify deploy log




Build a web application in C# that simulates code migration in a distributed system [closed]

I'm researching the topic. "Build a web application in C# that simulates code migration in a distributed system" Specifically, when loading a web, the server will send the calculation functions to the client, and the client will perform the calculation functions at his computer with the received code. Can anyone tell me if there are any documents or anyone with ideas, keywords about this to help me Thank you very much!




mardi 28 septembre 2021

How to extract latitude and longitude in a web

I have extract some infos in https://www.peakbagger.com/list.aspx?lid=5651 under the first column https://www.peakbagger.com/peak.aspx?pid=10882


from urllib.request import urlopen
from bs4 import BeautifulSoup
import pandas as pd

url = 'https://www.peakbagger.com/peak.aspx?pid=10882'
html = urlopen(url)
soup = BeautifulSoup(html, 'html.parser')

a= soup.select("td")
a

would want to only retrieve the latitude and longitude which is 35.360638, 138.727347 from the output I get.

It is in

E<br/>35.360638, 138.727347 

And also, is there a better way to retrieve all the latitude and longitude from the links of /https://ift.tt/3lZxTko other than doing one by one?

Thanks




I want to show some data from another website on my website using react [closed]

I have a project to get data from a django webserver and show them in my website using react.js any Idea?




Update user information section by section

In my previous question I was asking about how to update a user on the spot means right after inserting the user, but now I am asking about updating the user after inserting all of the fields section by section and by section I means that in my web application I have total 7 sections and each section has its own set of input fields but all the sections holds information for a single user, all of the sections are inserted one by one against a single user ID and the updating is done by first retrieving all of the filed values from database

this is my user data retrieving function which fills up all my input field values

function getParameterByName(name, url = window.location.href) {
    name = name.replace(/[\[\]]/g, '\\$&');
    var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
        ids = regex.exec(url);
    if (!ids) return null;
    if (!ids[2]) return '';
    return decodeURIComponent(ids[2].replace(/\+/g, ' '));
}

$(window).on('load', function () {
    var empid = getParameterByName('id');
    if (empid != null) {
        $('HiddenID').val(empid);
        alert("Editing Employee having ID " + empid);
        $('#main-heading').html("Edit Employee");

        $('.empOfficialDetails').html("Update &nbsp; <i class='fa fa-angle-right rotate-icon'></i>");
        //$('.empOfficialDetails').prop('disabled', 'true');

        $('#collapseTwo2').show();
        $('.empPersonalDetails').html("Update &nbsp; <i class='fa fa-angle-right rotate-icon'></i>");
        //$('.empPersonalDetails').prop('disabled', 'true');

        $('#collapseThree3').show();
        $('.empExperienceDetails').html("Update &nbsp; <i class='fa fa-angle-right rotate-icon'></i>");
        //$('.empExperienceDetails').prop('disabled', 'true');

        $('#collapseFour4').show();
        $('.empEducationDetails').html("Update &nbsp; <i class='fa fa-angle-right rotate-icon'></i>");
        //$('.empEducationDetails').prop('disabled', 'true');

        $('#collapseFive5').show();
        $('.empVaccinationDetails').html("Update &nbsp; <i class='fa fa-angle-right rotate-icon'></i>");
        //$('.empVaccinationDetails').prop('disabled', 'true');

        $('#collapseSix6').show();
        $('.empBenefitDetails').html("Update &nbsp; <i class='fa fa-angle-right rotate-icon'></i>");
        //$('.empBenefitDetails').prop('disabled', 'true');

        $('#collapseSeven7').show();
        $('.empBankDetails').html("Update &nbsp; <i class='fa fa-angle-right rotate-icon'></i>")

        GetEmployee(empid);
    }
});

function GetEmployee(EmpID) {


    $.ajax({
        url: 'http://localhost:1089/api/Employee/RetrieveEmployee?id=' + EmpID,
        type: "GET",
        //data: { id: EmpID },
        dataType: 'json',
        contentType: "application/json",
        beforeSend: function () {
            $("#dvRoomsLoader").show();
        },
        complete: function () {
            $("#dvRoomsLoader").hide();
        },
        success: function (data) {
            var v = data[0];
            //$(data).each(function (i, v) {

            $('#empId').val(v.empID);
            $('#username').val(v.userName);
            $('#userpass').val(v.pass);
            $('#officialemail').val(v.officialEmailAddress);
            $('#departments :selected').val(v.department);
            $('#designation').val(v.designation);
            $('#role :selected').val(v.role);
            $('#reportToID').val(v.reportToID);
            $('#reportTo :selected').text(v.reportTo);
            $('#joindate').val(v.joiningDate);
            $('#isAdmin :selected').text(v.isAdmin);
            $('#isActive :selected').text(v.isActive);
            $('#isPermanent :selected').text(v.isPermanent);
            $('#permanantdate').val(v.dateofPermanancy);
            $('#hiredbyRef :selected').text(v.hiredbyReference);
            $('#refePersonName').val(v.hiredbyReferenceName);
            $('#basicSalary').val(v.basicSalary);
            $('#firstname').val(v.firstName);
            $('#middlename').val(v.middleName);
            $('#lastname').val(v.lastName);
            $('#age').val(v.age);
            $('#gender :selected').text(v.gender);
            $('#dateofBirth').val(v.dateOfBirth);
            $('#maritalstatus').val(v.maritalStatus);
            $('#noofchildrens').val(v.nunmberOfChildrens);
            $('#noofdependants').val(v.numberOfDependents);
            $('#mobilenumber').val(v.mobileNumber);
            $('#alternatemobile').val(v.alternateMobileNumber);
            $('#ptcl').val(v.ptclNumber);
            $('#ecPerson :selected').text(v.typeOFEmergencyContact);
            $('#ecNumber').val(v.emergencyNumber);
            $('#emailaddress').val(v.emailAddress);
            $('#cnicnumber').val(v.cnicNumber);
            $('#cnicexpdate').val(v.cnicExpDate);
            $('#ntnnumber').val(v.ntnNumber);
            $('#passpNo').val(v.passportNumber);
            $('#passpExpDate').val(v.passportExpDate);
            $('#permanentaddress').val(v.permanentAddress);
            $('#officialaddress').val(v.officialAddress);
            $('#unofficialaddress').val(v.unOfficialAddress);
            $('#country').val(v.country);
            $('#city').val(v.city);
            $('#state').val(v.state);
            $('#postalcode').val(v.postalCode);
            $('#nationality').val(v.nationality);
            $('#religion').val(v.religion);
            $('#firqa').val(v.firqa);
            $('#cast').val(v.empCast);
            $('#bloodgroup :selected').text(v.bloodGroup);
            $('#facebookurl').val(v.facebookURL);
            $('#linkedinurl').val(v.linkedInURL);
            $('#twitterurl').val(v.twitterURL);
            $('#youtubelink').val(v.youtubeChannelURL);
            $('#githuburl').val(v.gitHubURL);
            $('#portfoliourl').val(v.portfolioURL);
            $('#currentDesg').val(v.currentDesignation);
            $('#lastDesg').val(v.lastDesignation);
            $('#initialDesg').val(v.initialDesignation);
            $('#totalExp').val(v.totalExperience);
            $('#lastEmpName').val(v.lastEmployerName);
            $('#lastEmpDesg').val(v.lastEmployerDesignation);
            $('#lastEmpSal').val(v.lastEmployerGrossSalary);
            $('#institutename').val(v.institutename);
            $('#typeofdegree').val(v.typeOFDegree);
            $('#majorcourse').val(v.majorCourses);
            $('#startdate').val(v.startDate);
            $('#enddate').val(v.endDate);
            $('#isVacc :selected').text(v.isvaccinated);
            $('#noofVacc').val(v.noOfVaccination);
            $('#lastVaccDate').val(v.lastVaccinationDate);
            $('#lastVaccName').val(v.lastVaccinationName);
            $('#grossSal').val(v.grossSalary);
            $('#currSalTax').val(v.currentSalaryTax);
            $('#houseRent').val(v.houseRent);
            $('#transAll').val(v.transportAllowance);
            $('#MedicAll').val(v.medicalAllowance);
            $('#medicCardNo').val(v.medicalCardNumber);
            $('#hasLoan :selected').text(v.hasLoan);
            $('#remainingLoan').val(v.currentRemainingLoan);
            $('#currLoanBal').val(v.currentLoanBalance);
            $('#currEOBI').val(v.currentEOBI);
            $('#pvdFund').val(v.currentProvidentFund);
            $('#crSickLeaves').val(v.currentRemainingSickLeaves);
            $('#crAnnualLeaves').val(v.currentRemainingAnnualLeaves);
            $('#crCasualLeaves').val(v.currentRemainingCasualLeaves);
            $('#crUmrahLeaves').val(v.currentRemainingUmrahLeaves);
            $('#crMaternityLeaves').val(v.currentRemainingMaternityLeaves);
            $('#accountholder').val(v.accountHolderName);
            $('#bankname').val(v.bankName);
            $('#accountno').val(v.bankAccountNumber);
            $('#ibanno').val(v.ibaNnumber);
            $('#accountType').val(v.accountType);
            $('#branchlocation').val(v.branchLocation);
            $('#branchcode').val(v.branchCode);
            $('#officialaccount').val(v.isOfficial);
            //})

            alert("Data Load success");
        },
        error: function (ex) {
            alert("Data Load Fail");
            alert('Error' + ex.responseXML);
            alert('Error' + ex.responseText);
            alert('Error' + ex.responseJSON);
            alert('Error' + ex.readyState);
            alert('Error' + ex.statusText);
        }
    });
}

and this the first update function I am using to update the first section of my application;

$('.empOfficialDetails').click(function (ev) {
    ev.preventDefault();

    var data = new Object();
    data.EmpID = $('#empId').val();
    data.UserName = $('#username').val();
    data.UPassword = $('#userpass').val();
    data.OfficialEmailAddress = $('#officialemail').val();
    data.Departments = $('#departments :selected').text();
    data.Designation = $('#designation :selected').text();
    data.Role = $('#role :selected').val();
    data.ReportToID = $('#reportToID').val();
    data.ReportTo = $('#reportTo :selected').text();
    data.JoiningDate = $('#joindate').val();
    data.IsAdmin = $('#isAdmin').val();
    data.IsActive = $('#isActive').val() ;
    data.IsPermanent = $('#isPermanent').val();
    data.DateofPermanancy = $('#permanantdate').val();
    data.HiredbyReference = $('#hiredbyRef').val();
    data.HiredbyReferenceName = $('#refePersonName').val();
    data.BasicSalary = $('#basicSalary').val();
    data.CurrentPicURL = $('.picture').val();
    //data.CurrentPicURL = $('.picture')[0].files; //uncomment When passing file as file object to controller

    if (data.UserName && data.UPassword && data.OfficialEmailAddress && data.Departments && data.Designation && data.Role && data.IsAdmin && data.IsPermanent) {
        $.ajax({
            url: 'http://localhost:1089/api/Employee/EmpOfficialDetails',
            type: "POST",
            dataType: 'json',
            contentType: "application/json",
            data: JSON.stringify(data),
            beforeSend: function () {
                $("#dvRoomsLoader").show();
            },
            complete: function () {
                $("#dvRoomsLoader").hide();
            },
            success: function (data) {
                var ID = parseInt(data);
                if (ID > 0) {
                    //var id = data;
                    $(".HiddenID").val(data);
                    //var id = $(".HiddenID").val();
                    $('#official').css('display', 'block');
                    $('#official').html("Employees Official details added successfully...!");
                    $('#official').fadeOut(25000);
                    $("#dvRoomsLoader").show();

                    $('.empOfficialDetails').html("Update &nbsp; <i class='fa fa-angle-right rotate-icon'></i>");
                }
                else {
                    $('#official').find("alert alert-success").addClass("alert alert-danger").remove("alert alert-success");
                }
            },
            error: function (ex) {
                alert("There was an error while submitting employee data");
                alert('Error' + ex.responseXML);
                alert('Error' + ex.responseText);
                alert('Error' + ex.responseJSON);
                alert('Error' + ex.readyState);
                alert('Error' + ex.statusText);
            }
        });

    }
    return false;

});

the problem is that my EmpID parameter in my ajax is not picking up the id and hence it is passing as null/empty value and because my EmpID parameter is empty the ajax call doesn't get to my controller and in order to update the user my EmpID parameter need the id which I don't know why it's not picking up, although the retrieving function works smoothly, I just want know that how can I pass the retrieved ID to my EmpID parameter in order to hit my controller and successfully run my update function

here is my controller update function, but for a reminder I am mentioning again that this update function is also my insert function as well, means at the time of adding a new user it acts as insert and right after insert it act as update:

public int Emp_OfficialDetails(Employee emp)
    {
        //SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["AmanraHRMS"].ConnectionString);
        var con = DB.getDatabaseConnection();
        SqlCommand com = new SqlCommand("InsEmpOfficialDetails", con);
        com.CommandType = CommandType.StoredProcedure;

        #region Employee Official Details Insert Code block

        com.Parameters.AddWithValue("@UserName", emp.UserName);
        com.Parameters.AddWithValue("@pass", Crypto.HashPassword(emp.UPassword));
        com.Parameters.AddWithValue("@OfficialEmailAddress", emp.OfficialEmailAddress);
        com.Parameters.AddWithValue("@Department", emp.Departments);
        com.Parameters.AddWithValue("@Role", emp.Role);
        com.Parameters.AddWithValue("@IsAdmin", emp.IsAdmin);
        com.Parameters.AddWithValue("@Designation", emp.Designation);
        com.Parameters.AddWithValue("@ReportToID", emp.ReportToID);
        com.Parameters.AddWithValue("@ReportTo", emp.ReportTo);
        com.Parameters.AddWithValue("@JoiningDate", Convert.ToDateTime(emp.JoiningDate));
        com.Parameters.AddWithValue("@IsPermanent", emp.IsPermanent);
        com.Parameters.AddWithValue("@DateofPermanancy", Convert.ToDateTime(emp.DateofPermanancy));
        com.Parameters.AddWithValue("@IsActive", emp.IsActive);
        com.Parameters.AddWithValue("@HiredbyReference", emp.HiredbyReference);
        com.Parameters.AddWithValue("@HiredbyReferenceName", emp.HiredbyReferenceName);
        com.Parameters.AddWithValue("@BasicSalary", emp.BasicSalary);
        com.Parameters.AddWithValue("@CurrentPicURL", emp.CurrentPicURL);
        com.Parameters.AddWithValue("@EmpID", emp.EmpID);

        #endregion

        //uncomment when getting the image as file object from ajax
        //var file = emp.CurrentPicURL;

        //EmployeeImage(file);

        var ID = com.ExecuteScalar();
        com.Clone();
        return Convert.ToInt32(ID);
    }

    //Ajax call hit this method from AddEmployee page
    [Route("api/Employee/EmpOfficialDetails")]
    [HttpPost]
    public int? EmpOfficialDetails(Employee emp)
    {
        var id = emp.EmpID;
        IHttpActionResult ret;
        try
        {
            id = Emp_OfficialDetails(emp);
            return id;
        }
        catch (Exception ex)
        {
            ret = InternalServerError(ex);
        }
        return null;
    }

all the help I will get on this is highly appreciated and suggestions for betterment of this code are warmly welcomed and all, all of you guys are amazing, helping each other out thank you by the I have learned a lot from all you




Accessing information generated by javascript with scrapy

I would like to get a number from a site: the number

To do this, I use scrapy but this number is generated by a button that activates javascript: the button

What can I do? Thanks in advance




Getting User input from the web into a java program?

How do I go about setting a java object's property via user input from the web? Like, I want to be able to enter playerOne's and playerTwo's "health" from a website, I know how to do that via command line (with Scanner object) but how do I "scan" from an html page's user input field? Do I have to use JSP or something like that?

static void playGame() {

    Person playerOne = new Seller();
    Person playerTwo = new Buyer();
    playerOne.setHealth(100); // I want this 100 to come from user input on an html page
    playerTwo.setHealth(500); // I want this 500 to come from user input on an html page
    System.out.println("playerOne's health is " + playerOne.getHealth());
    System.out.println("playerTwo's health is " + playerTwo.getHealth());
    
    //.... more code here
}



how to upload image in themeforest Description [closed]

you can see in the link that I want to upload an image in the description.. but I don't know how to upload it...

https://themeforest.net/item/codebase-bootstrap-4-admin-dashboard-template-ui-framework/20289243

Image: Click to see what i want




You have mobile app UI, UX design. How to decide where to start?

I have a question to developers who are in the industry in designing any apps (mobile, web and mb desktop as well) . Today my employer asked me to do a "scientific" research in how to develop a mobile app. I am not quite sure what "scientific" means in this context. Is it a common term in development?

The designers are currently working on the UI, UX (almost finished). I am not quite sure how and where I can research that. Is it related to psychology how people react to app's experience (animations, colors???) or may be what a good start is in developing an app (Start coding sign up process over main experience)? If I missed something please let me know

Thank you in advance guys!




extract word from after scrapping with BeautifulSoup

I had gathered some infos using BeautifulSoup4 in the webpage: https://www.peakbagger.com/list.aspx?lid=5651

from urllib.request import urlopen
from bs4 import BeautifulSoup
import pandas as pd

url = 'https://www.peakbagger.com/list.aspx?lid=5651'
html = urlopen(url)
soup = BeautifulSoup(html, 'html.parser')

row = soup.find('tr') 
row

rows = soup.find_all('tr')
for row in rows:          
    print(row.get_text())

I would want to print the word so that each can be shown in each different sections, e.g.

before:

1.Fuji-sanKanto3776Yamanashi-ken/Shizuoka-kenHonshu3776318

2.Kita-dakeChubu3192Yamanashi-kenHonshu223731

after:

(a= )

Fuji-san

Kita-dake

...

(b=)

Kanto

Chubu

...

(c=)

3776

3192

...

for every of the lines starting from 1. to 100.

Shall I use a for loop or split to break each word?

Thank you.




easywsclient websocket connection issues

I am using https://github.com/dhbaird/easywsclient

The following code wont connect properly, ws comes back as a NULL always and the connection "stucks".

using easywsclient::WebSocket;
ws = WebSocket::from_url("ws://mysite.net:80/app/");

assert(ws);

I tried debuggin it and at easywsclient.cpp (github link above) line 514 (code below) gives really weird values for "status" and this is where it fails it seems. I can't figure out why this is happening, the webapp works fine in my browser

if (sscanf(line, "HTTP/1.1 %d", &status) != 1 || status != 101) { fprintf(stderr, "ERROR: Got bad status connecting to %s: %s and status is %d", url.c_str(), line, status); return NULL; }

This is somewhat new terrority to me so I clearly am not understanding something. Any help is appreciated, thanks!




I want to add a shadow overlay to my website [closed]

I want to add a shadow overlay to my website CSS code over the whole page , I already downloaded the shadow file that I uploaded for you guys to check. It's in eps form and i don't know how to insert it into css. If anyone knows the code line please let me know. here is the file link: https://www.filemail.com/d/puxttluozcdaqah




How to "skip" first response with python requests.get

i want to automatically get some information off a website target.url when i open it in the browser a short loading screen shows up and then the information is displayed.

So when i use

resp = reqeusts.get(target.url)
wirte_to_disk(resp.text)

i only get the loading screen animation since its the first response to an http request to this site.

Is there a way to "skip" this response or to establish a connection and send multiple requests via this connection? I tried several things but none of them worked for me :)




How to download a pdf file from a website that is not downloadable?

I need help to figure out how i can download file such as PDF from the website that has no such option to download that PDF, is there a way i can do it?. I have tried google chrome developer tools but failed to find out pdf link.

Thanks in advance and looking forward for an answer from the community, and thanks for the support.!!!




Is it possible to make a 3 dots button using bootstrap 5 float over an Image with a transparent background

like this one but on the top of an image

three dots button




how to change a div position and make it responsible

I want to change the title "Jeneral Qasem Soleymani " and its subtitle to be upon the picture as shown in picture.

enter image description here

and this is my container of title and sub title:

<div>
<h1>General Qasem Soleymani</h1>
<p id="subtitle">The man who cleaned the world of terrorists</p>
</div>

for this I changed the css code to

h1{
   font-size: 2rem;
   margin-bottom: 0;
   position:absolute;
   top: 40%;
   left:5%; 
   color:white; 
  }



#subtitle{
          font-size:1.3rem;
          position:absolute;
          top: 45%;
          left:5%;
          color:white;
         }

and I reached tihs:

enter image description here

What I want to do is the responsiveness. so when user changes the dimension of page the content still stack in that place And automatically change the font size to fit the image size.

how can I do that?




Copy divs height and apply it to an other div with Javascript

<div class="thisOne">
</div>

<div class="thisHeight">
</div>

I want to copy thisHeight divs height and apply it to thisOne div, so as the result this two divs will always have the same height.




A function that change a Collection to an array

I am practicing selenium and web elements. I want to write a function that gets any collection and change return it as an array.

// Here I catch some tipe of collection - (System.Collections.ObjectModel.ReadOnlyCollection<OpenQA.Selenium.IWebElement>)

    public System.Collections.ObjectModel.ReadOnlyCollection<OpenQA.Selenium.IWebElement> Focus_Side_Bar_List()
    {
        WebWaitElementExist.ByCssSelector(Driver, "[data-menu-id='1']");
        return Driver.FindElements(By.CssSelector("[data-menu-id='1']>li"));
    }

This is what i am wishing to have a generic function can makes any collection to an array:

    public string[] Collection_To_Array(Collection<T> AnyCollection)
    {
        var NewArray = new string[AnyCollection.length];
        for (int i = 0; i < AnyCollection.length; i++)
        {
            NewArray[i] = AnyCollection[i].Text;
        }
        return NewArray;
    }



Check Python Version Used in Mod_WSGI

I can't find out which python environment is being used or install location is being used by mod_wsgi in Apache. In my apache config I didn't gave any specific venv config.

        ServerName 
        ServerAlias 
        DocumentRoot /home/Downloads

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        Alias /static /home/Downloads/static
        <Directory /home/Downloads/static>
                Require all granted
        </Directory>

        <Directory /home/Downloads/samples>
                Require all granted
        </Directory>

        <Directory /home/Downloads>
                <Files wsgi.py>
                        Require all granted
                </Files>
        </Directory>

        #WSGIDaemonProcess group python-path=/home/Downloads python-home=/home/envlin
        WSGIProcessGroup group
        WSGIScriptAlias / /home/Downloads/wsgi.py

I removed the critical info and replaced with random info.

Here's my apache restart log

Apache Logs

Apache/2.4.46 (Ubuntu) OpenSSL/1.1.1j mod_wsgi/4.7.1 Python/3.9 configured -- resuming normal operations

Question

Is there any way to get which python version and install location is being used by mod_wsgi.

**Python Path's ** If I fetch python path's normally here's the result.

sys.path = [
    '/root',
    '/usr/lib/python39.zip',
    '/usr/lib/python3.9',
    '/usr/lib/python3.9/lib-dynload',
    '/usr/local/lib/python3.9/dist-packages',
    '/usr/lib/python3/dist-packages',
    '/usr/lib/python3.9/dist-packages',
]



how to attach onclick function on every list item which is created through Javascript Dynamically | Vanilla Javascript [duplicate]

I am trying to create an animated side nav bar through vanilla javascript. the problem I am facing is to attach an on click function on every li element and I have already tried addEventListener but it is running that function immediately can I somehow get the expected result that on every single list item on click function is attached when anyone click on that list item then that function should run.

Code and screenshot is attach below

var navObject = {
"item1":[],
"item2":[],
"item3":[],
"item4":[],
"item5":[],
"item6":[]
}

console.log(Object.keys(navObject))

function next(){
console.log("welcome")
}

const container = document.getElementById('container')
const ul = document.createElement("ul")
objectKeys = Object.keys(navObject)

for (let i =0; i<=objectKeys.length-1;i++){
 
const li = document.createElement('li')
li.innerHTML = objectKeys[i]
li.addEventListener("click",next())
ul.appendChild(li)
}

container.appendChild(ul)

enter image description here




Extract specific links after extracting from BeautifulSoup

I had previously extract some information in the webpage using BeautifulSoup4: https://www.peakbagger.com/list.aspx?lid=5651

And I got a list of a href:

from urllib.request import urlopen
from bs4 import BeautifulSoup
import pandas as pd

url = 'https://www.peakbagger.com/list.aspx?lid=5651'
html = urlopen(url)
soup = BeautifulSoup(html, 'html.parser')

a= soup.select("a:nth-of-type(1)")
a

But I would only wants the one with the links starting on 'peak.aspx?pid=10...'

How do I only print out the ones with 'peak.aspx?pid=10...', do I need to use a loop or split it?

Thanks.




lundi 27 septembre 2021

How to add custom control in fabric.js 3.6.2?

I want to add custom control box like close button near selection box. How can I do that in fabric.js version 3.6.2. I only find ways do that in fabric.js version 4 but I don't know how to include it in my front-end only website.




How to make Big Data smarter and more useful through semantic web approach / OWL?

I am learning semantic web and trying to implement a program to make Big Data smarter through semantic web approach / OWL.

Would it be possible to assist me with a small sample code to prove this?

The code can in any programming language. The requirement is to get a sample Big Data, apply a semantic web technique and make Big Data more usable and prove that semantic web / OWL is helping Big Data to be smart.




How can I make a table with timeline on the side?

I've been trying to make a table with a timeline on the side to make a gantt chart,

and I tried editing this

:root {
  --white: #fff;
  --divider: lightgrey;
  --body: #f5f7f8;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

body {
  background: var(--body);
  font-size: 16px;
  font-family: sans-serif;
  padding-top: 40px;
}

.chart-wrapper {
  max-width: 1150px;
  padding: 0 10px;
  margin: 0 auto;
}


/* CHART-VALUES
–––––––––––––––––––––––––––––––––––––––––––––––––– */

.chart-wrapper .chart-values {
  position: relative;
  display: flex;
  margin-bottom: 20px;
  font-weight: bold;
  font-size: 1.2rem;
}

.chart-wrapper .chart-values li {
  flex: 1;
  min-width: 80px;
  text-align: center;
}

.chart-wrapper .chart-values li:not(:last-child) {
  position: relative;
}

.chart-wrapper .chart-values li:not(:last-child)::before {
  content: '';
  position: absolute;
  right: 0;
  height: 510px;
  border-right: 1px solid var(--divider);
}


/* CHART-BARS
–––––––––––––––––––––––––––––––––––––––––––––––––– */

.chart-wrapper .chart-bars li {
  position: relative;
  color: var(--white);
  margin-bottom: 15px;
  font-size: 16px;
  border-radius: 20px;
  padding: 10px 20px;
  width: 0;
  opacity: 0;
  transition: all 0.65s linear 0.2s;
}

@media screen and (max-width: 600px) {
  .chart-wrapper .chart-bars li {
    padding: 10px;
  }
}


/* FOOTER
–––––––––––––––––––––––––––––––––––––––––––––––––– */

.page-footer {
  font-size: 0.85rem;
  padding: 10px;
  text-align: right;
  color: var(--black);
}

.page-footer span {
  color: #e31b23;
}
<div class="container">
  <div class="chart">
    <div class="chart-row chart-period">
      <div class="chart-row-item"></div>
      <span>January</span><span>February</span><span>March</span>
      <span>April</span><span>May</span><span>June</span>
      <span>July</span><span>August</span><span>September</span>
      <span>October</span><span>November</span><span>December</span>
    </div>
    <div class="chart-row chart-lines">
      <span></span><span></span><span></span>
      <span></span><span></span><span></span>
      <span></span><span></span><span></span>
      <span></span><span></span><span></span>
    </div>
    <div class="chart-row">
      <div class="chart-row-item">1</div>
      <ul class="chart-row-bars">
        <li class="chart-li-one">Planning</li>
      </ul>
    </div>
    <div class="chart-row">
      <div class="chart-row-item">2</div>
      <ul class="chart-row-bars">
        <li class="chart-li-two-a">Meeting</li>
        <li class="chart-li-two-b">Analysis</li>
      </ul>
    </div>
    <div class="chart-row">
      <div class="chart-row-item">3</div>
      <ul class="chart-row-bars">
        <li class="chart-li-three">Design</li>
      </ul>
    </div>
    <div class="chart-row">
      <div class="chart-row-item">4</div>
      <ul class="chart-row-bars">
        <li class="chart-li-four">Development</li>
      </ul>
    </div>
    <div class="chart-row">
      <div class="chart-row-item">5</div>
      <ul class="chart-row-bars">
        <li class="chart-li-five">Testing</li>
      </ul>
    </div>
    <div class="chart-row">
      <div class="chart-row-item">6</div>
      <ul class="chart-row-bars">
        <li class="chart-li-six">Maintenance</li>
      </ul>
    </div>
    <div class="chart-row">
      <div class="chart-row-item">7</div>
      <ul class="chart-row-bars">
        <li class="chart-li-seven">Meeting</li>
      </ul>
    </div>

  </div>

</div>

https://codepen.io/tutsplus/pen/ZEzerNB

to make the timeline on the side and make the tasks horizontal,

I couldnt make it, can someone tell me what should I edit to make it vertical?

or is there a better way to do this?




Django view triggered twice after submit button

I found out that I returned the context to my HTML template the view called in the first time, after I hit the submit button the view triggered again from the beginning. how I can prevent the view to triggered from the beginning and execute directly the code after is request.method == 'POST'. this is the code of my view

def recipe_recommendations(request):
    print('enter----------------')
    # add rating of current user to rating matrix
    person = request.session['person_id']
    user_category = FoodCategory.objects.filter(
        person_id=request.session['person_id']).values_list('category', flat=True)
    user_category = user_category[0]
    target_user = add_to_csv(person, category=user_category)


    # get recommendation
    recom_size = 5
    htop_n_for_target_user = []
    unhtop_n_for_target_user = []
    htop_n_for_target_user,unhtop_n_for_target_user = get_top_n_for_user(person,recom_size, user_category)
    
    

    # get recipe info and send them to tmeplate
    id_h_recipes = [] 
    # for i in htop_n_for_target_user:
    #     id_h_recipes.append(i[0])
    [id_h_recipes.append(i[0]) for i in htop_n_for_target_user]

    id_unh_recipes = []
    [id_unh_recipes.append(i[0]) for i in unhtop_n_for_target_user]
    # for i in unhtop_n_for_target_user:
    #     id_unh_recipes.append(i[0])

    print(f'-------healthy_ids: {id_h_recipes}')
    print(f'--------unhealthy_ids: {id_unh_recipes}')
    
    # extract 5 healthy recipes
    h_0_recipe = HealthyRecipe.objects.get(id=id_h_recipes[0])
    h_1_recipe = HealthyRecipe.objects.get(id=id_h_recipes[1])
    h_2_recipe = HealthyRecipe.objects.get(id=id_h_recipes[2])
    h_3_recipe = HealthyRecipe.objects.get(id=id_h_recipes[3])
    h_4_recipe = HealthyRecipe.objects.get(id=id_h_recipes[4])
    # extract 5 unhealthy recipes
    unh_0_recipe = UnhealthyRecipe.objects.get(id=id_unh_recipes[0])
    unh_1_recipe = UnhealthyRecipe.objects.get(id=id_unh_recipes[1])
    unh_2_recipe = UnhealthyRecipe.objects.get(id=id_unh_recipes[2])
    unh_3_recipe = UnhealthyRecipe.objects.get(id=id_unh_recipes[3])
    unh_4_recipe = UnhealthyRecipe.objects.get(id=id_unh_recipes[4])
    
    # selected recipe model
    selected_recipe = SelectedRecipe() 

    if request.method == "POST":
        # if the user already select a recipe
        person = request.session['person_id']
        user_selected = SelectedRecipe.objects.filter(person_id = person)
        if user_selected:
            SelectedRecipe.objects.filter(person_id=person).delete()

        user_selected = Recommendations.objects.filter(person_id = request.session['person_id'])
        if user_selected:
            Recommendations.objects.filter(person_id=request.session['person_id']).delete()

        
        recipe_name = request.POST.get('recipe_name')
        recipe_id = request.POST.get('recipe_id')
        recipe_h  = request.POST.get('healthiness')
        
        
        
        if recipe_h == 'healthy':
            nutri__fsa = HealthyRecipe.objects.filter(id=recipe_id).values_list('Nutri_score', 'Fsa_new',)
        else:
            nutri__fsa = UnhealthyRecipe.objects.filter(id=recipe_id).values_list('Nutri_score', 'Fsa_new')
        selected_recipe.Nutri_score = nutri__fsa[0][0]
        selected_recipe.fsa_score = nutri__fsa[0][1]
        selected_recipe.person_id= person
        selected_recipe.recipe_name = recipe_name
        selected_recipe.recipe_id = recipe_id
        selected_recipe.healthiness = recipe_h
        selected_recipe.session_id = request.session['session_id']
        selected_recipe.save()
        
        

        h_recommendations = Recommendations()
        h_recommendations.person_id = person
        h_recommendations.recommended_recipes = [h_0_recipe.id,h_1_recipe.id,h_2_recipe.id,h_3_recipe.id,h_4_recipe.id]
        h_recommendations.healthiness = 'Healthy'
        h_recommendations.save()

        

        unh_recommendations = Recommendations()
        unh_recommendations.person_id = person
        unh_recommendations.recommended_recipes = [unh_0_recipe.id,unh_1_recipe.id,unh_2_recipe.id,unh_3_recipe.id,unh_4_recipe.id]
        unh_recommendations.healthiness = 'Unhealthy'
        unh_recommendations.save()

        

        return redirect('Labels_Nudges:choice_evaluation')
    else:
        Serving_size = float(h_0_recipe.size_g) // float(h_0_recipe.Servings)
        Serving_size1 = float(h_1_recipe.size_g) // float(h_1_recipe.Servings)
        Serving_size2 = float(h_2_recipe.size_g) // float(h_2_recipe.Servings)
        Serving_size3 = float(h_3_recipe.size_g) // float(h_3_recipe.Servings)
        Serving_size4 = float(h_4_recipe.size_g) // float(h_4_recipe.Servings)
        
        h_0 = [h_0_recipe.Name, id_h_recipes[0], 'healthy', h_0_recipe.image_link, int(float(h_0_recipe.calories_kCal)), int(float(h_0_recipe.Servings)),int(float(Serving_size))]
        h_1 = [h_1_recipe.Name, id_h_recipes[1], 'healthy', h_1_recipe.image_link, int(float(h_1_recipe.calories_kCal)), int(float(h_1_recipe.Servings)),int(float(Serving_size1))]
        h_2 = [h_2_recipe.Name, id_h_recipes[2], 'healthy', h_2_recipe.image_link, int(float(h_2_recipe.calories_kCal)), int(float(h_2_recipe.Servings)),int(float(Serving_size2))]
        h_3 = [h_3_recipe.Name, id_h_recipes[3], 'healthy', h_3_recipe.image_link, int(float(h_3_recipe.calories_kCal)), int(float(h_3_recipe.Servings)),int(float(Serving_size3))]
        h_4 = [h_4_recipe.Name, id_h_recipes[4], 'healthy', h_4_recipe.image_link, int(float(h_4_recipe.calories_kCal)), int(float(h_4_recipe.Servings)),int(float(Serving_size4))]
        
        Serving_size_ = float(unh_0_recipe.size_g) // float(unh_0_recipe.Servings)
        Serving_size_1 = float(unh_1_recipe.size_g) // float(unh_1_recipe.Servings)
        Serving_size_2 = float(unh_2_recipe.size_g) // float(unh_2_recipe.Servings)
        Serving_size_3 = float(unh_3_recipe.size_g) // float(unh_3_recipe.Servings)
        Serving_size_4 = float(unh_4_recipe.size_g) // float(unh_4_recipe.Servings)

        unh_0 = [unh_0_recipe.Name, id_unh_recipes[0], 'unhealthy', unh_0_recipe.image_link, int(float(unh_0_recipe.calories_kCal)), int(float(unh_0_recipe.Servings)),int(float(Serving_size_))]
        unh_1 = [unh_1_recipe.Name, id_unh_recipes[1], 'unhealthy', unh_1_recipe.image_link, int(float(unh_1_recipe.calories_kCal)), int(float(unh_1_recipe.Servings)),int(float(Serving_size_1))]
        unh_2 = [unh_2_recipe.Name, id_unh_recipes[2], 'unhealthy', unh_2_recipe.image_link, int(float(unh_2_recipe.calories_kCal)), int(float(unh_2_recipe.Servings)),int(float(Serving_size_2))]
        unh_3 = [unh_3_recipe.Name, id_unh_recipes[3], 'unhealthy', unh_3_recipe.image_link, int(float(unh_3_recipe.calories_kCal)), int(float(unh_3_recipe.Servings)),int(float(Serving_size_3))]
        unh_4 = [unh_4_recipe.Name, id_unh_recipes[4], 'unhealthy', unh_4_recipe.image_link, int(float(unh_4_recipe.calories_kCal)), int(float(unh_4_recipe.Servings)),int(float(Serving_size_4))]

    # send forms
    return render(request,'Labels_Nudges/recipe_recommendations.html',context={'h_':htop_n_for_target_user, 
                                                'unh_':unhtop_n_for_target_user,
                                                'h_0':h_0,
                                                'h_1':h_1,
                                                'h_2':h_2,
                                                'h_3':h_3,
                                                'h_4':h_4,
                                                'unh_0':unh_0,
                                                'unh_1':unh_1,
                                                'unh_2':unh_2,
                                                'unh_3':unh_3,
                                                'unh_4':unh_4,
                                                })```



Attempted import error: 'GridActionsCellItem' is not exported from '@mui/x-data-grid'

I am trying to import 'GridActionsCellItem' from '@mui/x-data-grid' as:

import { GridActionsCellItem } from '@mui/x-data-grid';

But it shows error as:

Attempted import error: 'GridActionsCellItem' is not exported from '@mui/x-data-grid'.

I am copying the official documentation code from here.

Can anyone help me with this?




exploit failed : rex::bindfailed the address is already in use or unavailable: (0.0.0.0:8080)

I am using msfconsole on kali I picked the exploitation when i try to run the exploit error message appear as shown below enter image description here

exploit failed : rex::bindfailed the address is already in use or unavailable: (0.0.0.0:8080)

I checked if there is any service using port 8080 but nothing is there the command I used to check. netstat -nao | grep 8080.




Heroku: "Domain format is invalid"

so I tried adding a custom domain to my heroku website, but I've got a "Domain format is invalid" error. My domain looks like name.space, maybe .space isn't an accepted domain?




How to remove redundant spaces after I pull data with selenium

how can I remove redundant spacing after I pull some element data with selenium

My output lookslike:

                    Telefon:
        
    
            
    216 593 17 20 - 21 - 22
        

                                            
    
            
                    Websitesi:
        
    
    http://www.an-ko.com


                                            

    
            
                    Email:
        
    
    info@anadolukompozit.com

and I want to remove spaces from this here's the script I use

from selenium import webdriver

driver = webdriver.Safari()

driver.get("https://iayosb.com/firmalar/anadolu-kompozit-mam-san-ve-tic-a-s/")
article = driver.find_elements_by_xpath("//div[@class='w2dc-fields-group w2dc-fields-group-1']")
for elem in article:
    print(elem.text)

driver.quit()

        

Thanks is advance I really appreciate it




iterate over a list of url in r

i want to import a txt that have a list of urls and extract from each one and save that in a cvs file but i get stuck

First i import the txt no problem but when a i want to iterate over each row i just extrat from the first one

library(rvest)
library(tidyr)
library(dplyr)

for(i in seq(list_url)) {
    text <- read_html(list_url$url[i]) %>%html_nodes("tr~ tr+ tr strong") %>%html_text()}

i just get the result from the first url in a value form , i want a dataframe of all the the extract from the urls




Validating slightly differing urls to a database

I am building an internal tool for our team, which is basically a database of urls. Within a Chrome extension I want to be able to check whether the url the user is currently on is in our database.

Checking this for the main domains is easy. The problem is that often query parameters differ slightly. For example, in a sharepoint link, the query paramter sourcedoc indicates the document ID, while the query paramter mobileredirect is not necessary, since I get on the same page with or without this parameter.

So when I parce an url, is there any standard way/algorithm to check whether parts of the url/query parameters are optional or unimportant?




How to get application url in kotlin?

I tried to develop an android application in kotlin that can receive URL from all application (e.g: website of tiktok, instagram or google). I tried to use okhttp, create my own vpn but nothing work like I want.

I find QUERY_ALL_PACKAGES to take informations of all the application. I don't know how it work and how to use it to do want I want.

Thanks for your responses.




How to scrape a single string data (value of euro) from a website? [closed]

I am trying to scrape a single string daily from a hungarian website, that publishes the HUF value of one Euro on a daily basis. I tried my best with BeautifulSoup, but can't seem to manage.

I wish to get that single str (ex. 365,899) from the website, and save it later into an excel file.

Do any of you by chance have some simple code lying around for that? Thanks in advance!




Is there any way to take input as a location stored it in db [closed]

So i was creating car rental site for that i want store pickup location and dropping location in db so can some one explain me how todo this also i want location list in input tag after search




How can I allow the person I'm making a website for to upload images to their website?

I'm currently making a website for a friend using Node, Express, and MongoDB Atlas. The website is to host their comic that they are creating, and I want them to be able to update it without needing my help. Right now I have a database that holds information on each comic page like which page it is and the file path, and I use the size of that collection to update certain parts of the website, such as the navigation buttons (first page, next page, previous page, last page.)

As it is now, they would have to move their new comic pages to the images folder and then add an entry to the database themselves. Is there a way I can make it so all they need to do is upload an image? Either to the website directly or is it possible to get them from a google drive or something?




can't get my selenium script to work on multiple links given from a list

im working on a script for my company that pulls form data as requested from the site but i can't get it to work automatically if I give the links from a list the first link is saved into a txt but i get this error message:

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x10d715640>: Failed to establish a new connection: [Errno 61] Connection refused

And lastly here's the code i use to pull data does the site basically refuses me for using a script ? But even then when insert links one by one its fine

def getData(link):
    try:
        driver.get(link)
        header = driver.find_element_by_tag_name('h2')
        results = driver.find_elements_by_xpath("//ul[@class='firma-info']/li")
        with open('readme.txt', 'a+') as f:
            f.write(header.text + "\n")
            for result in results:
                f.write(result.text + "\n")
        driver.quit()

    except Exception as e:
        driver.quit()
        print(e)



I am unable to solve this error generated from venerability report

What does this mean? Passwords may appear visible in the URL and stored in the browser's history. It may also be cached by immediate proxies and getting stored in remote server logs. What can happen? The login form is sending data using HTTP GET-request.




dimanche 26 septembre 2021

How to add a page to my website that can only be seen by an administrator?

I have a website (hypothetical) but it doesn't have any authentication. Just people can view it without registering and they can't see any login screen(There is no any Sign-Up, Sign In). But the site has a feature to add posts. That feature can be only used by the Admin. There is a special page designed for him to add posts. But Others should not be able to access that page. How to set up something like that? Without a login? Is it possible?




How to interface a microcontroller with a webpage?

I'm starting on an embedded neural network IoT project which involves the following parts:

  1. Sensing Data with a sensor (a camera module in this case)
  2. Processing (a tflite model embedded in the sensor)
  3. Showing the data in a webpage hosted on a server

I have no idea how to do step 3 and I need help to know where to look. As for the board, I'm using an Arduino Nano 33 BLE Sense.




este NUEVO sitio web le permite ganar dinero por internet

gana dinero en internet register now https://share.paid2tap.com/pjulian sign up FREE 25$




Prevent to change url address bar manually. Javascript

I m trying to prevent manipulation of websites.In which user try to manipulate sites by changing url address bar manually




How to use phython file to show some results at a html screen

Suppose I have a code print("Helo This Is Python") In a folder name code.py So how can I show it in a html file

Means how can I execute it Or How can I show :- Helo this is python on the webpage




What is the language to build a website to handle Authentication Payments and Databases

I would like some help form some experienced developers or coders. My problem is that i cant find which is the best way to make a website that has a good Authentication system and it can handle payments and store data in a data base and i was wondering anybody had a good start way cause what i have done so far is built the whole website in HTML and CSS and a little bit of JavaScript and i used Firebase to host it and ive tried the auth system but its not working and then i used there databases and i looked at the payment method and it came out to redoing the whole website with react base and more and the payment method was really crazy so i was wondering if anybody knows anything to tell me on like a good language that i can use to start it out and can import the a auth system and database to store like a ticket system and a payment method or any services to help me out or anything at all really cause ive already put like a 100 hours in this and i dont want to destroy it for nothing and anything would great right about now thanks if you guys have anything.




How to learn quickly about high level language? [closed]

I was studying police administration major in Uni, and now I changed my major to computer engineering. I just start to learn C, but I heard designing web is best way to study about programming. And also do I have to learn C at first? Or I have to find another languages fit me.I need a advice from professional like u guys.




Running Form.io

I'm just starting to learn how to code, and I was trying to work with Form.io, but I have some issues with my project.

I'm working on Java with Payara Server running. I have tried to put the form.io in html and jsp files, but none of them worked. I need to use the builder in my project, but the builder does not appear, it's worth say that if I clicked on the file html in my web explorer, chrome does load the builder, so I don't know what is what I'm doing wrong. enter image description here




What apps and softwares does fireship(Youtube) or JeffD23 uses to make his art [closed]

I am very interested on what does he uses for the making of the UI in the page he has(Besides fontawsome), and the art he uses on his videos




Create your own web crawler? [closed]

Hey I am looking into a way to index the web like googlebot does. Does anyone know how to do that or do you even know a free to use programm for that?

Thank you for your answer.




is passing a token in the request header a safe and secure way to safeguard services

Closed. This question needs details or clarity. It is not currently accepting answers. Add details and clarify the problem you’re solving. This will help others answer the question. You can edit the question or post a new one.

Closed 6 hours ago.

(Private feedback for you)

Hi security and how people hack is not something, I know a lot about. I have implemented a simple authorization. Where a request to a service is only allowed if in the header there is a JSTLToken, that contains the correct id information.

I am thinking is there the possibility of intercepting requests, and extracting all the header information.

I am not sure if it is a problem. But currently when a request is made, the security token is added to the request

Enumeration<String> names = request.getHeaders("authorization");
       log.info("Calling "+authorizationServer); 
       if(names.hasMoreElements()) {
           HttpHeaders headers=new HttpHeaders();

           
           while (names.hasMoreElements()) {
               String token = names.nextElement();
               names.get
               log.info("AUTHORISATION  "+name);
               headers.add(HttpHeaders.AUTHORIZATION, token);
           }
           HttpEntity httpHeaders=new HttpEntity<String>("parameters",headers);

Is this a safe and secure way to pass a token via the header.




Post then change text in html nodejs

I have a form tag in Html like then:

app.get("/",(req,res)=>{
res.sendFile(__dirname+"/index.html")

})

app.post("/Cong",urlencodedParser,(req,res)=>{
    var a = parseInt(req.body.a);
    var b = parseInt(req.body.b);
    var c = a + b;
    res.send("Result: "+c)//This is will route to a new website, but I just want change text in my HTML
})
 <form action="/Cong" method="post">
  A: <input type="text" name="a"><br>
  B: <input type="text" name="b"><br>
<label id="result"></label>
</form>

how I can change the label in HTML with id result = value C in file js when I click the button.