Thursday, 3 October 2013

attempting to return a multiple group by object

attempting to return a multiple group by object

Was hoping for some help with Nested group by in linq where I am trying to
go down three levels.
Basically the path would go down Business to BusUnit to Level1
So under Business there are various BusUnits and under BusUnits there are
various level1 values
I want to return this as a Json object.
As I have it at the moment I got down to BusUnits
as follow
var queryNestedData = (from r in DataItems
group r by r.Business into businesses
from businessUnits in
(from r in businesses
group r by r.Businessunit)
group businessUnits by businesses.Key).Select(tg =>
new
{
Business = tg.Key,
BusinessUnits = tg.Select(tv => new {
BusinessUnit = tv.Key })
});
How could I get to Level1 so as to return the values as well?

Wednesday, 2 October 2013

How to get a new gps coordinate at a known distance that lies between a known start and end gps coordinate?

How to get a new gps coordinate at a known distance that lies between a
known start and end gps coordinate?

I am working on google maps api + python code, And i'm kinda stuck with a
doubt. I basically have 2 gps co-ordinates, start and end point, and i am
able to calculate the shortest distance between them using the ideas i got
from stackoverflow. for example lets say the distance between (x1,y1) &
(x2,-y2) is 100 meters. Now the next task is to get a list of coordinates
which is lying on the same path between start & end point 10 metres
apart(which basically would be 9 more coordinates coz the 10th will be the
end point which i already know). I can apply ratio calculation and get a
(x,y) out but keeping the earth's spherical structure in mind is there any
other algorithm, theorem, package or solution you'd recommend? I'd
appreciate any thoughts that you'd like to share. thanks.
also will the solution mentioned in this link work? Adding distance to a
GPS coordinate

I want to play, pause and stop songs using an android app in my java server

I want to play, pause and stop songs using an android app in my java server

I am working with my an android app that would play a song in a java
server Could you guys please help me how do i stop or even pause songs in
my java server?
My server code goes like this
public server(String filename) {
this.filename = filename;
}
public static void main(String[] args) throws Exception
{
try
{
serverSocket = new ServerSocket(PORT, 0,
InetAddress.getLocalHost());
System.out.println("IP: " + serverSocket.getInetAddress() + "
Port: " + serverSocket.getLocalPort());
} catch (IOException e)
{
System.out.println("Could not listen on port: 7777");
}
System.out.println("Server started. Listening to the port 7777");
while (true)
{
try
{
clientSocket = serverSocket.accept(); // Code para sa
client connection
inputStreamReader = new
InputStreamReader(clientSocket.getInputStream());
bufferedReader = new BufferedReader(inputStreamReader); //
irread ng inputstream yung message na sinend
message = bufferedReader.readLine();
System.out.println(message);{
if(message.equals("play1")){
AudioInputStream inputStream =
AudioSystem.getAudioInputStream(new
File("D:/Kym/From BB/kayMani.wav"));
Clip clip1 = AudioSystem.getClip();
// getAudioInputStream() accepts a File or
InputStream
clip1.open(inputStream);
clip1.start();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JOptionPane.showMessageDialog(null,
"Classical song is playing!");
}
});
}
if(message.equals("play2")) {
AudioInputStream inputStream =
AudioSystem.getAudioInputStream(new
File("D:/Kym/From BB/kayMani.wav"));
Clip clip2 = AudioSystem.getClip();
// getAudioInputStream() accepts a File or
InputStream
clip2.open(inputStream);
clip2.start();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JOptionPane.showMessageDialog(null,
"Novelty song is playing!");
}
});
}
if(message.equals("play3")) {
AudioInputStream inputStream =
AudioSystem.getAudioInputStream(new File("D:/Kym/From
BB/kayMani.wav"));
Clip clip2 = AudioSystem.getClip();
// getAudioInputStream() accepts a File or
InputStream
clip2.open(inputStream);
clip2.start();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JOptionPane.showMessageDialog(null, "OPM
song is playing!");
}
});
}
if(message.equals("play4")) {
AudioInputStream inputStream =
AudioSystem.getAudioInputStream(new File("D:/Kym/From
BB/kayMani.wav"));
Clip clip2 = AudioSystem.getClip();
// getAudioInputStream() accepts a File or
InputStream
clip2.open(inputStream);
clip2.start();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JOptionPane.showMessageDialog(null, "Pop
song is playing!");
}
});
}
if(message.equals("play5")) {
AudioInputStream inputStream =
AudioSystem.getAudioInputStream(new File("D:/Kym/From
BB/kayMani.wav"));
Clip clip2 = AudioSystem.getClip();
// getAudioInputStream() accepts a File or
InputStream
clip2.open(inputStream);
clip2.start();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JOptionPane.showMessageDialog(null, "Rock
song is playing!");
}
});
}
}
inputStreamReader.close();
clientSocket.close();
} catch (IOException ex)
{
System.out.println("Problem in message reading");
}
}
}
}
another problem is it plays song but if it receives the same message like
play1 again while the song is playing the server crashes. Please help me
how to prevent that thanks in advance :D

FancyBox plugin doesn't work

FancyBox plugin doesn't work

I have a problem with my fancy box. when I click on a link, the fancy box
gets the content but doesn't show the lightbox and jumps to a page that I
supposed to get its returned content via Ajax.(like I've requested the
page straight forward).
HTML :
<a class="butt red medium fancybox"
href="http://localhost/food/index.php/food/ajaxExtras?foodId=412">ÓÝÇÑÔ
</a>
JS :
$("a.fancybox").fancybox();
My Result :

Tuesday, 1 October 2013

how to send sms ( text message ) from oracle database 10g / forms 6i

how to send sms ( text message ) from oracle database 10g / forms 6i

I want to send sms from oracle 10g, there is a lot of information for this
on web and I found the following are required:
sms gate way ( ozekisms.com )
GSM modem
SIM card from a mobile company
Now I want to confirm from the community before purchase a sms gateway
software and GSM modem. Is there any free sms gateway? Which GSM modem and
sms gateway software is more reliable, easy to use and cheap?
Regards:
Muhammad

Trying to step through BackgroundWorker code in debug but program ends unexpectedly

Trying to step through BackgroundWorker code in debug but program ends
unexpectedly

Here is the code I am working with:
try
{
mainWorker = new BackgroundWorker();
mainWorker.DoWork += (sender, e) =>
{
try
{
//stuff I want to have happen in the background
//I want to step through the lines in this try block
}
catch
{
//exception not being caught
}
};
mainWorker.RunWorkerCompleted += (sender, e) =>
{
//code to let user know that the background work is done
};
mainWorker.RunWorkerAsync();
mainWorker.Dispose();
}
catch
{
//exception not being caught
}
I do not see any exceptions being thrown. I have a breakpoint set inside
the try block in DoWork. Sometimes it hits the breakpoint, but after
stepping through a certain number of lines the program ends. It doesn't
always end on the same line of code. Sometimes it doesn't hit the
breakpoint at all.
The code steps through normally if I eliminate the background worker.
I haven't implemented background workers before and I'm trying to figure
out what I'm missing that's preventing me from stepping through my code.

routing problems assigning a whole IPv6 /64 to one host

routing problems assigning a whole IPv6 /64 to one host

I posted this question before, but it got deleted for some reason.
I've recently boughy a dedicated server, and I've been assigned a /64
subnet. How do I route all of the IPs without manually adding them all
with ifconfig? Thanks. I tried with the command specified in another
serverfault, 2001:41d0:1:5976::/64 being my subnet:
ip route add local 2001:41d0:1:5976::/64 dev lo
Kernel is 3.2, distro is Debian. I need to do this to flexibly use any
IPv6 in my subnet.
Now though, I can't ping IPs:
# ping6 2001:41d0:1:5976::3
PING 2001:41d0:1:5976::3(2001:41d0:1:5976::3) 56 data bytes
ping: sendmsg: Invalid argument
ping: sendmsg: Invalid argument
# route -6
Kernel IPv6 routing table
Destination Next Hop Flag Met Ref Use If
2001:41d0:1:5976::1/128 :: U 256 0 0
eth0
2001:41d0:1:59ff:ff:ff:ff:ff/128 :: U 1024 0
1 eth0
fe80::/64 :: !n 256 0 0 lo
fe80::/64 :: U 256 0 0
eth0
::/0 2001:41d0:1:59ff:ff:ff:ff:ff UG 1024 0
0 eth0
::/0 :: !n -1 1 14491 lo
::1/128 :: Un 0 1 1075 lo
2001:41d0:1:5976::1/128 :: Un 0 1 98 lo
2001:41d0:1:5976::/64 :: U 1024 0
0 lo
fe80::62a4:4cff:feb4:4b98/128 :: Un 0 1 0 lo
ff00::/8 :: U 256 0 0
eth0
::/0 :: !n -1 1 14491 lo
# ifconfig
eth0 Link encap:Ethernet HWaddr 60:a4:4c:xx:xx:xx
inet addr:xx.xxx.xx.xxx Bcast:91.121.6.255 Mask:255.255.255.0
inet6 addr: fe80::62a4:4cff:feb4:4b98/64 Scope:Link
inet6 addr: 2001:41d0:1:5976::1/128 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3165201 errors:0 dropped:480 overruns:0 frame:0
TX packets:2969595 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:707155716 (674.3 MiB) TX bytes:758957608 (723.7 MiB)
Interrupt:43 Base address:0xe000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:582297 errors:0 dropped:0 overruns:0 frame:0
TX packets:582297 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:74514698 (71.0 MiB) TX bytes:74514698 (71.0 MiB)
Ideas?

installation without cd or usb please help

installation without cd or usb please help

how do I install Ubuntu without having to burn to a cd or usb? I need this
for class and the pop up for cd keeps coming up then it tells me my cd is
too small