Ir al contenido principal

Entradas

Mostrando entradas de 2014

BI - SSIS ( Basics III )

Merge Join Transformation Left outer join : Includes all rows from the left table, but only matching rows from the right table. You can use the  Swap Inputs  option to switch data source, effectively creating a right outer join. Full outer join : Includes all rows from both tables. Inner join : Includes rows only when the data matches between the two tables.

BI - SSIS ( Basics II )

First Steps to create a Package\ Lessons on video are on http://www.wrox.com/WileyCDA/Section/id-814197.html 1) Create a Connection Manager This will create a connection for the project or the entire solution. This can e change in the properties. 2) Define the Control Flow Define the tasks Recommendation - Change the default name for something more explicit 3) Package Encryption The XML by default have a default encryption using Windows user key To change use, Properties Panel -> EncryptSensitiveWithUserKey Review the encryption when deploy in a productive environment 4) Upgrade your package Variables In the blank space, left click and select Variables. Then some window will be open to declare the variables. Script Task Examples of code: In Visual Basic, creating a variable Dts.Variables(“strFileName”).Value = strInternal In Visual Basic, reading default variables. Dts.Variables(“strFileName”).Value = “newvalue” M...

BI - SSIS ( Basics I )

SSIS - Basic Concepts Tasks Bulk Insert Task—Loads data into a table by using the BULK INSERT SQL command. Data Flow Task—This is the most important task that loads and transforms data into an OLE DB Destination. Execute Package Task—Enables you to execute a package from within a package, making your SSIS packages modular. Execute Process Task—Executes a program external to your package, like one to split your extract file into many files before processing the individual files. Execute SQL Task—Executes a SQL statement or stored procedure. File System Task—This task can handle directory operations like creating, renaming, or deleting a directory. It can also manage file operations like moving, copying, or deleting files. FTP Task—Sends or receives files from an FTP site. Script Task—Runs a set of VB.NET or C# coding inside a Visual Studio environment. Send Mail Task—Sends a mail message through SMTP. Analysis Services Processing Task—This task processes a SQL Server A...

AngularJS ( Read parameters from URL)

Read parameters from URL Create a module  The important part is the function that receive the $locationProvider var app = angular.module('tagStatus', [], function ($locationProvider) {     $locationProvider.html5Mode(true); }); Create the function that is consider as Controller, in this case the name is  QueryCntl The  location.search() find the parameter, in this case  'page' function QueryCntl($scope, $location) {     $scope.target = $location.search()['page']; } In the HTML  Include the Module and Controller  Display the parameter  <div class="form_message" ng-app="tagStatus" ng-controller="QueryCntl as ctrl">                   {{target}} </div>

Android Architecture ( Synchronization and Scheduling )

Java Classes ReentrantLock A reentrant mutual exclusion lock that extends the built-in-monitor lock capabilities ReentrantReadWriteLock Improves performance when resources are read much more often than written Semaphore A non-negative integer that controls the access of multiple threads to a limited number of shared resources ConditionObject Block thread(s) until some condition(s) becomes true CountDownLatch Allows one or more threads to wait until a set of operations being performed in other threads complete Considerations ReentrantLock have lower overhead than ReentrantReadWriteLock ReentrantReadWriteLock may enable more concurrency on multi-core or multi-processor hardware ConditionObject & Semaphore have higher overhead than ReentrantLock & ReentrantReadWriteLock ConditionObject & Semaphore are more expressive & more flexible ConditionObject can be used to lock a thread to keep other threads out of a critical section ...

AngularJS (Dependencies / Services)

Dependency To use the functionality from one module inside another module. Create your first module Add your module inside your second module inside ['first_module'] If you did your first module in another file then import your file in your html <script src="product.js"/> Service Give functionality like: Fetching JSON data from a web service with $http Logging messages to JS console with $log Filtering an array with $filter All built-in Services start with dollar sign $ Service   $http  Make an async request to a server $http( { method: 'GET' , url: '/products.json' } ) ; Another way is $http.get( '/products.json' , {  apiKey: 'myApiKey'  } ) ; In both cases return a Promise object with .success() and .error() In this image appear how to declare the services in a Controller Then invoke our service How to manipulate the result Additional Options ...

AngularJS (Directives IV )

Ng-include This directive include another html file Custom Directives You can create your own directives as elements or attributes. *Tip: Use Elemente directives for UI widgets and Attribute Directives for mixin behaviors as a tooltip. Element Directive In this case this directive is created as an Element that include an html page Attribute Directive Use a Controller in a Directive You need to use: The keyword " controller " to specify the functionality  The keyword " controllerAs " to specify the alias Then use in the custom directive without ng-controller, because the controller functionality is defined in the new directive

AngularJS ( Form)

Form Turn off Html Validations Inside the tag <form> add the attribute novalidate Angular Validations Add the attribute  required  in each element Review validation To validate your form use in the ng-submit="reviewName .$valid " You can print if the form is valid as {{formName .$valid }} Style for validations When use the validations Angular pass through some styles So only you have to define your style Type of validations

AngularJS (Directives III )

Ng-model Binds the form element value to the property Example: In this case when type in the textarea the value is reflected in the blockquote Other examples: Ng-submit Call a function when the form is submitted * The method push add the element to the array named reviews.

AngularJS ( Directives II)

Create a Tab To create some tab use the tab and assign a value for each tab. Ng-click  Every time you do click in the link   a tab will be selected. Each time the tab is selected the value of {{tab}} is updated with the selected value of the tab Create a tab content panels Ng-init Allows to evaluate an expression in the current scope Ng-class Set a class according with one expression Create Tab using a Controller

AngularJS ( Filters)

Syntaxis {{ data* | filter:options*}} Currency {{product.price | currency}} Date {{ '1388123145' | date:'MM/dd/yyyy @ h:mma'}} To get the Date use Date.now() Uppercase &lowercase {{ 'text to change'  | uppercase}} LimitTo  {{ 'text to display'  | limitTo:8 }} orderBy <li ng-repeat="product in store.products  | orderBy: '-price' "> the minus sign '-' means descending

AngularJS ( Directives )

Ng-App Attach the Application Module to the Page Ng-Controller Attach a Controller function to the page Ng-Show Will show an element if true Ex: <button ng-show =" product.saleproduct.canPurchase "> Add to cart</button> product.saleproduct.canPurchase -  Property from the controller Ng-Hide Hide an element like a <div> Ex: <button  ng-hide =" product.saleproduct.soldOut "> </div> Arrays var  saleproducts = [   {      name: 'Porche' ,      price: 295 ,      desc: "My first car"    },   {      name: 'Audi' ,      price: 290 ,      desc: "My second car"    } ]; Length To get the size use length Ex:  product.images.length To display the array just indicate the element as usual    <h2> {{product.saleproduct [0] .price}} </h2> ...

AngularJS (Setup / Controller )

Download angular.min.js             https://angularjs.org/ Twitter Bootstrap (bootstrap.min.js)            http://getbootstrap.com/ Module Is where we write our code Implement Angular Create a  javascript file  to type your code <script type="text/javascript" src="resources/ myapp.js "> Create a Module In your  javascript file  create your first module Specify that is an Angular application Add in the tag <html>  the attribute ng-app=" module_name " This means that will run the module with name   module_name Tutorials http://campus.codeschool.com/courses/shaping-up-with-angular-js/intro https://egghead.io/ http://www.thinkster.io/ API http://kapeli.com/dash Expressions You can include in your code an expression  {{  4 + 6 }} {{ "Hello" + "message" }} Controller Where is defined...

CSS - Tricks

How establish a CSS according with the display size In the css file, add the tag @media Establish the dimensions  @media(min-width:992px)  @media(min-width:992px) and (max-width: 1200px)  @media (max-width: 991px)  Can also establish an attribute as screen This mean that in case of a print the style will not be considered only in the screens =P @media screen  and (max-width: 1000px)  @media only  screen  and (max-width: 1000px) 

C# Tricks

Datable Read a Column Select the row and then ask for the field. DataTable requestedTags; requestedTags.Rows[0]["status"] GridView Add a field To add a field beyond the result of your query use <asp:TemplateField>                <asp:TemplateField HeaderText="New On Board Week">                         <ItemTemplate>                             <asp:DropDownList ID="ddlChange" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlChange_SelectedIndexChanged">                                 <asp:ListItem>--Change in:--</asp:ListItem>                                 <asp:ListItem>...

IIS - Permisions

IIS Permissions To enable the Active Directory connection in the IIS, follow the next steps: Go to IIS Go to Application Pool Select your App Pool Select Advanced Settings in the right side In the section Process Model Select in Identity value the property " NetworkService " You don´t need to restart your application

Android - Basic Steps (Service)

Service Run in the main thread of the hosting application Android can kill the Service if need the resources Purpose Supporting inter-application method execution Performing background processing Start a Service Call Context.startService(Intent intent)\ To call from a Fragment use getActivity().getApplicationContext().startService( intentService); Executing the service After call startService(...)  In the Service is executed the method onStartCommand(...) If the method returns the constant START_NOT_STICKY then Android will not restart the service automatically if the the process is killedp Foreground To execute the service foreground call the method startForeground() Use this if the user is aware of the process Bind to a Service Call the method Context.bindService( Intent service ServiceConnection con int flags ) Send Toast from the Service On the method onStartCommand receive the message   ...

JQuery - Setup

Include Jquery Download Jquery  http://jquery.com/download/ Include in your main page Include at the end of you html page after the tag </form> <script src="../<PATH>/jquery-2.0.3.min.js" type="text/javascript"></script>

Android - Basic Steps (ContentProvider)

ContentProvider Represents a repository of structured data Is better than SQLite DB, because you can share data across multiple applications Encapsulates data sets The access is through ContentResolver URI ContentProviders referenced by URIs Format: CONTENT://AUTHORITY/PATH/ID Content - Schee indicating data that is managed by content provider Authority - Id for the content provider Path - 0 or more segments indicating the type of data to be accessed Id - Specific record Example ContactsContract.Contacts.CONTENT_URI = "content://com.android.contects/contacts/" Retrive in this case all the table because is missing the id ContentResolver Presents a DB-style interface for read and wite data Provide service as Change notification How to use Get a reference to ContentResolver Context.getContentResolver() Types Brower - Bookmarks, history Call log - Telephone usage Contacts Media - Gallery image UserDictionary - predicti...

Android - Basic Steps (Data Management)

SharedPreferences Persistent Map of simple data types Automatically persisted across application sessions Used for store long-term storage of customizable application data Get a SharedPreferences object Activity.getPreferences(int mode) Get a specific SharedPreferences Context.getSharedPreferences(String file, int mode) file - name of SharedPreference file Get Values getAll() getBoolean(...) getString(...) Write SharedPreferences SharedPreferences.edit() putInt(...) putString(...) remove(...) Save changes SharedPreferences.Editor.commit() PreferenceFragment Display user preferences that can be modified Memomry Internal Application private data sets External non-private data sets Determine the status of external memory Environment.getExternalStorageState() Results MEDIA_MOUNTED MEDIA_MOUNTED_READ_ONLY MEDIA_REMOVED Permission android.permission.WRITE_EXTERNAL_STORAGE Cache Files Ge...

Android - Basic Steps (Location & Maps)

Location Is composed by Latitude Longitude Time-stamp Accuracy Altitude Speed Bearing LocationProvider Types: Network  Wifi access points Cell phone towers GPS Passive Piggyback on the readings requested by other application Permissions Network  android.permission.ACCESS_COARSE_LOCATION android.permission.ACCESS_FINE_LOCATION GPS android.permission.ACCESS_FINE_LOCATION Passive Provider android.permission.ACCESS_FINE_LOCATION LocationManager System service for accessing location data getSystemService( Context.LOCATION_SERVICE ) Functions Determine the last known user location Register for location update Register to receive intents when the device nears or move away from a given geographic area LocationListener Defines callbacks methods that are called when Location or LocationProvider status change. Methods onLocationChanged(...) onProviderDisabled(...) onProviderEnabled(...) onStatusChan...

Android - Basic Steps (Sensors)

Sensors There are three types: Motion Position Environment ServiceManager Get a reference with   getSystemService(Context.SENSOR_SERVICE) Get a specific sensor SensorManager.getDefaultSensor(int type) Sensor Types Sensor.TYPE_ACCELEROMETER Sensor.TYPE_MAGNETIC_FIELD Sensor.TYPE_PRESSURE SensorEventListener Interface for SensorEvent callback When the accuracy has changed onAccuracyChanged() When has a new value onSensorChanged() SensorManager To register or unregister SensorEvents registerListener() unregisterListener() SensorEvents Include Data is sensor Sensor Type time-stamp Accuracy Measurement data Filters Low-pass Deemphasize transient force changes Emphasize constant force components Example Carpenter's level High-pass Emphasize transient force changes Deemphasize  constant force components Example Percussion instrument

Android - Basic Steps (Multimedia)

Multimedia  Playing Audio Watching Video Recording Audio Using camera Multimedia classes AudioManager  Play sound effects Manage volume, system sound effects and ringer mode control Manage peripherals SoundPool Represents a collection of audio samples (streams) Can mix and play multiple simultaneously RingtoneManager & Ringtone MediaPlayer MediaRecorder Camera Control the camera AudioManager  Get instance Context.getSystemService(Context.AUDIO_SERVICE) SoundPool Is an asynchronous operation that load a file using the method onLoadComplete that is implemented by setOnLoadCompleteListener  When the status is equal to 0 the file is uploaded           SoundPool soundPool.setOnLoadCompleteListener(new OnLoadCompleteListener() { @Override public void onLoadComplete(SoundPool soundPool, int sampleId, int status) { if (0 == status) { playButton.setEnabled(tr...

Android - Basic Steps (Gestures)

Gestures Android use two classes MotionEvent Represent the movements TouchHandling To use the movement in the application MotionEvent The structure is Action Code State change that occurred Action Values Position and movement properties (time, source, location) Rules Touches go down one at a time touches move as a group Come up one at a time or are cancelled Methods getActionMasked() Return the action code associated with the motion event getActionIndex getActionIndex() Return the index of the pointer associated with the action code getPointerId(int) return the stable id of the pointer Pointer Individual touch sources Each pointer has a unique ID as long as it is active Each pointer has an index within the event MotionEvent can refer to multiple pointers GestureDetector  Recognize common touch gestures (single tap, double tap, fling) To use it: Create a GestureDector that implements OnGestureL...

Android - Basic Steps (Graphics)

Graphics 2D Graphics, it can be draw in two ways Views Simple graphics, little or no update Shapes can be defined in xml files in res/drawable folder Canvas Complex graphics with regular updates It allow to use methods like drawText() drawPoints() drawColors() Also the canvas use the class Paint for parameters setStrokeWidth() setTextSize() Drawable class It can draw using  ShapeDrawable Draw primitive shapes represented by classes as PathShape - Lines RectShape OvalShape BitmapDrawable ColorDrawale You can draw programmatically or using an xml file SurfaceView Manages a Low-level drawing area called a surface The surface represents a drawing area within the view hierarchy Use of SurfaceView Call method getHolder() to acquire its SurfaceHolder Register for callbacks with addCallack() surfaceCreated() - Until this method is call you can't draw surfaceChanged() surfaceDestroyed() Create thread on which drawing opera...

Android - Basic Steps (Alarms)

Alarms Remain active even if the device is asleep Are canceled on device shutdown/restart AlarmManager To get a reference use getSystemService(Context.ALARM_SERVICE) Methods Create Alarm set(...) Repeat setRepeating() setInexactRepeating() Alarm Type Constants RTC_WAKEUP - Execute the task at specific wall clock time. Wake up the device Use System.currentTimeMillis() to calculate the time RTC - Execute the task at specific wall clock time. Not wake up the device ELAPSE_REALTIME -  (time since boot, including sleep) Use  SystemClock.elapsedRealtime() to calculate the time ELAPSE_REALTIME_WAKEUP - 

Android - Basic Steps (Thread)

Thread UI Thread - Is the main thread UI Toolkit is not thread-safe Methods The following methods allows to  run in the UI Thread  View.post(Runnable r) Activity.runOnUiThread(Runnable r) AsyncTask Manage the Backgroud Thread & UI Thread Used for relative short tasks that lasting few seconds Background Thread Performs work Indicate progress UI Thread Does Setup Publishes intermediate progress Uses Results Workflow onPreExecute() Run in UI Thread before doInBackground() Do the setup doInBackground() Do the work in the background Return the result in a Result object pulishProgress() This method may be invoked onProgressUpdate() If pulishProgress() is invoked then this method continue Runs in the UI Thread onPostExecute Runs after  doInBackground() Handler Handle two threads of any kind One thread can hand off work to another thread by messages & posting runnables to handler associa...

Android - Basic Steps (Notifications)

User Notifications Types: Toast Notification Area Notifications Tip To use the notification vibration, establish the permission in the AndroidManifest.xml file    <uses-permission android:name="android.permission.VIBRATE" >     </uses-permission> Broadcast Base class for components that receive and react to events When event occur is represented as Intent, then are broadcast to system The Intent routes to BroadcastReceiver The BroadcastReceiver receive on the method onReceive() Broadcast Events can be broadcast in Order or Normal way Normal - Undefined order and if there are two or more BroadcastReceivers can process the event at the same time. Order - Deliver the intent one at the time in priority order Can also be Sticky or Not Sticky Sticky   Store intent after initial broadcast Is useful to record system changes like the battery status Is disposed after the event finish  Non Stick...

Github

Github Commands Upload the changes to GIT git add . git commit -m "Added associations" git push origin master Commands git init Initialize a Git repository git status Check if there are changes git add file_name Add specific file git add '*.txt' Add a type of files git rm '<file_name>' Delete a file git commit -m "Comment" Store our staged change git log Show all the changes git remote add origin https://github.com/<repository>/<repository_name>.git Push our local repository to Github server git push -u origin master  Push the changes to the server repo origin - is the name of the remote master - is the name of the branch -u - save the parameters, so the second time only type git push git pull origin master Down the changes from the server repo git diff HEAD Get the differences from our most recent commit git diff --staged See the changes you just staged git ...

Android - Basic Steps (UI)

View Elements Button ToggleButton Checkbox RatingBar AutoCompleteTextView ViewGroups RadioGroup TimePicker DatePicker WebView MapView Gallery Spinner Adapters & AdapterViews AdapterView are Views managed by an Adapter, who manage the data and provides data views AdapterView display the View ListView manage by ListAdapter Spinner manage by SpinnerAdapter Layouts match_parent - Occupy all the available space. D eprecated starting in API Level 8   fill_parent - Same asd match_parent but for API Level 8 LinearLayout Arrange all the child elements in one line RelativeLayout TableLayout GridView Menus Is defined in a resource XMLfile   res/menu/file.xml Use it on method OnCreate...Menu(), using the menu inflater Use method on...ItemSelection() to handle the item selection Types Options When user press a button In the method onCreateOptionsMenu() add the code to add the menu defined in res/menu/...

Android - Basic Steps (Fragments) II

Add a Fragment Dinamically The general steps are  While the activity is running can add a fragment to the layout  Get reference to the FragmentManager Begin a FragmentTransaction Add the Fragment  Commit the FragmentTransaction To change the previous application to add fragments dynamically, so: In the MainActivity.java override the onCreate method @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mTitleArray = getResources().getStringArray(R.array.Titles); mQuoteArray = getResources().getStringArray(R.array.Quotes); setContentView(R.layout.main); FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager .beginTransaction(); fragmentTransaction.add(R.id.title_frame, new TitlesFragment()); fragmentTransaction.add(R.id.quote_frame, mQuoteFragment); fragmentTransaction.commit(); } I...