-
Posts
6,910 -
Joined
Content Type
Forums
News
20th
EduGeek EDIT Conference
Blogs
Everything posted by LosOjos
-
I don't have either phone so can't comment there, but even with a 20% discount, that seems expensive for a contract. Have you shopped around?
-
Hi @Natashac15 My best advice is to tackle it in stages - produce the base report from SIMS first, then record some macros to perform the actions you want. Study the code the macros create in VBA Editor, you won't need to understand every single instruction but you'll need to at least get the gist of what each part does. Once you're in a position where you can run your macro against the SIMS report manually and get the outcome you want, then move on to dropping your macros in to the SIMS Excel template. There used to be a Capita SIMS document explaining how to get started with Excel templates, but I can't find it (then again, I can rarely find what I want on SupportNet; roll on the upgrade!). Does anyone know where you can get a copy of that document these days?
-
Turns out there appears to be a bug in the implementation of Forms.Timer, meaning once stopped, it will not restart. So here's an updated version using Sytem.Timer instead: Imports System.Diagnostics Imports System.Timers Public Class Form1 Private Const PROCESS_NAME As String = "notepad" ' the name of the process Private Const BALLOON_TIMEOUT As Integer = 5000 ' time in millis to display balloon Private Const BALLOON_TITLE As String = "SCHOOLNAME Network Portal" ' title of the balloon Private Const BALLOON_STARTED As String = "System backup started." ' text to display when process starts Private Const BALLOON_FINISHED As String = "System backup complete." ' text to display when process exits Private Const TIMER_INTERVAL As Integer = 10000 ' time in milis to run each check for the process Private timer As New Timer() Private Sub timer_Elapsed(sender As Object, e As EventArgs) 'collect matching processes Dim runningProcesses As Process() = Process.GetProcessesByName(PROCESS_NAME) ' collecting processes by name means it's possible we might get multiple matches ' I will assume the first match is correct, however you may want to think ' about how to handle the event that more than one match is found. ' If the process is found, display a balloon to inform the user ' and stop the timer as there's no longer a need to monitor for new ' processes. We also add an event handler to the process's Exited ' event, so that we will get an interrupt when the process completes. If runningProcesses.Length > 0 Then runningProcesses(0).EnableRaisingEvents = True AddHandler runningProcesses(0).Exited, AddressOf p_Exited NotifyIcon1.ShowBalloonTip( _ BALLOON_TIMEOUT, _ BALLOON_TITLE, _ BALLOON_STARTED, _ ToolTipIcon.Info) timer.Stop() End If End Sub ' This event is triggered when the process we find on Timer_Tick is closed or ' otherwise exits for any reason. We will display a balloon to inform the user ' the process is complete, then restart the timer to continue monitoring ' for the process to be started again. Private Sub p_Exited(ByVal sender As Object, ByVal e As System.EventArgs) NotifyIcon1.ShowBalloonTip( _ BALLOON_TIMEOUT, _ BALLOON_TITLE, _ BALLOON_FINISHED, _ ToolTipIcon.Info) timer.Start() End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load AddHandler timer.Elapsed, AddressOf timer_Elapsed timer.Interval = TIMER_INTERVAL timer.Start() End Sub End Class Notifier.zip
-
Is the code making up the body of the form that contains the NotifyIcon and Timer? If you want, I'll take a look at your project for you? If you don't want to post it here, PM me for my email address.
-
I'm really not sure then - have you tried running the project I attached and if so, does that work? Which version of VS are you using? EDIT: are you absolutely certain about those object names? Everything points to them being wrong... also, have you just tried running it anyway? I noticed myself that the IDE seemed to be a little slow at times, but building/running the project caused a full update, clearing any no longer existing errors.
-
Looks like your BackupCheck object is actually called BackupTimer (going off the Tick event's name), so change BackupCheck to BackupTimer. Also, check the name of your NotifyIcon, the underline suggests it's not called NotifyIcon1. Looking at where the highlighted errors are, that should fix it.
-
I've knocked a little sample together for you, code below and project attached. Ended up doing it slightly differently as under inspection, it seems by default the Exited event only triggers for processes started from VB. The principle is still the same, it's just that we now manually add the event handler to the process once we capture it. One thing to note - make sure your NotifyIcon actually has an icon set, otherwise it will not display. Also, I tested using Notepad as my monitor process, change the PROCESS_NAME constant to whatever your backup process is called Imports System.Diagnostics Public Class Form1 Private Const PROCESS_NAME As String = "notepad" ' the name of the process Private Const BALLOON_TIMEOUT As Integer = 5000 ' time in millis to display balloon Private Const BALLOON_TITLE As String = "SCHOOLNAME Network Portal" ' title of the balloon Private Const BALLOON_STARTED As String = "System backup started." ' text to display when process starts Private Const BALLOON_FINISHED As String = "System backup complete." ' text to display when process exits Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick 'collect matching processes Dim runningProcesses As Process() = Process.GetProcessesByName(PROCESS_NAME) ' collecting processes by name means it's possible we might get multiple matches ' I will assume the first match is correct, however you may want to think ' about how to handle the event that more than one match is found. ' If the process is found, display a balloon to inform the user ' and stop the timer as there's no longer a need to monitor for new ' processes. We also add an event handler to the process's Exited ' event, so that we will get an interrupt when the process completes. If runningProcesses.Length > 0 Then runningProcesses(0).EnableRaisingEvents = True AddHandler runningProcesses(0).Exited, AddressOf p_Exited NotifyIcon1.ShowBalloonTip( _ BALLOON_TIMEOUT, _ BALLOON_TITLE, _ BALLOON_STARTED, _ ToolTipIcon.Info) Timer1.Stop() End If End Sub ' This event is triggered when the process we find on Timer_Tick is closed or ' otherwise exits for any reason. We will display a balloon to inform the user ' the process is complete, then restart the timer to continue monitoring ' for the process to be started again. Private Sub p_Exited(ByVal sender As Object, ByVal e As System.EventArgs) NotifyIcon1.ShowBalloonTip( _ BALLOON_TIMEOUT, _ BALLOON_TITLE, _ BALLOON_FINISHED, _ ToolTipIcon.Info) Timer1.Start() End Sub Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Timer1.Start() End Sub End Class EDIT: this is the first thing I've coded in VB.NET in about 10 years - bloody painful language! Notifier.zip
-
Sure, if you don't mind waiting until later? Once I get back home, I'll throw a sample application together for you and post up the code
-
You can actually get a pointer to an already running process, which in turn gives you a Process object you can watch for the Exited callback, should solve your problem - https://msdn.microsoft.com/en-us/library/z3w4xdc9%28v=vs.110%29.aspx So my flow would be: * start a timer * when timer ticks, collect process using GetProcessByName - no process? It isn't running, so exit. - got the process? Stop timer, assign Exited callback to it, popup tooltip * Exited gets called - pop up tooltip, release process, restart timer
-
Problem is, doing this on a timer means you're now not only bombarding your user with tooltips, you're starting the process every 10 seconds too. I think you want to look at using the Process.Exited callback instead of a timer - this will get called when the process finishes running: https://msdn.microsoft.com/en-us/library/system.diagnostics.process.exited%28v=vs.110%29.aspx
-
What isn't happening? On the face of it, this code only deals with the tooltip, no other calls are made here. If your timer is running, then every 10 seconds this will run, displaying a tooltip for 5 seconds - meaning the user will have a tooltip popup every 5 seconds! Is that what you want?
-
You could put them on /r/GiftOfGames if you happen to like dealing with asshat moderators. [source: lots of frustrating dealings with /r/GoG moderators]
-
[news] Nintendo taking Ad Revenue from YouTubers
LosOjos replied to abillybob's topic in Jokes/Interweb Things
@X-13 - a website's T&C's/Fair Use/AUP/etc. never supersedes local* law. * local to the user, not the website -
I'm happy to take a look for you, PM me if you don't want to post it here Something that might help though is to comment out the "On Error GoTo ErrorHandler" line at the start of Auto_Open() - this overrides VBA's own "error handling" (i.e. throwing an error message and ceasing) but in so doing disables the debugger. If you comment that line out then when the error occurs, you can hit 'debug' in the resulting error message popup to see exactly where the problem is occurring to see if it sheds any light. One gotcha - the default code in the template hides Excel at the beginning of execution, meaning it will be totally invisible in Windows. To show it again when debugging, type in the Immediate Window (CTRL+G to bring this up if you don't see it) "Application.Visible=True"
-
This may be old news, but I only found this out today so thought I'd share. It turns out that the analog sticks used in PS4/XB1 have identical internal fittings, making them interchangeable. Now, if only somebody would make an XB1 style pad for the PS4! I know you can use an XB1 pad with a PS4 using a device like the CronusMAX, but I'd love someone to make a fully functional PS4 pad (i.e. with touch pad and LED) with similar ergonomics to the XB1 pad. In fact, I've been wondering how difficult this would be with access to a 3D printer...
-
To keep things readable, I generally put a call to my custom routine just after the page settings section of Auto_Open(). By that point in the code, the default macros havedone all of the important parts of their work. As for Sheets.Select - are you trying to select an individual sheet? My guess is to make that the first thing the user sees? If so, make sure first of all you precede it with ActiveWorkbook (i.e. ActiveWorkbook.Sheets(x).Select) - this will ensure you're trying to select a sheet on the final workbook, not the book containing macros (as the macro book simply produces a new worksheet and closes, you can verify this by inspecting the VBA for the final workbook - there's no code!) Don't rely on the sheet's ID to select it, as this will likely be different in the new workbook. Instead select it by name (ActiveWorkbook.Sheets("Sheet Name Here").Select). Without seeing the actual code, it's tricky to help much more.
-
Hi Sarah and welcome to Edugeek Strictly speaking, your code doesn't have to go after the FixAddressColumn of the report - from a pure VBA stand point, you code could go anywhere in the Auto_Open() routine and still run when the sheet opens - Auto_Open() is a special routine in VBA that, if present, Excel will execute automatically upon opening the workbook. However, the existing code in the default Excel template contains a lot of code to handle the formatting of your SIMS report (in fact, SIMS actually produces a CSV which this VBA code processes to turn in to a formatted Excel document). So although strictly speaking your code doesn't have to go in that section, it's a good idea to put it there to ensure the worksheet you're expecting SIMS to produce is ready before you make any further alterations to it. EDIT: just to clarify, if you run a SIMS report using the default portrait/landscape Excel output, these macros are actually run in a hidden Excel window to produce your report, so the worksheet you actually see is actually the result of these macros formatting. This is why you sometimes see an empty workbook flash on screen before your report, or a prompt to enable macros
-
How about a nice compact mATX? Gigabyte GA-H81M-DS2 - 38.99 Core i5 3.1GHz - 145.54 Crucial4GB RAM (1 stick, leaves room for upgrades) - 27.76 430W Corsair PSU - 36.18 Cooler Master mATX Case - 34.00 Seagate 1TB SSHD - 61.76 Edimax N150 Wifi Dongle - 7.49 Total: £351.72 (from eBuyer) No monitor, keyboard, mouse or OS there - did you need those working in to the cost? EDIT: or, yeah, a much better offer on a pre-built! Ah well, I won't pretend I don't enjoy theoretical PC building EDIT2: just noticed there's no exhaust fan in the case. You can get away without, but I'd sooner have one personally. Be Quiet make good silent fans for under a tenner, but any 80mm fan will do. Generally the more you pay the better (quieter, longer lasting), but I'd be reluctant to spend any more than £10 on an 80mm fan. This one would do you nicely: http://www.ebuyer.com/387610-be-quiet-shadow-wings-sw1-80mm-mid-speed-case-fan-bl051
-
I'd use INDEX and MATCH rather than VLOOKUP. MATCH can be set to return an exact match or the nearest match that is greater/less than; very handy for these kinds of lookups as you can use ranges of values rather than having to create a table for every possible outcome! MATCH returns a position rather than a value, so you couple it with INDEX to retrieve the value at that position.
-
Pfft, what a time for my daughter to decide she's having a birthday and make me go out and spend all my money on presents!
-
The Ten Commandments for C Programmers (Annotated Edition) As someone who's just getting in to C, this seems like it'll save me a lot of headaches down the line!
-
Have to echo @3s-gtech - aside from being an unneccesary resource hog, with an increasing number of sites ditching flash in favour of HTML5 and most mobile devices lacking support for it, there's really no good reason to be shoving flash on, well, anything anymore. There are tools that will help you recreate your flash animation in HTML5 though, such as this one: Mixeek - Free HTML5 animation tool (If you go to "File > Export Source" when you're done, you can drop the resulting HTML code straight on to your page/template)
-
You could, but why would you? Just got what @Banjo meant - I thought they were talking about a blank DB rather than restoring a backup Sorry @Banjo! You are warned in so far as it asks you to confirm deletion, but that's all. It's the aspects themselves (as well as gradesets and resultsets) that can't be deleted whilst they're in use.
-
It will only be "stuck" at 30FPS if you have VSync on or that's as much as it can handle. Disable VSync and see what kind of framerate you get. If Sony have told you that the TV has HDMI 2, I'd be inclined to believe them. Their website does say that this range is HDMI 2 compatible, though they don't actually list 3840x2160/60p as a supported resolution - you might want to email them back and clarify that:4K Ultra HD TV | X8500B 4K LED TV with TRILUMINOS Display | Sony UK The problem is your GPU; it only supports HDMI 1.4. So far as I can tell, there is not a HDMI -> DP adapter that supports 4K @ 60Hz. Without some source of 3840x2160/60p content, I can't see any way you can test that the TV is actually capable of what is stated. TL;DR - ask Sony.
-
There's nothing you can do, but I wouldn't sweat it; your GPU won't handle 4K @ 60FPS anyway! EDIT: meant to say for games. It might work fine for movies, but 30Hz should be fine for that. Displayport is an annoying "standard" seemingly invented to enable the sale of ridiculously expensive monitors.
