Monthly Archives: September 2013

  • 0
Google-AdSense-Android-App

Google‘s first official AdSense Android App, now on market !!

There have been a lot of third party android applications for users which provides the user access to the statistical data of their AdSense account.
But today is the date when the popular advertising platform Google AdSense, just launched on Google Play your Official Application for Android. As mentioned by the google,
The Google AdSense app provides an easy way to access key data from your AdSense account. Access reporting features anywhere, directly from your mobile phone. The first version of the app gives you access to: the key earnings information, top custom and URL channels, ad units and sites reports, payment alerts.
Although it is a largely useful application, all devices are not compatible with it which we can consider as one of the drawback of this application.  The application supports Android 4.0 and up.

  • 0
EXCEL-ADVANCED

How To Extract Excel Formulas

I had a spreadsheet in Excel 2007.  (I suspect the approach used here would also work in other versions of Excel, but I have not tried it.)  I wanted to print out the formulas used in each cell.  I did a couple of searches and wound up in a thread where they have advised me to create a module for the same. To add a new module to your excel file press Alt + F11.  Following is the code that I used to get the list of all the formulas used in the excel file.

Sub ListFormulas()

    ' constants
    Const ksDot = "."
    Const ksDoc = "_formula_doc"
    Const ksXLSX = "xlsx"

    ' declarations
    Dim I As Integer, J As Integer, K As Integer
    Dim L As Integer
    Dim iRows As Integer, iColumns As Integer
    Dim sName As String, sFileName As String
    Dim sNewName As String, sNewFileName As String
    Dim sCellName As String

    ' start
    '  source workbook
    With ActiveWorkbook
        sName = .Name
        sFileName = .FullName
        I = InStr(StrReverse(sName), ksDot)
        sNewFileName = Left$(sName, _
                       Len(sName) - I - 1) & ksDoc & 
                       ksDot & ksXLSX
        I = Application.SheetsInNewWorkbook
        Application.SheetsInNewWorkbook = .Worksheets.Count
    End With

    '  delete
    If Dir(sNewFileName, vbNormal) <> "" 
    Then Kill sNewFileName

    '  add
    Workbooks.Add
    Application.SheetsInNewWorkbook = I
    With ActiveWorkbook
        .SaveAs sNewFileName
        sNewName = .Name
    End With
    Workbooks(sName).Activate

    ' process
    With ActiveWorkbook
        For I = 1 To .Worksheets.Count
          ' format
          Workbooks(sNewName).Worksheets(I).Cells.NumberFormat
                        = "@"
          ' name
          Workbooks(sNewName).Worksheets(I).Name = 
                                         .Worksheets(I).Name
          ' formulas
          With .Worksheets(I)
            With .UsedRange
                iRows = .Rows.Count
                iColumns = .Columns.Count
            End With
            For K = 1 To iRows
               For J = 1 To iColumns
                   If .Cells(K, J).HasFormula Then
                     sCellName = .Cells(K, J).Address
                   Else
                     sCellName = ""
                   End If
               Workbooks(sNewName).Worksheets(I).Cells(K, J).Value = 
                       sCellName + .Cells(K, J).Formula

                Next J
             Next K
         End With
      Next I
  End With
    ' end

End Sub

  • 0
banner-javascript

Run javascript function as admin privileges

  • In Alfresco, create group, user, add user to group, set permission are allowed only
    to Admin group users.
  • Many times we get a requirement where we need to create group and users dynamically
    on some action.
  • Now javascript API are available to create group but works only for Admin group
    users.
  • I had a requirement to create groups dynamically when rule is executed. But rule was
    executed action taken by non-admin user.
  • So I created custom javascript API to run entire javascript function as Admin
    privileges.
  • For this you have to create one Java class which
    extends BaseScopableProcessorExtension. BaseScopableProcessorExtension class is extended whenever you want to create
    custom javascript API.
  • Register your javascript API in *-context.xml
  • Then use your API in your javascript.
  •     public class RunAsAdminUtil extends BaseScopableProcessorExtension {
          /** 
          * This method runs javascript function with Admin privileges 
          * @param func 
          *
          */ 
          public void runAsAdmin(final Function func) { 
            final  Context cx = Context.getCurrentContext(); 
            final Scriptale scope = getScope();
            RunAsWork raw = new RunAsWork() { 
              public Object doWork() throws Exception {
                func.call(cx, scope, scope, new Object[] {}); return null; 
              } 
            };
            AuthenticationUtil.runAs(raw,
            AuthenticationUtil.getSystemUserName()); 
          } 
        }
    

    Below is the *-contex.xml entry,   runAsAdminUtil Below is the code of javascript where you would be using custom created javascript api to run function with admin privileges
    function main() { if
    (!people.isAdmin(person)) { //if current logged in user is not admin
    run function with admin privileges
    runAsAdminUtil.runAsAdmin(createGroupsDynamically); }else{
    createFolderStructureFromTemplate(); } } var createGroupsDynamically =
    function createGroupsDynamically() { var name =
    document.properties.name; var TEST_READ = name + '_read'; var
    TEST_WRITE = name + '_write'; people.createGroup(TEST_READ);
    people.createGroup(TEST_WRITE); } main();


  • 0
liferay_banner_0

Embedding a portlet in to a web content portlet

  • Create a portlet with any name, EX. “portlet-embedded”.
  • Write your code in portlet (view.jsp) to be displayed.
  • This is a list item number 3
  • This is a list item number 4
  • Create a portlet with
  • Write your code in portlet (view.jsp) to be displayed.
  • After adding your code to the portlet deploy the portlet so it is available for to use in web content.
  • Adding web content on pag
  • Go to dock bar and select Addbutton and click Web Content Display so it’s add Web Content Display portlet on to your page.
  • After adding web content to page now add the content to web content display by clicking Add Web Content button of Web Content Display portlet.

Code snippet

   <div id=“div-id”>

      <div id=“data-id”>

Lorem Ipsum is simply dummy text of the printing
and typesetting industry. Lorem Ipsum has been the
industry’s standard dummy text ever since the 1500s,
when an unknown printer took a galley of type and
scrambled it to make a type specimen book.

</div>

<div id=“embedded-div-id”>

            <runtime-portlet name=”portletembedded_WAR_portletembeddedportlet”

instance=”” queryString=””/>

</div>

   </div>

  • The Red colored line is for to embed a portlet in to web content
    • name=”portletembedded_WAR_portletembeddedportlet” the name of your portlet to be embedded with.
    • instance=”” give instance name other wise blank.
    • queryString=”” give queryString if any other wise blank.
  • After adding this save the web content with proper name.
  • So it display the web content with your data plus the portlet with their data as shown below.

embedded-portlet


  • 0
SEO-BANNER_0

Why Optimize Your Website For Search Engines?

To run a website will definitely require you to apply Search Engine Optimization. The main reason of having a website is that people can access it and these people will be your traffic on your website. If nobody visits your website then there is no reason to have a specific website at all. Presently, most of the traffic is generated by search engines.

Here are some reasons behind Search Engine Optimization:
  • People have different ideas on how to search for what they need. So there is no single keyword that will pertain to a certain query, product or services. Optimizing can solve this problem.
  • Most people who use internet remain confident in organic results. If your website does not appear in the top five of the list then the probability of being visited by the user is greatly diminished.
  • You need to be proactive and innovative to stay ahead of your rivals in business.
  • You should be there where your competitors are. Or else, you will be left behind in ranking while your competitors are gaining profits that are brought about by the huge volume of traffic.
  • SEO will help in getting larger share of the market.
  • Optimizing your website with the good content will attract more people to visit your site and stay there for longer period of time.
  • There is no need of getting charged for per click if you are SEO because clicks that are generated by organic listings are free of charge.
SEO is a very significant way of getting more sales from your targeted market. However, before you sign up any SEO Professional for your website, study their credentials first.

  • 0
blog-1

Android Device Manager: A Google tool to track lost smart phones

After the initial sinking feeling when you realize you’ve lost your phone, it’s important to react swiftly to see whether you can retrieve it or at least cover your bases in terms of changing all of your passwords and logins.
Last week, the Google has finally announced a service that does what most other companies are already doing. It would allow users to remotely manage, locate, block, or wipe their misplaced devices. This new service will be named as “Android Device Manager” which will be designed to plug physical security holes, and will be available later in August. Having an official service makes more sense and it would be great if Google integrates it directly in the operating system with the next Android version.
According to a blog post on official Android Blog, this tool will be able to:
Locate and ring your misplaced device. It allows you to quickly ring your phone at maximum volume, even it’s been silent. Also, in the event that your phone or tablet is out of earshot (say, at that restaurant you left it at last night), you can locate it on a map in real time.
Protect your personal information and data. The more stressful thing is not losing the device but it is about your personal data ending up in the wrong hands. With the help of ADM, you can now quickly and securely erase all of the data on your device. Personally, it’s enough for me. I’ve never used an anti-theft app for my Android devices, but if my phone were stolen, being able to quickly initiate a remote wipe would give me peace of mind. I’d generally have little / no hope of getting it back in such a scenario, anyway.
You’ll manage it through Google Play on the web, and there will be an Android app, too. ADM will be integrated with Google Play Services, and at this point, it’s not clear how robust the protection’s survivability will be in the event of theft.
We’re not sure why Google jumped the gun early and made the announcement, even though the service is still awaiting a launch. It could have announced it when the service was ready.
According to some users and reports ; like Reddit, XDA, and other forums, Android Device Manager has already begun to roll out to users, The functionality is part of Google Play Services, which means it will be automatically and silently added to all devices running Android 2.2 and higher.
To check if the new functionality hit your device, navigate to Settings > Security, where you should find a section called Device Administrators. There, you should see Android Device Manager.