PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
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 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,401,284 | 07/09/2012 18:54:43 | 1,512,828 | 07/09/2012 18:33:44 | 1 | 0 | Compiler issues | I've been encountering some issues with a Java program which I've begun developing. It would be an online ordering system for the Honeydukes Candy Store of Harry Potter fame, and would be two separate programs. The client program would be in Swing, and would take the order and all that, sending it off to the server program when the order is made. The server program will be significantly less pretty, and its goal would be to write the orders to a text file before giving the green light to the client program that all went well.
For the client program, I'm wanting to have three panels, with the main panel containing the other two. On the left side would be the invntryPanel, containing a JList that has the store's stock. The right side would hold the infoPanel, which uses the CardLayout to change between various panels, using the currently selected item from the JList to determine which panel to display. The infoPanel will also be where the user selects the quantity the wish to purchase.
A button whose position I haven't quite decided on yet can be clicked when the user is done making their order, and it will bring up a separate window asking for general information(name, etc), as well as displaying their total. One final click of a button on that window will send the order to the server program, and the client application will close upon receiving confirmation from the server program that the request went through.
I've gotten started on it, but the compiler seems to be in a bad mood today. What am I doing wrong?
I do apologize for the fact that this is a self-centered question, but I'm just not really sure where else to turn to. I've checked multiple other resources and my code seems to be in order, but obviously it's not.
Thank you in advance.
Source:
import javax.swing.*;
import java.awt.event.*;
import javax.swing.border.*;
import java.util.*;
public class ClientApp extends JFrame
{
public static void main(String[] args)
{
new ClientApp();
}
public ClientApp()
{
this.setSize(320,200);
this.setTitle("Honeydukes Candy Order");
this.setDefaultCloseOperation(
JFrame.EXIT_ON_CLOSE);
ButtonListener bl = new ButtonListener();
JPanel mainPanel = new JPanel();
JPanel infoPanel = new JPanel(new CardLayout());
JPanel invntryPanel = new JPanel();
String[] candy = new String[38];
String[] candy = {"Acid Pops", "Bat's Blood Soup",
"Bertie Bott's Every Flavour Beans",
"Blood-flavoured Lollipops",
"Cauldron Cakes", "Charm Choc",
"Chocoballs", "Chocolate Cauldrons",
"Chocolate Frogs", "Chocolate Skeletons",
"Chocolate Wands", "Choco-Loco", "Cockroach Clusters",
"Nougat", "Crystallised Pineapple",
"Drooble's Best Blowing Gum", "Exploding Bonbons",
"Toffees", "Fizzing Whizzbees",
"Fudge Flies", "Ice Mice",
"Jelly Slugs", "Liquourice Wands",
"Pepper Imps", "Peppermint Toads",
"Pink Coconut Ice", "Pixie Puffs"
"Pumpkin Fizz", "Salt Water Taffy",
"Shock-o-Choc", "Skeletal Sweets",
"Splindle's Lick'O'Rish Spiders",
"Sugar Quills", "Sugared Butterfly Wings",
"Toothflossing Stringmints", "Tooth-Splintering Strongmints"
"Treacle Fudge", "Chocolates", "Wizochoc"};
candyList = new JList(candy);
candyList.setVisibleRowCount(38);
candyList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane scroll = new JScrollPane(candyList);
invntryPanel.add(scroll);
mainPanel.add(invntryPanel);
this.setVisible(true);
}
} | java | swing | network-programming | compiler-errors | null | null | open | Compiler issues
===
I've been encountering some issues with a Java program which I've begun developing. It would be an online ordering system for the Honeydukes Candy Store of Harry Potter fame, and would be two separate programs. The client program would be in Swing, and would take the order and all that, sending it off to the server program when the order is made. The server program will be significantly less pretty, and its goal would be to write the orders to a text file before giving the green light to the client program that all went well.
For the client program, I'm wanting to have three panels, with the main panel containing the other two. On the left side would be the invntryPanel, containing a JList that has the store's stock. The right side would hold the infoPanel, which uses the CardLayout to change between various panels, using the currently selected item from the JList to determine which panel to display. The infoPanel will also be where the user selects the quantity the wish to purchase.
A button whose position I haven't quite decided on yet can be clicked when the user is done making their order, and it will bring up a separate window asking for general information(name, etc), as well as displaying their total. One final click of a button on that window will send the order to the server program, and the client application will close upon receiving confirmation from the server program that the request went through.
I've gotten started on it, but the compiler seems to be in a bad mood today. What am I doing wrong?
I do apologize for the fact that this is a self-centered question, but I'm just not really sure where else to turn to. I've checked multiple other resources and my code seems to be in order, but obviously it's not.
Thank you in advance.
Source:
import javax.swing.*;
import java.awt.event.*;
import javax.swing.border.*;
import java.util.*;
public class ClientApp extends JFrame
{
public static void main(String[] args)
{
new ClientApp();
}
public ClientApp()
{
this.setSize(320,200);
this.setTitle("Honeydukes Candy Order");
this.setDefaultCloseOperation(
JFrame.EXIT_ON_CLOSE);
ButtonListener bl = new ButtonListener();
JPanel mainPanel = new JPanel();
JPanel infoPanel = new JPanel(new CardLayout());
JPanel invntryPanel = new JPanel();
String[] candy = new String[38];
String[] candy = {"Acid Pops", "Bat's Blood Soup",
"Bertie Bott's Every Flavour Beans",
"Blood-flavoured Lollipops",
"Cauldron Cakes", "Charm Choc",
"Chocoballs", "Chocolate Cauldrons",
"Chocolate Frogs", "Chocolate Skeletons",
"Chocolate Wands", "Choco-Loco", "Cockroach Clusters",
"Nougat", "Crystallised Pineapple",
"Drooble's Best Blowing Gum", "Exploding Bonbons",
"Toffees", "Fizzing Whizzbees",
"Fudge Flies", "Ice Mice",
"Jelly Slugs", "Liquourice Wands",
"Pepper Imps", "Peppermint Toads",
"Pink Coconut Ice", "Pixie Puffs"
"Pumpkin Fizz", "Salt Water Taffy",
"Shock-o-Choc", "Skeletal Sweets",
"Splindle's Lick'O'Rish Spiders",
"Sugar Quills", "Sugared Butterfly Wings",
"Toothflossing Stringmints", "Tooth-Splintering Strongmints"
"Treacle Fudge", "Chocolates", "Wizochoc"};
candyList = new JList(candy);
candyList.setVisibleRowCount(38);
candyList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane scroll = new JScrollPane(candyList);
invntryPanel.add(scroll);
mainPanel.add(invntryPanel);
this.setVisible(true);
}
} | 0 |
11,471,737 | 07/13/2012 13:45:16 | 315,182 | 04/13/2010 06:43:31 | 140 | 21 | Granting guest access to server with key based SSH login | Quite simple: How can guest SSH access to a server be granted to multiple users who will share the same 'guest' login?
The server has only RSA key access (no password login) and this works fine for the normal case where the public keys of single users are copied to authorized_keys on the remote server. What I'm looking for is guest access as user 'guest', the problem is the keys - I don't want to have to install keys from all my clients, rather give them a key to use - would this be the private 'guest' key? How does this work?
Clients will be connecting from Linux, and Windows using Putty. | login | ssh | null | null | null | null | open | Granting guest access to server with key based SSH login
===
Quite simple: How can guest SSH access to a server be granted to multiple users who will share the same 'guest' login?
The server has only RSA key access (no password login) and this works fine for the normal case where the public keys of single users are copied to authorized_keys on the remote server. What I'm looking for is guest access as user 'guest', the problem is the keys - I don't want to have to install keys from all my clients, rather give them a key to use - would this be the private 'guest' key? How does this work?
Clients will be connecting from Linux, and Windows using Putty. | 0 |
11,471,655 | 07/13/2012 13:40:52 | 1,521,556 | 07/12/2012 17:29:55 | 1 | 0 | if statement comparing integers not working in objective c | I am trying to perform logic based on the values of two integers. Here I am defining my integers, and I also have NSLog so I can see if the values are correct when I run the code:
int theHikeFlag = (int)[theNewHikeFlag objectAtIndex:(theID-1)];
NSLog(@"theHikeFlag: %@",theHikeFlag);
int fromTheDB = [self.detailItem hikeFlag];
NSLog(@"fromTheDB: %d",fromTheDB);
And here is the logic:
if (theHikeFlag==1) {
hikeString=@"You have";
}
else if (theHikeFlag==0) {
hikeString=@"You have not";
}
else {
if (fromTheDB==1) {
hikeString=@"You have";
}
else {
hikeString=@"You have not";
}
}
As an example of how this code is working. When theHikeFlag=1 and fromTheDB=0, the code bypasses the if and the else if and goes straight to the else and sets hikeString="You have not". This means that my result is irrelevant of theHikeFlag and is based on the fromTheDB integer. | objective-c | xcode | xcode4.3 | null | null | null | open | if statement comparing integers not working in objective c
===
I am trying to perform logic based on the values of two integers. Here I am defining my integers, and I also have NSLog so I can see if the values are correct when I run the code:
int theHikeFlag = (int)[theNewHikeFlag objectAtIndex:(theID-1)];
NSLog(@"theHikeFlag: %@",theHikeFlag);
int fromTheDB = [self.detailItem hikeFlag];
NSLog(@"fromTheDB: %d",fromTheDB);
And here is the logic:
if (theHikeFlag==1) {
hikeString=@"You have";
}
else if (theHikeFlag==0) {
hikeString=@"You have not";
}
else {
if (fromTheDB==1) {
hikeString=@"You have";
}
else {
hikeString=@"You have not";
}
}
As an example of how this code is working. When theHikeFlag=1 and fromTheDB=0, the code bypasses the if and the else if and goes straight to the else and sets hikeString="You have not". This means that my result is irrelevant of theHikeFlag and is based on the fromTheDB integer. | 0 |
11,471,698 | 07/13/2012 13:43:17 | 352,743 | 05/28/2010 09:28:02 | 1 | 0 | Generating a random preview image on a HTML5 video tag | Is it possible to capture a snapshot of a video that's loaded using the HTML5 video element and use that as a preview image until the video loads or the play event is triggered? I know about the poster attribute but I want the thumbnail to be self generated, like a random frame from the video. Sort of what YouTube/Vimeo does.
Thanks, | html5 | video | html5-video | thumbnail | poster | null | open | Generating a random preview image on a HTML5 video tag
===
Is it possible to capture a snapshot of a video that's loaded using the HTML5 video element and use that as a preview image until the video loads or the play event is triggered? I know about the poster attribute but I want the thumbnail to be self generated, like a random frame from the video. Sort of what YouTube/Vimeo does.
Thanks, | 0 |
11,471,739 | 07/13/2012 13:45:22 | 402,089 | 07/26/2010 09:14:55 | 164 | 2 | shell_exec() - Error when executing php script | When I'm trying to execute a PHP script using `shell_exec()`, it's not working.
In the error_log file it shows:
> PHP Warning: shell_exec() [<a
> href='function.shell-exec'>function.shell-exec</a>]: Unable to execute
> 'php /home/snabbsam/public_html/.....
**System**
Centos
**shell_exec works with clamscan**
`shell_exec()` works on `clamscan()` function of clamav.
But it's not executing PHP script
**Things I've checked:**
- PHP `safe_mode` is off
- `shell_exec()` is not present in `disable_functions` in php.ini
- Tried giving executable permission to the file & the parent folders as suggested in http://stackoverflow.com/a/8668666/402089
| php | shell-exec | null | null | null | null | open | shell_exec() - Error when executing php script
===
When I'm trying to execute a PHP script using `shell_exec()`, it's not working.
In the error_log file it shows:
> PHP Warning: shell_exec() [<a
> href='function.shell-exec'>function.shell-exec</a>]: Unable to execute
> 'php /home/snabbsam/public_html/.....
**System**
Centos
**shell_exec works with clamscan**
`shell_exec()` works on `clamscan()` function of clamav.
But it's not executing PHP script
**Things I've checked:**
- PHP `safe_mode` is off
- `shell_exec()` is not present in `disable_functions` in php.ini
- Tried giving executable permission to the file & the parent folders as suggested in http://stackoverflow.com/a/8668666/402089
| 0 |
11,471,740 | 07/13/2012 13:45:23 | 1,482,117 | 06/26/2012 08:34:43 | 9 | 0 | Error page for "mysql errors" | I was wounding if there really is any possible way to make the mysql errors cleaner. It's not a very big issue, but if they do happen I'd like them to be nice and neat.
I did read one tutorial, which sadly didn't work, but they did seem to give me hope of a possibility.
I would like my msql errors, no connection etc to show a error page like a 404 error page.
Anyone know? working tutorials?
Here is the tut I read: http://www.jooria.com/Making-Error-Page-When-The-Mysql-Offline-a66.html
Thanks! | php | mysql | html | null | null | null | open | Error page for "mysql errors"
===
I was wounding if there really is any possible way to make the mysql errors cleaner. It's not a very big issue, but if they do happen I'd like them to be nice and neat.
I did read one tutorial, which sadly didn't work, but they did seem to give me hope of a possibility.
I would like my msql errors, no connection etc to show a error page like a 404 error page.
Anyone know? working tutorials?
Here is the tut I read: http://www.jooria.com/Making-Error-Page-When-The-Mysql-Offline-a66.html
Thanks! | 0 |
11,470,928 | 07/13/2012 12:53:45 | 1,219,868 | 02/19/2012 22:42:30 | 10 | 0 | iPhone app store, how to release preview app just for customer | I know you can release your app throw iTunes connect and use the 50 redoom code for customer to free download.
But is there a preview store I can use to allow customer have a preview before I actually release to the app store?
Cheers
Phil | iphone | app-store | release | itunesconnect | null | null | open | iPhone app store, how to release preview app just for customer
===
I know you can release your app throw iTunes connect and use the 50 redoom code for customer to free download.
But is there a preview store I can use to allow customer have a preview before I actually release to the app store?
Cheers
Phil | 0 |
11,470,929 | 07/13/2012 12:53:47 | 1,038,702 | 11/09/2011 22:59:31 | 119 | 4 | Get webpage content with Hebrew characters / UTF-8 | I'm trying to bring next webpage content (as it) to TextView in my android application.
http://www.kavim-t.co.il/include/getXMLStations.asp?parent=56_%20_2
Here are the results, Chrome vs Activity:
![enter image description here][1]
[1]: http://i.stack.imgur.com/0WaDs.png
As you can see, the problem is that Hebrew/UTF-8/Windows-1255 characters shown as "???".
I'm using next code (using org.apache.http):
HttpClient client = new DefaultHttpClient();
client.getParams().setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, HTTP.UTF_8);
HttpGet request = new HttpGet("http://www.kavim-t.co.il/include/getXMLStations.asp?parent=56_%20_2");
HttpResponse response = null;
response = client.execute(request);
BufferedReader rd = null;
rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
String line = "";
while ((line = rd.readLine()) != null) {
tv.append(line);
}
| java | android | apache | hebrew | null | null | open | Get webpage content with Hebrew characters / UTF-8
===
I'm trying to bring next webpage content (as it) to TextView in my android application.
http://www.kavim-t.co.il/include/getXMLStations.asp?parent=56_%20_2
Here are the results, Chrome vs Activity:
![enter image description here][1]
[1]: http://i.stack.imgur.com/0WaDs.png
As you can see, the problem is that Hebrew/UTF-8/Windows-1255 characters shown as "???".
I'm using next code (using org.apache.http):
HttpClient client = new DefaultHttpClient();
client.getParams().setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, HTTP.UTF_8);
HttpGet request = new HttpGet("http://www.kavim-t.co.il/include/getXMLStations.asp?parent=56_%20_2");
HttpResponse response = null;
response = client.execute(request);
BufferedReader rd = null;
rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
String line = "";
while ((line = rd.readLine()) != null) {
tv.append(line);
}
| 0 |
11,470,930 | 07/13/2012 12:53:47 | 561,985 | 01/04/2011 01:39:03 | 1 | 0 | Remove YouTube related videos in this script | I have seen this script to auto-mute video's from youtube embedded on a site:
http://stackoverflow.com/questions/8869372/how-do-i-automatically-play-a-youtube-video-iframe-api-muted
The code is available on fiddle:
http://jsfiddle.net/9RjzU/3/
However I would like to know what to add to this code to prevent related videos appearing?
Thanks
Azzam | youtube | null | null | null | null | null | open | Remove YouTube related videos in this script
===
I have seen this script to auto-mute video's from youtube embedded on a site:
http://stackoverflow.com/questions/8869372/how-do-i-automatically-play-a-youtube-video-iframe-api-muted
The code is available on fiddle:
http://jsfiddle.net/9RjzU/3/
However I would like to know what to add to this code to prevent related videos appearing?
Thanks
Azzam | 0 |
11,471,746 | 07/13/2012 13:45:43 | 1,082,782 | 12/06/2011 03:42:21 | 147 | 1 | Why is my Trie lookup slower than that of the standard F# Map's? | So, I just ported the Trie from OCaml. Unfortunately, it runs slower than the standard Map in terms of tryFind. I don't understand this - the trie seems like it should be faster. Is F#'s code libraries built in some special way as to make them faster than the code that the user typically deploys?
Here's the code -
[<RequireQualifiedAccess>]
module Trie
type Node<'k, 'v when 'k : comparison> =
{ TrieMap : Map<'k, Node<'k, 'v>>
TrieKvp : ('k list * 'v) option }
member inline x.IsEmpty = x.TrieKvp.IsNone && x.TrieMap.IsEmpty
let inline make map kvp =
{ TrieMap = map
TrieKvp = kvp }
let inline makeEmpty () : Node<'k, 'v> = make Map.empty None
let inline isEmpty (node : Node<'k, 'v>) = node.IsEmpty
let rec tryFind (key : 'k list) node =
if key.IsEmpty then
match node.TrieKvp with
| Some (_, value) -> Some value
| None -> None
else
let keyHead = key.Head
let keyTail = key.Tail
let optSubNode = Map.tryFind keyHead node.TrieMap
match optSubNode with
| Some subNode -> tryFind keyTail subNode
| None -> None
let inline containsKey key node =
(tryFind key node).IsSome
let rec addInternal (key : 'k list) value node =
if key.IsEmpty then make node.TrieMap (Some (key, value))
else
let keyHead = key.Head
let keyTail = key.Tail
let newTrie =
match Map.tryFind keyHead node.TrieMap with
| Some subTrie -> subTrie
| None -> makeEmpty ()
let newTrie2 = addInternal keyTail value newTrie
make (Map.add keyHead newTrie2 node.TrieMap) node.TrieKvp
let inline add key value node =
addInternal key value node
let rec addMany kvps node =
if Seq.isEmpty kvps then node
else
let kvpHead = Seq.head kvps
let kvpTail = Seq.skip 1 kvps
let newTrie = add (fst kvpHead) (snd kvpHead) node
addMany kvpTail newTrie
let inline ofList kvps =
addMany kvps (makeEmpty ())
let inline ofListBy by kvps =
let pairs = List.map by kvps
ofList pairs
let rec foldInternal folder rev node state =
match node.TrieKvp with
| Some (_, value) -> folder (Map.fold (fun state key value -> foldInternal folder (key :: rev) value state) state node.TrieMap) (List.rev rev) value
| None -> Map.fold (fun state key value -> foldInternal folder (key :: rev) value state) state node.TrieMap
let inline fold folder state node =
foldInternal folder [] node state
let rec map (mapper : 'k list -> 'v -> 'a) (node : Node<'k, 'v>) : Node<'k, 'a> =
match node.TrieKvp with
| Some (key, value) -> make (Map.map (fun _ value -> map mapper value) node.TrieMap) (Some (key, mapper key value))
| None -> make (Map.map (fun _ value -> map mapper value) node.TrieMap) None
let inline toValueList node =
fold (fun state _ value -> value :: state) [] node
let inline singleton (key, value) =
add key value (makeEmpty ()) | performance | map | f# | trie | null | null | open | Why is my Trie lookup slower than that of the standard F# Map's?
===
So, I just ported the Trie from OCaml. Unfortunately, it runs slower than the standard Map in terms of tryFind. I don't understand this - the trie seems like it should be faster. Is F#'s code libraries built in some special way as to make them faster than the code that the user typically deploys?
Here's the code -
[<RequireQualifiedAccess>]
module Trie
type Node<'k, 'v when 'k : comparison> =
{ TrieMap : Map<'k, Node<'k, 'v>>
TrieKvp : ('k list * 'v) option }
member inline x.IsEmpty = x.TrieKvp.IsNone && x.TrieMap.IsEmpty
let inline make map kvp =
{ TrieMap = map
TrieKvp = kvp }
let inline makeEmpty () : Node<'k, 'v> = make Map.empty None
let inline isEmpty (node : Node<'k, 'v>) = node.IsEmpty
let rec tryFind (key : 'k list) node =
if key.IsEmpty then
match node.TrieKvp with
| Some (_, value) -> Some value
| None -> None
else
let keyHead = key.Head
let keyTail = key.Tail
let optSubNode = Map.tryFind keyHead node.TrieMap
match optSubNode with
| Some subNode -> tryFind keyTail subNode
| None -> None
let inline containsKey key node =
(tryFind key node).IsSome
let rec addInternal (key : 'k list) value node =
if key.IsEmpty then make node.TrieMap (Some (key, value))
else
let keyHead = key.Head
let keyTail = key.Tail
let newTrie =
match Map.tryFind keyHead node.TrieMap with
| Some subTrie -> subTrie
| None -> makeEmpty ()
let newTrie2 = addInternal keyTail value newTrie
make (Map.add keyHead newTrie2 node.TrieMap) node.TrieKvp
let inline add key value node =
addInternal key value node
let rec addMany kvps node =
if Seq.isEmpty kvps then node
else
let kvpHead = Seq.head kvps
let kvpTail = Seq.skip 1 kvps
let newTrie = add (fst kvpHead) (snd kvpHead) node
addMany kvpTail newTrie
let inline ofList kvps =
addMany kvps (makeEmpty ())
let inline ofListBy by kvps =
let pairs = List.map by kvps
ofList pairs
let rec foldInternal folder rev node state =
match node.TrieKvp with
| Some (_, value) -> folder (Map.fold (fun state key value -> foldInternal folder (key :: rev) value state) state node.TrieMap) (List.rev rev) value
| None -> Map.fold (fun state key value -> foldInternal folder (key :: rev) value state) state node.TrieMap
let inline fold folder state node =
foldInternal folder [] node state
let rec map (mapper : 'k list -> 'v -> 'a) (node : Node<'k, 'v>) : Node<'k, 'a> =
match node.TrieKvp with
| Some (key, value) -> make (Map.map (fun _ value -> map mapper value) node.TrieMap) (Some (key, mapper key value))
| None -> make (Map.map (fun _ value -> map mapper value) node.TrieMap) None
let inline toValueList node =
fold (fun state _ value -> value :: state) [] node
let inline singleton (key, value) =
add key value (makeEmpty ()) | 0 |
11,471,747 | 07/13/2012 13:45:43 | 1,523,691 | 07/13/2012 13:34:22 | 1 | 0 | Uusing unsignedByte with Base 64 encoding | I have made a SOAP API using WSDL, and i need to transfer bytes of a file from client to the server of the API. I am using unsignedBinary[] array type in the WSDL to describe the data to be passed. The WSDL description is as follows:
<complexType name="TByteArray">
<complexContent>
<restriction base="soapenc:Array">
<sequence/>
<attribute ref="soapenc:arrayType" n1:arrayType="xs:unsignedByte[]" xmlns:n1="http://schemas.xmlsoap.org/wsdl/"/>
</restriction>
</complexContent>
</complexType>
I am trying to send the data in a raw bytes, which is giving error.
Now i am doing a base64 encode while sending the binary data using the soap API call.
Now it is working fine if i send the data using PHP Client.
But not working when i use a DELPHI Application to send the data.
So do you think that converting the binary data to base64 is making the DELPHI application not allow to send the data?
unsignedByes is not allowed to transfer to Base 64?
Please reply me in yes or on with detailed description.
Thanks. | delphi | soap | null | null | null | null | open | Uusing unsignedByte with Base 64 encoding
===
I have made a SOAP API using WSDL, and i need to transfer bytes of a file from client to the server of the API. I am using unsignedBinary[] array type in the WSDL to describe the data to be passed. The WSDL description is as follows:
<complexType name="TByteArray">
<complexContent>
<restriction base="soapenc:Array">
<sequence/>
<attribute ref="soapenc:arrayType" n1:arrayType="xs:unsignedByte[]" xmlns:n1="http://schemas.xmlsoap.org/wsdl/"/>
</restriction>
</complexContent>
</complexType>
I am trying to send the data in a raw bytes, which is giving error.
Now i am doing a base64 encode while sending the binary data using the soap API call.
Now it is working fine if i send the data using PHP Client.
But not working when i use a DELPHI Application to send the data.
So do you think that converting the binary data to base64 is making the DELPHI application not allow to send the data?
unsignedByes is not allowed to transfer to Base 64?
Please reply me in yes or on with detailed description.
Thanks. | 0 |
11,471,748 | 07/13/2012 13:45:45 | 1,521,344 | 07/12/2012 16:02:01 | 6 | 0 | sparql regex compare two string variables (one is composed by the other) | I am trying to compare two string variables to discover if one is contained in the other, specifically if one is composed of the other (so, I would like to avoid retrieving that "information" contains "format". I am interested only in results similar to "information_management" includes "information".
I have tried both FILTER CONTAINS() and FILTER regex() with the same results. How can I modify the query so it includes the fact that there needs to be a space either before or after the term?
SELECT DISTINCT ?l1 ?l2
WHERE
{
?term1 skos:prefLabel ?l1.
?term2 skos:prefLabel ?l2.
FILTER(contains(?l1,?l2))
} | regex | contains | sparql | null | null | null | open | sparql regex compare two string variables (one is composed by the other)
===
I am trying to compare two string variables to discover if one is contained in the other, specifically if one is composed of the other (so, I would like to avoid retrieving that "information" contains "format". I am interested only in results similar to "information_management" includes "information".
I have tried both FILTER CONTAINS() and FILTER regex() with the same results. How can I modify the query so it includes the fact that there needs to be a space either before or after the term?
SELECT DISTINCT ?l1 ?l2
WHERE
{
?term1 skos:prefLabel ?l1.
?term2 skos:prefLabel ?l2.
FILTER(contains(?l1,?l2))
} | 0 |
11,541,627 | 07/18/2012 12:40:42 | 1,477,901 | 06/24/2012 09:57:04 | 3 | 0 | how android device identifies which layout to use | In my android app, I have set the layout resources for both large and x-large screens, viz:
layout-large and layout x-large. When I open run it in an device emulator with "large" screen, it gets the layout from the "layout-large" folder, which seems to be correct. But when I use a device with x-large screen size, it still uses the "layout-large" resources.
The x-large device I used is a 10", 1280x800, 240dp emulator. Any idea? | android | null | null | null | null | null | open | how android device identifies which layout to use
===
In my android app, I have set the layout resources for both large and x-large screens, viz:
layout-large and layout x-large. When I open run it in an device emulator with "large" screen, it gets the layout from the "layout-large" folder, which seems to be correct. But when I use a device with x-large screen size, it still uses the "layout-large" resources.
The x-large device I used is a 10", 1280x800, 240dp emulator. Any idea? | 0 |
11,541,671 | 07/18/2012 12:42:43 | 1,484,863 | 06/27/2012 07:34:11 | 1 | 0 | Excel Matrix get (multiple) values | As you can see we've got a matrix with data in it. (I removed the header of rows and columns, since it's corporate information that isn't supposed to be spread around.)
Link: http://i49.tinypic.com/5jwayg.jpg
This is what I need:
* When there is a 'X' in the matrix, I need the value of the column where it's placed underneath (from the 'yellow' range: B1:W1). As you can see, it's possible to have more 'X' in one row ('blue' range: A3:A48)
* So when A11 is selected, I need the values of B11 and M11)
I hope somebody is able to achieve this with just functions?
| excel | vba | excel-vba | matrix | excel-formula | null | open | Excel Matrix get (multiple) values
===
As you can see we've got a matrix with data in it. (I removed the header of rows and columns, since it's corporate information that isn't supposed to be spread around.)
Link: http://i49.tinypic.com/5jwayg.jpg
This is what I need:
* When there is a 'X' in the matrix, I need the value of the column where it's placed underneath (from the 'yellow' range: B1:W1). As you can see, it's possible to have more 'X' in one row ('blue' range: A3:A48)
* So when A11 is selected, I need the values of B11 and M11)
I hope somebody is able to achieve this with just functions?
| 0 |
11,541,672 | 07/18/2012 12:43:01 | 241,654 | 12/31/2009 17:56:43 | 1,516 | 16 | Different partial view per module | I have different namespaced controllers that share the same layout:
# /app/controllers/admin/dashboard.rb
class Admins::DashboardController < ApplicationController
...
end
----------
# /app/controllers/clients/dashboard.rb
class Clients::DashboardController < ApplicationController
...
end
I'd like to determine whether the layout is displayed by `Admins` or `Clients` so i can show the correct sidebar, Something like:
<% if admins? %>
...
<% elsif clients? %>
...
<% end %>
Also is this even the best way to approach this or there's a better solution? | ruby-on-rails | null | null | null | null | null | open | Different partial view per module
===
I have different namespaced controllers that share the same layout:
# /app/controllers/admin/dashboard.rb
class Admins::DashboardController < ApplicationController
...
end
----------
# /app/controllers/clients/dashboard.rb
class Clients::DashboardController < ApplicationController
...
end
I'd like to determine whether the layout is displayed by `Admins` or `Clients` so i can show the correct sidebar, Something like:
<% if admins? %>
...
<% elsif clients? %>
...
<% end %>
Also is this even the best way to approach this or there's a better solution? | 0 |
11,541,529 | 07/18/2012 12:36:35 | 492,182 | 10/30/2010 14:02:20 | 301 | 9 | Dividing Google Map Into sectors | Lets say i've a map of certain country. Is there anyway i'll be able to divide out the map into sectors? like the image below?
The reason why i wishes to divide is i am given a task to get the current sector the user is base on his current lat and long from the android phone. Because google map does not divides the map into the sector i wanted, i may have to divide them out individually and draw lines as overlay. Do you guys have any good solution
Example image ![enter image description here][1]
[1]: http://i.stack.imgur.com/4DxO6.png | android | google-maps | google-maps-api-3 | android-mapview | null | null | open | Dividing Google Map Into sectors
===
Lets say i've a map of certain country. Is there anyway i'll be able to divide out the map into sectors? like the image below?
The reason why i wishes to divide is i am given a task to get the current sector the user is base on his current lat and long from the android phone. Because google map does not divides the map into the sector i wanted, i may have to divide them out individually and draw lines as overlay. Do you guys have any good solution
Example image ![enter image description here][1]
[1]: http://i.stack.imgur.com/4DxO6.png | 0 |
11,541,531 | 07/18/2012 12:36:36 | 1,274,894 | 03/16/2012 20:24:41 | 1 | 1 | separate the word contain letters and numbers into two parts | How can I separate the word contain letters and numbers into two parts in the character variable and the number in the variable:
example:
<?
$x = "f25";
?>
I want to get the letter to a new variable $L="f";
and the number to another variable $N=25;
thanks alot | php | variables | word | null | null | null | open | separate the word contain letters and numbers into two parts
===
How can I separate the word contain letters and numbers into two parts in the character variable and the number in the variable:
example:
<?
$x = "f25";
?>
I want to get the letter to a new variable $L="f";
and the number to another variable $N=25;
thanks alot | 0 |
11,541,665 | 07/18/2012 12:42:15 | 414,940 | 08/09/2010 10:14:03 | 405 | 27 | grails / groovy NoClassDefFoundError when accessing a static variable | i think this is an easy one for you:
I have a Controller in which i want to access a static field within another class XY (groovy class, located in package src/groovy ...). But this gets an NoClassDefFoundError.
public class XY{ public static final String a = "something" }
in controller: XY.a causes error!!!
Other classes in the same package than Class XY dont cause problems.
what i am doing wrong? | grails | groovy | static | null | null | null | open | grails / groovy NoClassDefFoundError when accessing a static variable
===
i think this is an easy one for you:
I have a Controller in which i want to access a static field within another class XY (groovy class, located in package src/groovy ...). But this gets an NoClassDefFoundError.
public class XY{ public static final String a = "something" }
in controller: XY.a causes error!!!
Other classes in the same package than Class XY dont cause problems.
what i am doing wrong? | 0 |
11,541,667 | 07/18/2012 12:42:33 | 1,392,387 | 05/13/2012 16:51:43 | 22 | 0 | Form Authentication and Impersonation | I am trying to implement Form Authentication in my Application. At the same time I want to impersonate using a high previlaged account, in oredr to acces a file for a server. I have written the following code:
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="Login.aspx" timeout="30" defaultUrl="HomePage.aspx"
cookieless="AutoDetect">
<credentials passwordFormat="Clear">
<user name="user1" password="pass@123"/>
<user name="user2" password="pass@123"/>
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<identity impersonate="true" userName="domain\abcd" password="aaaa"/>
</system.web>
It seems, impersonation is not working. Couldn't we use impersonation with form authentication? | asp.net | null | null | null | null | null | open | Form Authentication and Impersonation
===
I am trying to implement Form Authentication in my Application. At the same time I want to impersonate using a high previlaged account, in oredr to acces a file for a server. I have written the following code:
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="Login.aspx" timeout="30" defaultUrl="HomePage.aspx"
cookieless="AutoDetect">
<credentials passwordFormat="Clear">
<user name="user1" password="pass@123"/>
<user name="user2" password="pass@123"/>
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<identity impersonate="true" userName="domain\abcd" password="aaaa"/>
</system.web>
It seems, impersonation is not working. Couldn't we use impersonation with form authentication? | 0 |
11,372,921 | 07/07/2012 06:48:03 | 1,488,327 | 06/28/2012 11:04:02 | 1 | 0 | Selenium IDE: Opening in new tab and shift focus to new tab not working | i have stuck in one point in selenium ide
the scenario is like this
Log-----go to dashboard page---------mouse over any menu on the top navigational bar-----on mouseover sub menu will appear as drop down---now click any link from the drop down ---- after clicking link will open in new tab
now from that point on-wards we have to shift our focus to that new tab because rest of the testing will be done on that new tab.
The code i have written is given below
<tr>
<td>open</td>
<td>/magma/dev/</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=user_id</td>
<td>abcd</td>
</tr>
<tr>
<td>type</td>
<td>name=pass</td>
<td>1234</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=btnLogin</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Costing List</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Fuel</td>
<td></td>
</tr>
<tr>
<td>mouseOver</td>
<td>//div[@id='smoothmenu1']/ul/li[3]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Fuel Cost</td>
<td></td>
</tr>
<tr>
<td>selectWindow</td>
<td>http://10.0.1.101/magma/dev/fuelcost/</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Manage Fuel Cost</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Logout</td>
<td></td>
</tr>
This code is working correctly upto clicking the sub menu from the dropdown after that it is not working and a error is showing in the log
so when ever i am trying to run that test case it is showing error
**[warn] Link has target '_blank', which is not supported in Selenium! Randomizing target to be: selenium_blank84419**
can any one please help me to write the code properly
| selenium-ide | null | null | null | null | null | open | Selenium IDE: Opening in new tab and shift focus to new tab not working
===
i have stuck in one point in selenium ide
the scenario is like this
Log-----go to dashboard page---------mouse over any menu on the top navigational bar-----on mouseover sub menu will appear as drop down---now click any link from the drop down ---- after clicking link will open in new tab
now from that point on-wards we have to shift our focus to that new tab because rest of the testing will be done on that new tab.
The code i have written is given below
<tr>
<td>open</td>
<td>/magma/dev/</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>name=user_id</td>
<td>abcd</td>
</tr>
<tr>
<td>type</td>
<td>name=pass</td>
<td>1234</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>id=btnLogin</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Costing List</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Fuel</td>
<td></td>
</tr>
<tr>
<td>mouseOver</td>
<td>//div[@id='smoothmenu1']/ul/li[3]</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>link=Fuel Cost</td>
<td></td>
</tr>
<tr>
<td>selectWindow</td>
<td>http://10.0.1.101/magma/dev/fuelcost/</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
<td>Manage Fuel Cost</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=Logout</td>
<td></td>
</tr>
This code is working correctly upto clicking the sub menu from the dropdown after that it is not working and a error is showing in the log
so when ever i am trying to run that test case it is showing error
**[warn] Link has target '_blank', which is not supported in Selenium! Randomizing target to be: selenium_blank84419**
can any one please help me to write the code properly
| 0 |
11,343,023 | 07/05/2012 11:04:13 | 987,143 | 10/10/2011 06:01:56 | 30 | 0 | Facebook ios sdk: Page not found message after integrate it into my App | i have searched for a lot of questions regarding this `The page you requested was not found.` <br/> when i do it in sample app then it work nicely and it connecting to facebook and posting work successfuly. but when i integrate it in my App then when i click on Facebook share button then after login it gives `The page you requested was not found` <br/> what problem is this please help while i m using the latest `facebook ios sdk` Please Help!!! | iphone | objective-c | ios | xcode | iphone-sdk-4.0 | null | open | Facebook ios sdk: Page not found message after integrate it into my App
===
i have searched for a lot of questions regarding this `The page you requested was not found.` <br/> when i do it in sample app then it work nicely and it connecting to facebook and posting work successfuly. but when i integrate it in my App then when i click on Facebook share button then after login it gives `The page you requested was not found` <br/> what problem is this please help while i m using the latest `facebook ios sdk` Please Help!!! | 0 |
11,372,928 | 07/07/2012 06:50:29 | 1,455,848 | 06/14/2012 09:33:18 | 30 | 4 | How to import .js files | Hi I am developing phonegap application. If I use console.log in index.html file then it prints, but If I use it in another file it doesn't print. If suppose I import files in index.html file like:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.1.0.css" />
<link rel="stylesheet" href="docs/assets/css/jqm-docs.css" />
<link rel="stylesheet" href="docsdemos-style-override.css" />
<script type="text/javascript" charset="utf-8" src="cordova-1.6.1.js"></script>
<script type="text/javascript" src="jquery.mobile/jquery-1.7.2.min"></script>
<script type="text/javascript" src="jquery.mobile/jqm.autoComplete-1.4.js"></script>
<script type="text/javascript" src="jquery.mobile/jquery.mobile-1.1.0.js"></script>
<script type="text/javascript">
console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
</script>
</head>
<body>
<div data-role="page" id="home" data-add-back-btn="true">
<div data-role="content" >
<a href="UI/Equity/test.html" data-role="button" id="myButton">index</a>
</div>
</div>
</body>
</html>
Then page display with button and print !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!. But on click of button it shows test.html file which is like:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.1.0.css" />
<link rel="stylesheet" href="docs/assets/css/jqm-docs.css" />
<link rel="stylesheet" href="docsdemos-style-override.css" />
<script type="text/javascript" charset="utf-8" src="cordova-1.6.1.js"></script>
<script type="text/javascript" src="jquery.mobile/jquery-1.7.2.min"></script>
<script type="text/javascript" src="jquery.mobile/jqm.autoComplete-1.4.js"></script>
<script type="text/javascript" src="jquery.mobile/jquery.mobile-1.1.0.js"></script>
<script type="text/javascript">
console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
</script>
</head>
<body>
<div data-role="page" id="home" data-add-back-btn="true">
<div data-role="content" >
<a href="#" data-role="button" id="myButton">Test</a>
</div>
</div>
</body>
</html>
But here it doesn't print @@@@@@@@@@@@@@@@@@@@@@@@@@@@ why is it so? | jquery | jquery-ui | jquery-mobile | phonegap | null | null | open | How to import .js files
===
Hi I am developing phonegap application. If I use console.log in index.html file then it prints, but If I use it in another file it doesn't print. If suppose I import files in index.html file like:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.1.0.css" />
<link rel="stylesheet" href="docs/assets/css/jqm-docs.css" />
<link rel="stylesheet" href="docsdemos-style-override.css" />
<script type="text/javascript" charset="utf-8" src="cordova-1.6.1.js"></script>
<script type="text/javascript" src="jquery.mobile/jquery-1.7.2.min"></script>
<script type="text/javascript" src="jquery.mobile/jqm.autoComplete-1.4.js"></script>
<script type="text/javascript" src="jquery.mobile/jquery.mobile-1.1.0.js"></script>
<script type="text/javascript">
console.log("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
</script>
</head>
<body>
<div data-role="page" id="home" data-add-back-btn="true">
<div data-role="content" >
<a href="UI/Equity/test.html" data-role="button" id="myButton">index</a>
</div>
</div>
</body>
</html>
Then page display with button and print !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!. But on click of button it shows test.html file which is like:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.1.0.css" />
<link rel="stylesheet" href="docs/assets/css/jqm-docs.css" />
<link rel="stylesheet" href="docsdemos-style-override.css" />
<script type="text/javascript" charset="utf-8" src="cordova-1.6.1.js"></script>
<script type="text/javascript" src="jquery.mobile/jquery-1.7.2.min"></script>
<script type="text/javascript" src="jquery.mobile/jqm.autoComplete-1.4.js"></script>
<script type="text/javascript" src="jquery.mobile/jquery.mobile-1.1.0.js"></script>
<script type="text/javascript">
console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
</script>
</head>
<body>
<div data-role="page" id="home" data-add-back-btn="true">
<div data-role="content" >
<a href="#" data-role="button" id="myButton">Test</a>
</div>
</div>
</body>
</html>
But here it doesn't print @@@@@@@@@@@@@@@@@@@@@@@@@@@@ why is it so? | 0 |
11,372,929 | 07/07/2012 06:50:36 | 372 | 08/05/2008 09:16:41 | 31,520 | 504 | How do I remove goBack events on UIButtons in UIPageViewControllers? | In an XCode project (iOS 5.1) where I have been using `UIPageViewController`, I noticed that when I tap on any button the automatic action is to send the `goBack`event and flip the page back to the previous index.
I am bewildered by this because checking on the responders for the `UIButton` they haven't been associated to the `goBack` event or any other event for that matter.
Any clues on how to remove this behavior? | ios | uibutton | uipageviewcontroller | null | null | null | open | How do I remove goBack events on UIButtons in UIPageViewControllers?
===
In an XCode project (iOS 5.1) where I have been using `UIPageViewController`, I noticed that when I tap on any button the automatic action is to send the `goBack`event and flip the page back to the previous index.
I am bewildered by this because checking on the responders for the `UIButton` they haven't been associated to the `goBack` event or any other event for that matter.
Any clues on how to remove this behavior? | 0 |
11,372,930 | 07/07/2012 06:50:37 | 1,262,318 | 03/11/2012 13:37:44 | 37 | 0 | How do I create a function common to all the pages in ASP.net? | I'm making a website that has a menu on all the pages that needs to be changed frequently. Right now I'm copying the code of the menu in all the pages, and so, if the menu needs to be changed, I have to open each page and change the menu there.
Is there any way by which I could define a function in a file somewhere that just writes the menu code using Response.Write() and then keep calling that function on all the pages that need the menu? That way whenever I'd need to make changes to the menu, I'll only make it in the function definition. | asp.net | function | menu | null | null | null | open | How do I create a function common to all the pages in ASP.net?
===
I'm making a website that has a menu on all the pages that needs to be changed frequently. Right now I'm copying the code of the menu in all the pages, and so, if the menu needs to be changed, I have to open each page and change the menu there.
Is there any way by which I could define a function in a file somewhere that just writes the menu code using Response.Write() and then keep calling that function on all the pages that need the menu? That way whenever I'd need to make changes to the menu, I'll only make it in the function definition. | 0 |
11,372,892 | 07/07/2012 06:42:12 | 1,190,837 | 02/05/2012 16:18:21 | 1 | 0 | How to write unit tests for functions with private fields in PHP | I have a class with private fields (class global variables) and private methods. Inside the constructor all fields are not initialized. Some of private fields are initialize inside some methods. I have already written some tests for private methods which not includes that private fields. But how could I write tests for the functions with private fields ?
I'm writing tests using PHPUnit framework. | testing | phpunit | private | null | null | null | open | How to write unit tests for functions with private fields in PHP
===
I have a class with private fields (class global variables) and private methods. Inside the constructor all fields are not initialized. Some of private fields are initialize inside some methods. I have already written some tests for private methods which not includes that private fields. But how could I write tests for the functions with private fields ?
I'm writing tests using PHPUnit framework. | 0 |
11,372,939 | 07/07/2012 06:52:11 | 892,849 | 08/13/2011 07:46:18 | 40 | 0 | malloc for string pointers - how it can be disastrous | In the following link http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=34, i read this :
using malloc() to create a non–POD object causes undefined behavior:
//disastrous!
std::string *pstr =(std::string*)malloc(sizeof(std::string));
I did not understand 2 points here :
- pointers are PODs then why here it is called non-POD(maybe I have to understand POD better)
- how can this be so disastrous(i have to understand string Internals for this).
Please explain me
Thanks | c++ | string | malloc | null | null | null | open | malloc for string pointers - how it can be disastrous
===
In the following link http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=34, i read this :
using malloc() to create a non–POD object causes undefined behavior:
//disastrous!
std::string *pstr =(std::string*)malloc(sizeof(std::string));
I did not understand 2 points here :
- pointers are PODs then why here it is called non-POD(maybe I have to understand POD better)
- how can this be so disastrous(i have to understand string Internals for this).
Please explain me
Thanks | 0 |
11,372,940 | 07/07/2012 06:52:18 | 1,508,369 | 07/07/2012 06:45:34 | 1 | 0 | Visualization of a given data set | The data set consists of tasks that extend over different time periods. The tasks consist of start time and end time. The goal is to find the tasks that are overlapping. I need a graphic visualization of the tasks such that they are plotted on a time-task(x-y) axis. Bar graphs and other things are not sufficient and do not satisfy my needs. Any suggestions as to what kind of an approach I should be doing would be of great help. Preferably C++ or Python. | c++ | python | graph | visualization | null | 07/07/2012 07:02:15 | not a real question | Visualization of a given data set
===
The data set consists of tasks that extend over different time periods. The tasks consist of start time and end time. The goal is to find the tasks that are overlapping. I need a graphic visualization of the tasks such that they are plotted on a time-task(x-y) axis. Bar graphs and other things are not sufficient and do not satisfy my needs. Any suggestions as to what kind of an approach I should be doing would be of great help. Preferably C++ or Python. | 1 |
11,372,941 | 07/07/2012 06:52:27 | 1,389,014 | 05/11/2012 08:50:58 | 78 | 0 | Using Nested Loop | Code for nested loop:
xquery version "1.0";
let $message := (1, 2)
for $s in $message
let $message1 := count($message)
for $i in ((1 to $message1))
return
<results>
<count>{$i}</count>
</results>
By using this nested for loop, i'm getting this sequence double. So how to get the result for single time by using Nested loop.
| for-loop | xquery | null | null | null | null | open | Using Nested Loop
===
Code for nested loop:
xquery version "1.0";
let $message := (1, 2)
for $s in $message
let $message1 := count($message)
for $i in ((1 to $message1))
return
<results>
<count>{$i}</count>
</results>
By using this nested for loop, i'm getting this sequence double. So how to get the result for single time by using Nested loop.
| 0 |
11,372,943 | 07/07/2012 06:52:45 | 806,106 | 06/20/2011 06:05:02 | 604 | 14 | Issue in calling Activity from the IntentService class | In my app i am using `IntentService` class to start another activity in the background. But the issue i got is that suppose from the `IntentService` class i start my activity, which open my activity, after that i don't close my activity. Then i notice that when IntentService class again want to start my same activity it is not called as the same activity is not close. So My question is how can i started the same activity again and again whether it is open or close from the `IntentService` class.
**Code in IntentService class**
public class AlarmService extends IntentService
{
public void onCreate()
{
super.onCreate();
}
public AlarmService()
{
super("MyAlarmService");
}
@Override
public int onStartCommand(Intent intent, int flags, int startId)
{
super.onStartCommand(intent, startId, startId);
return START_STICKY;
}
@Override
protected void onHandleIntent(Intent intent)
{
startActivity(new Intent(this, AlarmDialogActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
} | android | null | null | null | null | null | open | Issue in calling Activity from the IntentService class
===
In my app i am using `IntentService` class to start another activity in the background. But the issue i got is that suppose from the `IntentService` class i start my activity, which open my activity, after that i don't close my activity. Then i notice that when IntentService class again want to start my same activity it is not called as the same activity is not close. So My question is how can i started the same activity again and again whether it is open or close from the `IntentService` class.
**Code in IntentService class**
public class AlarmService extends IntentService
{
public void onCreate()
{
super.onCreate();
}
public AlarmService()
{
super("MyAlarmService");
}
@Override
public int onStartCommand(Intent intent, int flags, int startId)
{
super.onStartCommand(intent, startId, startId);
return START_STICKY;
}
@Override
protected void onHandleIntent(Intent intent)
{
startActivity(new Intent(this, AlarmDialogActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
}
} | 0 |
11,372,944 | 07/07/2012 06:52:52 | 1,063,545 | 11/24/2011 08:53:03 | 179 | 2 | Calculate time period list between 2 time in php? | I want to generate 3 time-period-list column between two times.
if
$start_time = '08:00 AM';'
$end_time = '10:00: PM';
Time Period List As:
Time-interval 30min [12:00 PM - 12:30 PM - 1:00 PM]
Morning ----- Noon ----- Eve
8:00 AM 1:00 PM 6:00 PM
... ... ...
to to to
... ... ...
12:00 PM 5:00 PM 10:00 PM
I have calculated times between
Thanks in advance to all my mates. | php | date | time | period | null | null | open | Calculate time period list between 2 time in php?
===
I want to generate 3 time-period-list column between two times.
if
$start_time = '08:00 AM';'
$end_time = '10:00: PM';
Time Period List As:
Time-interval 30min [12:00 PM - 12:30 PM - 1:00 PM]
Morning ----- Noon ----- Eve
8:00 AM 1:00 PM 6:00 PM
... ... ...
to to to
... ... ...
12:00 PM 5:00 PM 10:00 PM
I have calculated times between
Thanks in advance to all my mates. | 0 |
11,280,500 | 07/01/2012 08:15:32 | 1,447,048 | 06/10/2012 06:49:37 | 1 | 0 | ORA-02292 Constraint violation - child records found | parent entity is consits of many to may relation when ever i deleted the parent Id I give the excetion is ORA-02292 Constraint violation - child records found.
My Entity :
@Entity
@Table(name = "MOBEE_AGENCY")
public class MobeeAgency implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private Set<MobeeAgent> mobeeAgents = new HashSet<MobeeAgent>(0);
private Set<MobeeAgcyAccounts> mobeeAgcyAccountses = new HashSet<MobeeAgcyAccounts>(
0);
private Set<MobeeAgencyRegion> MobeeAgencyRegions = new HashSet<MobeeAgencyRegion>(0);
@Id
@GeneratedValue(generator = "MOBEE_AGENCY_SEQ")
@SequenceGenerator(name = "MOBEE_AGENCY_SEQ", sequenceName = "MOBEE_AGENCY_SEQ", allocationSize = 1)
@Column(name = "ID")
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
@OneToOne(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY)
@JoinColumn(name = "APP_ID")
public MobeeRegProcess getMobeeRegProcess() {
return this.mobeeRegProcess;
}
public void setMobeeRegProcess(MobeeRegProcess mobeeRegProcess) {
this.mobeeRegProcess = mobeeRegProcess;
}
@OneToMany(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, mappedBy = "mobeeAgency")
public Set<MobeeAgent> getMobeeAgents() {
return this.mobeeAgents;
}
public void setMobeeAgents(Set<MobeeAgent> mobeeAgents) {
this.mobeeAgents = mobeeAgents;
}
@OneToMany(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, mappedBy = "mobeeAgency")
public Set<MobeeAgcyAccounts> getMobeeAgcyAccountses() {
return this.mobeeAgcyAccountses;
}
public void setMobeeAgcyAccountses(
Set<MobeeAgcyAccounts> mobeeAgcyAccountses) {
this.mobeeAgcyAccountses = mobeeAgcyAccountses;
}
@OneToMany(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, mappedBy = "mobeeAgency")
public Set<MobeeAgencyRegion> getMobeeAgencyRegions() {
return MobeeAgencyRegions;
}
public void setMobeeAgencyRegions(Set<MobeeAgencyRegion> mobeeAgencyRegions) {
MobeeAgencyRegions = mobeeAgencyRegions;
}
}
Getting Exception Is:
> 13:29:56,226 INFO [STDOUT] [Mobee]- INFO 2012-07-01 13:29:56,225 []
> MobeeAgencyHome - deleting Records for the Agency 832859 13:29:56,251
> INFO [STDOUT] [Mobee]- WARN 2012-07-01 13:29:56,251 []
> JDBCExceptionReporter - SQL Error: 2292, SQLState: 23000 13:29:56,251
> INFO [STDOUT] [Mobee]-ERROR 2012-07-01 13:29:56,251 []
> JDBCExceptionReporter - ORA-02292: integrity constraint
> (KCBUSER.FK6B6B82ABC89B1A0C) violated - child record found
> 13:29:56,251 INFO [STDOUT] [Mobee]- WARN 2012-07-01 13:29:56,251 []
> JDBCExceptionReporter - SQL Error: 2292, SQLState: 23000 13:29:56,251
> INFO [STDOUT] [Mobee]-ERROR 2012-07-01 13:29:56,251 []
> JDBCExceptionReporter - ORA-02292: integrity constraint
> (KCBUSER.FK6B6B82ABC89B1A0C) violated - child record found
> 13:29:56,253 INFO [STDOUT] [Mobee]-ERROR 2012-07-01 13:29:56,251 []
> AbstractFlushingEventListener - Could not synchronize database state
> with session org.hibernate.exception.ConstraintViolationException:
> Could not execute JDBC batch update at
> org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
> at
> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at
> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
> at
> org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
> at
> org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
> at
> org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:222)
> at
> org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2479)
> at
> org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2697)
> at
> org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:74)
> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) at
> org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
> at
> org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:146)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
> at
> org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at
> org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:296)
> at
> org.jboss.seam.persistence.EntityManagerProxy.flush(EntityManagerProxy.java:92)
> at org.jboss.seam.framework.EntityHome.update(EntityHome.java:64) at
> com.manam.mobee.agency.MobeeAgencyHome.update(MobeeAgencyHome.java:2599)
> at
> com.manam.mobee.agency.MobeeAgencyHome.processUserDecision(MobeeAgencyHome.java:2465)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
> java.lang.reflect.Method.invoke(Unknown Source) at
> org.jboss.seam.util.Reflections.invoke(Reflections.java:22) at
> org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
> at
> org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:56)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
> at org.jboss.seam.util.Work.workInTransaction(Work.java:47) at
> org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
> at
> org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
> at
> org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
> at
> com.manam.mobee.agency.MobeeAgencyHome_$$_javassist_seam_15.processUserDecision(MobeeAgencyHome_$$_javassist_seam_15.java)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
> java.lang.reflect.Method.invoke(Unknown Source) at
> org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
> at
> org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
> at
> org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
> at
> org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
> at org.jboss.el.parser.AstValue.invoke(AstValue.java:96) at
> org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
> at
> com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
> at
> javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
> at
> com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
> at javax.faces.component.UICommand.broadcast(UICommand.java:383) at
> org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
> at
> org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324)
> at
> org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:299)
> at
> org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:256)
> at
> org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:469)
> at
> com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
> at
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:530) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
> at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
> at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
> at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
> at org.jboss.seam.web.RewriteFilter.process(RewriteFilter.java:98)
> at org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:57)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at
> org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at
> org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at
> org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
> at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
> at
> org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
> at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) at
> org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56) at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:
> 13:29:56,253 INFO [STDOUT] 158) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
> at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
> at java.lang.Thread.run(Unknown Source) Caused by:
> java.sql.BatchUpdateException: ORA-02292: integrity constraint
> (KCBUSER.FK6B6B82ABC89B1A0C) violated - child record found
| hibernate | jpa | seam | null | null | null | open | ORA-02292 Constraint violation - child records found
===
parent entity is consits of many to may relation when ever i deleted the parent Id I give the excetion is ORA-02292 Constraint violation - child records found.
My Entity :
@Entity
@Table(name = "MOBEE_AGENCY")
public class MobeeAgency implements java.io.Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private Set<MobeeAgent> mobeeAgents = new HashSet<MobeeAgent>(0);
private Set<MobeeAgcyAccounts> mobeeAgcyAccountses = new HashSet<MobeeAgcyAccounts>(
0);
private Set<MobeeAgencyRegion> MobeeAgencyRegions = new HashSet<MobeeAgencyRegion>(0);
@Id
@GeneratedValue(generator = "MOBEE_AGENCY_SEQ")
@SequenceGenerator(name = "MOBEE_AGENCY_SEQ", sequenceName = "MOBEE_AGENCY_SEQ", allocationSize = 1)
@Column(name = "ID")
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
@OneToOne(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY)
@JoinColumn(name = "APP_ID")
public MobeeRegProcess getMobeeRegProcess() {
return this.mobeeRegProcess;
}
public void setMobeeRegProcess(MobeeRegProcess mobeeRegProcess) {
this.mobeeRegProcess = mobeeRegProcess;
}
@OneToMany(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, mappedBy = "mobeeAgency")
public Set<MobeeAgent> getMobeeAgents() {
return this.mobeeAgents;
}
public void setMobeeAgents(Set<MobeeAgent> mobeeAgents) {
this.mobeeAgents = mobeeAgents;
}
@OneToMany(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, mappedBy = "mobeeAgency")
public Set<MobeeAgcyAccounts> getMobeeAgcyAccountses() {
return this.mobeeAgcyAccountses;
}
public void setMobeeAgcyAccountses(
Set<MobeeAgcyAccounts> mobeeAgcyAccountses) {
this.mobeeAgcyAccountses = mobeeAgcyAccountses;
}
@OneToMany(cascade = { CascadeType.PERSIST, CascadeType.REMOVE }, fetch = FetchType.LAZY, mappedBy = "mobeeAgency")
public Set<MobeeAgencyRegion> getMobeeAgencyRegions() {
return MobeeAgencyRegions;
}
public void setMobeeAgencyRegions(Set<MobeeAgencyRegion> mobeeAgencyRegions) {
MobeeAgencyRegions = mobeeAgencyRegions;
}
}
Getting Exception Is:
> 13:29:56,226 INFO [STDOUT] [Mobee]- INFO 2012-07-01 13:29:56,225 []
> MobeeAgencyHome - deleting Records for the Agency 832859 13:29:56,251
> INFO [STDOUT] [Mobee]- WARN 2012-07-01 13:29:56,251 []
> JDBCExceptionReporter - SQL Error: 2292, SQLState: 23000 13:29:56,251
> INFO [STDOUT] [Mobee]-ERROR 2012-07-01 13:29:56,251 []
> JDBCExceptionReporter - ORA-02292: integrity constraint
> (KCBUSER.FK6B6B82ABC89B1A0C) violated - child record found
> 13:29:56,251 INFO [STDOUT] [Mobee]- WARN 2012-07-01 13:29:56,251 []
> JDBCExceptionReporter - SQL Error: 2292, SQLState: 23000 13:29:56,251
> INFO [STDOUT] [Mobee]-ERROR 2012-07-01 13:29:56,251 []
> JDBCExceptionReporter - ORA-02292: integrity constraint
> (KCBUSER.FK6B6B82ABC89B1A0C) violated - child record found
> 13:29:56,253 INFO [STDOUT] [Mobee]-ERROR 2012-07-01 13:29:56,251 []
> AbstractFlushingEventListener - Could not synchronize database state
> with session org.hibernate.exception.ConstraintViolationException:
> Could not execute JDBC batch update at
> org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
> at
> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at
> org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
> at
> org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
> at
> org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
> at
> org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:222)
> at
> org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2479)
> at
> org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2697)
> at
> org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:74)
> at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) at
> org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
> at
> org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:146)
> at
> org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
> at
> org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
> at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at
> org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:296)
> at
> org.jboss.seam.persistence.EntityManagerProxy.flush(EntityManagerProxy.java:92)
> at org.jboss.seam.framework.EntityHome.update(EntityHome.java:64) at
> com.manam.mobee.agency.MobeeAgencyHome.update(MobeeAgencyHome.java:2599)
> at
> com.manam.mobee.agency.MobeeAgencyHome.processUserDecision(MobeeAgencyHome.java:2465)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
> java.lang.reflect.Method.invoke(Unknown Source) at
> org.jboss.seam.util.Reflections.invoke(Reflections.java:22) at
> org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
> at
> org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:56)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
> at org.jboss.seam.util.Work.workInTransaction(Work.java:47) at
> org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:163)
> at
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> at
> org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
> at
> org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
> at
> org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
> at
> com.manam.mobee.agency.MobeeAgencyHome_$$_javassist_seam_15.processUserDecision(MobeeAgencyHome_$$_javassist_seam_15.java)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
> java.lang.reflect.Method.invoke(Unknown Source) at
> org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
> at
> org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
> at
> org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
> at
> org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
> at org.jboss.el.parser.AstValue.invoke(AstValue.java:96) at
> org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
> at
> com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
> at
> javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
> at
> com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
> at javax.faces.component.UICommand.broadcast(UICommand.java:383) at
> org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
> at
> org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:324)
> at
> org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:299)
> at
> org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:256)
> at
> org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:469)
> at
> com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
> at
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
> at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:530) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
> at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
> at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:379)
> at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
> at org.jboss.seam.web.RewriteFilter.process(RewriteFilter.java:98)
> at org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:57)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at
> org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at
> org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at
> org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
> at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
> at
> org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
> at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) at
> org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56) at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
> at
> org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
> at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:
> 13:29:56,253 INFO [STDOUT] 158) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
> at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> at
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
> at java.lang.Thread.run(Unknown Source) Caused by:
> java.sql.BatchUpdateException: ORA-02292: integrity constraint
> (KCBUSER.FK6B6B82ABC89B1A0C) violated - child record found
| 0 |
11,280,506 | 07/01/2012 08:17:02 | 841,830 | 07/13/2011 01:24:29 | 1,287 | 56 | How to mock built-in php socket functions? | I'm working on some code that reads from a socket, and it goes wrong when it gets a certain large input. I went to add a unit test for this, before fixing it, but got stuck because I cannot mock `fread` (and the other PHP built-in functions I'm using such as `fsockopen`, `feof`, etc.).
In simple terms my problem is that this code fails with "*Fatal error: Cannot redeclare fgets() ...*":
function fgets($fp){
return "xxx";
}
I realize I could create a socket wrapper class, that my real code uses, and then I could create a mock object for that wrapper class. But that is The Tail Wagging The Dog, and I can think of reasons it is a bad idea, beyond just the principle of the thing. (E.g. Making code more complex, efficiency, having to refactor code not under test yet.)
So, my question is how can I replace the built-in `fgets()` implementation with my own, within a unit test? (Or, if you want to think outside the box, the question can be phrased as: how can I control the string that a call to `fgets($socket)` returns, when `$socket` is the return value from a call to `fsockopen`?)
| php | sockets | mocking | phpunit | null | null | open | How to mock built-in php socket functions?
===
I'm working on some code that reads from a socket, and it goes wrong when it gets a certain large input. I went to add a unit test for this, before fixing it, but got stuck because I cannot mock `fread` (and the other PHP built-in functions I'm using such as `fsockopen`, `feof`, etc.).
In simple terms my problem is that this code fails with "*Fatal error: Cannot redeclare fgets() ...*":
function fgets($fp){
return "xxx";
}
I realize I could create a socket wrapper class, that my real code uses, and then I could create a mock object for that wrapper class. But that is The Tail Wagging The Dog, and I can think of reasons it is a bad idea, beyond just the principle of the thing. (E.g. Making code more complex, efficiency, having to refactor code not under test yet.)
So, my question is how can I replace the built-in `fgets()` implementation with my own, within a unit test? (Or, if you want to think outside the box, the question can be phrased as: how can I control the string that a call to `fgets($socket)` returns, when `$socket` is the return value from a call to `fsockopen`?)
| 0 |
11,280,516 | 07/01/2012 08:19:38 | 138,627 | 07/15/2009 10:24:43 | 1,414 | 27 | DropShadow effect on pie chart | I want to do a pie chart with a DropShadow effect, so i've tried to put the effect on the PieDataPoint object but it didn't work - instead of heaving a shadow of the pie every slice of the pie draw its own shadow on its neighbors, as you can see in the image below:
![enter image description here][1]
[1]: http://i.stack.imgur.com/Ut70c.png | wpf | toolkit | null | null | null | null | open | DropShadow effect on pie chart
===
I want to do a pie chart with a DropShadow effect, so i've tried to put the effect on the PieDataPoint object but it didn't work - instead of heaving a shadow of the pie every slice of the pie draw its own shadow on its neighbors, as you can see in the image below:
![enter image description here][1]
[1]: http://i.stack.imgur.com/Ut70c.png | 0 |
11,280,520 | 07/01/2012 08:20:44 | 668,122 | 03/20/2011 10:42:25 | 144 | 1 | How do I display data in asp.net that has follows a specific pattern/ format? | I have this table ![enter image description here][1]
and what I want to is have something like this on the browser. ![enter image description here][2]
[1]: http://i.stack.imgur.com/jSO9C.png
[2]: http://i.stack.imgur.com/ucTsQ.jpg
The table has 8 rows and 3 columns
Here's my sql query: "SELECT q.QuestionID, q.QuestionText, q.GroupNo FROM question q ORDER BY GroupNo asc"
I have already stored the questions but I'm having a hard time printing it in this format.
Wherein after printing 4 questions it will then go to another cell and print 4 questions again and then once there are already 3 columns it will then create a new row and do the same step again.
[ In the database the 1st 4 questions are QuestionID1,2,3,4 and then the cell on it's right are 6,7,8,9 and so on....]
I want to display the questions in this pattern.
I'm stuck with this for almost two days already.... I tried looking for other solutions online but I wasn't able to find something that is quite similar with what I'm trying to accomplish. I'm trying to do it with either datalist or a repeater. If you could provide a solution that uses both and would be of really++ great help
Sir/Ma'am your answers would be of great help. Thank you++
| asp.net | repeater | datalist | asp.net-controls | null | null | open | How do I display data in asp.net that has follows a specific pattern/ format?
===
I have this table ![enter image description here][1]
and what I want to is have something like this on the browser. ![enter image description here][2]
[1]: http://i.stack.imgur.com/jSO9C.png
[2]: http://i.stack.imgur.com/ucTsQ.jpg
The table has 8 rows and 3 columns
Here's my sql query: "SELECT q.QuestionID, q.QuestionText, q.GroupNo FROM question q ORDER BY GroupNo asc"
I have already stored the questions but I'm having a hard time printing it in this format.
Wherein after printing 4 questions it will then go to another cell and print 4 questions again and then once there are already 3 columns it will then create a new row and do the same step again.
[ In the database the 1st 4 questions are QuestionID1,2,3,4 and then the cell on it's right are 6,7,8,9 and so on....]
I want to display the questions in this pattern.
I'm stuck with this for almost two days already.... I tried looking for other solutions online but I wasn't able to find something that is quite similar with what I'm trying to accomplish. I'm trying to do it with either datalist or a repeater. If you could provide a solution that uses both and would be of really++ great help
Sir/Ma'am your answers would be of great help. Thank you++
| 0 |
11,280,523 | 07/01/2012 08:21:12 | 1,491,340 | 06/29/2012 13:55:25 | 1 | 0 | C, reading from file into structure | I've been struggling with this for days and i can't figure out why it doesn't work.
I'm trying to read numbers from file with numbers written like this:
0 2012 1 1 2000.000000
0 2012 1 1 3000.000000
1 2012 1 1 4500.000000
my structure:
struct element{
int id;
int sign;
int year;
int month;
double amount;
struct element *next;
};
struct queue{
struct element *head;
struct element *tail;
struct element *head2;
struct element *temp;
struct element *temph;
int size;
};
> (head2, temp and temph are used in sorting structure)
and reading from a file:
void read_str(struct queue *queue){
FILE *reads;
char filename[40];
int temp;
printf("Type in name of the file\n");
scanf("%s",&filename);
reads=fopen(filename, "r");
if (reads==NULL) {
perror("Error");
return 1;
}
else { while(!feof(reads)) {
struct element *n= (struct element*)malloc(sizeof(struct element));
fscanf(reads,"%d %d %d %d %lf", n->id, n->sign, n->year, n->month, n->amount);
n->next=NULL;
if(queue->head ==NULL){
queue->head=n;}
else{
queue->tail->next=n;
}
queue->tail=n;
queue->size++;
}
}
}
I can change the way the data looks in a file by changing the function that writes it, but I don't think that's the problem. My guess i'm using `malloc`in a wrong way.
| c | file | structure | null | null | null | open | C, reading from file into structure
===
I've been struggling with this for days and i can't figure out why it doesn't work.
I'm trying to read numbers from file with numbers written like this:
0 2012 1 1 2000.000000
0 2012 1 1 3000.000000
1 2012 1 1 4500.000000
my structure:
struct element{
int id;
int sign;
int year;
int month;
double amount;
struct element *next;
};
struct queue{
struct element *head;
struct element *tail;
struct element *head2;
struct element *temp;
struct element *temph;
int size;
};
> (head2, temp and temph are used in sorting structure)
and reading from a file:
void read_str(struct queue *queue){
FILE *reads;
char filename[40];
int temp;
printf("Type in name of the file\n");
scanf("%s",&filename);
reads=fopen(filename, "r");
if (reads==NULL) {
perror("Error");
return 1;
}
else { while(!feof(reads)) {
struct element *n= (struct element*)malloc(sizeof(struct element));
fscanf(reads,"%d %d %d %d %lf", n->id, n->sign, n->year, n->month, n->amount);
n->next=NULL;
if(queue->head ==NULL){
queue->head=n;}
else{
queue->tail->next=n;
}
queue->tail=n;
queue->size++;
}
}
}
I can change the way the data looks in a file by changing the function that writes it, but I don't think that's the problem. My guess i'm using `malloc`in a wrong way.
| 0 |
11,280,526 | 07/01/2012 08:21:32 | 525,717 | 11/30/2010 20:58:22 | 15 | 0 | Reading web page source c/c++ windows | i have c++ application which reads page source
HINTERNET hInternet = InternetOpenA("InetURL/1.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
HINTERNET hConnection = InternetConnectA( hInternet, "ngg-l.com/Servers/getservers", 80, " "," ", INTERNET_SERVICE_HTTP, 0, 0 );
HINTERNET hData = HttpOpenRequestA( hConnection, "GET", "/", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0 );
char buf[ 2048 ] ;
HttpSendRequestA( hData, NULL, 0, NULL, 0 ) ;
DWORD bytesRead = 0 ;
DWORD totalBytesRead = 0 ;
while( InternetReadFile( hData, buf, 2000, &bytesRead ) && bytesRead != 0 )
{
buf[ bytesRead ] = 0 ; // insert the null terminator.
puts( buf ) ; // print it to the screen.
printf( "%d bytes read\n", bytesRead ) ;
totalBytesRead += bytesRead ;
}
printf( "\n\n END -- %d bytes read\n", bytesRead ) ;
printf( "\n\n END -- %d TOTAL bytes read\n", totalBytesRead ) ;
InternetCloseHandle( hData ) ;
InternetCloseHandle( hConnection ) ;
InternetCloseHandle( hInternet ) ;
This code works good ong ngg-l.com but when trying to get source ngg-l.com/servers
it returns null
Thanks | c++ | c | xml | windows | null | null | open | Reading web page source c/c++ windows
===
i have c++ application which reads page source
HINTERNET hInternet = InternetOpenA("InetURL/1.0", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
HINTERNET hConnection = InternetConnectA( hInternet, "ngg-l.com/Servers/getservers", 80, " "," ", INTERNET_SERVICE_HTTP, 0, 0 );
HINTERNET hData = HttpOpenRequestA( hConnection, "GET", "/", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0 );
char buf[ 2048 ] ;
HttpSendRequestA( hData, NULL, 0, NULL, 0 ) ;
DWORD bytesRead = 0 ;
DWORD totalBytesRead = 0 ;
while( InternetReadFile( hData, buf, 2000, &bytesRead ) && bytesRead != 0 )
{
buf[ bytesRead ] = 0 ; // insert the null terminator.
puts( buf ) ; // print it to the screen.
printf( "%d bytes read\n", bytesRead ) ;
totalBytesRead += bytesRead ;
}
printf( "\n\n END -- %d bytes read\n", bytesRead ) ;
printf( "\n\n END -- %d TOTAL bytes read\n", totalBytesRead ) ;
InternetCloseHandle( hData ) ;
InternetCloseHandle( hConnection ) ;
InternetCloseHandle( hInternet ) ;
This code works good ong ngg-l.com but when trying to get source ngg-l.com/servers
it returns null
Thanks | 0 |
11,298,459 | 07/02/2012 17:35:52 | 1,496,733 | 07/02/2012 17:30:33 | 1 | 0 | Records missing during select | I am using the following JPQL query to fetch and sort records based on SSN. In DB 7 of them has ssn and 4 does not have ssn. The first time I see all the 11 records being returned but when the query runs again, I see only 7 records, the records that had the case set to 0 and not the ones set to 1. Any help is much appreciated.
"SELECT qd, CASE WHEN qd.ssn IS NULL THEN 1 ELSE 0 END as nullssn FROM UiQtrlyRptUnitDtl qd WHERE qd.emprAcctId = :emprAcctId AND qd.ccyyqId IN (:ccyyqList) ORDER BY nullssn desc, qd.ssn, qd.lastNa, qd.firstNa"
I am using OpenJPA with JPA 2.0 and Websphere. | jpa | jpa-2.0 | null | null | null | null | open | Records missing during select
===
I am using the following JPQL query to fetch and sort records based on SSN. In DB 7 of them has ssn and 4 does not have ssn. The first time I see all the 11 records being returned but when the query runs again, I see only 7 records, the records that had the case set to 0 and not the ones set to 1. Any help is much appreciated.
"SELECT qd, CASE WHEN qd.ssn IS NULL THEN 1 ELSE 0 END as nullssn FROM UiQtrlyRptUnitDtl qd WHERE qd.emprAcctId = :emprAcctId AND qd.ccyyqId IN (:ccyyqList) ORDER BY nullssn desc, qd.ssn, qd.lastNa, qd.firstNa"
I am using OpenJPA with JPA 2.0 and Websphere. | 0 |
11,298,466 | 07/02/2012 17:36:18 | 1,036,125 | 11/08/2011 17:24:52 | 50 | 0 | Join operation on EntityQuery with Datacontext? | For IQueryable<T>, you can do a join. But you could not do it on EntityQuery. So if I want to do a joint in silverlight for the client side with DataContext, how do I do it? DataContext queries only return an EntityQuery in silverlight. I tried to use EntityQuery.Query to get it to IQueryable then Join. Why will it not work? | .net | wpf | silverlight | linq | entity-framework | null | open | Join operation on EntityQuery with Datacontext?
===
For IQueryable<T>, you can do a join. But you could not do it on EntityQuery. So if I want to do a joint in silverlight for the client side with DataContext, how do I do it? DataContext queries only return an EntityQuery in silverlight. I tried to use EntityQuery.Query to get it to IQueryable then Join. Why will it not work? | 0 |
11,298,472 | 07/02/2012 17:36:46 | 1,398,455 | 05/16/2012 11:07:12 | 38 | 5 | How to extract background-url from css definition with scrapy | How can I extract (with scrapy) `image_1.png` from something like this:
<html><body>
<style type="text/css">
img.article_image[class]
{
background-image:url('/article_images/image_1.png');
}
</style>
<img class="article_image">
</body></html>
The only idea that comes to my mind is to regexp the source html code, is there anything more elegant? | python-2.7 | scrapy | null | null | null | null | open | How to extract background-url from css definition with scrapy
===
How can I extract (with scrapy) `image_1.png` from something like this:
<html><body>
<style type="text/css">
img.article_image[class]
{
background-image:url('/article_images/image_1.png');
}
</style>
<img class="article_image">
</body></html>
The only idea that comes to my mind is to regexp the source html code, is there anything more elegant? | 0 |
11,298,473 | 07/02/2012 17:36:49 | 709,811 | 04/15/2011 12:41:02 | 1 | 0 | Change TableView Header Text Color | I would like to make a simple change in my tableView. I have a custom table view background and I would like to change the Header and Footer TEXT color,
**ONLY the text color.**
I've seen on internet that usually we must use the delegate method to give to the table view an entire new view but I would ONLY to change the text color (and, if possibile, the shadow)...
Is there a simple way to do this **avoiding create a new entire view**?
Please help me.
Thank you | iphone | ios | cocoa-touch | null | null | null | open | Change TableView Header Text Color
===
I would like to make a simple change in my tableView. I have a custom table view background and I would like to change the Header and Footer TEXT color,
**ONLY the text color.**
I've seen on internet that usually we must use the delegate method to give to the table view an entire new view but I would ONLY to change the text color (and, if possibile, the shadow)...
Is there a simple way to do this **avoiding create a new entire view**?
Please help me.
Thank you | 0 |
11,298,474 | 07/02/2012 17:36:53 | 406,421 | 07/30/2010 04:51:12 | 64 | 0 | width="" and "height"" on img messing their visibility | Why do I need to specify the width="" and height="" of the images on this page to make it appear correctly? The images in this list that don't specify their dims aren't visible. Can I make it so that I don't need to specify?
Thanks!
http://www.rollinleonard.com/elements/index-new.php | javascript | html | css | width | img | null | open | width="" and "height"" on img messing their visibility
===
Why do I need to specify the width="" and height="" of the images on this page to make it appear correctly? The images in this list that don't specify their dims aren't visible. Can I make it so that I don't need to specify?
Thanks!
http://www.rollinleonard.com/elements/index-new.php | 0 |
11,298,475 | 07/02/2012 17:36:55 | 1,121,315 | 12/29/2011 14:05:43 | 111 | 1 | Wordpress - Modifying Multiple User Profiles on the Front End | Stackoverflowians,
I have created a site that allows users to register themselves for a golf tournament. One of the features I wanted to create is a "CREATE-A-FOURSOME" feature that lists all of the users that have registered on the site into four select boxes. You simply give your foursome a name (for ID purposes), select the four golfers on your team, click submit and voila.
I've managed to create the select box list of all the users who have NOT been entered into foursomes along with a simple text input for the foursome name.
I'm employing the use of the Wordpress Plugin, WP-Members to allow me to add a custom user field "foursome". With that, I have created a for loop that first looks for the user list, check if there is anything in the "foursome" field, if no, then adds the last name, first name to the option list.
My problem now is how do I properly submit this HTML form back into each user's profile so that the "foursome" field is now populated with the foursome name text?
Thanks in advance.
P.S. the "foursome" field actually shows up in the wp_usermeta
----------
table | php | mysql | database | forms | wordpress | null | open | Wordpress - Modifying Multiple User Profiles on the Front End
===
Stackoverflowians,
I have created a site that allows users to register themselves for a golf tournament. One of the features I wanted to create is a "CREATE-A-FOURSOME" feature that lists all of the users that have registered on the site into four select boxes. You simply give your foursome a name (for ID purposes), select the four golfers on your team, click submit and voila.
I've managed to create the select box list of all the users who have NOT been entered into foursomes along with a simple text input for the foursome name.
I'm employing the use of the Wordpress Plugin, WP-Members to allow me to add a custom user field "foursome". With that, I have created a for loop that first looks for the user list, check if there is anything in the "foursome" field, if no, then adds the last name, first name to the option list.
My problem now is how do I properly submit this HTML form back into each user's profile so that the "foursome" field is now populated with the foursome name text?
Thanks in advance.
P.S. the "foursome" field actually shows up in the wp_usermeta
----------
table | 0 |
11,298,455 | 07/02/2012 17:35:36 | 791,713 | 06/09/2011 20:57:13 | 753 | 80 | make wildcard targets | Not much to say.
%.o: %.c
@echo $<
<span/>
C:\Users\niklas\Desktop>make foo.o
make: *** No rule to create »foo.o«. End.
I expect it to print `foo.c`. Why doesn't it work?
*Note: The last line of the last block is translated from german to english, the spelling might not be exactly as the english version prints out.*
<hr>
**Platform**: Windows 7
**Architecture**: x86
**Make Version**: gnuwin32 3.81 (*25. Nov 2006*)
| windows | compilation | makefile | make | null | null | open | make wildcard targets
===
Not much to say.
%.o: %.c
@echo $<
<span/>
C:\Users\niklas\Desktop>make foo.o
make: *** No rule to create »foo.o«. End.
I expect it to print `foo.c`. Why doesn't it work?
*Note: The last line of the last block is translated from german to english, the spelling might not be exactly as the english version prints out.*
<hr>
**Platform**: Windows 7
**Architecture**: x86
**Make Version**: gnuwin32 3.81 (*25. Nov 2006*)
| 0 |
11,298,456 | 07/02/2012 17:35:40 | 1,224,036 | 02/21/2012 18:06:02 | 1 | 0 | How to generate Excel sheet from drl file | I was looking for drools api to generate excel sheet from drl file, is this possible? if yes please can someone point me at the API's?
Thanks for the help in advance. | drools | null | null | null | null | null | open | How to generate Excel sheet from drl file
===
I was looking for drools api to generate excel sheet from drl file, is this possible? if yes please can someone point me at the API's?
Thanks for the help in advance. | 0 |
11,298,458 | 07/02/2012 17:35:52 | 1,488,120 | 06/28/2012 09:42:04 | 1 | 0 | How to hide a custom field in wordpress | I m working on my website and I'm trying to get custom fields to work. I have a page with some custom fields added. When I add this php code
<?php the_meta ?>
to my single.php file, a custom field 'WP-Prosper' automatically displayed to my post with its value like this.
WP-Prosper: a:2:{s:12:"remove_thumb";s:0:"";s:11:"video_embed";s:0:"";}
File Type: .IPA
I didn't give any value to this custom field. How can I remove it from my custom field section? | wordpress | field | null | null | null | null | open | How to hide a custom field in wordpress
===
I m working on my website and I'm trying to get custom fields to work. I have a page with some custom fields added. When I add this php code
<?php the_meta ?>
to my single.php file, a custom field 'WP-Prosper' automatically displayed to my post with its value like this.
WP-Prosper: a:2:{s:12:"remove_thumb";s:0:"";s:11:"video_embed";s:0:"";}
File Type: .IPA
I didn't give any value to this custom field. How can I remove it from my custom field section? | 0 |
11,327,638 | 07/04/2012 10:52:22 | 1,267,728 | 03/13/2012 23:26:07 | 22 | 2 | Printing char[] core dump C | I'm Trying to do:
printf("Provider: %s\n", Props->providerName);
where struct member:
char providerName[256];
causes core dump with:
Program terminated with signal 11, Segmentation fault.
[New process 73950 ]
#0 0xfee22290 in strlen () from /lib/libc.so.1
I guess the char[] might not be null terminated, but what is the best solution?
Cheers!
| c | char | printf | coredump | null | null | open | Printing char[] core dump C
===
I'm Trying to do:
printf("Provider: %s\n", Props->providerName);
where struct member:
char providerName[256];
causes core dump with:
Program terminated with signal 11, Segmentation fault.
[New process 73950 ]
#0 0xfee22290 in strlen () from /lib/libc.so.1
I guess the char[] might not be null terminated, but what is the best solution?
Cheers!
| 0 |
11,327,628 | 07/04/2012 10:51:51 | 1,501,216 | 07/04/2012 09:57:49 | 1 | 0 | JS newbie: how to execute part of the HTML after clicking on a button | I am fairly new to JS and jQuery and I am stuck with this.
I am doing an ecommerce and I have a page showing the details of a product.
I have a **carousel of thumbnail**. If you click on the thumbnail, the main image gets substituted with the selected one.
Then, in another portion of the page, I have some little **color boxes**: if you select one of them (e.g. Red), the list of thumbnails gets filtered and shows only the Red thumbnails. This is done via a custom script that matches the class value of the color boxes to the class value of the thumbnail images.
What I am struggling with is trying to show the bigger image of the selected color too.
The correct use case would be:
1. User opens product page
2. The big image viewer shows the Big image, e.g. a photo of
the Red version (corresponding to the first thumbnail in the
carousel) - this is OK
3. Carousel shows 5 thumbnails, 3 corresponding to the Red version of the product, 2 to the yellow one - this is OK
4. user plays with the carousel: a click on a thumbnail triggers the
corresponding big image - this is OK
5. User decides to filter by colour and clicks on the Yellow little color box - this is OK
6. Carousel gets filtered and shows only the thumbnail of the yellow version of the product - this is OK
7. At the same time as 5. the big image corresponding to the first thumbnail in the filtered list
shoud be triggered and should pop up in the big image viewer - this is what I am struggling with.
Here's the **code of the big image viewer + carousel**:
<div id="product">
<!-- BIG IMAGE VIEWER - The first that gets loaded is the first big image corresponding to the first thumbnail -->
<div id="productimg"><a href="full_size_red_01.jpg" class="cloud-zoom" id="zoom1" rel="position: 'inside', showTitle: false"><img src="big-red_01.jpg" alt="" title="M1" /></a></div>
<!-- END BIG IMAGE VIEWER -->
<div id="productdet">
<!-- THUMBNAILS CAROUSEL -->
<ul id="mycarousel" class="jcarousel-skin-tango">
<li><a href='full_size_red_01.jpg' class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: 'big_red_01.jpg' " title='M1'><img src="thumb_red_01.jpg" alt="M1" class="Rosso/Red" /></a></li>
<li><a href='full_size_red_02.jpg' class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: 'big_red_02.jpg' " title='M1'><img src="thumb_red_02.jpg" alt="M1" class="Rosso/Red" /></a></li>
<li><a href='full_size_red_03.jpg' class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: 'big_red_03.jpg' " title='M1'><img src="thumb_red_03.jpg" alt="M1" class="Rosso/Red" /></a></li>
<li><a href='full_size_yellow_01.jpg' class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: 'big_yellow_01.jpg' " title='M1'><img src="thumb_yellow_01.jpg" alt="M1" class="Rosso/Red" /></a></li>
<li><a href='full_size_yellow_02.jpg' class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: 'big_yellow_02.jpg' " title='M1'><img src="thumb_yellow_02.jpg" alt="M1" class="Rosso/Red" /></a></li>
</ul>
<!-- END THUMBNAILS CAROUSEL -->
</div>
And here's the code of the **color selection tool**:
<div class="controls color">
<label class="Rosso/Red"><input type="radio" name="modifiers[1]" value="1" /> Rosso/Red</label>
<label class="Giallo/Yellow"><input type="radio" name="modifiers[1]" value="2" /> Giallo/Yellow</label>
</div>
</div>
Any help would be much appreciated.
Thank you!! | javascript | jquery | null | null | null | null | open | JS newbie: how to execute part of the HTML after clicking on a button
===
I am fairly new to JS and jQuery and I am stuck with this.
I am doing an ecommerce and I have a page showing the details of a product.
I have a **carousel of thumbnail**. If you click on the thumbnail, the main image gets substituted with the selected one.
Then, in another portion of the page, I have some little **color boxes**: if you select one of them (e.g. Red), the list of thumbnails gets filtered and shows only the Red thumbnails. This is done via a custom script that matches the class value of the color boxes to the class value of the thumbnail images.
What I am struggling with is trying to show the bigger image of the selected color too.
The correct use case would be:
1. User opens product page
2. The big image viewer shows the Big image, e.g. a photo of
the Red version (corresponding to the first thumbnail in the
carousel) - this is OK
3. Carousel shows 5 thumbnails, 3 corresponding to the Red version of the product, 2 to the yellow one - this is OK
4. user plays with the carousel: a click on a thumbnail triggers the
corresponding big image - this is OK
5. User decides to filter by colour and clicks on the Yellow little color box - this is OK
6. Carousel gets filtered and shows only the thumbnail of the yellow version of the product - this is OK
7. At the same time as 5. the big image corresponding to the first thumbnail in the filtered list
shoud be triggered and should pop up in the big image viewer - this is what I am struggling with.
Here's the **code of the big image viewer + carousel**:
<div id="product">
<!-- BIG IMAGE VIEWER - The first that gets loaded is the first big image corresponding to the first thumbnail -->
<div id="productimg"><a href="full_size_red_01.jpg" class="cloud-zoom" id="zoom1" rel="position: 'inside', showTitle: false"><img src="big-red_01.jpg" alt="" title="M1" /></a></div>
<!-- END BIG IMAGE VIEWER -->
<div id="productdet">
<!-- THUMBNAILS CAROUSEL -->
<ul id="mycarousel" class="jcarousel-skin-tango">
<li><a href='full_size_red_01.jpg' class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: 'big_red_01.jpg' " title='M1'><img src="thumb_red_01.jpg" alt="M1" class="Rosso/Red" /></a></li>
<li><a href='full_size_red_02.jpg' class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: 'big_red_02.jpg' " title='M1'><img src="thumb_red_02.jpg" alt="M1" class="Rosso/Red" /></a></li>
<li><a href='full_size_red_03.jpg' class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: 'big_red_03.jpg' " title='M1'><img src="thumb_red_03.jpg" alt="M1" class="Rosso/Red" /></a></li>
<li><a href='full_size_yellow_01.jpg' class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: 'big_yellow_01.jpg' " title='M1'><img src="thumb_yellow_01.jpg" alt="M1" class="Rosso/Red" /></a></li>
<li><a href='full_size_yellow_02.jpg' class='cloud-zoom-gallery' rel="useZoom: 'zoom1', smallImage: 'big_yellow_02.jpg' " title='M1'><img src="thumb_yellow_02.jpg" alt="M1" class="Rosso/Red" /></a></li>
</ul>
<!-- END THUMBNAILS CAROUSEL -->
</div>
And here's the code of the **color selection tool**:
<div class="controls color">
<label class="Rosso/Red"><input type="radio" name="modifiers[1]" value="1" /> Rosso/Red</label>
<label class="Giallo/Yellow"><input type="radio" name="modifiers[1]" value="2" /> Giallo/Yellow</label>
</div>
</div>
Any help would be much appreciated.
Thank you!! | 0 |
11,327,631 | 07/04/2012 10:51:56 | 1,393,581 | 05/14/2012 11:12:12 | 5 | 0 | Remove jsessionid from URL | I'm working on a project with the following technologies
- Spring
- ShiroFilter
- PrettyFaces
- Tomcat server
While i'm deploying it on tomcat server, I'm getting a "JSESSIONID 456jghd787aa" added at the end of the URL.
I was trying to resolve this but i'm not able.Please help | spring | tomcat6 | shiro | prettyfaces | null | null | open | Remove jsessionid from URL
===
I'm working on a project with the following technologies
- Spring
- ShiroFilter
- PrettyFaces
- Tomcat server
While i'm deploying it on tomcat server, I'm getting a "JSESSIONID 456jghd787aa" added at the end of the URL.
I was trying to resolve this but i'm not able.Please help | 0 |
11,325,975 | 07/04/2012 09:11:53 | 1,497,840 | 07/03/2012 06:02:08 | 1 | 1 | Using .NET 3.5 Assambly with APS 2.0 | I inherited some .NET projects from a collegue who left our company a while ago. One of them is a web portal on ASP.NET (with 2.0 Framework), another is a helper library defining the controls we are using (derived from System.Web.UI.User) and some other helpers. This library uses some classes only available to .NET 3.5.
My predecessor somehow managed to use this 3.5 assambly in the 2.0 web project, but now I had to add some functionality to it and wasn't able to do it again.
(note: the alternative way to upgrade the web project to 3.5 framework caused some other problems I couldn't solve by now) | asp.net | .net | null | null | null | null | open | Using .NET 3.5 Assambly with APS 2.0
===
I inherited some .NET projects from a collegue who left our company a while ago. One of them is a web portal on ASP.NET (with 2.0 Framework), another is a helper library defining the controls we are using (derived from System.Web.UI.User) and some other helpers. This library uses some classes only available to .NET 3.5.
My predecessor somehow managed to use this 3.5 assambly in the 2.0 web project, but now I had to add some functionality to it and wasn't able to do it again.
(note: the alternative way to upgrade the web project to 3.5 framework caused some other problems I couldn't solve by now) | 0 |
11,327,649 | 07/04/2012 10:53:47 | 1,495,756 | 07/02/2012 10:18:01 | 14 | 0 | How to load aray of files to web-server from application? | I'm using c#, I have a method to load one file using post. But server takes array of files, so what to change, or generally how to post array or list of files? | c# | forms | file | post | null | null | open | How to load aray of files to web-server from application?
===
I'm using c#, I have a method to load one file using post. But server takes array of files, so what to change, or generally how to post array or list of files? | 0 |
11,327,650 | 07/04/2012 10:53:50 | 1,398,346 | 05/16/2012 10:20:18 | 1 | 0 | How to generate test result reports using Selenium Webdriver in C# | What's a good way of generating test results reports when I run a test in C# using the selenium webdriver. I have nunit available to me, but I'm not sure what I can do with it.
The tests are functional tests of a WUI | c# | selenium | report | webdriver | generate | null | open | How to generate test result reports using Selenium Webdriver in C#
===
What's a good way of generating test results reports when I run a test in C# using the selenium webdriver. I have nunit available to me, but I'm not sure what I can do with it.
The tests are functional tests of a WUI | 0 |
11,327,651 | 07/04/2012 10:53:55 | 755,094 | 11/22/2010 12:49:19 | 798 | 12 | Getting different result from google distance API and native Distance finding function +iphone | I am working on iphone application where i need to find the points between 2 latitude and longitude
I had used:-
CLLocation* newlocation = [[CLLocation alloc] initWithLatitude:19.0759837 longitude:72.8776559];
CLLocation* oldLocation = [[CLLocation alloc] initWithLatitude:19.075655999999999 longitude:72.87979];
float kilo1=[newlocation getDistanceFrom:oldLocation]/1000;
CLLocationDistance distance = [newlocation distanceFromLocation:oldLocation];
And Checked the googleulr:-
[url][1]
The distance from
getDistanceFrom and distanceFromLocation function are:0.227512KM
But in webservice it is showing the distance:0.300000
As there is alot of diference between this two result can any one suggest me which one is to be followed?
According to me the result of webservice is right.
But i cant use the webservice for finding the distance of 100points.As it is not feasible,
Can anyone help me how do i get correct value
Thanks in advance
[1]: http://maps.googleapis.com/maps/api/distancematrix/xml?origins=19.0759837,72.8776559&destinations=19.075655999999999,72.87979&mode=driving&language=en-EN&sensor=false | iphone | cllocationmanager | cllocation | cllocationdistance | null | null | open | Getting different result from google distance API and native Distance finding function +iphone
===
I am working on iphone application where i need to find the points between 2 latitude and longitude
I had used:-
CLLocation* newlocation = [[CLLocation alloc] initWithLatitude:19.0759837 longitude:72.8776559];
CLLocation* oldLocation = [[CLLocation alloc] initWithLatitude:19.075655999999999 longitude:72.87979];
float kilo1=[newlocation getDistanceFrom:oldLocation]/1000;
CLLocationDistance distance = [newlocation distanceFromLocation:oldLocation];
And Checked the googleulr:-
[url][1]
The distance from
getDistanceFrom and distanceFromLocation function are:0.227512KM
But in webservice it is showing the distance:0.300000
As there is alot of diference between this two result can any one suggest me which one is to be followed?
According to me the result of webservice is right.
But i cant use the webservice for finding the distance of 100points.As it is not feasible,
Can anyone help me how do i get correct value
Thanks in advance
[1]: http://maps.googleapis.com/maps/api/distancematrix/xml?origins=19.0759837,72.8776559&destinations=19.075655999999999,72.87979&mode=driving&language=en-EN&sensor=false | 0 |
11,327,652 | 07/04/2012 10:53:57 | 779,408 | 06/01/2011 12:55:04 | 1,943 | 164 | What is the string format of the Asp.net SessionID? | I want to use the `Session.SessionID` as file name and query string in URL. I want to know if its format is suitable for these applications. For example you can not use `'?'` or `'<'` characters in a file name.
Is SessionID format string safe for file names and query strings?
| c# | asp.net | session | string-formatting | sessionid | null | open | What is the string format of the Asp.net SessionID?
===
I want to use the `Session.SessionID` as file name and query string in URL. I want to know if its format is suitable for these applications. For example you can not use `'?'` or `'<'` characters in a file name.
Is SessionID format string safe for file names and query strings?
| 0 |
11,327,653 | 07/04/2012 10:53:58 | 1,497,369 | 07/02/2012 23:36:26 | 1 | 0 | Display image in uiwebview iphone | i have a uiwevview and i am just displaying some text. I am using html text to format the uiwebview. How can i include a image/uiimage inside it? I need to display an image with a fixed frame. | iphone | xcode | uiwebview | uiimageview | null | null | open | Display image in uiwebview iphone
===
i have a uiwevview and i am just displaying some text. I am using html text to format the uiwebview. How can i include a image/uiimage inside it? I need to display an image with a fixed frame. | 0 |
11,327,646 | 07/04/2012 10:53:30 | 648,608 | 03/07/2011 18:00:37 | 415 | 6 | writing a tab dilimited txt file in php, with proper encoding | This code writes a tab delimited txt file to a directory. I have a problem with the character encoding as it fails to get the non-English characters like ñ , é ,...
how can i get the encoding right? I know i should use UTF-8, but where in my code does it fit in?
Thanks
<?
@chmod($export_txt, 0777);
$fe = @fopen($export_txt."/export.txt", "w+");
if($fe){
$somecontent = "";
$fields_count = 0;
// fields headers
$db->query($sql_view);
if($row = $db->fetchAssoc()){
foreach($row as $key => $val){
if($fields_count++ > 0) $somecontent .= "\t";
$somecontent .= $key;
}
}
$somecontent .= "\r\n";
$db->query($sql_view);
while($row = $db->fetchAssoc()){
$fields_count = 0;
foreach($row as $key => $val){
if($fields_count++ > 0) $somecontent .= "\t";
$somecontent .= $val;
}
$somecontent .= "\r\n";
}
// write some content to the opened file.
if (fwrite($fe, $somecontent) == FALSE) echo 'file_writing_error'." (export.txt)";
fclose($fe);
}
?> | php | encoding | null | null | null | null | open | writing a tab dilimited txt file in php, with proper encoding
===
This code writes a tab delimited txt file to a directory. I have a problem with the character encoding as it fails to get the non-English characters like ñ , é ,...
how can i get the encoding right? I know i should use UTF-8, but where in my code does it fit in?
Thanks
<?
@chmod($export_txt, 0777);
$fe = @fopen($export_txt."/export.txt", "w+");
if($fe){
$somecontent = "";
$fields_count = 0;
// fields headers
$db->query($sql_view);
if($row = $db->fetchAssoc()){
foreach($row as $key => $val){
if($fields_count++ > 0) $somecontent .= "\t";
$somecontent .= $key;
}
}
$somecontent .= "\r\n";
$db->query($sql_view);
while($row = $db->fetchAssoc()){
$fields_count = 0;
foreach($row as $key => $val){
if($fields_count++ > 0) $somecontent .= "\t";
$somecontent .= $val;
}
$somecontent .= "\r\n";
}
// write some content to the opened file.
if (fwrite($fe, $somecontent) == FALSE) echo 'file_writing_error'." (export.txt)";
fclose($fe);
}
?> | 0 |
11,327,648 | 07/04/2012 10:53:41 | 500,889 | 11/08/2010 16:27:29 | 28 | 1 | How can I change an appengine application's billing administrator? | I want to change the billing administrator of an appengine application. How can I achieve that without causing service disruption?
Thanks. | google-app-engine | null | null | null | null | null | open | How can I change an appengine application's billing administrator?
===
I want to change the billing administrator of an appengine application. How can I achieve that without causing service disruption?
Thanks. | 0 |
11,327,655 | 07/04/2012 10:54:18 | 888,990 | 08/11/2011 00:24:54 | 402 | 5 | Trying to check if email already exists on database | I am trying to check an email address against ones listed in a database to make sure it doesn't match any.
I have attempted to use `rowCount` which I understand returns a bool `true` or `false` on whether it found a match.
But the email address still gets entered into the database.
Here is the method I'm using to check the email:
public function checkEmail(){
if($this->post_data['reg_email'] == $this->post_data['reg_conf_email']){
if(filter_var($this->post_data['reg_email'], FILTER_VALIDATE_EMAIL)){
$stmt = $this->dbh->prepare("SELECT email FROM oopforum_users WHERE email = ?");
$stmt->bindParam(1, $this->post_data['reg_email'], PDO::PARAM_STR);
$stmt->execute();
$result = $stmt->rowCount();
if($this->result){
return true;
}else{
return false;
}
}else{
return false;
}
}else{
return false;
}
}
Then in my calling program I have this:
if($register->checkUsername()){
if(!$register->checkEmail()){
//continue...
}else{
$message = 'ERROR: That email is not valid, doesn\'t match the confirmation email or already exists on our database, please choose another one.';
}
}else{
$message = 'ERROR: That username is invalid or is already taken, please choose another one and ensure it is atleast 4 characters long.';
}
Why is it not matching the email against the same one in the database and throwing the error message? | mysql | oop | class | pdo | rowcount | null | open | Trying to check if email already exists on database
===
I am trying to check an email address against ones listed in a database to make sure it doesn't match any.
I have attempted to use `rowCount` which I understand returns a bool `true` or `false` on whether it found a match.
But the email address still gets entered into the database.
Here is the method I'm using to check the email:
public function checkEmail(){
if($this->post_data['reg_email'] == $this->post_data['reg_conf_email']){
if(filter_var($this->post_data['reg_email'], FILTER_VALIDATE_EMAIL)){
$stmt = $this->dbh->prepare("SELECT email FROM oopforum_users WHERE email = ?");
$stmt->bindParam(1, $this->post_data['reg_email'], PDO::PARAM_STR);
$stmt->execute();
$result = $stmt->rowCount();
if($this->result){
return true;
}else{
return false;
}
}else{
return false;
}
}else{
return false;
}
}
Then in my calling program I have this:
if($register->checkUsername()){
if(!$register->checkEmail()){
//continue...
}else{
$message = 'ERROR: That email is not valid, doesn\'t match the confirmation email or already exists on our database, please choose another one.';
}
}else{
$message = 'ERROR: That username is invalid or is already taken, please choose another one and ensure it is atleast 4 characters long.';
}
Why is it not matching the email against the same one in the database and throwing the error message? | 0 |
11,571,597 | 07/20/2012 01:20:45 | 237,399 | 12/23/2009 06:38:18 | 637 | 25 | Immediately clearing the contents of an IFrame in Flex | I have a Flex HTML component that is displaying content from a remote URL and a button in the Flex application that reloads the content. However, it takes a few seconds for the IFrame's content to refresh. During this time, there is no obvious feedback to the user that any action is underway.
I would like to clear the contents of the IFrame, so there is immediate feedback after clicking refresh, and then load the remote URL again. Is there a way to do this?
I've tried setting the HTMLText property to "" and setting the IFrame location to "about:blank", and neither of these have the desired immediate effect. (on it's own, setting the location to about:blank immediately clears the IFrame, but if it is followed by resetting the location to the original URL, the immediate clearing doesn't occur. Is this something to do with the IFrame caching the original page?) | flex | iframe | actionscript | air | null | null | open | Immediately clearing the contents of an IFrame in Flex
===
I have a Flex HTML component that is displaying content from a remote URL and a button in the Flex application that reloads the content. However, it takes a few seconds for the IFrame's content to refresh. During this time, there is no obvious feedback to the user that any action is underway.
I would like to clear the contents of the IFrame, so there is immediate feedback after clicking refresh, and then load the remote URL again. Is there a way to do this?
I've tried setting the HTMLText property to "" and setting the IFrame location to "about:blank", and neither of these have the desired immediate effect. (on it's own, setting the location to about:blank immediately clears the IFrame, but if it is followed by resetting the location to the original URL, the immediate clearing doesn't occur. Is this something to do with the IFrame caching the original page?) | 0 |
11,571,604 | 07/20/2012 01:21:38 | 1,509,285 | 07/07/2012 21:24:44 | 1 | 0 | How to refresh my RSSFeed, Find Posts again, and parse again in app? | I am making a simple RSS Feed app. How do I refresh all the posts and parsing again to fetch for posts manually (so the user can click a refresh button)? | objective-c | rss | xml-parsing | refresh | fetch | null | open | How to refresh my RSSFeed, Find Posts again, and parse again in app?
===
I am making a simple RSS Feed app. How do I refresh all the posts and parsing again to fetch for posts manually (so the user can click a refresh button)? | 0 |
11,571,605 | 07/20/2012 01:22:31 | 624,288 | 02/19/2011 10:29:15 | 1 | 0 | javascript manifest file "application.js" is not processed | I am on a Macbook Pro and created a new Rails 3.2 app, but the assets pipeline does not work. Here is what I did:
$ rails version
Rails 3.2.5
$ rails new test_assets
$ cd test_assets
$ rails server
The server is started OK but if I visit `http://0.0.0.0:3000/assets/application.js`, it turns out the manifest file is not processed at all, it shows:
//... some comments ...
//= require jquery
//= require jquery_ujs
//= require_tree .
;
I tried to do the exactly same steps on my another Macbook Pro. It works well. Visiting `http://0.0.0.0:3000/assets/application.js` on that machine shows a compiled javascript file with all the contents.
I have read http://railscasts.com/episodes/279-understanding-the-asset-pipeline and http://guides.rubyonrails.org/asset_pipeline.html, also searched for hours on the web but with no clue.
Your help is really appreciated! | ruby-on-rails | asset-pipeline | null | null | null | null | open | javascript manifest file "application.js" is not processed
===
I am on a Macbook Pro and created a new Rails 3.2 app, but the assets pipeline does not work. Here is what I did:
$ rails version
Rails 3.2.5
$ rails new test_assets
$ cd test_assets
$ rails server
The server is started OK but if I visit `http://0.0.0.0:3000/assets/application.js`, it turns out the manifest file is not processed at all, it shows:
//... some comments ...
//= require jquery
//= require jquery_ujs
//= require_tree .
;
I tried to do the exactly same steps on my another Macbook Pro. It works well. Visiting `http://0.0.0.0:3000/assets/application.js` on that machine shows a compiled javascript file with all the contents.
I have read http://railscasts.com/episodes/279-understanding-the-asset-pipeline and http://guides.rubyonrails.org/asset_pipeline.html, also searched for hours on the web but with no clue.
Your help is really appreciated! | 0 |
11,571,585 | 07/20/2012 01:19:09 | 1,539,462 | 07/20/2012 01:01:42 | 1 | 0 | jQuery: Setting Header Accept for JSONP returns 405 | I see many posts over the Accepts issue, but I can't seem to nail down my specific issue. Here's a quick overview:
- Using the latest jQuery
- Trying to access JSONP from Redbox's (developer.redbox.com) API with a valid key
- Redbox only returns JSONP with a HTTP Header set to Accept: application/json
- Returning 405 Method Not Allowed no matter how many different ways I try to set the header
Here's my code:
$.ajaxSetup ({
accepts: {
json: "application/json",
// Hack for Chrome/Safari from jQuery forms
_default: ""
}
});
$.ajax({
url: 'https://api.redbox.com/v3/products/movies/top20?apiKey=<key here>&period=7& callBack=?',
type: 'GET',
contentType: 'application/json',
success : function(response) {
alert('success')
}
});
});
JSONP should be able to return cross domain, but I can't get the URL to return JSONP. It tries and tries to return XML with then causes the cross domain issue. I emailed Redbox and they say I have to use set the header to make it serve out the JSONP.
This method and many others I've attempted seems be for nothing at this point. I would greatly appreciate it if someone could give me a bit of guidance with this issue. At the company I work for, accessing our .net framework isn't possible. We have to reply on the client-side.
Thanks in advance. | jquery | ajax | jsonp | null | null | null | open | jQuery: Setting Header Accept for JSONP returns 405
===
I see many posts over the Accepts issue, but I can't seem to nail down my specific issue. Here's a quick overview:
- Using the latest jQuery
- Trying to access JSONP from Redbox's (developer.redbox.com) API with a valid key
- Redbox only returns JSONP with a HTTP Header set to Accept: application/json
- Returning 405 Method Not Allowed no matter how many different ways I try to set the header
Here's my code:
$.ajaxSetup ({
accepts: {
json: "application/json",
// Hack for Chrome/Safari from jQuery forms
_default: ""
}
});
$.ajax({
url: 'https://api.redbox.com/v3/products/movies/top20?apiKey=<key here>&period=7& callBack=?',
type: 'GET',
contentType: 'application/json',
success : function(response) {
alert('success')
}
});
});
JSONP should be able to return cross domain, but I can't get the URL to return JSONP. It tries and tries to return XML with then causes the cross domain issue. I emailed Redbox and they say I have to use set the header to make it serve out the JSONP.
This method and many others I've attempted seems be for nothing at this point. I would greatly appreciate it if someone could give me a bit of guidance with this issue. At the company I work for, accessing our .net framework isn't possible. We have to reply on the client-side.
Thanks in advance. | 0 |
11,571,588 | 07/20/2012 01:19:31 | 1,234,653 | 02/27/2012 01:54:26 | 1 | 0 | Adding glow to an object made by Raphael when an input form is clicked on | I have created a shape using the raphael JS library. I have an input field on my page. I want to toggle a glow around that shape when the input field is clicked on.
Here is the code I've already tried:
var searchBoxHtml = document.getElementsByName("searchBox");
searchBoxHtml.onclick= function () {europe_africa.glow({width: 10,fill: false, opacity: 0.5, offsetx: 0,offsety: 0,color:'white'}); };
This is not working. I have also tried putting the event handler inside the input tag and it didn't work. | javascript | html | javascript-events | onclick | raphael | null | open | Adding glow to an object made by Raphael when an input form is clicked on
===
I have created a shape using the raphael JS library. I have an input field on my page. I want to toggle a glow around that shape when the input field is clicked on.
Here is the code I've already tried:
var searchBoxHtml = document.getElementsByName("searchBox");
searchBoxHtml.onclick= function () {europe_africa.glow({width: 10,fill: false, opacity: 0.5, offsetx: 0,offsety: 0,color:'white'}); };
This is not working. I have also tried putting the event handler inside the input tag and it didn't work. | 0 |
11,571,613 | 07/20/2012 01:23:21 | 1,276,186 | 03/17/2012 20:16:24 | 1 | 0 | Android Custom Listview not responding to clicklistener | Okk friends i have this code in android for a custom lisview and clicklistener applied to it,But it seems nothing is happenning when i click on the listview item.it is a custom listview which is fetching information about youtube links from mysql database into a custom listview.
YoutubeActivity.java
package com.example.jagjitapp;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.example.jagjitapp.R;
import com.example.jagjitapp.Library;
import com.example.jagjitapp.GetYouTubeUserVideosTask;
import com.example.jagjitapp.VideosListView;
import android.support.v4.app.NavUtils;
public class YoutubeActivity extends Activity implements VideoClickListener {
EditText uq;
Button search;
private VideosListView listView;
public String sq;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
search=(Button)findViewById(R.id.search);
uq=(EditText)findViewById(R.id.userquery);
listView = (VideosListView) findViewById(R.id.videosListView);
}
// This is the XML onClick listener to retreive a query video feed
public void getUserYouTubeFeed(View v){
// We start a new task that does its work on its own thread
// We pass in a handler that will be called when the task has finished
// We also pass in the name of the user we are searching YouTube for
sq=uq.getText().toString().trim();
String ws=sq.replaceAll(" ","+");
new GetYouTubeUserVideosTask(responseHandler,ws).run();
}
// This is the handler that receives the response when the YouTube task finished
Handler responseHandler = new Handler() {
public void handleMessage(Message msg) {
populateListWithVideos(msg);
};
};
private void populateListWithVideos(Message msg) {
// Retreive the videos are task found from the data bundle sent back
Library lib = (Library) msg.getData().get(GetYouTubeUserVideosTask.LIBRARY);
listView.setVideos(lib.getVideos());
}
@Override
protected void onStop() {
responseHandler = null;
super.onStop();
}
@Override
public void onVideoClicked(Video video) {
Intent yt=new Intent(getApplicationContext(),VideoActivity.class);
startActivity(yt);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_youtube, menu);
return true;
}
}
VideoListView.java
package com.example.jagjitapp;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.example.jagjitapp.R;
import com.example.jagjitapp.Library;
import com.example.jagjitapp.GetYouTubeUserVideosTask;
import com.example.jagjitapp.VideosListView;
import android.support.v4.app.NavUtils;
public class YoutubeActivity extends Activity implements VideoClickListener{
EditText uq;
Button search;
private VideosListView listView;
public String sq;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
search=(Button)findViewById(R.id.search);
uq=(EditText)findViewById(R.id.userquery);
listView = (VideosListView) findViewById(R.id.videosListView);
}
public void getUserYouTubeFeed(View v){
sq=uq.getText().toString().trim();
String ws=sq.replaceAll(" ","+");
new GetYouTubeUserVideosTask(responseHandler,ws).run();
}
Handler responseHandler = new Handler() {
public void handleMessage(Message msg) {
populateListWithVideos(msg);
};
};
private void populateListWithVideos(Message msg) {
// Retreive the videos are task found from the data bundle sent back
Library lib = (Library)msg.getData().get(GetYouTubeUserVideosTask.LIBRARY);
listView.setVideos(lib.getVideos());
}
@Override
protected void onStop() {
responseHandler = null;
super.onStop();
}
@Override
public void onVideoClicked(Video video) {
Intent yt=new Intent(getApplicationContext(),VideoActivity.class);
startActivity(yt);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_youtube, menu);
return true;
}
}
VideoAdapter.java
package com.example.jagjitapp;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.jagjitapp.R;
import com.example.jagjitapp.Video;
import com.example.jagjitapp.UrlImageView;
public class VideosAdapter extends BaseAdapter {
List<Video> videos;
// An inflator to use when creating rows
private LayoutInflater mInflater;
public VideosAdapter(Context context, List<Video> videos) {
this.videos = videos;
this.mInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return videos.size();
}
@Override
public Object getItem(int position) {
return videos.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null){
convertView = mInflater.inflate(R.layout.list_item_user_video, null);
}
UrlImageView thumb = (UrlImageView)convertView.
findViewById(R.id.userVideoThumbImageView);
TextView title = (TextView) convertView.
findViewById(R.id.userVideoTitleTextView);
// Get a single video from our list
Video video = videos.get(position);
// Set the image for the list item
thumb.setImageDrawable(video.getThumbUrl());
// Set the title for the list item
title.setText(video.getTitle());
return convertView;
}
}
VideoClickListener.java
package com.example.jagjitapp;
import com.example.jagjitapp.Video;
public interface VideoClickListener {
public void onVideoClicked(Video video);
}
| onitemclicklistener | null | null | null | null | null | open | Android Custom Listview not responding to clicklistener
===
Okk friends i have this code in android for a custom lisview and clicklistener applied to it,But it seems nothing is happenning when i click on the listview item.it is a custom listview which is fetching information about youtube links from mysql database into a custom listview.
YoutubeActivity.java
package com.example.jagjitapp;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.example.jagjitapp.R;
import com.example.jagjitapp.Library;
import com.example.jagjitapp.GetYouTubeUserVideosTask;
import com.example.jagjitapp.VideosListView;
import android.support.v4.app.NavUtils;
public class YoutubeActivity extends Activity implements VideoClickListener {
EditText uq;
Button search;
private VideosListView listView;
public String sq;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
search=(Button)findViewById(R.id.search);
uq=(EditText)findViewById(R.id.userquery);
listView = (VideosListView) findViewById(R.id.videosListView);
}
// This is the XML onClick listener to retreive a query video feed
public void getUserYouTubeFeed(View v){
// We start a new task that does its work on its own thread
// We pass in a handler that will be called when the task has finished
// We also pass in the name of the user we are searching YouTube for
sq=uq.getText().toString().trim();
String ws=sq.replaceAll(" ","+");
new GetYouTubeUserVideosTask(responseHandler,ws).run();
}
// This is the handler that receives the response when the YouTube task finished
Handler responseHandler = new Handler() {
public void handleMessage(Message msg) {
populateListWithVideos(msg);
};
};
private void populateListWithVideos(Message msg) {
// Retreive the videos are task found from the data bundle sent back
Library lib = (Library) msg.getData().get(GetYouTubeUserVideosTask.LIBRARY);
listView.setVideos(lib.getVideos());
}
@Override
protected void onStop() {
responseHandler = null;
super.onStop();
}
@Override
public void onVideoClicked(Video video) {
Intent yt=new Intent(getApplicationContext(),VideoActivity.class);
startActivity(yt);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_youtube, menu);
return true;
}
}
VideoListView.java
package com.example.jagjitapp;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.example.jagjitapp.R;
import com.example.jagjitapp.Library;
import com.example.jagjitapp.GetYouTubeUserVideosTask;
import com.example.jagjitapp.VideosListView;
import android.support.v4.app.NavUtils;
public class YoutubeActivity extends Activity implements VideoClickListener{
EditText uq;
Button search;
private VideosListView listView;
public String sq;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
search=(Button)findViewById(R.id.search);
uq=(EditText)findViewById(R.id.userquery);
listView = (VideosListView) findViewById(R.id.videosListView);
}
public void getUserYouTubeFeed(View v){
sq=uq.getText().toString().trim();
String ws=sq.replaceAll(" ","+");
new GetYouTubeUserVideosTask(responseHandler,ws).run();
}
Handler responseHandler = new Handler() {
public void handleMessage(Message msg) {
populateListWithVideos(msg);
};
};
private void populateListWithVideos(Message msg) {
// Retreive the videos are task found from the data bundle sent back
Library lib = (Library)msg.getData().get(GetYouTubeUserVideosTask.LIBRARY);
listView.setVideos(lib.getVideos());
}
@Override
protected void onStop() {
responseHandler = null;
super.onStop();
}
@Override
public void onVideoClicked(Video video) {
Intent yt=new Intent(getApplicationContext(),VideoActivity.class);
startActivity(yt);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_youtube, menu);
return true;
}
}
VideoAdapter.java
package com.example.jagjitapp;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.jagjitapp.R;
import com.example.jagjitapp.Video;
import com.example.jagjitapp.UrlImageView;
public class VideosAdapter extends BaseAdapter {
List<Video> videos;
// An inflator to use when creating rows
private LayoutInflater mInflater;
public VideosAdapter(Context context, List<Video> videos) {
this.videos = videos;
this.mInflater = LayoutInflater.from(context);
}
@Override
public int getCount() {
return videos.size();
}
@Override
public Object getItem(int position) {
return videos.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(convertView == null){
convertView = mInflater.inflate(R.layout.list_item_user_video, null);
}
UrlImageView thumb = (UrlImageView)convertView.
findViewById(R.id.userVideoThumbImageView);
TextView title = (TextView) convertView.
findViewById(R.id.userVideoTitleTextView);
// Get a single video from our list
Video video = videos.get(position);
// Set the image for the list item
thumb.setImageDrawable(video.getThumbUrl());
// Set the title for the list item
title.setText(video.getTitle());
return convertView;
}
}
VideoClickListener.java
package com.example.jagjitapp;
import com.example.jagjitapp.Video;
public interface VideoClickListener {
public void onVideoClicked(Video video);
}
| 0 |
11,660,278 | 07/25/2012 23:36:54 | 1,244,277 | 03/02/2012 04:11:38 | 161 | 16 | Copy the contents of one table into another | In MSSQL
<br>I have two tables, identical in structure.
<br>Table A is products
<br>Table B is products_update.
On a given day, I get a new product xls in a predefined format.
I drop the products_update table and use SQL to select into products_update.
In the products table, I want to create new records, and modify existing records, while maintaining older records.
There are (at pressent) 50 columns.. (very little overlap so normalization isn't logical)
Is there an easy bit of SQL to accomplish this. I see MERGE examples, but I'd have to do the mapping to fields. | sql | merge | null | null | null | null | open | Copy the contents of one table into another
===
In MSSQL
<br>I have two tables, identical in structure.
<br>Table A is products
<br>Table B is products_update.
On a given day, I get a new product xls in a predefined format.
I drop the products_update table and use SQL to select into products_update.
In the products table, I want to create new records, and modify existing records, while maintaining older records.
There are (at pressent) 50 columns.. (very little overlap so normalization isn't logical)
Is there an easy bit of SQL to accomplish this. I see MERGE examples, but I'd have to do the mapping to fields. | 0 |
11,660,279 | 07/25/2012 23:36:58 | 1,432,894 | 06/02/2012 21:23:55 | 92 | 4 | Make a custom view for iAd as subview in my ViewControllers | I have a problem to make a soulotion for placing a iAd in my Tab Bar app. I'm using Xcode 4 with storyboard and the Tab Bar Controller itself is only created in storyboard with no class (just UITabBarController in Utilites). This is what I want to do:
Create a separate custom view for the iAd, and add this view as a subclass to my other apps as part of the viewDidLoad, and connect this to my banners. Can I do that, if so, how? | iphone | xcode | uitabbarcontroller | storyboard | iad | null | open | Make a custom view for iAd as subview in my ViewControllers
===
I have a problem to make a soulotion for placing a iAd in my Tab Bar app. I'm using Xcode 4 with storyboard and the Tab Bar Controller itself is only created in storyboard with no class (just UITabBarController in Utilites). This is what I want to do:
Create a separate custom view for the iAd, and add this view as a subclass to my other apps as part of the viewDidLoad, and connect this to my banners. Can I do that, if so, how? | 0 |
11,660,288 | 07/25/2012 23:38:11 | 1,553,093 | 07/25/2012 23:34:29 | 1 | 0 | Getting Client ID of textbox in Gridview | In order to use the
txtbox = document.getElementById() function inside of an external javascript file, I am assigned the clientID of each control to a variable that I use.
So for instance, I say:
var lbCancelID = '<%= lbCancel.ClientId %>';
Then, when I call a function inside of an external javascript file that uses document.getElementById() it can do whatever it wants with the return element (txtbox).
This works perfectly fine until I got to an area where I needed to get a control in the gridviews edit template. Then, it told me the element didn't exist.
So I tried this:
var txtStartDateID = '<%#((GridViewRow)Container).FindControl("txtStartDate").ClientID %>'
But get an error 'GridViewRow' is a type and cannot be used as an expression. What can I do instead?
Thanks! | javascript | asp.net | gridview | null | null | null | open | Getting Client ID of textbox in Gridview
===
In order to use the
txtbox = document.getElementById() function inside of an external javascript file, I am assigned the clientID of each control to a variable that I use.
So for instance, I say:
var lbCancelID = '<%= lbCancel.ClientId %>';
Then, when I call a function inside of an external javascript file that uses document.getElementById() it can do whatever it wants with the return element (txtbox).
This works perfectly fine until I got to an area where I needed to get a control in the gridviews edit template. Then, it told me the element didn't exist.
So I tried this:
var txtStartDateID = '<%#((GridViewRow)Container).FindControl("txtStartDate").ClientID %>'
But get an error 'GridViewRow' is a type and cannot be used as an expression. What can I do instead?
Thanks! | 0 |
11,660,304 | 07/25/2012 23:40:00 | 1,551,603 | 07/25/2012 12:33:38 | 5 | 0 | graphics object is painted twise | here is code that generate and paint one of tetramino figure every 5 sec.
However, the figure is drown twice and, therefore, twists the original picture.
Here tetramino figure consist of 10x10 pixel blocks.
Constructor Figure tells position of the blocks and color.
method paint(Graphics g) drows Figure f block by block.
import java.applet.*;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Rectangle2D;
import javax.swing.Timer;
public class Tetris extends Applet {
Dimension size;
int x1,y1;
private int xs=0,ys=0;
public int getXs() {
return xs;
}
public void setXs(int xs) {
this.xs = xs;
}
public int getYs() {
return ys;
}
public void setYs(int ys) {
this.ys = ys;
}
public void rotate(){
}
public Figure generate(){
Figure i = new Figure(new int[][]{new int[]{1},new int[]{1},new int[]{1},new int[]{1}},Color.CYAN);
Figure j = new Figure(new int[][]{new int[]{1,0,0}, new int[]{1,1,1}},Color.BLUE);
Figure l = new Figure(new int[][]{new int[]{0,0,1}, new int[]{1,1,1}},Color.ORANGE);
Figure o = new Figure(new int[][]{new int[]{1,1}, new int[]{1,1}},Color.YELLOW);
Figure s = new Figure(new int[][]{new int[]{0,1,1}, new int[]{1,1,0}},Color.GREEN);
Figure t = new Figure(new int[][]{new int[]{1,1,1}, new int[]{0,1,0}},Color.PINK);
Figure z = new Figure(new int[][]{new int[]{1,1,0}, new int[]{0,1,1}},Color.RED);
Figure[] genSet = {i,j,l,o,s,t,z};
int index =((int) (Math.random() * 7)) ;
//System.out.println(index);
return genSet[index];
}
public void drop(){
}
public void shift(){
}
public void movecheck(){
}
public void actiondelay(){
ActionListener actionlistener = new ActionListener() {
public void actionPerformed(ActionEvent actionevent){
repaint();
}
};
Timer timer = new Timer(5000,actionlistener);
timer.start();
}
public void init(){
setSize(200,400);
setBackground(Color.black);
size = getSize();
}
public void paint(Graphics g){
super.paint(g);
System.out.println("________________");
Graphics2D g2d = (Graphics2D) g.create();
Figure f = generate();
int length = f.getX()[0].length;
for(int j =0; j<f.getX().length;j++){
System.out.println();
ys = 0;
for(int i=0;i<length;i++){
if (f.getX()[j][i] == 1){
Rectangle2D p = new Rectangle2D.Double(xs,xs,xs+10,ys+10);
g2d.setColor(f.getY());
g2d.draw(p);
//g2d.drawRect(p.x, p.y, p.width, p.height);
//g2d.fillRect(p.x, p.y, p.width, p.height);
//System.out.println("widnth: " +p.width + " | height: " + p.height + " end ");
System.out.print("*");
}
else System.out.print(" ");
ys+=10;
}
xs+=10;
}
xs=0;
ys=0;
actiondelay();
//g.setColor(Color.white);
//g.drawRect(45, 95, 55, 105);
}
}
import java.awt.Color;
public class Figure{
int[][] x;
Color y;
public Figure(int[][] x , Color y){
this.x=x;
this.y=y;
}
public int[][] getX() {
return x;
}
public void setX(int[][] x) {
this.x = x;
}
public Color getY() {
return y;
}
public void setY(Color y) {
this.y = y;
}
}
| java | null | null | null | null | null | open | graphics object is painted twise
===
here is code that generate and paint one of tetramino figure every 5 sec.
However, the figure is drown twice and, therefore, twists the original picture.
Here tetramino figure consist of 10x10 pixel blocks.
Constructor Figure tells position of the blocks and color.
method paint(Graphics g) drows Figure f block by block.
import java.applet.*;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.ActionListener;
import java.awt.geom.Rectangle2D;
import javax.swing.Timer;
public class Tetris extends Applet {
Dimension size;
int x1,y1;
private int xs=0,ys=0;
public int getXs() {
return xs;
}
public void setXs(int xs) {
this.xs = xs;
}
public int getYs() {
return ys;
}
public void setYs(int ys) {
this.ys = ys;
}
public void rotate(){
}
public Figure generate(){
Figure i = new Figure(new int[][]{new int[]{1},new int[]{1},new int[]{1},new int[]{1}},Color.CYAN);
Figure j = new Figure(new int[][]{new int[]{1,0,0}, new int[]{1,1,1}},Color.BLUE);
Figure l = new Figure(new int[][]{new int[]{0,0,1}, new int[]{1,1,1}},Color.ORANGE);
Figure o = new Figure(new int[][]{new int[]{1,1}, new int[]{1,1}},Color.YELLOW);
Figure s = new Figure(new int[][]{new int[]{0,1,1}, new int[]{1,1,0}},Color.GREEN);
Figure t = new Figure(new int[][]{new int[]{1,1,1}, new int[]{0,1,0}},Color.PINK);
Figure z = new Figure(new int[][]{new int[]{1,1,0}, new int[]{0,1,1}},Color.RED);
Figure[] genSet = {i,j,l,o,s,t,z};
int index =((int) (Math.random() * 7)) ;
//System.out.println(index);
return genSet[index];
}
public void drop(){
}
public void shift(){
}
public void movecheck(){
}
public void actiondelay(){
ActionListener actionlistener = new ActionListener() {
public void actionPerformed(ActionEvent actionevent){
repaint();
}
};
Timer timer = new Timer(5000,actionlistener);
timer.start();
}
public void init(){
setSize(200,400);
setBackground(Color.black);
size = getSize();
}
public void paint(Graphics g){
super.paint(g);
System.out.println("________________");
Graphics2D g2d = (Graphics2D) g.create();
Figure f = generate();
int length = f.getX()[0].length;
for(int j =0; j<f.getX().length;j++){
System.out.println();
ys = 0;
for(int i=0;i<length;i++){
if (f.getX()[j][i] == 1){
Rectangle2D p = new Rectangle2D.Double(xs,xs,xs+10,ys+10);
g2d.setColor(f.getY());
g2d.draw(p);
//g2d.drawRect(p.x, p.y, p.width, p.height);
//g2d.fillRect(p.x, p.y, p.width, p.height);
//System.out.println("widnth: " +p.width + " | height: " + p.height + " end ");
System.out.print("*");
}
else System.out.print(" ");
ys+=10;
}
xs+=10;
}
xs=0;
ys=0;
actiondelay();
//g.setColor(Color.white);
//g.drawRect(45, 95, 55, 105);
}
}
import java.awt.Color;
public class Figure{
int[][] x;
Color y;
public Figure(int[][] x , Color y){
this.x=x;
this.y=y;
}
public int[][] getX() {
return x;
}
public void setX(int[][] x) {
this.x = x;
}
public Color getY() {
return y;
}
public void setY(Color y) {
this.y = y;
}
}
| 0 |
11,660,305 | 07/25/2012 23:40:01 | 1,553,057 | 07/25/2012 23:09:46 | 1 | 0 | Twitter bootstrap modals in Rails | I am trying to add a link to a modal in the header of my app, however my link currently does nothing. Can someone let me know whats wrong with my code?
**header.html.erb** (shortened)
<ul class="nav pull-right">
...
// pretty much just added the example modal to test it
<div class="modal hide" id="myModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<p>body</p>
</div>
<div class="footer">
<a href="#" class="btn" data-dismiss="modal">Close</a>
<a href="#> class="btn btn-primary">Save Changes</a>
</div>
</div>
<li><a data-toggle="modal href="#myModal">Modal Test</a></li>
</ul>
**application.js**
//=require jquery
//=require jquery_ujs
//=require bootstrap
//=require_tree .
Currently when "Modal Test" is pressed, nothing happens. I would very much appreciate the help!
| ruby-on-rails | twitter-bootstrap | null | null | null | null | open | Twitter bootstrap modals in Rails
===
I am trying to add a link to a modal in the header of my app, however my link currently does nothing. Can someone let me know whats wrong with my code?
**header.html.erb** (shortened)
<ul class="nav pull-right">
...
// pretty much just added the example modal to test it
<div class="modal hide" id="myModal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<p>body</p>
</div>
<div class="footer">
<a href="#" class="btn" data-dismiss="modal">Close</a>
<a href="#> class="btn btn-primary">Save Changes</a>
</div>
</div>
<li><a data-toggle="modal href="#myModal">Modal Test</a></li>
</ul>
**application.js**
//=require jquery
//=require jquery_ujs
//=require bootstrap
//=require_tree .
Currently when "Modal Test" is pressed, nothing happens. I would very much appreciate the help!
| 0 |
11,642,391 | 07/25/2012 03:45:54 | 1,153,443 | 01/17/2012 08:17:57 | 330 | 24 | How to upgrade dojo1.2 to dojo1.7 | I have an application which is running with dojo 1.2 having support for InternetExplorer8 only
so my problem is that I want to upgrate dojo version to 1.7 and InternetExplorer9/otherborwsers compatible,
so which API do I need to change? I am using all three dojo,dijit,dojox.
is there any solution or not ?
Thanks in advance....
| dojo | dijit | dojox | null | null | null | open | How to upgrade dojo1.2 to dojo1.7
===
I have an application which is running with dojo 1.2 having support for InternetExplorer8 only
so my problem is that I want to upgrate dojo version to 1.7 and InternetExplorer9/otherborwsers compatible,
so which API do I need to change? I am using all three dojo,dijit,dojox.
is there any solution or not ?
Thanks in advance....
| 0 |
11,594,285 | 07/21/2012 17:20:20 | 1,086,109 | 12/07/2011 16:45:38 | 1 | 0 | Sending NSData inside a structure object over BlueTooth | The structure:
typedef struct
{
NSData *levelData;
int levelID;
} GameLevelInfo;
How I send the data:
static GameLevelInfo gameLevelInfo;
gameLevelInfo.levelData = [[LevelManager sharedManager] levelDataFromName:@"XXXXXX"]];
gameLevelInfo.levelID = 1;
[sendPacket:NETWORK_SENDING_LEVEL
objectIndex:0
data:&gameLevelInfo
length:sizeof(gameLevelInfo)
reliable:YES];
The "levelDataFromName":
-(NSData *) levelDataFromName:(NSString *)levelName
{
NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *filePath = [documentPath stringByAppendingFormat:@"/%@", levelName];
return [[NSFileManager defaultManager] contentsAtPath:filePath];
}
And the "sendPacket":
- (void)sendPacket:(int)packetID objectIndex:(int)objectIndex data:(void *)data length:(int)length reliable:(bool)howtosend {
// the packet we'll send is resued
static unsigned char networkPacket[MAX_PACKET_SIZE];
const unsigned int packetHeaderSize = 3 * sizeof(int); // we have two "ints" for our header
if(length < (MAX_PACKET_SIZE - packetHeaderSize)) { // our networkPacket buffer size minus the size of the header info
int *pIntData = (int *)&networkPacket[0];
// header info
pIntData[0] = packetNumber++;
pIntData[1] = packetID;
pIntData[2] = objectIndex;
// copy data in after the header
memcpy( &networkPacket[packetHeaderSize], data, length );
NSData *packet = [NSData dataWithBytes: networkPacket length: (length+packetHeaderSize)];
if(howtosend == YES) {
[session sendDataToAllPeers:packet withDataMode:GKSendDataReliable error:nil];
} else {
[session sendDataToAllPeers:packet withDataMode:GKSendDataUnreliable error:nil];
}
}
}
The data was sent successfully but on the "receive side":
GameLevelInfo *gameLevelInfo = (GameLevelInfo*)data;
NSData *content = gameLevelInfo->levelData;
The "content" was invalid object.
Any help will be appreciated, thanks :) | iphone | ios | cocoa | null | null | null | open | Sending NSData inside a structure object over BlueTooth
===
The structure:
typedef struct
{
NSData *levelData;
int levelID;
} GameLevelInfo;
How I send the data:
static GameLevelInfo gameLevelInfo;
gameLevelInfo.levelData = [[LevelManager sharedManager] levelDataFromName:@"XXXXXX"]];
gameLevelInfo.levelID = 1;
[sendPacket:NETWORK_SENDING_LEVEL
objectIndex:0
data:&gameLevelInfo
length:sizeof(gameLevelInfo)
reliable:YES];
The "levelDataFromName":
-(NSData *) levelDataFromName:(NSString *)levelName
{
NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *filePath = [documentPath stringByAppendingFormat:@"/%@", levelName];
return [[NSFileManager defaultManager] contentsAtPath:filePath];
}
And the "sendPacket":
- (void)sendPacket:(int)packetID objectIndex:(int)objectIndex data:(void *)data length:(int)length reliable:(bool)howtosend {
// the packet we'll send is resued
static unsigned char networkPacket[MAX_PACKET_SIZE];
const unsigned int packetHeaderSize = 3 * sizeof(int); // we have two "ints" for our header
if(length < (MAX_PACKET_SIZE - packetHeaderSize)) { // our networkPacket buffer size minus the size of the header info
int *pIntData = (int *)&networkPacket[0];
// header info
pIntData[0] = packetNumber++;
pIntData[1] = packetID;
pIntData[2] = objectIndex;
// copy data in after the header
memcpy( &networkPacket[packetHeaderSize], data, length );
NSData *packet = [NSData dataWithBytes: networkPacket length: (length+packetHeaderSize)];
if(howtosend == YES) {
[session sendDataToAllPeers:packet withDataMode:GKSendDataReliable error:nil];
} else {
[session sendDataToAllPeers:packet withDataMode:GKSendDataUnreliable error:nil];
}
}
}
The data was sent successfully but on the "receive side":
GameLevelInfo *gameLevelInfo = (GameLevelInfo*)data;
NSData *content = gameLevelInfo->levelData;
The "content" was invalid object.
Any help will be appreciated, thanks :) | 0 |
11,594,286 | 07/21/2012 17:20:25 | 1,255,700 | 03/07/2012 21:04:27 | 5 | 0 | Mysql and Ruby on Rails configuration in windows7 x86 | I install the RailsInstaller downloading from this site http://railsinstaller.org/ and also install the mysqlInstaller downloading from this site http://dev.mysql.com/downloads/. Both I have installed in c:\ drive. I have also installed mysql driver from ruby command gem install mysql. Now I haven't Idea how to configure mysql in Ruby on Rails.
I have seen this answer http://stackoverflow.com/questions/1557267/mysql-driver-for-rails-in-windows-7-x64/1584366#1584366 they tell to replace libmySQL.dll but where to replace I didn't find such file.
I can anyone have Idea about my problem. | mysql | ruby-on-rails | null | null | null | null | open | Mysql and Ruby on Rails configuration in windows7 x86
===
I install the RailsInstaller downloading from this site http://railsinstaller.org/ and also install the mysqlInstaller downloading from this site http://dev.mysql.com/downloads/. Both I have installed in c:\ drive. I have also installed mysql driver from ruby command gem install mysql. Now I haven't Idea how to configure mysql in Ruby on Rails.
I have seen this answer http://stackoverflow.com/questions/1557267/mysql-driver-for-rails-in-windows-7-x64/1584366#1584366 they tell to replace libmySQL.dll but where to replace I didn't find such file.
I can anyone have Idea about my problem. | 0 |
11,594,287 | 07/21/2012 17:20:30 | 411,226 | 08/04/2010 20:02:32 | 38 | 2 | Dispatcher madness, how am i still in the background thread or is Visual Studio wrong? | Okay I've tried various different solutions and I'm going a bit insane so please bare with me.
Essentially I am invoking a service module call from my viewmodel in the background thread by using a background worker, all fine and dandy.
The service module method has an action parameter which is invoked when the service returns. Now I need to get back to the UI thread at this point to invoke the action (I have also tried getting back to the UI thread in my viewmodel method which is invoked from the service module.)
So to the crux of the matter I have tried
Application.Current.RootVisual.Dispatcher.BeginInvoke(() => code stuff here);
Which produces invalid cross thread access (fine I cant get to rootvisual here I understand)
I then tried to get the Dispatcher a different way as below
Deployment.Current.Dispatcher.BeginInvoke() => code here);
I have also tried a static class which has a Dispatcher property which I set in my application startup method and then try invoke using that.
Whilst using the Deployment dispatcher and my static class's dispatcher do not produce invalid cross thread access, the crux that has me so confused is that if i breakpoint inside the code that is being invoked by these dispatchers then I get this **System.Threading.Thread.CurrentThread.ThreadState is Background**
I can however update my properties in my view model and the view does indeed update without an issue, but I want to know if there is still something going wrong here and this will be a problem in the future.
Thanks for your time
| wpf | silverlight | mvvm | dispatcher | null | null | open | Dispatcher madness, how am i still in the background thread or is Visual Studio wrong?
===
Okay I've tried various different solutions and I'm going a bit insane so please bare with me.
Essentially I am invoking a service module call from my viewmodel in the background thread by using a background worker, all fine and dandy.
The service module method has an action parameter which is invoked when the service returns. Now I need to get back to the UI thread at this point to invoke the action (I have also tried getting back to the UI thread in my viewmodel method which is invoked from the service module.)
So to the crux of the matter I have tried
Application.Current.RootVisual.Dispatcher.BeginInvoke(() => code stuff here);
Which produces invalid cross thread access (fine I cant get to rootvisual here I understand)
I then tried to get the Dispatcher a different way as below
Deployment.Current.Dispatcher.BeginInvoke() => code here);
I have also tried a static class which has a Dispatcher property which I set in my application startup method and then try invoke using that.
Whilst using the Deployment dispatcher and my static class's dispatcher do not produce invalid cross thread access, the crux that has me so confused is that if i breakpoint inside the code that is being invoked by these dispatchers then I get this **System.Threading.Thread.CurrentThread.ThreadState is Background**
I can however update my properties in my view model and the view does indeed update without an issue, but I want to know if there is still something going wrong here and this will be a problem in the future.
Thanks for your time
| 0 |
11,594,280 | 07/21/2012 17:20:05 | 263,132 | 02/16/2009 22:41:10 | 1,278 | 22 | Collection as an attribute in EmberJS? (One-to-many relation) | In EmberJS I want to create a model that has a field that is a collection of other models. I figured this would be an easy thing, but I can't get it to work.
My current approach, as demonstrated in the JSFiddle below, is to create the two models (in this case `Foo` and `Bar`) and a collection model for `Bar`s (`BarCollection`). Then I give the `Foo` a `BarCollection` as an attribute, and then try to add `Bar`s to the collection. It doesn't work. No errors are thrown, and the collection exists, but no elements are ever added to it.
http://jsfiddle.net/tbxhQ/1/ | javascript | emberjs | null | null | null | null | open | Collection as an attribute in EmberJS? (One-to-many relation)
===
In EmberJS I want to create a model that has a field that is a collection of other models. I figured this would be an easy thing, but I can't get it to work.
My current approach, as demonstrated in the JSFiddle below, is to create the two models (in this case `Foo` and `Bar`) and a collection model for `Bar`s (`BarCollection`). Then I give the `Foo` a `BarCollection` as an attribute, and then try to add `Bar`s to the collection. It doesn't work. No errors are thrown, and the collection exists, but no elements are ever added to it.
http://jsfiddle.net/tbxhQ/1/ | 0 |
11,594,282 | 07/21/2012 17:20:13 | 230,717 | 12/13/2009 15:50:41 | 4,340 | 148 | When I should make sequence from lazy sequence | I'm reading [Programming Clojure][1] now and I find out next example
(defn by-pairs [coll]
(let
[take-pair (fn [c] (when (next c) (take 2 c)))]
(lazy-seq
(when-let [pair (seq (take-pair coll))] ;seq calls here
(cons pair (by-pairs (rest coll)))))))
it breaks list into pairs, like
(println (by-pairs [1 2 1])) ((1 2) (2 1))
(println (by-pairs [1 2 1 3])) ((1 2) (2 1) (1 3))
(println (by-pairs [])) ()
(println (by-pairs [1])) ()
What I can not get is why we should invoke seq on take-pair result? So why we can not just write
(defn by-pairs [coll]
(let
[take-pair (fn [c] (when (next c) (take 2 c)))]
(lazy-seq
(when-let [pair (take-pair coll)]
(cons pair (by-pairs (rest coll)))))))
In witch cases there are will be different results or are there are any performance reasons?
[1]: http://pragprog.com/book/shcloj2/programming-clojure | clojure | null | null | null | null | null | open | When I should make sequence from lazy sequence
===
I'm reading [Programming Clojure][1] now and I find out next example
(defn by-pairs [coll]
(let
[take-pair (fn [c] (when (next c) (take 2 c)))]
(lazy-seq
(when-let [pair (seq (take-pair coll))] ;seq calls here
(cons pair (by-pairs (rest coll)))))))
it breaks list into pairs, like
(println (by-pairs [1 2 1])) ((1 2) (2 1))
(println (by-pairs [1 2 1 3])) ((1 2) (2 1) (1 3))
(println (by-pairs [])) ()
(println (by-pairs [1])) ()
What I can not get is why we should invoke seq on take-pair result? So why we can not just write
(defn by-pairs [coll]
(let
[take-pair (fn [c] (when (next c) (take 2 c)))]
(lazy-seq
(when-let [pair (take-pair coll)]
(cons pair (by-pairs (rest coll)))))))
In witch cases there are will be different results or are there are any performance reasons?
[1]: http://pragprog.com/book/shcloj2/programming-clojure | 0 |
11,594,303 | 07/21/2012 17:22:08 | 1,228,914 | 02/23/2012 16:59:13 | 156 | 4 | Nodejs asynchronous confusion | I can't seem to grasp how to maintain async control flow with NodeJs. All of the nesting makes the code very hard to read in my opinion. I'm a novice, so I'm probably missing the big picture.
What is wrong with simply coding something like this...
function first() {
var object = {
aProperty: 'stuff',
anArray: ['html', 'html'];
};
second(object);
}
function second(object) {
for (var i = 0; i < object.anArray.length; i++) {
third(object.anArray[i]);
};
}
function third(html) {
// Parse html
}
first();
| node.js | asynchronous | null | null | null | null | open | Nodejs asynchronous confusion
===
I can't seem to grasp how to maintain async control flow with NodeJs. All of the nesting makes the code very hard to read in my opinion. I'm a novice, so I'm probably missing the big picture.
What is wrong with simply coding something like this...
function first() {
var object = {
aProperty: 'stuff',
anArray: ['html', 'html'];
};
second(object);
}
function second(object) {
for (var i = 0; i < object.anArray.length; i++) {
third(object.anArray[i]);
};
}
function third(html) {
// Parse html
}
first();
| 0 |
11,594,304 | 07/21/2012 17:22:21 | 95,735 | 04/24/2009 20:59:35 | 5,805 | 177 | How to save Python in-memory dictionary to a file as a Python source code? | How to get Python **source code** representation of in-memory Python dictionary?
I decided to ask this question after reading Thomas Kluyver's [comment][1] on Rob Galanakis' blog post titled [Why bother with python and config files?][2] In his comment Thomas states
> But if you want any way to change settings inside the application
> (like a preferences dialog), there’s no good way to automatically
> write a correct Python file.
[1]: http://www.robg3d.com/?p=1000#comment-31367
[2]: http://www.robg3d.com/?p=1000 | python | serialization | configuration | dictionary | code-generation | null | open | How to save Python in-memory dictionary to a file as a Python source code?
===
How to get Python **source code** representation of in-memory Python dictionary?
I decided to ask this question after reading Thomas Kluyver's [comment][1] on Rob Galanakis' blog post titled [Why bother with python and config files?][2] In his comment Thomas states
> But if you want any way to change settings inside the application
> (like a preferences dialog), there’s no good way to automatically
> write a correct Python file.
[1]: http://www.robg3d.com/?p=1000#comment-31367
[2]: http://www.robg3d.com/?p=1000 | 0 |
11,594,289 | 07/21/2012 17:20:33 | 209,628 | 11/12/2009 14:04:35 | 3 | 1 | Why EF 5 is not available on .Net 4? | I wanted to upgrade my app to EF 5 to take advantage of features like enum support spatial etc. However, I was not able to upgrade unless I move to .Net 4.5. I would like to know what features of .Net 4.5 does EF 5 use that it can not be done in .Net 4.0? | .net | .net-4.5 | entity-framework-5 | null | null | null | open | Why EF 5 is not available on .Net 4?
===
I wanted to upgrade my app to EF 5 to take advantage of features like enum support spatial etc. However, I was not able to upgrade unless I move to .Net 4.5. I would like to know what features of .Net 4.5 does EF 5 use that it can not be done in .Net 4.0? | 0 |
11,594,306 | 07/21/2012 17:23:01 | 1,077,533 | 12/02/2011 14:05:33 | 47 | 0 | IF works, SWITCH not | <input type="text" name="importo_estratto" />
<input type="text" name="numeri_giocati" />
<input type="submit" id="submit" name="submit" />
$(document).ready(function() {
$('input[name=submit]').click(function() {
var importo_estratto = $('input[name=importo_estratto]').val();
var numeri_giocati = $('input[name=numeri_giocati]').val();
// ESTRATTO
if (importo_estratto != '') {
switch(numeri_giocati) {
case 1: paga = 11.23; break;
case 2: paga = 5.62; break;
case 3: paga = 3.74; break;
case 4: paga = 2.81; break;
case 5: paga = 2.25; break;
case 6: paga = 1.87; break;
case 7: paga = 1.60; break;
case 8: paga = 1.40; break;
case 9: paga = 1.25; break;
case 10: paga = 1.12; break;
}
/*if (numeri_giocati == 1) {
var paga = 11.23;
} else if (numeri_giocati == 2) {
var paga = 5.62;
} else if (numeri_giocati == 3) {
var paga = 3.74;
} else if (numeri_giocati == 4) {
var paga = 2.81;
} else if (numeri_giocati == 5) {
var paga = 2.25;
} else if (numeri_giocati == 6) {
var paga = 1.87;
} else if (numeri_giocati == 7) {
var paga = 1.60;
} else if (numeri_giocati == 8) {
var paga = 1.40;
} else if (numeri_giocati == 9) {
var paga = 1.25;
} else if (numeri_giocati == 10) {
var paga = 1.12;
}*/
alert(paga);
} else {
var tot_estratto = 0;
}
return false;
});
});
I need your help.
I don't know why, but the IF works and the SWITCH not.
The alert outputs "undefined" instead of the value "paga", but everything seems to be ok for me.
Can someone help me, please?
Thank you very much | jquery | null | null | null | null | null | open | IF works, SWITCH not
===
<input type="text" name="importo_estratto" />
<input type="text" name="numeri_giocati" />
<input type="submit" id="submit" name="submit" />
$(document).ready(function() {
$('input[name=submit]').click(function() {
var importo_estratto = $('input[name=importo_estratto]').val();
var numeri_giocati = $('input[name=numeri_giocati]').val();
// ESTRATTO
if (importo_estratto != '') {
switch(numeri_giocati) {
case 1: paga = 11.23; break;
case 2: paga = 5.62; break;
case 3: paga = 3.74; break;
case 4: paga = 2.81; break;
case 5: paga = 2.25; break;
case 6: paga = 1.87; break;
case 7: paga = 1.60; break;
case 8: paga = 1.40; break;
case 9: paga = 1.25; break;
case 10: paga = 1.12; break;
}
/*if (numeri_giocati == 1) {
var paga = 11.23;
} else if (numeri_giocati == 2) {
var paga = 5.62;
} else if (numeri_giocati == 3) {
var paga = 3.74;
} else if (numeri_giocati == 4) {
var paga = 2.81;
} else if (numeri_giocati == 5) {
var paga = 2.25;
} else if (numeri_giocati == 6) {
var paga = 1.87;
} else if (numeri_giocati == 7) {
var paga = 1.60;
} else if (numeri_giocati == 8) {
var paga = 1.40;
} else if (numeri_giocati == 9) {
var paga = 1.25;
} else if (numeri_giocati == 10) {
var paga = 1.12;
}*/
alert(paga);
} else {
var tot_estratto = 0;
}
return false;
});
});
I need your help.
I don't know why, but the IF works and the SWITCH not.
The alert outputs "undefined" instead of the value "paga", but everything seems to be ok for me.
Can someone help me, please?
Thank you very much | 0 |
11,713,541 | 07/29/2012 22:28:08 | 568,508 | 01/09/2011 02:46:19 | 1,754 | 79 | Java run interface method on parent thread? | Does anyone know of a Java equivalent class to the Handler found for Android? For example a given class implements a callback interface. Callback interface methods are called from child threads, but the given class implements this callback.
The callback method's thread is that of the child, not the implementing class... How can I run code back on the implementing class, similar to Android's Handler class, where callbacks are run on the original caller's thread not on the child.
http://developer.android.com/reference/android/os/Handler.html
| java | java-ee | null | null | null | 07/30/2012 12:15:51 | not a real question | Java run interface method on parent thread?
===
Does anyone know of a Java equivalent class to the Handler found for Android? For example a given class implements a callback interface. Callback interface methods are called from child threads, but the given class implements this callback.
The callback method's thread is that of the child, not the implementing class... How can I run code back on the implementing class, similar to Android's Handler class, where callbacks are run on the original caller's thread not on the child.
http://developer.android.com/reference/android/os/Handler.html
| 1 |
11,713,645 | 07/29/2012 22:47:28 | 665,159 | 03/17/2011 21:49:24 | 68 | 1 | Chrome (not in app) - facebook error Unsafe JavaScript attempt | I came across this weird bug in the facebook.com page where the AJAX loaded parts (or however you call the technique facebook uses) didn't load (e.g. the chat, the notifications etc.).
When I fired up the developer's console, it gave me this JavaScript error:
Unsafe JavaScript attempt to access frame with URL
https://www.facebook.com/ai.php[*] from frame with URL
https://www.facebook.com/.
Domains, protocols and ports must match.
*stripped quite a long base64-esque part - I think that's login data so I won't publish that.
I tried googling it and I came across several similar problems, so I dug in some more not to double post, but the other's errors where thrown when they were using the API of facebook via some kind of app. I don't do that, I just use **Chrome 20.0.1132.47** (*Mac*) to visit the facebook.com page.
The error was explained on the other posts as a security measure by Chrome (and apparently Safari, too) to prevent some cookies inside a frame to be saved outside the frame. Preventing XSS and whatnot.
THE POSTS I FOUND:
---
http://stackoverflow.com/questions/3577947/facebook-gives-unsafe-javascript-attempt-to-access-frame-with-url-error-in-chr
http://stackoverflow.com/questions/9167371/unsafe-javascript-attempt-to-access-frame-when-using-secure-browsing-on-facebook
http://stackoverflow.com/questions/10629875/the-channel-file-and-cdn
tl;dr:
----
facebook call in Chrome 20 (mac) gives error usually only given on js API calles (security measure against xss) | javascript | facebook | api | google-chrome | bugs | null | open | Chrome (not in app) - facebook error Unsafe JavaScript attempt
===
I came across this weird bug in the facebook.com page where the AJAX loaded parts (or however you call the technique facebook uses) didn't load (e.g. the chat, the notifications etc.).
When I fired up the developer's console, it gave me this JavaScript error:
Unsafe JavaScript attempt to access frame with URL
https://www.facebook.com/ai.php[*] from frame with URL
https://www.facebook.com/.
Domains, protocols and ports must match.
*stripped quite a long base64-esque part - I think that's login data so I won't publish that.
I tried googling it and I came across several similar problems, so I dug in some more not to double post, but the other's errors where thrown when they were using the API of facebook via some kind of app. I don't do that, I just use **Chrome 20.0.1132.47** (*Mac*) to visit the facebook.com page.
The error was explained on the other posts as a security measure by Chrome (and apparently Safari, too) to prevent some cookies inside a frame to be saved outside the frame. Preventing XSS and whatnot.
THE POSTS I FOUND:
---
http://stackoverflow.com/questions/3577947/facebook-gives-unsafe-javascript-attempt-to-access-frame-with-url-error-in-chr
http://stackoverflow.com/questions/9167371/unsafe-javascript-attempt-to-access-frame-when-using-secure-browsing-on-facebook
http://stackoverflow.com/questions/10629875/the-channel-file-and-cdn
tl;dr:
----
facebook call in Chrome 20 (mac) gives error usually only given on js API calles (security measure against xss) | 0 |
11,713,646 | 07/29/2012 22:47:36 | 1,420,771 | 05/28/2012 01:07:35 | 56 | 0 | Simplemodal and json data returns undefined | I'm pretty new to jquery and json so be gentle ;)
I'm trying to load json data in simplemodal (by eric martin). All I get is undefined returns.
My json looks like this (minified):
{
"product": {
"id": 2140679,
"vid": 3376388,
"image": 2749528,
"brand": {
"id": 69118,
"image": 0,
"url": "brands/joopv",
"title": "Joop.V",
"count": 4,
"feat": true
},
"code": "19",
"ean": "19",
"sku": "19",
"score": false,
"price": {
"price": 19.95,
"price_incl": 23.7405,
"price_excl": 19.95,
"price_old": 0,
"price_old_incl": 0,
"price_old_excl": 0
},
"price_cost": 0,
"weight": 0,
"volume": 0,
"colli": 0,
"size": {
"x": 0,
"y": 0,
"z": 0
},
"unit": false,
"tax": 0.19,
"url": "joopv-testproduct.html",
"title": "testProduct",
"fulltitle": "Joop.V testProduct",
"variant": "Maat 100",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure d...",
"stock": {
"available": true,
"on_stock": true,
"track": true,
"level": 10,
"minimum": 1,
"maximum": 10,
"delivery": false
},
"content": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborumgesneden en valt dus zeer mooi. Een echte aanrader!",
etcetc....
My Jquery:
<script type="text/javascript">
$('.opener').click(function (event) {
var url = $(this).attr("href")+'/?format=json';
$('#formVariants').modal({
onShow:function(dialog) {
$.getJSON(url, function(data) {
$.each(data.product, function(index, product){
contentHtml = '' + product.id + '';
})
$('.formVariantsContent').append(contentHtml);
});
}
});
return false
})
</script>
My HTML
<!-- modal content -->
<div id="formVariants">
<p>Om dit product toe te voegen moet u een maat kiezen!</p>
<div class="formVariantsContent"></div>
</div>
</div>
I really can't see what I'm doing wrong, so any help is greatly appreciated!
| jquery | json | simplemodal | null | null | null | open | Simplemodal and json data returns undefined
===
I'm pretty new to jquery and json so be gentle ;)
I'm trying to load json data in simplemodal (by eric martin). All I get is undefined returns.
My json looks like this (minified):
{
"product": {
"id": 2140679,
"vid": 3376388,
"image": 2749528,
"brand": {
"id": 69118,
"image": 0,
"url": "brands/joopv",
"title": "Joop.V",
"count": 4,
"feat": true
},
"code": "19",
"ean": "19",
"sku": "19",
"score": false,
"price": {
"price": 19.95,
"price_incl": 23.7405,
"price_excl": 19.95,
"price_old": 0,
"price_old_incl": 0,
"price_old_excl": 0
},
"price_cost": 0,
"weight": 0,
"volume": 0,
"colli": 0,
"size": {
"x": 0,
"y": 0,
"z": 0
},
"unit": false,
"tax": 0.19,
"url": "joopv-testproduct.html",
"title": "testProduct",
"fulltitle": "Joop.V testProduct",
"variant": "Maat 100",
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure d...",
"stock": {
"available": true,
"on_stock": true,
"track": true,
"level": 10,
"minimum": 1,
"maximum": 10,
"delivery": false
},
"content": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborumgesneden en valt dus zeer mooi. Een echte aanrader!",
etcetc....
My Jquery:
<script type="text/javascript">
$('.opener').click(function (event) {
var url = $(this).attr("href")+'/?format=json';
$('#formVariants').modal({
onShow:function(dialog) {
$.getJSON(url, function(data) {
$.each(data.product, function(index, product){
contentHtml = '' + product.id + '';
})
$('.formVariantsContent').append(contentHtml);
});
}
});
return false
})
</script>
My HTML
<!-- modal content -->
<div id="formVariants">
<p>Om dit product toe te voegen moet u een maat kiezen!</p>
<div class="formVariantsContent"></div>
</div>
</div>
I really can't see what I'm doing wrong, so any help is greatly appreciated!
| 0 |
11,713,654 | 07/29/2012 22:48:52 | 1,552,271 | 07/25/2012 16:24:42 | 1 | 0 | webbrowser dll file | I was wondering where on my computer I can find the dll file for the web browser control. The reason I need it is because I'd like to modify it for my own use, as I have found that being IE based, the webBrowser control doesn't give me everything I need, and I need to add various functions. Where can I find the dll for it?
Thanks. | c# | dll | webbrowser | custom-controls | null | null | open | webbrowser dll file
===
I was wondering where on my computer I can find the dll file for the web browser control. The reason I need it is because I'd like to modify it for my own use, as I have found that being IE based, the webBrowser control doesn't give me everything I need, and I need to add various functions. Where can I find the dll for it?
Thanks. | 0 |
11,713,657 | 07/29/2012 22:49:09 | 1,250,526 | 03/05/2012 18:34:44 | 45 | 1 | Stylesheet not working with Code Igniter | I am trying to fit a stylesheet into view with CodeIgniter, please bare in mind I am new to CI.
So the stylesheet seems to be included right and I am checking the location, but it still doesn't seem to change a thing..
this is my view:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>newsletter</title>
<link rel="stylesheet" href="<?php echo base_url(); ?>application/css/style.css" media="screen" />
</head>
<body>
<label for="name"> HI TESTING STYLING & EMAILING</label>
<div id="newsletter_form">
<?php echo form_open('email/send'); ?>
<?php
$name_data = array(
'name' => 'name',
'id' => 'name',
'value' => set_value('name')
);
?>
<p><label for="name">Name: </label> <?php echo form_input($name_data); ?></p>
<p><label for="email">Email Address: </label><input type="text" name="email" id="email" value="<?php echo set_value('email'); ?>">
<p><?php echo form_submit('submit', 'Submit'); ?></p>
<?php echo base_url(); ?>application/css/style.css
<?php echo validation_errors('<p class="error">'); ?>
<?php echo form_close(); ?>
</div>
</body>
</html>
as you can see I am echoing out the url just to make sure and it is correct although it is forbidden.. not sure if this is standard CI procedure or if this is the cause.. I am working on my localhost.
and this is my stylesheet...
label{
display: block;
background: #FFF;
}
.error{
color: #373737;
}
#newsletter_form{
background: #000;
width: 100px;
}
input[type=submit]{
border: 1px solid #c62828;
background: #aa2929;
color: #e3e3e3;
padding: .5em;
cursor: pointer;
}
input[type=submit]:hover{
background: #9c2222;
}
thanks!! I am confused, any help is appreciated :) | php | css | codeigniter | frameworks | null | null | open | Stylesheet not working with Code Igniter
===
I am trying to fit a stylesheet into view with CodeIgniter, please bare in mind I am new to CI.
So the stylesheet seems to be included right and I am checking the location, but it still doesn't seem to change a thing..
this is my view:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>newsletter</title>
<link rel="stylesheet" href="<?php echo base_url(); ?>application/css/style.css" media="screen" />
</head>
<body>
<label for="name"> HI TESTING STYLING & EMAILING</label>
<div id="newsletter_form">
<?php echo form_open('email/send'); ?>
<?php
$name_data = array(
'name' => 'name',
'id' => 'name',
'value' => set_value('name')
);
?>
<p><label for="name">Name: </label> <?php echo form_input($name_data); ?></p>
<p><label for="email">Email Address: </label><input type="text" name="email" id="email" value="<?php echo set_value('email'); ?>">
<p><?php echo form_submit('submit', 'Submit'); ?></p>
<?php echo base_url(); ?>application/css/style.css
<?php echo validation_errors('<p class="error">'); ?>
<?php echo form_close(); ?>
</div>
</body>
</html>
as you can see I am echoing out the url just to make sure and it is correct although it is forbidden.. not sure if this is standard CI procedure or if this is the cause.. I am working on my localhost.
and this is my stylesheet...
label{
display: block;
background: #FFF;
}
.error{
color: #373737;
}
#newsletter_form{
background: #000;
width: 100px;
}
input[type=submit]{
border: 1px solid #c62828;
background: #aa2929;
color: #e3e3e3;
padding: .5em;
cursor: pointer;
}
input[type=submit]:hover{
background: #9c2222;
}
thanks!! I am confused, any help is appreciated :) | 0 |
11,227,000 | 06/27/2012 13:09:49 | 1,053,205 | 11/18/2011 05:51:57 | 63 | 0 | LLBLGen viewing generated SQL statement | I'm using LLBLGen to access a SQL Express database using LLBLGen runtime framework. Using Visual Studio 2010.
I have created a predicate expression, however It does not seem to be doing what I thought it should, how can I view the Generated SQL sent to the database?
thank you in advance. | sql | sql-server-2008 | llblgenpro | llblgen | null | null | open | LLBLGen viewing generated SQL statement
===
I'm using LLBLGen to access a SQL Express database using LLBLGen runtime framework. Using Visual Studio 2010.
I have created a predicate expression, however It does not seem to be doing what I thought it should, how can I view the Generated SQL sent to the database?
thank you in advance. | 0 |
11,227,001 | 06/27/2012 13:09:59 | 1,460,768 | 06/16/2012 14:42:02 | 5 | 0 | Layout issues with ssrs-2008 | I have some trouble with the layout of a custom invoice report for CRM 2011 based on fetch xml, created in ssrs-2008.
One dataset can contain several invoices. The details have on parent group, grouped on Invoice Number.
The invoice header is located in a rectangle in the header row of the group and is repeated to get the report header on all pages.
The invoice footer is located in a rectangle in the footer row of the group. The parent group is followed a pagebreak to make sure that every invoice starts on a new page. So far so good...
My problem now is that the invoice footer has to be placed at the bottom of the last page, and the details can only have a certain height. If the height is exceeded it must continue on the next page. Is there any way that I can achieve this in ssrs-2008?
I already tried playing with the number of lines in the details, but since the line height is dynamic (a invoice line description may need several text lines) this won't work.
Any help is appreciated!! | ssrs-2008 | dynamics-crm-2011 | null | null | null | null | open | Layout issues with ssrs-2008
===
I have some trouble with the layout of a custom invoice report for CRM 2011 based on fetch xml, created in ssrs-2008.
One dataset can contain several invoices. The details have on parent group, grouped on Invoice Number.
The invoice header is located in a rectangle in the header row of the group and is repeated to get the report header on all pages.
The invoice footer is located in a rectangle in the footer row of the group. The parent group is followed a pagebreak to make sure that every invoice starts on a new page. So far so good...
My problem now is that the invoice footer has to be placed at the bottom of the last page, and the details can only have a certain height. If the height is exceeded it must continue on the next page. Is there any way that I can achieve this in ssrs-2008?
I already tried playing with the number of lines in the details, but since the line height is dynamic (a invoice line description may need several text lines) this won't work.
Any help is appreciated!! | 0 |
11,227,008 | 06/27/2012 13:10:22 | 1,122,379 | 12/30/2011 05:30:59 | 6 | 0 | Salesforce error A workflow or approval field update caused an error when saving this record | I have one object with the name application. I am trying to update all the records of that object at that time it is throwing error message "A workflow or approval field update caused an error when saving this record. Contact your administrator to resolve it.
Division undefined: []" . Why i am getting this error? Application object having some workflow rules with the field update action. I am trying to upadte xyz field with abc field. abc is a formul field it is returning value null. i am updating xyz field with null, i think that reason only i am getting this error. Is this correct or not, if it is correct how to resolve this issue. Please let me know.
Thanks,
Vinod. | salesforce | null | null | null | null | null | open | Salesforce error A workflow or approval field update caused an error when saving this record
===
I have one object with the name application. I am trying to update all the records of that object at that time it is throwing error message "A workflow or approval field update caused an error when saving this record. Contact your administrator to resolve it.
Division undefined: []" . Why i am getting this error? Application object having some workflow rules with the field update action. I am trying to upadte xyz field with abc field. abc is a formul field it is returning value null. i am updating xyz field with null, i think that reason only i am getting this error. Is this correct or not, if it is correct how to resolve this issue. Please let me know.
Thanks,
Vinod. | 0 |
11,227,010 | 06/27/2012 13:10:33 | 1,485,682 | 06/27/2012 12:46:25 | 1 | 0 | Error when trying to connect to web-service | I have an external web-service: `http://188.254.16.92:7777/gateway/services/SID0003022?WSDL`
When I'm trying to connect to it (by the use of XML Spy or Informatica Powercenter), I receive an error:
File http://188.254.16.92:7777/gateway/services/SID0003022?WSDL is not valid.
File http://188.254.16.92:7777/gateway/services/SID0003022/N1503900007/SID0003022/P48559386/OwsmImport.xsd is not valid.
Invalid XML schema: ''tns:Include' is already declared in schema document 'http://188.254.16.92:7777/gateway/services/SID0003022/P1139237197/SID0003022/N1503900007/SID0003022/P48559386/OwsmImport.xsd'.'
Error location: xs:schema / xs:element
As far as I see there is no problem with xsd-schema.. I'm quite new to this topic so I apologize if the question is a stupid one.
Thank you! | web-services | soap | xsd | null | null | null | open | Error when trying to connect to web-service
===
I have an external web-service: `http://188.254.16.92:7777/gateway/services/SID0003022?WSDL`
When I'm trying to connect to it (by the use of XML Spy or Informatica Powercenter), I receive an error:
File http://188.254.16.92:7777/gateway/services/SID0003022?WSDL is not valid.
File http://188.254.16.92:7777/gateway/services/SID0003022/N1503900007/SID0003022/P48559386/OwsmImport.xsd is not valid.
Invalid XML schema: ''tns:Include' is already declared in schema document 'http://188.254.16.92:7777/gateway/services/SID0003022/P1139237197/SID0003022/N1503900007/SID0003022/P48559386/OwsmImport.xsd'.'
Error location: xs:schema / xs:element
As far as I see there is no problem with xsd-schema.. I'm quite new to this topic so I apologize if the question is a stupid one.
Thank you! | 0 |
11,227,012 | 06/27/2012 13:10:37 | 1,053,358 | 11/18/2011 08:00:03 | 1 | 0 | JAXB. Validating XML by two xsd | Does it possible to validate xml while unmarshaling by two xsd?
I know that you unmarshal xml to object with several contexts by doing this:
context = JAXBContext.newInstance("onepackagecontext:secondpackagecontext");
I can use one schema for validation:
unmarshaller.setSchema(getSchema(url));
What could I do so that use two XSD for validation? | java | java-ee | jaxb | null | null | null | open | JAXB. Validating XML by two xsd
===
Does it possible to validate xml while unmarshaling by two xsd?
I know that you unmarshal xml to object with several contexts by doing this:
context = JAXBContext.newInstance("onepackagecontext:secondpackagecontext");
I can use one schema for validation:
unmarshaller.setSchema(getSchema(url));
What could I do so that use two XSD for validation? | 0 |
11,227,013 | 06/27/2012 13:10:45 | 1,485,681 | 06/27/2012 12:45:46 | 1 | 0 | Application trust level issue:CookComputing xmlrpcClient.Invoke function throws an exception | I have an app that I am using the cook computing dll. When I issue this statement:
result = xmlrpcClient.Invoke (proxy, method, klarnaData);
I get an error on my shared hosting site because we have to run the site in a medium trust level. If I run it on my local machine it works just fine. The error that is retured is when on a medium trust level is:
Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
| asp.net | null | null | null | null | null | open | Application trust level issue:CookComputing xmlrpcClient.Invoke function throws an exception
===
I have an app that I am using the cook computing dll. When I issue this statement:
result = xmlrpcClient.Invoke (proxy, method, klarnaData);
I get an error on my shared hosting site because we have to run the site in a medium trust level. If I run it on my local machine it works just fine. The error that is retured is when on a medium trust level is:
Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
| 0 |
11,227,014 | 06/27/2012 13:10:48 | 1,249,936 | 03/05/2012 13:35:39 | 35 | 0 | git --mirror in post-receive hook gitolite | I add on the server with Gitolite in post-receive hook of repository line:
git push --mirror slave:repo.git
Slave - mirror of main repo
Repo - git repository
After git push on client side - all fine, but after create new branch on main server and git push - command line is hangs.
Why creation of new branch doesn't work? | git | gitolite | null | null | null | null | open | git --mirror in post-receive hook gitolite
===
I add on the server with Gitolite in post-receive hook of repository line:
git push --mirror slave:repo.git
Slave - mirror of main repo
Repo - git repository
After git push on client side - all fine, but after create new branch on main server and git push - command line is hangs.
Why creation of new branch doesn't work? | 0 |
11,227,022 | 06/27/2012 13:11:16 | 756,566 | 05/17/2011 00:45:58 | 874 | 13 | Proper way to fill a field/generate a value inside a widget | So I've got a Tkinter widget which scrapes a result online. I want it to output a few values to the widget, rather than the Python IDLE console. How would I do that? Would I programmatically/dynamically set a label? Every example I've looked up is how to put content initially into an entry widget, which is not what I want.
Like, for example, say you have a widget box
----------
[ ]
[ Search ]
[ ]
[ Output ]
----------
I want, whenever I click search, for the output values to display in the output section.
How would I do that? | python | tkinter | null | null | null | null | open | Proper way to fill a field/generate a value inside a widget
===
So I've got a Tkinter widget which scrapes a result online. I want it to output a few values to the widget, rather than the Python IDLE console. How would I do that? Would I programmatically/dynamically set a label? Every example I've looked up is how to put content initially into an entry widget, which is not what I want.
Like, for example, say you have a widget box
----------
[ ]
[ Search ]
[ ]
[ Output ]
----------
I want, whenever I click search, for the output values to display in the output section.
How would I do that? | 0 |
11,227,023 | 06/27/2012 13:11:18 | 1,250,177 | 03/05/2012 15:32:36 | 207 | 11 | twitter bootstrap popover plugin bug - this.isHTML is not a function | I copied the example straight from their page:
http://jsfiddle.net/D2RLR/631/
... and I get the following error:
this.isHTML is not a function
[Break On This Error]
$tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
Any thoughts? | javascript | jquery | twitter-bootstrap | popover | null | null | open | twitter bootstrap popover plugin bug - this.isHTML is not a function
===
I copied the example straight from their page:
http://jsfiddle.net/D2RLR/631/
... and I get the following error:
this.isHTML is not a function
[Break On This Error]
$tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
Any thoughts? | 0 |
11,387,162 | 07/08/2012 22:14:18 | 1,482,261 | 06/26/2012 09:34:45 | 1 | 0 | Silverlight/Flash content reloading every time when using Fancybox inline | I'm preloading embed Silverlight app on my page(inline content, display:block) so when I'm clicking on specific buttons on page Silverlight recieves some values and opens in Fancybox window.
But this works correctly only in Firefox browser. In other browsers everytime I call Fancybox inline window Silverlight app starts loading again (takes about 5-10 seconds) and only then shows the results.
Tried the same with embed youtube videos as inline content. When I play video and then close fancybox, the video stops playing, at least sound disappears(seems like being removed from dom) in every browser except Firefox.
How can I prevent reloading embed content in fancybox inline? | fancybox | fancybox-2 | null | null | null | null | open | Silverlight/Flash content reloading every time when using Fancybox inline
===
I'm preloading embed Silverlight app on my page(inline content, display:block) so when I'm clicking on specific buttons on page Silverlight recieves some values and opens in Fancybox window.
But this works correctly only in Firefox browser. In other browsers everytime I call Fancybox inline window Silverlight app starts loading again (takes about 5-10 seconds) and only then shows the results.
Tried the same with embed youtube videos as inline content. When I play video and then close fancybox, the video stops playing, at least sound disappears(seems like being removed from dom) in every browser except Firefox.
How can I prevent reloading embed content in fancybox inline? | 0 |
11,387,127 | 07/08/2012 22:08:23 | 1,510,539 | 07/08/2012 20:29:53 | 1 | 0 | How to pass prototype function? | I'm a newbie to javascript and I need some help.
I was trying to sum radius by function, but got an undefined error:(
function sumWithFunction(func, number) {
return func() + number;
}
function Circle(X, Y, R) {
this.x = X;
this.y = Y;
this.r = R;
}
Circle.prototype.getRadius = function () {
return this.r;
}
Circle.prototype.increaseRadiusBy = function(number) {
this.r = sumWithFunction(this.getRadius, number);
}
function addFivetoIt(func) {
func(5);
}
var MyCircle = new Circle(0, 0, 10);
addFivetoIt(MyCircle.increaseRadiusBy); | javascript | prototype | null | null | null | null | open | How to pass prototype function?
===
I'm a newbie to javascript and I need some help.
I was trying to sum radius by function, but got an undefined error:(
function sumWithFunction(func, number) {
return func() + number;
}
function Circle(X, Y, R) {
this.x = X;
this.y = Y;
this.r = R;
}
Circle.prototype.getRadius = function () {
return this.r;
}
Circle.prototype.increaseRadiusBy = function(number) {
this.r = sumWithFunction(this.getRadius, number);
}
function addFivetoIt(func) {
func(5);
}
var MyCircle = new Circle(0, 0, 10);
addFivetoIt(MyCircle.increaseRadiusBy); | 0 |
11,387,172 | 07/08/2012 22:15:32 | 1,311,103 | 04/03/2012 17:53:41 | 1 | 0 | devise reconfirmable | I would like to use the devise option :reconfirmable in my user model, so whenever a user changes his email, he needs to confirm it with a link sent by email.
The big problem is, that the email gets never sent ...
My setup is with devise 2.1.2 is:
user model:
attr_accessible: unconfirmed_email, ...
devise :invitable, :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :confirmable, :omniauthable
in the initilizer devise.rb:
config.reconfirmable = true
in the form the model field unconfirmed_email gets set properly. I checked this through the console.
The first confirmation email, when a user registers on the page gets send out without problem.
I tried debugging the problem with adding this code to the initializers directory to overwrite the devise methode that gets triggered as a after_update hook:
module Devise::Models::Confirmable
def send_confirmation_instructions
debugger
end
end
it seems like send_confirmation_instructions is never called, since I never get to the debugger.
Do I somehow need to call reconfirmable, or does it gets triggered automatically when setting the model attribute "unconfirmed_email" to a new email address?
Thankfull for any help,
j. | ruby-on-rails-3 | devise | devise-confirmable | null | null | null | open | devise reconfirmable
===
I would like to use the devise option :reconfirmable in my user model, so whenever a user changes his email, he needs to confirm it with a link sent by email.
The big problem is, that the email gets never sent ...
My setup is with devise 2.1.2 is:
user model:
attr_accessible: unconfirmed_email, ...
devise :invitable, :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :confirmable, :omniauthable
in the initilizer devise.rb:
config.reconfirmable = true
in the form the model field unconfirmed_email gets set properly. I checked this through the console.
The first confirmation email, when a user registers on the page gets send out without problem.
I tried debugging the problem with adding this code to the initializers directory to overwrite the devise methode that gets triggered as a after_update hook:
module Devise::Models::Confirmable
def send_confirmation_instructions
debugger
end
end
it seems like send_confirmation_instructions is never called, since I never get to the debugger.
Do I somehow need to call reconfirmable, or does it gets triggered automatically when setting the model attribute "unconfirmed_email" to a new email address?
Thankfull for any help,
j. | 0 |
11,387,178 | 07/08/2012 22:16:57 | 963,514 | 09/25/2011 10:35:20 | 26 | 1 | Firefox type rendering bolder than other OS X browsers - is there a solution? | Are there any non-hacky html/css/jquery tricks to achieve better font rendering for Firefox users? The screenshots below (Safari 5/Chrome 20/Firefox 13) show that Firefox is rendering user-agent fonts as well as typekit served fonts much bolder.
User-agent font (Helvetica)
![User-agent font (Helvetica)][1]
Typekit-served font (Meta)
![Typekit-served font (Meta)][2]
Thanks!
[1]: http://i.stack.imgur.com/dLkWK.png
[2]: http://i.stack.imgur.com/OHAWo.png | fonts | cross-browser | text-rendering | typekit | null | null | open | Firefox type rendering bolder than other OS X browsers - is there a solution?
===
Are there any non-hacky html/css/jquery tricks to achieve better font rendering for Firefox users? The screenshots below (Safari 5/Chrome 20/Firefox 13) show that Firefox is rendering user-agent fonts as well as typekit served fonts much bolder.
User-agent font (Helvetica)
![User-agent font (Helvetica)][1]
Typekit-served font (Meta)
![Typekit-served font (Meta)][2]
Thanks!
[1]: http://i.stack.imgur.com/dLkWK.png
[2]: http://i.stack.imgur.com/OHAWo.png | 0 |
11,387,171 | 07/08/2012 22:15:26 | 109,676 | 04/27/2009 18:56:57 | 2,382 | 81 | SO is so buggy for ages |
So often when I post I get "An error occurred during submission." Resubmitting doesn't help and I am forced to refresh the page. At that point, I have to verify that I am human.
What happened to this site? I've been patiently waiting for months, maybe a year it to get better but I see no signs of improvement.
It can't be just me, because I have this issue across multiple browsers and multiple PCs.
![enter image description here][1]
[1]: http://i.stack.imgur.com/Velbp.png | bugs | null | null | null | null | 07/08/2012 22:18:38 | off topic | SO is so buggy for ages
===
So often when I post I get "An error occurred during submission." Resubmitting doesn't help and I am forced to refresh the page. At that point, I have to verify that I am human.
What happened to this site? I've been patiently waiting for months, maybe a year it to get better but I see no signs of improvement.
It can't be just me, because I have this issue across multiple browsers and multiple PCs.
![enter image description here][1]
[1]: http://i.stack.imgur.com/Velbp.png | 2 |
11,387,180 | 07/08/2012 22:17:35 | 579,114 | 01/17/2011 21:42:10 | 42 | 0 | Java ImageIO.read() fails in browser | I've made a game in Java, which naturally uses multiple images in it. I developed the game using Eclipse, and running it in Eclipse has no problems. At this point, the game is pretty much done, so I'm trying to put it on the internet, but I cannot get this game to run in a browser.
Loading it in a browser just shows a white screen, no error, just white. I know Java is up to date, I have run other java apps to test it and none of them have any problems. For a while I couldn't view the console because clicking on the blank app did nothing, but eventually I noticed that going to the notification in the taskbar allowed me to see the console. In there it lists the error as
javax.imageio.IIOException: Can't read input file!
and points me to the first image I load in my code. I have about 2 dozen images but it goes to the first one, upon commenting it out, the error redirects to the second, so I presume this is the same problem with every image. These images load fine in Eclipse, so I know the file paths are correct, somehow it doesn't show up in the browser.
The Java code which loads the first image:
image = ImageIO.read(new File("images/debug/player.jpg"));
Constants.imgPlayer = new Picture(getImage(getDocumentBase(), "images/debug/player.jpg"), image.getWidth(), image.getHeight());
This is being run when the program loads and is saving the image into this Picture class I created. All the Picture class does is hold the Image object as well as the width and height for later when I need to actually use the image. The only reason I have to use the <code>ImageIO.read()</code> is so I can get the width and height of each image.
For debugging I changed some of the code to this:
File testFile = new File("images/debug/player.jpg");
System.out.println("exists() = " + testFile.exists());
System.out.println("canRead() = " + testFile.canRead());
testFile.setReadable(true);
System.out.println("setReadable(true)");
System.out.println("canRead() = " + testFile.canRead());
image = ImageIO.read(testFile);
Constants.imgPlayer = new Picture(getImage(getDocumentBase(), "images/debug/player.jpg"), image.getWidth(), image.getHeight());
In Eclipse, everything comes out as true, it exists, can be read, and then is read and works. In the browser (Chrome by the way), everything is false, it doesn't exist, cannot be read, and then throws an error when it tries to be read.
The HTML file is at [project]/bin/FinalProject.htm, though the main class is at [project]/bin/main/FinalProject.class. I'm wondering if because they are in separate folders, the file paths need to be different. I tried placing the HTML file in the same directory as the class, but then it would say it couldn't find the class though I'm certain I changed the file path to match.
I'm not really sure what to do at this point, Google searching hasn't really helped. Any help is appreciated. | java | imageio | null | null | null | null | open | Java ImageIO.read() fails in browser
===
I've made a game in Java, which naturally uses multiple images in it. I developed the game using Eclipse, and running it in Eclipse has no problems. At this point, the game is pretty much done, so I'm trying to put it on the internet, but I cannot get this game to run in a browser.
Loading it in a browser just shows a white screen, no error, just white. I know Java is up to date, I have run other java apps to test it and none of them have any problems. For a while I couldn't view the console because clicking on the blank app did nothing, but eventually I noticed that going to the notification in the taskbar allowed me to see the console. In there it lists the error as
javax.imageio.IIOException: Can't read input file!
and points me to the first image I load in my code. I have about 2 dozen images but it goes to the first one, upon commenting it out, the error redirects to the second, so I presume this is the same problem with every image. These images load fine in Eclipse, so I know the file paths are correct, somehow it doesn't show up in the browser.
The Java code which loads the first image:
image = ImageIO.read(new File("images/debug/player.jpg"));
Constants.imgPlayer = new Picture(getImage(getDocumentBase(), "images/debug/player.jpg"), image.getWidth(), image.getHeight());
This is being run when the program loads and is saving the image into this Picture class I created. All the Picture class does is hold the Image object as well as the width and height for later when I need to actually use the image. The only reason I have to use the <code>ImageIO.read()</code> is so I can get the width and height of each image.
For debugging I changed some of the code to this:
File testFile = new File("images/debug/player.jpg");
System.out.println("exists() = " + testFile.exists());
System.out.println("canRead() = " + testFile.canRead());
testFile.setReadable(true);
System.out.println("setReadable(true)");
System.out.println("canRead() = " + testFile.canRead());
image = ImageIO.read(testFile);
Constants.imgPlayer = new Picture(getImage(getDocumentBase(), "images/debug/player.jpg"), image.getWidth(), image.getHeight());
In Eclipse, everything comes out as true, it exists, can be read, and then is read and works. In the browser (Chrome by the way), everything is false, it doesn't exist, cannot be read, and then throws an error when it tries to be read.
The HTML file is at [project]/bin/FinalProject.htm, though the main class is at [project]/bin/main/FinalProject.class. I'm wondering if because they are in separate folders, the file paths need to be different. I tried placing the HTML file in the same directory as the class, but then it would say it couldn't find the class though I'm certain I changed the file path to match.
I'm not really sure what to do at this point, Google searching hasn't really helped. Any help is appreciated. | 0 |
11,387,181 | 07/08/2012 22:17:50 | 95,195 | 04/23/2009 21:10:22 | 2,458 | 143 | What is the name of a pair of brackets inside a C# function that only exists for an extra level of scope? | Take as an example the following C# function:
static void Main(string[] args)
{
var r = new Random();
{
var i = r.Next(); ;
Console.WriteLine("i = {0}", i);
}
var action = new Action(delegate()
{
var i = r.Next();
Console.WriteLine("Delegate: i = {0}", i);
});
action();
}
The following block only exists as C# syntactic sugar to enforce an extra layer of variable scope in the source code.
{
var i = r.Next(); ;
Console.WriteLine("i = {0}", i);
}
I proved this by decompiling the generated assembly with ILSpy and getting this:
private static void Main(string[] args)
{
Random r = new Random();
int i = r.Next();
Console.WriteLine("i = {0}", i);
Action action = delegate
{
int j = r.Next();
Console.WriteLine("Delegate: i = {0}", j);
}
;
action();
}
So does this C# construct have a name? If so what is it? | c# | .net | null | null | null | null | open | What is the name of a pair of brackets inside a C# function that only exists for an extra level of scope?
===
Take as an example the following C# function:
static void Main(string[] args)
{
var r = new Random();
{
var i = r.Next(); ;
Console.WriteLine("i = {0}", i);
}
var action = new Action(delegate()
{
var i = r.Next();
Console.WriteLine("Delegate: i = {0}", i);
});
action();
}
The following block only exists as C# syntactic sugar to enforce an extra layer of variable scope in the source code.
{
var i = r.Next(); ;
Console.WriteLine("i = {0}", i);
}
I proved this by decompiling the generated assembly with ILSpy and getting this:
private static void Main(string[] args)
{
Random r = new Random();
int i = r.Next();
Console.WriteLine("i = {0}", i);
Action action = delegate
{
int j = r.Next();
Console.WriteLine("Delegate: i = {0}", j);
}
;
action();
}
So does this C# construct have a name? If so what is it? | 0 |
11,471,750 | 07/13/2012 13:45:47 | 1,518,070 | 07/11/2012 14:22:46 | 19 | 0 | JQuery - Why when I add new columns to my table it says "undefined" in the extra cells | When I add an extra 3 columns to the table my list items do not fill them. Instead it says undefined in the cells. If anyone can I ideally need a 6x6 table for my list items. Cheers.
var listOfWords = ["mat", "cat", "dog", "pit", "pot", "fog", "log", "pan", "can", "man", "pin", "gag", "sat", "pat", "tap", "sap", "tag", "gig", "gap", "nag", "sag", "gas", "pig", "dig", "got", "not", "top", "pop", "god", "mog", "cot", "cop", "cap", "cod", "kid", "kit", "get", "pet", "ten", "net", "pen", "peg", "met", "men", "mum", "run", "mug", "cup", "sun", "mud", "rim", "ram", "rat", "rip", "rag", "rug", "rot", "dad", "sad", "dim", "dip", "did", "mam", "map", "nip", "tin", "tan", "nap", "sit", "tip", "pip", "sip", "had", "him", "his", "hot", "hut", "hop", "hum", "hit", "hat", "has", "hug", "but", "big", "bet", "bad", "bad", "bed", "bud", "beg", "bug", "bun", "bus", "bat", "bit", "fit", "fin", "fun", "fig", "fan", "fat", "lap", "lot", "let", "leg", "lit" ];
var shuffledWords = listOfWords.slice(0, 6);
shuffledWords.sort(function () {
return 0.5 - Math.random();
});
var tbl = document.createElement('table');
tbl.className='tablestyle';
for (var i = 0; i < shuffledWords.length; i++) {
var word = shuffledWords[i];
var row = document.createElement('tr');
//Here is where I add the extra 3 columns
for (var j = 0; j < word.length + 3; j++){
var cell = document.createElement('td');
cell.textContent = word[j];
// IF FIREFOX USE cell.textContent = word[j]; INSTEAD
row.appendChild(cell);
}
tbl.appendChild(row);
}
document.body.appendChild(tbl); | javascript | jquery | null | null | null | null | open | JQuery - Why when I add new columns to my table it says "undefined" in the extra cells
===
When I add an extra 3 columns to the table my list items do not fill them. Instead it says undefined in the cells. If anyone can I ideally need a 6x6 table for my list items. Cheers.
var listOfWords = ["mat", "cat", "dog", "pit", "pot", "fog", "log", "pan", "can", "man", "pin", "gag", "sat", "pat", "tap", "sap", "tag", "gig", "gap", "nag", "sag", "gas", "pig", "dig", "got", "not", "top", "pop", "god", "mog", "cot", "cop", "cap", "cod", "kid", "kit", "get", "pet", "ten", "net", "pen", "peg", "met", "men", "mum", "run", "mug", "cup", "sun", "mud", "rim", "ram", "rat", "rip", "rag", "rug", "rot", "dad", "sad", "dim", "dip", "did", "mam", "map", "nip", "tin", "tan", "nap", "sit", "tip", "pip", "sip", "had", "him", "his", "hot", "hut", "hop", "hum", "hit", "hat", "has", "hug", "but", "big", "bet", "bad", "bad", "bed", "bud", "beg", "bug", "bun", "bus", "bat", "bit", "fit", "fin", "fun", "fig", "fan", "fat", "lap", "lot", "let", "leg", "lit" ];
var shuffledWords = listOfWords.slice(0, 6);
shuffledWords.sort(function () {
return 0.5 - Math.random();
});
var tbl = document.createElement('table');
tbl.className='tablestyle';
for (var i = 0; i < shuffledWords.length; i++) {
var word = shuffledWords[i];
var row = document.createElement('tr');
//Here is where I add the extra 3 columns
for (var j = 0; j < word.length + 3; j++){
var cell = document.createElement('td');
cell.textContent = word[j];
// IF FIREFOX USE cell.textContent = word[j]; INSTEAD
row.appendChild(cell);
}
tbl.appendChild(row);
}
document.body.appendChild(tbl); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.