Search Results

Search found 7 results on 1 pages for 'yugal jindle'.

Page 1/1 | 1 

  • Should we have a database independent SQL like query language in Django?

    - by Yugal Jindle
    Note : I know we have Django ORM already that keeps things database independent and converts to the database specific SQL queries. Once things starts getting complicated it is preferred to write raw SQL queries for better efficiency. When you write raw sql queries your code gets trapped with the database you are using. I also understand its important to use the full power of your database that can-not be achieved with the django orm alone. My Question : Until I use any database specific feature, why should one be trapped with the database. For instance : We have a query with multiple joins and we decided to write a raw sql query. Now, that makes my website postgres specific. Even when I have not used any postgres specific feature. I feel there should be some fake sql language which can translate to any database's sql query. Even Django's ORM can be built over it. So, that if you go out of ORM but not database specific - you can still remain database independent. I asked the same question to Jacob Kaplan Moss (In person) : He advised me to stay with the database that I like and endure its whole power, to which I agree. But my point was not that we should be database independent. My point is we should be database independent until we use a database specific feature. Please explain, why should be there a fake sql layer over the actual sql ?

    Read the article

  • Quick and Good: ( Requirement -> Validation -> Design ) for self use?

    - by Yugal Jindle
    How to casually do the required Software Engineering and designing? I am an inexperienced developer and face the following problem: My company is a start up and has no fix Software engineering systems. I am assigned tasks with not very clear and conflicting requirements. I don't have to follow any designs or verify requirements officially. Problem: I code all day and finally get stuck where requirement conflicts and I have to start over again. I can-not spend a lot of time doing proper SRS or SDD. How should I: List out Requirements for myself. (Not an official document) How to verify and validate the requirements? How to visualize them? How to design them with minimum effort? (As its going to be with me only) I don't want to waste my time coding something that's gonna collapse according to requirement conflict or something! I don't want to compromise with quality but don't want to re-write everything on some change that I didn't expected. I imagine making a diagram for my thought process that will show me conflict in the diagram itself, then finally correcting the diagram - I decide my design and structure my code in terms of interfaces or something. And then finally start implementing my design. I am able to sense the lack of systematic approach, but don't know how to proceed! Update: Please suggest me some tools that can ask me the questions and help me aggregate important details. How can I have diagram that I talked about for requirement verification?

    Read the article

  • Does uwsgi workers share a common memory ? [ With Nginx ]

    - by Yugal Jindle
    I have configured my Nginx with Django uwsgi. When the django server starts, it reads a 5MB file from the hard-disk. Now, Without Nginx with Django default server python manage.py runserver = Runs immediately and starts serving pages. Problem: With Nginx as the server It takes very long time and several HTTP 504 before it start serving pages. So, How does uwsgi workers work with Nginx ? I have: 4 Workers 512 Threads each So, is the 5MB file getting read 512 * 4 times ? Is there a possible work around for this in Nginx / Uwsgi ?

    Read the article

  • Should we have a database independent SQL like query language in Django? [closed]

    - by Yugal Jindle
    Note : I know we have Django ORM already that keeps things database independent and converts to the database specific SQL queries. Once things starts getting complicated it is preferred to write raw SQL queries for better efficiency. When you write raw sql queries your code gets trapped with the database you are using. I also understand its important to use the full power of your database that can-not be achieved with the django orm alone. My Question : Until I use any database specific feature, why should one be trapped with the database. For instance : We have a query with multiple joins and we decided to write a raw sql query. Now, that makes my website postgres specific. Even when I have not used any postgres specific feature. I feel there should be some fake sql language which can translate to any database's sql query. Even Django's ORM can be built over it. So, that if you go out of ORM but not database specific - you can still remain database independent. I asked the same question to Jacob Kaplan Moss (In person) : He advised me to stay with the database that I like and endure its whole power, to which I agree. But my point was not that we should be database independent. My point is we should be database independent until we use a database specific feature. Please explain, why should be there a fake sql layer over the actual sql ?

    Read the article

  • Python : How to intercept a method call which does-not exists?

    - by Yugal Jindle
    I want to create a class that doesn't gives an Attribute Error on call of any method that may or may not exists: My class: class magic_class: ... # How to over-ride method calls ... Expected Output: ob = magic_class() ob.unknown_method() # Prints 'unknown_method' was called ob.unknown_method2() # Prints 'unknown_method2' was called Now, unknown_method and unknown_method2 doesn't actually exists in the class, but how can we intercept the method call in python ?

    Read the article

  • Python : How do you find the CPU consumption for a piece of code?

    - by Yugal Jindle
    Background: I have a django application, it works and responds pretty well on low load, but on high load like 100 users/sec, it consumes 100% CPU and then due to lack of CPU slows down. Problem : Profiling the application gives me time taken by functions. This time increases on high load. Time consumed may be due to complex calculation or for waiting for CPU. so, how to find the CPU cycles consumed by a piece of code ? Since, reducing the CPU consumption will increase the response time. I might have written extremely efficient code and need to add more CPU power OR I might have some stupid code taking the CPU and causing the slow down ? Any help is appreciated ! Update: I am using Jmeter to profile my webapp, it gives me a throughput of 2 requests/sec. [ 100 users] I get a average time of 36 seconds on 100 request vs 1.25 sec time on 1 request. More Info Configuration Nginx + Uwsgi with 4 workers No database used, using a responses from a REST API On 1st hit the response of REST API gets cached, therefore doesn't makes a difference. Using ujson for json parsing. Curious to Know: Python-Django is used by so many orgs for so many big sites, then there must be some high end Debug / Memory-CPU analysis tools. All those I found were casual snippets of code that perform profiling.

    Read the article

  • how to solve syntax error in procedure in mysql?

    - by Shooter
    Hi all, i am executing a procedure in mysql, procedure is- delimiter $$ create procedure getFacility (in id int, out MyFacility VARCHAR(200)) begin select Facility into MyFacility from facilities where FacilityID = id ; end $$ delimiter ; and it is giving error below- Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'end $$ delimiter' at line 1 (0 ms taken) how to solve this error? Thanks, Yugal

    Read the article

1