dimanche 1 février 2015

Using CDN to store images/videos for an email application

I am developing an application something similar in gmail service. User can post a message text content and able to attach media content (images gif/jpeg/png and gp3, video). Planning to use cdn to store media content.


Planning to develop html page similar compose in gmail service to let user to write text and attache media and finally send.


I wanted to



  • Let user upload content to cdn storage directly from Browser or App

  • Before storing, wanted to apply filtering logic to resize images if they are more than 1MB and reject if video size is more than 10MB


Getting more information how cdn works which is very generic. Looking for any specific code samples/APIs for uploading for the usecases described above.





How to trigger an event in web application backend?

I'm designing a Python Flask application, and want to have a program that run on the background. When something happen (such as expire of time of an object while the object itself is generated by web application), an event is triggered and change the database.


After searching i find Celery might do that, but i'm not sure. If it is the right direction, please tell me how to do that briefly. Thank you.





No "Expires" and no "Cache-Control" header set, yet "Last-Modified" or "ETag" are being ignored, why?

Chrome still loads the files from cache although the "ETag" changed and the "Last-Modified" is set to a newer date than the cached resource by the server. Why is that??





Deploying ASP Application



I start by saying that i new to ASP and have little experience with it.

I’m running on arvixe ASP shared windows hosting, and have a third party service

That I want to use in my software.

I took the Bin directory and put it in my website under the root directory.


Bin folder structure


This works and I get the login screen while pointing my web browser to the

Site Address, like: www.mysite.com.

But, I have other content that that is my homepage, etc… and I want to put

The Service in address like: http://ift.tt/1AevE17

So I opened a new folder [with FTP] named: LicensingService and put the bin

directory Content in it.

I got some problems with the web.config.

First, there are definitions that should be at the Root or top level,

So I took the web.config. and put it under my wwwroot.

Now I have problems with the SimpleRoleProvider: "Could not load file or assembly 'WebMatrix.WebData'..."


How should I make this the correct way ?

Do I must put all the bin folder directly in wwwroot ?

If so, how can people navigate to my home page ?

Should the \LicensingService directory be virtual ?

Why ASP is not finding the assemblies now ?


Thanks, Avi.


the web.config:





<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>

<connectionStrings>
<remove name="LicensingServiceConnection" />
<add name="LicensingServiceConnection" connectionString="Data Source=25.81.114.142;Initial Catalog=Regusers; Integrated Security=false; MultipleActiveResultSets=True; User Id=abcqte; Password=123456" providerName="System.Data.SqlClient" />
</connectionStrings>

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>
</entityFramework>

<appSettings>
<!-- Site/company identification settings. -->
<add key="RootUrl" value="http://ift.tt/K57Mif" />
<add key="SiteName" value="YourSite" />
<add key="SiteEmail" value="YourSite Support&lt;support@yoursite.com&gt;" />

<add key="SmtpServer" value="smtp.yoursite.com" />
<add key="SmtpPort" value="25" />
<add key="SmtpUsername" value="" />
<add key="SmtpPassword" value="" />
<add key="SmtpSsl" value="False" />

<!-- This Remove this line or set the value to "false" in production ! -->
<add key="Testing" value="false" />

<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="PreserveLoginUrl" value="true" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />

<add key="enableSimpleMembership" value="true" />

</appSettings>
<system.web>
<globalization culture="en-US" uiCulture="en-US" />
<compilation targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/ControlPanel/Account/Login" timeout="2880" />
</authentication>
<httpRuntime requestValidationMode="2.0" />
<pages validateRequest="false">
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
</namespaces>
</pages>
<!-- remove this in production -->
<customErrors mode="Off" />
<roleManager enabled="true" defaultProvider="SimpleRoleProvider">
<providers>
<clear />
<add name="SimpleRoleProvider" connectionStringName="LicensingServiceConnection" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData" />
</providers>
</roleManager>
<membership defaultProvider="SimpleMembershipProvider">
<providers>
<clear />
<add name="SimpleMembershipProvider" connectionStringName="LicensingServiceConnection" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData" />
</providers>
</membership>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
<remove name="Block1" />
<remove name="Block2" />
<add name="Block1" verb="*" path="App_Downloads/publicdownloadsample.txt" type="System.Web.HttpForbiddenHandler" />
<add name="Block2" verb="*" path="App_Downloads/restricteddownloadsample.txt" type="System.Web.HttpForbiddenHandler" />
</handlers>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
</assemblyBinding>

</runtime>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</DbProviderFactories>
</system.data>
</configuration>






Prevent images from moving (with a mouse) while browsing

When I am finished with the page. When its done. I want somehow to lock the images (for ex. header logo layer - try it out: http://www.lipanska.cz/ move with the header text EWITA). On the other side at https://www.google.com the logo is locked and I cant move with it.


How could i lock them? Thank you very much for your time!





Google site: search operator returning conflicting results


http://ift.tt/1yXGbXQ


Based on the above link, I am able to see the indexed pages. However, I see varying results as below.


Are they supposed to return different results based on http protocols and/or trailing slashes as in example below?



site:https://www.desiza.com returns 26,800 results
site:https://www.desiza.com/ returns 21,000 results
site:www.desiza.com returns 9640 results
site:www.desiza.com/ returns 4290 results


Which version is appropriate version? Thank you





Linking a domain to my bitbucket page

I followed the steps to host a website in bitbucket, http://ift.tt/1hHEyeG


Then I bought a domain in GoDaddy. And now I don't know how to proceed to link my bitbucket page to my domain.


There are ways to link Wix account to GoDaddy, see http://ift.tt/1D0H3kK


But is there a way to link my domain to my bitbucket page?