Here is my controller: <?php namespace App\Http\Controllers\Api; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class RegisterController extends Controller { public function register(Request $request) { dd('aa'); } } As seen in the screenshot, the class exists and is in the correct place: My api.php route: Route::get('register', 'Api\RegisterController@register'); When I hit my register route using Postman, it gave me the following error: Target class [Api\RegisterController] does not exist. How can I fix it? Thanks to the answers, I was able to fix it. I decided to use the
How to grant all table privileges to all schemas in a Postgres database to a user/role? The below command grants only to specific schema not whole database. GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA schema_name TO username; For example, Database: test Schema : schema1, schema2 inside test table : schema1.table1,schema1.table2,schema2.table1,schema2.table2 How to provide all table privileges to all tables found in all schemas found inside Database.
I have a set of 10,000 points, each made up of 70 boolean dimensions. From this set of 10,000, I would like to select 100 points which are representative of the whole set of 10,000. In other words, I would like to pick the 100 points which are most different from one another. Is there some established way of doing this? The first thing that comes to my mind is a greedy algorithm, which begins by selecting one point at random, then the next point is selected as the most distant one from the first point, and then the second point is selected as having the longest average distance from the first
I added the correct validation annotations to my DTO and API class, but when I input bad data thru postman, it doesn't error. API Class @RestController @RequestMapping("/laptops") @Validated public class LaptopApi { @Autowired private LaptopService laptopService; @Autowired private Environment environment; @GetMapping("/{id}") public ResponseEntity<LaptopDTO> getLaptop(@PathVariable Integer id) { LaptopDTO laptop = laptopService.getLaptop(id); return new ResponseEntity<>(laptop, HttpStatus.OK); } @GetMapping("/") public ResponseEntity<List<LaptopDTO>> getLaptops() { List<LaptopDTO> laptops = l
I'm still playing in the lowest Verilog level (gate level). I found this post: https://electronics.stackexchange.com/questions/390661/is-it-possible-to-create-a-working-jk-flip-flop-using-gate-level-description-in In that, I could understand that should work the idea, and I could solve to have a Master-Slave JK Flip-Flop for use it as a frequency divider. I use Icestorm toolchain. Yosys is not complaining, but Next-PNR is giving me this error: ERROR: timing analysis failed due to presence of combinatorial loops, incomplete specification of timing ports, etc. This is my code: module syncRX(clk,
The problem I have four different chemicals and I know the fraction of the following compounds in each of them as follows: |------------------|---------|---------|---------|---------|---------| | Name | ZrO2 | Al2O3 | SiO2 | Na2O | Price | |------------------|---------|---------|---------|---------|---------| | AZS | 30% | 50% | 13% | 1.8% | 328.95 | |------------------|---------|---------|---------|---------|---------| | Fine salt | 25% | 30% | 43% | 0.2% | 203.95 | |------------------|---------|---------|---------|---------|---------| | ZDCF | 63% | 1% | 33% | 0.4% | 789.47 | |--------------
As the title, I have installed uvicorn using the powershell, and added the environment variable. But whenever I run the command, I get the same error. I know I must be doing something small and stupid, but following every answer on SO tells me the same thing, and I have no leads at all.
I'm working on creating build pipeline in Azure DevOps. I want to trigger it against master branch but only when commit has changes under src/Project/tds/Serialization.Master/ Project - this project contains only .item files If the commit includes any other files together with .item then this pipeline shouldn't trigger, tried path exclude BDD Scenario 1 Given | I've changes for src/Project/tds/Serialization.Master/* Then | build pipeline should trigger Scenario 2 Given | I've changes for src/Project/tds/Serialization.Master/* And | I've changes for src/Foundation/* Then | build pipeline should
I'm trying to setup a Snowflake role that have access to all current and future tables in a given database: create role if not exists MYROLE; grant usage on database MYDB to role MYROLE; grant usage on all schemas in database MYDB to role MYROLE; grant usage on future schemas in database MYDB to role MYROLE; grant select on all tables in database MYDB to role MYROLE; grant select on future tables in database MYDB to role MYROLE; the SHOW FUTURE GRANTS IN DATABASE MYDB; confirms that the grants are there: created_on privilege grant_on name grant_to grantee_name grant_option ... USAGE SCHEMA MYD
I have a .mov file with a video and several audio tracks. To md5 the entire file I can do: [pdev@d ~]$ md5sum 1_TRAILER_HD_2CH_ES419_ENSUB_16X9_178_2398_DIGITAL_FINAL.mov 042f0e177fe25f562079cc07208ec446 Though when I try doing the same thing in ffmpeg, I get a different value: $ ffmpeg -i 1_TRAILER_HD_2CH_ES419_ENSUB_16X9_178_2398_DIGITAL_FINAL.mov -f md5 - MD5=74bd904f1edb4eb1368040e2792d7497 0kB time=00:01:59.11 bitrate= 0.0kbits/s speed=2.36x frame= 2867 fps= 56 q=-0.0 Lsize= 0kB time=00:01:59.57 bitrate= 0.0kbits/s speed=2.35x video:23222700kB audio:22421kB subtitle:0kB other streams:0kB
I'm kinda new to coding discord bots and I have a problem. I want to have a ban command that would ban the mentioned user in the command or the user that has an ID that was provided in the command. For example: &ban @User#0001 would ban User#0001 but if the command looks like this: &ban 123456789123456789 (let's say that's the ID of User#0001) it would still ban User#0001 (as it is the user's ID). I have this code, it works if I mention the user, but it doesn't work if I enter the ID. const Discord = require('discord.js'); module.exports = { name: 'testban', description: "Executer will ban the
I was wondering if there is a way to convert an Armadillo vector to a std string. For example if I have this vector: arma::vec myvec("1 2 3"); //create a vector of length 3 How can I produce: std::string mystring("1 2 3"); from it?
In C++20 (latest draft), given the following code: struct B { int mb; }; struct D : B { int md; }; which of these six expressions are ill-formed and which are not? /*1*/ D{42, 43} /*2*/ D{{42}, 43} /*3*/ D{42, .md = 43} /*4*/ D{{42}, .md = 43} /*5*/ D{.mb = 42, .md = 43} /*6*/ D{{.mb = 42}, .md = 43}
What I am trying to do is that I have highlighted text and this highlight can't be removed with left click (for example: there is self.text.tag_remove("match","1.0",END), which removes the highlight, but it will remove it immediately without even showing the highlight in the first place), so I want to remove highlight under the condition of left clicking in text widget. Here is part of my code which I think might be helpful: def Find(self): count=IntVar() s=self.text.search(self.entry.get(),'1.0',stopindex=END,count=count) self.text.tag_configure("match",background='yellow') end=f'{s}+{count.g
I have this code that is working perfectly: module syncRX(clk, signal, detect); input clk, signal; output reg [7:0] detect = 0; reg [7:0] delay = 0; //wire clk_1khz; freq_div div(.clk(clk), .clk_1khz(clk_1khz)); always @(posedge signal) begin detect <= detect + 1; delay <= 0; end always @(posedge clk_1khz) begin delay <= delay + 1; end endmodule // top module freq_div(input clk, output reg clk_1khz); reg [12:0] count = 0; always @(posedge clk) begin if(count == 6000) begin clk_1khz <= ~clk_1khz; count <= 0; end else count <= count + 1; end endmodule The problem appears when I change the line d
I made a python program and I want to disable the option to launch it multiple times in parallel. I searched the web and found that I need to do it with socket and ports, but I didn't find any example of how to do it(I know the steps, but I need to search every step on google and I am not so sure how to start). I also found that there might be libraries that can do that but to specific operating systems. My script only targets Windows 10, so I need to find a library that does that to Windows if there is one. Do you know such libraries or can you give a more detailed example of how to make this
I have some doubts regarding encoding (I am not familiar with tasks like these) categorical variables in order to use them as parameters in a model like logistic regression or SVM. My dataset looks like the following: Text Symbol Note Account Age Label There is a red car ! red John 24 1 My bag was very expensive ? orange Luke 36 0 Where are my keys? @ red Red 58 1 I promise: I will never let you go! ... green Aoife 28 0 In 'Text', there are stored comments from users in a community. 'Symbol' includes the most used symbol by a user. 'Note' represents its level (green is more experienced; red is
I have a table with descriptive statistics I generated using the table1 package (I used it since it can produce descriptive statistics for both categorical and continuous variables). The issue I'm having is that table1 only produce tables in HTML-format. I'd like to transform my table1-table to a kable-table (or equivalent) so I knit my markdown to a pdf-file. I tried the following code library(table1) library(kable) tb <- table1(reformulate(colnames(df)), data=df, output = "latex") kable(tb, caption = "Descriptive statistics") But this produces an empty table looking like this: Does anyone kn
I am trying to create a flat list in react native that displays an image as many times as the length of an array called "bools" (later, I will also display contents of bools in the flatlist). While I am able to create and display the flatlist, there is a lot of space between each item and above & below the first and last items, respectively. I can’t remove top and bottom margins completely because I want to add other elements above and below the flatlist. Other than this, I have tried every possible thing I could find online, but nothing is working. Flat List: <View style={{ marginTop: "10%",
I am downloading files using DownloadManager to a directory, that isn't apart of my "local packages" directory, i.e. outside /storage/emulated/0/Android/data/myPackageName/, but part of another directory's package, more specifically, obb directory, /storage/emulated/0/Android/obb/otherPackageName/ If I install on "my package's directory", no problem, if I got outside of it, I get a "java.lang.SecurityException: Unsupported path /storage/emulated/0/Android/obb/otherPackageName/fileName.obb" I have my permissions in the android manifest, WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE, and I check
I am new to web development and currently learning React. When I follow tutorials to set up a new React project, I often see the terminal output instructing me to visit localhost:3000 in my browser. I tried searching for an explanation, but none of the existing answers clearly explained what localhost:3000 actually means or why it is used. Could someone explain what localhost and the port 3000 represent in this context?
I am trying to make a mod for Minecraft Forge 1.12.2, mdk file forge-1.12.2-14.23.5.2854-mdk. Problem is, when i right-click inside this folder, open Powershell and run the ./gradlew setupDecompWorkspace eclipse command, it comes up with an error log: forge-1.12.2-14.23.5.2854-mdk> ./gradlew setupDecompWorkspace eclipse To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradlDaemon will be stopped at the end of the build stopping after processing FAILURE: Build failed with an exception. What went wrong: A problem occurred configur
Trying to evaluate if dataclasses are suitable for an upcoming project, but right now I'm stuck with this code: from dataclasses import dataclass @dataclass class MixinA: attrA: int def __post_init__(self): print('MixinA post_init') self.attrA = [self.attrA] @dataclass class MixinB: attrB: str def __post_init__(self): print('MixinB post_init') self.attrB = [self.attrB] @dataclass class MixinC: attrC: bool def __post_init__(self): print('MixinC post_init') self.attrC = [self.attrC] @dataclass class Inherited(MixinC, MixinB, MixinA): pass obj = Inherited(4, 'Hello', False) print(obj.attrA, obj.a
I have a Controller class on which I execute a SOQL query to Custom Metadata Type records. The SOQL query also contains a child relationship query (Master-Detail relationship). I need to write a test with mock custom metadata records @AuraEnabled(cacheable=true) public static List<Response> getLeadMetadataValues() { List<Lead_Business_Status__mdt> leadBusinessStatusList = [ SELECT Id, Label, DeveloperName, Index__c, (SELECT Id, Label, DeveloperName, Reason_Status_Api_Name__c FROM Lead_Reason_Status__r) FROM Lead_Business_Status__mdt ORDER BY Index__c ASC ]; List<Response> resList = new List<Re
I make use of the cloudstack API, to integrate into a 3de party portal. I would like to access the console proxy via the API, cant find the API methods to do so. Ie get the session token for the specific virtual machine and open up the ajax window from our 3de party portal. The management server should expose the Console Proxy to use via the API, then I assume you should acquire a token based on login credentials, or via the API for the specific Virtual Machine you have access to. If someone done this before, would be appreciated to share some detail related to this request.
I am trying to copy a few files from a git repository to a remote server. since the changes will be made often to these files, the files are placed in git, and from git, I am trying to copy it to the remote servers. I am trying something like this, but the git repo I am accessing is a protected one and I have the creds. I would like to know how do I pass on the username and password here. How do I achieve it? - name: Clone git to a local server git: repo: https://github.com/blah/blah.git dest: /my/laptop/var/tmp/ Once I have those files in the controller server, from there I can copy files to