How to come up with an idea for a thesis?
there is not enough imagination to come up with a topic for a thesis at the university. I am sorry for your help, any ideas will help me.
See also questions close to this topic
-
Can I access any response that is shown in dev tools?
Here is the scenario...
- I have an Iframe that is using RightSignature to capture a signed document.
- When I submit the document in the iframe, I can see in my Dev tools that I have a PUT with a json response that I want to grab.
- once it is submitted, the page in the iframe is redirected.
So far I have had no luck in capturing the response using just vanilla js and .addEventListener. It seems like there should be a way to do it but I am just curious if what I think should be possible actually is.
So in short, if I can see the response in my Dev Tools, does that mean I should be able to capture it somehow using js, or because it is in an iframe does that not necessarily translate into something that is accessible to me? I just want to know so I dont keep trying to go down a path that leads nowhere.
Thanks
-
Is there is a way to DM someone that is mentioned in a message with discord.js?
Is there is a way to DM someone that is mentioned in a message with discord.js?
this is my code.
client.on("message", message => { if (message.author.bot) {return} let person = message.content.mentions person.send("My message") })
it's not working for some reason
-
How to check cookie parameters in if-else condition after it is stored?
I have here a function that checks each parameters in the url and store it as cookie. But I have a problem, whenever I pass those parameter entered into a new url using
XMLHttpRequest()
it returns only the first parameter entered from the user. I guess this is something to do with theif-else
condition in mycode.Here is my javascript code:
<!-- Get Parameters for gclid, token , fbclid or cjevent when user visits the website --> <script> window.onload = function() { try { var url_string = (window.location.href).toLowerCase(); var url = new URL(url_string); // check parameters if exists ['gclid', 'token', 'fbclid', 'cjevent'].forEach(function (key) { var value = url.searchParams.get(key); if (value) { //token expires in 6 hours document.cookie = `${key}=${value}; max-age=21600` + ';path=/'; } }); const getCookieValue = (name) => ( document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)')?.pop() || '' ) // Sending a get request to laravel controller var base_url = window.location.origin; // get the base url var params = ''; // pass parameters if gclid, token, or fbclid if(getCookieValue('gclid')) { params = 'gclid=' + getCookieValue('gclid');} else if (getCookieValue('token')) { params = 'token=' + getCookieValue('token');} else if (getCookieValue('fbclid')) { params = 'fbclid=' + getCookieValue('fbclid');} else if (getCookieValue('cjevent')) { params = 'cjevent=' + getCookieValue('cjevent');} // send those parameters in TrafficTracking Controller storeTracking function let xhr = new XMLHttpRequest(); xhr.open("GET", base_url+"/storetrackvisit?"+params, true); xhr.send(); } catch (err) { console.log("Issues with Parsing URL Parameter's - " + err); } } </script>
When I try to use the
alert(params)
function in the varparams
it returns only the first parameter that user has entered.For example:
1.) User enters
test.com?gclid=111
-> stores that as a cookie2.) user re enters another value for other parameter
test.com?token=551
-> it will still alert thegclid
parameterHow do I refactor my if-else condition that returns only the parameter when a user enters it and assign it in the
params
variable. So that the variableparams
is dynamic when passing it to the new urlXMLHttpRequest()
.I believe this is something to do with this code:
if(getCookieValue('gclid')) { params = 'gclid=' + getCookieValue('gclid');} else if (getCookieValue('token')) { params = 'token=' + getCookieValue('token');} else if (getCookieValue('fbclid')) { params = 'fbclid=' + getCookieValue('fbclid');} else if (getCookieValue('cjevent')) { params = 'cjevent=' + getCookieValue('cjevent');} alert(params);
How can I modify my if-else conditions to return only the parameters what user entered? I believe that what I've done it fetches the last cookie saved. Is there anything good to do about the
if/else
condition? -
Convert CSV file data from any language to English in C#
I would like to convert CSV file data from multi languages such as Spanish, Russian, European etc to English language in C# program.
Convert all characters like Ó, É to English characters.
Thanks.
-
I get an error when solving this problem, How can I fix?
I am trying to solve the Climbstairs problem but in reverse, where I want to know the number of steps I have to take to go down.
I can go down 1, 2, 3 or 4 steps at the same time. That is, if I am at step i, I can go down to step i - a for any of the values 1, 2, 3 or 4 of a.
I have the following code but I don't know what happens:
I got this error: System.IndexOutOfRangeException in this line:
steps[i] += steps[i - a];
Why I have this error?
public static int DownStairs(int n) { int[] steps = new int[n + 1]; steps[n] = 1; steps[n - 1] = 1; for (int i = n-2; i>=0; i--) { for(int a = 1; a<=4; a++) { steps[i] += steps[i - a]; } } return steps[n]; } static void Main(string[] args) { int n = 5; DownStairs(n); }
-
How to delete multiple blank lines in a WPF DataGrid imported from an Excel file
I have a WPF DataGrid which I fill with imported data from an Excel file (*. Xlsx) through a class, the problem is that multiple blank lines are added to the end of the DataGrid that I don't see how to delete. I attach my code.
<DataGrid Name="dgvMuros" Height="210" Margin="8" VerticalAlignment="Top" Padding="5,6" ColumnWidth="50" IsReadOnly="False" AlternatingRowBackground="Azure" GridLinesVisibility="All" HeadersVisibility="Column" Loaded="dgvMuros_Loaded" CellEditEnding="DataGrid_CellEditEnding" ItemsSource="{Binding Data}" HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray" > </DataGrid>
With this method I import the data from the Excel file.
public void ImportarMuros() { ExcelData dataFronExcel = new ExcelData(); this.dgvMuros.DataContext = dataFronExcel; txtTotMuros.Text = dataFronExcel.numMuros.ToString(); cmdAgregarMuros.IsEnabled = false; cmdBorrarMuros.IsEnabled = false; cmdImportar.IsEnabled = false; } public class ExcelData { public int numMuros { get; set; } public DataView Data { get { Excel.Application excelApp = new Excel.Application(); Excel.Workbook workbook; Excel.Worksheet worksheet; Excel.Range range; workbook = excelApp.Workbooks.Open(Environment.CurrentDirectory + "\\MurosEjemplo.xlsx"); worksheet = (Excel.Worksheet)workbook.Sheets["DatMuros"]; int column = 0; int row = 0; range = worksheet.UsedRange; DataTable dt = new DataTable(); dt.Columns.Add("Muro"); dt.Columns.Add("Long"); dt.Columns.Add("Esp"); dt.Columns.Add("X(m)"); dt.Columns.Add("Y(m)"); dt.Columns.Add("Dir"); for (row = 2; row < range.Rows.Count; row++) { DataRow dr = dt.NewRow(); for (column = 1; column <= range.Columns.Count; column++) { dr[column - 1] = Convert.ToString((range.Cells[row, column] as Excel.Range).Value); } dt.Rows.Add(dr); dt.AcceptChanges(); numMuros = dt.Rows.Count; } workbook.Close(true, Missing.Value, Missing.Value); excelApp.Quit(); return dt.DefaultView; } } }
-
Random 3-4 long strings in a http response pythyon
I am trying to make a request with the socket module in python. It successfully makes the request, gets the response, and decodes it. When I am looking at the HTML document it is all correct except there are random 3-4 long random strings in the HTML document. I think I have the code right but I am not 100% sure. Here is my code:
def recive_data(get, timeout): ready = select.select([get], [], [], timeout) if ready[0]: return get.recv(4096) return b"" def get_file(website, port, file, https=False): data = [] new_data = "" if https: get = ssl.create_default_context().wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM), server_hostname=website) else: get = socket.socket(socket.AF_INET, socket.SOCK_STREAM) get.connect((website, port)) get.sendall(f"GET {file} HTTP/1.1\r\nHost: {website}:{port}\r\n\r\n".encode()) while True: new_data = recive_data(get, 5).decode() if new_data != "" and new_data != None: data.append(new_data) new_data = "" else: break data = "".join(data) header = data[0:data.find(newline+newline)] data = data[data.find(newline+newline):data.rfind(f"{newline}0{newline}{newline}")] data = BeautifulSoup(data, 'html.parser').prettify() get.close() return (header, data)
If I put in https://stackoverflow.com it outputs:
30d <!DOCTYPE html> <html class="html__responsive html__unpinned-leftnav"> <head> <title> Stack Overflow - Where Developers Learn, Share, & Build Careers </title> <link href="https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196" rel="shortcut icon"/> <link href="https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a" rel="apple-touch-icon"/> <link href="https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a" rel="image_src"/> <link href="/opensearch.xml" rel="search" title="Stack Overflow" type="application/opensearchdescription+xml"/> <meta content="Stack Overflow is the largest, most trusted online communi 20d0 ty for developers to learn, share their programming knowledge, and build their careers." name="description"/> <meta content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0" name="viewport"/> <meta content="website" property="og:type">
etc... However, some website has it more than others and I can't figure that out either. Any help is greatly appreciated!
-
Why does js exponents return infinity?
I made a huge number generator in html/javascript it uses a inputted number in its exponents,but my exponent returns infinity. if I enter 1 it returns NaN.
<button onclick = "cal()">Giant Number Calculator</button> <script type = "text/javascript"> function cal(){ var n = prompt("Give me a huge number") var number = 99999999**n**999999999999999999999999999999**900**9099909303847477474874884**74848484848 alert ("The calculations are done and your number is " + number) } </script>
-
Is there any way to get the values from HTML forms and display in Python (can we use cgi script) without using Frameworks like Flask or Django
As I have learned to take the values from the code itself, I need to take the values from the HTML forms and display them in Python. Also, I'm new to Python. Thank you.
-
Huge amount of logon attempts when loading a page (without cache)
I notice in the Performance Monitor of Windows Server 2012 that there are spikes in logon attempts per second under Web Service -> Logon Attempts/sec. These spikes go from about 0 to 50.
I've traced this down to a page refresh. Loading a page with no cache that is. An average page load does about 50 requests (images, scripts, etc). Now apparently these 50 requests are shown as logon attempts.
Is this normal?
Note that this page does not require the visitor to be logged in.
-
Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[3\
When warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {e43b756a-2818-4898-8730-5e8e0f230be7} may be persisted to storage in unencrypted form.
info: IdentityServer4.Startup[0]
Starting IdentityServer4 version 4.1.1+cebd52f5bc61bdefc262fd20739d4d087c6f961f
info: IdentityServer4.Startup[0]
You are using the in-memory version of the persisted grant store. This will store consent decisions, authorization codes, refresh and reference tokens in memory only. If you are using any of those features in production, you want to switch to a different store implementation.
info: IdentityServer4.Startup[0]
Using the default authentication scheme Identity.Application for IdentityServer
info: Microsoft.Hosting.Lifetime[0]
Now listening on: https://[::]:8081
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://[::]:8080
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: /app
info: IdentityServer4.Hosting.IdentityServerMiddleware[0]
Invoking IdentityServer endpoint: IdentityServer4.Endpoints.TokenEndpoint for /connect/token
info: IdentityServer4.AspNetIdentity.ResourceOwnerPasswordValidator[0]
Credentials validated for username: muthu
info: IdentityServer4.Validation.TokenRequestValidator[0]
Token request validation success, {
"ClientId": "sdgfsdsgsdg",
"ClientName": "Swagger UI",
"GrantType": "password",
"Scopes": "api",
"AuthorizationCode": "********",
"RefreshToken": "********",
"UserName": "sample",
"Raw": {
"grant_type": "password",
"username": "sample",
"password": "REDACTED"
}
}
fail: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[3]
Exception occurred while processing message.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'http://*:8080/.well-known/openid-configuration'.
---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'http://*:8080/.well-known/openid-configuration'.
---> System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString, UriKind uriKind)
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
--- End of inner exception stack trace ---
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
--- End of inner exception stack trace ---
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
fail: IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationHandler[0]
IDX20803: Unable to obtain configuration from: 'http://*:8080/.well-known/openid-configuration'.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'http://*:8080/.well-known/openid-configuration'.
---> System.IO.IOException: IDX20804: Unable to retrieve document from: 'http://*:8080/.well-known/openid-configuration'.
---> System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString, UriKind uriKind)
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
--- End of inner exception stack trace ---
at Microsoft.IdentityModel.Protocols.HttpDocumentRetriever.GetDocumentAsync(String address, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectConfigurationRetriever.GetAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
--- End of inner exception stack trace ---
at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationHandler`1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationHandler.HandleAuthenticateAsync()
info: IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationHandler[7]
Bearer was not authenticated. Failure message: IDX20803: Unable to obtain configuration from: 'http://*:8080/.well-known/openid-configuration'.
info: IdentityServer4.AccessTokenValidation.IdentityServerAuthenticationHandler[12]
AuthenticationScheme: Bearer was challenged.
-
ASP.NET using return RedirectToAction(" ", " ") how to use this to redirect to a cshtml
I can not find a useable tutorial that explains how to redirect using REdirectToAction. can someone share a link that that explains ALL the steps needed to use this? I think I am having a hard time understanding how the parameters are given can find an HTML file with a model in the parameter? or is it a controller? I am very lost on how they communicate. please someone if you can help.
-
ArgumentNullException: Value cannot be null. (Parameter 'user')
I have problem with my code based on this tutorial. I tried to make list of roles and add or delete user from specific role.
This is my code in controller:
[HttpPost] public async Task<IActionResult> EditUsersInRole(List<UserRoleViewModel> model, string roleId) { ViewBag.roleId = roleId; var role = await roleManager.FindByIdAsync(roleId); if (role == null) { ViewBag.ErrorMessage = $"Role with ID = {roleId} cannot be found."; return View("NotFound"); } for (int i = 0; i < model.Count; i++) { var user = await userManager.FindByIdAsync(model[i].UserId); IdentityResult result = null; if (model[i].IsSelected && !(await userManager.IsInRoleAsync(user, role.Name))) { result = await userManager.AddToRoleAsync(user, role.Name); } else if (!model[i].IsSelected && await userManager.IsInRoleAsync(user, role.Name)) { result = await userManager.RemoveFromRoleAsync(user, role.Name); } else { continue; } if (result.Succeeded) { if (i < (model.Count - 1)) continue; else return RedirectToAction("EditRole", new { Id = roleId }); } } return RedirectToAction("EditRole", new { Id = roleId }); }
EditUsersInRole View code:
@model List<collector_forum.ViewModels.UserRoleViewModel> @{ var roleId = ViewBag.roleId; } <form method="post"> <div class="card"> <div class="card-header"> <h2>Add or remove users from this role</h2> </div> <div class="card-body"> @for (int i = 0; i < Model.Count; i++) { <div class="form-check m-1"> <input asp-for="@Model[i].IsSelected" class="form-check-input" /> <label class="form-check-label" asp-for="@Model[i].IsSelected"> @Model[i].UserName </label> </div> } </div> <div class="card-footer"> <input type="submit" value="Update" class="btn btn-primary" style="width: auto;" /> <a asp-action="EditRole" asp-route-id="@roleId" class="btn btn-primary" style="width: auto;">Cancel</a> </div> </div> </form>
And the ViewModel:
namespace collector_forum.ViewModels { public class UserRoleViewModel { public string UserId { get; set; } public string UserName { get; set; } public bool IsSelected { get; set; } } }
Then I got this error:
ArgumentNullException: Value cannot be null. (Parameter 'user')
Error appears Error
I am helpless right now
Please help me.
//Edit.
Html view before posting - screenshot
Chrome Developer Tools -> Network tab before click on "Update"
And after hit "Update" view
-
Fresh ASP.NET MVC web application doesn't render menu/mobile menu correctly
I created a new project in Visual Studio 2017 and selected ASP.NET web application (.NET framework) then selected MVC as the project template. It created all the files and loaded the solution. Upon running the new project I noticed the menu was not being rendered correctly. The mobile menu is not rendered correctly either. And the Learn More buttons are wrong. I don't understand. I didn't make any changes. Anyone else have this issue? Is something missing or not loading? I don't see any errors or warning in the browser console.
Desktop
Mobile
It should look like this
-
Asp.net Identity: obtain client local time zone when logging in or returning to web application
Is it possible to read in the user's local timezone from the browser when they go to our website? Either logging in or where they are already logged in?
Reason: I would like to read the local time zone when they go to our URL (MVC asp.net web application) and store that in memory while they are in the application so we can convert to their local timezone from our UTC datetimes that are stored in the database.
Thanks.