New answers tagged

1

Although its a 3 years old thread, still I'm replying it thinking that it might be helpful to somebody. Table Structure Table_Offer -------- ID FK Name start time end time MandatoryGroup -------- ProductId (FK to product) MixGroup1 -------- ProductId (FK to product) MixGroup2 -------- ProductId (FK to product) Table_offerDetails --------------...


0

I think you should use directives for the DOM elements and controllers for interaction between these directives. DOM manipulation should only be done inside a directive. Fetching a text file could be done inside the controller, but it would be better if you did that through a service. Services can be used for reusable business logic/fetching data. You ...


6

I work on a code base in a compiled language (Scala) which is tens if not hundreds of thousands of lines long. The first thing commonly done in such situations is to break the application into microservices that usually max out at two or three thousand lines of code each, spread out among maybe 50 source files. Many are much smaller. Next, as others have ...


0

Not compiling everything after changing a single line in a single file is a big part of how we keep compile times low. This is partly what makes build management tools like Make or Gradle so much better for this than general purpose scripting languages like Bash or Groovy. That is, Make and Gradle provide easy syntax for defining dependencies, whereas Bash ...


0

Go's niche is really back-end services. While Go can certainly run your blog, its targeted purpose is to do the heavier lifting on the back-end where the design and coding part of the development cycle is typically more involved. So the 'inefficiency' of waiting for the compile isn't a big factor. Plus, there's some perspective involved. The code-compile-...


1

There's a widely used tool for Java which allows you to reload classed on the fly when they are recompiled. I've used it and it's reliable for the kind of thing you are talking about. Combine that with an IDE that compiles each class on saving (faster than I can blink,) it's basically just like what you describe. I don't know if anything like that exists ...


0

You should be able to host both on HTTPS in IIS, then apply a server name to the binding. After the binding is setup, IIS will do all the work for you.


3

Both solution are viable, they simply don't apply to the same use-cases. a) manipulate the DOM via JavaScript : This result in a more heavy first page, but after that you will use less bandwidth, because you will only fetch what you need, and not rebuild and send everything. And in the cases where you don't need to fetch anything, it will be really quick (...


1

With a little guidance from @RobertHarvey I found a StackOverflow answer about Presentation Models. A presentation model is a utility class that is used to render data on a screen or report. Presentation models are typically used to model complex data structures that are composed from data from multiple DTO’s. Presentation models often represent a ...


0

If I were you I'd start by utilising the "M" in MVC and abandoning the ViewBag: start creating view models. If you begin by creating a model for your grid sorting, filtering and paging you'll start see where the common functionality is and isn't, i.e. what is specific to a given grid and what is general. You don't have to go to the Repository pattern in ...


0

When you call an API through https, you can get the following answers: Internet is down. Cannot connect to the server. https failed to negotiate (after reaching the server). A nonsense answer when you use http in a Starbucks. The server tells you that the API is currently down. The API tells you that it isn't working right now. The API gives one of many ...


0

I don't think there is a definite right answer. It depends of course. If I were you I would think about what the ideal user experience would be when this happens. Then do whatever it takes in your application to make that happen. You could just throw an error and tell the user to try again later. Or if it's an issue that happens sporadically, just retry the ...


0

If you can't rely on the 3rd party API to give you a response (and you're accessing it synchronously) you can set a time-out. I would access the 3rd-party API on a separate thread (or even process) and wait for the response with a time-out set. If the time-out expires, just move on. Additionally, I had a very similar problem a while back. Feel free to check ...


0

If you're giving flow of control to the API the response is to wait until hell freezes over, or the user presses ctrl-alt-del. If you're calling it asynchronously the typical strategy is to timeout. If the API throws an exception, easy: clean up, log, and display the error. Whatever you do, don't fail quietly. I hate debugging things that fail quietly. ...


1

I see all websites (THE big ones) make both PHP and HTML in same page .. Do I need to make all my website pages as PHP and embedded HTML inside it ? The fundamental problem here is that you're seeing a thing that websites you perceive as being big ones and then you're assuming that's a good thing to do. It's not. PHP is terrible enough on its own; ...


0

Yesm all of these things are correct but in the end when every page is loaded they are all converted to an HTML formatting so basically PHP, Bootstrap, CSS, JS are just basically all additions with makes data entry or forums all possible but the real question is what will this be used for and how can we , you implement an infrastructure for storing all data ...


0

Yes you can avoid PHP inside HTML. Use PHP as an API. Load up the page with embedded JSON, and render out the page client side with JavaScript. Then, instead of requesting HTML/PHP via AJAX, request more info formatted as JSON.


2

Ahmed, Web pages can be built in just html. In fact, that's how the web started out: with just simple html pages, things we would call today "brochure-ware". The user requests a page and the server delivers a mixture of text and pictures, and then it's done. There is no interactivity, like individual preferences or searching a database. PHP came later ...


0

I would be cautious about simplifying what goes on under the hood of Angular.js to MVC, as there have been countless discussions about what MVC even is, and whether Angular implements MVC or MVVM or some other MV* paradigm. It's kind of become accepted in the Angular world that they implement Model-View-Whatever and leave it at that. Having said that, the ...


0

From the documentation, I am assuming that by "most templating systems", they are referring primarily to server-side templates which get rendered into a view. I feel comfortable making this assumption due to a later statement explaining why angular is different: "... the template ... is compiled on the browser. The compilation step produces a live view." And ...


2

You may have to modify the base template you are using for the static page generator to accomplish your goals. Add the javascript libraries/frameworks you need for the individual entries on the main template. Then, as you are creating your entries, add the relevant javascript code to the blog entry to perform the necessary interactions for your readers.


5

You're asking the classic multi-tenant question. Personally I would - and have - maintain a single copy of the application. It would look up the subdomain in the db to grab a site id, grab the info about the site, and show the relevant content. Templates and images can be stored by putting them into a directory named the same as their subdomain or site ...


1

You could also go for the middle ground here: use Parse Server + Parse Dashboard. You'll need to get familiar with it to set it up, but it's battle proven, and has many of the features you want: Maintained by Facebook for a very long time, and they're pretty good at authentication It's open source, has a large community, and follows semver, so should be ...


2

dynamically appending new code on the rendered page in a way that the changes would reflect on the other clients And this makes it possible to do XSS, mislead the users into providing confidential data such as passwords, and do lots of other cool stuff. You can't just let the users change the source code and run it, unverified, in other people's browsers. ...


0

Angular is a client-centric technology. Data is sent to an Angular application from the server, and most of the UI rendering takes place in the web browser. High user interactivity is promoted, because most of the UI development work takes place in Javascript, in the browser. Spring is a server-centric technology. The bulk of the page rendering is done ...


1

Usually you have to query DB every time you render a page. Q1 - Yes, you just have to select all items ordered by created date (well, you don't want to select ALL, but only how much you need for current page - see 'Pagination') Q2 - Yes. Same as above. This might not work exactly as you want, because SQL databases are not search engines. In SQL DB you can ...


1

I am not a lawyer but my understanding is that as long as you are not distributing the software, you don't need to do anything special. You are free to use it for commercial uses. This license was created before the concept of the cloud and the AGPL was created to address this loophole: http://www.gnu.org/licenses/why-affero-gpl.en.html



Top 50 recent answers are included