Best Practice for Developing Core Functions in Symfony2? - function

I am an experienced Symfony user and have started using Symfony2 and absolutely love it. A big thank you to Fabien and the guys over at Sensio.
I am pretty much there now in terms of developing in Symfony2 thanks to the documentation available, but there is one area in particular that I am still not 100% sure on.
I have a number of core functions that I want to use in different areas of the application and just want to know what the best practice for this is?
I am currently creating a bundle that has a number of functions in that handles the processing of images.
Is this the best way to do this and if so how do I then use or include these functions across other bundles?

You could just import the classes you want to use from your image handler bundle, but the way I would go about it is to register one or more services (like an image manager or thumbnail generator or whatnot) from your bundle so that the functionality you are creating will be available through the DIC for the entire application to use.

Related

Is there a way to import Polymer 3 components in Polymer 1?

I have just received a legacy project which was implemented using Polymer 1. For some reasons, I have a plan to change it to Polymer 3. There are lots of custom components. Also, it is a huge project and I want to gradually transform it step-by-step. My plan is that I want to change the components first and import them to the old project. When all components are finished, I will go for the rest of the project.
I want to ask if it is possible to take this approach and how? I have searched through the Internet but I cannot find any recommended approach in this case. If there is other recommended method, please tell me.
Thank you in advance!
Sorry but the answer is no you canĀ“t. You can load Polymer as library only once (It is using the same namespace) per browser window so you must decide which version to use. The only way i think i will be possible is with an iframe but i guess that is not a suitable way for you.

tvOS: any ready-made REST API component?

Before i start exploring the deep ends of tvOS, I'd rather turn to the community and get expert advice...
I am planning to write afwo-headed app :
First leg would run from FileMaker Go SDK given the simplicity to f development and straightforward database management.
Second leg would need to be an Apple tv component which only needs to display formatted text on screen, which is sent from the mobile bit described earlier.
Based on technologies i know so far my idea is to use FileMaker go ability to make http get/post requests to a RESTful service. Hence the question: is there anyway to run any such REST service from tvOS which will eventually display formatted text on screen based on requests pushed by mobile app ?
Does that even make any sense or, is there any more 'native' ways to achieve such stuff ?
Thanks
Cool project. Have a look at https://developer.apple.com/reference/tvmljs or search for TVML and TVJS.
Have you tried atvjs framework for building TVML apps? It lets you build and quickly prototype apps without much noise, abstracting the underlying hassles and complexities of a conventional TVML app.

Which technologies are advised to use for developing the following project?

Two years ago I developed an admin panel using winFroms that is used to configure different settings for specific users, create/remove users etc. This information is retrieved and saved to a SQL Database server.
I want to make this panel accessible through web browsers. I already have a REST API that will communicate with the database.
My question is: which technologies are the best to make this panel?
I've come across WebForms, MVC, HTML with Angular, jQuery etc., or with SPA.
I would appreciate it if someone can enlighten me with this matter. I know its not really a specific programmatic question, but there are so many different approaches that is difficult to find the right or best way.
I guess you already know a lot of .NET so if I was you I would just use a WebForms or MVC project and then call some jQuery on the api to handle the CRUD operations. But if you wanna try something completely new then use Angular.

MVVMCross View blocked by sqlite call

I am trying to build a fairly simple sqlite database based mobile app using mvvmcross and Portable class libraries. The database I have running is fairly large so querying it takes enough time where I don't want the UI to get blocked while running queries.
The way I currently have it set up is in a few classes based on the mvvmcross n+1 tutorials n=10 tutorial. I have two services that manage the look-ups for the two entities.
How can I perform these database calls on a separate thread and have the view be updated when completed. I assume that this capability exists within mvvmcross I just haven't been able to track down the documentation or any tutorials on it specifically.
Any help pointing me to the right direction would be much appreciated.
Thanks,
JH
Portable class libraries do give you access to the ThreadPool - so you could use that to marshall the work onto a background thread? http://msdn.microsoft.com/en-us/library/system.threading.threadpool.queueuserworkitem.aspx
Alternatively, if you have a setup/configuration which allows the TPL to be used in your library, then you could use the TaskFactory or async and await to provide some background threading - this is probably the better long-term route, but getting this setup and working initially may take longer as Xamarin's async support is very new and it's PCL support is changing.

Jump-starting web development

I wrote a prototype for my software in Python as a desktop client-server program, but I want to do the real version as a web service. (I have seen the light? much better deployment and reduced cost) Trouble is, I don't know web development.
I already did something webdev-ish: I have a page with a form on it, that when submitted Apache will run my Python script, which will do some server-side tasks and then send the result on a new page back to the user. Its a very simple tool (doesn't use any DB or framework), but I suppose that's the basic idea of web-based services... I think. To me that was a workaround, I did not realize it is webdev-ish.
So I have a basic idea of how it works, and about 8 years of programming behind me, but I need to learn:
How to design web sites (XHTML and CSS?)
Javascript and AJAX
More advanced features of databases (Postgresql)
I'm thinking Python/Django is a safe bet.
Any suggestions on where to start? I'm not the type who has the patience to read a book; I would rather jump in and build something simple first, then bigger and bigger stuff, but I can't seem to get my head around learning web design - I still format everything with tables.
Cheers and thanks
Check out Django. Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
There will be a learning curve, but you might as well learn how to do it right the first time. Go through the documentation, and start building small Django applications. There are tutorials on the Django website.
And yes, you will have to learn HTML and CSS anyway.
Tables are not evil, by the way. You don't have to learn your first website with CSS, but you will need to learn correct CSS layout sooner rather than later. There are free CSS templates out there you can use, which makes the correct use of CSS much easier.
I only got slightly into Django, but I hear good things, so stick with it if you like the approach... inheritance & templating language
XHTML blocks just need to not overlap (markup container rule, good XML syntax with contained elements closing before new ones are begun). Honestly the simplest & most common approach to start web layout is PHP, so I suggest that as first alternative since it is so template-centric.
my favorite CMS is ZOPE, built and used with Python for scripting. Zope3 is more like Django, Zope2 I use more still (Python 2.4.x) has some internal syntaxes and methods to grapple with at first, but if you wish to try it I have a basic site editing framework.
the advantage is the object database hierarchy is just like site structure, inheritance of scripts, content objects (HTML chunks & contextual values), properties... so duplication is minimized, the whole site can be a simple template, reuse & extension maximized. navigation scripted, archive by month & listing contents scripted, footer once, sidebar inherited throughout site - override by cloning into subdirs and editing or specifying object/property for local instance closest to the URL path then seeking up to root.
users can have roles in sections, XML-RPC/HTTP/FTP all ZOPE methods including user-defined, so rich clients can workflow media effectively. batch process media uploads with default containers for each item and metadata (filename, type extension) so users get right to their details. ZOPE can host files or static, remote, whichever, so long as the app knows where to find them (one base property for the app or project root)
if you get into Django there is the ZODB standalone library part of ZOPE for persistent storage only, no ORB