11 August, 2024
10 August, 2024
Instaloader stopped downloading at 12th posts
Programing Coderfunda August 10, 2024 No comments
L = instaloader.Instaloader(
download_videos=False,
download_video_thumbnails=False,
save_metadata=False,
user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36',
)
# L.login("USER", "PASS")
full_directory_path = os.path.join(root, username)
if not os.path.exists(full_directory_path):
os.makedirs(full_directory_path)
L.dirname_pattern = full_directory_path
L.download_profile(username,profile_pic=False)
print(Fore.GREEN + Style.BRIGHT + "\n* Download complete\n.")
This is my code, I have tried to download with an account logged in as well but it does not even download a single post (no exception was raised).
profile thuwu_ could also be downloaded anonymously. Retrieving posts
from profile thuwu_.
* Download complete .
Process finished with exit code 0
The problem here was it used to run flawlessly, I don't know what the problem here. And I tried to change my IP also but that does not work either.
Find the folderID from a shared fileID [duplicate]
Programing Coderfunda August 10, 2024 No comments
Is there any way About Google-Scripting?
Greetings
I have done the following so far without success:
*
I search about the WEB-Interface - here I see only "Shared with me"
*
I checked it wit the API-Explorer:
https://developers.google.com/drive/api/reference/rest/v3?hl=de
Build Your Own Assistant with Laravel Livewire — using your Data and Streamed Content
Programing Coderfunda August 10, 2024 No comments
InputStream and Reader subclass hierarchy difference [closed]
Programing Coderfunda August 10, 2024 No comments
pictorial representation -
InputStream ---> FileInputStream
|
|
---> FilterInputStream ---> BufferedInputStream
But then the Reader abstract class has FilterReader as a direct subclass but FileReader is not a direct subclass, FileReader extends InputStreamReader, and BufferedReader is a direct subclass of Reader and not of FilterReader, again why this decision is taken.
pictorial representation of this as well
Reader ---> InputStreamReader ---> FileReader
|
---> FilterReader
|
---> BufferedReader
Let me summarize all my queries in bullet pointers for easy answering -
* Why BufferedReader is a direct subclass of Reader and not extend FilterReader, as in the InputStream hierarchy.
* Why does FileReader extend InputStreamReader and not directly a subclass of Reader ?
* What capabilities were given to InputStreamReader because of which FileReader was kept a subclass of it?
* Why are those capabilities of InputStreamReader not given to FilterReader? If it was done that way, maybe the Reader abstract class might have the same hierarchy as InputStream.
* FilterReader might have been designed such that InputStreamReader can extend it and then provide an extra specialised wrapper on Reader for input-stream-specific purposes, which then can be further utilized. Why keep it a direct subclass instead?
09 August, 2024
C++ Templates - Guarantee A Type Definition Has a Particular Constructor Signature?
Programing Coderfunda August 09, 2024 No comments
#include
#include
struct AppleMakeInfo {};
template class Apple {
static_assert(std::is_base_of::value, "T must be derived from AppleMakeInfo");
public:
std::function deleteFunc;
~Apple() { deleteFunc(); }
Apple(T* aMI) {};
};
template class AppleManager
{
static_assert(std::is_base_of::value, "T must be derived from AppleMakeInfo");
static_assert(std::is_base_of::value, "U must be derived from Apple");
public:
static U* MakeApple(T* aMI, std::function dF)
{
U* ret = new U(aMI);
ret->deleteFunc = dF;
All.push_back(ret);
return ret;
}
private:
AppleManager() {};
static std::vector All;
};
struct GrannySmithMakeInfo :public AppleMakeInfo {};
class GrannySmith :public Apple {};
class GrannySmithManager :public AppleManager {};
The above code block mostly compiles, however I am having trouble with one line causing a compile error:
U* ret = new U(aMI)
This line, during compilation, will show the following error in my IDE (compile error C2665):
'GrannySmith::GrannySmith': no overloaded function could convert all the argument types
To me, this reads like the typename U of the AppleManager template class does not have a constructor with a signature that matches new U(aMI) because nothing in my source indicates a guarantee/contract between AppleManager and whatever Type is provided for typename U for a constructor with the new U(aMI) signature to exist in the definition of the typename U Type. I'd use the where keyword in C# to get this kind of contract, but the closest there is for this in C++ is static_assert() which isn't actually a contract (AFAIK) but just acts the way a contract would at compile.
Assuming I'm understanding correctly and the code won't compile because there's no compiler guarantee that the type provided for typename U will have a constructor with a signature matching new U(aMI), what am I to do to provide this kind of guarantee to the compiler?
Many thanks for any help I get! I'm not so experienced with C++ so apologies if the code block above is embarrassingly amateur.
cgi-bin on google search
Programing Coderfunda August 09, 2024 No comments
mathematica
Copy code
Name Last Modified Size
Directory cgi-bin 2024-08-05 04:23 -
And below it says: "Proudly Served by LiteSpeed Web Server at www.bpraj.online Port 443."
I've already checked that the index.php file is present in the root directory, and I've ensured the server is set to point to this file. Despite this, the directory listing keeps appearing.
I've also added rules to block directory listing in my .htaccess file and updated my robots.txt to prevent indexing. Additionally, I've tried removing the URL from Google Search Console, but the issue persists.
Has anyone faced a similar issue or knows how to resolve this? Any guidance or suggestions would be greatly appreciated.
Thank you in advance for your help!
I've tried the following steps to resolve the issue:
.htaccess and robots.txt: I added rules to block directory listing in my .htaccess file and updated my robots.txt to prevent indexing, expecting it to stop showing the directory contents and display the homepage instead.
Google Search Console: I edited settings in Google Search Console and attempted to remove the indexed URL, hoping it would refresh Google's view and remove the directory listing from search results.
Favicon/Icon Issue: Additionally, my site icon is not appearing in Google search results. I've added the appropriate meta tags and linked the favicon, but it still doesn't show.
Despite these efforts, the problems persist.
Has anyone faced a similar issue or knows how to resolve this? Any guidance or suggestions would be greatly appreciated.
Thank you in advance for your help!
Spyder console: Avoid empty lines in REPL output
Programing Coderfunda August 09, 2024 No comments
Mapping json to class/model
Programing Coderfunda August 09, 2024 No comments
I'm looking for some kind of package/or built in function, that can map JSON to Class/Model, similar to how you can map JSON to Struct in Go.
I found few small libraries but they are either too old or does not do exactly this.
Thanks! submitted by /u/stylesbeat
[link] [comments]
How to implement something like an SDK? [closed]
Programing Coderfunda August 09, 2024 No comments
I'm not quite clear how to implement this.
1)In what format should I provide my method code to user, should it be in form of DLL or .whl, or just Python scource?
2)If the application run user script with pyo3, how to process my method code called in the script?
Update: To be more forcused.
My application would also run a client side, it would include user written script to accomplish some feature.
08 August, 2024
How to use return value from method in Java?
Programing Coderfunda August 08, 2024 No comments
public int give_value(int x,int y) {
int a=0,b=0,c;
c=a+b;
return c;
}
public int sum(int c){
System.out.println("sum="+c);
}
public static void main(String[] args){
obj1.give_value(5,6);
obj2.sum(..??..); //what to write here so that i can use value of return c
//in obj2.sum
}
Opinions on this Laravel Actions package?
Programing Coderfunda August 08, 2024 No comments
Real World Laravel - Adding user events to my SaaS app
Programing Coderfunda August 08, 2024 No comments
Fully automated API documentation generation for Laravel with Scramble
Programing Coderfunda August 08, 2024 No comments
07 August, 2024
Yet another repository pattern post... Developers that don't use repository pattern and think it's redundant and over-engineering, where do you leave the complex queries of your project at?
Programing Coderfunda August 07, 2024 No comments
So now I'm rewriting it, while trying to make it follow some patterns and also follow some guidelines for a better and cleaner code, for improved readability and maintenance later on.
With all that said, I spent this week reading a lot about the use of Service and Repository Patterns in Laravel, and I started doing it using both but now I get why some people said that it's over-engineering because for like 85% of the Models in the old project (there are more than 150 models), the respective repositories class will only have basic Eloquent methods. The repository will have method create() that has one line that is just calling the same model with $model->create(). So for a good chunk of the project the repositories will be kinda useless.
The problem is the other 15% of the Models and data in general... a lot of the pages in our system shows statistics charts (line, pie, bar, polar, radar, etc) using ChartJS, and most of the queries for generating those charts are very complex and not using Eloquent, and just plain SQL as this is easier to write when you are dealing with a SQL with 80 lines or more, some even use database stored procedures and db functions calls.
Because of those queries, I wanted to go for the repository pattern but now I'm not so sure as there is so much redundancy for a good part of the code like I said before.
I spent some time searching, and for getting more inputs from other Laravel developers, I wanted to ask to you guys that work in complex projects, where do you store very complex queries? Specially those that are not even using Eloquent methods to be generated?
I saw some people leaving those complex, DB raw plain SQL queries at the Controller itself, others on a Service class, some people left them directly inside the Models as a method to be called like $user->getComplexChartData() after using a User::find($id), some create an Utils class, other guy made a class called UserCharts class inside a new directory called Charts...
The thing is, none of the solutions I saw looked like the "perfect match" for me.
How do you guys handle those?
edit: just adding that the queries result have to obviosuly be manipulated by the PHP for adding/treating some data, so that's why its planned to be on a method for each submitted by /u/Cthulhu-Cultist
[link] [comments]
Eloquent copy-on-write: automatically copy all model changes
Programing Coderfunda August 07, 2024 No comments
https://github.com/inmanturbo/ecow
I made a package which uses event sourcing and eloquent wildcard creating*, updating*, and deleting* events to automatically record all changes to all eloquent models. Unlike most similiar packages, it doesn't require adding a trait to your models to use it. And unlike most event sourcing packages it's very simple to use and it requires no setup aside from running a migration.
Rather than manually fire events and store them to be used by aggregates and projectors, then writing logic to adapt and project them out into models, it uses laravel's native events that are already fired for you and stores and projects them into the model automatically using eloquent and active record. Events are stored in a format that can be replayed or retrieved later and aggregated into something with a broader scope than just the model itself, or to be used for auditing, analytics and writing future businesses logic. submitted by /u/Gloomy_Ad_9120
[link] [comments]
As a developer, how may I add userfields on form in "Sales UOM and Package Types" and let the matrix controls?
Programing Coderfunda August 07, 2024 No comments
I'm using C# to create fields. This form has FormType 1470000010 and I aber to create event and controller classes and add fields binded with ITM4, only get the first register and bind to it (I tryed to set value in dbdatasource "ITM4", passing offset, but seems I cannot change not user defined data source.
Here the screen below as example (forget the title form, my focus is on Sales UOM and Package Types, that is the same form). When select a Package type, the default fields works fine and saves temporary tha values after update in "Sales UOM and Package Types"
What's is the ideal way to add it and link to?
I tryed too to create 2 userdatasources, and listen to matrix click and edittext Lost focus to update the values using dbdatasource with "ITM4" and get value passing offset as nextselectrow of matrix. It works, but just for the moment, I''ll need to create a datatable in this scren or Master Data Item, not sure what is best, to save the result and after update document, update the user fields (this could solution, but I'm not sure if i'm losing a more simple way).
From Idea to Merged Laravel Pull Request ✅
Programing Coderfunda August 07, 2024 No comments
How to Sign a JSON Using USB DSC Hardware
Programing Coderfunda August 07, 2024 No comments
I understand that the private key is not directly extractable from the hardware for security reasons. Instead, the signing operation should be performed by the DSC hardware itself.
Here’s what I need help with:
Accessing the DSC Hardware:
What tools or libraries are needed to interact with USB DSC hardware? How can I communicate with the USB token to perform signing?
I tried using C# code to sign JSON with a USB DSC hardware, but it didn’t work
06 August, 2024
Traverse over tree type structured data using JavaScript
Programing Coderfunda August 06, 2024 No comments
1
/ \
2 3
/ \ / \
4 5 6 7
First traverse 1,2,4 Now 4 has no children During back traverse in else part output 4, 2 then it should go to 2, 5
Now, 5 is end. Trace isVisited in parent nodes if any of the child is property isVisited as false.
5,2,1,3
Expected Output:-
1, 2, 4, 2, 5, 2, 1, 3, 6, 3, 7
Once the node end is reached start traversing reverse direction from end of node to start e.g. child2 where other children were left off and were not visited yet.
Data Set in parent child relationship
[
{
"id": 0,
"children": [
{
"id": 3,
"parentId": 0,
"children": [
{
"id": 6,
"parentId": 3,
"children": [
{
"id": 11,
"parentId": 6,
"children": [
{
"id": 10,
"parentId": 11,
"children": [
{
"id": 8,
"parentId": 10,
}
]
}
]
},
{
"id": 9,
"parentId": 6,
"children": [
{
"id": 1,
"parentId": 9,
"children": [
{
"id": 7,
"parentId": 1,
}
]
}
]
},
{
"id": 4,
"parentId": 6,
}
]
}
]
}
]
}
]
let result = [];
const handleTree = ( tree, count) => {
count = count || 0
const tree = _.clone(data);
if( tree ){
tree.forEach( ( t: any, i: string | number ) => {
let deepCopy = _.clone({...t });
delete deepCopy.children;
const { id, parentId } = deepCopy
result.push({ id, isVisited: true, parentId });
if( tree[i].children ){
handleTree(tree[i].children, count+1 )
}else{
//Completed start reading backward
// const getPreviousParent = findParentDetails(tree[i].parentId )
}
})
}
}
How to approach this problem?
So far I have been able to read the data in the same direction but, getting some unexpected results while going backward.
I tried using this code but backtrace I am not getting accurate results.
const handleTree = (tree, path = [], visited = new Set() ) => {
let result = [];
let count = 0;
let visitTree = tree
if( tree && tree.length > 0 ){
const tree2 = (tree) => {
if (tree) {
tree.forEach((t, i) => {
count += 1;
let { children, id, parentId, index, ...rest } = t
result.push({ ...t, id, parentId, isVisited: true, sid: count });
tree = updateIsVisited( tree, id, parentId )
path?.push( t.id );
if (t.children) {
tree2(t.children.sort( ( a: any, b: any ) => b.order - a.order ) );
} else {
tree = updateIsVisited( tree, id, parentId )
path.pop();
const res = returnReverseNodesForTraversel( [...path], tree, t.id );
// Here data is not coming correctly
}
});
}
}
return tree2(tree)
}
};
Function For updating status
const updateIsVisited = ( nodesData, id ) => {
return nodesData.map ( ( node: any ) => {
const updatedNode = {
...node,
isVisited: node.id === id ? true : node.isVisited,
children: Array.isArray( node.children )
? updateIsVisitedInNestedObjects( node.children, id )
: []
}
return updatedNode;
})
}
I hope I have explained the question well and it is making sense. Suggestions are welcomed.
Issues with my player and enemy not being drawn on to the canvas, any ideas?
Programing Coderfunda August 06, 2024 No comments
function gameloop() {
// Clear the canvas
ctx.clearRect(0, 0, canvas.width, canvas.height);
// Draw background elements
// Set timeout to hide symbols after 5 seconds
bg.draw();
cloudBig.update(ctx);
cloudBig2.update(ctx);
backgroundLevel1.draw();
water.draw();
waterSmall.draw();
waterSmallTwo.draw();
palmTree.draw();
palmTree2.draw();
palmTreeSide.draw();
palmTreeSide2.draw();
// Draw the p1Symbol
playerUpdate();
p1Symbol.draw(); // Update game objects
p1Symbolp.draw(); // Update game objects
// p1update();
// p1pupdate();
p2Symbol.draw(); // Update game objects
p2Symbolp.draw(); // Update game objects
enemy.enemyMovement();
player.movement();
// Update hurtboxes
player.updateHurtbox();
enemy.updateHurtbox();
// Draw game objects
player.update();
player.draw();
enemy.update();
enemy.draw();
// Check collisions
attackCollision();
enemyAttackCollision();
// CollisionBlocks.forEach(block => {
// block.draw();
// });
// Request the next frame
window.requestAnimationFrame(gameloop);
}
// Start the game loop
gameloop();
I mentioned that ive tried rearranging my drawings. So not sure what's causing this issue.
How do I write a driver for Intel IRIS XE intergraded graphics in C?
Programing Coderfunda August 06, 2024 No comments
I tried doing a Google search on how to do it but nothing about driver development for Intel IRIS XE popped up, I asked Google Gemini and it only gave me a diagram of the chip's die and what section does what.
Leveraging Laravel's built in driver functionality
Programing Coderfunda August 06, 2024 No comments
https://christalks.dev/post/leveraging-laravels-built-in-driver-functionality-a3210023
If it's not something you've come across before, I'm sure it'll be something you can utilise in your applications. Hope you enjoy it and any feedback welcome! submitted by /u/chrispage1
[link] [comments]
Anyone using Laravel to build API products?
Programing Coderfunda August 06, 2024 No comments
I'm talking about APIs built to be consumed by customers (for example, with usage-based pricing), not APIs for internal services.
Do you know any of such businesses? submitted by /u/ggStrift
[link] [comments]
05 August, 2024
How to round inside corners in QR scanner view?
Programing Coderfunda August 05, 2024 No comments
Just updated from 6 UpTo 11
Programing Coderfunda August 05, 2024 No comments
First lesson was to not try to save money not paying for shift. It's more expensive to not pay for it lol. I will use it from now so I don't end outdated again because laziness.
So now, you guys tell me what I was missing out .
I can see from the update where the framework is leading to (light structure and less bloat in the default installation) and I agree with that direction, I think it even will be a lot more easier to do version upgrades because this. submitted by /u/Substantial-Reward70
[link] [comments]
Recommendations To Log All API Requests
Programing Coderfunda August 05, 2024 No comments
Just for the API, which is launching in a critical environment where logging and traceability is a significant factor.
We have a middleware for the API that effectively adds a UUID trace_id key to the Context, which works really well as we put that UUID in our responses for the client side to correlate also.
However, I don't want to just Log all request payloads and responses to files. I want to send them somewhere where I can at least search them using the trace_id.
Things like Graylog, Elasticsearch, Seq come to mind. However, I'm wondering what other solutions I have for this type of use case. Don't mind spending money, low maintenance, and easy of implementation is key. submitted by /u/AskMeAboutTelecom
[link] [comments]
A 3 Minute Overview of Data Validation in Laravel
Programing Coderfunda August 05, 2024 No comments
Active Sessions Card for Laravel Pulse
Programing Coderfunda August 05, 2024 No comments
The Active Sessions card for Laravel Pulse shows your application's total number of sessions, including Web and API users. Based on the pulse.active_session_threshold value, this card will display interactive color-coded indicators in the card based on these values.
This package includes the following main features with the initial release:
* Display active web sessions and percentage of users
* Display active API sessions (sanctum)
* Color-coded thresholds based on the configured session threshold (green, yellow, red)
* Passport support when only using one provider
To get started with this package, you can install it via Composer:
composer require vcian/pulse-active-sessions
Then you can configure the threshold using the pulse.php config file:
return [
// ...
'active_session_threshold' => 100,
];
Finally, add the pulse_active_session component to the Pulse dashboard.blade.php file:
{{-- ... --}}
You can learn more about this package, get full installation instructions, and view the source code on GitHub. To get started with Pulse, follow the setup guide in the Laravel Documentation.
The post Active Sessions Card for Laravel Pulse appeared first on Laravel News.
Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.
04 August, 2024
ReactJS: Passing variable to another component
Programing Coderfunda August 04, 2024 No comments
const [dirty, setDirty] = React.useState(false);
In another component I have:
const AddItemForm = ({ setAddItem, addItem, dirty }) => {
I am trying to update dirty (when the form is changed) via:
So I can use this changed state in my other component - but how do you change the state as when I use setDirty it isn't available.