Salesforce and saving to server

Receiving the following error when Force.com IDE is started? com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor Try switching workspace - to the very same workspace! File -> Switch Workspace -> Other.. Select the same workspace, OK and voilá! Source

MVC 3 json post array workaround

Ajax-posting a JSON object containing arrays using jQuery work fine in PHP, but since ASP.NET expects the array to be posted with indeces a tiny workaround is required. Consider the following example:

var jsonData = { foo: 0, bar: [1, 2] };
$.post("/post-url", postData, function () {});

This will cause the post data to look like

foo=0
bar[]=1
bar[]=2

PHP acceps this, but ASP.NET requires the post data to be

foo=0
bar[0]=1
bar[1]=2

Here’s a workaround. Run it before $.post.

Using swftools to extract resources from flash swf files

There’s a nifty tool called Swftools out there which enables you to extract resource files out of an swf file (Adobe Flash). This little bash one-liner will extract all sounds from an swf file: for i in swfextract soundboard.swf |grep Sounds:|cut -c 24-|sed ’s/,//g’; do swfextract -s $i soundboard.swf

Your old backup is about to become unreadable

After spending a few hours in the past weekend, copying old photographs and various other files from CD’s and DVDs in the archive, I have sadly learned that discs do have a limited durability. Out of 24 CD-R’s my computer was unable to read 6 of them. For the record, the CD-R’s were burned in the years 2000 and 2001 and are of various brands. If you have precious data on CD’s or DVDs, my advice to you is to back it up on other media - now. Preferably on a good NAS storage solution so you can access it at any time from any device.

Group_concat in T-SQL

You may wish group_concat while working with MS SQL Server. Here’s a solution! Say you have these tables: a: id, content b: id, val rel_a_b: a_id, b_id The SQL query [default]select a.*, stuff( ( select cast(’;’ as varchar(max)) + b.val from b inner join rel_a_b on b.id = rel_a_b.b_id and rel_a_b.a_id = a.id for xml path(’’) ),1,1,’’) as vals_combined from a[/default]

dvbloopback in Linux 2.6.38

Compiling and using sasc-ng and dvbloopback with Linux 2.6.38 is a hassle. Here’s how to get it working. Prequisites: Ubuntu Lucid Kernel 2.6.38-11-generic We need to patch both the kernel dvb module as well as the dvbloopback source. Download linux-2.6.38-dvb-mutex.patch to your home folder. $ sudo apt-get install linux-headers-uname -r Now let’s get the kernel source, patch it, and recompile the dvb-core module. $ cd /usr/src $ sudo apt-get source kernel-image-uname -r $ cd linux-2.6.38 $ sudo patch -p1 < ~/linux-2.6.38-dvb-mutex.patch $ sudo make mrproper $ sudo cp /boot/config-$(uname -r) .config $ sudo cp /usr/src/linux-headers-uname -r/Module.symvers /usr/src/linux-2.6.38/ $ sudo make oldconfig $ sudo make prepare $ sudo make scripts $ sudo make M=drivers/media/dvb/dvb-core $ sudo cp /usr/src/linux-2.6.38/drivers/media/dvb/dvb-core/dvb-core.ko /lib/modules/uname -r/kernel/drivers/media/dvb/dvb-core/ Next, head to your sasc-ng source directory and apply the following patch [c] — contrib/sasc-ng/dvbloopback/module/dvblb_forward.c 2011-04-25 02:44:10.511089600 +0300 +++ contrib/sasc-ng/dvbloopback/module/dvblb_forward.c 2011-04-24 21:04:17.000000000 +0300 @@ -166,9 +166,9 @@ struct file ftmp = find_forwardmap(lbdev, f->private_data); if (!ftmp || IS_ERR(ftmp)) return -EFAULT; - if (lbdev->forward_dev->fops &&lbdev->forward_dev->fops->ioctl) - return lbdev->forward_dev->fops->ioctl( - ftmp->f_dentry->d_inode, ftmp, cmd, arg); + if (lbdev->forward_dev->fops &&lbdev->forward_dev->fops->unlocked_ioctl) + return lbdev->forward_dev->fops->unlocked_ioctl( + ftmp, cmd, arg); return -EFAULT; } — contrib/sasc-ng/dvbloopback/module/dvb_loopback.c 2011-04-25 02:44:10.511089600 +0300 +++ contrib/sasc-ng/dvbloopback/module/dvb_loopback.c 2011-04-25 00:42:54.234135688 +0300 @@ -118,9 +118,9 @@ / This is a copy of dvb_usercopy. We need to do this because it isn’t exported by dvbdev */ -static int dvblb_usercopy(struct inode *inode, struct file *file, +static int dvblb_usercopy(struct file *file, unsigned int cmd, unsigned long arg, - int (*func)(struct inode *inode, struct file *file, + int (*func)(struct file *file, unsigned int cmd, void arg)) { char sbuf[128]; @@ -180,7 +180,7 @@ } / call driver */ - if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) + if ((err = func(file, cmd, parg)) == -ENOIOCTLCMD) err = -EINVAL; if (err < 0) @@ -663,7 +663,7 @@ dvb_generic_ioctl) which is called by dvblb_ioctl for device-0. It is used to forward ioctl commands back to the userspace application */ -static int dvblb_looped_ioctl(struct inode *inode, struct file *f, +static int dvblb_looped_ioctl(struct file *f, unsigned int cmd, void *parg) { int ret; @@ -692,7 +692,7 @@ return ret; } -static int dvblb_ioctl(struct inode *inode, struct file *f, +static long dvblb_ioctl(struct file f, unsigned int cmd, unsigned long arg) { void * parg = (void )arg; @@ -723,7 +723,7 @@ if (lbdev->forward_dev) return dvblb_forward_ioctl(lbdev, f, cmd, arg); - return dvblb_usercopy (inode, f, cmd, arg, + return dvblb_usercopy (f, cmd, arg, dvbdev->kernel_ioctl); } / This is the userspace control device / @@ -978,7 +978,7 @@ .write = dvblb_write, .poll = dvblb_poll, .mmap = dvblb_mmap, - .ioctl = dvblb_ioctl, + .unlocked_ioctl = dvblb_ioctl, }; static struct dvb_device dvbdev_looped = { @@ -998,7 +998,7 @@ .write = dvblb_write, .poll = dvblb_poll, .mmap = dvblb_mmap, - .ioctl = dvblb_ioctl, + .unlocked_ioctl = dvblb_ioctl, }; static struct dvb_device dvbdev_userspace = { — contrib/sasc-ng/Makefile 2011-04-25 02:44:10.507089818 +0300 +++ contrib/sasc-ng/Makefile 2011-04-25 00:40:31.390323663 +0300 @@ -8,7 +8,7 @@ CC ?= gcc CXX ?= g++ -CXXFLAGS ?= -Wall -D__user= -Werror +CXXFLAGS ?= -Wall -D__user= #-Werror CFLAGS ?= -Wall -D__user= ifdef DVB_DIR @@ -17,7 +17,7 @@ endif DEFINES += -DRELEASE_VERSION="$(VERSION)" -D__KERNEL_STRICT_NAMES -INCLUDES += -Idvbloopback/module -I/lib/modules/$(shell uname -r)/build/include +INCLUDES += -Idvbloopback/module -I/usr/include LBDIR = dvbloopback/src SCDIR = sc/PLUGINS/src/$(SCVER) SC_FLAGS = -O2 -fPIC -Wall -Woverloaded-virtual @@ -57,7 +57,7 @@ INC_DEPS := $(shell ls $(LBDIR)/.h) dvbloopback/module/dvbloopback.h INC_DEPS_LB := $(shell ls dvblb_plugins/.h) -LIBS = -lpthread -lcrypto -lcrypt +LIBS = -lpthread -lcrypto -lcrypt -lv4l1 all: $(TOOL) libscanwrap.so — contrib/sasc-ng/sc/dvbdevice.cpp 2011-04-25 02:44:10.519089162 +0300 +++ contrib/sasc-ng/sc/dvbdevice.cpp 2011-04-24 21:04:17.000000000 +0300 @@ -10,7 +10,7 @@ #include “include/vdr/dvbdevice.h” #include #include -#include +#include #include #include #include diff -u -r systems/constcw/constcw.c systems/constcw/constcw.c — systems/constcw/constcw.c 2011-04-25 02:44:10.567086537 +0300 +++ systems/constcw/constcw.c 2011-04-25 02:39:59.527575519 +0300 @@ -70,7 +70,7 @@ bool cPlainKeyConstCw::Matches(const cEcmInfo *ecm) { - return ecm->prgId==prgId && ecm->source==source && ecm->transponder==transponder; + return ecm->prgId==prgId; } bool cPlainKeyConstCw::Parse(const char *line)[/c] I.e. save as sasc-2.6.38.patch in your home directory, cd to the sasc source dir and apply patch with $ patch -p0 < ~/sasc-2.6.38.patch Refer to the official sasc-ng installation page for more info http://dolot.kipdola.com/wiki/Install_SASC-NG Thanks to http://www.vanbest.org/drupal6/content/installing-sasc-ng-linux-2.6.38 and http://www.eurocardsharing.com/f273/ubuntu-11-04-sasc-ng-dvbloopback-348184