Wasp3D / C# : Generate Ad Log file

Published 2 months ago, has comments


private void logIt(string adName){
     		
     		
     		string time = DateTime.Now.ToString("hh:mm:ss"); // includes leading zeros
			string date = DateTime.Now.ToString("dd.MM.yyyy"); // includes leading zeros
			
			string txtLine = date+","+time+","+adName;

			string directory = @"C:\Logs\"+date;
     		if(!Directory.Exists(directory))
			{
			    Directory.CreateDirectory(directory);
			}
			
			string path = directory+@"\AdLog_"+adName+"_"+date+".csv";
			if(!File.Exists(path))
		    {
		        File.Create(path).Dispose();
		      	using( TextWriter tw = new StreamWriter(path))
		        {
		          tw.WriteLine("Date,Time,AdName");
		          tw.WriteLine(txtLine);
		          tw.Close();
		        }
		
			}
		
		    else if (File.Exists(path))
		    {
		        using(TextWriter tw = new StreamWriter(path,true))
		        {
		          tw.WriteLine(txtLine);
		          tw.Close(); 
		        }
		    }
	
     	}

How To Create PageController in Wasp3D Drone Designer

Published 2 months ago, has comments

Viz Artist : Script to generate Logs

Published 2 months ago, has comments


Dim filename As String = Scene.Name
Dim path As String = "C:\\LogPATH1\\"
Dim path2 As String = "D:\\LogPATH2\\"
DIM dt AS DateTime
Dim filepath As String
Dim newLineData As String
Dim fileData As String
Dim myDirector As Director
Dim isLogged As Boolean = false
Dim dtString As String


Sub LogIt(path As String)
    filepath = path & filename & "_" &  GetCurrentTime().Month & "." & GetCurrentTime().Year & ".csv"

    fileData = ""
	System.LoadTextFile(filepath, fileData)
	
	if fileData == "" then
		System.SaveTextFile(filepath, "timestamp,name" )
		System.LoadTextFile(filepath, fileData)
	end if
	
	dt = GetCurrentTime() 	
	dtString = dt.DayOfMonth & "/" & dt.Month & "/" & dt.Year & " " & dt.Hour & ":" & dt.Minute & ":" & dt.Second 
	newLineData = dtString & "," & filename
	
	System.SaveTextFile(filepath, fileData & newLineData )
End Sub


sub OnExecPerField()
	myDirector = Stage.FindDirector("Default")

	if myDirector.time > 0 and myDirector.time < 1 then
		
		if isLogged == false then
			LogIt(path)
			LogIt(path2)
		end if
				
		isLogged = true
	end if
	
	if myDirector.time == 0 or myDirector.time > 1 then
		isLogged = false
	end if
	
end sub

Note: create path folders manually

Update/ Change
"C:\\LogPATH1\\" and "D:\\LogPATH2\\"
to your desired Directory Like
"C:\\Logs\\"

You have to have a Director in Stage named 'Default' and its animation must be > 1 second

Create a Container and Drop 'Script' Plugin in it, Edit the 'Script' Copy/Paste this code in it press 'Compile & Run' Save Scene. That's it.

Script to create Dynamic MAP Graphics in WASP3D using SQLEXPRESS

Published 5 months ago, has comments

WASP3D scene Editor Script:

#region NameSpaceRegion
    using System;
    using System.Data.SqlClient;
    using System.Windows.Forms;
    using System.Data;
    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.Xml;
    using System.Xml.Linq;
    using BeeSys.Wasp3D.Hosting;
    using System.Collections.Generic;
    using BeeSys.Wasp3D.WrapperHelper;
    using GFXWrpSceneGraph; 
#endregion

namespace BeeSys.Wasp3D.Scene
{
    public partial class SceneHandler : SceneGraph
    {            

 		public void createMap() {
 			// BJP   0.9,0.4,0,1
			//CONGRESS   0,1,0,1
			//OTHERS   0.4,0.4,0.4,1

			
			XDocument xdPolyData = XDocument.Parse("<shape></shape>");
			
			foreach (DataRow theRow in  this.getDataSetTable().Rows) {
				//Console.WriteLine(theRow["number"] + "\t" + theRow["last_party"]);
				
				XElement xePoly = XElement.Parse("<polygon />");
				
				string clr = "0.9,0.4,0,1";
				
				if (theRow["last_party"].ToString() == "BJP") clr = "0.7,0.4,0,1";
				else if (theRow["last_party"].ToString() == "INC") clr = "0,1,0,1";
				else if (theRow["last_party"].ToString() == "SP") clr = "1,0.1,0,1";
				else if (theRow["last_party"].ToString() == "BSP") clr = "1,1,0,1";
				else clr = "0.4,0.4,0.4,1";
				
				xePoly.SetAttributeValue("name", theRow["number"].ToString());
				xePoly.SetAttributeValue("visibility",1);
				xePoly.SetAttributeValue("color",clr);
				xdPolyData.Root.Add(xePoly);

				System.Threading.Thread.Sleep(50);
				
			} // end foreach
			
			this.LocalVariable.mapData = xdPolyData.ToString();
			
 		
 		}

        // this method is called when scene is cue    
        private void OnSceneCue(ref bool bRender)
        {
        	
        	
        	this.createMap();	
        }
        
 
		
	public DataTable getDataSetTable(){
 		
 			SqlConnection thisConnection = new SqlConnection(@"Server=MY_SERVER_ADDRESS_OR_IP;Database=MYDBNAME;Uid=MYUSERNAME;Pwd=MYPASSWORD");
			
			DataSet thisDataSet = new DataSet();
		
			try {
 				thisConnection.Open();
 				SqlDataAdapter thisAdapter = new SqlDataAdapter("SELECT number, last_party FROM MAP_DATA WHERE state='UP'", thisConnection);

				thisAdapter.Fill(thisDataSet, "seats");
				
				return thisDataSet.Tables["seats"];
 				
 			} catch(Exception e){
			    Console.WriteLine(e.ToString());
			    //MessageBox.Show(e.ToString());
			}
 			
			return thisDataSet.Tables["seats"];
		
			
 		}
       
    }
}

What else matters?

Published 6 months ago, has comments


“You may not be her first, her last, or her only. She loved before she may love again. But if she loves you now, what else matters?
She’s not perfect, you aren’t either, and the two of you may never be perfect together but if she can make you laugh, cause you to think twice, and admit to being human and making mistakes, hold onto her and give her the most you can. She may not be thinking about you every second of the day, but she will give you a part of her that she knows you can break, her heart.

So don’t hurt her, don’t change her, don’t analyze and don’t expect more than she can give.
Smile when she makes you happy, let her know when she makes you mad, and miss her when she’s not there.” 

—Bob Marley

Dear diary..

Published 10 months ago, has comments

Her diary: ’Today, I noticed that my husband was behaving kind of strange. We had a reservation for dinner at our favorite place and were due to meet there in the evening. I went shopping with my girls and I showed up in the restaurant a little late, my fault. He was a little less talkative than usual and I noticed something was bothering him. At first I thought he was irritated by my late arrival but later I realized the problem was much, so much deeper. I suggested to him that we move to a less crowded place so we could talk....

Read More!

After Effects script to create a 3D Cube

Published 1 year ago, has comments

This script is used to create a 3d cube. You can later replace the different sides and spin the null around for easy animation. To make it more flexible, you can enter the size of the sides and the script will adjust.

In order for the sides to hold their positions (I've found that during animations, sometimes the sides will slip slightly out of place), they are all positioned with expressions and should keep their place no matter what you do to them.

There is a null object as well, all the sides have been parented to it and should make moving the cube around relatively simple.
...
Read More!

A Simple Server-to-Server File Transfer Script (PHP)

Published 2 years ago, has comments

To use it, simply change the variable $path to a relative path on your new server where you want the file to be saved to, change the variable $url to the web-accessible location of the file on the old server, and upload and run the script on your new server..


set_time_limit(0); //Unlimited max execution time
 
$path = 'newfile.zip';
$url = 'http://example.com/oldfile.zip';
$newfname = $path;
echo 'Starting Download!
';
$file = fopen ($url, "rb");
if($file) {
    $newf = fopen ($newfname, "wb");
    if($newf)
        while(!feof($file)) {
            fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );
            echo '1 MB File Chunk Written!
';
        }
}
if($file) {
    fclose($file);
}
if($newf) {
    fclose($newf);
}
echo 'Finished!';

Train 3D Model Cinema 4D R15

Published 3 years ago, has comments

Click on the 'Download button blow to get the .c4d file.'

Download

Oxygen: Boost Battery & Speed

Published 3 years ago, has comments

Oxygen: Boost Battery & Speed

Oxygen is an app for ROOTED ANDROID DEVICES which boosts battery life and Speed by preventing annoying and unwanted apps running in background, it periodically check for background apps and services and automatically hibernate them and completely close those apps and their services. the apps remain hibernated/ freeze unless or until triggered by user or via other app.


Oxygen makes your battery last longer upto 60% and boost android speed like new one. You need a rooted phone to use it.


We tried to make it very simple and useful. Please give it a try and let us know if you like it or not. 


FOR ROOT USERS ONLY. 


BOOST BATTERY AND ANDROID SPEED. 

LET ANDROID BREATH. 


ENJOY NEW LIKE ANDROID DEVICE, EVERYDAY.


This app needed full root access in order to function properly. You need to grant super user access.

GET OXYGEN HERE