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,541,386
07/18/2012 12:29:55
181,721
09/30/2009 10:21:00
3
1
listBox DataTemplate not picking up values
I am learning to use listBox in WPF with dataTemplate using the examples from MSDN, I can render a listBox bound to an ObservableCollection as a source and by overriding the ToString method. However, I need to render an image and some texblocks for every item. Here's my XAML: <Grid x:Class="MyAddin.WPFControls" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:c="clr-namespace:MyAddin" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" Background="Transparent" HorizontalAlignment="Stretch" Width="auto" Height="215" VerticalAlignment="Stretch" ShowGridLines="False"> <Grid.Resources> <c:People x:Key="MyFriends"/> </Grid.Resources> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <TextBlock HorizontalAlignment="Left" IsManipulationEnabled="True" Height="20" Width="300">Activity Feed</TextBlock> <ListBox Grid.Row="1" Name="listBox1" IsSynchronizedWithCurrentItem="True" BorderThickness="0" ScrollViewer.VerticalScrollBarVisibility="Auto" VerticalContentAlignment="Stretch" Margin="0,0,0,5" Background="Transparent"> <ListBox.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="60"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Border Margin="5" BorderBrush="Black" BorderThickness="1"> <Image Source="{Binding Path=Avatar}" Stretch="Fill" Width="50" Height="50" /> </Border> <StackPanel Grid.Column="1" Margin="5"> <StackPanel Orientation="Horizontal" TextBlock.FontWeight="Bold" > <TextBlock Text="{Binding Path=Firstname }" /> </StackPanel> <TextBlock Text="{Binding Path=Comment}" /> </StackPanel> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Grid> My Collection class is as following: public class People : ObservableCollection<Person> { } public class Person { private string firstName; private string comment; private Bitmap avatar; public Person(string first, string comment, Bitmap avatar) { this.firstName = first; this.comment = comment; this.avatar = avatar; } public string FirstName { get { return firstName; } set { firstName = value; } } public string Comment { get { return comment; } set { comment = value; } } public Bitmap Avatar { get { return avatar;} set { avatar = value; } } public override string ToString() { return firstName.ToString(); } } Once my addin is loaded, I am downloading my data and setting the itemsSource. People p = new People(); p.Add(new Person("Willa", "Some Comment", myAvatar)); p.Add(new Person("Isak", "Some Comment", myAvatar)); p.Add(new Person("Victor", "Some Comment", myAvatar)); this.wpfControl.listBox1.ItemsSource = p; The problem I am facing is that the items are being rendered as empty rows whereas If I remove the dataTemplate, the items are rendered fine with their firstName.
wpf
xaml
datatemplate
null
null
null
open
listBox DataTemplate not picking up values === I am learning to use listBox in WPF with dataTemplate using the examples from MSDN, I can render a listBox bound to an ObservableCollection as a source and by overriding the ToString method. However, I need to render an image and some texblocks for every item. Here's my XAML: <Grid x:Class="MyAddin.WPFControls" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:c="clr-namespace:MyAddin" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" Background="Transparent" HorizontalAlignment="Stretch" Width="auto" Height="215" VerticalAlignment="Stretch" ShowGridLines="False"> <Grid.Resources> <c:People x:Key="MyFriends"/> </Grid.Resources> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <TextBlock HorizontalAlignment="Left" IsManipulationEnabled="True" Height="20" Width="300">Activity Feed</TextBlock> <ListBox Grid.Row="1" Name="listBox1" IsSynchronizedWithCurrentItem="True" BorderThickness="0" ScrollViewer.VerticalScrollBarVisibility="Auto" VerticalContentAlignment="Stretch" Margin="0,0,0,5" Background="Transparent"> <ListBox.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="60"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Border Margin="5" BorderBrush="Black" BorderThickness="1"> <Image Source="{Binding Path=Avatar}" Stretch="Fill" Width="50" Height="50" /> </Border> <StackPanel Grid.Column="1" Margin="5"> <StackPanel Orientation="Horizontal" TextBlock.FontWeight="Bold" > <TextBlock Text="{Binding Path=Firstname }" /> </StackPanel> <TextBlock Text="{Binding Path=Comment}" /> </StackPanel> </Grid> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Grid> My Collection class is as following: public class People : ObservableCollection<Person> { } public class Person { private string firstName; private string comment; private Bitmap avatar; public Person(string first, string comment, Bitmap avatar) { this.firstName = first; this.comment = comment; this.avatar = avatar; } public string FirstName { get { return firstName; } set { firstName = value; } } public string Comment { get { return comment; } set { comment = value; } } public Bitmap Avatar { get { return avatar;} set { avatar = value; } } public override string ToString() { return firstName.ToString(); } } Once my addin is loaded, I am downloading my data and setting the itemsSource. People p = new People(); p.Add(new Person("Willa", "Some Comment", myAvatar)); p.Add(new Person("Isak", "Some Comment", myAvatar)); p.Add(new Person("Victor", "Some Comment", myAvatar)); this.wpfControl.listBox1.ItemsSource = p; The problem I am facing is that the items are being rendered as empty rows whereas If I remove the dataTemplate, the items are rendered fine with their firstName.
0
11,542,392
07/18/2012 13:19:42
1,366,650
04/30/2012 20:30:42
35
1
Can't post in wall/logout from facebook in android
At the oficial facebook developers tutorial, they say posting in users Wall on facebook is as easy as writing this single line: mFacebook.dialog(context, "feed", new PostDialogListener()); but when I try to use this, it keeps asking me to create the PostDialogListener class. Isn't that included with facebook sdk? where can I find this class? and, to logout, I must use this: mAsyncRunner.logout(getContext(), new RequestListener() { @Override public void onComplete(String response, Object state) {} @Override public void onIOException(IOException e, Object state) {} @Override public void onFileNotFoundException(FileNotFoundException e, Object state) {} @Override public void onMalformedURLException(MalformedURLException e, Object state) {} @Override public void onFacebookError(FacebookError e, Object state) {} }); And then I'm asked to create getContext() method. Facebook's tutorial is very incomplete, what must I do now? Thanks!
android
facebook
null
null
null
null
open
Can't post in wall/logout from facebook in android === At the oficial facebook developers tutorial, they say posting in users Wall on facebook is as easy as writing this single line: mFacebook.dialog(context, "feed", new PostDialogListener()); but when I try to use this, it keeps asking me to create the PostDialogListener class. Isn't that included with facebook sdk? where can I find this class? and, to logout, I must use this: mAsyncRunner.logout(getContext(), new RequestListener() { @Override public void onComplete(String response, Object state) {} @Override public void onIOException(IOException e, Object state) {} @Override public void onFileNotFoundException(FileNotFoundException e, Object state) {} @Override public void onMalformedURLException(MalformedURLException e, Object state) {} @Override public void onFacebookError(FacebookError e, Object state) {} }); And then I'm asked to create getContext() method. Facebook's tutorial is very incomplete, what must I do now? Thanks!
0
11,542,393
07/18/2012 13:19:42
1,280,608
03/20/2012 10:22:18
141
5
Lock Windows 7 session from a service
Is there a way to lock a windows session from a service? I know that a service is not executed under the same user so when i'm calling rundll32.exe user32.dll, LockWorkStation nothing is happening but is there another solution to lock the session?
session
windows-services
locking
null
null
null
open
Lock Windows 7 session from a service === Is there a way to lock a windows session from a service? I know that a service is not executed under the same user so when i'm calling rundll32.exe user32.dll, LockWorkStation nothing is happening but is there another solution to lock the session?
0
11,542,396
07/18/2012 13:19:59
1,503,543
07/05/2012 09:37:12
15
0
How to blur the background screen when click on image in windows phone 7?
in a page small image icon is there when click on that displaying the large size image.Then i need to blur the background of the screen untill he will click on cross icon. i placed background controls in a grid. please tell me...
windows-phone-7.1
null
null
null
null
null
open
How to blur the background screen when click on image in windows phone 7? === in a page small image icon is there when click on that displaying the large size image.Then i need to blur the background of the screen untill he will click on cross icon. i placed background controls in a grid. please tell me...
0
11,542,398
07/18/2012 13:20:11
1,287,840
03/23/2012 08:44:52
18
0
Computed field as link SharePoint 2010
How to define computed field in list definition. This field should show link to display form of document.
sharepoint2010
null
null
null
null
null
open
Computed field as link SharePoint 2010 === How to define computed field in list definition. This field should show link to display form of document.
0
11,594,535
07/21/2012 17:49:39
1,368,381
05/01/2012 18:43:09
1,951
153
how to format a text that I can copy/paste anywhere with data from a spreadsheet
I have a database program on a spreadsheet with data classically ordered in rows and columns, what I'm working on is a UI that allows the user to search the database and shows results like shown below. The "table" shows the result and the 15 next items in a scrollable table with most important data and a text area in the bottom that should contain the **selected item** in a format that I could copy and paste in any document while keeping the layout (new line, spacing...).Note : the script should also detect wich row in the table has the focus. This text area should provide 2 (for now) so called 'formats', one for letters as shown in the screen capture and a second with all the fields (commas or tab separated) on a couple of rows (I called it 'raw data') for any other purpose (selection with radioButtons). I managed to perform search, table populate and UI design but (*here is finally the actual question*) I'm not sure how to get the formatted text in the textarea... should I use HTML ? Below are the screen capture and the UI code I use for now, I guess the picture makes things a bit more clear, at least I hope ;-) ![enter image description here][1] function buildUi() { var app = UiApp.createApplication().setTitle("BrowseList Test") .setHeight(340).setWidth(800).setStyleAttribute("background-color","beige").setStyleAttribute('padding','20'); var scroll = app.createScrollPanel().setPixelSize(750,150) var vpanel = app.createVerticalPanel(); var cell = new Array(); var cellWidth = [45,135,150,250,50,100] var row = new Array(); for(vv=0;vv<15;++vv){ row[vv]=app.createHorizontalPanel(); vpanel.add(row[vv]); for(hh=0;hh<cellWidth.length;++hh){ cell[hh+(vv)*cellWidth.length]=app.createTextBox().setWidth(cellWidth[hh]+""); row[vv].add(cell[hh+(vv)*cellWidth.length]) } } app.add(scroll.add(vpanel)) // Initial populate var data = ss.getDataRange().getValues(); for(vv=0;vv<15;++vv){ for(hh=0;hh<cellWidth.length;++hh){ var rowpos=vv+1+offset var cellpos = hh+(vv)*cellWidth.length cell[cellpos].setValue(data[rowpos][hh]) } } var grid = app.createGrid(2,9).setWidth('700') grid.setWidget(1, 0, app.createLabel('search')); grid.setWidget(1, 1, app.createTextBox().setName('search').setId('search')); grid.setWidget(1, 2, app.createRadioButton('mode','strict')); grid.setWidget(1, 3, app.createRadioButton('mode','global').setValue(true)); grid.setWidget(1, 5, app.createLabel(' ').setWidth('100')); grid.setWidget(1, 6, app.createLabel('show mode')); grid.setWidget(1, 7, app.createRadioButton('show','letter').setValue(true)); grid.setWidget(1, 8, app.createRadioButton('show','raw data')); app.add(grid); var result = app.createTextArea().setPixelSize(700,100) app.add(result) ss.show(app); } [1]: http://i.stack.imgur.com/fVIPi.jpg
google-apps-script
null
null
null
null
null
open
how to format a text that I can copy/paste anywhere with data from a spreadsheet === I have a database program on a spreadsheet with data classically ordered in rows and columns, what I'm working on is a UI that allows the user to search the database and shows results like shown below. The "table" shows the result and the 15 next items in a scrollable table with most important data and a text area in the bottom that should contain the **selected item** in a format that I could copy and paste in any document while keeping the layout (new line, spacing...).Note : the script should also detect wich row in the table has the focus. This text area should provide 2 (for now) so called 'formats', one for letters as shown in the screen capture and a second with all the fields (commas or tab separated) on a couple of rows (I called it 'raw data') for any other purpose (selection with radioButtons). I managed to perform search, table populate and UI design but (*here is finally the actual question*) I'm not sure how to get the formatted text in the textarea... should I use HTML ? Below are the screen capture and the UI code I use for now, I guess the picture makes things a bit more clear, at least I hope ;-) ![enter image description here][1] function buildUi() { var app = UiApp.createApplication().setTitle("BrowseList Test") .setHeight(340).setWidth(800).setStyleAttribute("background-color","beige").setStyleAttribute('padding','20'); var scroll = app.createScrollPanel().setPixelSize(750,150) var vpanel = app.createVerticalPanel(); var cell = new Array(); var cellWidth = [45,135,150,250,50,100] var row = new Array(); for(vv=0;vv<15;++vv){ row[vv]=app.createHorizontalPanel(); vpanel.add(row[vv]); for(hh=0;hh<cellWidth.length;++hh){ cell[hh+(vv)*cellWidth.length]=app.createTextBox().setWidth(cellWidth[hh]+""); row[vv].add(cell[hh+(vv)*cellWidth.length]) } } app.add(scroll.add(vpanel)) // Initial populate var data = ss.getDataRange().getValues(); for(vv=0;vv<15;++vv){ for(hh=0;hh<cellWidth.length;++hh){ var rowpos=vv+1+offset var cellpos = hh+(vv)*cellWidth.length cell[cellpos].setValue(data[rowpos][hh]) } } var grid = app.createGrid(2,9).setWidth('700') grid.setWidget(1, 0, app.createLabel('search')); grid.setWidget(1, 1, app.createTextBox().setName('search').setId('search')); grid.setWidget(1, 2, app.createRadioButton('mode','strict')); grid.setWidget(1, 3, app.createRadioButton('mode','global').setValue(true)); grid.setWidget(1, 5, app.createLabel(' ').setWidth('100')); grid.setWidget(1, 6, app.createLabel('show mode')); grid.setWidget(1, 7, app.createRadioButton('show','letter').setValue(true)); grid.setWidget(1, 8, app.createRadioButton('show','raw data')); app.add(grid); var result = app.createTextArea().setPixelSize(700,100) app.add(result) ss.show(app); } [1]: http://i.stack.imgur.com/fVIPi.jpg
0
11,594,370
07/21/2012 17:30:58
557,358
12/29/2010 16:37:38
316
9
CSS - Transparency Gradient on an Image
I would like my background image to go from 100% opacity to 0% opacity. I could choose to use another image asset where I use an image editor to make the image fade opacity, however I want to use as little assets as possible. Can this be done with CSS? I know I could make several divs in which I change the opacity on each one, however this would require a lot of divs to make it look good.
css
transparency
background-image
null
null
null
open
CSS - Transparency Gradient on an Image === I would like my background image to go from 100% opacity to 0% opacity. I could choose to use another image asset where I use an image editor to make the image fade opacity, however I want to use as little assets as possible. Can this be done with CSS? I know I could make several divs in which I change the opacity on each one, however this would require a lot of divs to make it look good.
0
11,594,554
07/21/2012 17:52:06
615,364
02/13/2011 19:39:29
17
0
this keyword with select box onchange attribute in Safaari vs. Chrome, Firefox, IE
Tested in Chrome 20, FF 13, IE 9, Safari 5.1.7. Can anyone tell me why the following code works in Chrome, Firefox and IE, but not in Safari? <select id="mySelectBox" onChange="window.open(options[selectedIndex].value);"> <option value="" selected="selected" >Choose a search engine.</option> <option value="http://www.google.com" >Google</option> <option value="http://www.bing.com" >Bing</option> <option value="http://www.yahoo.com" >Yahoo</option> </select> My feeling is that Safari is doing the right thing. I shouldn't be able to reference the options property and selectedIndex property without using the this keyword or the more verbose document.getElementById('mySelectBox'). What's going on? Thanks!
javascript
safari
this
selectbox
selectedindex
null
open
this keyword with select box onchange attribute in Safaari vs. Chrome, Firefox, IE === Tested in Chrome 20, FF 13, IE 9, Safari 5.1.7. Can anyone tell me why the following code works in Chrome, Firefox and IE, but not in Safari? <select id="mySelectBox" onChange="window.open(options[selectedIndex].value);"> <option value="" selected="selected" >Choose a search engine.</option> <option value="http://www.google.com" >Google</option> <option value="http://www.bing.com" >Bing</option> <option value="http://www.yahoo.com" >Yahoo</option> </select> My feeling is that Safari is doing the right thing. I shouldn't be able to reference the options property and selectedIndex property without using the this keyword or the more verbose document.getElementById('mySelectBox'). What's going on? Thanks!
0
11,594,557
07/21/2012 17:52:30
1,540,284
07/20/2012 09:14:41
1
0
Objective C Logic of alloc method?
So I'm new to this site, not really sure what the conventions are for how to go about asking a question, but I'm just beginning with Objective-C and have a question relating to the instantiating of objects. Okay, so I know that the root class NSObject has the class methods alloc and init, and these methods are passed down to any classes that inherit NSObject, which is pretty much every class. I know the typical format for instantiating an object is like this: `MyObject *m = [[MyObject alloc]init];` But considering MyObject has the alloc and init methods inherited from NSObject, this could also theoretically work, considering that MyObject and NSObject have the same alloc and init methods (assuming that the class doesn't override them): `MyObject *m = [[NSObject alloc] init];` And it works for just instantiating, but when I try to call any method in the MyObject class, an NSException is thrown. When I switch the NSObject alloc back to MyObject alloc, it works. I just don't understand why! This is probably a basic question, but any explanation? Thanks in advance! Jake
objective-c
null
null
null
null
null
open
Objective C Logic of alloc method? === So I'm new to this site, not really sure what the conventions are for how to go about asking a question, but I'm just beginning with Objective-C and have a question relating to the instantiating of objects. Okay, so I know that the root class NSObject has the class methods alloc and init, and these methods are passed down to any classes that inherit NSObject, which is pretty much every class. I know the typical format for instantiating an object is like this: `MyObject *m = [[MyObject alloc]init];` But considering MyObject has the alloc and init methods inherited from NSObject, this could also theoretically work, considering that MyObject and NSObject have the same alloc and init methods (assuming that the class doesn't override them): `MyObject *m = [[NSObject alloc] init];` And it works for just instantiating, but when I try to call any method in the MyObject class, an NSException is thrown. When I switch the NSObject alloc back to MyObject alloc, it works. I just don't understand why! This is probably a basic question, but any explanation? Thanks in advance! Jake
0
11,594,558
07/21/2012 17:52:33
325,418
05/09/2009 15:50:29
17,485
383
For iOS apps, how to use Instruments' Memory Monitor to graph an app's memory usage?
It seems that we should rely more on Instruments' "Memory Monitor", rather than "Allocations" to tell an app's real memory usage, as discussed [in this question][1]. But for Allocations, we can pause Instruments, and then drag the up-side-down triangle to see the highest number of "Live bytes" to tell the peak allocation size -- how about for Memory Monitor, is there a way to also graph the app we are looking at, and be able to tell what the peak memory usage is? [1]: http://stackoverflow.com/questions/5518918/instruments-with-ios-why-does-memory-monitor-disagree-with-allocations
iphone
ios
ipad
instruments
null
null
open
For iOS apps, how to use Instruments' Memory Monitor to graph an app's memory usage? === It seems that we should rely more on Instruments' "Memory Monitor", rather than "Allocations" to tell an app's real memory usage, as discussed [in this question][1]. But for Allocations, we can pause Instruments, and then drag the up-side-down triangle to see the highest number of "Live bytes" to tell the peak allocation size -- how about for Memory Monitor, is there a way to also graph the app we are looking at, and be able to tell what the peak memory usage is? [1]: http://stackoverflow.com/questions/5518918/instruments-with-ios-why-does-memory-monitor-disagree-with-allocations
0
11,594,560
07/21/2012 17:52:50
1,316,617
04/06/2012 02:15:58
103
15
Anchor link keeps jumping, no matter what I do
Ok, this is driving me crazy! I'm working with a "tab like" submenu to show 3 different tables. Each link inside this submenu hides the current content and show another one. **NOTE:** for now I'll leave a direct link to the page [I'm working on][1] so you may check to problem by yourself. To avoid the <a> (anchor) jumps, I'm already trying <a onclick="return false;"> (which works fine in another site I have). In my jQuery code I'm also using "e.preventDefault();" that helps avoiding the jump to the top of the page, but even using it the page always jumps to some part of the page above the sublinks. I really don't know what else I could do to avoid this jumps. For now this is what I have inside my html: <nav id="submenu" class="menu"> <ul> <li class="current-menu-item"><a onclick="return false;" href="#" rel="statics">Sites Estáticos</a></li> <li><a onclick="return false;" href="#" rel="dynamics">Sites Dinâmicos</a></li> <li><a onclick="return false;" href="#" rel="extras">Serviços Extras</a></li> </ul> </nav> And this is my jQuery: function subSections(){ $('nav.menu li a').click(function(e){ e.preventDefault(); //this helps, but don't solve the problem var active = $(this).parent(); var currSection = $(this).attr('rel'); if(active.hasClass('current-menu-item')!=true){ // Add and remove 'current-menu-item' class $('nav.menu .current-menu-item').removeClass('current-menu-item'); active.addClass('current-menu-item'); // Hide currentSection and Show the clicked one $('.showing').fadeOut('slow', function(){ $('#'+currSection).fadeIn('slow').addClass('showing'); }).removeClass('showing'); } }); } Also, maybe there's a better way to do this "show and hide" stuff, but this seems to work fine. Well, I'll be glad if anyone can shed a light on this problem and help me! Thanks in advance! [1]: http://wp.publishyours.com.br/publishyours/planos-custos
jquery
html
anchor
page-jump
null
null
open
Anchor link keeps jumping, no matter what I do === Ok, this is driving me crazy! I'm working with a "tab like" submenu to show 3 different tables. Each link inside this submenu hides the current content and show another one. **NOTE:** for now I'll leave a direct link to the page [I'm working on][1] so you may check to problem by yourself. To avoid the <a> (anchor) jumps, I'm already trying <a onclick="return false;"> (which works fine in another site I have). In my jQuery code I'm also using "e.preventDefault();" that helps avoiding the jump to the top of the page, but even using it the page always jumps to some part of the page above the sublinks. I really don't know what else I could do to avoid this jumps. For now this is what I have inside my html: <nav id="submenu" class="menu"> <ul> <li class="current-menu-item"><a onclick="return false;" href="#" rel="statics">Sites Estáticos</a></li> <li><a onclick="return false;" href="#" rel="dynamics">Sites Dinâmicos</a></li> <li><a onclick="return false;" href="#" rel="extras">Serviços Extras</a></li> </ul> </nav> And this is my jQuery: function subSections(){ $('nav.menu li a').click(function(e){ e.preventDefault(); //this helps, but don't solve the problem var active = $(this).parent(); var currSection = $(this).attr('rel'); if(active.hasClass('current-menu-item')!=true){ // Add and remove 'current-menu-item' class $('nav.menu .current-menu-item').removeClass('current-menu-item'); active.addClass('current-menu-item'); // Hide currentSection and Show the clicked one $('.showing').fadeOut('slow', function(){ $('#'+currSection).fadeIn('slow').addClass('showing'); }).removeClass('showing'); } }); } Also, maybe there's a better way to do this "show and hide" stuff, but this seems to work fine. Well, I'll be glad if anyone can shed a light on this problem and help me! Thanks in advance! [1]: http://wp.publishyours.com.br/publishyours/planos-custos
0
11,734,644
07/31/2012 06:51:14
308,674
04/04/2010 11:32:33
559
11
Getting character direction in Actionscript 3.0?
I'm creating a small multiplayer game and I am trying to find how to get the direction the mouse is compared to where the character is.. For example, if the Character is at Point A, I would like the direction the character is facing to change so it is facing the direction at where the mouse is. I've created the direction movieclips for my character by following; http://www.mathsisfun.com/geometry/images/degrees-360.gif as a guide. I've tried numerous online code/suggestions/howtos and none of them work for me. Thanks in advance, Daniel.
actionscript-3
flash
actionscript
null
null
null
open
Getting character direction in Actionscript 3.0? === I'm creating a small multiplayer game and I am trying to find how to get the direction the mouse is compared to where the character is.. For example, if the Character is at Point A, I would like the direction the character is facing to change so it is facing the direction at where the mouse is. I've created the direction movieclips for my character by following; http://www.mathsisfun.com/geometry/images/degrees-360.gif as a guide. I've tried numerous online code/suggestions/howtos and none of them work for me. Thanks in advance, Daniel.
0
11,734,651
07/31/2012 06:51:27
1,034,298
11/07/2011 18:22:18
128
7
Storing user_id in the paper_trail versions table
I am using paper trail to audit changes to data and would like to store the user_id of the current user in addition to the "whodunnit" column that paper_trail stores by default. I had no trouble modifying the versions migration to add the user_id column. But I haven't figured out an easy way to set that column from the various models in my app. It seems like this should work: has_paper_trail :meta => { :user_id => current_user.id } And, I think it might work if I had access to the current_user in my models. But I don't. After researching this online I see there is a philosophical debate here. That's not my question though. So I'm thinking of using a gem like sentient_user or sentient_model to give me access to the current_user in my models so I can set it with something like the code above. However, adding these gems seems complicated for the little thing I'm trying to do here. I'm wondering if there is an easier way. What is the easiest way to add the user_id of the person who took the action to the versions table?
ruby-on-rails-3
audit-trail
papertrail
null
null
null
open
Storing user_id in the paper_trail versions table === I am using paper trail to audit changes to data and would like to store the user_id of the current user in addition to the "whodunnit" column that paper_trail stores by default. I had no trouble modifying the versions migration to add the user_id column. But I haven't figured out an easy way to set that column from the various models in my app. It seems like this should work: has_paper_trail :meta => { :user_id => current_user.id } And, I think it might work if I had access to the current_user in my models. But I don't. After researching this online I see there is a philosophical debate here. That's not my question though. So I'm thinking of using a gem like sentient_user or sentient_model to give me access to the current_user in my models so I can set it with something like the code above. However, adding these gems seems complicated for the little thing I'm trying to do here. I'm wondering if there is an easier way. What is the easiest way to add the user_id of the person who took the action to the versions table?
0
11,734,654
07/31/2012 06:51:33
1,420,429
05/27/2012 17:49:47
104
2
Accessing HTML table values in javascript
I am using HTML5 with phonegap. I have a table defined as follows. <table id = "myTable"> <tr><td>Name</td><td class="center">:</td><td><div id="name"></div> </td></tr> <tr><td>Age</td><td class="center">:</td><td><div id="age"></div> </td></tr> <tr><td>Country</td><td class="center">:</td><td><div id="country"></div> </td></tr> </table> I want to set values to "name", "age", and "country" from javascript. I tried it as follows. document.getElementById('name') = 'John' But this doesn't give me the required output. How can that be done? Thank you.
javascript
html
html5
null
null
null
open
Accessing HTML table values in javascript === I am using HTML5 with phonegap. I have a table defined as follows. <table id = "myTable"> <tr><td>Name</td><td class="center">:</td><td><div id="name"></div> </td></tr> <tr><td>Age</td><td class="center">:</td><td><div id="age"></div> </td></tr> <tr><td>Country</td><td class="center">:</td><td><div id="country"></div> </td></tr> </table> I want to set values to "name", "age", and "country" from javascript. I tried it as follows. document.getElementById('name') = 'John' But this doesn't give me the required output. How can that be done? Thank you.
0
11,734,655
07/31/2012 06:51:32
913,766
08/26/2011 09:22:08
1
1
Could not create framework: java.lang.ClassCastException: ihtika2.mainform.MainForm cannot be cast to ihtika2.mainform.service2.MainFormInterface2
I'm playing with the Felix and I can't understand one thing. I have some OSGi Felix bundle and I try to load and use service from this bundle. Bundle code: import com.google.code.ihtika.Vars.Ini; import ihtika2.mainform.service.MainFormInterface; import java.util.Hashtable; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.InvalidSyntaxException; import org.osgi.framework.ServiceReference; public class Activator implements BundleActivator { @Override public void start(BundleContext context) throws Exception { Hashtable<String, String> props = new Hashtable<String, String>(); props.put("Funct", "MainForm"); context.registerService(MainFormInterface.class.getName(), new MainForm(), props); // ServiceReference[] refs = context.getServiceReferences( // MainFormInterface.class.getName(), "(Funct=MainForm)"); // if (refs == null) { // System.out.println("Not Found MainForm on start"); // } else { // MainFormInterface MainForm = (MainFormInterface) context.getService(refs[0]); // MainForm.sendContext(context); // MainForm.showWindow(); // } } ****************************************** package ihtika2.mainform; import ihtika2.mainform.service.MainFormInterface; import javax.swing.SwingUtilities; import org.osgi.framework.BundleContext; /** * * @author Arthur */ public class MainForm implements MainFormInterface { // BundleContext context; @Override public void sendContext(BundleContext context) { // this.context = context; } IC_MainForm MainForm; @Override public void showWindow() { SwingUtilities.invokeLater(new Runnable() { // This creates of the application window. @Override public void run() { MainForm = new IC_MainForm(); MainForm.main(); // MainForm.main(context); } }); } @Override public void disposeWindow() { Runnable runner = new Runnable() { // This disposes of the application window. @Override public void run() { MainForm.stop(); } }; if (SwingUtilities.isEventDispatchThread()) { runner.run(); } else { try { SwingUtilities.invokeAndWait(runner); } catch (Exception ex) { ex.printStackTrace(); } } } } If I uncomment code // ServiceReference[] refs = context.getServiceReferences( // MainFormInterface.class.getName(), "(Funct=MainForm)"); // if (refs == null) { // System.out.println("Not Found MainForm on start"); // } else { // MainFormInterface MainForm = (MainFormInterface) context.getService(refs[0]); // MainForm.sendContext(context); // MainForm.showWindow(); // } form will show and all works OK. But if I try do execute this code in my "loader", then will shown error Could not create framework: java.lang.ClassCastException: ihtika2.mainform.MainForm cannot be cast to ihtika2.mainform.service2.MainFormInterface2 java.lang.ClassCastException: ihtika2.mainform.MainForm cannot be cast to ihtika2.mainform.service2.MainFormInterface2 at com.google.code.ihtika.Starter.main(Starter.java:100) Java Result: -1 Code of the loader is the package com.google.code.ihtika; import ihtika2.mainform.service2.MainFormInterface2; import java.io.File; import java.util.ArrayList; import java.util.Map; import java.util.ServiceLoader; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleException; import org.osgi.framework.InvalidSyntaxException; import org.osgi.framework.ServiceReference; import org.osgi.framework.launch.Framework; import org.osgi.framework.launch.FrameworkFactory; /** * This class provides a static {@code main()} method so that the bundle can be * run as a stand-alone host application. In such a scenario, the application * creates its own embedded OSGi framework instance and interacts with the * internal extensions to providing drawing functionality. To successfully * launch the stand-alone application, it must be run from this bundle's * installation directory using "{@code java -jar}". The locations of any * additional extensions that have to be started, have to be passed as command * line arguments to this method. */ public class Starter { private static Framework m_framework = null; /** * Enables the bundle to run as a stand-alone application. When this static * {@code main()} method is invoked, the application creates its own * embedded OSGi framework instance and interacts with the internal * extensions to provide drawing functionality. To successfully launch as a * stand-alone application, this method should be invoked from the bundle's * installation directory using "{@code java -jar}". The location of any * extension that shall be installed can be passed as parameters. <p> For * example if you build the bundles inside your workspace, maven will create * a target directory in every project. To start the application from within * your IDE you should pass: <p> * <pre> * {@code file:../servicebased.circle/target/servicebased.circle-1.0.0.jar * file:../servicebased.square/target/servicebased.square-1.0.0.jar * file:../servicebased.triangle/target/servicebased.triangle-1.0.0.jar} * </pre> * * @param args The locations of additional bundles to start. * */ public static void main(String[] args) { // Args should never be null if the application is run from the command line. // Check it anyway. ArrayList<String> locations = new ArrayList<>(); indexBundlesDir("I_Bundles/Stage_300", locations); indexBundlesDir("I_Bundles/Stage_400", locations); indexBundlesDir("I_Bundles/Stage_500", locations); // Print welcome banner. System.out.println("\nWelcome to My Launcher"); System.out.println("======================\n"); try { Map<String, String> config = ConfigUtil.createConfig(); m_framework = createFramework(config); m_framework.init(); m_framework.start(); installAndStartBundles(locations); ServiceReference[] refs; try { BundleContext bundleContext = m_framework.getBundleContext(); System.out.println(MainFormInterface2.class.getName()); refs = bundleContext.getServiceReferences( "ihtika2.mainform.service.MainFormInterface", "(Funct=MainForm)"); if (refs == null) { System.out.println("Not Found AboutForm on show!!!"); } else { Object MainForm = bundleContext.getService(refs[0]); MainFormInterface2 sdfsdf=(MainFormInterface2)MainForm; // MainForm.sendContext(bundleContext); // MainForm.showWindow(); } } catch (InvalidSyntaxException ex) { ex.printStackTrace(); } // for (Bundle testBundle : m_framework.getBundleContext().getBundles()) { // Dictionary<String, String> headerLine = testBundle.getHeaders(); // Enumeration e = headerLine.keys(); // // while (e.hasMoreElements()) { // Object key = e.nextElement(); // if (key.equals("Import-Package")) { // System.out.println(key + " - " + headerLine.get(key)); // } // System.out.println(key + " - " + headerLine.get(key)); // } // } m_framework.waitForStop(0); System.exit(0); } catch (Exception ex) { System.err.println("Could not create framework: " + ex); ex.printStackTrace(); System.exit(-1); } } private static void indexBundlesDir(String bundlesDir, ArrayList<String> locations) { File dir = new File(bundlesDir); String[] children = dir.list(); if (children == null) { // Either dir does not exist or is not a directory } else { for (int i = 0; i < children.length; i++) { // Get filename of file or directory locations.add("file:/c:/Art/Dropbox/OpenSource/MyGIT/ihtika-2/ihtika-2/MainApplication/" + bundlesDir + "/" + children[i]); } } } /** * Util method for creating an embedded Framework. Tries to create a * {@link FrameworkFactory} which is then be used to create the framework. * * @param config the configuration to create the framework with * @return a Framework with the given configuration */ private static Framework createFramework(Map<String, String> config) { ServiceLoader<FrameworkFactory> factoryLoader = ServiceLoader.load(FrameworkFactory.class); for (FrameworkFactory factory : factoryLoader) { return factory.newFramework(config); } throw new IllegalStateException("Unable to load FrameworkFactory service."); } /** * Installs and starts all bundles used by the application. Therefore the * host bundle will be started. The locations of extensions for the host * bundle can be passed in as parameters. * * @param bundleLocations the locations where extension for the host bundle * are located. Must not be {@code null}! * @throws BundleException if something went wrong while installing or * starting the bundles. */ private static void installAndStartBundles(ArrayList<String> bundleLocations) throws BundleException { BundleContext bundleContext = m_framework.getBundleContext(); // Activator bundleActivator = new Activator(); // bundleActivator.start(bundleContext); for (String location : bundleLocations) { Bundle addition = bundleContext.installBundle(location); System.out.println(location); addition.start(); } } } I can't understand - where is error. Interfaces has in the bundle (MainFormInterface) and in the loader (MainFormInterface2) and has some code package ihtika2.mainform.service; import org.osgi.framework.BundleContext; /** * * @author Arthur */ public interface MainFormInterface { public void showWindow(); public void disposeWindow(); public void sendContext(BundleContext context); } and package ihtika2.mainform.service2; import org.osgi.framework.BundleContext; /** * * @author Arthur */ public interface MainFormInterface2 { public void showWindow(); public void disposeWindow(); public void sendContext(BundleContext context); }
java
osgi
bundle
null
null
null
open
Could not create framework: java.lang.ClassCastException: ihtika2.mainform.MainForm cannot be cast to ihtika2.mainform.service2.MainFormInterface2 === I'm playing with the Felix and I can't understand one thing. I have some OSGi Felix bundle and I try to load and use service from this bundle. Bundle code: import com.google.code.ihtika.Vars.Ini; import ihtika2.mainform.service.MainFormInterface; import java.util.Hashtable; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.InvalidSyntaxException; import org.osgi.framework.ServiceReference; public class Activator implements BundleActivator { @Override public void start(BundleContext context) throws Exception { Hashtable<String, String> props = new Hashtable<String, String>(); props.put("Funct", "MainForm"); context.registerService(MainFormInterface.class.getName(), new MainForm(), props); // ServiceReference[] refs = context.getServiceReferences( // MainFormInterface.class.getName(), "(Funct=MainForm)"); // if (refs == null) { // System.out.println("Not Found MainForm on start"); // } else { // MainFormInterface MainForm = (MainFormInterface) context.getService(refs[0]); // MainForm.sendContext(context); // MainForm.showWindow(); // } } ****************************************** package ihtika2.mainform; import ihtika2.mainform.service.MainFormInterface; import javax.swing.SwingUtilities; import org.osgi.framework.BundleContext; /** * * @author Arthur */ public class MainForm implements MainFormInterface { // BundleContext context; @Override public void sendContext(BundleContext context) { // this.context = context; } IC_MainForm MainForm; @Override public void showWindow() { SwingUtilities.invokeLater(new Runnable() { // This creates of the application window. @Override public void run() { MainForm = new IC_MainForm(); MainForm.main(); // MainForm.main(context); } }); } @Override public void disposeWindow() { Runnable runner = new Runnable() { // This disposes of the application window. @Override public void run() { MainForm.stop(); } }; if (SwingUtilities.isEventDispatchThread()) { runner.run(); } else { try { SwingUtilities.invokeAndWait(runner); } catch (Exception ex) { ex.printStackTrace(); } } } } If I uncomment code // ServiceReference[] refs = context.getServiceReferences( // MainFormInterface.class.getName(), "(Funct=MainForm)"); // if (refs == null) { // System.out.println("Not Found MainForm on start"); // } else { // MainFormInterface MainForm = (MainFormInterface) context.getService(refs[0]); // MainForm.sendContext(context); // MainForm.showWindow(); // } form will show and all works OK. But if I try do execute this code in my "loader", then will shown error Could not create framework: java.lang.ClassCastException: ihtika2.mainform.MainForm cannot be cast to ihtika2.mainform.service2.MainFormInterface2 java.lang.ClassCastException: ihtika2.mainform.MainForm cannot be cast to ihtika2.mainform.service2.MainFormInterface2 at com.google.code.ihtika.Starter.main(Starter.java:100) Java Result: -1 Code of the loader is the package com.google.code.ihtika; import ihtika2.mainform.service2.MainFormInterface2; import java.io.File; import java.util.ArrayList; import java.util.Map; import java.util.ServiceLoader; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleException; import org.osgi.framework.InvalidSyntaxException; import org.osgi.framework.ServiceReference; import org.osgi.framework.launch.Framework; import org.osgi.framework.launch.FrameworkFactory; /** * This class provides a static {@code main()} method so that the bundle can be * run as a stand-alone host application. In such a scenario, the application * creates its own embedded OSGi framework instance and interacts with the * internal extensions to providing drawing functionality. To successfully * launch the stand-alone application, it must be run from this bundle's * installation directory using "{@code java -jar}". The locations of any * additional extensions that have to be started, have to be passed as command * line arguments to this method. */ public class Starter { private static Framework m_framework = null; /** * Enables the bundle to run as a stand-alone application. When this static * {@code main()} method is invoked, the application creates its own * embedded OSGi framework instance and interacts with the internal * extensions to provide drawing functionality. To successfully launch as a * stand-alone application, this method should be invoked from the bundle's * installation directory using "{@code java -jar}". The location of any * extension that shall be installed can be passed as parameters. <p> For * example if you build the bundles inside your workspace, maven will create * a target directory in every project. To start the application from within * your IDE you should pass: <p> * <pre> * {@code file:../servicebased.circle/target/servicebased.circle-1.0.0.jar * file:../servicebased.square/target/servicebased.square-1.0.0.jar * file:../servicebased.triangle/target/servicebased.triangle-1.0.0.jar} * </pre> * * @param args The locations of additional bundles to start. * */ public static void main(String[] args) { // Args should never be null if the application is run from the command line. // Check it anyway. ArrayList<String> locations = new ArrayList<>(); indexBundlesDir("I_Bundles/Stage_300", locations); indexBundlesDir("I_Bundles/Stage_400", locations); indexBundlesDir("I_Bundles/Stage_500", locations); // Print welcome banner. System.out.println("\nWelcome to My Launcher"); System.out.println("======================\n"); try { Map<String, String> config = ConfigUtil.createConfig(); m_framework = createFramework(config); m_framework.init(); m_framework.start(); installAndStartBundles(locations); ServiceReference[] refs; try { BundleContext bundleContext = m_framework.getBundleContext(); System.out.println(MainFormInterface2.class.getName()); refs = bundleContext.getServiceReferences( "ihtika2.mainform.service.MainFormInterface", "(Funct=MainForm)"); if (refs == null) { System.out.println("Not Found AboutForm on show!!!"); } else { Object MainForm = bundleContext.getService(refs[0]); MainFormInterface2 sdfsdf=(MainFormInterface2)MainForm; // MainForm.sendContext(bundleContext); // MainForm.showWindow(); } } catch (InvalidSyntaxException ex) { ex.printStackTrace(); } // for (Bundle testBundle : m_framework.getBundleContext().getBundles()) { // Dictionary<String, String> headerLine = testBundle.getHeaders(); // Enumeration e = headerLine.keys(); // // while (e.hasMoreElements()) { // Object key = e.nextElement(); // if (key.equals("Import-Package")) { // System.out.println(key + " - " + headerLine.get(key)); // } // System.out.println(key + " - " + headerLine.get(key)); // } // } m_framework.waitForStop(0); System.exit(0); } catch (Exception ex) { System.err.println("Could not create framework: " + ex); ex.printStackTrace(); System.exit(-1); } } private static void indexBundlesDir(String bundlesDir, ArrayList<String> locations) { File dir = new File(bundlesDir); String[] children = dir.list(); if (children == null) { // Either dir does not exist or is not a directory } else { for (int i = 0; i < children.length; i++) { // Get filename of file or directory locations.add("file:/c:/Art/Dropbox/OpenSource/MyGIT/ihtika-2/ihtika-2/MainApplication/" + bundlesDir + "/" + children[i]); } } } /** * Util method for creating an embedded Framework. Tries to create a * {@link FrameworkFactory} which is then be used to create the framework. * * @param config the configuration to create the framework with * @return a Framework with the given configuration */ private static Framework createFramework(Map<String, String> config) { ServiceLoader<FrameworkFactory> factoryLoader = ServiceLoader.load(FrameworkFactory.class); for (FrameworkFactory factory : factoryLoader) { return factory.newFramework(config); } throw new IllegalStateException("Unable to load FrameworkFactory service."); } /** * Installs and starts all bundles used by the application. Therefore the * host bundle will be started. The locations of extensions for the host * bundle can be passed in as parameters. * * @param bundleLocations the locations where extension for the host bundle * are located. Must not be {@code null}! * @throws BundleException if something went wrong while installing or * starting the bundles. */ private static void installAndStartBundles(ArrayList<String> bundleLocations) throws BundleException { BundleContext bundleContext = m_framework.getBundleContext(); // Activator bundleActivator = new Activator(); // bundleActivator.start(bundleContext); for (String location : bundleLocations) { Bundle addition = bundleContext.installBundle(location); System.out.println(location); addition.start(); } } } I can't understand - where is error. Interfaces has in the bundle (MainFormInterface) and in the loader (MainFormInterface2) and has some code package ihtika2.mainform.service; import org.osgi.framework.BundleContext; /** * * @author Arthur */ public interface MainFormInterface { public void showWindow(); public void disposeWindow(); public void sendContext(BundleContext context); } and package ihtika2.mainform.service2; import org.osgi.framework.BundleContext; /** * * @author Arthur */ public interface MainFormInterface2 { public void showWindow(); public void disposeWindow(); public void sendContext(BundleContext context); }
0
11,734,658
07/31/2012 06:51:46
1,390,292
05/11/2012 20:46:44
13
0
mystery RemotingException raised when changing Platform Target to Any CPU
I'm going to assume my installed version of .NET is foobared, but thought I would ask anyways as this makes no sense. 1. Create a new C# Console Application 2. Change Platform Target to Any CPU 3. Run 4. See a RemotingException be raised!?! 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'e:\dev\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.vshost.exe' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll' The thread 'vshost.NotifyLoad' (0x1494) has exited with code 0 (0x0). The thread 'vshost.LoadReference' (0x12f0) has exited with code 0 (0x0). 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'e:\dev\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe', Symbols loaded. A first chance exception of type 'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll An unhandled exception of type 'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll Additional information: The async result object is null or of an unexpected type. > mscorlib.dll!System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(System.Runtime.Remoting.Messaging.Message reqMsg, bool bProxyCase) + 0x2d0 bytes mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(object NotUsed, ref System.Runtime.Remoting.Proxies.MessageData msgData) + 0x191 bytes System.Windows.Forms.dll!System.Windows.Forms.Screen.AllScreens.get() + 0x1d2 bytes System.Windows.Forms.dll!System.Windows.Forms.Form.ApplyBoundsConstraints(int suggestedX, int suggestedY, int proposedWidth, int proposedHeight) + 0x12a bytes System.Windows.Forms.dll!System.Windows.Forms.Form.FillInCreateParamsStartPosition(System.Windows.Forms.CreateParams cp) + 0x4ab bytes System.Windows.Forms.dll!System.Windows.Forms.Form.CreateParams.get() + 0x153 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.CreateHandle() + 0x146 bytes System.Windows.Forms.dll!System.Windows.Forms.Form.CreateHandle() + 0x2ad bytes System.Windows.Forms.dll!System.Windows.Forms.Control.Handle.get() + 0x68 bytes Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunParkingWindowThread() + 0xbd bytes mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool ignoreSyncCtx) + 0xdc bytes mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x3b bytes mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x4d bytes [Native to Managed Transition]
c#
null
null
null
null
null
open
mystery RemotingException raised when changing Platform Target to Any CPU === I'm going to assume my installed version of .NET is foobared, but thought I would ask anyways as this makes no sense. 1. Create a new C# Console Application 2. Change Platform Target to Any CPU 3. Run 4. See a RemotingException be raised!?! 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'e:\dev\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.vshost.exe' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll' 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll' The thread 'vshost.NotifyLoad' (0x1494) has exited with code 0 (0x0). The thread 'vshost.LoadReference' (0x12f0) has exited with code 0 (0x0). 'ConsoleApplication2.vshost.exe' (Managed (v4.0.30319)): Loaded 'e:\dev\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe', Symbols loaded. A first chance exception of type 'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll An unhandled exception of type 'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll Additional information: The async result object is null or of an unexpected type. > mscorlib.dll!System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(System.Runtime.Remoting.Messaging.Message reqMsg, bool bProxyCase) + 0x2d0 bytes mscorlib.dll!System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(object NotUsed, ref System.Runtime.Remoting.Proxies.MessageData msgData) + 0x191 bytes System.Windows.Forms.dll!System.Windows.Forms.Screen.AllScreens.get() + 0x1d2 bytes System.Windows.Forms.dll!System.Windows.Forms.Form.ApplyBoundsConstraints(int suggestedX, int suggestedY, int proposedWidth, int proposedHeight) + 0x12a bytes System.Windows.Forms.dll!System.Windows.Forms.Form.FillInCreateParamsStartPosition(System.Windows.Forms.CreateParams cp) + 0x4ab bytes System.Windows.Forms.dll!System.Windows.Forms.Form.CreateParams.get() + 0x153 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.CreateHandle() + 0x146 bytes System.Windows.Forms.dll!System.Windows.Forms.Form.CreateHandle() + 0x2ad bytes System.Windows.Forms.dll!System.Windows.Forms.Control.Handle.get() + 0x68 bytes Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunParkingWindowThread() + 0xbd bytes mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool ignoreSyncCtx) + 0xdc bytes mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x3b bytes mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x4d bytes [Native to Managed Transition]
0
11,734,648
07/31/2012 06:51:21
1,067,943
11/27/2011 14:26:06
303
0
How to catch and save exception?
NET so maybe my question will seem naive. I want to catch and save exception, can you give me please example how can i implement it?
.net
null
null
null
null
null
open
How to catch and save exception? === NET so maybe my question will seem naive. I want to catch and save exception, can you give me please example how can i implement it?
0
11,734,666
07/31/2012 06:52:04
1,214,090
02/16/2012 14:44:22
1
0
opengl es texture mapping
I need to draw circles in my android application. Actually it is a pacman game and I need to draw tablets. Since there are many tablets on field I decided to draw each tablet with a single polygon. [Here][1] is the illustration of my idea: vertex coordrs: // (x, y) 0 : -R, R * (Math.sqrt(2) + 1) 1 : -R, -R 2 : R * (Math.sqrt(2) + 1), -R vertex coords are calculated relative to circle center to place circles with ease later. the problem is in texture mapping, according to my calculations UVs should be like this 0 : 0, -(Math.sqrt(2) + 0.5) 1 : 0, 1 2 : 1, (Math.sqrt(2) + 0.5) but negative V value causes application to show only black screen. That is why I think that I'm missing something or I'm going the wrong way... My question is: is it possible to render the texture in that way or not? If it isn't possible, what is the best way to draw small dots? P.S.: I'm working with OpenGL ES 2.0 on Android. seems to me, that this guy is trying to do the same http://stackoverflow.com/questions/9397170/opengl-es-texture-mapping-overflow [1]: http://www.advancedigital.ru/ideal_circle_with_only_one_polygon.jpg
android
opengl-es
textures
uv-mapping
null
null
open
opengl es texture mapping === I need to draw circles in my android application. Actually it is a pacman game and I need to draw tablets. Since there are many tablets on field I decided to draw each tablet with a single polygon. [Here][1] is the illustration of my idea: vertex coordrs: // (x, y) 0 : -R, R * (Math.sqrt(2) + 1) 1 : -R, -R 2 : R * (Math.sqrt(2) + 1), -R vertex coords are calculated relative to circle center to place circles with ease later. the problem is in texture mapping, according to my calculations UVs should be like this 0 : 0, -(Math.sqrt(2) + 0.5) 1 : 0, 1 2 : 1, (Math.sqrt(2) + 0.5) but negative V value causes application to show only black screen. That is why I think that I'm missing something or I'm going the wrong way... My question is: is it possible to render the texture in that way or not? If it isn't possible, what is the best way to draw small dots? P.S.: I'm working with OpenGL ES 2.0 on Android. seems to me, that this guy is trying to do the same http://stackoverflow.com/questions/9397170/opengl-es-texture-mapping-overflow [1]: http://www.advancedigital.ru/ideal_circle_with_only_one_polygon.jpg
0
11,734,604
07/31/2012 06:48:34
514,235
11/20/2010 05:25:21
21,658
898
"if" block without curly braces makes subsequent "else if" nested
AFAIK, if an "if" block is not provided the curly braces then only 1 statement is considered inside it. e.g. if(..) statement_1; statement_2; Irrespective of tabs, only `statement_1` is considered inside the `if` block. Following code doesn't get along with that: int main () { if(false) // outer - if if(false) // nested - if cout << "false false\n"; else if(true) cout << "true\n"; } Above code doesn't print anything. It should have printed `"true"`. It appears as of the `else if` is automatically nested inside the *outer* `if` block. `g++ -Wall` issues warning, but that is not the question here. Once you put the curly braces, everything goes fine as expected. Why such different behavior ? [GCC demo: [without braces](http://ideone.com/0v0aD) and [with braces](http://ideone.com/k7L5Z)].
c++
c
if-statement
elseif
nested-if
null
open
"if" block without curly braces makes subsequent "else if" nested === AFAIK, if an "if" block is not provided the curly braces then only 1 statement is considered inside it. e.g. if(..) statement_1; statement_2; Irrespective of tabs, only `statement_1` is considered inside the `if` block. Following code doesn't get along with that: int main () { if(false) // outer - if if(false) // nested - if cout << "false false\n"; else if(true) cout << "true\n"; } Above code doesn't print anything. It should have printed `"true"`. It appears as of the `else if` is automatically nested inside the *outer* `if` block. `g++ -Wall` issues warning, but that is not the question here. Once you put the curly braces, everything goes fine as expected. Why such different behavior ? [GCC demo: [without braces](http://ideone.com/0v0aD) and [with braces](http://ideone.com/k7L5Z)].
0
11,734,606
07/31/2012 06:48:37
551,269
12/22/2010 14:00:56
632
21
Tasks queue up, nothing happens on retry (no log)
I noticed that over 1,000 tasks queued up in Google App Engine's task queue. When I hit "Run Now" nothing seems to happen, no error in the log entry, etc. I double checked everything, but everything seems fine. The only suspicious thing to me was under the "Previous Run" tab in the task queue console, it showed "Last http response code: 404". Despite the 404, the URL seems fine, I can call it in a browser. Also, tasks just like those also run as expected. Without a log, I do not know what else to check. Some tasks may have failed before, but after a fix, that error should be gone. I'm using Java App Engine SDK 1.7.0 and a custom queue like this: <queue> <name>data-import</name> <rate>1/s</rate> <bucket-size>3</bucket-size> <max-concurrent-requests>1</max-concurrent-requests> </queue> So, any clues what's going on? Or what else to check?
google-app-engine
task-queue
null
null
null
null
open
Tasks queue up, nothing happens on retry (no log) === I noticed that over 1,000 tasks queued up in Google App Engine's task queue. When I hit "Run Now" nothing seems to happen, no error in the log entry, etc. I double checked everything, but everything seems fine. The only suspicious thing to me was under the "Previous Run" tab in the task queue console, it showed "Last http response code: 404". Despite the 404, the URL seems fine, I can call it in a browser. Also, tasks just like those also run as expected. Without a log, I do not know what else to check. Some tasks may have failed before, but after a fix, that error should be gone. I'm using Java App Engine SDK 1.7.0 and a custom queue like this: <queue> <name>data-import</name> <rate>1/s</rate> <bucket-size>3</bucket-size> <max-concurrent-requests>1</max-concurrent-requests> </queue> So, any clues what's going on? Or what else to check?
0
11,350,821
07/05/2012 19:01:01
269,758
02/09/2010 19:11:11
787
10
Automatic curve fitting in R
Is there any package that automatically fits a curve using many simple models? By simple models I mean: - ax+b - ax^2+bx+c - a*log(x) + b - a*x^n+b - ax/(1+bx) - ax^n/(1+bx^n) - ... The best would be to have a function that takes two vector parameters X and Y and returns a list of fitted simple models with their SSE.
r
curve-fitting
null
null
null
null
open
Automatic curve fitting in R === Is there any package that automatically fits a curve using many simple models? By simple models I mean: - ax+b - ax^2+bx+c - a*log(x) + b - a*x^n+b - ax/(1+bx) - ax^n/(1+bx^n) - ... The best would be to have a function that takes two vector parameters X and Y and returns a list of fitted simple models with their SSE.
0
11,350,552
07/05/2012 18:42:21
1,483,332
06/26/2012 16:00:20
6
0
Setting up MVC3 Application Services with mySQL
I have a mvc3 application up and running on my server using IIS6. I am needing to get application services working with mysql rather than microsoft SQL. I have configured the Web.config file for the following below. I was wondering if you have to manually setup the mysql tables or are they supposed to create automatically? <?xml version="1.0" encoding="utf-8"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=152368 --> <configuration> <connectionStrings> <add name="ApplicationServices" connectionString="server=server; user id=user; password=password; database=services; pooling=false" providerName="MySql.Data.MySqlClient"/> <add name="programEntities" connectionString="metadata=res://*/Models.DashboardModel.csdl|res://*/Models.DashboardModel.ssdl|res://*/Models.DashboardModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=server;User Id=user;password=password;Persist Security Info=True;database=program&quot;" providerName="System.Data.EntityClient" /> </connectionStrings> <appSettings> <add key="webpages:Version" value="1.0.0.0" /> <add key="ClientValidationEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" /> </appSettings> <system.web> <customErrors mode="Off"> </customErrors> <compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </assemblies> </compilation> <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" /> </authentication> <membership defaultProvider="MySQLMembershipProvider"> <providers> <clear/> <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="/" description="Membership Provider" connectionStringName="ApplicationServices" writeExceptionsToEventLog="True" autogenerateschema="True" enablePasswordRetrieval="False" enablePasswordReset="True" requiresQuestionAndAnswer="False" requiresUniqueEmail="False" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" /> </providers> </membership> <profile defaultProvider="MySQLProfileProvider"> <providers> <clear/> <add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="/" description="Profile provider" connectionStringName="ApplicationServices" writeExceptionsToEventLog="False" autogenerateschema="True" /> </providers> </profile> <roleManager enabled="true" defaultProvider="MySQLRoleProvider"> <providers> <clear/> <add applicationName="/" description="Role Provider" connectionStringName="ApplicationServices" writeExceptionsToEventLog="True" autogenerateschema="True" name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </providers> </roleManager> <pages> <namespaces> <add namespace="System.Web.Helpers" /> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> <add namespace="System.Web.WebPages" /> </namespaces> </pages> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesForAllRequests="true" /> </system.webServer> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
mysql
asp.net-mvc-3
null
null
null
null
open
Setting up MVC3 Application Services with mySQL === I have a mvc3 application up and running on my server using IIS6. I am needing to get application services working with mysql rather than microsoft SQL. I have configured the Web.config file for the following below. I was wondering if you have to manually setup the mysql tables or are they supposed to create automatically? <?xml version="1.0" encoding="utf-8"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=152368 --> <configuration> <connectionStrings> <add name="ApplicationServices" connectionString="server=server; user id=user; password=password; database=services; pooling=false" providerName="MySql.Data.MySqlClient"/> <add name="programEntities" connectionString="metadata=res://*/Models.DashboardModel.csdl|res://*/Models.DashboardModel.ssdl|res://*/Models.DashboardModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=server;User Id=user;password=password;Persist Security Info=True;database=program&quot;" providerName="System.Data.EntityClient" /> </connectionStrings> <appSettings> <add key="webpages:Version" value="1.0.0.0" /> <add key="ClientValidationEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" /> </appSettings> <system.web> <customErrors mode="Off"> </customErrors> <compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </assemblies> </compilation> <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" /> </authentication> <membership defaultProvider="MySQLMembershipProvider"> <providers> <clear/> <add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="/" description="Membership Provider" connectionStringName="ApplicationServices" writeExceptionsToEventLog="True" autogenerateschema="True" enablePasswordRetrieval="False" enablePasswordReset="True" requiresQuestionAndAnswer="False" requiresUniqueEmail="False" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression="" /> </providers> </membership> <profile defaultProvider="MySQLProfileProvider"> <providers> <clear/> <add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" applicationName="/" description="Profile provider" connectionStringName="ApplicationServices" writeExceptionsToEventLog="False" autogenerateschema="True" /> </providers> </profile> <roleManager enabled="true" defaultProvider="MySQLRoleProvider"> <providers> <clear/> <add applicationName="/" description="Role Provider" connectionStringName="ApplicationServices" writeExceptionsToEventLog="True" autogenerateschema="True" name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </providers> </roleManager> <pages> <namespaces> <add namespace="System.Web.Helpers" /> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> <add namespace="System.Web.WebPages" /> </namespaces> </pages> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesForAllRequests="true" /> </system.webServer> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
0
11,350,553
07/05/2012 18:42:45
184,822
10/06/2009 08:22:11
383
16
Nested SVG node creation in d3.js
I'v just started playing with d3js and find it strange that I have to create multiple selectors for each element I want to link to the background data structure for example separate selectors such as one for overlay text and one for rectangles to make an annotated bar graph. svg.selectAll("rect") .data(data) .enter() .append("rect") .attr('y',function(d,i){return i*10;}) .attr('height',10) .attr('width',function(d){return d.interestingValue}) .fill('#00ff00'); svg.selectAll("text") .data(data) .enter() .append("text") .attr('y',function(d,i){return i*10;}) .fill('#0000ff') .text(function(d){return d.interestingValue}); Is there a more convenient way of combining these into a single selection and enter() chain that creates both the rects and the text elements?
javascript
d3.js
null
null
null
null
open
Nested SVG node creation in d3.js === I'v just started playing with d3js and find it strange that I have to create multiple selectors for each element I want to link to the background data structure for example separate selectors such as one for overlay text and one for rectangles to make an annotated bar graph. svg.selectAll("rect") .data(data) .enter() .append("rect") .attr('y',function(d,i){return i*10;}) .attr('height',10) .attr('width',function(d){return d.interestingValue}) .fill('#00ff00'); svg.selectAll("text") .data(data) .enter() .append("text") .attr('y',function(d,i){return i*10;}) .fill('#0000ff') .text(function(d){return d.interestingValue}); Is there a more convenient way of combining these into a single selection and enter() chain that creates both the rects and the text elements?
0
11,350,555
07/05/2012 18:42:50
1,497,495
07/03/2012 01:42:27
11
0
Regex - Query, Isolating
I have the following string. Andrew - BOB - Jay vs John Now all Four names can change at any time, my only true concern however is with isolating Jay vs John independent of the names before the constant in this, is that the format always follows world1 - world2 - X vs Y How do I check for X vs Y disregarding the first 2? I've tried. '%- (.*?) Vs (.*)$%'; TO no avail. Any help would be greatly appreciated.
php
regex
null
null
null
null
open
Regex - Query, Isolating === I have the following string. Andrew - BOB - Jay vs John Now all Four names can change at any time, my only true concern however is with isolating Jay vs John independent of the names before the constant in this, is that the format always follows world1 - world2 - X vs Y How do I check for X vs Y disregarding the first 2? I've tried. '%- (.*?) Vs (.*)$%'; TO no avail. Any help would be greatly appreciated.
0
11,350,825
07/05/2012 19:01:06
843,700
07/14/2011 00:25:11
890
39
Calculating distance between two addresses without Google Maps API?
Is there some way **other than using the Google Maps API** to calculate the distance between two addresses (not lat/long points)? The "as the crow flies" distance is fine -- I don't need a driving distance. I could calculate it using [**Vicenty's formula**](http://www.movable-type.co.uk/scripts/latlong-vincenty.html) or the [**Haversine formula**](http://www.movable-type.co.uk/scripts/latlong.html), but I'd still need to convert my address into a lat/long coordinate. I can't use the Google Maps API because it requires me to display a map, and I need this distance for an internal calculation on my server.
google-maps
distance
null
null
null
null
open
Calculating distance between two addresses without Google Maps API? === Is there some way **other than using the Google Maps API** to calculate the distance between two addresses (not lat/long points)? The "as the crow flies" distance is fine -- I don't need a driving distance. I could calculate it using [**Vicenty's formula**](http://www.movable-type.co.uk/scripts/latlong-vincenty.html) or the [**Haversine formula**](http://www.movable-type.co.uk/scripts/latlong.html), but I'd still need to convert my address into a lat/long coordinate. I can't use the Google Maps API because it requires me to display a map, and I need this distance for an internal calculation on my server.
0
11,350,826
07/05/2012 19:01:08
1,490,330
06/29/2012 05:28:22
13
0
Disabling DEP for an Outlook 2010 Add-In
Is there any way to do this? My legacy VB6 add-in utilizes a legacy (likely C++) third party component to make some UI "skin" enhancements. It works fine in Outlook 2000-2007 but fails in 2010 due to DEP - and likely the manner in which my "skinning" component accesses memory. If I disable DEP globally in Outlook (via the Trust Center) it works fine however this isn't a viable solution for my client. I've tried adding my DLL to the DEP Opt-Out list in **System Properties > Performance > DEP** however it didn't seem to have any affect. Nor did adding the "skinning" DLL, the MS VB6 virtual machine it runs under, or even Outlook.EXE to the list. If anyone can point me in the right direction re: disabling JUST my add-in from DEP, I'd be greatly appreciative.
vb6
outlook
add-in
dep
null
null
open
Disabling DEP for an Outlook 2010 Add-In === Is there any way to do this? My legacy VB6 add-in utilizes a legacy (likely C++) third party component to make some UI "skin" enhancements. It works fine in Outlook 2000-2007 but fails in 2010 due to DEP - and likely the manner in which my "skinning" component accesses memory. If I disable DEP globally in Outlook (via the Trust Center) it works fine however this isn't a viable solution for my client. I've tried adding my DLL to the DEP Opt-Out list in **System Properties > Performance > DEP** however it didn't seem to have any affect. Nor did adding the "skinning" DLL, the MS VB6 virtual machine it runs under, or even Outlook.EXE to the list. If anyone can point me in the right direction re: disabling JUST my add-in from DEP, I'd be greatly appreciative.
0
11,350,827
07/05/2012 19:01:13
59,202
01/27/2009 03:11:34
1,349
36
How can design a full screen calendar view in Twitter Bootstrap?
I need to design a calendar view and I would like to use Twitter Bootstrap since I am used to using it for smaller projects. But the 12 column span system doesn't seem to fit right on creating a calendar view. So if I have a row that is span12, and I want to create a sub-row, I need 7 evenly spaced boxes for the calendar. I can't see how I can do this. I thought about just creating a span12 and then just applying my own CSS inside it. Bypassing the Bootstrap system. Any suggestions? Thanks
design
css3
twitter-bootstrap
fullcalendar
null
null
open
How can design a full screen calendar view in Twitter Bootstrap? === I need to design a calendar view and I would like to use Twitter Bootstrap since I am used to using it for smaller projects. But the 12 column span system doesn't seem to fit right on creating a calendar view. So if I have a row that is span12, and I want to create a sub-row, I need 7 evenly spaced boxes for the calendar. I can't see how I can do this. I thought about just creating a span12 and then just applying my own CSS inside it. Bypassing the Bootstrap system. Any suggestions? Thanks
0
11,350,828
07/05/2012 19:01:16
1,371,045
05/02/2012 20:39:04
38
5
Adobe Flex Mobile - TextArea refuses to scroll on Android, StageWebView won't scroll at all
I'm trying to make the Spark TextArea component automatically scroll down as text is added to it. When the TextArea is first populated, the vertical scrollbar is at the bottom. But if I append more text, it just outright refuses to scroll. Its working on the iOS platform, but it won't on Android!! I've tried doing the following, according to the example found here: http://devgirl.org/2010/12/16/automatically-scroll-flex-mobile-textarea/ StyleableTextField(TextArea1.textDisplay).htmlText += textHTML; StyleableTextField(TextArea1.textDisplay).scrollV++; I've also tried the following two lines of code: StyleableTextField(TextArea1.textDisplay).verticalScrollPosition = int.MAX_VALUE - 1; TextArea1.scrollToRange(int.MAX_VALUE, int.MAX_VALUE); NOTHING WORKS! Whenever the TextArea is updated, it just scrolls back up to the top, or doesn't move at all. I even tried changing the program so that the HTML content is displayed in a StageWebView instead. But I can't get that one to scroll at all, even on the iPad. I tried calling a JavaScript function (document.getElementById('id').focus()) as well as inserting a hidden anchor tag into the code, and calling loadURL() on it. Neither solution worked. Can someone please help me out with this? I am absolutely stumped.
android
ios
flex
mobile
adobe
null
open
Adobe Flex Mobile - TextArea refuses to scroll on Android, StageWebView won't scroll at all === I'm trying to make the Spark TextArea component automatically scroll down as text is added to it. When the TextArea is first populated, the vertical scrollbar is at the bottom. But if I append more text, it just outright refuses to scroll. Its working on the iOS platform, but it won't on Android!! I've tried doing the following, according to the example found here: http://devgirl.org/2010/12/16/automatically-scroll-flex-mobile-textarea/ StyleableTextField(TextArea1.textDisplay).htmlText += textHTML; StyleableTextField(TextArea1.textDisplay).scrollV++; I've also tried the following two lines of code: StyleableTextField(TextArea1.textDisplay).verticalScrollPosition = int.MAX_VALUE - 1; TextArea1.scrollToRange(int.MAX_VALUE, int.MAX_VALUE); NOTHING WORKS! Whenever the TextArea is updated, it just scrolls back up to the top, or doesn't move at all. I even tried changing the program so that the HTML content is displayed in a StageWebView instead. But I can't get that one to scroll at all, even on the iPad. I tried calling a JavaScript function (document.getElementById('id').focus()) as well as inserting a hidden anchor tag into the code, and calling loadURL() on it. Neither solution worked. Can someone please help me out with this? I am absolutely stumped.
0
11,350,834
07/05/2012 19:01:28
1,493,506
06/30/2012 20:03:28
1
5
in MDX Where clause does not filter calculated member
WHy where claus filter work affect [All subcategoty] member and not affect [All_Category] with member [All_Category]as ([Product].[Category].[All Products],[Measures].[Reseller Sales Amount]) member [All_SubCategory]as ([Product].[Subcategory].[All Products],[Measures].[Reseller Sales Amount]) select {[All_Category], [All_SubCategory], [Measures].[Reseller Sales Amount]} on 0 from [Adventure Works] where [Product].[Category].&[4] All_Categry All_SubCategry Reseller Sales Amount $80,450,596.98 $571,297.93 $571,297.93
mdx
null
null
null
null
null
open
in MDX Where clause does not filter calculated member === WHy where claus filter work affect [All subcategoty] member and not affect [All_Category] with member [All_Category]as ([Product].[Category].[All Products],[Measures].[Reseller Sales Amount]) member [All_SubCategory]as ([Product].[Subcategory].[All Products],[Measures].[Reseller Sales Amount]) select {[All_Category], [All_SubCategory], [Measures].[Reseller Sales Amount]} on 0 from [Adventure Works] where [Product].[Category].&[4] All_Categry All_SubCategry Reseller Sales Amount $80,450,596.98 $571,297.93 $571,297.93
0
11,349,189
07/05/2012 17:09:44
978,411
10/04/2011 12:21:58
85
1
handling pop up with many buttons using selenium webdriver
I'm using selenium web driver with Java language. when there are two buttons in a pop up i.e. ok and cancel , it can be easily handled with web driver using the following code: Alert alert = driver.switchTo().alert(); alert.accept(); // or alert.dismiss(); depending upon the action u want to perform. but what to do when there are more than two button, i.e. there are 3 to 4 buttons in the pop up ( e.g. like ok,cancel,try again, ignore/continue), in that case what do we do? how can we click on whichever button that we want? Thank you very much for your help in advance
java
selenium
popup
selenium2
null
null
open
handling pop up with many buttons using selenium webdriver === I'm using selenium web driver with Java language. when there are two buttons in a pop up i.e. ok and cancel , it can be easily handled with web driver using the following code: Alert alert = driver.switchTo().alert(); alert.accept(); // or alert.dismiss(); depending upon the action u want to perform. but what to do when there are more than two button, i.e. there are 3 to 4 buttons in the pop up ( e.g. like ok,cancel,try again, ignore/continue), in that case what do we do? how can we click on whichever button that we want? Thank you very much for your help in advance
0
11,349,190
07/05/2012 17:09:44
1,504,713
07/05/2012 17:02:07
1
0
JAXB-XJC Xpropertyaccessors
Per JAXB specification http://jaxb.java.net/2.2.4/docs/xjc.html if you want to run the JAXB-XJC compiler, one of the of the extensions/arguments you may pass is -Xpropertyaccessors even though it has been specfied in each of JAXB-RI till the latest one 2.2.5u2 still when I try to run it passing this argument I get 'unrecognized parameter -Xpropertyaccessors' is not specified in the help menu when I run it. It is important for me to have the access levels on properties not fields.
jaxb
xjc
null
null
null
null
open
JAXB-XJC Xpropertyaccessors === Per JAXB specification http://jaxb.java.net/2.2.4/docs/xjc.html if you want to run the JAXB-XJC compiler, one of the of the extensions/arguments you may pass is -Xpropertyaccessors even though it has been specfied in each of JAXB-RI till the latest one 2.2.5u2 still when I try to run it passing this argument I get 'unrecognized parameter -Xpropertyaccessors' is not specified in the help menu when I run it. It is important for me to have the access levels on properties not fields.
0
11,349,191
07/05/2012 17:09:44
1,117,438
12/27/2011 10:11:40
255
15
VKB not showing up after portin LWUIT to Codename one
I am trying to port my LWUIT app to [Codename One][1] [1]: http://www.codenameone.com I have a textField in my LWUIT app. On a touchscreen phone, whenever I clicked this textfield, a VKB would show up. Now I have ported the LWUIT app to Codename one. Now, in the emulator whenever I click the textfield, the VKB is not showing up automatically. Why is this happening and how do i fix it? I want the VKB to automatically show up on clicking the textfield.
lwuit
codenameone
null
null
null
null
open
VKB not showing up after portin LWUIT to Codename one === I am trying to port my LWUIT app to [Codename One][1] [1]: http://www.codenameone.com I have a textField in my LWUIT app. On a touchscreen phone, whenever I clicked this textfield, a VKB would show up. Now I have ported the LWUIT app to Codename one. Now, in the emulator whenever I click the textfield, the VKB is not showing up automatically. Why is this happening and how do i fix it? I want the VKB to automatically show up on clicking the textfield.
0
11,350,838
07/05/2012 19:01:43
1,504,927
07/05/2012 18:48:11
1
0
CSS margin-left property doesn't exist?
I am trying to center something both horizontally and vertically on my page... I have seen several threads on stackoverflow of people experiencing the same issue, but I tried the solutions posted there (things relating to overflow: hidden, different floats, inline blocks, etc.) but none seem to work. Here you can see the CSS validation fails: <<http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.applemktcap.com%2Fcss%2Fmain.css&profile=css3&usermedium=all&warning=1&vextwarning=&lang=en>> margin-left is not a recognized property? if you go to the homepage of that site, <<http://applemktcap.com>>, you can see the resulting JS applet which is not centered. I know it has nothing to do with the JS, as I stripped everything out of my site and put some simple text in the container, and it's still shifted towards the right. Must just be some simple CSS mistake I'm looking right over. Any ideas?
css3
margin
negative-margin
null
null
null
open
CSS margin-left property doesn't exist? === I am trying to center something both horizontally and vertically on my page... I have seen several threads on stackoverflow of people experiencing the same issue, but I tried the solutions posted there (things relating to overflow: hidden, different floats, inline blocks, etc.) but none seem to work. Here you can see the CSS validation fails: <<http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.applemktcap.com%2Fcss%2Fmain.css&profile=css3&usermedium=all&warning=1&vextwarning=&lang=en>> margin-left is not a recognized property? if you go to the homepage of that site, <<http://applemktcap.com>>, you can see the resulting JS applet which is not centered. I know it has nothing to do with the JS, as I stripped everything out of my site and put some simple text in the container, and it's still shifted towards the right. Must just be some simple CSS mistake I'm looking right over. Any ideas?
0
11,350,840
07/05/2012 19:01:48
1,504,911
07/05/2012 18:41:32
1
1
store jpeg images in cassandra using libQTcassandra (C++)
I am very new to cassandra and I have installed cassandra and libQTcassandra on a linux machine. I want to insert image files like .jpg or .png into cassandra(images are small, couple of MBs). How can send image files to cassandra server to insert into column of a column family? Will you please give me an example in C++ code. I know that i can use image file name as column name but i don't know how to send image file to cassandra. Any help is greatly appreciated... Thanks, Swat
apache
cassandra
null
null
null
null
open
store jpeg images in cassandra using libQTcassandra (C++) === I am very new to cassandra and I have installed cassandra and libQTcassandra on a linux machine. I want to insert image files like .jpg or .png into cassandra(images are small, couple of MBs). How can send image files to cassandra server to insert into column of a column family? Will you please give me an example in C++ code. I know that i can use image file name as column name but i don't know how to send image file to cassandra. Any help is greatly appreciated... Thanks, Swat
0
11,350,841
07/05/2012 19:01:53
1,504,937
07/05/2012 18:52:42
1
0
Is a priority queue necessary for event simulation?
Right now in my basic event simulation engine, I simply just resort the list of event objects to update by their priorities every step of the simulation. I do this because new events can be created during event updates and are appended to the list and when an event expires, I just "swap and pop" it with the last event in the list for performance. Should I just be using two priority queues instead? It seems like the n log n of sorting every step is at least the same if not less costly than dequeing all the events (n log n?) putting each unexpired one in another list that is built into the priority queue for the next update step.
sorting
heap
simulation
priority-queue
heapsort
null
open
Is a priority queue necessary for event simulation? === Right now in my basic event simulation engine, I simply just resort the list of event objects to update by their priorities every step of the simulation. I do this because new events can be created during event updates and are appended to the list and when an event expires, I just "swap and pop" it with the last event in the list for performance. Should I just be using two priority queues instead? It seems like the n log n of sorting every step is at least the same if not less costly than dequeing all the events (n log n?) putting each unexpired one in another list that is built into the priority queue for the next update step.
0
11,651,033
07/25/2012 13:37:52
1,155,852
01/18/2012 09:37:33
48
1
How to set value for NSString in another view controller from one viewcontroller
I'm using Xcode 4.3.2 & iOS 5.1 simulator, in my project i have using two viewControllers testingViewController, detailView in that i want to set values for NSString in detailView once i didSelect tableViewCell in testingViewController. For that i used following codes. > testingViewController.h ![testingViewController.h](http://i.imgur.com/Yl3fc.png?1) > testingViewController.m ![testingViewController.m](http://i.imgur.com/fpgeS.png?1) > detailView.h ![detailView.h](http://i.imgur.com/5KIlC.png?1) > detailView.m ![detailView.m](http://i.imgur.com/SUXP3.png?1) In detailView NSLog it display null value for both "wordName" & "wordMeaning" So please help me to get out of this issue. Thanks in Advance!
iphone
objective-c
uistoryboard
ios5.1
null
null
open
How to set value for NSString in another view controller from one viewcontroller === I'm using Xcode 4.3.2 & iOS 5.1 simulator, in my project i have using two viewControllers testingViewController, detailView in that i want to set values for NSString in detailView once i didSelect tableViewCell in testingViewController. For that i used following codes. > testingViewController.h ![testingViewController.h](http://i.imgur.com/Yl3fc.png?1) > testingViewController.m ![testingViewController.m](http://i.imgur.com/fpgeS.png?1) > detailView.h ![detailView.h](http://i.imgur.com/5KIlC.png?1) > detailView.m ![detailView.m](http://i.imgur.com/SUXP3.png?1) In detailView NSLog it display null value for both "wordName" & "wordMeaning" So please help me to get out of this issue. Thanks in Advance!
0
11,651,036
07/25/2012 13:38:09
1,279,586
03/19/2012 21:28:22
16
0
test for errors in ruby watir script
I have several ruby watir-webdriver scripts I am using to automate downloading files from various websites. simple scripts that log in to site, fill in text fields, click buttons..... what do I have to do to get the script to send an email alert any time there is an error or timeout? Scripts are running on a Mac OSX server and I can use /usr/bin/mail. just looking to get a simple error message if the script stops before the last line of the script which is: b.close Thanks for all of your help
ruby
watir
watir-webdriver
null
null
null
open
test for errors in ruby watir script === I have several ruby watir-webdriver scripts I am using to automate downloading files from various websites. simple scripts that log in to site, fill in text fields, click buttons..... what do I have to do to get the script to send an email alert any time there is an error or timeout? Scripts are running on a Mac OSX server and I can use /usr/bin/mail. just looking to get a simple error message if the script stops before the last line of the script which is: b.close Thanks for all of your help
0
11,651,037
07/25/2012 13:38:19
1,514,681
07/10/2012 11:54:49
1
0
Need help writing an xpath string to match multiple, but not all, table cells
I'm trying to get a site scraper working properly and I'm having problems coming up with a suitable xpath string for some table cells. <tr> <td class="Label" width="20%" valign="top">Section title</td> <td class="Data"> 1231231231231</td> </tr> <tr> <td></td> <td class="Data"> 123123123x</td> </tr> There can be an arbitrary number of rows in this, I need the text() of all of the Data fields under this section. There is other sections with the same format where the only difference is that "Section title" is something different than for this one. I can match the first one with the following xpath string, but I'm not sure how to rewrite it to work for all of them: //tr[@class="Entry"]//tr/td[contains(text(), "Section title")]/following-sibling::td/text() The tr with the Entry class is what contain all the data I'm trying to get some of. If it's relevant, I'm using xml.dom.minidom and py-dom-xpath with Python 2.7.
python
xpath
screen-scraping
web-scraping
minidom
null
open
Need help writing an xpath string to match multiple, but not all, table cells === I'm trying to get a site scraper working properly and I'm having problems coming up with a suitable xpath string for some table cells. <tr> <td class="Label" width="20%" valign="top">Section title</td> <td class="Data"> 1231231231231</td> </tr> <tr> <td></td> <td class="Data"> 123123123x</td> </tr> There can be an arbitrary number of rows in this, I need the text() of all of the Data fields under this section. There is other sections with the same format where the only difference is that "Section title" is something different than for this one. I can match the first one with the following xpath string, but I'm not sure how to rewrite it to work for all of them: //tr[@class="Entry"]//tr/td[contains(text(), "Section title")]/following-sibling::td/text() The tr with the Entry class is what contain all the data I'm trying to get some of. If it's relevant, I'm using xml.dom.minidom and py-dom-xpath with Python 2.7.
0
11,649,625
07/25/2012 12:23:19
799,295
06/15/2011 09:33:36
61
3
Varnish: Sending “If-None-Match”-Header to Backends?
I'd like to use etag caching directly in my application / verify the eTag in my Application. How is it possible to route the "If-None-Match" header to the backends? It seems that Varnish is cutting out this header by default.
caching
load-balancing
varnish
null
null
null
open
Varnish: Sending “If-None-Match”-Header to Backends? === I'd like to use etag caching directly in my application / verify the eTag in my Application. How is it possible to route the "If-None-Match" header to the backends? It seems that Varnish is cutting out this header by default.
0
11,649,626
07/25/2012 12:23:21
1,551,542
07/25/2012 12:13:51
1
0
Using Multiple JavaBean DataSources in Jasper Report
As JasperReport can have a JavaBean collection as a DataSource. Can we send a SetCollection with a single object which has references to multiple SetCollections. And use these references to pass to compiled jrxml file using mulitple calls to JasperFillManager.fillReport() each time passing a different SetCollection. just wanted to know if that compiled jrxml file will be filled with the last call or will have the data of each call to JasperFillManager.fillReport().
jasper-reports
osgi
null
null
null
null
open
Using Multiple JavaBean DataSources in Jasper Report === As JasperReport can have a JavaBean collection as a DataSource. Can we send a SetCollection with a single object which has references to multiple SetCollections. And use these references to pass to compiled jrxml file using mulitple calls to JasperFillManager.fillReport() each time passing a different SetCollection. just wanted to know if that compiled jrxml file will be filled with the last call or will have the data of each call to JasperFillManager.fillReport().
0
11,649,628
07/25/2012 12:23:23
60,002
01/29/2009 00:05:50
1,383
11
Task chaining (wait for the previous task to completed)
var tasks = new List<Task>(); foreach (var guid in guids) { var task = new Task( ...); tasks.Add(task); } foreach (var task in tasks) { task.Start(); Task.WaitAll(task); } This is run of the UI thread. I need to execute all tasks in tasks variable one after the other. The problem is if I call Task.WaitAll(task), the UI freeze. How can I do the following logic without having the UI freeze?
c#
.net
task
null
null
null
open
Task chaining (wait for the previous task to completed) === var tasks = new List<Task>(); foreach (var guid in guids) { var task = new Task( ...); tasks.Add(task); } foreach (var task in tasks) { task.Start(); Task.WaitAll(task); } This is run of the UI thread. I need to execute all tasks in tasks variable one after the other. The problem is if I call Task.WaitAll(task), the UI freeze. How can I do the following logic without having the UI freeze?
0
11,650,956
07/25/2012 13:34:07
688,237
04/01/2011 20:22:28
54
4
Performance of joblib Parallel loop with numpy ndarray
I'm doing some statistical computations in python using numpy. My current implementation is not parallelized so far. So I was looking into python joblib Parallel for a simple loop-parallelization. My non-parallelized part of the code looks like this: def calcRADMatInt( i, j , RADMat, pdfMu, pdfSigma): if i==j: RADMat[i, j] = 0.0 else: RADMat[i, j] = calcRAD( pdfMu[i], np.squeeze( pdfSigma[i]), pdfMu[j], np.squeeze( pdfSigma[j]) ) RADMat[j, i] = RADMat[i,j] def caldRADMat(....): .... .... RADMat = np.zeros( (numLandmark, numLandmark) ) for i in range( 0, numLandmark): for j in range( i, numLandmark)): calcRADMatInt( i, j, RADMat, pdfMu, pdfSigma) .... .... I've tried to parallelize it like this: def caldRADMat(....): .... .... RADMat = np.zeros( (numLandmark, numLandmark) ) for i in range( 0, numLandmark): Parallel(n_jobs=8)(delayed(calcRADMatInt)( i, j, RADMat, pdfMu, pdfSigma) for j in range( i, numLandmark)) .... .... However, the resulting parallel code runs significantly slower than the non-parallelized version. So I guess my actual questions are: Am I using joblib Parallel correctly? Is this the right way to parallelize computation of numpy ndarray elements?
python
numpy
parallel-processing
null
null
null
open
Performance of joblib Parallel loop with numpy ndarray === I'm doing some statistical computations in python using numpy. My current implementation is not parallelized so far. So I was looking into python joblib Parallel for a simple loop-parallelization. My non-parallelized part of the code looks like this: def calcRADMatInt( i, j , RADMat, pdfMu, pdfSigma): if i==j: RADMat[i, j] = 0.0 else: RADMat[i, j] = calcRAD( pdfMu[i], np.squeeze( pdfSigma[i]), pdfMu[j], np.squeeze( pdfSigma[j]) ) RADMat[j, i] = RADMat[i,j] def caldRADMat(....): .... .... RADMat = np.zeros( (numLandmark, numLandmark) ) for i in range( 0, numLandmark): for j in range( i, numLandmark)): calcRADMatInt( i, j, RADMat, pdfMu, pdfSigma) .... .... I've tried to parallelize it like this: def caldRADMat(....): .... .... RADMat = np.zeros( (numLandmark, numLandmark) ) for i in range( 0, numLandmark): Parallel(n_jobs=8)(delayed(calcRADMatInt)( i, j, RADMat, pdfMu, pdfSigma) for j in range( i, numLandmark)) .... .... However, the resulting parallel code runs significantly slower than the non-parallelized version. So I guess my actual questions are: Am I using joblib Parallel correctly? Is this the right way to parallelize computation of numpy ndarray elements?
0
11,650,957
07/25/2012 13:34:11
1,543,644
07/22/2012 07:18:01
2
0
MSSQL Sorting and Checking
I have a table named Logs, Logs ->OCCUR_TIME --date and time ->NAME --name of a person ->KIND --the kind of log (eg. 40 means `something`) ->VALUE --the value of the kind of log (eg. 99) I have to create a query: SELECT * FROM LOGS WHERE NAME='dude' ORDER BY KIND, OCCUR_TIME, VALUE; Now this displays the logs and sorted by kind, then occur time (if occur_time is exactly the same it will then sort by value). Notes: VALUE of a KIND must always be +1 If not report a problem. What if for an example there was a problem with the log and after the VALUE 400 the next VALUE is 398? Example: Occur_Time | Name | Kind | Value 2012-06-26 15:14:25.407 dude 40 398 2012-06-27 16:55:28.730 dude 40 399 2012-06-30 02:43:26.763 dude 40 400 2012-06-30 05:26:32.673 dude 40 398 <-- data prob. (possible rollback) 2012-06-30 16:35:28.330 dude 40 399 <-- problem continuing 2012-06-20 20:29:51.207 dude 41 100 <-- no prob. bcoz its another kind 2012-06-23 05:50:59.130 guy 40 500 <-- no prob. bcoz its another name I want a QUERY that will find the problem, and where it started. like this? Please help. Thank you.
sql-server
query
sorting
if-statement
case
null
open
MSSQL Sorting and Checking === I have a table named Logs, Logs ->OCCUR_TIME --date and time ->NAME --name of a person ->KIND --the kind of log (eg. 40 means `something`) ->VALUE --the value of the kind of log (eg. 99) I have to create a query: SELECT * FROM LOGS WHERE NAME='dude' ORDER BY KIND, OCCUR_TIME, VALUE; Now this displays the logs and sorted by kind, then occur time (if occur_time is exactly the same it will then sort by value). Notes: VALUE of a KIND must always be +1 If not report a problem. What if for an example there was a problem with the log and after the VALUE 400 the next VALUE is 398? Example: Occur_Time | Name | Kind | Value 2012-06-26 15:14:25.407 dude 40 398 2012-06-27 16:55:28.730 dude 40 399 2012-06-30 02:43:26.763 dude 40 400 2012-06-30 05:26:32.673 dude 40 398 <-- data prob. (possible rollback) 2012-06-30 16:35:28.330 dude 40 399 <-- problem continuing 2012-06-20 20:29:51.207 dude 41 100 <-- no prob. bcoz its another kind 2012-06-23 05:50:59.130 guy 40 500 <-- no prob. bcoz its another name I want a QUERY that will find the problem, and where it started. like this? Please help. Thank you.
0
11,651,044
07/25/2012 13:38:31
224,774
12/04/2009 13:30:21
1,074
55
Custom UIView drawing artifacts
I have the following problem: I have made two custom UIViews each using normally drawRect routines. The one is a bubble view used as container and text views used to show NSAttributedStrings (iOS 5 necessary). The text views are added to the bubble view with addSubview. They are both using transparent UIColor (clearColor) as background. Now for performance optimizations I wanted to set the background color to white. Suddenly there are visual artifacts visible. For better debugging I set the background color now to red and blue: ![Problem][1] As you see, there is a blue and red rectangle on the wrong position. They are exactly on the *starting* rectangle when I initialize my custom text view with initFrame. Later I move the frame in the correct position. Ok, it seems that the former label rectangles are *still* drawn, but why ? They are definitely moved into the right position with setFrame: Neither [self setNeedsDisplay] nor [self setNeedsLayout] have an effect. What is the cause of the redrawing and how do I fix it ? [1]: http://i.stack.imgur.com/pPhuf.png
ios
uiview
custom-controls
null
null
null
open
Custom UIView drawing artifacts === I have the following problem: I have made two custom UIViews each using normally drawRect routines. The one is a bubble view used as container and text views used to show NSAttributedStrings (iOS 5 necessary). The text views are added to the bubble view with addSubview. They are both using transparent UIColor (clearColor) as background. Now for performance optimizations I wanted to set the background color to white. Suddenly there are visual artifacts visible. For better debugging I set the background color now to red and blue: ![Problem][1] As you see, there is a blue and red rectangle on the wrong position. They are exactly on the *starting* rectangle when I initialize my custom text view with initFrame. Later I move the frame in the correct position. Ok, it seems that the former label rectangles are *still* drawn, but why ? They are definitely moved into the right position with setFrame: Neither [self setNeedsDisplay] nor [self setNeedsLayout] have an effect. What is the cause of the redrawing and how do I fix it ? [1]: http://i.stack.imgur.com/pPhuf.png
0
11,651,046
07/25/2012 13:38:32
1,394,953
05/15/2012 00:54:37
77
0
Entity Framework 4 Image Type
I am using code-first Entity Framework 4 with MSSQLCE 4. What is the type I should define in the class? MSSQLCE only support Image. Thank you.
c#
.net
entity-framework
sql-server-ce
null
null
open
Entity Framework 4 Image Type === I am using code-first Entity Framework 4 with MSSQLCE 4. What is the type I should define in the class? MSSQLCE only support Image. Thank you.
0
11,650,913
07/25/2012 13:32:23
851,829
07/19/2011 11:16:22
1
0
Using fk in composite pk using JPA
i have two table as below 1. Employee id - integer (pk) name - varchar (20) surname - varchar (20) 2. Eployee_Address emp_id - Integer (pk) address_type - char(1) (pk) address - varchar(100) From above two tables it can be seen that i have to use employee id which is pk from Employee table into primary key of Employee_Address table which is composite key. I am new in JPA-Hibernate could you please tell me if I create seperate entity as EmployeeAddressId and used in EmployeeAddress entity using @embeddedId anotation, will it work. I am geting primary key violation exception when i am trying to persist Employee
hibernate
jpa
null
null
null
null
open
Using fk in composite pk using JPA === i have two table as below 1. Employee id - integer (pk) name - varchar (20) surname - varchar (20) 2. Eployee_Address emp_id - Integer (pk) address_type - char(1) (pk) address - varchar(100) From above two tables it can be seen that i have to use employee id which is pk from Employee table into primary key of Employee_Address table which is composite key. I am new in JPA-Hibernate could you please tell me if I create seperate entity as EmployeeAddressId and used in EmployeeAddress entity using @embeddedId anotation, will it work. I am geting primary key violation exception when i am trying to persist Employee
0
11,651,048
07/25/2012 13:38:37
1,032,006
11/06/2011 09:22:57
829
33
Pandas concatenate rows
Apologies in advance for the super-newbie question. I'm learning to use pandas, and have this simple operation that I can't figure out how to perform: I have the following data frame: print df Out[19]: USERNAME REQUEST_TYPE STATUS LATENCY 0 foo 1 SUCCESS 7 1 foo 2 SUCCESS 17 2 bar 1 SUCCESS 10 3 bar 2 FAILURE 12 I would like to have one row for each USERNAME, which is the concatenation of the STATUS and LATENCY columns per REQUEST_TYPE. The output should look like this: USERNAME STATUS_1 LATENCY_1 STATUS_2 LATENCY_2 0 foo SUCCESS 7 SUCCESS 17 1 bar SUCCESS 10 FAILURE 12 I thought of something starting with pandas.groupby(df,['USERNAME', 'REQUEST_TYPE']), but I am not sure how to concatenate the rows back, and whether there is any method which would create new column names. Thanks!
python
pandas
null
null
null
null
open
Pandas concatenate rows === Apologies in advance for the super-newbie question. I'm learning to use pandas, and have this simple operation that I can't figure out how to perform: I have the following data frame: print df Out[19]: USERNAME REQUEST_TYPE STATUS LATENCY 0 foo 1 SUCCESS 7 1 foo 2 SUCCESS 17 2 bar 1 SUCCESS 10 3 bar 2 FAILURE 12 I would like to have one row for each USERNAME, which is the concatenation of the STATUS and LATENCY columns per REQUEST_TYPE. The output should look like this: USERNAME STATUS_1 LATENCY_1 STATUS_2 LATENCY_2 0 foo SUCCESS 7 SUCCESS 17 1 bar SUCCESS 10 FAILURE 12 I thought of something starting with pandas.groupby(df,['USERNAME', 'REQUEST_TYPE']), but I am not sure how to concatenate the rows back, and whether there is any method which would create new column names. Thanks!
0
11,651,049
07/25/2012 13:38:38
243,513
01/04/2010 22:08:07
353
3
What is a better practice, to combine two interfaces or to cast an interface to its implementing type?
Let's say that I have two interfaces and a behavior class: public interface Creable { public boolean belongsToSystem(); public List<Creable> getCreatedItems(); } public interface HasDependencies { public void createDependencies(); public void generateDependents(); } public class CreableBehavior { private Creable creableObject; public CreableBehavior(Creable creableObject) { this.creableObject = creableObject; } public boolean hasBeenCreated() { return !creableObject.belongsToSystem() && !creableObject.getCreatedItems().contains(createdObject); } And this piece of code: Creable includedTab = new AdempiereTab(getIncluded_Tab_ID(), creableElements); if (!new CreableBehavior(includedTab).hasBeenCreated) { includedTab.createDependencies(); includedTab.getCreatedItems.add(includedTab); includedTab.generateDependents(); } AdempiereTab implements both Creable and HasDependencies. The problem is that I need to use both interfaces Creable and HasDependencies. Should I cast it like this: if (!new CreableBehavior(includedTab).hasBeenCreated) { ((AdempiereTab)includedTab).createDependencies(); includedTab.getCreatedItems.add(includedTab); ((AdempiereTab)includedTab).generateDependents(); } Or should should I create a new interface CreableWithDependencies that extends both interfaces and use that one instead? Thanks.
java
design-patterns
design
interface
null
null
open
What is a better practice, to combine two interfaces or to cast an interface to its implementing type? === Let's say that I have two interfaces and a behavior class: public interface Creable { public boolean belongsToSystem(); public List<Creable> getCreatedItems(); } public interface HasDependencies { public void createDependencies(); public void generateDependents(); } public class CreableBehavior { private Creable creableObject; public CreableBehavior(Creable creableObject) { this.creableObject = creableObject; } public boolean hasBeenCreated() { return !creableObject.belongsToSystem() && !creableObject.getCreatedItems().contains(createdObject); } And this piece of code: Creable includedTab = new AdempiereTab(getIncluded_Tab_ID(), creableElements); if (!new CreableBehavior(includedTab).hasBeenCreated) { includedTab.createDependencies(); includedTab.getCreatedItems.add(includedTab); includedTab.generateDependents(); } AdempiereTab implements both Creable and HasDependencies. The problem is that I need to use both interfaces Creable and HasDependencies. Should I cast it like this: if (!new CreableBehavior(includedTab).hasBeenCreated) { ((AdempiereTab)includedTab).createDependencies(); includedTab.getCreatedItems.add(includedTab); ((AdempiereTab)includedTab).generateDependents(); } Or should should I create a new interface CreableWithDependencies that extends both interfaces and use that one instead? Thanks.
0
11,628,204
07/24/2012 09:45:41
844,516
07/14/2011 12:06:47
106
0
reducing number of choices
I have two tables: db.define_table('tests', Field('name'), Field('status'),...) db.tests.status.requires=IS_IN_SET(['OK','obsolete']) db.define_table('testruns', Field('name'), Field('test', db.tests), ...) My form looks lik this: form = SQLFORM(db.testruns) How can I change the form, that it contains only the tests that have the state 'OK'? Thank you Benny
web2py
null
null
null
null
null
open
reducing number of choices === I have two tables: db.define_table('tests', Field('name'), Field('status'),...) db.tests.status.requires=IS_IN_SET(['OK','obsolete']) db.define_table('testruns', Field('name'), Field('test', db.tests), ...) My form looks lik this: form = SQLFORM(db.testruns) How can I change the form, that it contains only the tests that have the state 'OK'? Thank you Benny
0
11,607,103
07/23/2012 05:54:48
863,110
07/26/2011 09:22:10
51
0
Check if there is phone number in string C#
I read a string that includes all types of characters. I want to check whether there is in the string, consisting of sub-string at least 7 digits. What is the best way to do it?
c#
string
null
null
null
null
open
Check if there is phone number in string C# === I read a string that includes all types of characters. I want to check whether there is in the string, consisting of sub-string at least 7 digits. What is the best way to do it?
0
11,628,438
07/24/2012 09:59:08
1,471,938
06/21/2012 11:25:17
23
5
zend country code url
hi currently i have a zend application view helper to resolve user ip to countryName require_once '../library/Ipinfo/ip2locationlite.class.php'; class Application_View_Helper_GetLocation extends Zend_View_Helper_Abstract { public function getLocation() { $ipLite = new ip2location_lite; $ipLite->setKey('api key'); //Get errors and locations $locations = $ipLite->getCity($_SERVER['REMOTE_ADDR']); $errors = $ipLite->getError(); $country = $locations['countryName']; return "$country"; } } what i would like to know is how to rewrite route so that if a user is originate from united state i need to redirect them to www.example.com/us/controller/action site ?
php
zend-framework
zend-route
null
null
null
open
zend country code url === hi currently i have a zend application view helper to resolve user ip to countryName require_once '../library/Ipinfo/ip2locationlite.class.php'; class Application_View_Helper_GetLocation extends Zend_View_Helper_Abstract { public function getLocation() { $ipLite = new ip2location_lite; $ipLite->setKey('api key'); //Get errors and locations $locations = $ipLite->getCity($_SERVER['REMOTE_ADDR']); $errors = $ipLite->getError(); $country = $locations['countryName']; return "$country"; } } what i would like to know is how to rewrite route so that if a user is originate from united state i need to redirect them to www.example.com/us/controller/action site ?
0
11,628,444
07/24/2012 09:59:37
1,548,278
07/24/2012 09:53:44
1
0
SQL to Relational Algebra database consisting of one relation and assume that a film is uniquely identified by its title
Please can anyone help convert the following SQL statements to Relational Algebra CREATE TABLE Film ( Tittle varchar(100) NOT NULL , Director varchar(100) NOT NULL, Actor varchar(100) NOT NULL ) 1)Select distinct(actor), count(tittle) from film where director=’spielberg” group by tittle having count(tittle) = ( select count(tittle) from film where director = “Spielberg”) 2)Select distinct (actor) from film where director=”spielberg” and director not in ( select distinct(director) from film where director != “Spielberg”) 3)Select actors from film group by actor having count(tittle) >= 1 4)Select distinct( director) ,count(actor) from film group by actor count(actor) = ( select count(tittle) from film )
sql
null
null
null
null
null
open
SQL to Relational Algebra database consisting of one relation and assume that a film is uniquely identified by its title === Please can anyone help convert the following SQL statements to Relational Algebra CREATE TABLE Film ( Tittle varchar(100) NOT NULL , Director varchar(100) NOT NULL, Actor varchar(100) NOT NULL ) 1)Select distinct(actor), count(tittle) from film where director=’spielberg” group by tittle having count(tittle) = ( select count(tittle) from film where director = “Spielberg”) 2)Select distinct (actor) from film where director=”spielberg” and director not in ( select distinct(director) from film where director != “Spielberg”) 3)Select actors from film group by actor having count(tittle) >= 1 4)Select distinct( director) ,count(actor) from film group by actor count(actor) = ( select count(tittle) from film )
0
11,411,003
07/10/2012 10:08:02
258,274
01/25/2010 09:05:10
51
1
How to handle white space in command line?Like: GOMAKE=${GOGO}(white space here) build
I want to compile thrift 0.8 to support go1(golang version 1) .Before go1,there are two command:goinstall and gomake,so lines in configure script like this: ------------------------------------------------------- GOMAKE=${GOBIN}/gomake GOINSTALL=${GOBIN}/goinstall ------------------------------------------------------- but as of go1,"go install" and "go build" replaced "goinstall" and "gomake",I found some guy changed thrift configure script to: ------------------------------------------------------- GOGO=${GOBIN}/go GOMAKE=${GOGO} build GOINSTALL=${GOGO} install ------------------------------------------------------- but when I try to run script with: ./configure,I got: -------------------- ./configure: line 18067: build: command not found install: missing file operand Try `install --help' for more information. checking for 6g... /6g checking for 6l... /6l ------------------------------ Not sure,but I think "./configure: line 18067: build: command not found" means white space within "GOMAKE=${GOGO} build" can't be handled,right?Anyone can help to make this work?Thanks
autoconf
automake
null
null
null
null
open
How to handle white space in command line?Like: GOMAKE=${GOGO}(white space here) build === I want to compile thrift 0.8 to support go1(golang version 1) .Before go1,there are two command:goinstall and gomake,so lines in configure script like this: ------------------------------------------------------- GOMAKE=${GOBIN}/gomake GOINSTALL=${GOBIN}/goinstall ------------------------------------------------------- but as of go1,"go install" and "go build" replaced "goinstall" and "gomake",I found some guy changed thrift configure script to: ------------------------------------------------------- GOGO=${GOBIN}/go GOMAKE=${GOGO} build GOINSTALL=${GOGO} install ------------------------------------------------------- but when I try to run script with: ./configure,I got: -------------------- ./configure: line 18067: build: command not found install: missing file operand Try `install --help' for more information. checking for 6g... /6g checking for 6l... /6l ------------------------------ Not sure,but I think "./configure: line 18067: build: command not found" means white space within "GOMAKE=${GOGO} build" can't be handled,right?Anyone can help to make this work?Thanks
0
11,411,040
07/10/2012 10:09:56
1,503,332
07/05/2012 08:13:27
3
0
Google Map in Unity3D
I want develop GoogleMap scrolling in Unity3D. But nothing method.. I know static map method by WWW instance. But it can't scroll the map by mouse input. How can I scroll Google Map in Unity3D?
google-maps
unity3d
null
null
null
07/10/2012 17:57:08
not a real question
Google Map in Unity3D === I want develop GoogleMap scrolling in Unity3D. But nothing method.. I know static map method by WWW instance. But it can't scroll the map by mouse input. How can I scroll Google Map in Unity3D?
1
11,411,041
07/10/2012 10:09:56
934,232
09/08/2011 06:56:59
139
6
phonegap Storage in iPhone
I am trying to save some data and fetching that data from Database. I have done all from [Here][1]. But I am not getting list view here. just header are getting appears. What I want my application to be is ![enter image description here][2] and what I am getting is this !![enter image description here][3] Don't know why but the control is not going in OnDeviceReady() method !! [1]: http://coenraets.org/blog/2011/10/sample-app-using-the-phonegap-database-api/#comment-92635 [2]: http://i.stack.imgur.com/IWqNL.png [3]: http://i.stack.imgur.com/vcUWa.png
javascript
iphone
ios5
jquery-mobile
phonegap
null
open
phonegap Storage in iPhone === I am trying to save some data and fetching that data from Database. I have done all from [Here][1]. But I am not getting list view here. just header are getting appears. What I want my application to be is ![enter image description here][2] and what I am getting is this !![enter image description here][3] Don't know why but the control is not going in OnDeviceReady() method !! [1]: http://coenraets.org/blog/2011/10/sample-app-using-the-phonegap-database-api/#comment-92635 [2]: http://i.stack.imgur.com/IWqNL.png [3]: http://i.stack.imgur.com/vcUWa.png
0
11,411,050
07/10/2012 10:10:27
717,214
04/20/2011 13:22:15
10,377
578
Copy data between postgres databases
I need, as a one-off, to copy data from one table in a PostgreSQL database to the corresponding table in a different database. There's not that much data: about 2500 rows, 8 columns (some numeric, some varchar). My first thought was to simply `pg_dump -a -t table -f output.file` and then `pg_restore` on another database. However, as it turned out, the versions of `pg_dump` and the source server do not match - and I have no control over versions, so upgrading is not an option: pg_dump: server version: 9.1.2; pg_dump version: 9.0.5 pg_dump: aborting because of server version mismatch Unfortunately, with version 9 of Postgres, option `-i` (ignore version) is not longer available. I **do** know what I am doing, but it still wouldn't let me (naturally). What other options do I have?
postgresql
postgresql-9.0
copy-data
null
null
null
open
Copy data between postgres databases === I need, as a one-off, to copy data from one table in a PostgreSQL database to the corresponding table in a different database. There's not that much data: about 2500 rows, 8 columns (some numeric, some varchar). My first thought was to simply `pg_dump -a -t table -f output.file` and then `pg_restore` on another database. However, as it turned out, the versions of `pg_dump` and the source server do not match - and I have no control over versions, so upgrading is not an option: pg_dump: server version: 9.1.2; pg_dump version: 9.0.5 pg_dump: aborting because of server version mismatch Unfortunately, with version 9 of Postgres, option `-i` (ignore version) is not longer available. I **do** know what I am doing, but it still wouldn't let me (naturally). What other options do I have?
0
11,411,051
07/10/2012 10:10:30
1,141,264
01/10/2012 16:03:22
63
6
Outputting json two levels deep Ruby on Rails
I have 3 models. Venue :has_many :events Events :has_many :event_dates Im spitting out events: <%= venue.events.to_json.html_safe %> Which works correctly. But I also need an array of the event dates within each event. Im sure there is a very long winded way of doing this comparing ids, but im looking for an elegant solution. Make Thanks.
ruby-on-rails
json
has-many
null
null
null
open
Outputting json two levels deep Ruby on Rails === I have 3 models. Venue :has_many :events Events :has_many :event_dates Im spitting out events: <%= venue.events.to_json.html_safe %> Which works correctly. But I also need an array of the event dates within each event. Im sure there is a very long winded way of doing this comparing ids, but im looking for an elegant solution. Make Thanks.
0
11,410,789
07/10/2012 09:55:45
923,503
09/01/2011 13:08:32
50
2
How do I add 15 images in a tablerow
I have 15 images and the number of images to be displayed is dynamic, anywhere from 1-15.I have visibility gone for all images and its visible if the condition is true.But I am unable to see all the images its only displayed till 7 and the rest is off the screen. I have tried using multiple table rows and it works but their is a gap between the two rows if few images are not displayed in the first row,but the requirement is to have continuous images without gap. Is there any other way to achieve it other than Grid view ,any condition which can extend or include the images in table row. Thanks in Advance.Any Help will be greatly appreciated.
android
null
null
null
null
null
open
How do I add 15 images in a tablerow === I have 15 images and the number of images to be displayed is dynamic, anywhere from 1-15.I have visibility gone for all images and its visible if the condition is true.But I am unable to see all the images its only displayed till 7 and the rest is off the screen. I have tried using multiple table rows and it works but their is a gap between the two rows if few images are not displayed in the first row,but the requirement is to have continuous images without gap. Is there any other way to achieve it other than Grid view ,any condition which can extend or include the images in table row. Thanks in Advance.Any Help will be greatly appreciated.
0
11,411,053
07/10/2012 10:10:39
645,181
03/04/2011 17:39:29
95
2
Javascript that act like css3 transition
I want to do something like `-moz-transition` effect that give me a animated rotate picture. or move a picture from bottom of it's wrapper to top of it. for clarify how I want just take a look at [This Link](http://demo.scripteers.com/expressive/) and see the four pictures that are under slider. It uses `-moz-transition` CSS3 effect but I want to have something with js or jQuery to animate it even in IE. Is there any plugin for it? Thanks alot
javascript
jquery
css3
transition
null
null
open
Javascript that act like css3 transition === I want to do something like `-moz-transition` effect that give me a animated rotate picture. or move a picture from bottom of it's wrapper to top of it. for clarify how I want just take a look at [This Link](http://demo.scripteers.com/expressive/) and see the four pictures that are under slider. It uses `-moz-transition` CSS3 effect but I want to have something with js or jQuery to animate it even in IE. Is there any plugin for it? Thanks alot
0
11,411,062
07/10/2012 10:10:51
1,493,082
06/30/2012 13:58:30
15
1
Render HTML Page
This is my html page. <body> <div id="form1"> <root xmlns:NS='www.yembi.com'> <NS:ENTRY Action='Users'> <div class="colm1"> <NS:DISPLAY datafield="FirstName"></NS:DISPLAY> </div> <div class="colm2"> <NS:Text datafield='FirstName'/> </div> <div class="colm1"> <NS:DISPLAY datafield="MiddleName"></NS:DISPLAY> </div> <div class="colm2"> <NS:Text datafield='MiddleName'/> </div> <div class="colm1"> <NS:DISPLAY datafield="LastName"></NS:DISPLAY> </div> <div class="colm2"> <NS:Text datafield='LastName'/> </div> <div class="colm1"> <NS:DISPLAY datafield="Phone"></NS:DISPLAY> </div> <div class="colm2"> <NS:Text datafield='Phone'/> </div> <div class="colm3"> <NS:BUTTON ></NS:BUTTON> </div> </NS:ENTRY> </root> </div> </body> I wanna get this html into a temp variable. so tried like below var Text = $("#form1").html(); I am getting full html content, But with small exceptions. It not displaying the double quotes in div attributes. I am getting the below output: <ROOT xmlns:NS='www.yembi.com'> <NS:ENTRY Action='Users'> <DIV class=colm1> <NS:DISPLAY datafield="FirstName"></NS:DISPLAY> </DIV> <DIV class=colm2> // Here it automatically removes the double quotes. how to retain this double quotes ? <NS:Text datafield='FirstName'/> </DIV> <DIV class=colm1> <NS:DISPLAY datafield="MiddleName"></NS:DISPLAY> </DIV> <DIV class=colm2> <NS:Text datafield='MiddleName'/> </div> <DIV class=colm1> <NS:DISPLAY datafield="LastName"></NS:DISPLAY> </DIV> <DIV class=colm2> <NS:Text datafield='LastName'/> </DIV> <DIVclass=colm1> <NS:DISPLAY datafield="Phone"></NS:DISPLAY> </DIV> <DIV class=colm2> <NS:Text datafield='Phone'/> </DIV> <DIV class=colm3> <NS:BUTTON ></NS:BUTTON> </DIV> </NS:ENTRY> </ROOT> As mentioned above it automatically remove the double quotes in DIV. How to retain this double quotes??
html
null
null
null
null
null
open
Render HTML Page === This is my html page. <body> <div id="form1"> <root xmlns:NS='www.yembi.com'> <NS:ENTRY Action='Users'> <div class="colm1"> <NS:DISPLAY datafield="FirstName"></NS:DISPLAY> </div> <div class="colm2"> <NS:Text datafield='FirstName'/> </div> <div class="colm1"> <NS:DISPLAY datafield="MiddleName"></NS:DISPLAY> </div> <div class="colm2"> <NS:Text datafield='MiddleName'/> </div> <div class="colm1"> <NS:DISPLAY datafield="LastName"></NS:DISPLAY> </div> <div class="colm2"> <NS:Text datafield='LastName'/> </div> <div class="colm1"> <NS:DISPLAY datafield="Phone"></NS:DISPLAY> </div> <div class="colm2"> <NS:Text datafield='Phone'/> </div> <div class="colm3"> <NS:BUTTON ></NS:BUTTON> </div> </NS:ENTRY> </root> </div> </body> I wanna get this html into a temp variable. so tried like below var Text = $("#form1").html(); I am getting full html content, But with small exceptions. It not displaying the double quotes in div attributes. I am getting the below output: <ROOT xmlns:NS='www.yembi.com'> <NS:ENTRY Action='Users'> <DIV class=colm1> <NS:DISPLAY datafield="FirstName"></NS:DISPLAY> </DIV> <DIV class=colm2> // Here it automatically removes the double quotes. how to retain this double quotes ? <NS:Text datafield='FirstName'/> </DIV> <DIV class=colm1> <NS:DISPLAY datafield="MiddleName"></NS:DISPLAY> </DIV> <DIV class=colm2> <NS:Text datafield='MiddleName'/> </div> <DIV class=colm1> <NS:DISPLAY datafield="LastName"></NS:DISPLAY> </DIV> <DIV class=colm2> <NS:Text datafield='LastName'/> </DIV> <DIVclass=colm1> <NS:DISPLAY datafield="Phone"></NS:DISPLAY> </DIV> <DIV class=colm2> <NS:Text datafield='Phone'/> </DIV> <DIV class=colm3> <NS:BUTTON ></NS:BUTTON> </DIV> </NS:ENTRY> </ROOT> As mentioned above it automatically remove the double quotes in DIV. How to retain this double quotes??
0
11,472,575
07/13/2012 14:30:45
969,603
09/28/2011 17:13:53
32
2
percentage margin issue in chrome & IE
I have built a slider which expands to fit the window, and have #prev and #next pager buttons (which are highlighted in green). As the slider changes size I need to have these buttons positioned with a top margin as a percentage value. This is fine in Firefox but in Chrome and IE it doesn't read this margin. If I put it as a px value it works fine but obviously doesn't adjust to fit the slider size. Please advise... **http://subzerostudio.com/Clients/perkinreveller/index.html** Many thanks..
css
percentage
null
null
null
null
open
percentage margin issue in chrome & IE === I have built a slider which expands to fit the window, and have #prev and #next pager buttons (which are highlighted in green). As the slider changes size I need to have these buttons positioned with a top margin as a percentage value. This is fine in Firefox but in Chrome and IE it doesn't read this margin. If I put it as a px value it works fine but obviously doesn't adjust to fit the slider size. Please advise... **http://subzerostudio.com/Clients/perkinreveller/index.html** Many thanks..
0
11,472,579
07/13/2012 14:31:04
1,523,833
07/13/2012 14:27:53
1
0
Adding Jquery autocomplete to a Html.EditorFor
I want to add a autocomplete (suggestion function) to a editor field in my create menu. I have this basic razor view @Html.EditorFor(model => model.Title) I want to add my autocomplete to his previously I have used `{ <input type="text" name="q" data-autocomplete="@Url.Action("QuickSearch", "Person")" /> <input type="submit" name="submit" value="Find FullName" /> } ` And I wondered how to implement this. My Jquery searches for data-autocomplete (shown below) $(document).ready(function () { $(":input[data-autocomplete]").each(function () { $(this).autocomplete({ source: $(this).attr("data-autocomplete") }); }); })
jquery
.net
mvc
razor
null
null
open
Adding Jquery autocomplete to a Html.EditorFor === I want to add a autocomplete (suggestion function) to a editor field in my create menu. I have this basic razor view @Html.EditorFor(model => model.Title) I want to add my autocomplete to his previously I have used `{ <input type="text" name="q" data-autocomplete="@Url.Action("QuickSearch", "Person")" /> <input type="submit" name="submit" value="Find FullName" /> } ` And I wondered how to implement this. My Jquery searches for data-autocomplete (shown below) $(document).ready(function () { $(":input[data-autocomplete]").each(function () { $(this).autocomplete({ source: $(this).attr("data-autocomplete") }); }); })
0
11,472,580
07/13/2012 14:31:06
1,217,647
02/18/2012 05:26:39
68
2
Fill checkboxlist with column names from database table
I am creating a webpage using VS2010 and .net 4.0 in it I return a table from a database. What I would like to do is fill a checkboxlist with the columns names from the table returned from the database. Is there anyway to do this? or can i query the database and have it return a table of the column names? The checkboxlist will be used to allow the user to decide which columns they want displayed. Thanks!
c#
visual-studio-2010
checkboxlist
null
null
07/13/2012 15:49:18
not a real question
Fill checkboxlist with column names from database table === I am creating a webpage using VS2010 and .net 4.0 in it I return a table from a database. What I would like to do is fill a checkboxlist with the columns names from the table returned from the database. Is there anyway to do this? or can i query the database and have it return a table of the column names? The checkboxlist will be used to allow the user to decide which columns they want displayed. Thanks!
1
11,472,563
07/13/2012 14:30:29
1,502,364
07/04/2012 19:33:58
64
0
connecting all points (possible conbination) in scatter plot
Here is small dataset: myd <- data.frame(PC1 = rnorm(5, 5, 2), PC2 = rnorm (5, 5, 3), label = c("A", "B", "C", "D", "E")) plot(myd$PC1, myd$PC2) text( myd$PC1-0.1, myd$PC2, lab = myd$label) I want connect all possible combination between line with straight (euclidean) distance, to produce some graph like this (preferrably in base graphics or ggplot2) ![enter image description here][1] [1]: http://i.stack.imgur.com/IvszE.jpg
r
plot
line
connect
null
null
open
connecting all points (possible conbination) in scatter plot === Here is small dataset: myd <- data.frame(PC1 = rnorm(5, 5, 2), PC2 = rnorm (5, 5, 3), label = c("A", "B", "C", "D", "E")) plot(myd$PC1, myd$PC2) text( myd$PC1-0.1, myd$PC2, lab = myd$label) I want connect all possible combination between line with straight (euclidean) distance, to produce some graph like this (preferrably in base graphics or ggplot2) ![enter image description here][1] [1]: http://i.stack.imgur.com/IvszE.jpg
0
11,472,588
07/13/2012 14:31:37
1,346,031
04/20/2012 08:27:21
16
0
Programmatically fill grid in wpf: auto rowheight doesn't seem to work
I'm filling a WPF Grid programmatically with rows. Each row is assigned a user control. This user control contains a Grid itself, with exactly one row and 3 columns. The 3rd column can contain a TextBox, a ComboBox or a variable number of CheckBoxes in a ListBox. Though I have set the rowheight in the user control and the Grid containing the user control to Auto, the height of the row does not expand. The lower checkboxes just disappear. I've tried different things but no luck yet. Any ideas?
c#
.net
wpf
usercontrols
grid
null
open
Programmatically fill grid in wpf: auto rowheight doesn't seem to work === I'm filling a WPF Grid programmatically with rows. Each row is assigned a user control. This user control contains a Grid itself, with exactly one row and 3 columns. The 3rd column can contain a TextBox, a ComboBox or a variable number of CheckBoxes in a ListBox. Though I have set the rowheight in the user control and the Grid containing the user control to Auto, the height of the row does not expand. The lower checkboxes just disappear. I've tried different things but no luck yet. Any ideas?
0
11,472,591
07/13/2012 14:31:40
1,501,521
07/04/2012 12:08:49
6
1
Installling.exe using MSIEXEC in NSIS (Program doesn't install at all)
I try to install a program (.exe)in the NSIS Script here is my code ;Install PDFXVIEWER SetOutPath "$INSTDIR\PdfViewer" File /r "file\PdfViewer\PDFXV.exe" ExecWait 'msiexec /i "file\PdfViewer\PDFXV.exe" /VERYSILENT /NORESTART /DIR="$INSTDIR\PdfViewer"' However, during the installation i got a windows installer popup ! : http://i.stack.imgur.com/g8Gdh.jpg and the program is not installed at all. Can anyone point me my error?? thanks
installer
windows-installer
nsis
msiexec
null
null
open
Installling.exe using MSIEXEC in NSIS (Program doesn't install at all) === I try to install a program (.exe)in the NSIS Script here is my code ;Install PDFXVIEWER SetOutPath "$INSTDIR\PdfViewer" File /r "file\PdfViewer\PDFXV.exe" ExecWait 'msiexec /i "file\PdfViewer\PDFXV.exe" /VERYSILENT /NORESTART /DIR="$INSTDIR\PdfViewer"' However, during the installation i got a windows installer popup ! : http://i.stack.imgur.com/g8Gdh.jpg and the program is not installed at all. Can anyone point me my error?? thanks
0
11,472,582
07/13/2012 14:31:12
192,831
10/20/2009 04:32:49
546
18
HG: How to push some (but not all) changes to 'stable' branch?
Say I do my new feature development either in **default**, or an entirely new branch made just for the feature for a web site project. When it comes time to push the feature out to the live website, I want to move it to the **live** branch, which I then `hg archive` to my apache directory. Throughout everything, I want to be absolutely sure not to push other, unrelated changes that are not yet ready to be published to the **live** branch. 1. Is this even a good idea? Or should I be doing something entirely different? 2. If the code is in **default**, how do I push only the one thing I need and not everything to **live**? If I push just the latest changeset, is it smart enough to send the latest version of those files, or will it only do the changesets? 3. If the code is in an entirely new branch, do I merge the whole branch into **live**? How do I get those changes back to my **default** branch so I see them there too? 4. I was reading the "Task Based Management" section of the [Mercurial Kick Start][1] guide and it mentions merging **default** into your branch. I found this very confusing and was wondering why you'd ever do this. Thanks for any help you guys can provide. [edit] I'm using TortoiseHG BTW [/edit] [1]: http://mercurial.aragost.com/kick-start/en/tasks/#merging-default-into-a-branch
mercurial
tortoisehg
null
null
null
null
open
HG: How to push some (but not all) changes to 'stable' branch? === Say I do my new feature development either in **default**, or an entirely new branch made just for the feature for a web site project. When it comes time to push the feature out to the live website, I want to move it to the **live** branch, which I then `hg archive` to my apache directory. Throughout everything, I want to be absolutely sure not to push other, unrelated changes that are not yet ready to be published to the **live** branch. 1. Is this even a good idea? Or should I be doing something entirely different? 2. If the code is in **default**, how do I push only the one thing I need and not everything to **live**? If I push just the latest changeset, is it smart enough to send the latest version of those files, or will it only do the changesets? 3. If the code is in an entirely new branch, do I merge the whole branch into **live**? How do I get those changes back to my **default** branch so I see them there too? 4. I was reading the "Task Based Management" section of the [Mercurial Kick Start][1] guide and it mentions merging **default** into your branch. I found this very confusing and was wondering why you'd ever do this. Thanks for any help you guys can provide. [edit] I'm using TortoiseHG BTW [/edit] [1]: http://mercurial.aragost.com/kick-start/en/tasks/#merging-default-into-a-branch
0
11,472,597
07/13/2012 14:31:58
328,337
04/28/2010 21:55:21
180
0
Converting a bitmap to monochrome
I am trying to save an image as monochrome (black&white, 1 bit-depth) but I'm coming up lost how to do it. I am starting with a png and converting to a bitmap for printing (it's a thermal printer and only supports black anyway - plus its slow as hell for large images if I try to send them as color/grayscale). My code so far is dead simple to convert it to a bitmap, but it is retaining the original colour depth. Image image = Image.FromFile("C:\\test.png"); byte[] bitmapFileData = null; int bitsPerPixel = 1; int bitmapDataLength; using (MemoryStream str = new MemoryStream()) { image.Save(str, ImageFormat.Bmp); bitmapFileData = str.ToArray(); }
c#
image
bitmap
thermal-printer
null
null
open
Converting a bitmap to monochrome === I am trying to save an image as monochrome (black&white, 1 bit-depth) but I'm coming up lost how to do it. I am starting with a png and converting to a bitmap for printing (it's a thermal printer and only supports black anyway - plus its slow as hell for large images if I try to send them as color/grayscale). My code so far is dead simple to convert it to a bitmap, but it is retaining the original colour depth. Image image = Image.FromFile("C:\\test.png"); byte[] bitmapFileData = null; int bitsPerPixel = 1; int bitmapDataLength; using (MemoryStream str = new MemoryStream()) { image.Save(str, ImageFormat.Bmp); bitmapFileData = str.ToArray(); }
0
11,567,951
07/19/2012 19:29:54
912,359
08/25/2011 14:44:02
176
18
Making dom parsig using php case insesitive
I am parsing html using domxpath in php, and extracting description out of the webpage. But the problem I am facing is that its case sensitive and giving an error if anything is written in different case. here is my code: $d=new DOMDocument(); $d->loadHTML($source); $domx = new DOMXPath($d); $description=$domx->query("//meta[@name='description']")->item(0)->getAttribute('content'); its working fine when everything is in lower case, but gives error if anything is written in any other case. Is there any flag or something which can make domxpath case insensitive.
php
html-parsing
domxpath
null
null
null
open
Making dom parsig using php case insesitive === I am parsing html using domxpath in php, and extracting description out of the webpage. But the problem I am facing is that its case sensitive and giving an error if anything is written in different case. here is my code: $d=new DOMDocument(); $d->loadHTML($source); $domx = new DOMXPath($d); $description=$domx->query("//meta[@name='description']")->item(0)->getAttribute('content'); its working fine when everything is in lower case, but gives error if anything is written in any other case. Is there any flag or something which can make domxpath case insensitive.
0
11,567,955
07/19/2012 19:30:13
1,019,906
10/29/2011 15:46:04
23
0
Oracle - updating a sorted table
I found an old table without a primary key, and in order to add one, I have to add a new column and fill it with sequence values. I have another column which contains the time of when the record was created, so I want to insert the sequence values to the table sorted by the column with the time. I'm not sure how to do it. I tried using PL\SQL - I created a cursor for a query that returns the table with an ORDER BY, and then update for each record the cursor returns but it didn't work. Is there a smart working way to do this? Thanks in advance.
sql
oracle
null
null
null
null
open
Oracle - updating a sorted table === I found an old table without a primary key, and in order to add one, I have to add a new column and fill it with sequence values. I have another column which contains the time of when the record was created, so I want to insert the sequence values to the table sorted by the column with the time. I'm not sure how to do it. I tried using PL\SQL - I created a cursor for a query that returns the table with an ORDER BY, and then update for each record the cursor returns but it didn't work. Is there a smart working way to do this? Thanks in advance.
0
11,567,941
07/19/2012 19:29:11
1,538,901
07/19/2012 19:17:57
1
0
fancyBox 2 official DEMO throwing error when loaded on local machine when attempting to test Vimeo & YouTube playback
I am writing plain HTML & CSS and loading the file directly in the browser from my local hard drive. FancyBox 2 is loading the lightbox effect, so I know the script is working, but I am receving the following error message when attempting to play a video: "This webpage is not found No webpage was found for the web address: file://player.vimeo.com/video/25634903?hd=1&autoplay=1&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1 Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found." Notice that the script is attempting to load the video from file:// even though the HREF URL I specified is HTTP://vimeo/25634903 I then loaded the demo file in my browser, locally, attempted to play the youtube and vimeo video examples and I received the same error. The demo does load images properly, but not videos. Is there something I can tweak in the fancBox js file that will allow me to use this locally? Thank you!
jquery
html
video
fancybox
null
null
open
fancyBox 2 official DEMO throwing error when loaded on local machine when attempting to test Vimeo & YouTube playback === I am writing plain HTML & CSS and loading the file directly in the browser from my local hard drive. FancyBox 2 is loading the lightbox effect, so I know the script is working, but I am receving the following error message when attempting to play a video: "This webpage is not found No webpage was found for the web address: file://player.vimeo.com/video/25634903?hd=1&autoplay=1&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1 Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found." Notice that the script is attempting to load the video from file:// even though the HREF URL I specified is HTTP://vimeo/25634903 I then loaded the demo file in my browser, locally, attempted to play the youtube and vimeo video examples and I received the same error. The demo does load images properly, but not videos. Is there something I can tweak in the fancBox js file that will allow me to use this locally? Thank you!
0
11,451,881
07/12/2012 12:29:08
1,520,714
07/12/2012 12:04:42
1
0
Log Parser ORDER BY CASE statement
Quite a trivial problem here that I can't seem to resolve. I am using LogParser to analyse some telephone system CSV log files. I am trying to produce a graph of all the incoming calls between two dates, grouped by day of the week. I have achieved this, but I am struggling to have the graph display the columns in the correct order, starting with Monday. My SQL query that I pass to LogParser is as follows: SELECT to_string(to_timestamp(c1, 'yyyy/MM/dd HH:mm'), 'dddd') as Day, count(*) as Calls INTO graph.gif FROM C:\logs\*.txt WHERE c5 = 'I' AND to_timestamp(c1, 'yyyy/MM/dd HH:mm') BETWEEN timestamp('10/05/2012', 'dd/MM/yyyy') AND timestamp('24/05/2012', 'dd/MM/yyyy') GROUP BY Day It actually outputs in the correct order without any ORDER BY statement at all, but I think that the first column is always the day that the date range starts on, whereas I would like it to always be Monday (for easy comparison of graphs). What happens currently is it converts the timestamp from my log file into a string representation of the day of the week (for the purpose of output) and as far as I am aware there is no built in logic that 'Monday' is less than 'Tuesday' and so on. My instinct was to use a CASE statement in an ORDER BY, but LogParser won't accept this. This is my entire LogParser command just in case it's relevant, C:\Program Files (x86)\Log Parser 2.2\Logparser.exe" -i:CSV "SELECT to_string(to_timestamp(c1, 'yyyy/MM/dd HH:mm'), 'dddd') as Day, count(*) as Calls INTO graph.gif FROM C:\logs\*.txt WHERE c5 = 'I' AND to_timestamp(c1, 'yyyy/MM/dd HH:mm') BETWEEN timestamp('10/05/2012', 'dd/MM/yyyy') AND timestamp('24/05/2012', 'dd/MM/yyyy') GROUP BY Day" -chartType:Column3D -chartTitle:"Incoming Calls" -values:ON -config:MyConfig.js -o:CHART -headerRow OFF -iHeaderFile C:\logs\header\header.txt Simply all I would like is for my results order to always start on Monday, regardless of the date range. Any ideas?
sql
logging
logparser
null
null
null
open
Log Parser ORDER BY CASE statement === Quite a trivial problem here that I can't seem to resolve. I am using LogParser to analyse some telephone system CSV log files. I am trying to produce a graph of all the incoming calls between two dates, grouped by day of the week. I have achieved this, but I am struggling to have the graph display the columns in the correct order, starting with Monday. My SQL query that I pass to LogParser is as follows: SELECT to_string(to_timestamp(c1, 'yyyy/MM/dd HH:mm'), 'dddd') as Day, count(*) as Calls INTO graph.gif FROM C:\logs\*.txt WHERE c5 = 'I' AND to_timestamp(c1, 'yyyy/MM/dd HH:mm') BETWEEN timestamp('10/05/2012', 'dd/MM/yyyy') AND timestamp('24/05/2012', 'dd/MM/yyyy') GROUP BY Day It actually outputs in the correct order without any ORDER BY statement at all, but I think that the first column is always the day that the date range starts on, whereas I would like it to always be Monday (for easy comparison of graphs). What happens currently is it converts the timestamp from my log file into a string representation of the day of the week (for the purpose of output) and as far as I am aware there is no built in logic that 'Monday' is less than 'Tuesday' and so on. My instinct was to use a CASE statement in an ORDER BY, but LogParser won't accept this. This is my entire LogParser command just in case it's relevant, C:\Program Files (x86)\Log Parser 2.2\Logparser.exe" -i:CSV "SELECT to_string(to_timestamp(c1, 'yyyy/MM/dd HH:mm'), 'dddd') as Day, count(*) as Calls INTO graph.gif FROM C:\logs\*.txt WHERE c5 = 'I' AND to_timestamp(c1, 'yyyy/MM/dd HH:mm') BETWEEN timestamp('10/05/2012', 'dd/MM/yyyy') AND timestamp('24/05/2012', 'dd/MM/yyyy') GROUP BY Day" -chartType:Column3D -chartTitle:"Incoming Calls" -values:ON -config:MyConfig.js -o:CHART -headerRow OFF -iHeaderFile C:\logs\header\header.txt Simply all I would like is for my results order to always start on Monday, regardless of the date range. Any ideas?
0
11,567,958
07/19/2012 19:30:28
659,858
03/15/2011 02:19:08
189
11
Proper way to decode SecurityElement.Escape using Javascript
I've tried several methods to decode encoded xml using javascript. For some reason all of them ignore &apos; which causes it to fail. I can do a string.replace to fix the issue, but wondering why this happens or if there is some other method I should be using. I've tried decodeURIComponent as well as another method I found on SO that puts the content in a div and then pulls it back out. Both ignore the &apos;. I also tried unescape which curiously did nothing whatsoever. It is an xml block I am decoding.
c#
javascript
asp.net
null
null
null
open
Proper way to decode SecurityElement.Escape using Javascript === I've tried several methods to decode encoded xml using javascript. For some reason all of them ignore &apos; which causes it to fail. I can do a string.replace to fix the issue, but wondering why this happens or if there is some other method I should be using. I've tried decodeURIComponent as well as another method I found on SO that puts the content in a div and then pulls it back out. Both ignore the &apos;. I also tried unescape which curiously did nothing whatsoever. It is an xml block I am decoding.
0
11,567,945
07/19/2012 19:29:25
1,425,786
05/30/2012 10:26:04
46
0
how to mix multithreading with sequential requirement?
i have a program which process price data coming from the broker. the pseudo code are as follow: Process[] process = new Process[50]; void tickEvent(object sender, EventArgs e) { int contractNumber = e.contractNumber; doPriceProcess(process[contractNumber], e); } now i would like to use mutlithreading to speed up my program, if the data are of different contract number, i would like to fire off different threads to speed up the process. However if the data are from the same contract, i would like the program to wait until the current process finishes before i continue with the next data. How do i do it? can you provide some code please? thanks in advance~
c#
multithreading
null
null
null
null
open
how to mix multithreading with sequential requirement? === i have a program which process price data coming from the broker. the pseudo code are as follow: Process[] process = new Process[50]; void tickEvent(object sender, EventArgs e) { int contractNumber = e.contractNumber; doPriceProcess(process[contractNumber], e); } now i would like to use mutlithreading to speed up my program, if the data are of different contract number, i would like to fire off different threads to speed up the process. However if the data are from the same contract, i would like the program to wait until the current process finishes before i continue with the next data. How do i do it? can you provide some code please? thanks in advance~
0
11,567,965
07/19/2012 19:31:19
1,429,069
05/31/2012 17:32:56
236
15
Getting The Current User Name In ASP.NET Application
I am running a webpage that needs to be able to read the login id of the current user. Here is the code I am using: string id = System.Security.Principal.WindowsIdentity.GetCurrent().Name; Currently this returns the correct login but when I use it in this method: protected Boolean isPageOwner() { string id = System.Security.Principal.WindowsIdentity.GetCurrent().Name; alert("User: " + id); if (id.Equals(pageOwnerID)) { return true; } if (accessPermission.ContainsKey(id)) { return true; } return false; } the method returns false even though the id returned is identical to pageOwnerID. I'm really not sure which part of this I am having a problem with. On a side note, my login id is of the form string1/string2 but the code retrieves it as string1 + string2 without the slash. Any advice is appreciated. Regards.
c#
asp.net
null
null
null
null
open
Getting The Current User Name In ASP.NET Application === I am running a webpage that needs to be able to read the login id of the current user. Here is the code I am using: string id = System.Security.Principal.WindowsIdentity.GetCurrent().Name; Currently this returns the correct login but when I use it in this method: protected Boolean isPageOwner() { string id = System.Security.Principal.WindowsIdentity.GetCurrent().Name; alert("User: " + id); if (id.Equals(pageOwnerID)) { return true; } if (accessPermission.ContainsKey(id)) { return true; } return false; } the method returns false even though the id returned is identical to pageOwnerID. I'm really not sure which part of this I am having a problem with. On a side note, my login id is of the form string1/string2 but the code retrieves it as string1 + string2 without the slash. Any advice is appreciated. Regards.
0
11,567,967
07/19/2012 19:31:25
1,538,910
07/19/2012 19:23:24
1
0
My Android app needs to push data to a database in a cloud. What database do I use, what code do I need in the app?
I am about to start writing an Android app that allows users to do the following: Type in data about a specific topic, tick some boxes, enter some numbers. This data needs to be pushed from the Android tablet to a database. I then need to view that database on a website. The data must be transferred securely. The app needs to receive data from the database over wifi allowing the user to update fields. My questions: 1) What coding do I need to use for the app? 2) What database do I need to use? 3) What is the most efficient way to do this on an Android tablet? 4) How do I set up the database connection? Should I use polling, push or something else? Thank you so much David
android
database
application
null
null
null
open
My Android app needs to push data to a database in a cloud. What database do I use, what code do I need in the app? === I am about to start writing an Android app that allows users to do the following: Type in data about a specific topic, tick some boxes, enter some numbers. This data needs to be pushed from the Android tablet to a database. I then need to view that database on a website. The data must be transferred securely. The app needs to receive data from the database over wifi allowing the user to update fields. My questions: 1) What coding do I need to use for the app? 2) What database do I need to use? 3) What is the most efficient way to do this on an Android tablet? 4) How do I set up the database connection? Should I use polling, push or something else? Thank you so much David
0
11,373,449
07/07/2012 08:16:51
1,144,895
01/12/2012 07:08:48
36
1
NSInternalInconsistencyException ( error during execution of SQL string 'INSERT INTO Y_UBMETA(YPEERID, YTRANSACTIONNUMBER) )
iOS iCloud Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'error during execution of SQL string 'INSERT INTO Y_UBMETA(YPEERID, YTRANSACTIONNUMBER) Unresolved error Error Domain=NSCocoaErrorDomain Code=134312 "Store metadata recovery appears to have failed, please try adding the store to the coordinator again. If that is unsuccessful, migrate the data to a new ubiquitized persistent store." UserInfo=0xdba5b80 {NSLocalizedDescription=Store metadata recovery appears to have failed, please try adding the store to the coordinator again. If that is unsuccessful, migrate the data to a new ubiquitized persistent store.}, {    NSLocalizedDescription = "Store metadata recovery appears to have failed, please try adding the store to the coordinator again. If that is unsuccessful, migrate the data to a new ubiquitized persistent store."; How do I solve this problem? Coz that it is an internal query for iCloud. I am putting my code block below of the method i have written.. <code> - (NSPersistentStoreCoordinator *)persistentStoreCoordinator {     NSLog(@"persistentStoreCoordinator:%@",[persistentStoreCoordinator_ description]);     if((persistentStoreCoordinator_ != nil))     {         return persistentStoreCoordinator_;     }     NSLog(@"persistentStoreCoordinator:%@",[persistentStoreCoordinator_ description]);     NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"CoreDataModel.sqlite"];     persistentStoreCoordinator_ = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];     NSPersistentStoreCoordinator* psc = persistentStoreCoordinator_;     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];                         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{         NSFileManager *fileManager = [NSFileManager defaultManager];         // Migrate datamodel         NSDictionary *options = nil;         // this needs to match the entitlements and provisioning profile         NSURL *cloudURL = [fileManager URLForUbiquityContainerIdentifier:nil];         NSLog(@"cloudURL:%@",cloudURL);             //NSString* coreDataCloudContent = [[cloudURL path] stringByAppendingPathComponent:@"Data"];                          cloudURL = [cloudURL URLByAppendingPathComponent:@"Data"];                                                                                                                                          // NSLog(@"coreDataCloudContent:%@",coreDataCloudContent);        //if ([coreDataCloudContent length] != 0 && [[defaults objectForKey:@"allMetadataFlag"] isEqualToString:@"YES"])                    if (cloudURL )//&& [[defaults objectForKey:@"allMetadataFlag"] isEqualToString:@"YES"])                     {             // iCloud is available            // cloudURL = [NSURL fileURLWithPath:coreDataCloudContent];             NSLog(@"cloudURL:%@",cloudURL);             options = [NSDictionary dictionaryWithObjectsAndKeys:                        [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,                        [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption,                        @"SecureAssistant.store", NSPersistentStoreUbiquitousContentNameKey,                        cloudURL, NSPersistentStoreUbiquitousContentURLKey,nil];         }         else         {             // iCloud is not available             options = [NSDictionary dictionaryWithObjectsAndKeys:                        [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,                        [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption,nil];         }             NSError *error = nil;         [psc lock];         if (![psc addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error])         {             NSLog(@"Unresolved error %@, %@", error, [error userInfo]);             abort();         }         [psc unlock];         dispatch_async(dispatch_get_main_queue(), ^{             NSLog(@"asynchronously added persistent store!");             [[NSNotificationCenter defaultCenter] postNotificationName:@"RefetchAllDatabaseData" object:self userInfo:nil];         });     });        return persistentStoreCoordinator_; } </code>
iphone
xcode
ios5
icloud
icloud-api
null
open
NSInternalInconsistencyException ( error during execution of SQL string 'INSERT INTO Y_UBMETA(YPEERID, YTRANSACTIONNUMBER) ) === iOS iCloud Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'error during execution of SQL string 'INSERT INTO Y_UBMETA(YPEERID, YTRANSACTIONNUMBER) Unresolved error Error Domain=NSCocoaErrorDomain Code=134312 "Store metadata recovery appears to have failed, please try adding the store to the coordinator again. If that is unsuccessful, migrate the data to a new ubiquitized persistent store." UserInfo=0xdba5b80 {NSLocalizedDescription=Store metadata recovery appears to have failed, please try adding the store to the coordinator again. If that is unsuccessful, migrate the data to a new ubiquitized persistent store.}, {    NSLocalizedDescription = "Store metadata recovery appears to have failed, please try adding the store to the coordinator again. If that is unsuccessful, migrate the data to a new ubiquitized persistent store."; How do I solve this problem? Coz that it is an internal query for iCloud. I am putting my code block below of the method i have written.. <code> - (NSPersistentStoreCoordinator *)persistentStoreCoordinator {     NSLog(@"persistentStoreCoordinator:%@",[persistentStoreCoordinator_ description]);     if((persistentStoreCoordinator_ != nil))     {         return persistentStoreCoordinator_;     }     NSLog(@"persistentStoreCoordinator:%@",[persistentStoreCoordinator_ description]);     NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"CoreDataModel.sqlite"];     persistentStoreCoordinator_ = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];     NSPersistentStoreCoordinator* psc = persistentStoreCoordinator_;     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];                         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{         NSFileManager *fileManager = [NSFileManager defaultManager];         // Migrate datamodel         NSDictionary *options = nil;         // this needs to match the entitlements and provisioning profile         NSURL *cloudURL = [fileManager URLForUbiquityContainerIdentifier:nil];         NSLog(@"cloudURL:%@",cloudURL);             //NSString* coreDataCloudContent = [[cloudURL path] stringByAppendingPathComponent:@"Data"];                          cloudURL = [cloudURL URLByAppendingPathComponent:@"Data"];                                                                                                                                          // NSLog(@"coreDataCloudContent:%@",coreDataCloudContent);        //if ([coreDataCloudContent length] != 0 && [[defaults objectForKey:@"allMetadataFlag"] isEqualToString:@"YES"])                    if (cloudURL )//&& [[defaults objectForKey:@"allMetadataFlag"] isEqualToString:@"YES"])                     {             // iCloud is available            // cloudURL = [NSURL fileURLWithPath:coreDataCloudContent];             NSLog(@"cloudURL:%@",cloudURL);             options = [NSDictionary dictionaryWithObjectsAndKeys:                        [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,                        [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption,                        @"SecureAssistant.store", NSPersistentStoreUbiquitousContentNameKey,                        cloudURL, NSPersistentStoreUbiquitousContentURLKey,nil];         }         else         {             // iCloud is not available             options = [NSDictionary dictionaryWithObjectsAndKeys:                        [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,                        [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption,nil];         }             NSError *error = nil;         [psc lock];         if (![psc addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error])         {             NSLog(@"Unresolved error %@, %@", error, [error userInfo]);             abort();         }         [psc unlock];         dispatch_async(dispatch_get_main_queue(), ^{             NSLog(@"asynchronously added persistent store!");             [[NSNotificationCenter defaultCenter] postNotificationName:@"RefetchAllDatabaseData" object:self userInfo:nil];         });     });        return persistentStoreCoordinator_; } </code>
0
11,373,450
07/07/2012 08:17:00
732,884
05/01/2011 00:50:58
178
3
Connecting to a local socket server from SWF on remote page
I have a Kiosk that connects to a local socket server so it can access some hardware. If the kiosk code is stored locally, it can access the socket perfectly. However, and I know for good reason, if the kiosk code is hosted on a remote server, it can not access the local socket server because of a sandbox violation. The problem is that all of these kiosks are hosted on AppEngine, so when I am done making changes, it takes hours to render out to a single HTML file, and change all the css/js location links. Is there anyway possible for the allow the SWF file to access the local socket server when it is hostel remotely? Also, The socket server is a Java app that I dont have the source to. I run it locally through the terminal
actionscript-3
flash
sockets
sandbox
null
null
open
Connecting to a local socket server from SWF on remote page === I have a Kiosk that connects to a local socket server so it can access some hardware. If the kiosk code is stored locally, it can access the socket perfectly. However, and I know for good reason, if the kiosk code is hosted on a remote server, it can not access the local socket server because of a sandbox violation. The problem is that all of these kiosks are hosted on AppEngine, so when I am done making changes, it takes hours to render out to a single HTML file, and change all the css/js location links. Is there anyway possible for the allow the SWF file to access the local socket server when it is hostel remotely? Also, The socket server is a Java app that I dont have the source to. I run it locally through the terminal
0
11,373,426
07/07/2012 08:12:17
1,404,083
05/18/2012 18:43:15
1
0
Android PhoneGap Downloader Plugin for dynamic page
I just need a javascript/java code for dynamic url to use phonegap downloader plugion for dynamic pages.can any one help??? **THANXX**
android
dynamic
phonegap
phonegap-plugins
null
null
open
Android PhoneGap Downloader Plugin for dynamic page === I just need a javascript/java code for dynamic url to use phonegap downloader plugion for dynamic pages.can any one help??? **THANXX**
0
11,373,433
07/07/2012 08:14:18
1,386,748
05/10/2012 09:50:29
41
0
Android Scrollable EditText Hint
http://stackoverflow.com/questions/6250041/problem-with-making-edittext-scrollable there is mentioned that it is not scrollable with singleLine=true. So i have 2 options: 1. I check if the user inputs "\n" and delete that, then i have to worry about things in the second line, too. 2. I use a custom scroll view in textviews, could this be used here too only for the hint ? import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; import android.widget.TextView; public class ScrollingTextView extends TextView { public ScrollingTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public ScrollingTextView(Context context, AttributeSet attrs) { super(context, attrs); } public ScrollingTextView(Context context) { super(context); } @Override protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { if (focused) super.onFocusChanged(focused, direction, previouslyFocusedRect); } @Override public void onWindowFocusChanged(boolean focused) { if (focused) super.onWindowFocusChanged(focused); } @Override public boolean isFocused() { return true; } } <com.test.ScrollingTextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginTop="1dp" android:layout_weight="0.17" android:background="@color/black" android:ellipsize="marquee" android:gravity="center_vertical" android:marqueeRepeatLimit="marquee_forever" android:paddingLeft="10dp" android:scrollHorizontally="true" android:singleLine="true" android:text="@string/editLength" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@color/white" />
android
edittext
null
null
null
null
open
Android Scrollable EditText Hint === http://stackoverflow.com/questions/6250041/problem-with-making-edittext-scrollable there is mentioned that it is not scrollable with singleLine=true. So i have 2 options: 1. I check if the user inputs "\n" and delete that, then i have to worry about things in the second line, too. 2. I use a custom scroll view in textviews, could this be used here too only for the hint ? import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; import android.widget.TextView; public class ScrollingTextView extends TextView { public ScrollingTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public ScrollingTextView(Context context, AttributeSet attrs) { super(context, attrs); } public ScrollingTextView(Context context) { super(context); } @Override protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) { if (focused) super.onFocusChanged(focused, direction, previouslyFocusedRect); } @Override public void onWindowFocusChanged(boolean focused) { if (focused) super.onWindowFocusChanged(focused); } @Override public boolean isFocused() { return true; } } <com.test.ScrollingTextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginTop="1dp" android:layout_weight="0.17" android:background="@color/black" android:ellipsize="marquee" android:gravity="center_vertical" android:marqueeRepeatLimit="marquee_forever" android:paddingLeft="10dp" android:scrollHorizontally="true" android:singleLine="true" android:text="@string/editLength" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="@color/white" />
0
11,373,456
07/07/2012 08:18:33
1,508,422
07/07/2012 07:51:17
1
0
Camera properties for 3d using specular reflection
Could any one help in clarifying the following description taken from the article "Local Shape from Mirror Reflection" by Savarese, Chen and Perona. "Let c be the center of projection of the camera. The image plane is positioned l distance units in front of c, perpendicular to the view direction v. Given a scene point p let q be the image of p observed on the image plane through a specular reflection on the mirror surface at r." 1. To my understanding both c, v and l are properties of the camera, so how can I find them? 2. As p moves along the scene plain q and r shift respectively are c,v and l constant or should a new center of projection, image plane and view direction be calibrated separately for each point![enter image description here][1]?
image-processing
computer-vision
cv
null
null
null
open
Camera properties for 3d using specular reflection === Could any one help in clarifying the following description taken from the article "Local Shape from Mirror Reflection" by Savarese, Chen and Perona. "Let c be the center of projection of the camera. The image plane is positioned l distance units in front of c, perpendicular to the view direction v. Given a scene point p let q be the image of p observed on the image plane through a specular reflection on the mirror surface at r." 1. To my understanding both c, v and l are properties of the camera, so how can I find them? 2. As p moves along the scene plain q and r shift respectively are c,v and l constant or should a new center of projection, image plane and view direction be calibrated separately for each point![enter image description here][1]?
0
11,373,459
07/07/2012 08:19:00
650,312
03/08/2011 18:23:03
525
4
How to avoid php escape string on online hosting?
When I type ***don't***, it save ***don\'t*** to database. I tested the code on wamp offline server and it save ***don't***. But when I test the code on online hosting, it save ***don\'t***. How to make online hosting don't use excape string? Codes : <?php if (isset($_POST['btn_edit'])) { $description = $_POST['description']; } $sql = "UPDATE expense SET description=? WHERE spender_id=?"; $q = $conn->prepare($sql); $result = $q->execute(array($description, $_SESSION['user_id'])); ?> <input type="text" name="description" size="70" value="" />
php
pdo
null
null
null
null
open
How to avoid php escape string on online hosting? === When I type ***don't***, it save ***don\'t*** to database. I tested the code on wamp offline server and it save ***don't***. But when I test the code on online hosting, it save ***don\'t***. How to make online hosting don't use excape string? Codes : <?php if (isset($_POST['btn_edit'])) { $description = $_POST['description']; } $sql = "UPDATE expense SET description=? WHERE spender_id=?"; $q = $conn->prepare($sql); $result = $q->execute(array($description, $_SESSION['user_id'])); ?> <input type="text" name="description" size="70" value="" />
0
11,373,438
07/07/2012 08:15:03
1,508,437
07/07/2012 08:08:48
1
0
Splice is not splice
Here i have an array with undefined number of elements. I tried to print random element of this array and cut it. Here my code. function rand(min, max){ return (Math.floor(Math.random() * (max - min + 1)) + min).toFixed(0); } $('#do').click(function(){ var count = chamarr.length; var num = 0; if (count == 1) { $('#output').html('Nothing can found'); } else { num = rand(1,chamarr.length); $('#output').html(chamarr[num]); chamarr.splice(num,1); } }); When I logged an array is cutted, I saw that always ok, but sometimes element is not cut!
javascript
splice
null
null
null
null
open
Splice is not splice === Here i have an array with undefined number of elements. I tried to print random element of this array and cut it. Here my code. function rand(min, max){ return (Math.floor(Math.random() * (max - min + 1)) + min).toFixed(0); } $('#do').click(function(){ var count = chamarr.length; var num = 0; if (count == 1) { $('#output').html('Nothing can found'); } else { num = rand(1,chamarr.length); $('#output').html(chamarr[num]); chamarr.splice(num,1); } }); When I logged an array is cutted, I saw that always ok, but sometimes element is not cut!
0
11,373,441
07/07/2012 08:15:26
1,500,194
07/03/2012 23:50:17
11
0
WMI and C# - window logon events
Can anyone help me how to retrieve the below computer event statistics on a network: The exact time computer gets logged on, logged off, locked, unlocked, remote logged on etc, also the user name who is responsible for events.. Also this should work on windows OS(XP/Server/7). If this can be done through WMI, please let me know how... Thanks!
c#
window
wmi
null
null
null
open
WMI and C# - window logon events === Can anyone help me how to retrieve the below computer event statistics on a network: The exact time computer gets logged on, logged off, locked, unlocked, remote logged on etc, also the user name who is responsible for events.. Also this should work on windows OS(XP/Server/7). If this can be done through WMI, please let me know how... Thanks!
0
11,373,442
07/07/2012 08:15:43
452,680
07/26/2010 07:33:54
1,547
11
Is this possible to an Interface inherit constants and methods from Super Interface in java?
I know an Interface extends another Interface in java.So, Is this possible to inheriting constants and methods from the super interface.If i have any restrictions on inheriting then please guide me to get knowledge about it
java
oop
null
null
null
null
open
Is this possible to an Interface inherit constants and methods from Super Interface in java? === I know an Interface extends another Interface in java.So, Is this possible to inheriting constants and methods from the super interface.If i have any restrictions on inheriting then please guide me to get knowledge about it
0
11,373,460
07/07/2012 08:19:03
1,508,436
07/07/2012 08:07:47
1
0
Netty persistent connetion error
I have a nio server A to handle incoming clients in the meantime the server need to connect to another server B.So my code is as follows: Create server: serverfactory = new NioServerSocketChannelFactory(Executors.newSingleThreadExecutor(), Executors.newCachedThreadPool()); ServerBootstrap bootstrap = new ServerBootstrap(serverfactory); gamePipelineFactory = new GamePipelineFactory(); bootstrap.setPipelineFactory(gamePipelineFactory); bootstrap.setOption("child.tcpNoDelay", true); bootstrap.setOption("child.keepAlive", true); Channel channel = bootstrap.bind(new InetSocketAddress(Config.getServerPort())); allChannels.add(channel); Connect to server B(Server B is running on the same machine using Executors.newCachedThreadPool()): if(clientfactory == null) { clientfactory = new NioClientSocketChannelFactory(Executors.newSingleThreadExecutor(),Executors.newSingleThreadExecutor()); } ClientBootstrap bootstrap = new ClientBootstrap(clientfactory); bootstrap.setPipelineFactory(new ChannelPipelineFactory() { public ChannelPipeline getPipeline() { return Channels.pipeline(new HeaderFrameDecoder(), new DatabaseClientHandler()); } }); bootstrap.setOption("tcpNoDelay", true); bootstrap.setOption("receiveBufferSize", 1048576); bootstrap.setOption("sendBufferSize", 1048576); ChannelFuture future = bootstrap.connect(new InetSocketAddress(Config.getDatabaseHost(), Config.getDatabasePort())); future = future.awaitUninterruptibly(); databaseChannel = future.getChannel(); lastDbConnectTime = System.currentTimeMillis(); It works fine in one hour or two, but after that, I will get no response from Server B, It seems I have to reconnect to Server B.I wonder why? Can someone point out? Thanks in advanced.
connection
netty
persistent
null
null
null
open
Netty persistent connetion error === I have a nio server A to handle incoming clients in the meantime the server need to connect to another server B.So my code is as follows: Create server: serverfactory = new NioServerSocketChannelFactory(Executors.newSingleThreadExecutor(), Executors.newCachedThreadPool()); ServerBootstrap bootstrap = new ServerBootstrap(serverfactory); gamePipelineFactory = new GamePipelineFactory(); bootstrap.setPipelineFactory(gamePipelineFactory); bootstrap.setOption("child.tcpNoDelay", true); bootstrap.setOption("child.keepAlive", true); Channel channel = bootstrap.bind(new InetSocketAddress(Config.getServerPort())); allChannels.add(channel); Connect to server B(Server B is running on the same machine using Executors.newCachedThreadPool()): if(clientfactory == null) { clientfactory = new NioClientSocketChannelFactory(Executors.newSingleThreadExecutor(),Executors.newSingleThreadExecutor()); } ClientBootstrap bootstrap = new ClientBootstrap(clientfactory); bootstrap.setPipelineFactory(new ChannelPipelineFactory() { public ChannelPipeline getPipeline() { return Channels.pipeline(new HeaderFrameDecoder(), new DatabaseClientHandler()); } }); bootstrap.setOption("tcpNoDelay", true); bootstrap.setOption("receiveBufferSize", 1048576); bootstrap.setOption("sendBufferSize", 1048576); ChannelFuture future = bootstrap.connect(new InetSocketAddress(Config.getDatabaseHost(), Config.getDatabasePort())); future = future.awaitUninterruptibly(); databaseChannel = future.getChannel(); lastDbConnectTime = System.currentTimeMillis(); It works fine in one hour or two, but after that, I will get no response from Server B, It seems I have to reconnect to Server B.I wonder why? Can someone point out? Thanks in advanced.
0
11,373,461
07/07/2012 08:19:04
1,379,455
05/07/2012 10:06:00
3
1
handling multiple threads in java to send request and get response, to a C server application
I have a traditional problem that's living in java development for years, but couldn't decide what is the best way of doing it. So need your advice to pick the best one. Issue goes as below - Client - Java program (Basically a web based application) Server - Written in C Requirement - User will upload a file that may contain a million records or for example say 50000 records. Each record (line) will have a serial id, product name and customer name. My java program should read the file and send request to the C application over the network. This C server application will respond with a request id and in java (client) I need to store this request ID in a list that's synchronized and should query back to the C server application to find out the status of the request id that was sent earlier. And server responds either WIP (work in progress) or DONE (completed) for the request id. If C server application response = DONE, server will send some data along with the response and if its WIP, client should retry 3 times with an interval of 5 seconds. Code Design - Step 1 - Read the file line by line Step 2 - After reading the line, Start a thread that would send request to the server and stores the response to a synchronized array list. Step 3 - Another thread would read the synchronized list and starts querying the request status and stores the final response from the C server app. This might create a memory overhead as you can see if the file contains 100000 records, it might create 100000 threads. Can you guys suggest me a better way of handling this. Thanks, Sirish.
java
multithreading
performance
synchronization
null
null
open
handling multiple threads in java to send request and get response, to a C server application === I have a traditional problem that's living in java development for years, but couldn't decide what is the best way of doing it. So need your advice to pick the best one. Issue goes as below - Client - Java program (Basically a web based application) Server - Written in C Requirement - User will upload a file that may contain a million records or for example say 50000 records. Each record (line) will have a serial id, product name and customer name. My java program should read the file and send request to the C application over the network. This C server application will respond with a request id and in java (client) I need to store this request ID in a list that's synchronized and should query back to the C server application to find out the status of the request id that was sent earlier. And server responds either WIP (work in progress) or DONE (completed) for the request id. If C server application response = DONE, server will send some data along with the response and if its WIP, client should retry 3 times with an interval of 5 seconds. Code Design - Step 1 - Read the file line by line Step 2 - After reading the line, Start a thread that would send request to the server and stores the response to a synchronized array list. Step 3 - Another thread would read the synchronized list and starts querying the request status and stores the final response from the C server app. This might create a memory overhead as you can see if the file contains 100000 records, it might create 100000 threads. Can you guys suggest me a better way of handling this. Thanks, Sirish.
0
11,373,462
07/07/2012 08:19:21
1,418,933
05/26/2012 11:18:36
11
0
Highlight current post item in a list of posts - PHP
I have a website under construction, using PHP MYSQL, which contains a news page with three columns. col1 - news content (middle column) col2 - recent news (left column) col3 - News Archives (right column) The db queries are as below: mysql_select_db($database_admin_conn, $admin_conn); $query_getArchives = "SELECT DISTINCT DATE_FORMAT (news.updated, '%M %Y') AS archive, DATE_FORMAT (news.updated, '%Y-%m') AS link FROM news ORDER BY news.updated DESC"; $getArchives = mysql_query($query_getArchives, $admin_conn) or die(mysql_error()); $row_getArchives = mysql_fetch_assoc($getArchives); $totalRows_getArchives = mysql_num_rows($getArchives); mysql_select_db($database_admin_conn, $admin_conn); $query_getRecent = "SELECT news.news_id, news.title FROM news ORDER BY news.updated DESC LIMIT 10"; $getRecent = mysql_query($query_getRecent, $admin_conn) or die(mysql_error()); $row_getRecent = mysql_fetch_assoc($getRecent); $totalRows_getRecent = mysql_num_rows($getRecent); $var1_getDisplay2 = "-1"; if (isset($_GET['archive'])) { $var1_getDisplay2 = $_GET['archive']; $query_getDisplay = sprintf("SELECT news.news_id, news.title, news.news_entry, DATE_FORMAT (news.updated, '%%M %%e, %%Y') AS formatted FROM news WHERE DATE_FORMAT(news.updated, '%%Y-%%m') = %s ORDER BY news.updated DESC", GetSQLValueString($var1_getDisplay2, "text")); } elseif (isset($_GET['news_id'])) { $var2_getDisplay3 = $_GET['news_id']; $query_getDisplay = sprintf("SELECT news.news_id, news.title, news.news_entry, DATE_FORMAT(news.updated, '%%M %%e, %%Y') AS formatted FROM news WHERE news.news_id=%s ", GetSQLValueString($var2_getDisplay3, "int")); } else { mysql_select_db($database_admin_conn, $admin_conn); $query_getDisplay = "SELECT news.news_id, news.title, news.news_entry, DATE_FORMAT (news.updated, '%M %e, %Y') AS formatted FROM news ORDER BY news.updated DESC LIMIT 3"; } $getDisplay = mysql_query($query_getDisplay, $admin_conn) or die(mysql_error()); And here is the relevant extract of the html/css for news page: <div class="col1"> <div class="news"> <?php while($newsItem = mysql_fetch_array($getDisplay)) { ?> <?php $arrayNews[$getDisplay['news_id']] = $newsItem; ?> <?php foreach($arrayNews AS $newsItem) { ?> <h1> <?php echo $newsItem['title'] ; ?> </h1><h3> <?php echo $newsItem['formatted'] ; ?></h3> <?php $query_getPhotoDetails = "SELECT * FROM photos INNER JOIN news2photo USING (photo_id) WHERE news2photo.news_id = '" . $newsItem['news_id'] . "' LIMIT 3 "; $getPhotoDetails = mysql_query($query_getPhotoDetails, $admin_conn) or die(mysql_error()); while($photo = mysql_fetch_array($getPhotoDetails)) { ?> <div class="imagefield"> <p>&nbsp</p> <p> <img src="../images/<?php echo $photo['filename']; ?>" width="200" /> </p> </div> <?php } ?> <?php $newsItem['news_entry'] = preg_replace("/((http)+(s)?:\/\/[^<>\s]+)/i", "<a href=\"\\0\" target=\"_blank\">\\0</a>", $newsItem['news_entry'] ); ?> <div class="newsitem"> <p>&nbsp</p> <p> <?php echo nl2br($newsItem['news_entry']); ?> </p> </div> <?php } ?> <?php } ?> </div><!--end news--> </div> <div class="col2"> <h3>Recent News</h3> <ul> <?php do { ?> <li class="seperator"><a href="news.php?news_id=<?php echo $row_getRecent['news_id']; ?>"><?php echo $row_getRecent['title']; ?></a></li> <?php } while ($row_getRecent = mysql_fetch_assoc($getRecent)); ?> </ul> </div> <div class="col3"><h3>News Archives</h3> <ul> <?php do { ?> <li class="seperator"><a href="news.php?archive=<?php echo $row_getArchives['link']; ?>"><?php echo $row_getArchives['archive']; ?></a></li> <?php } while ($row_getArchives = mysql_fetch_assoc($getArchives)); ?> </ul> </div> Things work fine, but I need help with highlighting the current list item in the 'Recent News' (col2) column. I did search quite a bit, but almost all of solutions are wordpess specific. Thanks in advance :)
php
mysql
css
html-lists
null
null
open
Highlight current post item in a list of posts - PHP === I have a website under construction, using PHP MYSQL, which contains a news page with three columns. col1 - news content (middle column) col2 - recent news (left column) col3 - News Archives (right column) The db queries are as below: mysql_select_db($database_admin_conn, $admin_conn); $query_getArchives = "SELECT DISTINCT DATE_FORMAT (news.updated, '%M %Y') AS archive, DATE_FORMAT (news.updated, '%Y-%m') AS link FROM news ORDER BY news.updated DESC"; $getArchives = mysql_query($query_getArchives, $admin_conn) or die(mysql_error()); $row_getArchives = mysql_fetch_assoc($getArchives); $totalRows_getArchives = mysql_num_rows($getArchives); mysql_select_db($database_admin_conn, $admin_conn); $query_getRecent = "SELECT news.news_id, news.title FROM news ORDER BY news.updated DESC LIMIT 10"; $getRecent = mysql_query($query_getRecent, $admin_conn) or die(mysql_error()); $row_getRecent = mysql_fetch_assoc($getRecent); $totalRows_getRecent = mysql_num_rows($getRecent); $var1_getDisplay2 = "-1"; if (isset($_GET['archive'])) { $var1_getDisplay2 = $_GET['archive']; $query_getDisplay = sprintf("SELECT news.news_id, news.title, news.news_entry, DATE_FORMAT (news.updated, '%%M %%e, %%Y') AS formatted FROM news WHERE DATE_FORMAT(news.updated, '%%Y-%%m') = %s ORDER BY news.updated DESC", GetSQLValueString($var1_getDisplay2, "text")); } elseif (isset($_GET['news_id'])) { $var2_getDisplay3 = $_GET['news_id']; $query_getDisplay = sprintf("SELECT news.news_id, news.title, news.news_entry, DATE_FORMAT(news.updated, '%%M %%e, %%Y') AS formatted FROM news WHERE news.news_id=%s ", GetSQLValueString($var2_getDisplay3, "int")); } else { mysql_select_db($database_admin_conn, $admin_conn); $query_getDisplay = "SELECT news.news_id, news.title, news.news_entry, DATE_FORMAT (news.updated, '%M %e, %Y') AS formatted FROM news ORDER BY news.updated DESC LIMIT 3"; } $getDisplay = mysql_query($query_getDisplay, $admin_conn) or die(mysql_error()); And here is the relevant extract of the html/css for news page: <div class="col1"> <div class="news"> <?php while($newsItem = mysql_fetch_array($getDisplay)) { ?> <?php $arrayNews[$getDisplay['news_id']] = $newsItem; ?> <?php foreach($arrayNews AS $newsItem) { ?> <h1> <?php echo $newsItem['title'] ; ?> </h1><h3> <?php echo $newsItem['formatted'] ; ?></h3> <?php $query_getPhotoDetails = "SELECT * FROM photos INNER JOIN news2photo USING (photo_id) WHERE news2photo.news_id = '" . $newsItem['news_id'] . "' LIMIT 3 "; $getPhotoDetails = mysql_query($query_getPhotoDetails, $admin_conn) or die(mysql_error()); while($photo = mysql_fetch_array($getPhotoDetails)) { ?> <div class="imagefield"> <p>&nbsp</p> <p> <img src="../images/<?php echo $photo['filename']; ?>" width="200" /> </p> </div> <?php } ?> <?php $newsItem['news_entry'] = preg_replace("/((http)+(s)?:\/\/[^<>\s]+)/i", "<a href=\"\\0\" target=\"_blank\">\\0</a>", $newsItem['news_entry'] ); ?> <div class="newsitem"> <p>&nbsp</p> <p> <?php echo nl2br($newsItem['news_entry']); ?> </p> </div> <?php } ?> <?php } ?> </div><!--end news--> </div> <div class="col2"> <h3>Recent News</h3> <ul> <?php do { ?> <li class="seperator"><a href="news.php?news_id=<?php echo $row_getRecent['news_id']; ?>"><?php echo $row_getRecent['title']; ?></a></li> <?php } while ($row_getRecent = mysql_fetch_assoc($getRecent)); ?> </ul> </div> <div class="col3"><h3>News Archives</h3> <ul> <?php do { ?> <li class="seperator"><a href="news.php?archive=<?php echo $row_getArchives['link']; ?>"><?php echo $row_getArchives['archive']; ?></a></li> <?php } while ($row_getArchives = mysql_fetch_assoc($getArchives)); ?> </ul> </div> Things work fine, but I need help with highlighting the current list item in the 'Recent News' (col2) column. I did search quite a bit, but almost all of solutions are wordpess specific. Thanks in advance :)
0
11,350,846
07/05/2012 19:02:18
1,504,919
07/05/2012 18:46:13
1
0
Using Robocopy to copying to multiple destination with a size limitation and to keep going to next avaiable volume
i just started my migrations here and now i have to transfer / migrate my video files we have here we have one large nas what a share of 15TB worth of Video. Need to mirror until the guys here are happy with the setup of it. i have 15 shares of 1.5TB so for easier backups they new shares are chunk'ed up into smaller 1.5tb shares instead of one large share of 15tb (for snapshots) not my decision) video would transfer into vid1 vid2 vid3 vid4 vid5 vid6 etc etc all the way down to vid15 my users will be stuck with these new shares for there content i just need a good way to get it there and i figured that robocopy would help but i can't find a syntax or script to move the data to the smaller shares. anyone have any ideas?
robocopy
null
null
null
null
null
open
Using Robocopy to copying to multiple destination with a size limitation and to keep going to next avaiable volume === i just started my migrations here and now i have to transfer / migrate my video files we have here we have one large nas what a share of 15TB worth of Video. Need to mirror until the guys here are happy with the setup of it. i have 15 shares of 1.5TB so for easier backups they new shares are chunk'ed up into smaller 1.5tb shares instead of one large share of 15tb (for snapshots) not my decision) video would transfer into vid1 vid2 vid3 vid4 vid5 vid6 etc etc all the way down to vid15 my users will be stuck with these new shares for there content i just need a good way to get it there and i figured that robocopy would help but i can't find a syntax or script to move the data to the smaller shares. anyone have any ideas?
0
11,350,848
07/05/2012 19:02:24
1,436,325
06/05/2012 01:12:42
16
0
Importing varbinary data using xml
I have a table that has a number of columns that are encrypted. The columns are defined as varbinary in the table and there is a view that converts the varbinary data into varchar. I have a requirement to be able to export and and import rows in the table. I decided to use xml to export the data and this seems to work fine. The problem that I'm having is when I import the data. After importing the encrypted columns, if I look at the base table, the data looks exactly the same, but when I select the data using the view it comes back as null. This all works fine when I select the original row. btw, I'm doing this with C# and SQL Server Am I missing something? Thanks for the help!! Gary
c#
sql-server
varbinary
null
null
null
open
Importing varbinary data using xml === I have a table that has a number of columns that are encrypted. The columns are defined as varbinary in the table and there is a view that converts the varbinary data into varchar. I have a requirement to be able to export and and import rows in the table. I decided to use xml to export the data and this seems to work fine. The problem that I'm having is when I import the data. After importing the encrypted columns, if I look at the base table, the data looks exactly the same, but when I select the data using the view it comes back as null. This all works fine when I select the original row. btw, I'm doing this with C# and SQL Server Am I missing something? Thanks for the help!! Gary
0
11,350,850
07/05/2012 19:02:27
637,858
02/28/2011 14:50:18
242
25
How to quickly create complex HTML controls for webdevelopment?
I know J2EE,Spring,jquery,JS,CSS. Whenever we build any web application then most of the time it require complex HTML controls to be built . Plugin which are freely available in jquery is good but most of the time it require lots of customization which takes lots of time and hence delay the project deliverable. Is there any way were complex controls of web application can be built quickly? How to quickly develop web application ? Is there any tool or opensource project which can generate the code and make the development process faster? Mostly till now I have developed project using 100% hand coding?So do Normally everyone develop java/j2ee webapplication using handcoding or is there any automated tool ?
jquery
css
spring
java-ee
null
07/06/2012 04:04:55
not a real question
How to quickly create complex HTML controls for webdevelopment? === I know J2EE,Spring,jquery,JS,CSS. Whenever we build any web application then most of the time it require complex HTML controls to be built . Plugin which are freely available in jquery is good but most of the time it require lots of customization which takes lots of time and hence delay the project deliverable. Is there any way were complex controls of web application can be built quickly? How to quickly develop web application ? Is there any tool or opensource project which can generate the code and make the development process faster? Mostly till now I have developed project using 100% hand coding?So do Normally everyone develop java/j2ee webapplication using handcoding or is there any automated tool ?
1
11,350,853
07/05/2012 19:02:30
48,025
12/20/2008 19:11:28
416
13
Are there any real advantages of AspNetWebApi over traditional ASP MVC controllers?
With ASP.NET MVC controllers you can expose your data in different formats. AspNetWebAPI is designed explicitly for creating API's but i can easily do that with MVC controllers, is not clear to me in what cases it would be better than traditional MVC controllers. I'm interested in scenarios where the benefits of WebApi are obvious and it would be worthy to add another complexity layer to my applications.
asp.net-mvc
null
null
null
null
null
open
Are there any real advantages of AspNetWebApi over traditional ASP MVC controllers? === With ASP.NET MVC controllers you can expose your data in different formats. AspNetWebAPI is designed explicitly for creating API's but i can easily do that with MVC controllers, is not clear to me in what cases it would be better than traditional MVC controllers. I'm interested in scenarios where the benefits of WebApi are obvious and it would be worthy to add another complexity layer to my applications.
0
11,350,856
07/05/2012 19:02:58
1,252,706
03/06/2012 16:19:29
11
0
Adding z-index to a window
How can I add a zindex value to the following string so that the pop-window is always on top? string winopen = "Window.Open('Details - " + name + "', 'test.aspx', 'dest=" + destination.Value + "&id=" + id.Value + "', [250,250], [100,100], true); return false;"; button1["onclick"] = winopen ;
c#
javascript
jquery
null
null
null
open
Adding z-index to a window === How can I add a zindex value to the following string so that the pop-window is always on top? string winopen = "Window.Open('Details - " + name + "', 'test.aspx', 'dest=" + destination.Value + "&id=" + id.Value + "', [250,250], [100,100], true); return false;"; button1["onclick"] = winopen ;
0
11,350,857
07/05/2012 19:03:02
784,102
06/04/2011 16:40:15
800
4
Why MVar does not work with `par`?
Just curious. If I have 2 threads spawn using `forkIO`, communication between them can be done using `MVar`. I wonder if the same apply when using parallel Haskell's spark created using `par`. I understand `par` does not create an actual thread but just a pointer to some computation that can happen in parallel. The following code compiles, `main` raises the following error: `thread blocked indefinitely in an MVar operation`. t1 a = putMVar a "Hi" t2 a = do v <- takeMVar a print v main1 = do a <- newEmptyMVar forkIO (t1 a) forkIO (t2 a) main = do a <- newEmptyMVar (t1 a) `par` (t2 a)
haskell
concurrency
parallel-processing
null
null
null
open
Why MVar does not work with `par`? === Just curious. If I have 2 threads spawn using `forkIO`, communication between them can be done using `MVar`. I wonder if the same apply when using parallel Haskell's spark created using `par`. I understand `par` does not create an actual thread but just a pointer to some computation that can happen in parallel. The following code compiles, `main` raises the following error: `thread blocked indefinitely in an MVar operation`. t1 a = putMVar a "Hi" t2 a = do v <- takeMVar a print v main1 = do a <- newEmptyMVar forkIO (t1 a) forkIO (t2 a) main = do a <- newEmptyMVar (t1 a) `par` (t2 a)
0
11,350,858
07/05/2012 19:03:03
1,504,944
07/05/2012 18:56:30
1
0
Unfortunately, Intents has stopped?
I am creating few buttons and implemented some links to them e.g. when clicking button1 the app takes users to some webpage. However i am receiving some error when running the app, here is the error message i am getting: 07-05 19:57:58.694: E/AndroidRuntime(564): FATAL EXCEPTION: main 07-05 19:57:58.694: E/AndroidRuntime(564): java.lang.RuntimeException: Unable to start activity ComponentInfo{intentsPackage.button/intentsPackage.button.IntentsActivity}: java.lang.RuntimeException: Binary XML file line #14: You must supply a layout_width attribute. 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread.access$600(ActivityThread.java:123) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.os.Handler.dispatchMessage(Handler.java:99) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.os.Looper.loop(Looper.java:137) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread.main(ActivityThread.java:4424) 07-05 19:57:58.694: E/AndroidRuntime(564): at java.lang.reflect.Method.invokeNative(Native Method) 07-05 19:57:58.694: E/AndroidRuntime(564): at java.lang.reflect.Method.invoke(Method.java:511) 07-05 19:57:58.694: E/AndroidRuntime(564): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 07-05 19:57:58.694: E/AndroidRuntime(564): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 07-05 19:57:58.694: E/AndroidRuntime(564): at dalvik.system.NativeStart.main(Native Method) 07-05 19:57:58.694: E/AndroidRuntime(564): Caused by: java.lang.RuntimeException: Binary XML file line #14: You must supply a layout_width attribute. 07-05 19:57:58.694: E/AndroidRuntime(564): at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5318) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:5439) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.widget.LinearLayout$LayoutParams.<init>(LinearLayout.java:1776) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1700) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:56) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.LayoutInflater.rInflate(LayoutInflater.java:741) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 07-05 19:57:58.694: E/AndroidRuntime(564): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.Activity.setContentView(Activity.java:1835) 07-05 19:57:58.694: E/AndroidRuntime(564): at intentsPackage.button.IntentsActivity.onCreate(IntentsActivity.java:23) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.Activity.performCreate(Activity.java:4465) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 07-05 19:57:58.694: E/AndroidRuntime(564): ... 11 more can you suggest me the the thing i am doing wrong. Thanks
android
android-intent
error-handling
null
null
null
open
Unfortunately, Intents has stopped? === I am creating few buttons and implemented some links to them e.g. when clicking button1 the app takes users to some webpage. However i am receiving some error when running the app, here is the error message i am getting: 07-05 19:57:58.694: E/AndroidRuntime(564): FATAL EXCEPTION: main 07-05 19:57:58.694: E/AndroidRuntime(564): java.lang.RuntimeException: Unable to start activity ComponentInfo{intentsPackage.button/intentsPackage.button.IntentsActivity}: java.lang.RuntimeException: Binary XML file line #14: You must supply a layout_width attribute. 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread.access$600(ActivityThread.java:123) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.os.Handler.dispatchMessage(Handler.java:99) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.os.Looper.loop(Looper.java:137) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread.main(ActivityThread.java:4424) 07-05 19:57:58.694: E/AndroidRuntime(564): at java.lang.reflect.Method.invokeNative(Native Method) 07-05 19:57:58.694: E/AndroidRuntime(564): at java.lang.reflect.Method.invoke(Method.java:511) 07-05 19:57:58.694: E/AndroidRuntime(564): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 07-05 19:57:58.694: E/AndroidRuntime(564): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 07-05 19:57:58.694: E/AndroidRuntime(564): at dalvik.system.NativeStart.main(Native Method) 07-05 19:57:58.694: E/AndroidRuntime(564): Caused by: java.lang.RuntimeException: Binary XML file line #14: You must supply a layout_width attribute. 07-05 19:57:58.694: E/AndroidRuntime(564): at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5318) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:5439) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.widget.LinearLayout$LayoutParams.<init>(LinearLayout.java:1776) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1700) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:56) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.LayoutInflater.rInflate(LayoutInflater.java:741) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.LayoutInflater.inflate(LayoutInflater.java:489) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 07-05 19:57:58.694: E/AndroidRuntime(564): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.Activity.setContentView(Activity.java:1835) 07-05 19:57:58.694: E/AndroidRuntime(564): at intentsPackage.button.IntentsActivity.onCreate(IntentsActivity.java:23) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.Activity.performCreate(Activity.java:4465) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 07-05 19:57:58.694: E/AndroidRuntime(564): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920) 07-05 19:57:58.694: E/AndroidRuntime(564): ... 11 more can you suggest me the the thing i am doing wrong. Thanks
0
11,350,864
07/05/2012 19:03:21
1,504,867
07/05/2012 18:24:46
1
0
My graph contraction algorithm in Python behaves strangely
I've written some code for this problem, but hole block of the code doesn't work at all. Tried everything, now desperate. (python27) Graph is represented as dictionary with frozenset keys and sets of frozensets: graph = {frozenset([node1]): set([frozenset([node2]), frozenset([node3]) ...])} def kargerMinCut(graph): if len(graph) == 2: return graph u = random.choice(graph.keys()) # u and v are frozensets, idea is that they form v = random.choice(list(graph[u])) # a clique in a single frozenset for node in graph: if node is not u and node is not v: links = graph[node] # this for-loop doesn't work! links.discard(u) # i've tried every single option. no changes happen links.discard(v) # to the set of links after the loop links.add(frozenset(tuple(u | v))) if u in links or v in links else None graph[node] = links graph[u | v] = graph[u] | graph[v] del graph[u], graph[v] return kargerMinCut(graph)
python
algorithm
graph
null
null
null
open
My graph contraction algorithm in Python behaves strangely === I've written some code for this problem, but hole block of the code doesn't work at all. Tried everything, now desperate. (python27) Graph is represented as dictionary with frozenset keys and sets of frozensets: graph = {frozenset([node1]): set([frozenset([node2]), frozenset([node3]) ...])} def kargerMinCut(graph): if len(graph) == 2: return graph u = random.choice(graph.keys()) # u and v are frozensets, idea is that they form v = random.choice(list(graph[u])) # a clique in a single frozenset for node in graph: if node is not u and node is not v: links = graph[node] # this for-loop doesn't work! links.discard(u) # i've tried every single option. no changes happen links.discard(v) # to the set of links after the loop links.add(frozenset(tuple(u | v))) if u in links or v in links else None graph[node] = links graph[u | v] = graph[u] | graph[v] del graph[u], graph[v] return kargerMinCut(graph)
0
11,350,868
07/05/2012 19:03:41
919,705
08/30/2011 12:36:41
115
2
Separate nameserver for certain hostnames
On my home LAN I have a number of computers. They are connected to a router which connects me to the internet and acts as DHCP server and nameserver on the LAN. Some of my computers are Ubuntu machines, and I'm trying to set up a good /etc/resolv.conf on them. The problem is that my router is *really* lousy as a nameserver (very, very slow), so I prefer to use an external name server such as Google's nameserver or OpenDNS. But these public nameservers obviously do not know the IP addresses of my local machines. So here's my question: Is there any way to configure /etc/resolv.conf so that certain hostnames are resolved by one nameserver and other hostnames are resolved by another nameserver? (My guess is no, and in that case I'll have to set up fixed IP addresses. But I hope to avoid that.)
ubuntu
dns
nameserver
null
null
null
open
Separate nameserver for certain hostnames === On my home LAN I have a number of computers. They are connected to a router which connects me to the internet and acts as DHCP server and nameserver on the LAN. Some of my computers are Ubuntu machines, and I'm trying to set up a good /etc/resolv.conf on them. The problem is that my router is *really* lousy as a nameserver (very, very slow), so I prefer to use an external name server such as Google's nameserver or OpenDNS. But these public nameservers obviously do not know the IP addresses of my local machines. So here's my question: Is there any way to configure /etc/resolv.conf so that certain hostnames are resolved by one nameserver and other hostnames are resolved by another nameserver? (My guess is no, and in that case I'll have to set up fixed IP addresses. But I hope to avoid that.)
0
11,350,869
07/05/2012 19:03:46
1,267,180
05/04/2010 15:21:03
94
0
FieldDefs reporting false count using Delphi 20120 and SQL Server 2005/2008
using Delphi 2010, Unidac components, and SQl Server 2005 & 2008 When I perform a standard select from my query....and look at the fieldDefs count, it is always adding the count of the Primary index field (ID) whether or not i select for it in my select statement or not. procedure Tmainform.Test1Click(Sender: TObject); var AQuery: TXQuery; begin XQuery:= TXQuery.create(nil); XQuery.connection:= gm_vcontrol; //XQuery.SQL.Text:= 'Select masterid from cdmed'; //count= 2 //XQuery.SQL.Text:= 'XQuery.SQL.Text:= 'Select Id, masterid, cdstatus, cdpaydate from cdmed';//count = 4 XQuery.SQL.Text:= 'Select masterid, cdstatus, cdpaydate from cdmed'; //count = 4 try XQuery.Open; ShowMessage(inttostr(XQuery.FieldDefs.Count)); Except on E: Exception do begin // end; end; XQuery.Free; end; No matter how many fields i add to my select statement, it seems the ID field always gets pulled in my FieldDefs count This does not happen if i use Interbase (or Firebird). ID is an integer, the primary Key, and is not null thanks
sql-server
delphi
delphi-2010
unidac
null
null
open
FieldDefs reporting false count using Delphi 20120 and SQL Server 2005/2008 === using Delphi 2010, Unidac components, and SQl Server 2005 & 2008 When I perform a standard select from my query....and look at the fieldDefs count, it is always adding the count of the Primary index field (ID) whether or not i select for it in my select statement or not. procedure Tmainform.Test1Click(Sender: TObject); var AQuery: TXQuery; begin XQuery:= TXQuery.create(nil); XQuery.connection:= gm_vcontrol; //XQuery.SQL.Text:= 'Select masterid from cdmed'; //count= 2 //XQuery.SQL.Text:= 'XQuery.SQL.Text:= 'Select Id, masterid, cdstatus, cdpaydate from cdmed';//count = 4 XQuery.SQL.Text:= 'Select masterid, cdstatus, cdpaydate from cdmed'; //count = 4 try XQuery.Open; ShowMessage(inttostr(XQuery.FieldDefs.Count)); Except on E: Exception do begin // end; end; XQuery.Free; end; No matter how many fields i add to my select statement, it seems the ID field always gets pulled in my FieldDefs count This does not happen if i use Interbase (or Firebird). ID is an integer, the primary Key, and is not null thanks
0
11,350,870
07/05/2012 19:03:49
1,064,391
11/24/2011 17:06:34
1
2
Video Streaming API and Hosting for Android and iOS
I have a client that wants to sell training videos. The primary Use case is one user watching the first 2 videos for free and then start paying for the 3rd and on. No subscription model, you pick a video, pay for it and it is yours! Ideally we would like to let the user download the video so he could watch it offline.(no worries about piracy, we will take care of that on the client app.). What, in your opinion, are the best options in terms of hosting and client API to stream video on both platforms, Android and iOS? Leo
android
ios
video-streaming
null
null
null
open
Video Streaming API and Hosting for Android and iOS === I have a client that wants to sell training videos. The primary Use case is one user watching the first 2 videos for free and then start paying for the 3rd and on. No subscription model, you pick a video, pay for it and it is yours! Ideally we would like to let the user download the video so he could watch it offline.(no worries about piracy, we will take care of that on the client app.). What, in your opinion, are the best options in terms of hosting and client API to stream video on both platforms, Android and iOS? Leo
0
11,350,871
07/05/2012 19:03:49
1,308,844
04/02/2012 19:15:51
7
0
Spring: How to return a httpinvoker-proxy class by a httpinvokerservice
I have a small application server (tomcat) with spring and a HttpInvokationServiceExporter. This classes are on Server: public interface IAccount{ public IUser getUser(); } public class Account implements IAccount{ private IUser user; public Account(IUser user){ this.user = user } @Override public IUser getUser(){return this.user} } public interface IUser{ public String getName(); } public class User implements IUser(){ private String name; public User(String name){ this.name = name; } @Override public String getName(){ return this.name) } } My HttpInvokerService Exporter exports an instance of the Account-class to the clients with IAccount as the service-interface, so far so good. If I now try to invoke the method getUser() at client-side the client tries to deserialize the returned object to a User-Object and throws an exception because it does not know the class User. But I want it to be like a proxy you get from the HttpInvokerServiceExporter in order to invoke the methods from the User-class on the server with IUser as a service-interface instead of deserialzing the result to the User-class. The client should only know the interfaces and and no implementations of these. I hope you can understand my problem, if you need to see my applicationContext.xml on server- and client-side or web.xml feel free to ask for it:) P.s.: Also feel free to edit the title because I hardly could describe my problem in a few words
spring
proxy-classes
httpinvoker
null
null
null
open
Spring: How to return a httpinvoker-proxy class by a httpinvokerservice === I have a small application server (tomcat) with spring and a HttpInvokationServiceExporter. This classes are on Server: public interface IAccount{ public IUser getUser(); } public class Account implements IAccount{ private IUser user; public Account(IUser user){ this.user = user } @Override public IUser getUser(){return this.user} } public interface IUser{ public String getName(); } public class User implements IUser(){ private String name; public User(String name){ this.name = name; } @Override public String getName(){ return this.name) } } My HttpInvokerService Exporter exports an instance of the Account-class to the clients with IAccount as the service-interface, so far so good. If I now try to invoke the method getUser() at client-side the client tries to deserialize the returned object to a User-Object and throws an exception because it does not know the class User. But I want it to be like a proxy you get from the HttpInvokerServiceExporter in order to invoke the methods from the User-class on the server with IUser as a service-interface instead of deserialzing the result to the User-class. The client should only know the interfaces and and no implementations of these. I hope you can understand my problem, if you need to see my applicationContext.xml on server- and client-side or web.xml feel free to ask for it:) P.s.: Also feel free to edit the title because I hardly could describe my problem in a few words
0