Posts

Sharepoint: Calculate Today in Sharepoint 2010 using Javascript

How to calculate Today's Date in SharePoint 2010 Problem: Need a column in sharepoint that has updated today's date? This is an issue with sharepoint, there are couple of way going around this issue, its even more limited if you only have client side access to sharepoint. Solution: Use client side (javascript) to update a column with today's date. Note** javaScript is runtime script and so what this means, it will execute only when a user loads the page where the code exists. Implementation : Refer to other blog post -- > Link ---------------------------------------------- Code --------------------------------------------------------------- <script type="text/javascript"> var myListItemColelction; var myListcontext; //Delays function from running until sp.js loads $(document).ready(function() {     ExecuteOrDelayUntilScriptLoaded(getMyListItems, "sp.js"); }); function getMyListItems() { try { myListcontext =  new...

Sharepoint List: Days Elapsed or Countdown

Image
SharePoint List: How to Display Days Elapsed or Countdown  Problem :Have you thought about introducing a countdown or even days elapsed as a feature in a sharepoint list? Solution: Well i have a solution for you using javascript. It does get a little involved with code but very easy to implement. 4 Step Implementation: Step 1 : Create the list in sharepoint and name it what you like Add two columns: Column 'Today" type = Date and Time Column 'Days Elapsed' type = calculated Step 2 : Under list settings, go to column you have just added called Days Elapsed and enter the following formula: =ROUND(Today-Created,0)&" days" --> Output Data Type as a Single Line of Text. Step 3 : Some code --> Copy the code below and paste it into a nodepad, go through the code and change the name of your list: Look for LIST NAME , thats where you will change the name to your list name and also change the column name for "Today" if you named it...

How to find pc serial number

Image
Find Computer Serial Number on any windows machine 1. Open command prompt (Click start, and search cmd) 2.Enter the command wmic bios serialnumber

CS3550 Final Exam

1. Identify True or False for the following statements: (10*1 = 10) (a) A TCP header has source and destination port address. ___ (b) OSI model has 5 layers. ___ (c) In a TCP/IP model, an application can communicate with the underneath transport layer through a port number. ____ (d) PDU header has the control information. ____ (e) UDP is an example of TCP protocol. _____ (f) HTTP is an example of TCP protocol. _____ (g) UDP provides a reliable connection for transferring data between applications. ___ (h) A TCP header is minimum 160 bits. _____ (i) TCP header does not contain sequence and acknowledge number. ____ (j) A UDP header has source and destination IP address. ____ 2. For TCP protocol, show the sequence of packet exchange for the following: (a) 3-way handshake, and (b) Connection closing or teardown. (3+3=6) Ans: 3. Briefly discuss three characteristics of TCP that ensure reliable communication. (2*3= 6) Ans: 4. Consider the following ...

Caesar Cipher in Java

Credit goes to Musa Mohammed for his help. import java.util.Scanner; public class CaesarCipher { public static final String ALPHABET = "abcdefghijklmnopqrstuvwxyz"; public static String encrypt(String plain_Text,int shiftKey) { plain_Text = plain_Text.toLowerCase(); String cipherText=""; for(int i=0;i<plain_Text.length();) { if(plain_Text.charAt(i) == ' ') { cipherText += plain_Text.charAt(i); i++; } else { int charPosition = ALPHABET.indexOf(plain_Text.charAt(i)); int keyVal = (shiftKey+charPosition)%26; char replaceVal = ALPHABET.charAt(keyVal); cipherText += replaceVal; i++; } } return cipherText; } public static String decrypt(String cipherText, int shiftKey) { cipherText = cipherT...

Timer/Count Down in standard C

#include <stdio.h> #include <signal.h> #include <stdlib.h> #include <unistd.h> #include <setjmp.h> static void sig_alarm (int signo); void err_sys (const char* message); static jmp_buf alarm_jmp; int main (int argc, char* argv[]) { int time_left = 10; if (signal (SIGALRM, sig_alarm) == SIG_ERR) err_sys ("alarm signal error"); alarm (1); if (sigsetjmp (alarm_jmp, 1) != 0) { time_left--; if (time_left == 0) { printf ("BOOM\n"); exit(0); } else { printf ("%d\n", time_left); alarm (1); } } while (1); exit(0); } static void sig_alarm (int signo) { siglongjmp (alarm_jmp, 1); } void err_sys (const char* message) { printf ("%s\n", message); exit (0); }

CS3401 HW 7

package trees; /** Course: CS 3401  * Section: 01  * Name: Dalibor Labudovic  * Professor: Prof. Shaw  * Assignment #: Homework #7  */  import java.math.BigDecimal; import java.util.*; //******************************************************************** // Evaluates a given expression by first converting it to a // Postfix Stack and then to an Expression Tree and then // evaluating the Expression Tree //********************************************************************  public class EvaluateExpressionTree {  public static void main(String[] args) {  Scanner input = new Scanner(System.in);  System.out.println("Enter an equation in infix notation: " + "[Ex: 10+6/3 ]");  String expression = input.nextLine();  input.close();  try {  System.out.println("Result = " + evaluateExpressionTree(expression).stripTrailingZeros().toPlainString());  }  catch (Exception ex) {  System.out.println...