To list global NPM packages:
npm list -g --depth=0
To update the globally installed NPM packages:
sudo npm -g update
To list global NPM packages:
npm list -g --depth=0
To update the globally installed NPM packages:
sudo npm -g update
A few notes for me...
print “Properties are:”, obj.__dict__
I’ve got a Mac which is running a Windows 10 Parallels VM that I use for Microsoft Visual Studio 2015 development. I’m using the Express Edition of VS2015. If I code up a web application (maybe a web service or an ASP.NET Web API) and run it in the IDE, I can hit it from the browser on that machine at http://localhost:57292/api/test.
How can I consume this Windows 10 web service from my Mac?
First of all I need to know the IP address of my Win 10 machine. Fire up a “cmd" prompt and run “ipconfig”. In my case the "IPv4 Address” is 10.211.55.4
To avoid having to remember and type this address, let’s add it to the “hosts” file on the Mac. Do this from the Terminal on the Mac using “sudo vi /private/etc/hosts” and add in a new line such as:
10.211.55.4 win10
Sadly, if I fire up Safari on my Mac and try to browse to http://win10:57292/api/test or (http://10.211.55.4:57292/api/test), it won’t find the page. There are two reasons for this:
Fortunately, both of these can be overcome thanks to the handy tips on this webpage. Read it for the details, but for my quick reference I need to do the following on the Windows 10 machine:
<binding protocol="http" bindingInformation="*:57292:localhost" />
<binding protocol="http" bindingInformation="*:57292:10.211.55.4" />
NB.This step needs to be done for each new website.
>netsh http add urlacl url=http://10.211.55.4:57292/ user=everyone
>netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=57292 profile=private remoteip=localsubnet action=allow
Now, firing up Safari on the Mac and browsing to http://win10:57292/api/test should work!
If you are getting a 503 error, it could be because IIS Express hasn’t restarted and picked up the new website location. Check in the Windows System Tray for the IIS Express icon and click on it to see when there IP address is listed under the application:
If it isn’t there, stop VS2015, exit IIS Express if still running (using the ‘Exit' option above), and restart your VS2015 application.
NB. Updated for Windows 10/VS2015 here.
I’ve got a Mac which is running a Windows 7 Parallels VM that I use for Microsoft Visual Studio 2013 development. I’m using the Express Edition of VS2013. If I code up a web application (maybe a web service or an ASP.NET Web API) and run it in the IDE, I can hit it from the browser on that machine at http://localhost:57017/api/test.
How can I consume this Windows 7 web service from my Mac?
First of all I need to know the IP address of my Win 7 machine. Fire up a “cmd" prompt and run “ipconfig”. In my case the "IPv4 Address” is 10.211.55.3
To avoid having to remember and type this address, let’s add it to the “hosts” file on the Mac. Do this from the Terminal on the Mac using “sudo vi /private/etc/hosts” and add in a new line such as:
10.211.55.3 win7
Sadly, if I fire up Safari on my Mac and try to browse to http://win7:57017/api/test or (http://10.211.55.3:57017/api/test), it won’t find the page. There are two reasons for this:
Fortunately, both of these can be overcome thanks to the handy tips on this webpage. Read it for the details, but for my quick reference I need to do the following on the Windows 7 machine:
<binding protocol="http" bindingInformation="*:57017:localhost" />
<binding protocol="http" bindingInformation="*:57017:10.211.55.3" />
NB.This step needs to be done for each new website.
>netsh http add urlacl url=http://10.211.55.3:57017/ user=everyone
>netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=57017 profile=private remoteip=localsubnet action=allow
Now, firing up Safari on the Mac and browsing to http://win7:57017/api/test should work!
On my Mac, I needed to reduce the size of some scanned PDF documents - without changing the scanner settings and rescanning them. I tried to Export from Preview as a PDF using the “Reduce File Size” filter, but it made the files too blurry.
Googling revealed a nice solution, which allows you to add your own custom “Reduce File Size” filters to Preview’s Export window. Once you’ve done this once, you can use them whenever you need to:
I am going to repost how to do this here, so I don’t lose it. The original can be found at: http://hints.macworld.com/article.php?story=20120629091437274
I was never satisfied with results of "Reduce File Size" Quartz filter when trying to make some PDFs smaller before sending them by e-mail. It made them too small, and the graphics were fuzzy.
I eventually found where these filters are:
/System/Library/Filters
I was delighted to find out they're XML files easily editable with TextEdit (or any other text editor). I also found why this particular filter makes quite unusable PDFs, as these parameters were just too low:
Compression Quality 0.0
ImageSizeMax 512
So I copied this file to my Desktop, and then made two more copies of it, and called them Reduce File Size Good, Better and Best. Then I changed the parameters of each file to 0.25, 0.5 and 0.75 for Compression Quality, and used these three values for ImageSizeMax:
842 (that's A4 at 72dpi)
1684 (A4 at 144dpi)
3508 (A4 at 300dpi)
Finally, I changed the default string for the Name key at the end of each file to reflect the three settings, so they display the names I have given them in the menu.
Then I copied them to a /Library/Filters folder I created (for some reason, ~/Library/Filters doesn't work in Lion) and now when I open a picture or PDF in Preview, I have the option of four different qualities for reduced file sizes.
As an example, I have a JPEG of scanned A4 invoice at 300dpi and it's 1.6MB. When exporting to PDF in reduced size, the file is only 27 KB and it's quite unusable - very fuzzy and hard to read. The Good one is much easier to read, slightly fuzzy and still only 80 KB. Better is 420 KB and clear, and the Best is 600 KB and almost as good as the original even on a laser printer.
A few notes:
Public Property Let MyProperty(sValue As String)
...
End Property
Public Property Let MyProperty(ByVal sValue As String)
...
End Property
[id(0x68030000), propput]
HRESULT MyProperty([in, out] BSTR* );
[id(0x68030000), propput]
HRESULT MyProperty([in] BSTR );
Public Sub TestMethod(ByVal sArgIn As String, Optional sArgOut As String)
HRESULT TestMethod(
[in] BSTR sArgIn,
[in, out, optional] BSTR* sArgOut);
.\MyDll13.IDL(30) : warning MIDL2400 : for oleautomation, optional parameters should be VARIANT or VARIANT * : [optional
] [ Parameter 'sArgOut' of Procedure 'TestMethod' ( Interface '_TestClass' ) ]
using System.Runtime.InteropServices;
namespace MyDllNet
{
[ProgId("MyDll.TestClass")]
[ComVisible(true)]
[Guid("D860A2A8-5003-4714-AE59-918FE2B0FC42")]
public class MyProxyClass : MyDll13ModifiedTA.TestClass
{
public string GetVersion()
{...}
public void TestMethod(string sArgIn, [OptionalAttribute]ref string sArgOut)
{...}
}
}
| C# DLL implements IDL with optional BSTR* argument | ||
|---|---|---|
| VB6 Binding | Pass One Arg | Pass Two Args |
| Early Binding | OK | OK |
| Late Binding | OK | Error "Type mismatch" |
public void TestMethod(string sArgIn, [OptionalAttribute]ref object sArgOut) {}
| C# DLL implements IDL with optional VARIANT* argument | ||
|---|---|---|
| VB6 Binding | Pass One Arg | Pass Two Args |
| Early Binding | Error clr.dll APPCRASH | Error clr.dll APPCRASH |
| Late Binding | OK | OK |
Imports System.Runtime.InteropServices
<ProgId("MyDll.TestClass")>
<Guid("D860A2A8-5003-4714-AE59-918FE2B0FC42")>
Public Class MyProxyClass
Implements MyDll13TldAssembly.TestClass
Public Function GetVersion() As String Implements MyDll13TldAssembly._TestClass.GetVersion
...
End Function
Public Sub TestMethod(ByVal sArgIn As String, Optional ByRef sArgOut As String = Nothing) Implements MyDll13TldAssembly._TestClass.TestMethod
...
End Sub
End Class
HKEY_CLASSES_ROOT\MyDll.TestClass\CLSID
+-- (Default) {ABB83F02-4012-45E4-ADD6-D2E79F45381D}
HKEY_CLASSES_ROOT\CLSID\{ABB83F02-4012-45E4-ADD6-D2E79F45381D}
+-- InProcServer32
+-- (Default) C:\code\MyDll.dll
+-- TypeLib
+-- (Default) {EACF9A0F-461E-4A36-A195-43ECDE3C5FBA}
+-- VERSION
+-- (Default) 1.1
HKEY_CLASSES_ROOT\TypeLib\{EACF9A0F-461E-4A36-A195-43ECDE3C5FBA}
+-- 1.1
+-- 0
+-- win32
+-- (Default) C:\code\MyDll
[assembly: Guid("EACF9A0F-461E-4A36-A195-43ECDE3C5FBA")]
Reference=*\G{EACF9A0F-461E-4A36-A195-43ECDE3C5FBA}#1.1#0#MyDll.dll#
[ProgId("MyDll.TestClass")]
[ComVisible(true)]
[Guid("ABB83F02-4012-45E4-ADD6-D2E79F45381D")]
public class MyProxyClass : MyDllTlbAssembly.TestClass
{ ...
I use so many different IDEs that there are a few key combinations that I just don't remember. Here's a quick list for next time I'm hunting:
| Command | Keys I Use | Keys Others Use |
|---|---|---|
| Edit-Intellisense-Resolve | Alt-Shift-F10 | Ctrl-+ |
| Right Click-Go to Definition | Shift-F2 | F12 |
AM.1804 : Connection to service failed.
novl-sslvpn-service-install.exe
cacert.pem
openvpnclient.msi
PrivilegeDetector.exe
vplogin.dll
I've got a C# DLL that is used from a number of different places, including .Net EXEs, VB6 EXEs, Work and Outlook COMAddIns and also Outlook forms. It uses log4net for tracing and debugging.
I'd found log4net to be pretty reliable BUT sometimes messages weren't ending up in my log file (usually when I really needed them!). Most recently this happened today when I was trying to trace a problem in my Outlook form. I'd drag the appointment in Outlook which would fire the Item Write event on the form and, although I could loo kin the DB and see that my DLL was working, nothing was showing up in the log4net log file.
To find out what was really happening, I used log4net's internal debugging. In the case of an Outlook Form, I switched it on like this:
When I ran the test again with log4net debugging switched on, I could clearly see that log4net was unable to write to my logfile because it was locked. I didn't obviously have it locked (I had it open in TextPad but closing that didn't fix the problem). A quick scout around revealed that log4net with the RollingFileAppender by default will lock the file and keep it locked. Clearly this was the problem in my case where multiple programs all use my DLL which writes to the same logfile.
I do want all of the instances of my DLL to write to the same log file, but I don't want them to lock the file and keep each other out. The solution was to add the following to the appender section of my log4net configuration file:
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
This instructs log4net to get the lock, write and release the lock every time - so it doesn't keep the file locked. With this in place, all of my DLL instances now write to the logfile, ALL of the time! There is a slight performance overhead to this approach, but then I'd rather than it works slowly, than not working quickly!
I had a PL/SQL package (let's call it PACKAGE_A) in schema SCHEMA_A which called a procedure in PACKAGE_B in SCHEMA_B. When I added a new parameter to the procedure in PACKAGE_B, I got some very strange errors showing up in PACKAGE_A. After trying all combinations of compiling PACKAGE_A and PACKAGE_B and REVOKEing and GRANTing EXECUTE rights to PACKAGE_B, I was consistently coming up with this Oracle error when I ran PACKAGE_A:
ORA-06508: PL/SQL: could not find program unit being called
Note that PACKAGE_A would compile fine, it just wouldn't run. I finally managed to get rid of this error by logging off my PL/SQL session in SCHEMA_A and then logging back in. After that, my PACKAGE_A call worked fine. "When in doubt, reboot!" A pretty old-school solution but it was the answer in this case!
NB. Oracle Version 10g Enterprise Edition 10.2.0.2.0
I had a VB6 program running on a server using Outlook 2003 client to create appointments. The appointments used a custom Outlook form stored in the Organizational Forms Library. Suddenly the program started spitting out this error:
"The form required to view this message cannot be display. Contact your administrator."
If I used the Outlook Client (on the server) to try to design the form via Tools-Forms-Design Form-Organizational Forms Library-{shift}+Open then I got the following error message:
"The form you selected cannot be displayed. The form required to view this message cannot be display. Contact your administrator."
The solution was to clear the Outlook Forms cache. This can be done via:
Credit for these steps from http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_24342937.html
SELECT 'ALTER '
||decode(object_type,'PACKAGE BODY','PACKAGE', object_type)
||' '||object_name||' COMPILE'
||decode(object_type,'PACKAGE BODY',' BODY', '')||';'
FROM user_objects
WHERE status = 'INVALID'
AND object_type <> 'SYNONYM'
ALTER TRIGGER CUST_AUI COMPILE;
ALTER PACKAGE CUST_PKG COMPILE;
ALTER PACKAGE CUST_PKG COMPILE BODY;
ALTER VIEW CUST_VW COMPILE;
ALTER PACKAGE CUST_AUDIT_PKG COMPILE BODY;
$htpasswd2 -m /etc/svn-auth-file xyz
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode xmlns="">env:Server</faultcode>
<faultstring xmlns="">ORABPEL-08021 Cannot find partner wsdl. parnterLink "MyService" is not found in process "MyService" (revision "1.0") Please check the deployment descriptor of the process to find the correct partnerLink name.
</faultstring>
<faultactor xmlns=""></faultactor>
</env:Fault>
</env:Body>
</env:Envelope>
http://myserver:8888/orabpel/default/MyService/1.0/MyService
http://myserver:8888/orabpel/default/MyService/1.0
http://myserver:8888/orabpel/default/MyService
I have a .Net DLL which I want to use from VB6 via COM interop. Where should I put it when I deploy it? (look here to see how to make a .Net DLL useable via VB6)
The key thing is that in order to use your .Net dll from VB6 you do need to register the .Net DLL. You don't need to to do anything special in the VB6 program - it doesn't matter how you reference the .Net DLL in your VB6 program. The command to register a .Net DLL is "regasm". This lives under "C:\Windows\Microsoft.Net\Framework\v2.0.50727" (or whatever .Net framework version you have).
There are three options for where to put your .Net DLL:
1. Put it in the GAC. If you want to share the same .Net DLL with more than one VB6 program then you can put it in the GAC (Global Assembly Cache). To do this, you can use an MSI file, or manually, you can copy it to c:\windows\assembly, and then register it via "regasm c:\winnt\assembly\mydotnet.dll".
2. Put it in the EXE folder. If you want the .Net DLL to live in the same place as your VB6 EXE then you can copy it to that folder, and then use "regasm c:\vb6\exe\folder\mydotnet.dll". Note that the .Net DLL has to be in the same folder as the VB6 EXE. So if you have VB6 EXE calling a VB6 DLL which calls your .Net dll then it must go in the EXEs folder - it won't find it in VB6 DLLs folder.
3. Put it in any folder via codebase. If you want the .Net DLL to live anywhere else, you can use use "regasm c:\program files\vanwills\mydotnet.dll /codebase". This will register the .Net DLL to the path you provide. This is a bit like the old VB6 regsvr32 command. So using this we can have the .Net DLL sitting in the "c:\vb6\dll\folder" folder.
The only other point to note is that .Net will always check the GAC first before other locations. So if we have a .Net DLL in the GAC, then even if we register the same DLL somewhere else via the "/codebase" option, it will always use the GAC DLL. You can get around this by changing the version number on the DLL - it will always load the version with the highest number first.
<configuration>
<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>
</configuration>
[assembly: log4net.Config.XmlConfigurator
(Watch = true)]
[assembly: log4net.Config.XmlConfigurator
(ConfigFile = "log4net.config", Watch = true)]
[assembly: log4net.Config.XmlConfigurator
(ConfigFile = "../../log4net.config", Watch = true)]