Colin Wu

1

votes
2

answer
39

views

How to detect new print jobs in Windows queue using Powershell

I am looking for a way, using PowerShell, to detect when a new print job arrives in a print queue. Have been searching for the past couple of days and the best I've come up with is reference to a 'PRINTER_CHANGE_ADD_JOB' flag here but nothing about how to use it. I would like to be able to do somet...
Colin Wu
1

votes
1

answer
613

views

Getting “undefined method `[]' for nil:NilClass” when creating record

I am porting an old Rails 3 application to Rails 4.0.15 and everything seems to be going fine except that whenever I try to create a record (even in Rails console) I am getting the above error (undefined method '[]' for nil:NilClass). I am over-simplifying things a little here but what I did was to...
Colin Wu
1

votes
2

answer
69

views

Perl Tk/Tcl: Can widget callbacks take parameters

Is it possible to create a button, for example, whose callback takes a parameters? e.g. button(-text => 'Row1', -command => \&do_something_with('Row 1')); Tried it on a test program and it doesn't seem to. If that is the case, is there some other way to do what I intend with the example above? My pr...
Colin Wu
1

votes
1

answer
196

views

Passenger can't find gems in production

Passenger: 5.0.22, Rails: 3.2.22, Capistrano 3.4.0 I built a new server and am trying to deploy a Rails application with Capistrano. Seems that after deployment Passenger can not start the web app because it can not find some gemfiles. After some digging, I found that it is only the ones that are in...
Colin Wu
1

votes
1

answer
1.4k

views

How to specify tab char as delimiter for Export-Csv (PowerShell)

A complete newbie with PowerShell here. I need to export data as a tab-delimited file and it looks like Export-Csv is the utility to use. I can't figure out how to specify the tab character though. I have tried Export-Csv -Delimiter \t and Export-Csv -Delimiter '\t'
Colin Wu
1

votes
1

answer
309

views

Print a PDF to a file in PowerShell

I need to automatically print a PDF file to a file (need to have printer driver set all the print options like stapling, duplexing, etc) on a network folder so other employees can print the .prn file from networked printers. After a fair bit of searching I have found that it is possible to have Powe...
Colin Wu
0

votes
0

answer
3

views

Compiled Perl (with ActiveTCL) won't run on some Windows 10

I am at a complete loss and am hoping someone could provide at least a hint... I wrote a (Strawberry) Perl program that uses ActiveTCL to create a GUI interface. I then 'compiled' it using pp on my Windows 10 Pro system and sent it to a friend. When he tried to run it, his Win 10 Pro system put up a...
Colin Wu
1

votes
1

answer
69

views

Perl Tkx: How to pass a variable as a parameter to a button's callback

Given this Perl/Tkx code fragment: @itemList = ({'attrib1' => 'name1', 'attrib2' => 'value1'}, {'attrib1' => 'name2', 'attrib2' => 'value2'}); $row = 0; foreach $item (@itemList) { push(@btn_list, new_ttk__button(-text => $item->{'attrib1'}, -command => sub {do_something($item->{'attrib2'});})); $bt...
Colin Wu
1

votes
1

answer
657

views

What does “&:name” mean in Ruby [duplicate]

This question already has an answer here: What does map(&:name) mean in Ruby? 14 answers I saw it in some sample Ruby code someone had posted. It was something like: a.sort_by(&:name) where a is an array or ActiveRecord objects and :name is one of the attributes. I have never seen &:name and Ruby's...
Colin Wu
1

votes
2

answer
651

views

paperclip 5.1 content-type validation too strict

I need to upload attachments with extension of .txt but evaluate to mime-type 'application/octet-stream' by the file command. The file is automatically generated by a piece of equipment and it is not feasible to rename it before uploading. I have tried: class Book < ActiveRecord::Base has_attached_f...
Colin Wu
2

votes
0

answer
1.1k

views

How to debug kernel oops “Unable to handle kernel paging request”

I changed some configuration and build a new uImage. Then I move the new uImage to /boot When I start the system, I find an oops in dmesg. The system looks working well, except that 'insmod xxx' can not be run. I am not familiar with kernel, and don't know how to debug this. In addition, I have...
colin wu
2

votes
1

answer
625

views

Auto-update text field depending on selected option

Rails ver: 4.0.0 Hi all, In my form I have a drop-down selection of client names. I would like to have a text box containing the client's address be updated whenever the selection is changed (before clicking the submit button to finalize the update). The reason is I am working with legacy data from...
Colin Wu