Thursday, 3 October 2013

Trigger is not working and value not auto selected

Trigger is not working and value not auto selected

Trigger is not working and state value not auto selected from state drop
down. I have form and onchange event fill listing information into
country,state..etc in that form. state is by default hidden field and
populate upon change in country field. customField are form field
jr_country, jr_state..etc
for (customField in ui.item) {
if (customField == 'value' || customField == 'label') continue;
if (ui.item[customField] == null || ui.item[customField] == ''
|| ui.item[customField] == 'undefined') continue;
try{
var fieldObject =
jQuery('#jr-form-listing').find('.'+customField);
if(fieldObject.is('input')){
var fieldType = fieldObject.attr('type');
switch (fieldType) {
// radio buttons
case 'radio':
jQuery(fieldObject.selector + '[value=' +
ui.item[customField].replace(/\*/g,'') +
']').click();
break;
// text and other types
default:
fieldObject.val(ui.item[customField]);
break;
}
} else if(fieldObject.is('select')) {
jQuery(fieldObject.selector + ' option[value=' +
ui.item[customField].replace(/\*/g,'') +
']').attr('selected', 'selected');
}
fieldObject.trigger('change');
} catch(err){
//alert(customField); // show error field name
}
}
}

Wednesday, 2 October 2013

Ant: NoClassDefFound exception

Ant: NoClassDefFound exception

I am developing a java project. My instructor wants us to strictly use
apache ant for compilation. I knew nothing about it, and don't know about
apache ant either. I have generated an ant buildfile and edited that for
target "run", so that program will run after ant run command.
I am getting following error,
Exception in thread "main" java.lang.NoClassDefFoundError: src/Client
[java] Caused by: java.lang.ClassNotFoundException: src.Client
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
[java] at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
[java] Could not find the main class: src.Client. Program will exit.
I think I have resolved all the target dependencies. But still this error
persists.
Can somebody help me? This is my ant build.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
Any modifications will be overwritten.
To include a user specific buildfile here, simply create one
in the same
directory with the processing instruction
<?eclipse.ant.import?>
as the first entry and export the buildfile again. -->
<project basedir="." default="build" name="client">
<property environment="env"/>
<property name="ECLIPSE_HOME" value="../../../../usr/lib/eclipse"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.6"/>
<property name="source" value="1.6"/>
<path id="client.classpath">
<pathelement location="bin"/>
<pathelement location="libthrift-1.0.0-javadoc.jar"/>
<pathelement location="libthrift-1.0.0.jar"/>
<pathelement location="log4j-1.2.14.jar"/>
<pathelement location="slf4j-api-1.5.8.jar"/>
<pathelement location="slf4j-log4j12-1.5.8.jar"/>
</path>
<target name="init">
<mkdir dir="bin"/>
<mkdir dir="build"/>
<copy includeemptydirs="false" todir="bin">
<fileset dir="src">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
<echo message="${ant.project.name}: ${ant.file}"/>
<javac debug="true" debuglevel="${debuglevel}" destdir="bin"
source="${source}" target="${target}">
<src path="src"/>
<classpath refid="client.classpath"/>
</javac>
</target>
<target name="jar" depends="init">
<mkdir dir="build/jar" />
<jar destfile="client.jar" basedir="bin">
<manifest>
<attribute name="Main-Class" value="src.Client" />
</manifest>
</jar>
</target>
<target description="Build all projects which reference this project.
Useful to propagate changes." name="build-refprojects"/>
<target description="copy Eclipse compiler jars to ant lib directory"
name="init-eclipse-compiler">
<copy todir="${ant.library.dir}">
<fileset dir="${ECLIPSE_HOME}/plugins"
includes="org.eclipse.jdt.core_*.jar"/>
</copy>
<unzip dest="${ant.library.dir}">
<patternset includes="jdtCompilerAdapter.jar"/>
<fileset dir="${ECLIPSE_HOME}/plugins"
includes="org.eclipse.jdt.core_*.jar"/>
</unzip>
</target>
<target description="compile project with Eclipse compiler"
name="build-eclipse-compiler">
<property name="build.compiler"
value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<antcall target="build"/>
</target>
<target name="Client">
<java classname="Client" failonerror="true" fork="yes">
<classpath refid="client.classpath"/>
</java>
</target>
<target name="run" depends="jar">
<java jar="client.jar" fork="true">
</java>
</target>
</project>
Can anybody spot the mistake for me?

Sound effects library

Sound effects library

I am trying to add some Audio effect to a stream. namely Echo and Chorus.
I can't find any library that can allow me to add effects to sound. Does
anyone know about any good library?
Google didn't help much :-(

Apply border to uiBarButtonItem in ios7

Apply border to uiBarButtonItem in ios7

I have seen UIBarButtonItem,UIButtons are borderless in ios7.But I want to
have the appearance of UIBarButtonItem like in <=ios6.At the same time I
cannot apply a particular backgroundimage because navigationbar tint
colour changes from some set of views to other views. How can I set
borderstyle in [UIBarButtonItem appearance] may be by using some CALayer
properties or so ..?
Any help would be appreciated..

Tuesday, 1 October 2013

open specific part of table of contents of chm file c# or vb.net

open specific part of table of contents of chm file c# or vb.net

I have a .chm file called help, In that file I have a structure like:
Introduction
-item1
-item2
Topic1
-item1
-item2
Topic2
-item1
-item2
Topic3
Now I want to open Topic1 inside c# or vb.net I have tried:
Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.Index, "Topic1")
Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.TableOfContents,
"Topic1")
but is not working, then I tried to give inside chm file an index to
Topic1 (31) and tried:
Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.Index, "31")
Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.Index, "Item1")
It gives execption, only working code is:
Help.ShowHelp(ParentForm, "Help.chm", HelpNavigator.TableOfContents,
Nothing)
How to open Topic1 ?

What would the perl commands be for this script?

What would the perl commands be for this script?

I have a short bash script that finds the release ID in /etc/os-release,
and prints a string based on that result. I would like to convert it to
perl, if possible. I'll appreciate any help with this.
Here is the script that I'm using:
#!/bin/bash
grep "ID=fedora" /etc/os-release > /dev/null 2>&1
if [ $? = 0 ]; then
echo "You are running Fedora"
else
echo "You are running Ubuntu"
fi
Thanks, and have a great day.:) Patrick.

Windows Deployment Server Answer Files for PC's with RAID Controllers

Windows Deployment Server Answer Files for PC's with RAID Controllers

I currently have a Windows Deployment Server running on Windows Server
2008 R2 Standard, and so far it has worked without any issues. I am able
to capture and deploy images to the majority of the computers my company
maintains.
However, we just began ordering new Dell Precision T3600 PC's that come
with RAID controllers. At first when we tried applying one of our images
to the machine, it did not detect the hard drive. Simple enough fix, I
injected the correct drivers to my boot images and install images. But now
when I try to apply an image to one of these RAID controller pcs, it tells
me that I do not have enough space on the partition to install Windows:
Windows cannot be installed to the selected partition. Installation requires
at least 15199 MB of free space. To install Windows, free up additional space
and restart the installation.
I have spoken to a few people about the issue and some theories are that
it is following a deprecated Windows NT rule and creating 2gb partitions,
or that PC's with a RAID configuration require special switches in the
answer file.
Here is the DiskConfiguration section of my answer file (the part I
believe to be in question):
<DiskConfiguration>
<Disk wcm:action="add">
<WillWipeDisk>true</WillWipeDisk>
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Extend>false</Extend>
<Format>NTFS</Format>
<Label>Local Disk</Label>
<Letter>C</Letter>
<Order>1</Order>
<PartitionID>1</PartitionID>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
</Disk>
<WillShowUI>OnError</WillShowUI>
</DiskConfiguration>
I have tried change the 'Extend' field to True, the 'Modify Partition
wcm:action' field to Modify, and changed the order of the Create and
Modify partition trees. I have also tried completely removing the RAID
controller from the PC, but I then receive an error about being unable to
read my answer files element
Does anyone have any insight to if I need special conditions when
deploying to a raid configuration? I have scoured through a ton of TechNet
articles on the subject, and I believe I have the correct configuration,
but I have been unable to find any documentation for issues with RAID
configurations
When deploying to a machine without a RAID configuration, the answer file
works perfectly.
After messing around with some more answer file flags, I decided to take a
look at what it is actually doing to the partitions on the drive. With my
current answer file the drives end up like this:
Disk 1 Partition 1: Local Disk - 100.00MB - System
Disk 1 Partition 2 - 232.30GB - Primary
So it looks like it's trying to install on the smaller partition, so I
either need to make that one larger, reduce the install to one partition,
or install to the second partition. Would any of these be acceptable
workarounds?
Thank you for looking into my question, let me know if you need any
additional information.