Recent Notes
Displaying keyword search results 81 - 90
Created by Fang on January 23, 2011 19:28:35
Last update: October 28, 2011 12:10:07
Maven repositories are a central part of the Maven build system. Maven resolves dependencies through repositories. There are two types of repositories: local and remote . The local repository stores local build artifacts (when you do mvn install ) and caches artifacts from remote repositories. It is usually located on the local file system at $USER_HOME/.m2/repository . Remote repositories are located on the network and accessed by URLs ( http:// or file:// etc). The central Maven repository is: repo1.maven.org . The Java EE repositories are located at: http://download.java.net/maven/2/ and http://download.java.net/maven/1/ . Remote repositories can also be set up on the company intranet within a company's firewall. The central repository is automatically configured after installation. You can add additional repositories in settings.xml , for example:
<?xml version="1.0" encoding="UTF-8"?> <setting......
Created by mee2 on October 20, 2011 16:52:33
Last update: October 20, 2011 16:54:17
Alfresco RESTful URLs provided by Web Scripts are extensively documented, but examples are hard to come by. This makes it hard to ramp up for beginners. Here are some examples I tested on 3.4.4 enterprise edition and 4.0a community edition, with the results documented. To list the available scripts:
http://localhost:8081/alfresco/service/index There's a Refresh Web Scripts button at the bottom of the page. If you add a Web Script, you need to click that button in order for the system to know about your addition. To get information about the root folder ( Company Home ): http://localhost:8081/alfresco/service/cmis/p To get information about the folder Data Dictionary : http://localhost:8081/alfresco/service/cmis/p/Data... To get information about the folder Data Dictionary/Space Templates : http://localhost:8081/alfresco/service/cmis/p/Data... You get the idea. To list the children...
Created by meiu on October 14, 2011 14:21:39
Last update: October 14, 2011 14:22:24
This works for Eclipse Indigo.
From the Help menu, select Install New Software...
Select --All Available Sites-- for the Work with dropdown
Enter maven in filter text
Check m2e and install:
Created by Fang on October 14, 2011 13:22:38
Last update: October 14, 2011 13:25:13
You get "permission denied" if you are using JBoss repository http://repository.jboss.org/maven2 . This repository has been deprecated . The new repository is:
https://repository.jboss.org/nexus/content/groups/public
Maven 3.0.3 archetype weld-jsf-servlet-minimal generated pom.xml still uses the old JBoss repository, causing the build to fail.
Created by balu on October 14, 2011 10:21:08
Last update: October 14, 2011 10:21:08
Got this error while trying to start vFabric tc server :
C:\Apps\vfabric-tc-server-standard-2.6.1.RELEASE>t...
It's a UAC error. Need to start the command prompt with Administrator privileges: right click the shortcut and select Run as administrator .
Or enable administrator rights for the shortcut:
Bring up the cmd shortcut properties
Select the Shortcut tab, click the Advanced button.
Check Run as administrator .
Created by Dr. Xi on September 30, 2011 15:34:47
Last update: September 30, 2011 15:34:47
A naive try would be something like this:
$ nc -l 8082 | nc remote_host 80 Yes, it does forward the request from local port 8082 to remote_host:80 , but the response is dumped to stdout , not routed back to the client as expected. Using a named pipe makes it work: $ mkfifo backpipe $ nc -l 8082 0<backpipe | nc ... Use tee to get a glimpse of the response through the pipe (I wasn't able to find a way to dump the request): $ nc -k -l 8082 0<backpipe | nc localhost 80 | tee... The GNU netcat has a different syntax than the stock nc . It also supports different switches. To listen to port 1234: $ netcat -l -p 1234...
Created by freyo on September 29, 2011 16:01:31
Last update: September 29, 2011 16:09:37
With standalone broadcast receiver
AndroidManifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifes...
Java code:
package com.android.networkreceiver;
import...
Register listener inside Activity programmatically
AndroidManifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifes...
Java code:
package com.android.networklistener;
import...
Register/unregister broadcast receiver in onResume / onPause works because the connectivity change broadcast is sticky . I intentionally used two registerReceiver calls in onResume to demonstrate this - onReceive will be called once for each registration.
Created by magnum on September 27, 2011 21:51:05
Last update: September 28, 2011 18:02:49
Client socket usually does not call bind . But I've seen code that does and it was puzzling to me what bind does to a client socket. Therefore, this little test program. It retrieves a web url and displays info about the socket. You can optionally give a bind host name/ip and port and see what it does.
Here are my test results:
$ ./client www.google.com
Local addr: 172.16.0....
This is the code:
#include <stdio.h>
#include <stdlib.h>
#incl...
Created by magnum on September 27, 2011 09:32:18
Last update: September 27, 2011 09:33:04
Use tcpdump to monitor traffic on a network: To print all incoming and outgoing packets on host 192.168.0.1 :
tcpdump host 192.168.0.1 To print all incoming and outgoing IP packets on host firebird : tcpdump ip host firebird To write raw packets to a file, rather than parsing and printing them out: tcpdump ip host firebird -w /tmp/firebird.pcap To listen on interface eth0 (without this, tcpdump listens on the lowest numbered, configured up interface except loopback): tcpdump -i eth0 ip Use switch -X for more verbose output: tcpdump -i eth0 ip -X host 192.168.0.1 Outgoing from 192.168.0.1 : tcpdump -i eth0 ip -X src host 192.168.0.1 Incoming to 192.168.0.1 : tcpdump -i eth0 ip -X dst host 192.168.0.1 More verbose output: tcpdump -i eth0 tcp -vvX host 192.168.0.1...
Created by freyo on May 13, 2011 15:45:29
Last update: September 20, 2011 08:08:12
This is an Android app that dumps any binarized xml file as plain text - to the sdcard on the device or emulator.
build.xml :
<?xml version="1.0" encoding="UTF-8"?>
<project...
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<man...
res/layout/main.xml
<?xml version="1.0" encoding="utf-8"?>
<Lin...
res/values/strings.xml :
<?xml version="1.0" encoding="utf-8"?>
<res...
src/com/android/xmltool/DumpXml.java
package com.android.xmltool;
import java.ut...
Screenshot
Pre-built APK can be downloaded from: http://code.google.com/p/android-binxml-dump/