PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,654,346 | 12/28/2011 09:58:01 | 960,580 | 09/23/2011 07:11:22 | 452 | 45 | Custom SeekBar as Shown in Image Below | I want seekbar ui like shown in image below.
![enter image description here][1]
[1]: http://i.stack.imgur.com/1gzeG.png
Any Ideas How to do it. | android | null | null | null | null | 12/28/2011 11:44:09 | not a real question | Custom SeekBar as Shown in Image Below
===
I want seekbar ui like shown in image below.
![enter image description here][1]
[1]: http://i.stack.imgur.com/1gzeG.png
Any Ideas How to do it. | 1 |
10,687,390 | 05/21/2012 14:40:31 | 1,311,286 | 04/03/2012 19:43:29 | 108 | 0 | Java, FTP server and client | I am trying to "Write two Java programs implementing the FTP server with responses to USER and PASS, with thread-per-client and thread pool, respectively." I am just trying to make sure I have everything in order before turning it in. Here is my source code. The only trouble I am having is figuring out what to do with "FTPProtocol client;" Should I just destroy it after I have the thread.start?
FTPServer.java
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
public class FTPserver
{
public static void main(String [] args)
{
if (args.length != 1)
throw new IllegalArgumentException( "Parameter(s): <Port>");
int threadPoolSize = 10;
int port = Integer.parseInt(args[0]);
final ServerSocket server;
try
{
server = new ServerSocket(port);
}
catch (IOException e1)
{
return;
}
for (int i = 0; i < threadPoolSize; i++)
{
Thread thread = new Thread()
{
public void run()
{
while (true)
{
try
{
Socket sock = server.accept();
FTPProtocol client = new FTPProtocol(sock);
}
catch (IOException e)
{
System.err.println(e.getMessage());
return;
}
}
}
};
thread.start();
}
}
}
FTPProtocol.java
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
class FTPProtocol implements Runnable
{
static String greeting = "220 Service Ready.\r\n";
static String needPassword = "331 User name ok, need password.\r\n";
static String closing = "421 Service not available, closing control connection.\r\n";
static byte[] reply220 = null;
static byte[] reply331 = null;
static byte[] reply421 = null;
Socket sock = null;
public FTPProtocol(Socket so)
{
sock = so;
reply220 = greeting.getBytes();
reply331 = needPassword.getBytes();
reply421 = closing.getBytes();
}
public void run()
{
handleFTPClient(sock);
}
void handleFTPClient(Socket sock)
{
InputStream is = null;
OutputStream os = null;
byte[] inBuffer = new byte[1024];
try
{
is = sock.getInputStream();
os = sock.getOutputStream();
os.write(reply220);
int len = is.read(inBuffer);
System.out.write(inBuffer, 0, len);
os.write(reply331);
len = is.read(inBuffer);
System.out.write(inBuffer, 0, len);
os.write(reply421);
sock.close();
}
catch (IOException e)
{
System.err.println(e.getMessage());
return;
}
}
}
| java | null | null | null | null | 05/22/2012 15:25:21 | not a real question | Java, FTP server and client
===
I am trying to "Write two Java programs implementing the FTP server with responses to USER and PASS, with thread-per-client and thread pool, respectively." I am just trying to make sure I have everything in order before turning it in. Here is my source code. The only trouble I am having is figuring out what to do with "FTPProtocol client;" Should I just destroy it after I have the thread.start?
FTPServer.java
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
public class FTPserver
{
public static void main(String [] args)
{
if (args.length != 1)
throw new IllegalArgumentException( "Parameter(s): <Port>");
int threadPoolSize = 10;
int port = Integer.parseInt(args[0]);
final ServerSocket server;
try
{
server = new ServerSocket(port);
}
catch (IOException e1)
{
return;
}
for (int i = 0; i < threadPoolSize; i++)
{
Thread thread = new Thread()
{
public void run()
{
while (true)
{
try
{
Socket sock = server.accept();
FTPProtocol client = new FTPProtocol(sock);
}
catch (IOException e)
{
System.err.println(e.getMessage());
return;
}
}
}
};
thread.start();
}
}
}
FTPProtocol.java
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
class FTPProtocol implements Runnable
{
static String greeting = "220 Service Ready.\r\n";
static String needPassword = "331 User name ok, need password.\r\n";
static String closing = "421 Service not available, closing control connection.\r\n";
static byte[] reply220 = null;
static byte[] reply331 = null;
static byte[] reply421 = null;
Socket sock = null;
public FTPProtocol(Socket so)
{
sock = so;
reply220 = greeting.getBytes();
reply331 = needPassword.getBytes();
reply421 = closing.getBytes();
}
public void run()
{
handleFTPClient(sock);
}
void handleFTPClient(Socket sock)
{
InputStream is = null;
OutputStream os = null;
byte[] inBuffer = new byte[1024];
try
{
is = sock.getInputStream();
os = sock.getOutputStream();
os.write(reply220);
int len = is.read(inBuffer);
System.out.write(inBuffer, 0, len);
os.write(reply331);
len = is.read(inBuffer);
System.out.write(inBuffer, 0, len);
os.write(reply421);
sock.close();
}
catch (IOException e)
{
System.err.println(e.getMessage());
return;
}
}
}
| 1 |
66,227 | 09/15/2008 19:51:37 | 9,411 | 09/15/2008 18:43:54 | 11 | 1 | What is the best multi-platform RAD language? | What is the best multi-platform RAD language for writing a desktop application? Nice GUI capability would be a bonus. | gui | programming-languages | multi-platform | null | null | 01/29/2012 00:30:53 | not constructive | What is the best multi-platform RAD language?
===
What is the best multi-platform RAD language for writing a desktop application? Nice GUI capability would be a bonus. | 4 |
8,596,569 | 12/21/2011 21:23:25 | 1,110,622 | 12/21/2011 20:51:14 | 1 | 0 | Unpublished app not available for downloading from market for Test Accounts | I exported unsigned app from eclipse and signed using keytool and jarsigner of java jdk. I uploaded the signed app, application icon, screenshots from android developer console. selected Copy Protection "Off", all countried and not excluded any devices. I saved all above details and clicked "Active" link next to apk file. Went to "Edit Profile" and added few comma seperated gmail accounts to "Test Accounts" and selected "Respond normally" for "License Test Response". After completing above steps waited for more than 2 days and still not able to find the app from android market. Am I missing something? The whole purpose of doingthis is to distribute beta version of app to selected group of people. Your resposne is greatly appreciated. | android-market | null | null | null | null | 12/22/2011 04:49:27 | off topic | Unpublished app not available for downloading from market for Test Accounts
===
I exported unsigned app from eclipse and signed using keytool and jarsigner of java jdk. I uploaded the signed app, application icon, screenshots from android developer console. selected Copy Protection "Off", all countried and not excluded any devices. I saved all above details and clicked "Active" link next to apk file. Went to "Edit Profile" and added few comma seperated gmail accounts to "Test Accounts" and selected "Respond normally" for "License Test Response". After completing above steps waited for more than 2 days and still not able to find the app from android market. Am I missing something? The whole purpose of doingthis is to distribute beta version of app to selected group of people. Your resposne is greatly appreciated. | 2 |
11,101,835 | 06/19/2012 13:20:06 | 658,031 | 03/13/2011 23:52:31 | 1,687 | 55 | Check if the network where application was depeloyd is up and running | I have a `c#` `winfomrs` application that is deployed on netowkr using `ClickOne`. Everything works fine and program will check for update on startup.
But if the netowrk is down, when application starts it shows that its checking for new version, but the server is actually down! I want to notificate the user that checking for update was not successful. Is there anyway to do that? I already checked but it seems that visual studio does not add any code for this case.
I need the program to be avilable offline, so setting the program to only online is not a case.
Can someone please tell me how can I do this programatically, or what options I need to change in solution properties? | c# | winforms | visual-studio-2010 | clickonce | null | null | open | Check if the network where application was depeloyd is up and running
===
I have a `c#` `winfomrs` application that is deployed on netowkr using `ClickOne`. Everything works fine and program will check for update on startup.
But if the netowrk is down, when application starts it shows that its checking for new version, but the server is actually down! I want to notificate the user that checking for update was not successful. Is there anyway to do that? I already checked but it seems that visual studio does not add any code for this case.
I need the program to be avilable offline, so setting the program to only online is not a case.
Can someone please tell me how can I do this programatically, or what options I need to change in solution properties? | 0 |
6,604,524 | 07/07/2011 00:19:38 | 518,703 | 11/24/2010 11:54:44 | 6 | 2 | PEAR install problems | Having spent the last 5 hours trying to install PEAR I'm somewhat at a loss for what to try next. The initial go-pear.phar running from the command line produces the following error:
http://imgur.com/iHKSZ
I can install the PEAR files from the package, but this doesn't include the pear.bat file and other registration files. I can't use the web installer because it puts the package manager in my www directory, and if I try moving the files the path variables all fail to work again. I've searched Google for ages and nowhere can you download the files on their own- everything is just circular references getting back to go-pear.phar, which does not work. I've tried using older PHP versions (5.2.9) without effect.
The system is running through EasyPHP on Windows 7 64 bit, account is a single account administrator, UAC is disabled. Can someone zip up the PEAR files and host them somewhere so that I can get hold of them to install manually, as this would be the quickest way to solve the issues? | php | download | batch-file | install | pear | null | open | PEAR install problems
===
Having spent the last 5 hours trying to install PEAR I'm somewhat at a loss for what to try next. The initial go-pear.phar running from the command line produces the following error:
http://imgur.com/iHKSZ
I can install the PEAR files from the package, but this doesn't include the pear.bat file and other registration files. I can't use the web installer because it puts the package manager in my www directory, and if I try moving the files the path variables all fail to work again. I've searched Google for ages and nowhere can you download the files on their own- everything is just circular references getting back to go-pear.phar, which does not work. I've tried using older PHP versions (5.2.9) without effect.
The system is running through EasyPHP on Windows 7 64 bit, account is a single account administrator, UAC is disabled. Can someone zip up the PEAR files and host them somewhere so that I can get hold of them to install manually, as this would be the quickest way to solve the issues? | 0 |
8,494,195 | 12/13/2011 18:23:06 | 1,035,496 | 11/08/2011 11:36:17 | 20 | 0 | Startup issues with javascriptMVC | Ok, so this is a beginners question. I am trying to use the jQueryMX part of javascriptMVC. I have tried reading the docs, but I still have problems understanding the simplest things.
So I want to start my program with putting some data into my Model. My model should contain some tab data. I am currently not talking to server. I just want to start pumping the data some javascript.
So here is what I have come up with so far:
$(document).ready(
function()
{
tab = new Tabs({
tab1:
{
name:'Reuters',
hits:'500'
},
tab2:
{
name:'AP',
hits:'5043'
},
tab3:
{
name:'Sports',
hits:'50'
},
tab4:
{
name:'Cityscape',
hits:'1'
}
});
}
);
$.Model('Tabs',
{
},
{
}
);
Ok. So now I may/may not have pumped some data into my $.Model class. I don't have any functions or anything for it yet. I just want to be able to make sure I have the data in my class.
My questions are:
Are the data in my class or do I need to do more to it?
How can I find the data through the console?
I know this is begginners material. But I need this to get started, as the samples in their doc does not explain it good enough for me. | javascriptmvc | null | null | null | null | null | open | Startup issues with javascriptMVC
===
Ok, so this is a beginners question. I am trying to use the jQueryMX part of javascriptMVC. I have tried reading the docs, but I still have problems understanding the simplest things.
So I want to start my program with putting some data into my Model. My model should contain some tab data. I am currently not talking to server. I just want to start pumping the data some javascript.
So here is what I have come up with so far:
$(document).ready(
function()
{
tab = new Tabs({
tab1:
{
name:'Reuters',
hits:'500'
},
tab2:
{
name:'AP',
hits:'5043'
},
tab3:
{
name:'Sports',
hits:'50'
},
tab4:
{
name:'Cityscape',
hits:'1'
}
});
}
);
$.Model('Tabs',
{
},
{
}
);
Ok. So now I may/may not have pumped some data into my $.Model class. I don't have any functions or anything for it yet. I just want to be able to make sure I have the data in my class.
My questions are:
Are the data in my class or do I need to do more to it?
How can I find the data through the console?
I know this is begginners material. But I need this to get started, as the samples in their doc does not explain it good enough for me. | 0 |
8,560,765 | 12/19/2011 11:39:40 | 774,437 | 05/28/2011 15:20:55 | 32 | 0 | How to draw a rotated string with high quality in C#? | I want to draw a string and rotate it with a custom angle. Simply, I calculate the new dimenstions of the area that contains the rotated image, then create a bitmap object and by means of graphics object of it, I draw a string with 3 transformations (translation to the center, rotation, and reverse translation). I wrote the following code but the quality is not desired. Does anyone have an idea?
private Image RotateText(string Text, int FontSize, float Angle)
{
//Modify angle
Angle *= -1;
//Calculate rotation angle in radian
double AngleInRadian = (Angle * 2 * Math.PI) / 360d;
//Instantiate a font for text
Font TextFont = new Font("Tahoma", FontSize, FontStyle.Bold);
//Measure size of the text
Graphics Graphic = this.CreateGraphics();
SizeF TextSize = Graphic.MeasureString(Text, TextFont);
//Calculate size of the rotated text
double NewWidth = Math.Abs(TextSize.Width * Math.Cos(AngleInRadian)) + Math.Abs(TextSize.Height * Math.Sin(AngleInRadian));
double NewHeight = Math.Abs(TextSize.Width * Math.Sin(AngleInRadian)) + Math.Abs(TextSize.Height * Math.Cos(AngleInRadian));
//Instantiate a new image for rotated text
Bitmap RotatedText = new Bitmap((int)(Math.Round(NewWidth)), (int)(Math.Round(NewHeight)));
//Get graphic object of new isntantiated image for painting
Graphics TextGraphic = Graphics.FromImage(RotatedText);
TextGraphic.InterpolationMode = InterpolationMode.High;
//Calcaute coordination of center of the image
float OX = (float)NewWidth / 2f;
float OY = (float)NewHeight / 2f;
//Apply transformations (translation, rotation, reverse translation)
TextGraphic.TranslateTransform(OX, OY);
TextGraphic.RotateTransform(Angle);
TextGraphic.TranslateTransform(-OX, -OY);
//Calculate the loaction of drawing text
float X = (RotatedText.Width - TextSize.Width ) / 2f;
float Y = (RotatedText.Height - TextSize.Height) / 2f;
//Draw the string
TextGraphic.DrawString(Text, TextFont, Brushes.White, X, Y);
//Return the image of rotated text
return RotatedText;
}
The result is this:
![enter image description here][1]
[1]: http://i.stack.imgur.com/DGqt6.jpg | c# | graphics | usercontrols | null | null | null | open | How to draw a rotated string with high quality in C#?
===
I want to draw a string and rotate it with a custom angle. Simply, I calculate the new dimenstions of the area that contains the rotated image, then create a bitmap object and by means of graphics object of it, I draw a string with 3 transformations (translation to the center, rotation, and reverse translation). I wrote the following code but the quality is not desired. Does anyone have an idea?
private Image RotateText(string Text, int FontSize, float Angle)
{
//Modify angle
Angle *= -1;
//Calculate rotation angle in radian
double AngleInRadian = (Angle * 2 * Math.PI) / 360d;
//Instantiate a font for text
Font TextFont = new Font("Tahoma", FontSize, FontStyle.Bold);
//Measure size of the text
Graphics Graphic = this.CreateGraphics();
SizeF TextSize = Graphic.MeasureString(Text, TextFont);
//Calculate size of the rotated text
double NewWidth = Math.Abs(TextSize.Width * Math.Cos(AngleInRadian)) + Math.Abs(TextSize.Height * Math.Sin(AngleInRadian));
double NewHeight = Math.Abs(TextSize.Width * Math.Sin(AngleInRadian)) + Math.Abs(TextSize.Height * Math.Cos(AngleInRadian));
//Instantiate a new image for rotated text
Bitmap RotatedText = new Bitmap((int)(Math.Round(NewWidth)), (int)(Math.Round(NewHeight)));
//Get graphic object of new isntantiated image for painting
Graphics TextGraphic = Graphics.FromImage(RotatedText);
TextGraphic.InterpolationMode = InterpolationMode.High;
//Calcaute coordination of center of the image
float OX = (float)NewWidth / 2f;
float OY = (float)NewHeight / 2f;
//Apply transformations (translation, rotation, reverse translation)
TextGraphic.TranslateTransform(OX, OY);
TextGraphic.RotateTransform(Angle);
TextGraphic.TranslateTransform(-OX, -OY);
//Calculate the loaction of drawing text
float X = (RotatedText.Width - TextSize.Width ) / 2f;
float Y = (RotatedText.Height - TextSize.Height) / 2f;
//Draw the string
TextGraphic.DrawString(Text, TextFont, Brushes.White, X, Y);
//Return the image of rotated text
return RotatedText;
}
The result is this:
![enter image description here][1]
[1]: http://i.stack.imgur.com/DGqt6.jpg | 0 |
9,919,948 | 03/29/2012 06:09:42 | 319,918 | 04/19/2010 00:00:57 | 1,016 | 33 | What uses prawn for rendering pdfs? | Just curious, how [prawn](https://github.com/prawnpdf/prawn) renders pdf? Does it uses a library, webkit or latex or what?
| ruby | pdf | prawn | null | null | 03/29/2012 07:56:54 | not constructive | What uses prawn for rendering pdfs?
===
Just curious, how [prawn](https://github.com/prawnpdf/prawn) renders pdf? Does it uses a library, webkit or latex or what?
| 4 |
8,500,153 | 12/14/2011 06:08:10 | 1,027,421 | 11/03/2011 10:21:43 | 16 | 0 | How does i-nigma app supports all mobile platforms? | Does anyone here knows why and how the i-nigma app can be integrated into all mobile platforms? thanks | android | iphone | qr-code | barcode-scanner | null | null | open | How does i-nigma app supports all mobile platforms?
===
Does anyone here knows why and how the i-nigma app can be integrated into all mobile platforms? thanks | 0 |
9,621,259 | 03/08/2012 16:35:36 | 1,019,710 | 10/29/2011 11:39:30 | 51 | 0 | Java parser rename variable | I need to write a parser for Java programming language. I've seen some implementations (JavaCC, SableCC) and i think i can handle it.
The thing is I need to rename the variables. Could I do this using the parser?
If yes, how? | java | parsing | grammar | context-free-grammar | null | 03/09/2012 01:43:08 | not a real question | Java parser rename variable
===
I need to write a parser for Java programming language. I've seen some implementations (JavaCC, SableCC) and i think i can handle it.
The thing is I need to rename the variables. Could I do this using the parser?
If yes, how? | 1 |
11,388,031 | 07/09/2012 01:05:48 | 1,510,771 | 07/09/2012 00:59:10 | 1 | 0 | Magento Ogone extension not working with old hashing | I am trying to make the Ogone payment method work on magento 1.7. I installed the official extension but that one works just with the new hashing, can somebody hack the extension to ben able to accept the old hashing instead?
Thanks in advance,
| magento | null | null | null | null | 07/10/2012 14:37:23 | off topic | Magento Ogone extension not working with old hashing
===
I am trying to make the Ogone payment method work on magento 1.7. I installed the official extension but that one works just with the new hashing, can somebody hack the extension to ben able to accept the old hashing instead?
Thanks in advance,
| 2 |
7,995,731 | 11/03/2011 13:30:06 | 1,027,767 | 11/03/2011 13:23:14 | 1 | 0 | How to present combobox from been edited during runtime in C# | I have a combobox on my application with a dropdown list so i want to prevent a user from entering values in he decides not to select the items already the combobox | c#-2.0 | null | null | null | null | 11/03/2011 14:04:15 | not a real question | How to present combobox from been edited during runtime in C#
===
I have a combobox on my application with a dropdown list so i want to prevent a user from entering values in he decides not to select the items already the combobox | 1 |
71,108 | 09/16/2008 10:41:21 | 11,575 | 09/16/2008 09:13:37 | 11 | 1 | What use is multiple indirection in C++? | Under what circumstances might you want to use multiple indirection (that is, a chain of pointers as in **foo) in C++? | c++ | pointers | null | null | null | null | open | What use is multiple indirection in C++?
===
Under what circumstances might you want to use multiple indirection (that is, a chain of pointers as in **foo) in C++? | 0 |
5,194,341 | 03/04/2011 13:30:20 | 577,553 | 01/16/2011 14:44:19 | 39 | 0 | ORACLE 10G to print missing bill no query | I have a table **bill** with column name **bill_id**
bill_id range from 1 to 40.
and i have rows like
bill_id
-----------
1
3
6
8
2
21
34
35
26
40
i want to print the missing bill_id from the above table can anyone help me ?
| oracle | query | 10g | null | null | null | open | ORACLE 10G to print missing bill no query
===
I have a table **bill** with column name **bill_id**
bill_id range from 1 to 40.
and i have rows like
bill_id
-----------
1
3
6
8
2
21
34
35
26
40
i want to print the missing bill_id from the above table can anyone help me ?
| 0 |
9,976,466 | 04/02/2012 12:30:17 | 784,597 | 06/05/2011 09:07:37 | 646 | 1 | JAXB : Doesn't there is need of XMl attribute names to be matched with java Annotations in JAXB |
I am working on a existing Application which is using JAXB .
Currently there is a unmarshell process that will happen on a XML document
For example this is the xml document
String str = "<BACS xmlns=\"http://www.bacs.org/BACS\"><Bahut number=\"1234\"><Order Quantity=\"1\" ><Bag value=\"1\" /></Order></Bahut><BACS>";
public class One{
@XmlAttribute(name = "numberDT")
protected String id;
@XmlAttribute(name = "valueDT")
protected String src;
My question is , that in our Application the XML attribute names and the names in the java annotations doesn't match ?? But still the code is working .
Please let me know , if i am missing something ?
| xml | jaxb | null | null | null | null | open | JAXB : Doesn't there is need of XMl attribute names to be matched with java Annotations in JAXB
===
I am working on a existing Application which is using JAXB .
Currently there is a unmarshell process that will happen on a XML document
For example this is the xml document
String str = "<BACS xmlns=\"http://www.bacs.org/BACS\"><Bahut number=\"1234\"><Order Quantity=\"1\" ><Bag value=\"1\" /></Order></Bahut><BACS>";
public class One{
@XmlAttribute(name = "numberDT")
protected String id;
@XmlAttribute(name = "valueDT")
protected String src;
My question is , that in our Application the XML attribute names and the names in the java annotations doesn't match ?? But still the code is working .
Please let me know , if i am missing something ?
| 0 |
1,965,882 | 12/27/2009 12:49:56 | 194,328 | 10/22/2009 05:28:20 | 622 | 17 | Open links on other section of FrameSet | I am using following code to split my screen into two panes.
<frameset cols="20%,80%">
<frame name="lefty" src="menusidebar.html">
</frameset>
</frameset>
The file "menusidebar.html" contains links. I want to open the links on the right pane when the user clicks on the link in the left-pane. How to do this?
| html | xhtml | html4 | null | null | null | open | Open links on other section of FrameSet
===
I am using following code to split my screen into two panes.
<frameset cols="20%,80%">
<frame name="lefty" src="menusidebar.html">
</frameset>
</frameset>
The file "menusidebar.html" contains links. I want to open the links on the right pane when the user clicks on the link in the left-pane. How to do this?
| 0 |
8,382,148 | 12/05/2011 07:25:33 | 519,062 | 11/24/2010 04:03:37 | 35 | 2 | Javascript (library) to format and prettify source code of various languages | Am looking for a free Javascript (library) to format and highlight syntax of source code of various possible languages (mainly JSON, XML, java, javascript, python). Different libraries for different languages should also be ok.
Googling got me google-code-prettify and syntax highlighter but from demo they just seem to prettify code but not format (you can correct me if am wrong, i haven't tried them out)
Thanks much for your help! | javascript | syntax | format | source | prettify | 12/08/2011 03:48:47 | not constructive | Javascript (library) to format and prettify source code of various languages
===
Am looking for a free Javascript (library) to format and highlight syntax of source code of various possible languages (mainly JSON, XML, java, javascript, python). Different libraries for different languages should also be ok.
Googling got me google-code-prettify and syntax highlighter but from demo they just seem to prettify code but not format (you can correct me if am wrong, i haven't tried them out)
Thanks much for your help! | 4 |
6,650,344 | 07/11/2011 12:50:48 | 838,903 | 07/11/2011 12:50:48 | 1 | 0 | video converter | >Im working on my thesis now.
>>It is about video converter.
>>>Is it possible to do it on java?
>>>>Whats ffmpeg? and codec? | java | converter | null | null | null | 07/11/2011 12:54:49 | not a real question | video converter
===
>Im working on my thesis now.
>>It is about video converter.
>>>Is it possible to do it on java?
>>>>Whats ffmpeg? and codec? | 1 |
2,149,706 | 01/27/2010 19:30:06 | 177,912 | 09/23/2009 16:11:50 | 17 | 0 | Accessing Web Services from iPhone on PC through network | I asked a very similar question not too long ago and got some great responses. I've made it pretty far but still can't quite get things to talk. What I have is a PC running IIS and a web service inside of that. I'm trying to get the iPhone simulator on my Mac to be able to see this web service. I can ping my PCs local IP address from the Mac just fine, it's clearly alive and on the network. However, no matter what URL I enter into Safari the web service will not appear.
Any suggestions?
Thank you very much in advance. | iphone | web-services | networking | iis | null | null | open | Accessing Web Services from iPhone on PC through network
===
I asked a very similar question not too long ago and got some great responses. I've made it pretty far but still can't quite get things to talk. What I have is a PC running IIS and a web service inside of that. I'm trying to get the iPhone simulator on my Mac to be able to see this web service. I can ping my PCs local IP address from the Mac just fine, it's clearly alive and on the network. However, no matter what URL I enter into Safari the web service will not appear.
Any suggestions?
Thank you very much in advance. | 0 |
896,566 | 05/22/2009 06:24:43 | 65,503 | 02/12/2009 12:00:41 | 329 | 42 | social graph problem ( path between users ) | i have received the task to make a social graph where with one user in the center it shows the connections he has.
But before we can reach that, our focus is how can we determine the shortest path between 2 users. I found some algorithm to do it, but it seems that it takes a lot of time, and because its about social links, we are looking for one that is the fastest because we will need to run it on a regular basis to keep up with the updates in friends.
So do you know witch would be the fastest way to determine the shortest path between to users ?
PS: if you know an example in php & mysql i will give you a virtual beer ( or coke ) :D | php | graph | nodes | shortest | algorithm | null | open | social graph problem ( path between users )
===
i have received the task to make a social graph where with one user in the center it shows the connections he has.
But before we can reach that, our focus is how can we determine the shortest path between 2 users. I found some algorithm to do it, but it seems that it takes a lot of time, and because its about social links, we are looking for one that is the fastest because we will need to run it on a regular basis to keep up with the updates in friends.
So do you know witch would be the fastest way to determine the shortest path between to users ?
PS: if you know an example in php & mysql i will give you a virtual beer ( or coke ) :D | 0 |
10,586,825 | 05/14/2012 15:55:56 | 1,296,058 | 03/27/2012 16:08:18 | 64 | 0 | New to Java: Is there a better way to write this simple code | private void addMember() {
while (true) {
String mNum = readLine("Please enter a membership number: ");
if (mNum == null) break;
Integer mNumAsInteger = Integer.parseInt(mNum);
String mName = readLine("Please enter the member's name: ");
members.put(mNumAsInteger, mName);
}
}
private Map<Integer, String> members = new HashMap<Integer, String>();
The purpose of the code is to keep adding members until user enter a blank input.
Is there a way to change the first line to something like
Integer mNum = readInt("Please enter a membership number: ");
And somehow detects a blank input? | java | null | null | null | null | 05/14/2012 16:12:43 | off topic | New to Java: Is there a better way to write this simple code
===
private void addMember() {
while (true) {
String mNum = readLine("Please enter a membership number: ");
if (mNum == null) break;
Integer mNumAsInteger = Integer.parseInt(mNum);
String mName = readLine("Please enter the member's name: ");
members.put(mNumAsInteger, mName);
}
}
private Map<Integer, String> members = new HashMap<Integer, String>();
The purpose of the code is to keep adding members until user enter a blank input.
Is there a way to change the first line to something like
Integer mNum = readInt("Please enter a membership number: ");
And somehow detects a blank input? | 2 |
11,281,725 | 07/01/2012 11:52:04 | 1,267,729 | 03/13/2012 23:26:07 | 1 | 0 | How to add to ruby stack trace | I have a ruby program where I want to add to the stack trace for better error analysis | ruby | stack-trace | null | null | null | 07/01/2012 14:36:21 | not a real question | How to add to ruby stack trace
===
I have a ruby program where I want to add to the stack trace for better error analysis | 1 |
10,318,307 | 04/25/2012 14:59:07 | 804,234 | 06/18/2011 05:00:22 | 6 | 3 | Hide the filepath in a URL of a downloadable file on a second server | I am setting up a store for a friend to allow downloading of media files. He is using a pay per month ecommerce store that comes with domain name (*www.examplestore.com*), site templates, hosting, credit card processing, and other features. When someone purchases a video/photo then a link is sent to them for downloading.
The video/photo files will be hosted on my site to avoid a 1GB bandwidth limit on his hosted store. For the example, refer to my site as *www.thefiles.com*
Can I mask that emailed link so that the video/photos appear not to be coming from *www.thefiles.com* but rather come from *www.examplestore.com*
Thanks,
Red | url | url-rewriting | hyperlink | file-download | null | 04/26/2012 13:26:33 | off topic | Hide the filepath in a URL of a downloadable file on a second server
===
I am setting up a store for a friend to allow downloading of media files. He is using a pay per month ecommerce store that comes with domain name (*www.examplestore.com*), site templates, hosting, credit card processing, and other features. When someone purchases a video/photo then a link is sent to them for downloading.
The video/photo files will be hosted on my site to avoid a 1GB bandwidth limit on his hosted store. For the example, refer to my site as *www.thefiles.com*
Can I mask that emailed link so that the video/photos appear not to be coming from *www.thefiles.com* but rather come from *www.examplestore.com*
Thanks,
Red | 2 |
6,771,236 | 07/21/2011 04:24:45 | 776,676 | 05/30/2011 19:02:12 | 308 | 1 | ASP.NET: C# DropDownList How to Randomly Set Initial Index Declaratively or in Code? | I have a DropDownList and want to randomly set the selected index at PageLoad.
Can this be done declaratively in the aspx file?
If so, how? If not, how do I do so in PageLoad() in C#?
Thanks. | c# | asp.net | drop-down-menu | null | null | null | open | ASP.NET: C# DropDownList How to Randomly Set Initial Index Declaratively or in Code?
===
I have a DropDownList and want to randomly set the selected index at PageLoad.
Can this be done declaratively in the aspx file?
If so, how? If not, how do I do so in PageLoad() in C#?
Thanks. | 0 |
9,481,667 | 02/28/2012 12:11:21 | 1,151,429 | 01/16/2012 07:55:58 | 30 | 0 | Making Patterns with Recusions | Can you people please help me with my assignment?
I am having to much problem with this pattern.
If the user Input is 5, then the outcome is:
+**
****
*******
***********
****************
This is the best that I can ever come up to this pattern.
int recursions(int number,int condition)
{
if(condition < 0)
{
printf("\n");
return 0;
}
else
{
printf("**");
recursions(number + 2,condition - 1);
}
}
int main()
{
int number;
printf("Please give a number!\n");
scanf("%d",&number);
printf("+");
recursions(number,number);
getch();
}
I really don't know If what kind of pattern there is involved. I been Looking for the pattern for 1 hr and doing the pattern blindly for 2hr.
| c | homework | design-patterns | recursion | null | 04/06/2012 17:21:23 | not a real question | Making Patterns with Recusions
===
Can you people please help me with my assignment?
I am having to much problem with this pattern.
If the user Input is 5, then the outcome is:
+**
****
*******
***********
****************
This is the best that I can ever come up to this pattern.
int recursions(int number,int condition)
{
if(condition < 0)
{
printf("\n");
return 0;
}
else
{
printf("**");
recursions(number + 2,condition - 1);
}
}
int main()
{
int number;
printf("Please give a number!\n");
scanf("%d",&number);
printf("+");
recursions(number,number);
getch();
}
I really don't know If what kind of pattern there is involved. I been Looking for the pattern for 1 hr and doing the pattern blindly for 2hr.
| 1 |
4,309,089 | 11/29/2010 23:19:30 | 144,140 | 07/23/2009 23:38:33 | 203 | 16 | Return function pointing to local var in php |
class Person{
var $name = "Omer";
function get_name(){
return $this->name;//Why not $this->$name ?
}
}
Thanks | php | variables | methods | return | null | null | open | Return function pointing to local var in php
===
class Person{
var $name = "Omer";
function get_name(){
return $this->name;//Why not $this->$name ?
}
}
Thanks | 0 |
4,192,299 | 11/16/2010 08:34:03 | 256,988 | 01/22/2010 18:27:21 | 3 | 0 | Executing C# code from front end | I have something like this
<script language="c#" runat="server">
private string GetUserImage(string userId)
{
MembershipUser user = Membership.GetUser();
ProfileBase profile = ProfileBase.Create(user.UserName);
return profile.GetPropertyValue("Photo").ToString();
}
</script >
it works fine, but I need to create a user object by passing Guid like this
MembershipUser user = Membership.GetUser(new Guid(userId));
It does not work for me. what may be the cause. it woks fine from C# code behind.
Regards,
tvr | asp.net | null | null | null | null | 11/16/2010 14:27:05 | not a real question | Executing C# code from front end
===
I have something like this
<script language="c#" runat="server">
private string GetUserImage(string userId)
{
MembershipUser user = Membership.GetUser();
ProfileBase profile = ProfileBase.Create(user.UserName);
return profile.GetPropertyValue("Photo").ToString();
}
</script >
it works fine, but I need to create a user object by passing Guid like this
MembershipUser user = Membership.GetUser(new Guid(userId));
It does not work for me. what may be the cause. it woks fine from C# code behind.
Regards,
tvr | 1 |
7,725,051 | 10/11/2011 11:07:04 | 907,596 | 08/23/2011 11:18:32 | 22 | 0 | Which SEO softwares to use? | I want to do SEO of my site for around 10-15 keywords. I went through many tutorials regarding it. I have know how of what needs to be done. It was then, I came across Complete SEO softwares like SEO Power Suite, Traffic Travis, SeNuke, Market Samurai etc. I got really confused around it and am stuck on how to proceed. I had read that Google blacklists if we use automated softwares. Can someone please tell me which softwares to use based on your experience?
| seo | null | null | null | null | 10/11/2011 11:13:39 | not constructive | Which SEO softwares to use?
===
I want to do SEO of my site for around 10-15 keywords. I went through many tutorials regarding it. I have know how of what needs to be done. It was then, I came across Complete SEO softwares like SEO Power Suite, Traffic Travis, SeNuke, Market Samurai etc. I got really confused around it and am stuck on how to proceed. I had read that Google blacklists if we use automated softwares. Can someone please tell me which softwares to use based on your experience?
| 4 |
321,711 | 11/26/2008 18:37:42 | 4,418 | 09/03/2008 15:54:27 | 5,036 | 410 | Virtual guest not bridging to the host's VPN connection in VMware Server | I saw this similar question for [Hyper-V](http://stackoverflow.com/questions/124378/how-to-share-host-vpn-connection-with-vm-instances-in-hyper-v), but I don't think any of the answers there apply directly. If they do, please point me at the right one, and I'll close this as a dupe.
My question arises with using VMware's bridged networking - when I have X-many guests running in VMware Server, and I connect to my corporate VPN, none of the hosts "rebridge", they continue to get their IP address from my router.
If I start the VPN *before* starting VMware, the same behavior is seen.
Is there a configuration option I have merely missed somewhere that would put the guests onto the VPN also, getting their IPs from the DHCP server at the office, or is this a pipe dream at the moment? | vpn | vmware | networking | null | null | 06/02/2011 16:10:41 | off topic | Virtual guest not bridging to the host's VPN connection in VMware Server
===
I saw this similar question for [Hyper-V](http://stackoverflow.com/questions/124378/how-to-share-host-vpn-connection-with-vm-instances-in-hyper-v), but I don't think any of the answers there apply directly. If they do, please point me at the right one, and I'll close this as a dupe.
My question arises with using VMware's bridged networking - when I have X-many guests running in VMware Server, and I connect to my corporate VPN, none of the hosts "rebridge", they continue to get their IP address from my router.
If I start the VPN *before* starting VMware, the same behavior is seen.
Is there a configuration option I have merely missed somewhere that would put the guests onto the VPN also, getting their IPs from the DHCP server at the office, or is this a pipe dream at the moment? | 2 |
5,619,000 | 04/11/2011 09:02:14 | 687,943 | 04/01/2011 16:25:44 | 3 | 0 | Android triangle puzzle game development | i'm want to develop puzzle game for Android. I have develop simple apps for android. But need guide for developing triangle puzzle (How many triangles in the picture). with three options for time limit and five levels of complexity.
Any link, guide line, suggestions?
Thank you so much. | android | null | null | null | null | 04/11/2011 12:22:34 | not a real question | Android triangle puzzle game development
===
i'm want to develop puzzle game for Android. I have develop simple apps for android. But need guide for developing triangle puzzle (How many triangles in the picture). with three options for time limit and five levels of complexity.
Any link, guide line, suggestions?
Thank you so much. | 1 |
7,864,206 | 10/23/2011 03:42:40 | 91,422 | 04/16/2009 02:09:50 | 116 | 1 | what is the best way to handle new clients using select() in a server? | I want to write a asynchronous socket server in C, but before I do I'm doing some research. Looking at the select() socket example shown here: http://www.gnu.org/s/hello/manual/libc/Server-Example.html#Server-Example I can see that the example program will only accept one client per select loop (if I'm reading it right). So if there are 20 clients and two more try to connect, will it only accept the 21st client then process the other 20 (worst case, assuming all 20 others require reading) and THEN accept the 22nd? Would it be better if I break the loop after accepting a client so it can select() again and take care of all pending clients before processing connected ones? Or does that defeat the purpose of using select()? Thanks. | c | sockets | select | asynchronous | null | null | open | what is the best way to handle new clients using select() in a server?
===
I want to write a asynchronous socket server in C, but before I do I'm doing some research. Looking at the select() socket example shown here: http://www.gnu.org/s/hello/manual/libc/Server-Example.html#Server-Example I can see that the example program will only accept one client per select loop (if I'm reading it right). So if there are 20 clients and two more try to connect, will it only accept the 21st client then process the other 20 (worst case, assuming all 20 others require reading) and THEN accept the 22nd? Would it be better if I break the loop after accepting a client so it can select() again and take care of all pending clients before processing connected ones? Or does that defeat the purpose of using select()? Thanks. | 0 |
5,910,473 | 05/06/2011 11:05:14 | 741,620 | 05/06/2011 11:05:14 | 1 | 0 | Application.Printers returns error message "Object does not support this property or method" | Do I need to select a specific Reference to make printers property visible? Which one? | vba | excel-2003 | null | null | null | null | open | Application.Printers returns error message "Object does not support this property or method"
===
Do I need to select a specific Reference to make printers property visible? Which one? | 0 |
11,476,048 | 07/13/2012 18:15:00 | 1,341,275 | 04/18/2012 12:15:58 | 8 | 0 | Multiple Android Emulator loading in windows 7 64 bit | i am updating android sdk rev 19 into rev 20, now have a problem for loading multiple android emulators.
i am using windows 7 64 bit
eclipse Juno for mobile developers
how can i sole this problem any one can help me
THANKS
| android | eclipse | android-emulator | windows-7-x64 | null | 07/15/2012 12:08:13 | not a real question | Multiple Android Emulator loading in windows 7 64 bit
===
i am updating android sdk rev 19 into rev 20, now have a problem for loading multiple android emulators.
i am using windows 7 64 bit
eclipse Juno for mobile developers
how can i sole this problem any one can help me
THANKS
| 1 |
4,542,717 | 12/27/2010 23:50:42 | 518,551 | 11/24/2010 09:36:23 | 86 | 4 | C#, WPF. Length of string that will fit in a specific width. | I'm sure I'm missing something obvious, I have an area in which I intend to draw text. I know its (the area) height and width. I wish to know how many characters/Words will fit in the width, characters preferably. Second question, If the line is too long I'll want to draw a second line, so I guess I need to get the height of the text as well, including what ever it considers the right vertical padding?
I'd also rather like to know the inverse, i.e. how many characters I can fit in a specific width.
I assume the fact that WPF isn't constrained to pixels will have some bearing on the answer?
Ultimately I'm planning on wrapping text around irregular shaped images embedded in the text.
Any pointers in the right direction would be great.
Thanks | wpf | wpf-controls | null | null | null | null | open | C#, WPF. Length of string that will fit in a specific width.
===
I'm sure I'm missing something obvious, I have an area in which I intend to draw text. I know its (the area) height and width. I wish to know how many characters/Words will fit in the width, characters preferably. Second question, If the line is too long I'll want to draw a second line, so I guess I need to get the height of the text as well, including what ever it considers the right vertical padding?
I'd also rather like to know the inverse, i.e. how many characters I can fit in a specific width.
I assume the fact that WPF isn't constrained to pixels will have some bearing on the answer?
Ultimately I'm planning on wrapping text around irregular shaped images embedded in the text.
Any pointers in the right direction would be great.
Thanks | 0 |
5,442,455 | 03/26/2011 13:00:37 | 513,413 | 11/19/2010 11:31:30 | 143 | 2 | android, is it possible to install android OS on my GPS? | recently I bhought a GPS device. All maps and other programs are stored on SD/MMC card. This device uses windows CE to run applications.
My question is, can I install android OS as a software on my device? How can I find android OS for download?
Thanks | android | windows | operating-system | install | null | 03/26/2011 13:38:01 | off topic | android, is it possible to install android OS on my GPS?
===
recently I bhought a GPS device. All maps and other programs are stored on SD/MMC card. This device uses windows CE to run applications.
My question is, can I install android OS as a software on my device? How can I find android OS for download?
Thanks | 2 |
8,451,238 | 12/09/2011 20:19:56 | 686,920 | 04/01/2011 04:16:29 | 11 | 1 | Magento .htaccess Redirection of index.php to root | I do not want my URLs on my Store to contain index.php
I have tried the following code in my .htaccess file to redirect index.php to root.
**RewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.php HTTP/**
**RewriteRule ^index.php$ http://www.pudu.com.au/ [R=301,L]**
I then tried to resolve http://www.pudu.com.au/index.php and it showed me an error page as shown in the attachment
error.png
![enter image description here][1]
I need help in resolving this issue.
All my urls including product pages contain index.php which I want to get rid off.
Looking forward for some help.
Thanks & Regards,
Hemanth
[1]: http://i.stack.imgur.com/oQ8rZ.png | .htaccess | magento | null | null | null | null | open | Magento .htaccess Redirection of index.php to root
===
I do not want my URLs on my Store to contain index.php
I have tried the following code in my .htaccess file to redirect index.php to root.
**RewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.php HTTP/**
**RewriteRule ^index.php$ http://www.pudu.com.au/ [R=301,L]**
I then tried to resolve http://www.pudu.com.au/index.php and it showed me an error page as shown in the attachment
error.png
![enter image description here][1]
I need help in resolving this issue.
All my urls including product pages contain index.php which I want to get rid off.
Looking forward for some help.
Thanks & Regards,
Hemanth
[1]: http://i.stack.imgur.com/oQ8rZ.png | 0 |
7,133,557 | 08/20/2011 17:52:33 | 702,284 | 04/11/2011 13:51:01 | 1,243 | 92 | ruby rescue constant missing? | few month ago I've been using some ruby library ( I can't recall which one exactly, unfortunately )
I've been surprised to see it allowed me to initialize it's instance with something like that:
Lib::SOMETHING(args)
I don't really understand how it works. I'm pretty much sure it should be something dynamic ( there's no SOMETHING constant ) like `constant_missing` method or maybe the `ConstantMissing` exception gets handled somehow.
Could you please advice? | ruby | metaprogramming | null | null | null | null | open | ruby rescue constant missing?
===
few month ago I've been using some ruby library ( I can't recall which one exactly, unfortunately )
I've been surprised to see it allowed me to initialize it's instance with something like that:
Lib::SOMETHING(args)
I don't really understand how it works. I'm pretty much sure it should be something dynamic ( there's no SOMETHING constant ) like `constant_missing` method or maybe the `ConstantMissing` exception gets handled somehow.
Could you please advice? | 0 |
7,544,331 | 09/25/2011 07:57:14 | 677,900 | 03/26/2011 10:08:30 | 220 | 1 | Access to xml file | I have some user.The user has one xml file.i would like any user access to xml file himself.but another user cannot access xml file. how to implement this?
where do i keep this xml files?
my solution:
i keep xml files out of www folder and "folder1" for user 1.
if url is "folder1/1.xml" rewrire url. check session userid and if session id is equall to xml file name redirect to xml file. | php | null | null | null | null | 09/25/2011 08:40:37 | not a real question | Access to xml file
===
I have some user.The user has one xml file.i would like any user access to xml file himself.but another user cannot access xml file. how to implement this?
where do i keep this xml files?
my solution:
i keep xml files out of www folder and "folder1" for user 1.
if url is "folder1/1.xml" rewrire url. check session userid and if session id is equall to xml file name redirect to xml file. | 1 |
5,396,435 | 03/22/2011 19:00:53 | 648,866 | 03/01/2011 13:40:58 | 35 | 0 | facebook application, invite friends after posting on wall php sdk. | here is my code to post status on user's wall :
updatestatusphp :
$feed_url = "http://www.facebook.com/dialog/feed?app_id="
. $app_id . "&redirect_uri=" . urlencode($canvas_page)
. "&message=" . $charecter
. "&link=" . $linky
if (empty($_REQUEST["post_id"])) {
echo("<script> top.location.href='" . $feed_url . "'</script>");
//include "invitefriends.php";
} else {
echo ("Feed Post Id: " . $_REQUEST["post_id"]);
//include "invitefriends.php";
}
it works pretty well.
code below is to prompt user to invite friends to my fb app :
invitefriends.
$message = "Would you like to join me in this great app?";
$requests_url = "http://www.facebook.com/dialog/apprequests?app_id="
. $app_id . "&redirect_uri=" . urlencode($canvas_page)
. "&message=" . $message;
if (empty($_REQUEST["request_ids"])) {
echo("<script> top.location.href='" . $requests_url . "'</script>");
} else {
echo "Request Ids: ";
print_r($_REQUEST["request_ids"]);
} | facebook | facebook-connect | facebook-php-sdk | facebook-social-plugins | null | 07/18/2011 17:34:10 | not a real question | facebook application, invite friends after posting on wall php sdk.
===
here is my code to post status on user's wall :
updatestatusphp :
$feed_url = "http://www.facebook.com/dialog/feed?app_id="
. $app_id . "&redirect_uri=" . urlencode($canvas_page)
. "&message=" . $charecter
. "&link=" . $linky
if (empty($_REQUEST["post_id"])) {
echo("<script> top.location.href='" . $feed_url . "'</script>");
//include "invitefriends.php";
} else {
echo ("Feed Post Id: " . $_REQUEST["post_id"]);
//include "invitefriends.php";
}
it works pretty well.
code below is to prompt user to invite friends to my fb app :
invitefriends.
$message = "Would you like to join me in this great app?";
$requests_url = "http://www.facebook.com/dialog/apprequests?app_id="
. $app_id . "&redirect_uri=" . urlencode($canvas_page)
. "&message=" . $message;
if (empty($_REQUEST["request_ids"])) {
echo("<script> top.location.href='" . $requests_url . "'</script>");
} else {
echo "Request Ids: ";
print_r($_REQUEST["request_ids"]);
} | 1 |
11,481,318 | 07/14/2012 05:25:52 | 1,521,341 | 07/12/2012 16:00:15 | 21 | 3 | Opinion needed about structure of multi-site platform | I've built other website platforms before, and I know the way I did it previously wasn't the best, so I want everyone's opinion on my new structure idea. I'm not sure how wordpress or other platforms do it, but I think this'll work well. Let me know what your thoughts are and if there are any massive holes in it.<br><br>
Here's how I did it before...<br>
> * Each customer received a subdomain i.e. business.simplesellingsite.com<br>
* A php script would break it apart and deliver them the correct content for that page<br>
* Each page was the same for every person and they could only do so much with the template using CSS<br
* I used ugly urls with .php?product_id=1000<br>
Now here's how I want to do it...<br>
> * Each customer receives a subdomain in folder style i.e. sellninja.com/business<br>
* An HTACCESS command sends every url to the same file i.e. index.php<br>
* PHP breaks the url apart and uses file_get_contents to pull the homepage from the theme folder of the theme they have chosen with a get variable to tell that file what content to pull. i.e. file_get_contents($theme."/".$file_name.".php?id=".$business_id);<br.
* Additional pages will be called the same way and additional parameters can be added to the file_get_contents. This keeps everything pretty in the URL and hidden from viewers, but allows me to get contents from a specific folder for that person and not show that folder in the url. It'd be stupid to redirect users to that folder. I realize that. I mean, how stupid would http://www.sellninja.com/business/theme-name/file-name/parameters look? lol...<br>
* The other thing is they can use their own custom domains, so I'd need to break the URL apart and say ok if the domain is sellninja then the first variable in the URL array is the business, but if it's not, then the first parameter is the file-name and i've got to match that domain with a business in the database<br>
SO, are there any holes in this idea? Can I optimize it in any way that's easy to understand? I HATE working with HTACESS, so please no options where I have to write nine pages of modrewrite. | structure | platform | null | null | null | 07/20/2012 21:31:54 | not a real question | Opinion needed about structure of multi-site platform
===
I've built other website platforms before, and I know the way I did it previously wasn't the best, so I want everyone's opinion on my new structure idea. I'm not sure how wordpress or other platforms do it, but I think this'll work well. Let me know what your thoughts are and if there are any massive holes in it.<br><br>
Here's how I did it before...<br>
> * Each customer received a subdomain i.e. business.simplesellingsite.com<br>
* A php script would break it apart and deliver them the correct content for that page<br>
* Each page was the same for every person and they could only do so much with the template using CSS<br
* I used ugly urls with .php?product_id=1000<br>
Now here's how I want to do it...<br>
> * Each customer receives a subdomain in folder style i.e. sellninja.com/business<br>
* An HTACCESS command sends every url to the same file i.e. index.php<br>
* PHP breaks the url apart and uses file_get_contents to pull the homepage from the theme folder of the theme they have chosen with a get variable to tell that file what content to pull. i.e. file_get_contents($theme."/".$file_name.".php?id=".$business_id);<br.
* Additional pages will be called the same way and additional parameters can be added to the file_get_contents. This keeps everything pretty in the URL and hidden from viewers, but allows me to get contents from a specific folder for that person and not show that folder in the url. It'd be stupid to redirect users to that folder. I realize that. I mean, how stupid would http://www.sellninja.com/business/theme-name/file-name/parameters look? lol...<br>
* The other thing is they can use their own custom domains, so I'd need to break the URL apart and say ok if the domain is sellninja then the first variable in the URL array is the business, but if it's not, then the first parameter is the file-name and i've got to match that domain with a business in the database<br>
SO, are there any holes in this idea? Can I optimize it in any way that's easy to understand? I HATE working with HTACESS, so please no options where I have to write nine pages of modrewrite. | 1 |
11,454,107 | 07/12/2012 14:30:19 | 1,330,137 | 04/12/2012 20:13:00 | 77 | 3 | Streamlining If statement c# | I'm trying to use this statement
status_label.Text = err.Message + " || " + err.InnerException == null ? " " : err.InnerException.Message;
Basically if there is an InnerException because its not null, then show it, if it is null then don't output anything.
this is as streamlined as I think I can have it
status_label.Text = err.Message;
if (err.InnerException == null)
status_label.Text += " || " + err.InnerException.Message;
Cheers. | c# | visual-studio-2010 | object | if-statement | null | 07/12/2012 16:03:14 | not a real question | Streamlining If statement c#
===
I'm trying to use this statement
status_label.Text = err.Message + " || " + err.InnerException == null ? " " : err.InnerException.Message;
Basically if there is an InnerException because its not null, then show it, if it is null then don't output anything.
this is as streamlined as I think I can have it
status_label.Text = err.Message;
if (err.InnerException == null)
status_label.Text += " || " + err.InnerException.Message;
Cheers. | 1 |
11,494,682 | 07/15/2012 18:55:49 | 328,294 | 04/28/2010 20:53:57 | 1,035 | 34 | How does SSH know which key to use? | I'm trying to set up ssh keys and I don't do this often. That said, I have 3-4 key pairs in my .ssh/ dir already. WHen I do ssh my_user@mydomain.com how does ssh know what key to use?
I don't want to have key per site, but rather use one private key for lots of sites, and put the public key on the remote server. Sometimes my username on the server is not the same as my local username (often). How does SSH know which key I want to use? | ssh | null | null | null | null | 07/16/2012 17:34:15 | off topic | How does SSH know which key to use?
===
I'm trying to set up ssh keys and I don't do this often. That said, I have 3-4 key pairs in my .ssh/ dir already. WHen I do ssh my_user@mydomain.com how does ssh know what key to use?
I don't want to have key per site, but rather use one private key for lots of sites, and put the public key on the remote server. Sometimes my username on the server is not the same as my local username (often). How does SSH know which key I want to use? | 2 |
5,073,126 | 02/22/2011 01:24:29 | 343,614 | 05/18/2010 02:32:33 | 26 | 5 | How to gpg encrypt via PHP on a windows platform, under a webserver? | I'm trying to do GPG encryption on a Windows platform, in PHP, running XAMPP.
The webserver is Apache and is running PHP 5.2.9.
I'm using GPG4Win 2.0.4.
I've had success running the encrypt command from the command line. I've changed the recipient and host names.
C:\>C:\PROGRA~1\GNU\GnuPG\pub\gpg.exe --encrypt --homedir C:\DOCUME~1\reubenh.AD\APPLIC~1\gnupg --recipient name@host.com --armor < test.txt > test.enc.txt
In PHP, I'm using proc_open() so I can pipe the content to be encrypted directly to the process, and use the stdout pipe to grab the output.
Following is a snippet of the code:
$cmd = Configure::read('Legacy.GPG.gpg_bin').' --encrypt '.
'--homedir '.Configure::read('Legacy.GPG.gpg_home').' '.
'--recipient '.Configure::read('Legacy.MO.gnugp_keyname').' '.
'--local-user '.'me@host.com'.' '.
'--armor --no-tty --batch --debug-all';
error_log('Encrypting Command line is '.$cmd);
$descriptors = array(
0 => array('pipe', 'r'),
1 => array('pipe', 'w'),
2 => array('file', LOGS.'gpg.log', 'a')
);
$process = proc_open($cmd, $descriptors, $pipes);
if (is_resource($process)) {
error_log(print_r($pipes, true));
list($stdin, $stdout) = $pipes;
error_log('Have pipes');
error_log('body length is '.strlen($this->request['body']));
$ret = fwrite($stdin, $this->request['body'], strlen($this->request['body']));
error_log($ret.' written');
error_log('before fclose()');
fclose($stdin);
error_log('Done with input');
$encryptedData = '';
while(!feof($stdout)) {
$line = fgets($stdout);
error_log('Line read:'.error_log(print_r($line, true)));
$encryptedData .= $line;
}
fclose($stdout);
$return = proc_close($process);
error_log('Encryption process returned '.print_r($return, true));
if ($return == '0') { // ... next step is to sign
The generated command from the first error_log() statement is:
C:\PROGRA~1\GNU\GnuPG\pub\gpg.exe --encrypt --homedir C:\DOCUME~1\reubenh.AD\APPLIC~1\gnupg --recipient name@host.com --local-user me@host.com --armor --no-tty --batch --debug-all
The actual running seems to get as far as "Have pipes". After that, it just stops.
I can also see in the Process Explorer, that the gpg.exe also spawns a gpg2.exe. I suspect that it is this gpg2.exe that I do not have a handle to, is waiting for the input, not the original gpg.exe that I invoked.
I've tried invoking gpg2.exe directly, but a child gpg2.exe is still spawned.
I'd rather use proc_open(), and avoid using disk I/O to provide the content and grab the output, since this will be run on a webserver, and proc_open() will allow me to not bother generating unique files, and then having to clean them up.
| php | windows | encryption | xampp | gpg | null | open | How to gpg encrypt via PHP on a windows platform, under a webserver?
===
I'm trying to do GPG encryption on a Windows platform, in PHP, running XAMPP.
The webserver is Apache and is running PHP 5.2.9.
I'm using GPG4Win 2.0.4.
I've had success running the encrypt command from the command line. I've changed the recipient and host names.
C:\>C:\PROGRA~1\GNU\GnuPG\pub\gpg.exe --encrypt --homedir C:\DOCUME~1\reubenh.AD\APPLIC~1\gnupg --recipient name@host.com --armor < test.txt > test.enc.txt
In PHP, I'm using proc_open() so I can pipe the content to be encrypted directly to the process, and use the stdout pipe to grab the output.
Following is a snippet of the code:
$cmd = Configure::read('Legacy.GPG.gpg_bin').' --encrypt '.
'--homedir '.Configure::read('Legacy.GPG.gpg_home').' '.
'--recipient '.Configure::read('Legacy.MO.gnugp_keyname').' '.
'--local-user '.'me@host.com'.' '.
'--armor --no-tty --batch --debug-all';
error_log('Encrypting Command line is '.$cmd);
$descriptors = array(
0 => array('pipe', 'r'),
1 => array('pipe', 'w'),
2 => array('file', LOGS.'gpg.log', 'a')
);
$process = proc_open($cmd, $descriptors, $pipes);
if (is_resource($process)) {
error_log(print_r($pipes, true));
list($stdin, $stdout) = $pipes;
error_log('Have pipes');
error_log('body length is '.strlen($this->request['body']));
$ret = fwrite($stdin, $this->request['body'], strlen($this->request['body']));
error_log($ret.' written');
error_log('before fclose()');
fclose($stdin);
error_log('Done with input');
$encryptedData = '';
while(!feof($stdout)) {
$line = fgets($stdout);
error_log('Line read:'.error_log(print_r($line, true)));
$encryptedData .= $line;
}
fclose($stdout);
$return = proc_close($process);
error_log('Encryption process returned '.print_r($return, true));
if ($return == '0') { // ... next step is to sign
The generated command from the first error_log() statement is:
C:\PROGRA~1\GNU\GnuPG\pub\gpg.exe --encrypt --homedir C:\DOCUME~1\reubenh.AD\APPLIC~1\gnupg --recipient name@host.com --local-user me@host.com --armor --no-tty --batch --debug-all
The actual running seems to get as far as "Have pipes". After that, it just stops.
I can also see in the Process Explorer, that the gpg.exe also spawns a gpg2.exe. I suspect that it is this gpg2.exe that I do not have a handle to, is waiting for the input, not the original gpg.exe that I invoked.
I've tried invoking gpg2.exe directly, but a child gpg2.exe is still spawned.
I'd rather use proc_open(), and avoid using disk I/O to provide the content and grab the output, since this will be run on a webserver, and proc_open() will allow me to not bother generating unique files, and then having to clean them up.
| 0 |
326,379 | 11/28/2008 18:27:14 | 41,654 | 11/28/2008 18:03:04 | 1 | 0 | PHP APIs for Hotmail, Gmail and Yahoo? | I am a PHP developer who is kind of in a pickle. I'm trying to locate and/or build an API capable of speaking to Hotmail, Yahoo and GMAIL in order to retrieve contact lists (with the user's consent, of course). The one I'm having the most trouble finding is a Hotmail API.
Where would I start to look as far as finding either a working, stable API or the steps I could take to developing one for hotmail? Is there one that covers all of these bases that I could implement? Any help would be greatly appreciated!
Thanks! | php | hotmail | gmail | api | null | 07/10/2012 14:23:14 | not constructive | PHP APIs for Hotmail, Gmail and Yahoo?
===
I am a PHP developer who is kind of in a pickle. I'm trying to locate and/or build an API capable of speaking to Hotmail, Yahoo and GMAIL in order to retrieve contact lists (with the user's consent, of course). The one I'm having the most trouble finding is a Hotmail API.
Where would I start to look as far as finding either a working, stable API or the steps I could take to developing one for hotmail? Is there one that covers all of these bases that I could implement? Any help would be greatly appreciated!
Thanks! | 4 |
11,402,323 | 07/09/2012 20:09:52 | 871,926 | 07/31/2011 21:02:09 | 20 | 0 | Port Android Application to website? | Is there anyway to port an Android application to a website?
For example, if people do not have Android (iOS, Computer, etc), I would like them to navigate to a website and access a web-version of the Android application.
Is this possible? | android | google-chrome | application | android-emulator | null | null | open | Port Android Application to website?
===
Is there anyway to port an Android application to a website?
For example, if people do not have Android (iOS, Computer, etc), I would like them to navigate to a website and access a web-version of the Android application.
Is this possible? | 0 |
8,810,465 | 01/10/2012 21:03:04 | 298,336 | 03/21/2010 07:16:45 | 668 | 7 | How to improve performance or simplify .NET code with linq | Apart from database operation, how can I simplify or improve my code with LINQ ?
**Example**
*To search in a string*
string search = "search in list";
IEnumerable<string> results = myList.Where(s => s == search); | performance | linq | .net-4.0 | null | null | 01/12/2012 03:38:32 | not constructive | How to improve performance or simplify .NET code with linq
===
Apart from database operation, how can I simplify or improve my code with LINQ ?
**Example**
*To search in a string*
string search = "search in list";
IEnumerable<string> results = myList.Where(s => s == search); | 4 |
1,911,918 | 12/16/2009 02:41:56 | 205,971 | 11/08/2009 09:50:01 | 37 | 2 | Should I do money calculations in Javascript or as an AJAX call? | I'm building a webapp using JQuery, Stripes, Spring and JPA (Hibernate).
I have a page that allows users to enter a number of order line items and each time onblur occurs in the price field, I have a JQuery event bound to the field which sums all the price fields (this is a subtotal), calculates 10% tax and adds the tax to the subtotal. I update the page to display the subtotal, tax and grand total.
My question is, should I be doing this calculation in Javascript? If so, how can I be sure the rounding etc is working correctly? I'm a bit worried about problems with precision.
Would it be better for me to make an Ajax call to do the calculation in Java?
Any advice would be great! | jquery | javascript | currency | money | ajax | null | open | Should I do money calculations in Javascript or as an AJAX call?
===
I'm building a webapp using JQuery, Stripes, Spring and JPA (Hibernate).
I have a page that allows users to enter a number of order line items and each time onblur occurs in the price field, I have a JQuery event bound to the field which sums all the price fields (this is a subtotal), calculates 10% tax and adds the tax to the subtotal. I update the page to display the subtotal, tax and grand total.
My question is, should I be doing this calculation in Javascript? If so, how can I be sure the rounding etc is working correctly? I'm a bit worried about problems with precision.
Would it be better for me to make an Ajax call to do the calculation in Java?
Any advice would be great! | 0 |
11,157,453 | 06/22/2012 13:47:04 | 1,448,323 | 06/11/2012 06:58:00 | 35 | 0 | Is long data type faster than int type? | int a = 0xEFEFEFEF;
long b = 0xEFEFEFEF;
cout << a << endl << b << endl;
value 'a' and 'b' has same output.
I heard about long type has more processing time to calculation because of long type should be casting to int for calculating. Is these values are same internally? int type really faster then long?
| c++ | data | types | null | null | 06/22/2012 13:57:36 | not a real question | Is long data type faster than int type?
===
int a = 0xEFEFEFEF;
long b = 0xEFEFEFEF;
cout << a << endl << b << endl;
value 'a' and 'b' has same output.
I heard about long type has more processing time to calculation because of long type should be casting to int for calculating. Is these values are same internally? int type really faster then long?
| 1 |
191,282 | 10/10/2008 13:31:07 | 25,515 | 10/06/2008 15:01:43 | 68 | 13 | How do I create a custom menu navigation in ASP.NET? | Is it possible to make the Menu control look and feel like the following image?
![alt text][1]
It is a nested list
[1]: http://img512.imageshack.us/img512/4774/navzu4.gif | asp.net | navigation | css | coding-style | null | 05/17/2012 15:16:15 | not a real question | How do I create a custom menu navigation in ASP.NET?
===
Is it possible to make the Menu control look and feel like the following image?
![alt text][1]
It is a nested list
[1]: http://img512.imageshack.us/img512/4774/navzu4.gif | 1 |
8,691,003 | 12/31/2011 23:04:58 | 1,124,728 | 12/31/2011 22:28:50 | 1 | 0 | Using Apple's iTunes RSS Feed on Wordpress | As a little experiment, I want to implement the iTunes App Store's RSS Feed into a wordpress site.
I want it to look something like this:
http://www.148apps.com/newest-148-app-store-additions/
OR
http://www.slidetoplay.com/games/new-releases
without the sorting options.
--
I'm completely new to programming, and its a small project I'd like to finish.
Can you suggest plugins or tutorials?
| wordpress | rss | itunes | apps | null | 01/05/2012 16:01:43 | off topic | Using Apple's iTunes RSS Feed on Wordpress
===
As a little experiment, I want to implement the iTunes App Store's RSS Feed into a wordpress site.
I want it to look something like this:
http://www.148apps.com/newest-148-app-store-additions/
OR
http://www.slidetoplay.com/games/new-releases
without the sorting options.
--
I'm completely new to programming, and its a small project I'd like to finish.
Can you suggest plugins or tutorials?
| 2 |
3,344,872 | 07/27/2010 14:52:48 | 126,916 | 06/22/2009 12:57:30 | 1,362 | 44 | Type hinting not enforced in defrecord constructors | I created a type using `defrecord` with type hints for the fields. However, I found that these type hints are not enforced in the constructors and I am able to do some strange things with them. Look at the snippet below for example:
user=> (defrecord Person [#^String name #^Integer age])
user.Person
user=> (seq (.getConstructors Person))
(#<Constructor public user.Person(java.lang.Object,java.lang.Object,
java.lang.Object,java.lang.Object)>
#<Constructor public user.Person(java.lang.Object,java.lang.Object)>)
user=> (Person. (Integer. 123) "abhinav")
#:user.Person{:name 123, :age "abhinav"}
The constructor signatures shown do not match with the type hints provided (they use `Object` for both `String` and `Integer`) and I am able to construct objects with wrong field types.
Is there something wrong with my code or is it a bug in Clojure?
I am on Clojure 1.2.0-beta1. | clojure | type-hinting | null | null | null | null | open | Type hinting not enforced in defrecord constructors
===
I created a type using `defrecord` with type hints for the fields. However, I found that these type hints are not enforced in the constructors and I am able to do some strange things with them. Look at the snippet below for example:
user=> (defrecord Person [#^String name #^Integer age])
user.Person
user=> (seq (.getConstructors Person))
(#<Constructor public user.Person(java.lang.Object,java.lang.Object,
java.lang.Object,java.lang.Object)>
#<Constructor public user.Person(java.lang.Object,java.lang.Object)>)
user=> (Person. (Integer. 123) "abhinav")
#:user.Person{:name 123, :age "abhinav"}
The constructor signatures shown do not match with the type hints provided (they use `Object` for both `String` and `Integer`) and I am able to construct objects with wrong field types.
Is there something wrong with my code or is it a bug in Clojure?
I am on Clojure 1.2.0-beta1. | 0 |
10,640,156 | 05/17/2012 17:00:42 | 946,225 | 09/15/2011 07:26:44 | 62 | 0 | Access Denied (SQLEditors) | I have an Employee Database in SQL Server 2008. When I right click on any table and chose **Edit Top 200 Rows** then it shows following Error Box:
![Access Denied Error][1]
[1]: http://i.stack.imgur.com/gJyB3.png
How can i fix it?
Thanks | sql-server-2008 | null | null | null | null | null | open | Access Denied (SQLEditors)
===
I have an Employee Database in SQL Server 2008. When I right click on any table and chose **Edit Top 200 Rows** then it shows following Error Box:
![Access Denied Error][1]
[1]: http://i.stack.imgur.com/gJyB3.png
How can i fix it?
Thanks | 0 |
10,680,075 | 05/21/2012 05:51:48 | 782,145 | 06/03/2011 03:41:58 | 819 | 31 | Extended use of replace filter in twig? | i checked out the [documentation][1] for the replace filter in twig. my problem is that, suppose i have a variable say `contvariable`, and the content passed through that variable from the controller is dynamic
return $this->render('RodasysFormstudyBundle:Default:addclientname.html.twig', array('contvariable' =>$sometext));
this `$sometext` variable will contain texts like
$sometext='%Sun% rises in the East';
the text inside the `%%` should be displayed as an `input field` in the browser. I did not find any examples in the web like to replace the content inside the `%%` (what ever the content be whether its sun or the moon). Is this possible to do this using `replace` filter or should i follow some other method such as to replace the content in controller before sending it to twig..
please help..
[1]: http://twig.sensiolabs.org/doc/filters/replace.html
| symfony-2.0 | twig | null | null | null | null | open | Extended use of replace filter in twig?
===
i checked out the [documentation][1] for the replace filter in twig. my problem is that, suppose i have a variable say `contvariable`, and the content passed through that variable from the controller is dynamic
return $this->render('RodasysFormstudyBundle:Default:addclientname.html.twig', array('contvariable' =>$sometext));
this `$sometext` variable will contain texts like
$sometext='%Sun% rises in the East';
the text inside the `%%` should be displayed as an `input field` in the browser. I did not find any examples in the web like to replace the content inside the `%%` (what ever the content be whether its sun or the moon). Is this possible to do this using `replace` filter or should i follow some other method such as to replace the content in controller before sending it to twig..
please help..
[1]: http://twig.sensiolabs.org/doc/filters/replace.html
| 0 |
3,736,413 | 09/17/2010 14:51:40 | 294,789 | 03/16/2010 13:50:52 | 22 | 6 | iPhone checking for existance of AVCaptureSession Class | I have integrated a library that uses AVCaptureSession to capture a photo from the camera. As is the AVCaptureSession is only available on iOS4 devices, I want to disable this integrated functionality for older devices.
I know that it should be done by weak-linking the AVFoundation Framework and checking for function existance. Weak-linking is easy to do, but which function should I check for existance here? AVCaptureSession is a class and not a function.
Could anyone provide some sample code here please?
thanks in advance! | objective-c | iphone-sdk-4.0 | null | null | null | null | open | iPhone checking for existance of AVCaptureSession Class
===
I have integrated a library that uses AVCaptureSession to capture a photo from the camera. As is the AVCaptureSession is only available on iOS4 devices, I want to disable this integrated functionality for older devices.
I know that it should be done by weak-linking the AVFoundation Framework and checking for function existance. Weak-linking is easy to do, but which function should I check for existance here? AVCaptureSession is a class and not a function.
Could anyone provide some sample code here please?
thanks in advance! | 0 |
2,010,576 | 01/06/2010 02:17:25 | 224,988 | 12/04/2009 18:31:03 | 375 | 31 | jQuery animation issue in Chrome | I was animating an a element in jQuery using jQuery 1.3.2 and jQuery color plugin. I was animating the color and backgroundColor properties at the same time. In IE8 and FF it worked just fine. Chrome animated the mouseover color and then stopped. The background stayed the same and the mouseout did not undo the effect as it should have. Chrome's developer tools said something about something being undefined. I know that I'm being somewhat vague here, perhaps this is a known issue? | jquery | bug | animation | jquery-color | null | null | open | jQuery animation issue in Chrome
===
I was animating an a element in jQuery using jQuery 1.3.2 and jQuery color plugin. I was animating the color and backgroundColor properties at the same time. In IE8 and FF it worked just fine. Chrome animated the mouseover color and then stopped. The background stayed the same and the mouseout did not undo the effect as it should have. Chrome's developer tools said something about something being undefined. I know that I'm being somewhat vague here, perhaps this is a known issue? | 0 |
2,956,728 | 06/02/2010 10:20:09 | 356,322 | 06/02/2010 10:20:09 | 1 | 0 | Best language to develop medical software | I need to write medical program to manage medical practices (patient records, appointments, prescription, etc). Note that this is not for US practices so US EMRs will not work. What is the best platform to develop the software in ie. language and database?
Considerations include:
- Integration with the web - will need to have Doctors download updates to the software from the web. Will also post reports from the software unto webpages
- The software will include a mobile application - probably for Blackberry
- Cost is a big factor - need to minimize the license cost to the users
- Need tight security on the program
| language | platform | medical | null | null | 06/02/2010 10:48:21 | not constructive | Best language to develop medical software
===
I need to write medical program to manage medical practices (patient records, appointments, prescription, etc). Note that this is not for US practices so US EMRs will not work. What is the best platform to develop the software in ie. language and database?
Considerations include:
- Integration with the web - will need to have Doctors download updates to the software from the web. Will also post reports from the software unto webpages
- The software will include a mobile application - probably for Blackberry
- Cost is a big factor - need to minimize the license cost to the users
- Need tight security on the program
| 4 |
4,931,989 | 02/08/2011 10:37:49 | 607,957 | 02/08/2011 10:37:49 | 1 | 0 | dynamic inline silverlight from string without files | for my final project in university i am developing in asp.net mvc3 and using silverlight for vector graphics.
I store silverlight code as string/xml in a database, and i want the ability to manipulate it dynamically (change proportions etc..) and display it in my aspx view. i don't want and can't use files because of scalability issues (there will be a lot of them) and because of possible porting of the application to the cloud (Azure).
basically i want to build a controller that will take raw xaml code from the DB and display it. all the solutions i found on the web are about two options which is not helpful for me:
- http://msdn.microsoft.com/en-us/library/cc189044(VS.95).aspx - which involves manually creating the entire dom object and integrating it in an existing silverlight page, which i don't have
- http://visualstudiomagazine.com/articles/2008/01/21/using-inline-xaml-with-silverlight-listing-2.aspx - using embedded header in the html itself - again not pracrtical..
maybe someone can suggest me a practical solution for my problem | silverlight | asp.net-mvc-2 | null | null | null | null | open | dynamic inline silverlight from string without files
===
for my final project in university i am developing in asp.net mvc3 and using silverlight for vector graphics.
I store silverlight code as string/xml in a database, and i want the ability to manipulate it dynamically (change proportions etc..) and display it in my aspx view. i don't want and can't use files because of scalability issues (there will be a lot of them) and because of possible porting of the application to the cloud (Azure).
basically i want to build a controller that will take raw xaml code from the DB and display it. all the solutions i found on the web are about two options which is not helpful for me:
- http://msdn.microsoft.com/en-us/library/cc189044(VS.95).aspx - which involves manually creating the entire dom object and integrating it in an existing silverlight page, which i don't have
- http://visualstudiomagazine.com/articles/2008/01/21/using-inline-xaml-with-silverlight-listing-2.aspx - using embedded header in the html itself - again not pracrtical..
maybe someone can suggest me a practical solution for my problem | 0 |
7,296,382 | 09/03/2011 22:59:34 | 927,109 | 09/03/2011 22:59:34 | 1 | 0 | How to analyse optimal weights for gathered information in recommendation systems | I want to write a master thesis about recommendation systems on e-commerce sites and there are several questions.
In my first brainstorming I listed some factors that (I think) provide information about the customers preference, e.g.:
- viewing a product details
- amount of time spending on product detail view
- adding a product to the shopping cart
- adding a product to the wishlist
- ...
I found a lot of studies that analyse one factor (e.g. movie rating). There is often used a collaborative filtering approach (item based and user based) to present matching products.
(1) I would like to find out the weights for evalutating the information gathered from the users' actions. I assume that adding a product to cart expresses much more preference for this product than viewing it.
Isn't that correct?
(2) Additionally I am not sure how to connect these preferences to historical data.
If the current user views 4 different jeans and adds a belt to cart, what history data is relevant? One could suggest that shopping carts that contain that belt are analysed. Probably a jeans is most often ordered with that belt. A recommend could be to show that jeans. But the current user views jeans with another style. This information is lost in that case.
(3) I am totally confused if the described problem is already solved in all the algorithms.
I thought that it would be nice to implement tracking a couple of user actions and weight them randomly. After the experiment it should be possible to get the weights that have the best outcome (amount of recommended products that have been ordered).
I haven't found a statistical method for that case.
Best regards! | statistics | recommendation-engine | collaborative-filtering | product-recommendation | null | 09/03/2011 23:12:35 | off topic | How to analyse optimal weights for gathered information in recommendation systems
===
I want to write a master thesis about recommendation systems on e-commerce sites and there are several questions.
In my first brainstorming I listed some factors that (I think) provide information about the customers preference, e.g.:
- viewing a product details
- amount of time spending on product detail view
- adding a product to the shopping cart
- adding a product to the wishlist
- ...
I found a lot of studies that analyse one factor (e.g. movie rating). There is often used a collaborative filtering approach (item based and user based) to present matching products.
(1) I would like to find out the weights for evalutating the information gathered from the users' actions. I assume that adding a product to cart expresses much more preference for this product than viewing it.
Isn't that correct?
(2) Additionally I am not sure how to connect these preferences to historical data.
If the current user views 4 different jeans and adds a belt to cart, what history data is relevant? One could suggest that shopping carts that contain that belt are analysed. Probably a jeans is most often ordered with that belt. A recommend could be to show that jeans. But the current user views jeans with another style. This information is lost in that case.
(3) I am totally confused if the described problem is already solved in all the algorithms.
I thought that it would be nice to implement tracking a couple of user actions and weight them randomly. After the experiment it should be possible to get the weights that have the best outcome (amount of recommended products that have been ordered).
I haven't found a statistical method for that case.
Best regards! | 2 |
7,975,270 | 11/02/2011 02:45:23 | 893,129 | 08/13/2011 14:08:57 | 1 | 0 | server-side sql vs client-side sql | I have been looking to find answers to this question from past two hours. I haven't found even one single relevant post/book/answer. Could somebody explain the difference between server-side scripting and client-side scripting to me. I know that triggers are part of server-side scripting but really, whats the difference between the two. Could you please provide me with couple examples.
Thanks! | sql | null | null | null | null | 11/02/2011 08:38:45 | not a real question | server-side sql vs client-side sql
===
I have been looking to find answers to this question from past two hours. I haven't found even one single relevant post/book/answer. Could somebody explain the difference between server-side scripting and client-side scripting to me. I know that triggers are part of server-side scripting but really, whats the difference between the two. Could you please provide me with couple examples.
Thanks! | 1 |
10,037,164 | 04/05/2012 22:56:25 | 836,026 | 07/08/2011 20:10:32 | 220 | 7 | Example for NSAttributedString with NSStrikethroughColorAttributeName | I'm looking for an example of using NSAttributedString with NSStrikethroughColorAttributeName | ios | null | null | null | null | null | open | Example for NSAttributedString with NSStrikethroughColorAttributeName
===
I'm looking for an example of using NSAttributedString with NSStrikethroughColorAttributeName | 0 |
10,980,755 | 06/11/2012 13:09:57 | 1,448,964 | 06/11/2012 12:53:19 | 1 | 0 | Jquery tabs : dynamic ur on tab reload | I am using a url method for dynamically sending the data through ajax with the following code, where clearSession is a dynamic variable.
$(function(){
var clearSession;
$("#tabs").tabs({
select: function(event, ui) {
if(ui.index == 1){
var url = '${tab1_url}' + "?clearSession=" + clearSession;
$("#tabs").tabs("url", 1, url); //this is new !
}else if(ui.index == 2){
var url = '${tab2_url}' + "?clearSession=" + clearSession;
$("#tabs").tabs("url", 2, url); //this is new !
}
return true;
}
});
});
For refreshing the current tab on click iam using load option like
$("li.ui-tabs-selected").children("a").click(function () {
var tabindex = $("#tabs").tabs('option', 'selected');
$("#tabs").tabs('load',tabindex);
});
While reloading the currently selected tab, it's not taking the dynamic value of clearSession as the control not going to the select function.
Can any one tell me how to pass dynamic url while reloading the currently selected tab.
| jquery | null | null | null | null | null | open | Jquery tabs : dynamic ur on tab reload
===
I am using a url method for dynamically sending the data through ajax with the following code, where clearSession is a dynamic variable.
$(function(){
var clearSession;
$("#tabs").tabs({
select: function(event, ui) {
if(ui.index == 1){
var url = '${tab1_url}' + "?clearSession=" + clearSession;
$("#tabs").tabs("url", 1, url); //this is new !
}else if(ui.index == 2){
var url = '${tab2_url}' + "?clearSession=" + clearSession;
$("#tabs").tabs("url", 2, url); //this is new !
}
return true;
}
});
});
For refreshing the current tab on click iam using load option like
$("li.ui-tabs-selected").children("a").click(function () {
var tabindex = $("#tabs").tabs('option', 'selected');
$("#tabs").tabs('load',tabindex);
});
While reloading the currently selected tab, it's not taking the dynamic value of clearSession as the control not going to the select function.
Can any one tell me how to pass dynamic url while reloading the currently selected tab.
| 0 |
8,935,975 | 01/20/2012 02:09:42 | 1,159,818 | 01/20/2012 02:03:16 | 1 | 0 | @DynamicInsert @DynamicUpdate does not work? | I am using Hibernate 4.
When I use
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true,
selectBeforeUpdate = true)
it works.
But, I found that they have deprecated, so I follow the instructions to use the @DynamicInsert and @DynamicUpdate, like this:
@Entity
@DynamicInsert
@DynamicUpdate
@SelectBeforeUpdate
@Table(name = "User")
public class User {
..........
}
It does not work.
How do I use @DynamicInsert and @DynamicUpdate ? | hibernate | null | null | null | null | null | open | @DynamicInsert @DynamicUpdate does not work?
===
I am using Hibernate 4.
When I use
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true,
selectBeforeUpdate = true)
it works.
But, I found that they have deprecated, so I follow the instructions to use the @DynamicInsert and @DynamicUpdate, like this:
@Entity
@DynamicInsert
@DynamicUpdate
@SelectBeforeUpdate
@Table(name = "User")
public class User {
..........
}
It does not work.
How do I use @DynamicInsert and @DynamicUpdate ? | 0 |
9,820,855 | 03/22/2012 10:54:16 | 89,397 | 04/10/2009 09:24:01 | 1,682 | 44 | Liferay on JBoss AS 7.1 | I tried to install Liferay on JBoss 7.1 without luck. I followed [these instructions][1] for deploying Liferay on an existing application server. In the documentation, under section "Installing Liferay on JBoss 7", the first step is "Download and install JBoss AS 7.0.x into your preferred directory.". This left me wondering if the instruction even apply for JBoss AS 7.1
Anyway, I tried to follow the instructions, I wanted to use liferay's internal data source and mailing, so skipped those stages and I wanted to configure liferay using the wizard. When starting JBoss, I get the following exception:
[11:34:08,098 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.module.service."deployment.ROOT.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.ROOT.war".main: Failed to load module: deployment.ROOT.war:main
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_29]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_29]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_29]
Caused by: org.jboss.modules.ModuleNotFoundException: Module system:main is not found in local module loader @747917a (roots: /Users/<user>/Servers/liferay/jboss-as-7.1.0.Final/modules)
at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126) [jboss-modules.jar:1.1.1.GA]
Any ideas how this could be fixed?
[1]: http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/installing-liferay-on-an-existing-application-server | jboss | liferay | null | null | null | 05/25/2012 03:23:17 | too localized | Liferay on JBoss AS 7.1
===
I tried to install Liferay on JBoss 7.1 without luck. I followed [these instructions][1] for deploying Liferay on an existing application server. In the documentation, under section "Installing Liferay on JBoss 7", the first step is "Download and install JBoss AS 7.0.x into your preferred directory.". This left me wondering if the instruction even apply for JBoss AS 7.1
Anyway, I tried to follow the instructions, I wanted to use liferay's internal data source and mailing, so skipped those stages and I wanted to configure liferay using the wizard. When starting JBoss, I get the following exception:
[11:34:08,098 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.module.service."deployment.ROOT.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.ROOT.war".main: Failed to load module: deployment.ROOT.war:main
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [classes.jar:1.6.0_29]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [classes.jar:1.6.0_29]
at java.lang.Thread.run(Thread.java:680) [classes.jar:1.6.0_29]
Caused by: org.jboss.modules.ModuleNotFoundException: Module system:main is not found in local module loader @747917a (roots: /Users/<user>/Servers/liferay/jboss-as-7.1.0.Final/modules)
at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126) [jboss-modules.jar:1.1.1.GA]
Any ideas how this could be fixed?
[1]: http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/installing-liferay-on-an-existing-application-server | 3 |
11,605,687 | 07/23/2012 02:16:08 | 1,544,731 | 07/23/2012 01:39:55 | 1 | 0 | minimum impact "like" request on Sybase ASE 12.5 DB | I would like to minimize the performace impact of the following query on a Sybase ASE 12.5 database
SELECT description_field FROM table WHERE description_field LIKE 'HEADER%'
GO
I suspect I cannot do better than a full table scan without modifying the database but does someone have an idea?
Perhaps an improvement relative to locking would be done thanks to a special syntax?
| sql | query | optimization | locking | sybase | null | open | minimum impact "like" request on Sybase ASE 12.5 DB
===
I would like to minimize the performace impact of the following query on a Sybase ASE 12.5 database
SELECT description_field FROM table WHERE description_field LIKE 'HEADER%'
GO
I suspect I cannot do better than a full table scan without modifying the database but does someone have an idea?
Perhaps an improvement relative to locking would be done thanks to a special syntax?
| 0 |
10,538,786 | 05/10/2012 16:54:22 | 1,387,704 | 05/10/2012 16:41:08 | 1 | 0 | swf Flash do not work on apache mod_wsgi. Django Project | Recently I deployed my django project on Apache using mod_wsgi.
Everything is working perfect except flash. The flash (.swf file) did
not render on the client's browser but it works perfect while hosting
on django built-in development server. What may be the problem?
When right-clicked at the location where flash should have rendered,
it gives error message, "Movie Not Loaded"
Error Log Shows on the Tools --> Web Developer --> Web Console in Firefox shows following relevant line about flash:
[19:09:24.001] GET http://127.0.0.1/site_media/flash/flashvortex.swf [HTTP/1.1 500 INTERNAL SERVER ERROR 131ms]
I am using
Ubuntu : 11.04
Apache2 : Apache/2.2.17
Adobe Flash Player: 10.3.* | python | django | flash | apache | internal-server-error | 05/11/2012 17:16:40 | off topic | swf Flash do not work on apache mod_wsgi. Django Project
===
Recently I deployed my django project on Apache using mod_wsgi.
Everything is working perfect except flash. The flash (.swf file) did
not render on the client's browser but it works perfect while hosting
on django built-in development server. What may be the problem?
When right-clicked at the location where flash should have rendered,
it gives error message, "Movie Not Loaded"
Error Log Shows on the Tools --> Web Developer --> Web Console in Firefox shows following relevant line about flash:
[19:09:24.001] GET http://127.0.0.1/site_media/flash/flashvortex.swf [HTTP/1.1 500 INTERNAL SERVER ERROR 131ms]
I am using
Ubuntu : 11.04
Apache2 : Apache/2.2.17
Adobe Flash Player: 10.3.* | 2 |
6,268,865 | 06/07/2011 16:57:57 | 480,848 | 10/19/2010 18:19:30 | 247 | 17 | Django Unique properties in admin | I'm building a generic template that will be deployed for several sites, one of the customizing options we'd like to allow would be a custom font for the title text. I'd like to add this property to the admin interface.
Is there a better technique then creating a model for these properties and doing a Model.objects.get() to retrieve 1 instance.
Thanks in advance | django | django-models | django-admin | null | null | null | open | Django Unique properties in admin
===
I'm building a generic template that will be deployed for several sites, one of the customizing options we'd like to allow would be a custom font for the title text. I'd like to add this property to the admin interface.
Is there a better technique then creating a model for these properties and doing a Model.objects.get() to retrieve 1 instance.
Thanks in advance | 0 |
1,871,076 | 12/09/2009 01:28:41 | 154,186 | 08/11/2009 07:12:59 | 1,074 | 74 | Are there any free Xml Diff/Merge tools available? | I have several config files in my .net applications which I would like to merge application settings elements etc.
I was about to begin doing it manually as I usually do, however thought there must be an XML diff GUI tool available somewhere.
The tool would be able to go to the element level to compare and display the differences etc.
However Google gave no substantive free tool results and no hints for anything of value.
Is such a tool available? That is very useful? For free?
Thanks in advance. :) | xml | diff | merge | null | null | 05/12/2012 14:55:05 | not constructive | Are there any free Xml Diff/Merge tools available?
===
I have several config files in my .net applications which I would like to merge application settings elements etc.
I was about to begin doing it manually as I usually do, however thought there must be an XML diff GUI tool available somewhere.
The tool would be able to go to the element level to compare and display the differences etc.
However Google gave no substantive free tool results and no hints for anything of value.
Is such a tool available? That is very useful? For free?
Thanks in advance. :) | 4 |
9,941,743 | 03/30/2012 11:04:47 | 1,071,203 | 11/29/2011 11:46:54 | 47 | 2 | ASP.net - How to achieve CSS with constant values, arithmetic and string manipulation | When developing ASP.NET websites (using VB.NET web forms) - a lot of my time is spend writing CSS files and they always seem to get messy (code duplication) and very long.
All I want to achieve is to be able to manipulate the CSS using VB.NET code in the following ways:
- Use an integer variable to store my "golden" number 7 and use that for width, padding, margin etc where needed
- Use string variables to store my "golden" hex color codes e.g. "#44C5F2" and use them for color, background-color, border-color etc. where needed
- Use an integer variable to set the height of an element and have four child elements each with height: mynum / 4
I just want to use basic VB.net number and string manipulation in order to create a CSS file on the fly.
I understand that the end product - the CSS file shouldn't change much - it should at most change on a daily basis otherwise caching couldn't be used.
I also understand that I would lose Visual Studio CSS intellisense support but...
How do I achieve this?
Should I be using:
- Generic handlers (ASHX)
- ASP.NET Themes
- ASP.NET Skins
- Something else?
I just some pointers.
Any help is appreciated.
Thanks.
| asp.net | css | vb.net | asp.net-mvc-3 | asp.net-mvc-2 | null | open | ASP.net - How to achieve CSS with constant values, arithmetic and string manipulation
===
When developing ASP.NET websites (using VB.NET web forms) - a lot of my time is spend writing CSS files and they always seem to get messy (code duplication) and very long.
All I want to achieve is to be able to manipulate the CSS using VB.NET code in the following ways:
- Use an integer variable to store my "golden" number 7 and use that for width, padding, margin etc where needed
- Use string variables to store my "golden" hex color codes e.g. "#44C5F2" and use them for color, background-color, border-color etc. where needed
- Use an integer variable to set the height of an element and have four child elements each with height: mynum / 4
I just want to use basic VB.net number and string manipulation in order to create a CSS file on the fly.
I understand that the end product - the CSS file shouldn't change much - it should at most change on a daily basis otherwise caching couldn't be used.
I also understand that I would lose Visual Studio CSS intellisense support but...
How do I achieve this?
Should I be using:
- Generic handlers (ASHX)
- ASP.NET Themes
- ASP.NET Skins
- Something else?
I just some pointers.
Any help is appreciated.
Thanks.
| 0 |
11,546,238 | 07/18/2012 16:39:04 | 1,514,282 | 07/10/2012 09:10:31 | 1 | 0 | How to make child page for each story of parent webpage.? | I have posted stories from database to my view.php page.i want to link each story's title with its own webpage (child page of view.php page).for example..
view.php?id=123
is linked to story no .1 and
view.php?id=124
is linked to story no. 2
thus i want to link each story to its own webpage ... | php | null | null | null | null | 07/19/2012 09:32:38 | not a real question | How to make child page for each story of parent webpage.?
===
I have posted stories from database to my view.php page.i want to link each story's title with its own webpage (child page of view.php page).for example..
view.php?id=123
is linked to story no .1 and
view.php?id=124
is linked to story no. 2
thus i want to link each story to its own webpage ... | 1 |
3,077,789 | 06/20/2010 00:45:52 | 365,450 | 06/13/2010 00:06:07 | 6 | 0 | Audio using Yeti Mic does not work on iPhone Simulator | I am following [iPhone Core Audio Tutorial by Tim Bolstad][1]. It works as expected. I can hear the audio successfully.
But when I plug-in USB Yeti Stereo Microphone by BlueMic on my MacMini. It does not produce the sound anymore.
Why is that?
Thanks in advance for your help.
[1]: http://timbolstad.com/2010/03/17/core-audio-getting-started-pt3/ | iphone | audio | null | null | null | null | open | Audio using Yeti Mic does not work on iPhone Simulator
===
I am following [iPhone Core Audio Tutorial by Tim Bolstad][1]. It works as expected. I can hear the audio successfully.
But when I plug-in USB Yeti Stereo Microphone by BlueMic on my MacMini. It does not produce the sound anymore.
Why is that?
Thanks in advance for your help.
[1]: http://timbolstad.com/2010/03/17/core-audio-getting-started-pt3/ | 0 |
5,171,625 | 03/02/2011 18:16:26 | 617,977 | 02/15/2011 14:35:28 | 1 | 1 | Reuse only some parameters on Crystal Reports refresh? | I have a Crystal Reports which takes 2 parameters. One of these is set automatically by the C# app that runs the report, but the other is set by the user. I would like to make it so that when the user refreshes the report, only the parameter that was entered by the user is prompted for.
I'm aware of the ReuseParameterValuesOnRefresh property, but this make it so that ALL parameters are reused. I have also tried appending the refreshreports method, but this doesn't seem to work. When I look at the viewer's Refresh() method's definition, all I get is an abstract class with undefined methods, so I'm not sure where to look.
Has anyone dealt with this sort of issue before? | c# | crystal-reports | null | null | null | null | open | Reuse only some parameters on Crystal Reports refresh?
===
I have a Crystal Reports which takes 2 parameters. One of these is set automatically by the C# app that runs the report, but the other is set by the user. I would like to make it so that when the user refreshes the report, only the parameter that was entered by the user is prompted for.
I'm aware of the ReuseParameterValuesOnRefresh property, but this make it so that ALL parameters are reused. I have also tried appending the refreshreports method, but this doesn't seem to work. When I look at the viewer's Refresh() method's definition, all I get is an abstract class with undefined methods, so I'm not sure where to look.
Has anyone dealt with this sort of issue before? | 0 |
11,247,297 | 06/28/2012 14:51:50 | 601,198 | 02/03/2011 08:53:23 | 1 | 0 | UnauthorizedAccessException keyword crashes stackoverflow | UnauthorizedAccessException Cannot write to the registry key
This query crashes the stackoverflow, I have tried different keywords, they all work fine, but as soon as I add **UnauthorizedAccessException** keyword to it, it simply crashes. | https | bugs | keywords | null | null | 06/28/2012 16:47:33 | off topic | UnauthorizedAccessException keyword crashes stackoverflow
===
UnauthorizedAccessException Cannot write to the registry key
This query crashes the stackoverflow, I have tried different keywords, they all work fine, but as soon as I add **UnauthorizedAccessException** keyword to it, it simply crashes. | 2 |
4,976,295 | 02/12/2011 04:20:10 | 577,042 | 01/15/2011 20:58:52 | 377 | 35 | java vs php benchmark | I'm a php developer, but recently had to write the same application twice, once in php and once in java, for a class I'm taking at school. For curiosity I did a benchmark on the two and found that the java version was 2 to 20 times slower than the php version if the database is accessed, and 1 to 10 times slower without DB access. I see two immediate possibilites:
1. I suck at java.
2. I can finally tell people to quit whining about php.
I posted my servlet code [here][1]. I don't want any nit-picky whining or minor improvements, but can someone see a horrible glaring performance issue in there? Or can anybody explain why Java feels like it has to suck?
I've always heard people say that java is faster and more scalable than php, especially my teacher, he is convinced of it, but the more requests that are made, the slower java gets. php doesn't seem to be affected by increased loads but remains constant.
[1]: http://pastebin.com/RaMkENuL | java | php | benchmarking | null | null | 02/12/2011 10:10:38 | not constructive | java vs php benchmark
===
I'm a php developer, but recently had to write the same application twice, once in php and once in java, for a class I'm taking at school. For curiosity I did a benchmark on the two and found that the java version was 2 to 20 times slower than the php version if the database is accessed, and 1 to 10 times slower without DB access. I see two immediate possibilites:
1. I suck at java.
2. I can finally tell people to quit whining about php.
I posted my servlet code [here][1]. I don't want any nit-picky whining or minor improvements, but can someone see a horrible glaring performance issue in there? Or can anybody explain why Java feels like it has to suck?
I've always heard people say that java is faster and more scalable than php, especially my teacher, he is convinced of it, but the more requests that are made, the slower java gets. php doesn't seem to be affected by increased loads but remains constant.
[1]: http://pastebin.com/RaMkENuL | 4 |
9,002,846 | 01/25/2012 12:37:17 | 1,169,189 | 01/25/2012 12:25:00 | 1 | 0 | java.lang.NullPointerException in EJB3 from JSP page | I am developing my first EJB 3 application using JBOSS 7 as application server in Java EE IDE 1.4. The session bean is deployed successfully on the server but when i try to access it from the JSP page, then i get the java.lang.NullPointerException exception.
Following is my code:
**Local Interface**:
package my.first;
import javax.ejb.Local;
@Local
public interface CalculatorRemote {
public float add(float x, float y);
public float subtract(float x, float y);
public float multiply(float x, float y);
public float division(float x, float y);
}
**Session bean**:
package my.first;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
@Stateless(name = "CalculatorRemote")
public class CalculatorBean implements CalculatorRemote {
public float add(float x, float y) {
return x + y;
}
public float subtract(float x, float y) {
return x - y;
}
public float multiply(float x, float y) {
return x * y;
}
public float division(float x, float y) {
return x / y;
}
}
**JSP Page:**
<%!
private CalculatorRemote calculator = null;
float result=0;
public void jspInit() {
try {
InitialContext ic = new InitialContext();
calculator = (CalculatorRemote) ic
.lookup("CalculatorRemote/Local");
System.out.println("Loaded Calculator Bean");
//CalculatorBean
} catch (Exception ex) {
System.out.println("Error:"+
ex.getMessage());
}
}
public void jspDestroy() {
calculator = null;
}
%>
**Server Log File:**
17:17:20,552 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named CalculatorRemote in deployment unit deployment "EJBsession.jar" are as follows:
java:global/EJBsession/CalculatorRemote!my.first.CalculatorBean
java:app/EJBsession/CalculatorRemote!my.first.CalculatorBean
java:module/CalculatorRemote!my.first.CalculatorBean
java:global/EJBsession/CalculatorRemote!my.first.CalculatorRemote
java:app/EJBsession/CalculatorRemote!my.first.CalculatorRemote
java:module/CalculatorRemote!my.first.CalculatorRemote
......
......
......
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) java.lang.NullPointerException
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.jsp.test_jsp._jspService(test_jsp.java:102)
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
......
......
......
Please help? | ejb-3.0 | java-ee-6 | null | null | null | null | open | java.lang.NullPointerException in EJB3 from JSP page
===
I am developing my first EJB 3 application using JBOSS 7 as application server in Java EE IDE 1.4. The session bean is deployed successfully on the server but when i try to access it from the JSP page, then i get the java.lang.NullPointerException exception.
Following is my code:
**Local Interface**:
package my.first;
import javax.ejb.Local;
@Local
public interface CalculatorRemote {
public float add(float x, float y);
public float subtract(float x, float y);
public float multiply(float x, float y);
public float division(float x, float y);
}
**Session bean**:
package my.first;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
@Stateless(name = "CalculatorRemote")
public class CalculatorBean implements CalculatorRemote {
public float add(float x, float y) {
return x + y;
}
public float subtract(float x, float y) {
return x - y;
}
public float multiply(float x, float y) {
return x * y;
}
public float division(float x, float y) {
return x / y;
}
}
**JSP Page:**
<%!
private CalculatorRemote calculator = null;
float result=0;
public void jspInit() {
try {
InitialContext ic = new InitialContext();
calculator = (CalculatorRemote) ic
.lookup("CalculatorRemote/Local");
System.out.println("Loaded Calculator Bean");
//CalculatorBean
} catch (Exception ex) {
System.out.println("Error:"+
ex.getMessage());
}
}
public void jspDestroy() {
calculator = null;
}
%>
**Server Log File:**
17:17:20,552 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named CalculatorRemote in deployment unit deployment "EJBsession.jar" are as follows:
java:global/EJBsession/CalculatorRemote!my.first.CalculatorBean
java:app/EJBsession/CalculatorRemote!my.first.CalculatorBean
java:module/CalculatorRemote!my.first.CalculatorBean
java:global/EJBsession/CalculatorRemote!my.first.CalculatorRemote
java:app/EJBsession/CalculatorRemote!my.first.CalculatorRemote
java:module/CalculatorRemote!my.first.CalculatorRemote
......
......
......
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) java.lang.NullPointerException
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.jsp.test_jsp._jspService(test_jsp.java:102)
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
17:23:44,105 ERROR [stderr] (http--127.0.0.1-8080-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
......
......
......
Please help? | 0 |
7,405,492 | 09/13/2011 16:49:01 | 434,218 | 08/29/2010 13:00:14 | 996 | 11 | Add/remove class on secrtion collapse/expand w/jQuery | I have the following logic to expand / collapse Q & A sections. I am trying to add a class to "A" to indicate collapsed/expanded state. I think I'm overcomplicating the matter, and it doesn't work...
$(".A").hide();
$(".Q").click(function() {
$(".A:visible").slideUp("slow");
$(this).next(".A:hidden").slideDown("slow");
// part below does not work !!!
$(this).each(function(){
if ($(this).is(":visible")) {
$(this).find("span").removeClass("collapsed").addClass("expanded");
} else {
$(this).find("span").removeClass("expanded").addClass("collapsed");
}
});
});
<div class="Q"><span class="collapsed"></span>aaaa</div>
<div class="A">bbbb</div>
<div class="Q"><span class="collapsed"></span>cccc</div>
<div class="A">dddd</div> | jquery | null | null | null | null | null | open | Add/remove class on secrtion collapse/expand w/jQuery
===
I have the following logic to expand / collapse Q & A sections. I am trying to add a class to "A" to indicate collapsed/expanded state. I think I'm overcomplicating the matter, and it doesn't work...
$(".A").hide();
$(".Q").click(function() {
$(".A:visible").slideUp("slow");
$(this).next(".A:hidden").slideDown("slow");
// part below does not work !!!
$(this).each(function(){
if ($(this).is(":visible")) {
$(this).find("span").removeClass("collapsed").addClass("expanded");
} else {
$(this).find("span").removeClass("expanded").addClass("collapsed");
}
});
});
<div class="Q"><span class="collapsed"></span>aaaa</div>
<div class="A">bbbb</div>
<div class="Q"><span class="collapsed"></span>cccc</div>
<div class="A">dddd</div> | 0 |
11,603,865 | 07/22/2012 20:47:27 | 940,479 | 09/12/2011 11:53:58 | 102 | 6 | wildcard array comparison - improving efficiency | I have two arrays that I'm comparing and I'd like to know if there is a more efficient way to do it.
The first array is user submitted values, the second array is allowed values some of which may contain a wildcard in the place of numbers e.g.
// user submitted values
$values = array('fruit' => array(
'apple8756apple',
'banana234banana',
'apple4apple',
'kiwi435kiwi'
));
//allowed values
$match = array('allowed' => array(
'apple*apple',
'banana234banana',
'kiwi*kiwi'
));
I need to know whether or not all of the values in the first array, match a value in the second array.
This is what I'm using:
// the number of values to validate
$valueCount = count($values['fruit']);
// the number of allowed to compare against
$matchCount = count($match['allowed']);
// the number of values passed validation
$passed = 0;
// update allowed wildcards to regular expression for preg_match
foreach($match['allowed'] as &$allowed)
{
$allowed = str_replace(array('*'), array('([0-9]+)'), $allowed);
}
// for each value match against allowed values
foreach($values['fruit'] as $fruit)
{
$i = 0;
$status = false;
while($i < $matchCount && $status == false)
{
$result = preg_match('/' . $match['allowed'][$i] . '/', $fruit);
if ($result)
{
$status = true;
$passed++;
}
$i++;
}
}
// check all passed validation
if($passed === $valueCount)
{
echo 'hurray!';
}
else
{
echo 'fail';
}
I feel like I might be missing out on a PHP function that would do a better job than a while loop within a foreach loop. Or am I wrong? | php | loops | foreach | while-loops | preg-match | null | open | wildcard array comparison - improving efficiency
===
I have two arrays that I'm comparing and I'd like to know if there is a more efficient way to do it.
The first array is user submitted values, the second array is allowed values some of which may contain a wildcard in the place of numbers e.g.
// user submitted values
$values = array('fruit' => array(
'apple8756apple',
'banana234banana',
'apple4apple',
'kiwi435kiwi'
));
//allowed values
$match = array('allowed' => array(
'apple*apple',
'banana234banana',
'kiwi*kiwi'
));
I need to know whether or not all of the values in the first array, match a value in the second array.
This is what I'm using:
// the number of values to validate
$valueCount = count($values['fruit']);
// the number of allowed to compare against
$matchCount = count($match['allowed']);
// the number of values passed validation
$passed = 0;
// update allowed wildcards to regular expression for preg_match
foreach($match['allowed'] as &$allowed)
{
$allowed = str_replace(array('*'), array('([0-9]+)'), $allowed);
}
// for each value match against allowed values
foreach($values['fruit'] as $fruit)
{
$i = 0;
$status = false;
while($i < $matchCount && $status == false)
{
$result = preg_match('/' . $match['allowed'][$i] . '/', $fruit);
if ($result)
{
$status = true;
$passed++;
}
$i++;
}
}
// check all passed validation
if($passed === $valueCount)
{
echo 'hurray!';
}
else
{
echo 'fail';
}
I feel like I might be missing out on a PHP function that would do a better job than a while loop within a foreach loop. Or am I wrong? | 0 |
11,686,039 | 07/27/2012 10:31:28 | 1,557,351 | 07/27/2012 10:14:45 | 1 | 0 | How do I start programming? I want to write games | I have never programmed before, and want to write my own games. I looked at Unity3D and did a tutorial. It's looks really nice, but there is a lot of terminology I don't understand.
I bought a Unity3D book on my Kindle, but it assumes I'm already a programmer.
Where can I start? | javascript | unity3d | null | null | null | 07/27/2012 10:33:05 | not constructive | How do I start programming? I want to write games
===
I have never programmed before, and want to write my own games. I looked at Unity3D and did a tutorial. It's looks really nice, but there is a lot of terminology I don't understand.
I bought a Unity3D book on my Kindle, but it assumes I'm already a programmer.
Where can I start? | 4 |
10,519,539 | 05/09/2012 15:48:13 | 1,293,754 | 03/26/2012 18:42:11 | 6 | 0 | Blackberry Bold browser - h3 (clickable element) - browser inserts blue background | There is another posting on stackoverflow titled "Blackberry browser automatically inserts blue background". This is very similar to what I am seeing, but not exactly the same. I've tried to apply the fix "outline:none" to my element, but I am still seeing the blue background.
It appears that the blue background is being applied by default in the Blackberry Bold 9650 browser. Is there a way to override this using CSS?
thanks | css | blackberry | mobile | null | null | null | open | Blackberry Bold browser - h3 (clickable element) - browser inserts blue background
===
There is another posting on stackoverflow titled "Blackberry browser automatically inserts blue background". This is very similar to what I am seeing, but not exactly the same. I've tried to apply the fix "outline:none" to my element, but I am still seeing the blue background.
It appears that the blue background is being applied by default in the Blackberry Bold 9650 browser. Is there a way to override this using CSS?
thanks | 0 |
6,178,625 | 05/30/2011 16:25:08 | 775,401 | 05/29/2011 18:58:32 | 8 | 0 | for loop goes infinite within the ready function. | $(document).ready(function() {
for (var i=0; i<20; i++) {
document.write('hello world');
}
});
in this code for goes infinite. so what's the reason of that? | jquery | null | null | null | null | 05/30/2011 17:30:49 | not a real question | for loop goes infinite within the ready function.
===
$(document).ready(function() {
for (var i=0; i<20; i++) {
document.write('hello world');
}
});
in this code for goes infinite. so what's the reason of that? | 1 |
9,115,501 | 02/02/2012 16:00:04 | 346,646 | 05/20/2010 23:58:15 | 161 | 2 | paypal notify_url action to php script keeps on repeating itself | I have a small action script that I run when someone buys something with Paypal.
Using the notify_url=http://www.mysite.com/my-automatic-script.php
I am using the mail() feature on my site to automatically grabs email address and update the user with some info.
Everything runs perfect, but the script just keeps on repeating and repeating itself. (i am getting emailed every 5 mins with this) ..
script here:
if ( something ) {
mail() function...
break;
}
else {
mail() function to someone else...
break;
}
Thanks in advance! Is break; sufficient for this? | php | paypal | null | null | null | null | open | paypal notify_url action to php script keeps on repeating itself
===
I have a small action script that I run when someone buys something with Paypal.
Using the notify_url=http://www.mysite.com/my-automatic-script.php
I am using the mail() feature on my site to automatically grabs email address and update the user with some info.
Everything runs perfect, but the script just keeps on repeating and repeating itself. (i am getting emailed every 5 mins with this) ..
script here:
if ( something ) {
mail() function...
break;
}
else {
mail() function to someone else...
break;
}
Thanks in advance! Is break; sufficient for this? | 0 |
1,100,032 | 07/08/2009 19:17:00 | 85,064 | 03/31/2009 12:49:54 | 15 | 0 | DotNetNuke CSS problem on page postback? | We're having a very strange problem with css in DotNetNuke.
It seems that with any of our custom modules, if a user clicks to postback 9 times the skin css is removed and the page becomes rather ugly. Looking at the source the tags with the urls to the css files are gone. After one more click making 10 postbacks, any custom css files we've added are removed as well. It seems that sometimes the css will come back after more postbacks but other times it will not.
what you click on doesn't matter, just the amount of postbacks. However we have another server that on some days will behave fine, and others will have the same behavior.
We can't narrow it down to anything our modules have in common. It happens in modules that do not share any code, but somehow happens in all our modules that we've tried but not in any other modules that come with DNN.
Though experimenting we've also found you can postback say 8 times leave the page and come back, you then can postback 9 more times before the css will be gone.
| dotnetnuke | css | skins | module | postback | null | open | DotNetNuke CSS problem on page postback?
===
We're having a very strange problem with css in DotNetNuke.
It seems that with any of our custom modules, if a user clicks to postback 9 times the skin css is removed and the page becomes rather ugly. Looking at the source the tags with the urls to the css files are gone. After one more click making 10 postbacks, any custom css files we've added are removed as well. It seems that sometimes the css will come back after more postbacks but other times it will not.
what you click on doesn't matter, just the amount of postbacks. However we have another server that on some days will behave fine, and others will have the same behavior.
We can't narrow it down to anything our modules have in common. It happens in modules that do not share any code, but somehow happens in all our modules that we've tried but not in any other modules that come with DNN.
Though experimenting we've also found you can postback say 8 times leave the page and come back, you then can postback 9 more times before the css will be gone.
| 0 |
8,839,322 | 01/12/2012 17:19:28 | 879,153 | 08/04/2011 17:32:12 | 460 | 8 | Why does the Delphi compiler allow a comma after the final parameter in a method call? | Say I had a function such as this one
procedure TMyObject.DoSomething(text: string);
begin
// do something important with the text
end;
When I call the method like so
DoSomething('some text', );
the code editor displays a red squiggly at the comma after the last parameter, just as I would have expected. The compiler, however, accepts this code and everything works as if the comma wasn't there.
Why does this appear to be legal syntax? Is there some historical reason this is still supported today (I have tried this in Delphi 2006)? | delphi | compiler | history | null | null | null | open | Why does the Delphi compiler allow a comma after the final parameter in a method call?
===
Say I had a function such as this one
procedure TMyObject.DoSomething(text: string);
begin
// do something important with the text
end;
When I call the method like so
DoSomething('some text', );
the code editor displays a red squiggly at the comma after the last parameter, just as I would have expected. The compiler, however, accepts this code and everything works as if the comma wasn't there.
Why does this appear to be legal syntax? Is there some historical reason this is still supported today (I have tried this in Delphi 2006)? | 0 |
10,870,471 | 06/03/2012 12:51:27 | 576,589 | 01/15/2011 09:02:10 | 407 | 4 | Hiding A Comment Form With CSS | I've been trying to hide a comment form (a div) with CSS `display: none;`but it doesn't seem to hide. The div in question loads data with JavaScript. Could anybody please help me and point out what actually I am doing wrong? The comment form is found here:
[http://functionn.blogspot.com/2012/06/hydrajs-javascript-library-providing.html][1]
It is found at the very bottom of the page, the HyperComments form. I've tried to apply the `display:none;`to the #`hc_root` div, but to no sucess.
Thanks in advance.
[1]: http://functionn.blogspot.com/2012/06/hydrajs-javascript-library-providing.html | html | css | null | null | null | 06/04/2012 14:06:44 | not a real question | Hiding A Comment Form With CSS
===
I've been trying to hide a comment form (a div) with CSS `display: none;`but it doesn't seem to hide. The div in question loads data with JavaScript. Could anybody please help me and point out what actually I am doing wrong? The comment form is found here:
[http://functionn.blogspot.com/2012/06/hydrajs-javascript-library-providing.html][1]
It is found at the very bottom of the page, the HyperComments form. I've tried to apply the `display:none;`to the #`hc_root` div, but to no sucess.
Thanks in advance.
[1]: http://functionn.blogspot.com/2012/06/hydrajs-javascript-library-providing.html | 1 |
5,204,090 | 03/05/2011 13:28:39 | 631,726 | 02/24/2011 05:47:39 | 1 | 0 | Primary and secondary indexing using a hashtable | provide me the code to implement hashtable as a value of another hashtable..
(i.e) when i find a value using the key in 1st hash table that value should contain the pointer to another hashtable.. where i can start searching in this 2nd table
This is exactly same as that of implementing primary and secondary indexing using hashtables...
can anyone help me by providing the code in JAVA??
THANK U ALL.. | hashtable | null | null | null | null | 03/05/2011 17:35:10 | not a real question | Primary and secondary indexing using a hashtable
===
provide me the code to implement hashtable as a value of another hashtable..
(i.e) when i find a value using the key in 1st hash table that value should contain the pointer to another hashtable.. where i can start searching in this 2nd table
This is exactly same as that of implementing primary and secondary indexing using hashtables...
can anyone help me by providing the code in JAVA??
THANK U ALL.. | 1 |
8,101,163 | 11/11/2011 23:23:53 | 920,954 | 08/31/2011 04:47:50 | 19 | 0 | Align social buttons in web | I have a problem to align a social icons
My code is on here
http://pastebin.com/fWYnCRNa
How can align in one line all?
the site is http://www.laeconomista.com/web/
Very thanks | html | css | wordpress | null | null | 11/12/2011 00:27:30 | not a real question | Align social buttons in web
===
I have a problem to align a social icons
My code is on here
http://pastebin.com/fWYnCRNa
How can align in one line all?
the site is http://www.laeconomista.com/web/
Very thanks | 1 |
4,611,944 | 01/06/2011 05:11:21 | 402,983 | 07/27/2010 05:20:04 | 47 | 3 | Geo Fence: Find number of features (points/lines/polygons) inside a polygon using oracle spatial | How do i write a SQL query (using Oracle Spatial) to find the number of features available inside a polygon (geofence);
The features could be either points, lines or a polygon itself.
Thanks. | geolocation | oracle-spatial | null | null | null | null | open | Geo Fence: Find number of features (points/lines/polygons) inside a polygon using oracle spatial
===
How do i write a SQL query (using Oracle Spatial) to find the number of features available inside a polygon (geofence);
The features could be either points, lines or a polygon itself.
Thanks. | 0 |
8,872,155 | 01/15/2012 18:21:41 | 604,511 | 02/05/2011 16:16:29 | 857 | 48 | What can an RDBMS do that Neo4j (and graph databases) cant? | I looked around in the Neo4j site and saw that
> “A Graph Database –transforms a–> RDBMS”
It seems to imply that whatever you can do in RDBMS, you can do in Neo4j. Neo4j can be a replacement for an RDBMS.
----------
I am interested in Neo4j for
- ability to do quickly modify data "schema"
- ability to express entities naturally instead of relations and normalizations
- ...which leads to highly expressive code (better than ORM)
This is a NoSQL solution I am interested in for it's features, not high performance.
----------
**Question:** What are the chief "deficiencies" present in Neo4j that may make it unsuitable as a RDBMS replacement?
I am particularly interested about:
- is there any **DB feature** I must implement in **application logic**? (For example, you must implement joins at application layer for a few NoSQL DBs)
- Are the fields "**indexed**" to allow a lookup faster than O(n)?
- How do I handle hot backups and replication?
- any issues with "altering" schema or letting entities with different versions of the schema living together?
and the applications for which Neo4j is optimized for ("is optimized for highly connected data")?
| database | nosql | rdbms | neo4j | graph-databases | 01/16/2012 02:58:43 | not constructive | What can an RDBMS do that Neo4j (and graph databases) cant?
===
I looked around in the Neo4j site and saw that
> “A Graph Database –transforms a–> RDBMS”
It seems to imply that whatever you can do in RDBMS, you can do in Neo4j. Neo4j can be a replacement for an RDBMS.
----------
I am interested in Neo4j for
- ability to do quickly modify data "schema"
- ability to express entities naturally instead of relations and normalizations
- ...which leads to highly expressive code (better than ORM)
This is a NoSQL solution I am interested in for it's features, not high performance.
----------
**Question:** What are the chief "deficiencies" present in Neo4j that may make it unsuitable as a RDBMS replacement?
I am particularly interested about:
- is there any **DB feature** I must implement in **application logic**? (For example, you must implement joins at application layer for a few NoSQL DBs)
- Are the fields "**indexed**" to allow a lookup faster than O(n)?
- How do I handle hot backups and replication?
- any issues with "altering" schema or letting entities with different versions of the schema living together?
and the applications for which Neo4j is optimized for ("is optimized for highly connected data")?
| 4 |
7,001,780 | 08/09/2011 19:26:15 | 771,670 | 05/26/2011 16:22:28 | 11 | 9 | Web service in codeigniter | My doult is: where put web services files on codeigniter?
I'm in the PHP/CI and I'll implement some web services in a running project using CI.
My need is only consume de WS not provide. I thought use model to set he functions and extra files for each call. | codeigniter | null | null | null | null | 08/11/2011 13:32:16 | not a real question | Web service in codeigniter
===
My doult is: where put web services files on codeigniter?
I'm in the PHP/CI and I'll implement some web services in a running project using CI.
My need is only consume de WS not provide. I thought use model to set he functions and extra files for each call. | 1 |
7,031,145 | 08/11/2011 18:43:40 | 124,650 | 06/17/2009 20:26:14 | 149 | 0 | MS SQL Sever Wildcard | Does "Select * from <table/view>" have the same performance implication regarding wildcard interpretation when used in a dynamic TSQL statement as against using it in a stored procedure, given that the stored procedure is a compiled unit of code?
| sql-server-2005 | tsql | wildcard | null | null | 08/12/2011 01:40:59 | not a real question | MS SQL Sever Wildcard
===
Does "Select * from <table/view>" have the same performance implication regarding wildcard interpretation when used in a dynamic TSQL statement as against using it in a stored procedure, given that the stored procedure is a compiled unit of code?
| 1 |
6,251,637 | 06/06/2011 11:56:06 | 171,546 | 09/10/2009 16:13:36 | 862 | 14 | Superpose images via shell | I have two figures, one is a data plot resulting from some calculations and made with matplotlib and the other is a world map figure taken from google maps. I would like to reduce the matplotlib figure to some percentage value and superpose it over the map picture at certain position and get a final "mixed" picture. I know it can be done with graphical problems and so, but I would like to do it automatically on the shell for thousands of different cases, I wonder if you could propose some methodology / ideas for this. | image | bash | matplotlib | mix | null | null | open | Superpose images via shell
===
I have two figures, one is a data plot resulting from some calculations and made with matplotlib and the other is a world map figure taken from google maps. I would like to reduce the matplotlib figure to some percentage value and superpose it over the map picture at certain position and get a final "mixed" picture. I know it can be done with graphical problems and so, but I would like to do it automatically on the shell for thousands of different cases, I wonder if you could propose some methodology / ideas for this. | 0 |
6,866,786 | 07/28/2011 23:01:31 | 862,773 | 07/26/2011 05:07:30 | 14 | 0 | How do I assign event handlers to every object with a certain attribute? | Basically, I want to assign an event handler to each page number (in a ul) in some sort of loop. Each list item has a certain class and a name attribute. I want to assign the event handler .click() and then inside access the name attribute. Thanks to anyone who responds/views this post, and I would be appreciative if you would also show how to access the name attribute.
I can access all the list items like this I think (accessing each individual one is another process I don't know)
$('li[class|='pagelistitem'). //now I need to assign event handler and access 'name' attr
| javascript | jquery | events | attributes | selector | null | open | How do I assign event handlers to every object with a certain attribute?
===
Basically, I want to assign an event handler to each page number (in a ul) in some sort of loop. Each list item has a certain class and a name attribute. I want to assign the event handler .click() and then inside access the name attribute. Thanks to anyone who responds/views this post, and I would be appreciative if you would also show how to access the name attribute.
I can access all the list items like this I think (accessing each individual one is another process I don't know)
$('li[class|='pagelistitem'). //now I need to assign event handler and access 'name' attr
| 0 |
8,128,654 | 11/14/2011 21:48:44 | 730,047 | 04/28/2011 20:20:41 | 134 | 6 | Android Widget onClick | I want to be able to click on a widget and launch a dialog box. I have read the official documentation as some of the unofficial ones. I initially wanted to launch a new activity but even this fails. I get the following in Logcat but I cant really see anything.
11-14 21:28:47.929: INFO/ActivityManager(116): Starting: Intent { flg=0x10000000 cmp=com.android.app/.Execute bnds=[179,89][300,160] } from pid -1
The code used is:
public class ExampleAppWidgetProvider extends AppWidgetProvider {
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
final int N = appWidgetIds.length;
// Perform this loop procedure for each App Widget that belongs to this provider
for (int i=0; i<N; i++) {
int appWidgetId = appWidgetIds[i];
// Create an Intent to launch ExampleActivity
Intent intent = new Intent(context, ExampleActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
// Get the layout for the App Widget and attach an on-click listener
// to the button
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.appwidget_provider_layout);
views.setOnClickPendingIntent(R.id.button, pendingIntent);
// Tell the AppWidgetManager to perform an update on the current app widget
appWidgetManager.updateAppWidget(appWidgetId, views);
}
}
} | android | widget | onclick | null | null | null | open | Android Widget onClick
===
I want to be able to click on a widget and launch a dialog box. I have read the official documentation as some of the unofficial ones. I initially wanted to launch a new activity but even this fails. I get the following in Logcat but I cant really see anything.
11-14 21:28:47.929: INFO/ActivityManager(116): Starting: Intent { flg=0x10000000 cmp=com.android.app/.Execute bnds=[179,89][300,160] } from pid -1
The code used is:
public class ExampleAppWidgetProvider extends AppWidgetProvider {
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
final int N = appWidgetIds.length;
// Perform this loop procedure for each App Widget that belongs to this provider
for (int i=0; i<N; i++) {
int appWidgetId = appWidgetIds[i];
// Create an Intent to launch ExampleActivity
Intent intent = new Intent(context, ExampleActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
// Get the layout for the App Widget and attach an on-click listener
// to the button
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.appwidget_provider_layout);
views.setOnClickPendingIntent(R.id.button, pendingIntent);
// Tell the AppWidgetManager to perform an update on the current app widget
appWidgetManager.updateAppWidget(appWidgetId, views);
}
}
} | 0 |
3,986,157 | 10/21/2010 09:45:58 | 442,214 | 09/08/2010 08:40:48 | 26 | 0 | mysql_connect not working | mysql_connect is not working but mysql_iconnect is working.
Please help.
Thanks | php | mysql | mysqli | connect | mysql-connect | 10/22/2010 01:11:30 | not a real question | mysql_connect not working
===
mysql_connect is not working but mysql_iconnect is working.
Please help.
Thanks | 1 |
9,107,543 | 02/02/2012 05:23:25 | 1,184,300 | 02/02/2012 04:52:00 | 1 | 0 | Spring Autowiring and Class Inheritance | I'm having a problem getting @Autowired to work. Sorry if I screw up any terms, I am relatively new to Spring.
Spring Version is 3.0.5.RELEASE, and I am using context:component-scan in my beans definition.
This works with the @Autowired annotation:
@Component
public class UserDao {
@PersistenceContext
protected EntityManager em;
@Transactional
public User findById(Long id) {
return em.find(User.class, id);
}
}
This does NOT work with the @Autowired annotation:
@Component
public class UserDao implements Dao<User> {
@PersistenceContext
protected EntityManager em;
@Transactional
public User findById(Long id) {
return em.find(User.class, id);
}
}
With this setup, **all I've added 'implements Dao<User>'**, and I get a:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [web.rs.persistence.dao.UserDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
And here are some other classes for reference:
Dao.java (interface):
public interface Dao<T extends BaseEntity> {
T findById(Long id);
}
UserResource.java:
@Component
public class UserResource {
@Autowired
UserDao userDao;
public User getUser(Long id) {
return userDao.findById(id);
}
}
Can anyone shed some light on this issue? I'd love to keep class inheritance.
Thanks! | spring | inheritance | autowired | null | null | null | open | Spring Autowiring and Class Inheritance
===
I'm having a problem getting @Autowired to work. Sorry if I screw up any terms, I am relatively new to Spring.
Spring Version is 3.0.5.RELEASE, and I am using context:component-scan in my beans definition.
This works with the @Autowired annotation:
@Component
public class UserDao {
@PersistenceContext
protected EntityManager em;
@Transactional
public User findById(Long id) {
return em.find(User.class, id);
}
}
This does NOT work with the @Autowired annotation:
@Component
public class UserDao implements Dao<User> {
@PersistenceContext
protected EntityManager em;
@Transactional
public User findById(Long id) {
return em.find(User.class, id);
}
}
With this setup, **all I've added 'implements Dao<User>'**, and I get a:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [web.rs.persistence.dao.UserDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
And here are some other classes for reference:
Dao.java (interface):
public interface Dao<T extends BaseEntity> {
T findById(Long id);
}
UserResource.java:
@Component
public class UserResource {
@Autowired
UserDao userDao;
public User getUser(Long id) {
return userDao.findById(id);
}
}
Can anyone shed some light on this issue? I'd love to keep class inheritance.
Thanks! | 0 |
8,475,296 | 12/12/2011 13:47:12 | 526,710 | 12/01/2010 14:51:05 | 90 | 0 | Google Moderator API (PHP) | I am trying to figure out how to use the Google API [Google API Library - Moderator][1] and have hit a snag. I am currently trying to create a series like so
if ($client->getAccessToken() && isset($_GET['insertSeries'])) {
$series = new Series();
$series->data = $_GET['insertSeries'];
$short = $plus->series->insert($series);
$_SESSION['access_token'] = $client->getAccessToken();
}
However it is not working and I am given the following:
`Fatal error: Uncaught exception 'apiServiceException' with message 'Error calling POST https://www.googleapis.com/moderator/v1/series?alt=json&key=AIzaSyB9_KFGtmkHU-4Bm9Jdn73T0bMzuzuSNEU: (400) 'data' field must contain a JSON object.' in /home5/twooned6/public_html/mobile/google-api-php-client/src/io/apiREST.php:86 Stack trace: #0 /home5/twooned6/public_html/mobile/google-api-php-client/src/io/apiREST.php(56): apiREST::decodeHttpResponse(Object(apiHttpRequest)) #1 /home5/twooned6/public_html/mobile/google-api-php-client/src/service/apiServiceResource.php(148): apiREST::execute(Object(apiServiceRequest)) #2 /home5/twooned6/public_html/mobile/google-api-php-client/src/contrib/apiModeratorService.php(287): apiServiceResource->__call('insert', Array) #3 /home5/twooned6/public_html/mobile/google-plus-access.php(56): SeriesServiceResource->insert(Object(Series)) #4 /home5/twooned6/public_html/mobile/test.php(3): include_once('/home5/twooned6...') #5 {main} thrown in /home5/twooned6/public_html/mobile/google-api-php-client/src/io/apiREST.php on line 86`
[1]: http://code.google.com/p/google-api-php-client/source/browse/trunk/src/contrib/apiModeratorService.php?r=162 | php | google | google-moderator | null | null | null | open | Google Moderator API (PHP)
===
I am trying to figure out how to use the Google API [Google API Library - Moderator][1] and have hit a snag. I am currently trying to create a series like so
if ($client->getAccessToken() && isset($_GET['insertSeries'])) {
$series = new Series();
$series->data = $_GET['insertSeries'];
$short = $plus->series->insert($series);
$_SESSION['access_token'] = $client->getAccessToken();
}
However it is not working and I am given the following:
`Fatal error: Uncaught exception 'apiServiceException' with message 'Error calling POST https://www.googleapis.com/moderator/v1/series?alt=json&key=AIzaSyB9_KFGtmkHU-4Bm9Jdn73T0bMzuzuSNEU: (400) 'data' field must contain a JSON object.' in /home5/twooned6/public_html/mobile/google-api-php-client/src/io/apiREST.php:86 Stack trace: #0 /home5/twooned6/public_html/mobile/google-api-php-client/src/io/apiREST.php(56): apiREST::decodeHttpResponse(Object(apiHttpRequest)) #1 /home5/twooned6/public_html/mobile/google-api-php-client/src/service/apiServiceResource.php(148): apiREST::execute(Object(apiServiceRequest)) #2 /home5/twooned6/public_html/mobile/google-api-php-client/src/contrib/apiModeratorService.php(287): apiServiceResource->__call('insert', Array) #3 /home5/twooned6/public_html/mobile/google-plus-access.php(56): SeriesServiceResource->insert(Object(Series)) #4 /home5/twooned6/public_html/mobile/test.php(3): include_once('/home5/twooned6...') #5 {main} thrown in /home5/twooned6/public_html/mobile/google-api-php-client/src/io/apiREST.php on line 86`
[1]: http://code.google.com/p/google-api-php-client/source/browse/trunk/src/contrib/apiModeratorService.php?r=162 | 0 |
9,856,518 | 03/24/2012 23:15:26 | 794,624 | 06/12/2011 09:21:54 | 24 | 0 | PHP Excel Header |
header("Content-Type: application/vnd.ms-excel; charset=utf-8");
header("Content-type: application/x-msexcel; charset=utf-8");
header("Content-Disposition: attachment; filename=abc.xsl");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
echo "Some Text"
Here is code to write and download xsl file using php,
my problem is when i open excel file MS-Excel show warning before opening file says
**The file you are trying to open is in different format than specified by the file extension...Blah blah**
What's to do with PHP code to remove this warning. Contents are written correctly.
**i know this is because content written in file are txt file content and file extension is incorrect, that is, xls. Solution???**
**Please don't suggest to use any library.** | php | excel | header | phpexcel | fwrite | null | open | PHP Excel Header
===
header("Content-Type: application/vnd.ms-excel; charset=utf-8");
header("Content-type: application/x-msexcel; charset=utf-8");
header("Content-Disposition: attachment; filename=abc.xsl");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
echo "Some Text"
Here is code to write and download xsl file using php,
my problem is when i open excel file MS-Excel show warning before opening file says
**The file you are trying to open is in different format than specified by the file extension...Blah blah**
What's to do with PHP code to remove this warning. Contents are written correctly.
**i know this is because content written in file are txt file content and file extension is incorrect, that is, xls. Solution???**
**Please don't suggest to use any library.** | 0 |
9,176,463 | 02/07/2012 12:41:55 | 1,170,970 | 01/26/2012 09:46:38 | 14 | 0 | Java loop not working correctly | I am putting if loops in java code for finding out if the pcap file contains certain string or not,if yes then don't show that string in my else condition but i am still getting that string in my else condition.Can anyone tell me what can be the possible problems.
my code
String a=new String(packet.data);
if(a.contains("image/"))
{
}
else
{
System.out.println(a);
} | java | if-statement | null | null | null | 02/08/2012 14:39:18 | not constructive | Java loop not working correctly
===
I am putting if loops in java code for finding out if the pcap file contains certain string or not,if yes then don't show that string in my else condition but i am still getting that string in my else condition.Can anyone tell me what can be the possible problems.
my code
String a=new String(packet.data);
if(a.contains("image/"))
{
}
else
{
System.out.println(a);
} | 4 |
8,308,310 | 11/29/2011 09:17:41 | 1,066,935 | 11/26/2011 13:45:51 | 1 | 0 | How to generate Read Receipt After reading the sms | I go through this site:
http://mobiforge.com/developing/story/sms-messaging-android .
And developed sms app.
Now I have to make a app which has to send sms and after receive and reading the sms a Read Receipt will generate.
Give you valuable suggestion ASP.
thak you
In Advance | android | null | null | null | null | 12/03/2011 08:39:02 | not a real question | How to generate Read Receipt After reading the sms
===
I go through this site:
http://mobiforge.com/developing/story/sms-messaging-android .
And developed sms app.
Now I have to make a app which has to send sms and after receive and reading the sms a Read Receipt will generate.
Give you valuable suggestion ASP.
thak you
In Advance | 1 |
10,604,780 | 05/15/2012 16:12:57 | 76,582 | 03/11/2009 10:40:46 | 11 | 1 | Speeding slicing of big numpy array | I have a big array ( 1000x500000x6 ) that is stored in a pyTables file. I am doing some calculations on it that are fairly optimized in terms of speed, but what is taking the most time is the slicing of the array.
At the beginning of the script, I need to get a subset of the rows : reduced_data = data[row_indices, :, :] and then, for this reduced dataset, I need to access:
- columns one by one: reduced_data[:,clm_indice,:]
- a subset of the columns: reduced_data[:,clm_indices,:]
Getting these arrays takes forever. Is there any way to speed that up ? storing the data differently for example ?
| python | numpy | slicing | pytables | null | null | open | Speeding slicing of big numpy array
===
I have a big array ( 1000x500000x6 ) that is stored in a pyTables file. I am doing some calculations on it that are fairly optimized in terms of speed, but what is taking the most time is the slicing of the array.
At the beginning of the script, I need to get a subset of the rows : reduced_data = data[row_indices, :, :] and then, for this reduced dataset, I need to access:
- columns one by one: reduced_data[:,clm_indice,:]
- a subset of the columns: reduced_data[:,clm_indices,:]
Getting these arrays takes forever. Is there any way to speed that up ? storing the data differently for example ?
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.