اذهب إلى المحتوى

Mohamed Farahat

الأعضاء
  • المساهمات

    123
  • تاريخ الانضمام

  • تاريخ آخر زيارة

كل منشورات العضو Mohamed Farahat

  1. مرحبا, I've just completed this project, and I would love to hear your honest opinions and any suggestions for further improvement. Thank you git clone : https://github.com/Hamadabcn/Automated_teller_machine.git Automated_teller_machine.rar I may have changed the PIN during testing, so if the default '1234' doesn't work, try '1981'. I've been switching it to ensure everything functions properly Notice how when you quit and reopen the program, all the transaction history is saved, and you can view it by simply pressing 'Show History'
      • 1
      • أعجبني
  2. مرحبا, ما رأيكم في اللعبة و كيف يمكن تحسينها؟ you need pygame: pip install pygame and to run the game py main.py my_number_guess.rar
  3. Hello, did you get to play the game pip install pygame python main.py try it and tell me what do you think If pip install python does not work try: py -m pip install pygame then py main.py
  4. git clone https://github.com/Hamadabcn/2048.git Navigate to the project directory: cd 2048 Run the game: py main.py How to Play Use the arrow keys to move the tiles. When two tiles with the same number touch, they merge into one. The goal is to create a tile with the number 2048. git clone https://github.com/Hamadabcn/2048_game Navigate to the project directory: cd 2048 Run the game: py main.py How to Play Use the arrow keys to move the tiles. When two tiles with the same number touch, they merge into one. The goal is to create a tile with the number 2048. download the game pip install pygame then in your terminal write py main.py and the game will start, then use the arrows the join the numbers and if your are lucky you will get 2048 and you will win the game
  5. I have added sound effects to the game but I cannot figure out where the problem is in the logic, thank you 2048.rar
  6. أصدقائي، ما رأيكم في هذه اللعبة وكيف يمكن تحسينها بشكل أفضل؟ شكرًا لكم 2048.rar
  7. مرحبًا فريق أكاديمية حسوب، أود أن أعبر عن خالص شكري وامتناني لكم جميعًا على الدعم الكبير والتفاني الذي أظهرتموه خلال دورة تطوير التطبيقات باستخدام Python. كانت تجربة التعلم رائعة ومثمرة بفضلكم. لقد استفدت كثيرًا من الدورة، وتقدمت بشكل ملحوظ بفضل التوجيهات والنصائح التي كنتم تقدمونها باستمرار. كنتم دائمًا موجودين لمساعدتي وحل المشاكل التي واجهتها، وهذا كان له تأثير كبير على تقدمي وتحقيقي لهذه الشهادة. أشكر كل فرد من فريق أكاديمية حسوب على المجهودات الكبيرة والتفاني في العمل لضمان حصولنا على تجربة تعليمية ممتازة. تعاملكم اللطيف والدعم المستمر كانا محل تقدير كبير لدي. أتطلع لمواصلة التعلم والتطوير، وأرجو لكم جميعًا كل التوفيق والنجاح في مسيرتكم. تحياتي وتقديري، محمد فرحات
      • 4
      • أعجبني
      • شكرًا
  8. django_store.rar
  9. {% extends 'base.html' %} {% load i18n my_filter %} {% block content %} {% include 'common/page_title.html' with title=_('Checkout') %} <div class="container my-5"> <div class="row bd-highlight"> <div class="col-md-12"> <div class="alert alert-success py-3"> <h3 class=" text-center"> {% trans 'Amount to pay' %} </h3> <h3 class=" text-center"> {{ cart_total|currency }} </h3> </div> </div> <div class="col-12"> <h4 class="my-3"> {% trans 'Your information' %} </h4> <div class="card"> <div class="card-body"> <form id="form-user-info"> {% csrf_token %} <div class="row"> <div class="col-md-6"> <div class="mb-3"> <label for="firstNameInput" class="form-label">{% trans 'First Name' %}</label> <input type="text" class="form-control" id="firstNameInput" name="first_name" required> </div> </div> <div class="col-md-6"> <div class="mb-3"> <label for="lastNameInput" class="form-label">{% trans 'Last Name' %}</label> <input type="text" class="form-control" id="lastNameInput" name="last_name" required> </div> </div> </div> <div class="mb-3"> <label for="emailInput" class="form-label">{% trans 'Email' %}</label> <input type="email" class="form-control" id="emailInput" name="email" required> </div> </form> </div> </div> <h4 class="my-3"> {% trans 'Payment Method' %} </h4> <div class="row"> <div class="col-md-6"> <div class="card" role="button" onclick="createPaypalSession()"> <div class="card-body text-center"> <p> {% trans 'Paypal' %} </p> <i class="lni lni-paypal-original fs-1"></i> </div> </div> </div> <div class="col-md-6"> <div class="card" role="button" onclick="createStripeSession()"> <div class="card-body text-center"> <p> {% trans 'Credit Card' %} </p> <i class="lni lni-credit-cards fs-1"></i> </div> </div> </div> <div class="col-md-12"> <div id="payment-form-container"> <div id="stripe-card" class="card my-3 p-3" style="display: none"> <form id="payment-form"> <div id="payment-element"> </div> <button id="stripe-submit" class="btn btn-primary mt-3"> {% trans 'Pay Now' %} </button> </form> </div> </div> <div id="paypal-card" class="card my-3 p-3" style="display: none"> </div> </div> </div> </div> </div> </div> {% endblock %}
  10. مرحبا, I have a small problem in my urls can you please help from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static from django.conf.urls.i18n import i18n_patterns # Base URL patterns urlpatterns = [ path('i18n/', include('django.conf.urls.i18n')), # Language switching ] # Internationalized patterns with i18n_patterns urlpatterns += i18n_patterns( path('admin/', admin.site.urls), # Admin URLs path('checkout/', include('checkout.urls')), # Checkout URLs path('blog/', include('blog.urls', namespace='blog')), # Blog URLs path('', include('store.urls')), # Store URLs prefix_default_language=True, # Disable prefix for default language ) # Serve media files during development if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if this is True prefix_default_language=True then stripe does not accept payments and when its false then it accepts payments but the page loads without a language prefix and it does not load right I need the page to load with http://127.0.0.1:8000/en/ and not http://127.0.0.1:8000/ I have checked everything the settings file and still, thank you
  11. Just got it thank you {% load static %} {% load i18n %} <!DOCTYPE html> <html lang="en" class="h-100" dir=""> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>{% trans 'App Name' %}</title> <script defer src="{% static 'js/819.2ec26ef5.js' %}"></script> <script defer src="{% static 'js/app.0c66f515.js' %}"></script> <link href="{% static 'css/819.css' %}" rel="stylesheet"> <link href="{% static 'css/app.css' %}" rel="stylesheet"> <script src="https://js.stripe.com/v3/"></script> <!-- Add style for blog link --> <style> /* Style for the blog link */ header a.blog-link { font-size: 1.5rem; /* Larger font size */ color: #4CAF50; /* Green color */ font-weight: bold; /* Bold text */ text-decoration: none; /* Remove underline */ margin-right: 20px; /* Adjust spacing if needed */ } </style> </head> <body class="d-flex flex-column h-100 bg-light"> <!-- Header --> <header> <a href="{% url 'blog:blog_home' %}" class="blog-link">{% trans 'Blog' %}</a> </header> <main> {% block content %} {% endblock %} </main> <!-- Footer --> {% include 'partials/footer.html' %} <!-- Scripts --> <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> <script src="{% static 'js/main.js' %}"></script> <script src="{% static 'js/stripe.js' %}"></script> </body> </html>
  12. السلام عليكم how can I add a link to the blog page in the main page thank you django_store.rar
  13. Data types such as images and text can be used in machine learning without necessarily relying on deep learning. However, the choice depends on the tasks at hand and the complexity of the data. Deep learning, a subset of machine learning, is often more effective in processing images and text due to its ability to extract complex patterns. Deep Learning: More effective for handling complex images and text but requires significant computational resources. Traditional Machine Learning: Can be used with simpler images and text or when clear features can be manually extracted or processed using conventional data processing techniques.
  14. Efficiency and Productivity: Python is designed to be easy to read and write, which increases programmers' productivity and allows them to complete projects faster. This ease allows programmers to focus on solving problems rather than getting bogged down in the intricacies of the language. Libraries and Frameworks: Python provides a vast array of libraries and frameworks that cover a wide range of applications, from machine learning and artificial intelligence to web development and data analysis. Using these libraries can help programmers achieve advanced results more quickly without having to reinvent the wheel. Language Strength: Python is powerful enough to handle large and complex projects. Major companies like Google, Facebook, and Netflix use it for their critical projects. Versatility and Multiple Applications: Python is used in a wide range of fields, including web development, data analysis, machine learning, automation, and more. This versatility gives programmers a lot of flexibility in choosing projects and specializations. Community and Support: Python has a large and active community of programmers, which means there are plenty of resources and support available for programmers, whether they are beginners or professionals. In contrast, languages like C and C++ offer certain advantages such as high performance and complete control over memory, which can be necessary for some applications like embedded systems or game development. However, learning and using these languages require more effort and a deeper understanding of technical details. Ultimately, strength and weakness are not determined solely by the language used but by how it is used. A good programmer is someone who knows how to choose the right tool for the task and uses it efficiently to achieve their goals.
  15. وعليكم السلام Deep learning is a subset of machine learning that focuses on neural networks. Neural networks are the foundation of deep learning. They consist of interconnected layers of artificial neurons, which process and learn from data. Deep learning models, such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs), excel at tasks like image recognition, natural language processing, and speech synthesis. In summary, deep learning encompasses neural networks, but it extends beyond them to include complex architectures with many layers, enabling powerful representations and feature extraction
  16. وعليكم السلام! Python is not necessarily a language for weak programmers. On the contrary, Python is a powerful and versatile programming language: Ease of Learning: Python is beginner-friendly. You can quickly start writing programs and grasp the basics Rich Libraries: Python boasts a large collection of ready-made libraries. For example, NumPy for scientific and mathematical computing, Pandas for data analysis, Django for web development, and more. These libraries accelerate development. Expressive Syntax: Python’s clean and readable syntax allows developers to express ideas concisely. It emphasizes code readability, making it easier to maintain and collaborate on projects. Community and Support: Python has a vibrant community. You’ll find extensive documentation, tutorials, and forums to help you along the way. In contrast to C and C++, Python abstracts low-level details, making it an excellent choice for various tasks.
  17. وعليكم السلام Understanding the mathematical equations associated with models can be helpful for comprehending how each model works and customizing its usage effectively. However, it’s not necessary to memorize all the equations in detail. In fact, you can rely on programming libraries and available tools to execute these equations instead of memorizing them manually. For example, in the case of Linear Regression, the main equation is: [ y = \beta_0 + \beta_1 x ] Where: (y) represents the target value (dependent variable). (x) represents the independent variable. (\beta_0) and (\beta_1) are the regression coefficients. As for the RandomForestClassifier model, it relies on an ensemble of decision trees and doesn’t have a specific mathematical equation in the same way.
  18. وعليكم السلام The Linear Regression model and the RandomForestClassifier model differ in their use cases and the contexts where they are most beneficial.: 1Linear Regression: The Linear Regression model is used when we assume a linear relationship between the dependent variable (target) and the independent variables (predictors). It is suitable for continuous numerical data and can be used to predict target values using a straight line. Example: It can be used to predict house prices based on house size. 2Random Forest Classifier: The RandomForestClassifier model is used for classification, not continuous value prediction. It relies on an ensemble of decision trees and combines their predictions for classification. It is suitable for categorical data (such as classifying into specific categories). 3General Considerations: The choice of model depends on the nature of the data and the goal of the analysis. If you want to predict continuous values, Linear Regression is the appropriate choice. If you want to perform classification, RandomForestClassifier is the suitable choice.
  19. وعليكم السلام! In the scikit-learn library, the normalize parameter is not available in the LinearRegression model. The LinearRegression model is used to fit a linear model with coefficients w = (w1, ..., wp) to minimize the sum of squared residuals between observed targets in the dataset and the predicted targets from the linear approximation If you need to apply normalization to your data before using the LinearRegression model, you can use the normalize function from scikit-learn to normalize the data. This function helps standardize the data and avoids issues related to varying scales.
  20. مرحبا class Board: def __init__(self, board): self.board = board def __str__(self): board_str = '' for row in self.board: row_str = [str(i) if i else '*' for i in row] row_str.join(board_str) def find_empty_cell(self): for row, contents in enumerate(self.board): try: col = contents.index(0) return row, col except ValueError: pass return None def valid_in_row(self, row, num): return num not in self.board[row] def valid_in_col(self, col, num): return all(self.board[row][col] != num for row in range(9)) def valid_in_square(self, row, col, num): row_start = (row // 3) * 3 col_start = (col // 3) * 3 for row_no in range(row_start, row_start + 3): for col_no in range(col_start, col_start + 3): if self.board[row_no][col_no] == num: return False return True def is_valid(self, empty, num): row, col = empty valid_in_row = self.valid_in_row(row, num) valid_in_col = self.valid_in_col(col, num) valid_in_square = self.valid_in_square(row, col, num) return all([valid_in_row, valid_in_col, valid_in_square]) def solver(self): if (next_empty := self.find_empty_cell()) is None: return True for guess in range(1, 10): if self.is_valid(next_empty, guess): row, col = next_empty self.board[row][col] = guess if self.solver(): return True self.board[row][col] = 0 return False def solve_sudoku(board): gameboard = Board(board) print(f'Puzzle to solve:\n{gameboard}') if gameboard.solver(): print(f'Solved puzzle:\n{gameboard}') else: print('The provided puzzle is unsolvable.') return gameboard puzzle = [ [0, 0, 2, 0, 0, 8, 0, 0, 0], [0, 0, 0, 0, 0, 3, 7, 6, 2], [4, 3, 0, 0, 0, 0, 8, 0, 0], [0, 5, 0, 0, 3, 0, 0, 9, 0], [0, 4, 0, 0, 0, 0, 0, 2, 6], [0, 0, 0, 4, 6, 7, 0, 0, 0], [0, 8, 6, 7, 0, 4, 0, 0, 0], [0, 0, 0, 5, 1, 9, 0, 0, 8], [1, 7, 0, 0, 0, 6, 0, 0, 5] ] You should use .join() to join the items in row_str with a space and add the result to the current value of board_str. What is the problem here I cannot see it, thank you
  21. def main(): input_string = 'aLongAndComplexString' print(input_string) Sorry, your code does not pass. Keep trying. You should call convert_to_snake_case() inside the main() function and pass 'aLongAndComplexString' as input to the function. Just got it thank you for your help def main(): convert_to_snake_case() my_function("Input String") print(convert_to_snake_case('aLongAndComplexString'))
  22. مرحبا, I've been stuck on this problem for a while. Could someone help me, please? Thank you in advance def convert_to_snake_case(pascal_or_camel_cased_string): snake_cased_char_list = [] for char in pascal_or_camel_cased_string: if char.isupper(): converted_character = '_' + char.lower() snake_cased_char_list.append(converted_character) else: snake_cased_char_list.append(char) snake_cased_string = ''.join(snake_cased_char_list) clean_snake_cased_string = snake_cased_string.strip('_') return clean_snake_cased_string def main(): pass Inside the main() function, replace pass with a convert_to_snake_case() call. Pass the string 'aLongAndComplexString' as input to the function and print out the output using the print() function.
×
×
  • أضف...