Home

Advertisement

Brainchildren of the Demented [entries|archive|friends|userinfo]
studiojanck

[ Website - Studio Janck Homepage ]
[ Userinfo - Livejournal Userinfo ]
[ Archive - Journal Archive ]
[ - Storm of Bullets ]
[ - Kongregate ]

Cog's PowerShell Corner: The Revenge [Date: Thursday, 10/22/2009 | Time: 0855.00]
[Tags|, , , , , ]

Hey Paisanos! It's Cog's PowerShell Corner!
Yes, again. I refuse to shut up.

Today's word is: Execution.
As in running a program. Not the other kind.

Running a program, DOS-style

Code:
function Invoke-Shell ([string]$command, [string]$params, [switch]$raw)
{
  if (-not $raw)
  {
    $command = "`"$command`" $params"
  }
 
  cmd.exe /s /c "`"$command`""
}


This function allows you to safely call outside programs and DOS commands without the chances of having them be misconstrued as a cmdlet, function, or alias. If the -raw switch is specified, the command parameter is treated as the command line (which means the application name must be in quotes).
I recommend making an alias for this named "cmd" or "run".

Running a program as a new process

Code:
function Start-Process ([string]$application, [string]$params)
{
  [System.Diagnostics.Process]::Start($application, $params) | out-null
}


I recommend making an alias for this named "start".

These are simple functions. You'll probably want to combine the two and simply use the System.Diagnostics.Process class, while allowing for extra parameters for whether or not to start it as a new process and the execution environment.

Tip of the day

Variables will be expanded in double-quoted strings, e.g. "You are $age years old.". This works for variables with scopes and namespaces (such as $env:path or $global:foo), but it does not allow you to expand object members (e.g. "$foo.bar"). However, you CAN expand object members and evaluate expressions in a string by using a dollar sign and parenthesis, as shown here:
"$($foo.bar)"
"$(get-item $name)"
"$($a + $b)"
LinkLeave a comment

Cog's PowerShell Corner [Date: Wednesday, 10/21/2009 | Time: 0858.00]
[Tags|, , , , , , ]

I've been getting into PowerShell recently. It's awesome. But sometimes it doesn't seem to have all the functions that one would want. So I made my own. I've decided to dust off the ol' blog to tell you about how awesome I am some of the more useful functions. There's no guarantee that these won't malfunction when used in extreme ways (a pipe in a ForEach-Object in a pipe in a function), but there you go.

Dual Filter


(PowerShell 2.0 CTP 1 only, as far as I can tell)
Will automatically generate a Cmdlet from a script block. It's an easy way to make a filter that doubles as a function, or a function that accepts pipeline input. It all depends on how you look at it.

Code:
function DualFilter ([string]$name, [string]$params, [scriptblock]$filter)
{
  if ($params -ne "") {$params = ", $params"}
  $params = "param( [ValueFromPipeline][object]`$_ $params )"
  invoke-expression "cmdlet global:$name {$params process {$filter}}"
}


It can then be used like so:
DualFilter Write-Colored '[ConsoleColor]$color' {
  Write-Host $_ -foregroundcolor $color
}

Note that the opening brace must be on the same line as the DualFilter statement.

Including Scripts


With the advent of "Modules" in PowerShell 2.0 CTP 2, this may not be necessary for much longer.

Code:
function include ([string]$path)
{
  get-item "$path.ps1" | foreach-object {. $_.FullName}
}


Usage:
. include "c:\ps\*"

Scripts can be included by an absolute path or by wildcard. The ".ps1" extension should be omitted.

Tip of the Day


You can make an alias for a script file by writing Set-Alias <name> <path>
LinkLeave a comment

DigiPen orientation: day one [Date: Wednesday, 09/02/2009 | Time: 1344.00]
[Tags|]
[Mood | optimistic]

First day of orientation and I already know that I'm going to love this place. Reasons listed below.

In general:

1. Every conversation I had, whenever I thought to ask someone about something, they would ask it first.

2. Almost everyone has a similar oddball sense of humor.

The undergrad welcoming session:

3. The first 10 minutes of the undergrad welcoming session was spent on video game trivia. With candy for prizes.

4. "Please, treat the campus like it was your house... er, actually... treat it like it was your PARENT'S house."

General question and answer session:

5. These conversations:
Helper 2: Is this the place for general questions?
Helper 1: Generally, yes.
Helper 2: Then can I generally sit here and help?
Helper 1: If you want to, in general.

Me: So how general can these questions be? Like, should I put money down for an XBOX 360?
Helper 1: That's a good question. You see, the things you need to think about are how much you REALLY want one, how much time do you have to spend on it, and whether or not it's within your budget.
Helper 2: If you think about it, you won't have much time to mess around with it in DigiPen.
Helper 1: Yeah, that's a good observation.
Helper 3: (deadpan) The answer is no.

Getting student IDs:

6. Someone there kept asking the people getting their picture taken to "strike a pose." Most of them did.

7. The photographer told everyone to say "fuzzy pickles" when he was taking their picture. Someone asked him about it, and he said "I'm going to keep doing it until someone gets where it's from." I spoke up, and he just pointed at me and said "YES."

I'm going to love college ;_;

Edit: I forgot this last one:

8. At one point, several people carrying boxes for Macintosh computers passed through the room. Someone shouted "ARE YOU TRYING TO START A FIGHT? I'LL TOTALLY TAKE YOU ON!"
LinkLeave a comment

Lifelong dream [Date: Wednesday, 06/10/2009 | Time: 2214.00]
[Tags|, ]
[Mood |accomplished]

 Gentlemen, I have an announcement.
I have finally achieved my lifelong dream of owning a fedora.
That is all.
LinkLeave a comment

Wings [Date: Monday, 04/20/2009 | Time: 1624.00]
She replaced your body
With cogs, gears, and springs
Saving your life
And giving you wings

May your hands fly true
And your body soar
Or your fragile world
Will be no more

Move quickly, make haste
Her time's drawing near
Your last chance to save
That which you hold dear


Annette is loathed deeply
By one once deceased
His name, long forgotten
Now Agony, the beast

When she saved his life
Annette's work was in vain;
Losing his body
Soon drove him insane

His humanity lost
A deranged psychopath
Mind and form twisted
By unholy wrath


Is she an angel
Of life, giving wings?
Or is she a demon
Who is pulling the strings?
LinkLeave a comment

I ATEN'T DEAD [Date: Tuesday, 04/15/2008 | Time: 0919.00]
Sorry for the lack of posts, my possibly multiple viewers. The next chapter is coming up soon. THERE WILL BE EXPLOSIONS!

Until then, have a list of all the things that are constantly running through my head:

Subzero: Origins (Tentative title) - Action/RPG
Subzero: Stratego (Tentative title) - Real-time strategy
Subzero: Apocalypse - Domination of All Mankind - Danmaku/Bullet Curtain
Ground Zero: Building 47 - Survival horror/Room escape
Ground Zero: Machinations - Platformer
Ground Zero: Final Mission - Vertical scrolling shoot-em-up
Zero Hour: Focal point (Tentative title) - Third person shooter

Spinoff games (Zero Relevance, if you will):
Marionation - Puzzle/platformer
Panic! Shooter - Arena shooter

I will personally be amazed if more than two of these see reality.

Edit: Changed some names
LinkLeave a comment

Short intermission [Date: Sunday, 01/27/2008 | Time: 2025.00]
SOM > Nothing interesting happens for a few days after this, so let's skip ahead...

COG > Somnus, there's nobody to talk to. Go back to sleep.

SOM > Done and done.

WARNING: UNIT "SOMNUS" IS NOT RESPONDING

SPEC > Like a baaaaaaby.





The console had been set to "Reports Only" a while ago.

REPORT FROM UNIT "SPECULUS"

DETAILS: Woman disregards advice and gets run over by truck. Killed instantly.

PENDING REVIEW


They were still sore about it. Her mind wandered a bit. Come to think of it, this was supposed to be a serious and life-threatening mission, but lately... well, the "59 days without us all getting killed" sign in the mess hall said it all, really. Has the American government still not figured it out yet? The sage drive hasn't reported anything-

REPORT FROM UNIT "SOMNUS"

DETAILS: Crew killed in devastating attack by poodles. No survivors.

COG: There are no poodles in space!

SPEC: At least, none that I've seen.

ESTIMATED PROBABILITY: 0.1%


...useful since this mission started, unless, of course, you counted the "Constipation epidemic due to expired cheese" report. Even then, the real culprit turned out to be low fiber. Maybe it's broken?

ADDENDUM: Invisible poodles.

SPEC: ...

COG: No. Go back to sleep.

ESTIMATED PROBABILITY: 0.001%


As Cognitus would say, "That's still to be determined."

Well, there goes that tangent. She looked around. Everyone had already left their stations. Everyone else go to sleep in their bunks. Well, she did keep signing up for this, so it was her own fault, really, but still. She should get a medal or something. Or better yet, she shouldn't, because if she did they would have to look up her file...

She yawned. 3 channels and there's nothing on. Try to stay awake, try to stay awake, try... to... stay...
Link

She woke up. [Date: Wednesday, 01/16/2008 | Time: 1733.00]

She was resting her head in her hand. She had fallen asleep again. Hopefully they had not, against all evidence, all been killed in one easily avoidable fell swoop because she was sleeping on Sage Drive duty. She checked the screen, just in case.

SAGE_DRIVE >> TERMINAL_BRIDGE_07 SPEC > You're sleeping, did you know that? COG > Humans often need sleep. SOM > Hey, she sleeps too? Amazing!

Top secret cutting-edge future prediction technology, she thought. Like magic, more text appeared.

SAGE_DRIVE >> TERMINAL_BRIDGE_07 SPEC > Prototypes. We're prototypes. SOM > That explains EVERYTHING!

The beauty of it all, the text-based interface. Nothing to get in the way of... of...

She reflected on how she had almost managed to convince herself that the Sage Drive made good conversation.

Her slightly depressing reverie was interrupted by a muffled cheer. Her chair squeaked as she turned to look around. No one else was on the bridge. They were having another party. With a sigh, she activated the communication utility. Better than mind-reading.

TERMINAL_BRIDGE_07 >> SAGE_DRIVE How many times can you party in one month? COG > Is that a philosophical question? SOM > You would think they would run out of conical paper hats. And cake. Mmmm... cake... SPEC > Are you sure you're not just saying that because you got left out? No! Of course not! SPEC > Can't stand being away from him then?

The rest of the universe seemed to quickly recede into the darkness, especially everything below her stomach.

What? SPEC > The captain, Adam. You like him, don't you?

She waited for a period long enough to be acceptably considered a confused silence and responded:

Um, no. SPEC > My mistake... SOM > MYSTERIOUS ELLIPSIS!

Her bewilderment at this strange interjection was cut short, as she noticed that the noises were starting to get closer. People were singing. Eventually, she was able to make out the words.

"Let's ruin the reputation of the good ol' USA
They lied to all of us and now there will be hell to pay
Expose the lies, present the truth, and then be on our way
There's things we'd rather do~"
Battle hymn of the republic? SOM > MENTALLY INSERTED TILDE! COG > SHUT UP! SPEC > Shush children, the chorus is starting!
"Jury jury let 'em fool ya
Them and Fuhrer Schicklgruba
We'll expose them, promise to ya
'Cuz that's just what we do!"

The door to the bridge opened, and the singing broke into a sea of background noise as people dispersed and sat down.

Schicklgruber? COG > I believe they're referring to President Lexington. How do they know he's involved? SPEC > How do you know he isn't? Will this go anywhere? COG > Probably not. SPEC > Hey, look! It's the captain! Blow him a kiss!

She didn't bother looking. She drew back her arm is if to punch the screen when Adam's voice came from behind her. "Sarah? Is something wrong?"

SPEC > The world is all wrong! You should be closer together! SOM > Hear hear!

She turned to the captain and waved nervously, while making a furious hand gesture behind her back towards one of the cameras on the bridge.

SPEC > Well that was uncalled for. COG > Oh, how things change... It seems like only yesterday that gesture took only one finger.
Link

She calmed down eventually. [Date: Wednesday, 12/12/2007 | Time: 1917.00]
[Tags|]

     Alex noted that 40 minutes had passed already, and that he should probably refrain from saying anything that wasn't strictly necessary. She started to speak again. "The three sages are missing. A cult known as the "Five Traits of Self-Preservation" are taking credit for it. We don't know their exact location, but we can give you some equipment which can help. We'll explain those later."
     "I will need a team."
     "You're in luck." She handed him a stack of files. He skimmed each one. A graduate of the N-MA university of magic, a graduate of N-SCI, and a... swordsman. A mage, a physicist, and a swordsman. A well-balanced team... but...
     "They're all female?"
     Julius frantically began, Don't ask what I think you're going to- 
     "Are you sure they're capable?"
     There was a snapping noise. Alex looked up.
     She had broken her pencil in half, and was giving him a blank stare.
     Alex carefully weighed his options, considered his objectives, and chose the best course of action.
     He left the office. 
Link

Alex cocked his head. [Date: Sunday, 12/09/2007 | Time: 1906.00]
[Tags|]

Julius was silent. She tried again. “The Earth, Grass, and Sky?” No. “Past, present, and future?” Still no. She sighed. “Cognitus, Speculus, and Somnus?” Ales spoke up. “Ah yes, them.” She began to grin. “I think it’s about time you learned the truth about them…”
     “They’re real,” he stated flatly.
     She stared at him. She closed her mouth, then opened and closed it a few more times. She recovered shortly. “How did you know that?”
     “I just do.”
     “Someone must have told you.”
     “It doesn’t matter… unless…”
     “Unless what?”
     “Mother was lying…”
     Her head hit her desk again. Alex turned to Julius. Should we leave and come back again?
     No need. This time she’s laughing.
Link

"So what is this about a job?" [Date: Tuesday, 12/04/2007 | Time: 1903.00]
[Tags|]

Julius asked, as Alex was sitting down. Julius seemed to be running the show, which was unusual for an advisory NIL, Ms. Featherstone note. Alex seemed rather like the fool in a two-person slapstick routine, minus the slapstick. She turned back to look at Julius. She returned her gaze silently and unblinkingly, in the manner of all NILs.
     We once suggested making everyone think we were blinking, but your people decided that made them uncomfortable.
     Ah yes, they did that too. "But I digress," she said out loud, startling Alex, who had been sitting in silence for several minutes, unaware of the mental narrative. "Have you heard the story of the three sages?"

Link

Her chair was empty... [Date: Tuesday, 11/27/2007 | Time: 1903.00]
[Tags|]

...and the papers on her desk were disturbed recently, and still settling. He was about to call for help when Julius tugged on his sleeve. He turned back around to see Ms. Featherstone climbing back onto her chair. "Was there any reason for that just now, or do they not teach you about opening doors at that school of yours?" she said, dismissing the secretary, who was making frantic apologetic hand gestures just outside the door. Alex settled down. “Opening doors was not in the curriculum,” he began, “but I-” He was cut off by a mental throat-clearing from Julius. She had her head on her desk.
     “We are out in society, Alex,” Julius explained, in a tone void of annoyance, pity, or exasperation. “People ask rhetorical questions and use figures of speech. He turned to look at Ms. Featherstone. “I apologize for his social ineptitude.” He said. There was a long silence. “Erm, how about we leave and start over again?”
      “That sounds like a wonderful idea. Let’s do that.”

Link

He sat, unmoving, for several seconds. [Date: Tuesday, 11/20/2007 | Time: 2032.00]
[Tags|]

Suddenly, apparently without any external stimuli whatsoever, he became quite alarmed. The time had passed. He took out his pocketwatch, and hurriedly looked from it to the clock on the wall. This must be some sort of error on his part, unless... the organization wasn't as well-oiled a machine as he thought? No... impossible. He turned to look at Julius. If Julius noticed his turmoil, he was showing no sign of it. All he got was a feeling of deep and profound thought, which wasn't that different from usual. No, this was no time to get distracted. The time was definately past. Now was the time for action. He rushed to the door of the office, and, before the secretary could so much as raise her hand, kicked it open...

Link

He sat in the chair. [Date: Wednesday, 11/14/2007 | Time: 1621.00]
[Tags|]

He had been sitting there for 47 seconds. He had already cursed himself silently 21 seconds ago for overestimating the time it would take to reach the office, so there was no need to do so again. The secretary had asked him 10 seconds after his arrival who he was and if she should notify Ms. Featherstone of his arrival, and he assured her that no, such would not be necessary, and that events would result in mutual benefit. This did, in fact, intersect with the silent cursing. She returned to her desk in a state of perturbation.
Link

I inquired... [Date: Tuesday, 10/02/2007 | Time: 2208.00]
...as to whether or not he knew what time it was. He replied that yes, he did, as he used his watch to time how long it took me to open the door, which was 11 minutes and 47 seconds. I asked if that time was somehow important and he responded "Eventually". As my brain slowly fizzled, I concluded that the irrelevant questions should be kept to a minimum. I got to the point and asked him why he was here... 
Link

I happened to be awakened one morning... [Date: Monday, 10/01/2007 | Time: 1842.00]
...for an unknown cause. The cause immediately became apparent when there came a knocking, most likely a repeat. It was quite an abrupt awakening, and in order coherent my thoughts were not. Regardless, I still managed to somewhat haphazardly make it down the stairs and towards my front door. It apparently took quite a while, as the knocking continued and became, it seemed, slightly irritated. I opened the door to find a fairly nondescript middle-aged man, wearing an expression of slight irritation...
Link

Brainchildren of the ADD Child [Date: Monday, 08/13/2007 | Time: 1232.00]
[Tags|]
[Music |Gregorian - Ave Satani (The Omen)]

Hell, who needs plans? Everyone knows I can't work on one project for more than 15 minutes!
Image Hosted by ImageShack.us

Building up and then destroying people's hopes is fun!!
See ya next time, folks!
Link1 comment | Leave a comment

Up next (hopefully)... Battle mode! [Date: Wednesday, 08/08/2007 | Time: 1510.00]
[Tags|]
[Music |Juno Reactor - Navras]

Sorry for the lack of Japan Time yesterday...

Dammit, now that term is official.

My next goal is to get Battle Mode working as soon as possible.
The demo will be posted on the Storm of Bullets forums.
WHEN IT'S DONE.
Link1 comment | Leave a comment

NEW CHALLENGER APPROACHING [Date: Monday, 08/06/2007 | Time: 1435.00]
[Tags|, ]
[Music |Hans Zimmer - Roll Tide]

Image Hosted by ImageShack.us

The majority of the content (Characters, maps, game modes) is going to be unlockable.
In fact, in the beginning the only characters you'll have will be 'real world' vehicles, and the only map will be the ordinary "Panic! Stadium".
How do you unlock stuff? Well, in your explorations through space, you might get some strange readings...

Image Hosted by ImageShack.us


Wait a second, there's gonna be maps? OMG, spoilers!
Link1 comment | Leave a comment

Naze NANI!?!?!?!? (Nadesico?) [Date: Friday, 08/03/2007 | Time: 1041.00]
[Tags|, , ]
[Music |Uematsu Nobuo - Advent: One Winged Angel]

In this episode, you will get an exclusive look at the insides of Panic! Shooter.

Here is what the player sees:
Image Hosted by ImageShack.us

This is what it looks like to the programmer:
Image Hosted by ImageShack.us


That's pretty much it. Tune in next time for the point where I can't keep avoiding programming the engine! There'll be a car chase, guns, and explosions!
Link2 comments | Leave a comment

navigation
[ viewing | most recent entries ]
[ go | earlier ]

Advertisement