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,472,795 | 07/13/2012 14:44:21 | 190,758 | 10/15/2009 16:49:25 | 199 | 6 | modify per-application access control for private key via command line? | I have a cert in a key chain that contains a private key. I'd like to add an application to the access control "white list" for that key. I know how to do this using the graphical key chain tool, but I'd like to do it via the command line as part of an Xcode build script.
From what I can tell the "security" command is the way to manipulate key chains at the command line, but I can't figure out from the man page how I'd go about accomplishing this task.
For completeness, here's exactly what I do in the key chain tool that I'd like to do via the command line:
1. Click the cert to show its private key.
2. Right-click the private key and select the "Get Info" menu item.
3. Click the "Access Control" tab.
4. Click the "+" button to add an application to the white list.
5. Select the application (in my case Xcode) and click "Add".
I might also be interested in how to allow access to all applications. | xcode | osx | security | command-line | keychain | null | open | modify per-application access control for private key via command line?
===
I have a cert in a key chain that contains a private key. I'd like to add an application to the access control "white list" for that key. I know how to do this using the graphical key chain tool, but I'd like to do it via the command line as part of an Xcode build script.
From what I can tell the "security" command is the way to manipulate key chains at the command line, but I can't figure out from the man page how I'd go about accomplishing this task.
For completeness, here's exactly what I do in the key chain tool that I'd like to do via the command line:
1. Click the cert to show its private key.
2. Right-click the private key and select the "Get Info" menu item.
3. Click the "Access Control" tab.
4. Click the "+" button to add an application to the white list.
5. Select the application (in my case Xcode) and click "Add".
I might also be interested in how to allow access to all applications. | 0 |
11,472,800 | 07/13/2012 14:44:36 | 127,826 | 05/25/2009 07:47:19 | 1,307 | 28 | Nested RowDetailsTemplate fails if button has event assigned | I have a tree-like object structure three levels deep and have tried to represent that in a DataGrid.
I'll show the XAML below, but there is basically a top-level DataGrid, with a DataGridTemplateColumn that contains a ToggleButton. If you click the button it shows the second DataGrid, which has an identical setup. That should allow you to click the ToggleButton in the second grid and show the third (and final) DataGrid.
This is the expected result:
![enter image description here][1]
[1]: http://i.stack.imgur.com/pfhLa.png
So you'd click "Destinations..." to show the Destination grid and then click "Expressions..." to show that detail.
Both buttons are implemented with identical code:
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ToggleButton Content="Destinations..." ButtonBase.Click="ToggleButton_Click" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
If both buttons have their Click handlers assigned (same handler, or different), I get a NullReferenceException when I click "Destinations..." (before the destinations grid even displays).
But if I take out the handler for the "Expressions..." button, everything shows just dandy, but of course you cannot expand the inner grid.
The problem is not with my objects, because if I just leave the grid's RowDetailsVisibilityMode="Visible" data from all three levels reflect in the grid. The problem seems to be isolated to the use of the ButtonBase.Click event on the inner grid.
Here's the XAML:
<Window x:Class="SPConvert.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Stored Procedure Converter" Height="425" Width="705">
<Grid>
<DataGrid Name="conversionsGrid" RowDetailsVisibilityMode="Collapsed" CanUserAddRows="False">
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ToggleButton Content="Destinations..." ButtonBase.Click="ToggleButton_Click" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<StackPanel DockPanel.Dock="Left">
<Label Content="Add destination paths" />
<DataGrid ItemsSource="{Binding Destinations}" RowDetailsVisibilityMode="Visible">
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ToggleButton Content="Expressions..." ButtonBase.Click="ToggleButton_Click" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<DataGrid ItemsSource="{Binding Expressions}" AutoGenerateColumns="True">
</DataGrid>
</DataTemplate>
</DataGrid.RowDetailsTemplate>
</DataGrid>
</StackPanel>
</DataTemplate>
</DataGrid.RowDetailsTemplate>
</DataGrid>
</Grid>
</Window>
| c# | wpf | datagrid | togglebutton | null | null | open | Nested RowDetailsTemplate fails if button has event assigned
===
I have a tree-like object structure three levels deep and have tried to represent that in a DataGrid.
I'll show the XAML below, but there is basically a top-level DataGrid, with a DataGridTemplateColumn that contains a ToggleButton. If you click the button it shows the second DataGrid, which has an identical setup. That should allow you to click the ToggleButton in the second grid and show the third (and final) DataGrid.
This is the expected result:
![enter image description here][1]
[1]: http://i.stack.imgur.com/pfhLa.png
So you'd click "Destinations..." to show the Destination grid and then click "Expressions..." to show that detail.
Both buttons are implemented with identical code:
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ToggleButton Content="Destinations..." ButtonBase.Click="ToggleButton_Click" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
If both buttons have their Click handlers assigned (same handler, or different), I get a NullReferenceException when I click "Destinations..." (before the destinations grid even displays).
But if I take out the handler for the "Expressions..." button, everything shows just dandy, but of course you cannot expand the inner grid.
The problem is not with my objects, because if I just leave the grid's RowDetailsVisibilityMode="Visible" data from all three levels reflect in the grid. The problem seems to be isolated to the use of the ButtonBase.Click event on the inner grid.
Here's the XAML:
<Window x:Class="SPConvert.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Stored Procedure Converter" Height="425" Width="705">
<Grid>
<DataGrid Name="conversionsGrid" RowDetailsVisibilityMode="Collapsed" CanUserAddRows="False">
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ToggleButton Content="Destinations..." ButtonBase.Click="ToggleButton_Click" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<StackPanel DockPanel.Dock="Left">
<Label Content="Add destination paths" />
<DataGrid ItemsSource="{Binding Destinations}" RowDetailsVisibilityMode="Visible">
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ToggleButton Content="Expressions..." ButtonBase.Click="ToggleButton_Click" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
<DataGrid.RowDetailsTemplate>
<DataTemplate>
<DataGrid ItemsSource="{Binding Expressions}" AutoGenerateColumns="True">
</DataGrid>
</DataTemplate>
</DataGrid.RowDetailsTemplate>
</DataGrid>
</StackPanel>
</DataTemplate>
</DataGrid.RowDetailsTemplate>
</DataGrid>
</Grid>
</Window>
| 0 |
11,472,801 | 07/13/2012 14:44:44 | 1,509,444 | 07/08/2012 01:01:10 | 43 | 11 | CSS spacing using the :before pseudo attribute | I have an image that I'm trying to place using :before. I want the image to sit on the first letter of the line. If you look at the live site, The bird's feet should touch the letter "C".
It works in the fiddle, but not on the live site. Any help?
http://imip.rvadv.com/index3.html
fiddle: http://jsfiddle.net/imakeitpretty/yV3kK/30/
| css | null | null | null | null | null | open | CSS spacing using the :before pseudo attribute
===
I have an image that I'm trying to place using :before. I want the image to sit on the first letter of the line. If you look at the live site, The bird's feet should touch the letter "C".
It works in the fiddle, but not on the live site. Any help?
http://imip.rvadv.com/index3.html
fiddle: http://jsfiddle.net/imakeitpretty/yV3kK/30/
| 0 |
11,472,803 | 07/13/2012 14:44:55 | 1,491,987 | 06/29/2012 19:11:55 | 13 | 0 | update child view textview in storyboard | I'm working on an app using storyboard and Navigation controller is embedded in. In the child view, when a button is pressed, it calls a function in parent view controller without changing the view.
[self.delegate buttonPressed];
and the method supposed to update the text of textview in child view.
childviewcontroller.textViewName.text=@"something";
But the textview is not being updated.
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
[[segue destinationViewController] setDelegate:self];
}
Can anyone give me some ideas?
I don't know if I explain it clearly or not. I'm still kinda new to this and am learning while making this app. Thank you in advance.
| ios | storyboard | null | null | null | null | open | update child view textview in storyboard
===
I'm working on an app using storyboard and Navigation controller is embedded in. In the child view, when a button is pressed, it calls a function in parent view controller without changing the view.
[self.delegate buttonPressed];
and the method supposed to update the text of textview in child view.
childviewcontroller.textViewName.text=@"something";
But the textview is not being updated.
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
[[segue destinationViewController] setDelegate:self];
}
Can anyone give me some ideas?
I don't know if I explain it clearly or not. I'm still kinda new to this and am learning while making this app. Thank you in advance.
| 0 |
11,472,804 | 07/13/2012 14:44:59 | 896,062 | 08/16/2011 05:58:49 | 31 | 1 | Error Running Windows Filtering Platform Sample | I am trying to test WFP(Windows Filtering Platform) sample provided by microsoft. While testing I got error.
While building it builds well: With following message:
> Build started: Project: package (Package\package), Configuration: Win8 Debug Win32 ------
> Inf2Cat task was skipped as there were no inf files to process
>
>========== Build: 1 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========
And While running the exe file I got an error. as:
> "Cannot Verify Digital signature of the file.......".
how to resolve this.
Code From: [msdn](http://code.msdn.microsoft.com/windowshardware/Windows-Filtering-Platform-27553baa#content)
I am using Windows 8 Release Preview machine with Visual studio 2012. | c++ | windows | visual-studio | wfp | null | null | open | Error Running Windows Filtering Platform Sample
===
I am trying to test WFP(Windows Filtering Platform) sample provided by microsoft. While testing I got error.
While building it builds well: With following message:
> Build started: Project: package (Package\package), Configuration: Win8 Debug Win32 ------
> Inf2Cat task was skipped as there were no inf files to process
>
>========== Build: 1 succeeded, 0 failed, 5 up-to-date, 0 skipped ==========
And While running the exe file I got an error. as:
> "Cannot Verify Digital signature of the file.......".
how to resolve this.
Code From: [msdn](http://code.msdn.microsoft.com/windowshardware/Windows-Filtering-Platform-27553baa#content)
I am using Windows 8 Release Preview machine with Visual studio 2012. | 0 |
11,472,805 | 07/13/2012 14:45:01 | 1,494,432 | 07/01/2012 15:39:27 | 10 | 1 | I think its a memory management error Cocos2d | So I have it set up so when the characters health is < 100 (for testing purposes) it stop the scene and goes to the game over scene. `if (playerDataManager.playerHealth < 100) {
[[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:3 scene: [GameLogic scene]]];
}`However when the players health drops below 100 it goes to the new scene but the FPS drops dramatically from 60 to 5 I get a list of `OpenGL error 0x0503 in -[EAGLView swapBuffers]` then it stays frozen like that for about 40 seconds then the FPS unfreeze and goes back out to 60 and I get a list of `2012-07-13 10:37:50.234 Tilegame[93513:10a03] cocos2d: removeChildByTag: child not found!` Then I can continue with the app like normal, going back to the main menu, starting a new game, then recreate the error. I'm extremely new to cocos2d and programming in general and I'm sure theres something fundamental that I'm doing wrong. Please Help me. | opengl | memory-management | cocos2d-iphone | removechild | null | null | open | I think its a memory management error Cocos2d
===
So I have it set up so when the characters health is < 100 (for testing purposes) it stop the scene and goes to the game over scene. `if (playerDataManager.playerHealth < 100) {
[[CCDirector sharedDirector] replaceScene:[CCTransitionFade transitionWithDuration:3 scene: [GameLogic scene]]];
}`However when the players health drops below 100 it goes to the new scene but the FPS drops dramatically from 60 to 5 I get a list of `OpenGL error 0x0503 in -[EAGLView swapBuffers]` then it stays frozen like that for about 40 seconds then the FPS unfreeze and goes back out to 60 and I get a list of `2012-07-13 10:37:50.234 Tilegame[93513:10a03] cocos2d: removeChildByTag: child not found!` Then I can continue with the app like normal, going back to the main menu, starting a new game, then recreate the error. I'm extremely new to cocos2d and programming in general and I'm sure theres something fundamental that I'm doing wrong. Please Help me. | 0 |
11,472,807 | 07/13/2012 14:45:02 | 1,523,864 | 07/13/2012 14:39:01 | 1 | 0 | Searching through Database - in asp c# Visual Web Developer Express | I would like to search for a specific number via user input... this si not working at the moment, however even when i hardcode a number it still does not reteive anything. I am not sure what i am doing wrong. Please assist me, it is rather urgent.
Tahnk you you, the files are below.
cs file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;
using System.Data.SqlClient;
namespace SearchC
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void SearchClick(object sender, EventArgs e)
{
string searchPAS = txtSearch.Text;
using (var sqlconnection = new SqlConnection(Search)
{
string strQuery = "Select PAS_NO from P_DETAILS where PAS_NO = searchPAS";
SqlCommand command = new SqlCommand(strQuery, sqlconnection) { CommandType = CommandType.Text };
var ptnt = command.ExecuteScalar();
txtPAS.Text = ptnt.ToString();
}
}
}
}
Web config file
<configuration>
<connectionStrings>
<add name="Search" connectionString="Data Source=dwh;User ID=***;Password=***;Unicode=True"
providerName="System.Data.OracleClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
aspx file
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="SearchC._Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<table>
<tr>
<td>
PAS NUmber
</td>
<td>
<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
</td>
</tr>
<tr >
<td >
<asp:Button runat="server" ID="btnSearch" OnClick="SearchClick" Text="Search"/>
</td>
</tr>
<tr >
<td >
<asp:TextBox ID="txtPAS" runat="server"></asp:TextBox>
</td>
</tr>
</table>
</asp:Content>
This is what i have now... am unsure why it is not working, it just flashes when i press the button and nothing else happens
| c# | database | search | asp-classic | web | null | open | Searching through Database - in asp c# Visual Web Developer Express
===
I would like to search for a specific number via user input... this si not working at the moment, however even when i hardcode a number it still does not reteive anything. I am not sure what i am doing wrong. Please assist me, it is rather urgent.
Tahnk you you, the files are below.
cs file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OleDb;
using System.Data.SqlClient;
namespace SearchC
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void SearchClick(object sender, EventArgs e)
{
string searchPAS = txtSearch.Text;
using (var sqlconnection = new SqlConnection(Search)
{
string strQuery = "Select PAS_NO from P_DETAILS where PAS_NO = searchPAS";
SqlCommand command = new SqlCommand(strQuery, sqlconnection) { CommandType = CommandType.Text };
var ptnt = command.ExecuteScalar();
txtPAS.Text = ptnt.ToString();
}
}
}
}
Web config file
<configuration>
<connectionStrings>
<add name="Search" connectionString="Data Source=dwh;User ID=***;Password=***;Unicode=True"
providerName="System.Data.OracleClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
aspx file
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="SearchC._Default" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<table>
<tr>
<td>
PAS NUmber
</td>
<td>
<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
</td>
</tr>
<tr >
<td >
<asp:Button runat="server" ID="btnSearch" OnClick="SearchClick" Text="Search"/>
</td>
</tr>
<tr >
<td >
<asp:TextBox ID="txtPAS" runat="server"></asp:TextBox>
</td>
</tr>
</table>
</asp:Content>
This is what i have now... am unsure why it is not working, it just flashes when i press the button and nothing else happens
| 0 |
11,472,811 | 07/13/2012 14:45:16 | 1,010,730 | 10/24/2011 11:16:40 | 116 | 0 | How to work around Response / Server which does not exist in the context? | I have this C# ASP.NET 4 website.
I would like to have a general method in a class which will include a Response.Redirect or Server.Transfer in it to a specific page.
Both names, Response and Server, does not exist in the context.
How to work this around?
| c# | asp.net | null | null | null | null | open | How to work around Response / Server which does not exist in the context?
===
I have this C# ASP.NET 4 website.
I would like to have a general method in a class which will include a Response.Redirect or Server.Transfer in it to a specific page.
Both names, Response and Server, does not exist in the context.
How to work this around?
| 0 |
11,472,812 | 07/13/2012 14:45:23 | 804,319 | 06/18/2011 07:43:05 | 45 | 2 | Extracting whole page as image iTextPdf | Is it possible to extract pages from an existing pdf file and save the whole page as an image through iTextPDF library.
for example if my pdf file contains 2 pages then 2 images will be generated and each image will be a snapshot of a particular page.
| java | pdf | itextsharp | itext | null | null | open | Extracting whole page as image iTextPdf
===
Is it possible to extract pages from an existing pdf file and save the whole page as an image through iTextPDF library.
for example if my pdf file contains 2 pages then 2 images will be generated and each image will be a snapshot of a particular page.
| 0 |
11,472,813 | 07/13/2012 14:45:27 | 1,522,505 | 07/13/2012 03:42:17 | 1 | 0 | Phonegap with jquery and jquerymobile for BB | I am developing for BlackBerry webworks, PhoneGap 1.9., Jquery and jquery mobile.
The example provided by PhoneGap works fine on the simulator until it includes jQuery library, where the application stops responding.
Add code to understand the situation. Someone could use the same technologies?
1)
<!DOCTYPE HTML>
<html>
<head>
<title>Prueba</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" />
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/cordova-1.9.0.js"></script>
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.1.0.min.js"></script>
</head>
<body>
<h3>Hello!</h3>
</body>
</html>
=> Result: crash
2) Using the jQuery version 1.6.4 for this post (http://bugs.jquery.com/ticket/10608)
<!DOCTYPE HTML>
<html>
<head>
<title>Prueba</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" />
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/cordova-1.9.0.js"></script>
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.1.0.min.js"></script>
</head>
<body>
<h3>Hello!</h3>
</body>
</html>
=> Result: crash
3) Without jquery mobile
<!DOCTYPE HTML>
<html>
<head>
<title>Prueba</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" />
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/cordova-1.9.0.js"></script>
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
</head>
<body>
<h3>Hello!</h3>
</body>
</html>
=> Result: crash
4) Without jquery mobile
<!DOCTYPE HTML>
<html>
<head>
<title>Prueba</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" />
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/cordova-1.9.0.js"></script>
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
</head>
<body>
<h3>Hello!</h3>
</body>
</html>
=> Result: works!
But I need jquery mobile. Thanks for your help. | jquery | html5 | jquery-mobile | blackberry-webworks | null | null | open | Phonegap with jquery and jquerymobile for BB
===
I am developing for BlackBerry webworks, PhoneGap 1.9., Jquery and jquery mobile.
The example provided by PhoneGap works fine on the simulator until it includes jQuery library, where the application stops responding.
Add code to understand the situation. Someone could use the same technologies?
1)
<!DOCTYPE HTML>
<html>
<head>
<title>Prueba</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" />
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/cordova-1.9.0.js"></script>
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.1.0.min.js"></script>
</head>
<body>
<h3>Hello!</h3>
</body>
</html>
=> Result: crash
2) Using the jQuery version 1.6.4 for this post (http://bugs.jquery.com/ticket/10608)
<!DOCTYPE HTML>
<html>
<head>
<title>Prueba</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" />
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/cordova-1.9.0.js"></script>
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.1.0.min.js"></script>
</head>
<body>
<h3>Hello!</h3>
</body>
</html>
=> Result: crash
3) Without jquery mobile
<!DOCTYPE HTML>
<html>
<head>
<title>Prueba</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" />
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/cordova-1.9.0.js"></script>
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
</head>
<body>
<h3>Hello!</h3>
</body>
</html>
=> Result: crash
4) Without jquery mobile
<!DOCTYPE HTML>
<html>
<head>
<title>Prueba</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/jquery.mobile.structure-1.1.0.min.css" />
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="js/cordova-1.9.0.js"></script>
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
</head>
<body>
<h3>Hello!</h3>
</body>
</html>
=> Result: works!
But I need jquery mobile. Thanks for your help. | 0 |
11,472,815 | 07/13/2012 14:45:34 | 1,070,338 | 11/28/2011 23:30:15 | 187 | 4 | How do I ignore an slash at the front? | How do I ignore forward slash and space at the start of the line in regular expressions?
In the Example below, I need to ignore the forward slash and space because I am using grep
and awk
The actual command gives me
cmd
size=5.0G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 3:0:0:3 sdh 8:112 active ready running #Line 3
`-+- policy='round-robin 0' prio=1 status=enabled
`- 4:0:0:3 sdl 8:176 active ready running #Line 5
By doing this,
cmd | grep -E '[0-9]+:[0-9]+:[0-9]+:[0-9]+' | awk '{print $3}'
I was able to get the sdh, sdl. But the problem is, I need to ignore the '|' upfront, to make the Line 3 and Line 5 same. Please advise.
| regex | bash | shell | awk | grep | null | open | How do I ignore an slash at the front?
===
How do I ignore forward slash and space at the start of the line in regular expressions?
In the Example below, I need to ignore the forward slash and space because I am using grep
and awk
The actual command gives me
cmd
size=5.0G features='0' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| `- 3:0:0:3 sdh 8:112 active ready running #Line 3
`-+- policy='round-robin 0' prio=1 status=enabled
`- 4:0:0:3 sdl 8:176 active ready running #Line 5
By doing this,
cmd | grep -E '[0-9]+:[0-9]+:[0-9]+:[0-9]+' | awk '{print $3}'
I was able to get the sdh, sdl. But the problem is, I need to ignore the '|' upfront, to make the Line 3 and Line 5 same. Please advise.
| 0 |
11,472,816 | 07/13/2012 14:45:37 | 1,216,976 | 02/17/2012 19:14:07 | 1,423 | 59 | SVG-specific CSS not loading in Firefox | I'm using the following CSS in my SVG:
line{
stroke-linecap:round;
stroke-width:4;
stroke:url(#disabled);
fill:url(#disabled);
}
In Chrome and IE, this works fine. However, Firefox won't accept the `stroke:url(#disabled);` and `fill:url(#disabled);`. So those elements are black. I think that the `#` could be causing it (FF has had [issues with this in the past)][1]. What can I do to fix this? I've tried escaping the `#` as well as replacing it with `#`.
[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=658949 | css | firefox | svg | null | null | null | open | SVG-specific CSS not loading in Firefox
===
I'm using the following CSS in my SVG:
line{
stroke-linecap:round;
stroke-width:4;
stroke:url(#disabled);
fill:url(#disabled);
}
In Chrome and IE, this works fine. However, Firefox won't accept the `stroke:url(#disabled);` and `fill:url(#disabled);`. So those elements are black. I think that the `#` could be causing it (FF has had [issues with this in the past)][1]. What can I do to fix this? I've tried escaping the `#` as well as replacing it with `#`.
[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=658949 | 0 |
11,472,798 | 07/13/2012 14:44:30 | 1,210,977 | 02/15/2012 09:56:23 | 42 | 2 | ICollectionView cancel currentchanging | I am looking for a way to cancel the CurrentChanging event depending on the item that was clicked.
In my application I use ICollectionView to hold my list of viewmodels which are rendered as tabitems in a tabcontrol.
For a specific viewmodel I need to do some property checking before the viewmodel can be activated. In order to do that I need to now that the specific viewmodel is going to be the next current item. Depending on the results of the property checking, the change of the current item should be allowed or canceled (only for the specific viewmodel).
I don't want to do the property checking for all the other viewmodels.
Is there a way to have access to the next current item before it is set? | wpf | icollectionview | currentitem | null | null | null | open | ICollectionView cancel currentchanging
===
I am looking for a way to cancel the CurrentChanging event depending on the item that was clicked.
In my application I use ICollectionView to hold my list of viewmodels which are rendered as tabitems in a tabcontrol.
For a specific viewmodel I need to do some property checking before the viewmodel can be activated. In order to do that I need to now that the specific viewmodel is going to be the next current item. Depending on the results of the property checking, the change of the current item should be allowed or canceled (only for the specific viewmodel).
I don't want to do the property checking for all the other viewmodels.
Is there a way to have access to the next current item before it is set? | 0 |
11,568,028 | 07/19/2012 19:36:08 | 1,534,932 | 07/18/2012 13:32:36 | 1 | 0 | display message javascript while a calculation is being made | I have been looking around and I cannot seem to figure out how to do this, although it seems like it would be very simple.(mobile development)
What I am trying to do is display a message (kind of like an alert, but not an alert, more like a dialog) while a calculation is being made. Simply like a Loading please wait. I want the message to appear and stay there while the calculation is being done and then be removed. I just cannot seem to find a proper way of doing this.
The submit button is pressed and first checks to make sure all the forms are filled out then it should show the message, it does the calculation, then hides the message.
Here is the Calculation function.
function scpdResults(form) {
//call all of the "choice" functions here
//otherwise, when the page is refreshed, the pulldown might not match the variable
//this shouldn't be a problem, but this is the defensive way to code it
choiceVoltage(form);
choiceMotorRatingVal(form);
getMotorRatingType();
getProduct();
getConnection();
getDisconnect();
getDisclaimer();
getMotorType();
//restore these fields to their default values every time submit is clicked
//this puts the results table into a known state
//it is also used in error checking in the populateResults function
document.getElementById('results').innerHTML = "Results:";
document.getElementById('fuse_cb_sel').innerHTML = "Fuse/CB 1:";
document.getElementById('fuse_cb_sel_2').innerHTML = "Fuse/CB 2:";
document.getElementById('fuse_cb_result').innerHTML = "(result1)";
document.getElementById('fuse_cb_res_2').innerHTML = "(result2)";
document.getElementById('sccr_2').innerHTML = "<b>Fault Rating:</b>";
document.getElementById('sccr_result').innerHTML = "(result)";
document.getElementById('sccr_result_2').innerHTML = "(result)";
document.getElementById('contactor_result').innerHTML = "(result)";
document.getElementById('controller_result').innerHTML = "(result)";
//Make sure something has been selected for each variable
if (product === "Choose an Option." || product === "") {
alert("You must select a value for every field. Select a Value for Product");
**************BLAH************
} else {
//valid entries, so jump to results table
document.location.href = '#results_a';
******This is where the message should start being displayed***********
document.getElementById('motor_result').innerHTML = motorRatingVal + " " + motorRatingType;
document.getElementById('voltage_res_2').innerHTML = voltage + " V";
document.getElementById('product_res_2').innerHTML = product;
document.getElementById('connection_res_2').innerHTML = connection;
document.getElementById('disconnect_res_2').innerHTML = disconnect;
if (BLAH) {
}
else {
}
populateResults();
document.getElementById('CalculatedResults').style.display = "block";
} //end massive else statement that ensures all fields have values
*****Close out of the Loading message********
} //scpd results
Thank you all for your time, it is greatly appreciated | javascript | jquery | mobile | dialog | null | null | open | display message javascript while a calculation is being made
===
I have been looking around and I cannot seem to figure out how to do this, although it seems like it would be very simple.(mobile development)
What I am trying to do is display a message (kind of like an alert, but not an alert, more like a dialog) while a calculation is being made. Simply like a Loading please wait. I want the message to appear and stay there while the calculation is being done and then be removed. I just cannot seem to find a proper way of doing this.
The submit button is pressed and first checks to make sure all the forms are filled out then it should show the message, it does the calculation, then hides the message.
Here is the Calculation function.
function scpdResults(form) {
//call all of the "choice" functions here
//otherwise, when the page is refreshed, the pulldown might not match the variable
//this shouldn't be a problem, but this is the defensive way to code it
choiceVoltage(form);
choiceMotorRatingVal(form);
getMotorRatingType();
getProduct();
getConnection();
getDisconnect();
getDisclaimer();
getMotorType();
//restore these fields to their default values every time submit is clicked
//this puts the results table into a known state
//it is also used in error checking in the populateResults function
document.getElementById('results').innerHTML = "Results:";
document.getElementById('fuse_cb_sel').innerHTML = "Fuse/CB 1:";
document.getElementById('fuse_cb_sel_2').innerHTML = "Fuse/CB 2:";
document.getElementById('fuse_cb_result').innerHTML = "(result1)";
document.getElementById('fuse_cb_res_2').innerHTML = "(result2)";
document.getElementById('sccr_2').innerHTML = "<b>Fault Rating:</b>";
document.getElementById('sccr_result').innerHTML = "(result)";
document.getElementById('sccr_result_2').innerHTML = "(result)";
document.getElementById('contactor_result').innerHTML = "(result)";
document.getElementById('controller_result').innerHTML = "(result)";
//Make sure something has been selected for each variable
if (product === "Choose an Option." || product === "") {
alert("You must select a value for every field. Select a Value for Product");
**************BLAH************
} else {
//valid entries, so jump to results table
document.location.href = '#results_a';
******This is where the message should start being displayed***********
document.getElementById('motor_result').innerHTML = motorRatingVal + " " + motorRatingType;
document.getElementById('voltage_res_2').innerHTML = voltage + " V";
document.getElementById('product_res_2').innerHTML = product;
document.getElementById('connection_res_2').innerHTML = connection;
document.getElementById('disconnect_res_2').innerHTML = disconnect;
if (BLAH) {
}
else {
}
populateResults();
document.getElementById('CalculatedResults').style.display = "block";
} //end massive else statement that ensures all fields have values
*****Close out of the Loading message********
} //scpd results
Thank you all for your time, it is greatly appreciated | 0 |
11,568,029 | 07/19/2012 19:36:09 | 418,859 | 08/12/2010 19:53:46 | 1,699 | 145 | Horizontal Menu Slide Out ScrollTo Not Being called | So I'm trying my crack at the infamous slide out menu, like in G+ and Youtube.
In this cause I'm setting an ActionBar UP button that I want to use to open the Side Menu.
I have most everything laid out correctly, but my HorizontalScrollView is not sliding when I ask.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<include
android:layout_width="wrap_content"
layout="@layout/side_menu" />
<HorizontalScrollView
android:id="@+id/menu_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="horizontal" >
<include
layout="@layout/main_content" />
</HorizontalScrollView>
</FrameLayout>
private void toggleSideMenu() {
mMenuScrollView.postDelayed(new Runnable() {
@Override
public void run() {
int menuWidth = mSideMenu.getMeasuredWidth();
if (!mIsMenuVisible) {
// Scroll to 0 to reveal menu
int left = 0;
mScrollView.smoothScrollTo(left, 0);
} else {
// Scroll to menuWidth so menu isn't on screen.
int left = menuWidth;
mScrollView.smoothScrollTo(left, 0);
}
mIsMenuVisible = !mIsMenuVisible;
}
}, 50);
}
My call to smoothScroll doesn't seem to be working.
| android | android-actionbar | android-scrollview | android-sliding | null | null | open | Horizontal Menu Slide Out ScrollTo Not Being called
===
So I'm trying my crack at the infamous slide out menu, like in G+ and Youtube.
In this cause I'm setting an ActionBar UP button that I want to use to open the Side Menu.
I have most everything laid out correctly, but my HorizontalScrollView is not sliding when I ask.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<include
android:layout_width="wrap_content"
layout="@layout/side_menu" />
<HorizontalScrollView
android:id="@+id/menu_scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="horizontal" >
<include
layout="@layout/main_content" />
</HorizontalScrollView>
</FrameLayout>
private void toggleSideMenu() {
mMenuScrollView.postDelayed(new Runnable() {
@Override
public void run() {
int menuWidth = mSideMenu.getMeasuredWidth();
if (!mIsMenuVisible) {
// Scroll to 0 to reveal menu
int left = 0;
mScrollView.smoothScrollTo(left, 0);
} else {
// Scroll to menuWidth so menu isn't on screen.
int left = menuWidth;
mScrollView.smoothScrollTo(left, 0);
}
mIsMenuVisible = !mIsMenuVisible;
}
}, 50);
}
My call to smoothScroll doesn't seem to be working.
| 0 |
11,567,586 | 07/19/2012 19:03:18 | 1,223,574 | 02/21/2012 14:26:37 | 6 | 0 | Stopwatch in java | Im trying to make a stopwatch in java, that looks like so 00:00:00, which starts counting once a button is pressed. For some reason it won't work but I'm sure there is something that I am missing.
for (;;)
{
if (pause == false)
{
sec++;
if (sec == 60)
{
sec = 0;
mins++;
}
if (mins == 60)
{
mins = 0;
hrs++;
}
String seconds = Integer.toString(sec);
String minutes = Integer.toString(mins);
String hours = Integer.toString(hrs);
if (sec <= 9)
{
seconds = "0" + Integer.toString(sec);
}
if (mins <= 9)
{
minutes = "0" + Integer.toString(mins);
}
if (hrs <= 9)
{
hours = "0" + Integer.toString(hrs);
}
jLabel3.setText(hours + ":" + minutes + ":" + seconds);
} | java | swing | netbeans | timer | stopwatch | null | open | Stopwatch in java
===
Im trying to make a stopwatch in java, that looks like so 00:00:00, which starts counting once a button is pressed. For some reason it won't work but I'm sure there is something that I am missing.
for (;;)
{
if (pause == false)
{
sec++;
if (sec == 60)
{
sec = 0;
mins++;
}
if (mins == 60)
{
mins = 0;
hrs++;
}
String seconds = Integer.toString(sec);
String minutes = Integer.toString(mins);
String hours = Integer.toString(hrs);
if (sec <= 9)
{
seconds = "0" + Integer.toString(sec);
}
if (mins <= 9)
{
minutes = "0" + Integer.toString(mins);
}
if (hrs <= 9)
{
hours = "0" + Integer.toString(hrs);
}
jLabel3.setText(hours + ":" + minutes + ":" + seconds);
} | 0 |
11,567,740 | 07/19/2012 19:14:22 | 1,538,874 | 07/19/2012 19:04:03 | 1 | 0 | add view to scrollview in android | I have a relative layout inside a scrollview, then i created a new view with this code:
public class DrawView extends View {
Paint paint = new Paint();
public DrawView(Context context) {
super(context);
}
@Override
public void onDraw(Canvas canvas) {
paint.setColor(Color.BLACK);
paint.setStrokeWidth(2);
paint.setStyle(Paint.Style.STROKE);
canvas.drawRect(5, 5, 140, 140, paint);
}
}
Then i try to use layout.addView(DrawView) to add the new view to the relative layout, so it can be scrollable with the rest of the content, but is doesn't work, nothing shows up..
Am i missing something ? | android | view | scrollview | gif | ondraw | null | open | add view to scrollview in android
===
I have a relative layout inside a scrollview, then i created a new view with this code:
public class DrawView extends View {
Paint paint = new Paint();
public DrawView(Context context) {
super(context);
}
@Override
public void onDraw(Canvas canvas) {
paint.setColor(Color.BLACK);
paint.setStrokeWidth(2);
paint.setStyle(Paint.Style.STROKE);
canvas.drawRect(5, 5, 140, 140, paint);
}
}
Then i try to use layout.addView(DrawView) to add the new view to the relative layout, so it can be scrollable with the rest of the content, but is doesn't work, nothing shows up..
Am i missing something ? | 0 |
11,567,741 | 07/19/2012 19:14:29 | 1,531,384 | 07/17/2012 10:00:55 | 1 | 0 | objective-c accessing class variable from button selector | I am initializing UIButton in init method of a class like this:
UIButton* upButton=[[UIButton alloc] initWithFrame:CGRectMake(2*stepX, 13*stepY,2*stepX,stepY)];
[upButton setTitle:@"UP" forState:UIControlStateNormal];
[upButton setBackgroundColor:[UIColor blueColor]];
[upButton addTarget:self action:@selector(pressedUp) forControlEvents:UIControlEventTouchUpInside];
In pressedUp method I need to use variables from that class (NSInteger* and my class hero*).
So I am doing:
hero*h=self.mainHero;
NSInteger*m=self.map;
But later in code I can easily work with hero class (change position etc) but it fails to work with self.map (awful integers in array instead of 0 and 1)... How to fix it?
| objective-c | null | null | null | null | null | open | objective-c accessing class variable from button selector
===
I am initializing UIButton in init method of a class like this:
UIButton* upButton=[[UIButton alloc] initWithFrame:CGRectMake(2*stepX, 13*stepY,2*stepX,stepY)];
[upButton setTitle:@"UP" forState:UIControlStateNormal];
[upButton setBackgroundColor:[UIColor blueColor]];
[upButton addTarget:self action:@selector(pressedUp) forControlEvents:UIControlEventTouchUpInside];
In pressedUp method I need to use variables from that class (NSInteger* and my class hero*).
So I am doing:
hero*h=self.mainHero;
NSInteger*m=self.map;
But later in code I can easily work with hero class (change position etc) but it fails to work with self.map (awful integers in array instead of 0 and 1)... How to fix it?
| 0 |
11,568,036 | 07/19/2012 19:36:47 | 448,715 | 09/15/2010 17:56:20 | 2,456 | 161 | Must Clojure circular data structures involve constructs like ref? | Today I've seen some references to tying the knot and circular data structures. I've been out reading some answers, and the solutions seem to involve using a ref to point back to the head of the list. One particular [SO question][1] showed a Haskell example, but I don't know Haskell well enough to know if the example was using a ref.
Is there a way to make a Clojure data structure circular without using a ref or similar construct?
Thanks.
[1]: http://stackoverflow.com/questions/11567625/tying-the-knot-in-clojure-can-mutation-of-delay-be-avoided-in-my-code | clojure | circular-buffer | null | null | null | null | open | Must Clojure circular data structures involve constructs like ref?
===
Today I've seen some references to tying the knot and circular data structures. I've been out reading some answers, and the solutions seem to involve using a ref to point back to the head of the list. One particular [SO question][1] showed a Haskell example, but I don't know Haskell well enough to know if the example was using a ref.
Is there a way to make a Clojure data structure circular without using a ref or similar construct?
Thanks.
[1]: http://stackoverflow.com/questions/11567625/tying-the-knot-in-clojure-can-mutation-of-delay-be-avoided-in-my-code | 0 |
11,568,041 | 07/19/2012 19:36:58 | 1,485,662 | 06/27/2012 12:39:28 | 27 | 0 | When i try to print out some unicode chars as hex in C, they all have the same value for some reason | So for some reason, all these UNICODE characters appear to have the same value when i print them out in C Does anyone have any idea why?
char input[8] = {'⺖', '⺓', '⺄', '⺑', '⻣', '⺽', '', '⺽'};
for( i = 0; i < 9; i++)
{
printf("Input number equivelents in hex %x, in int %i\nj", input[i], (int)input[i]);
}
This is what the UNICODE corresponds to in C#. in C they print out as 0x3f.
C#
[0x00000000] 0x2e96 '⺖' char
[0x00000001] 0x2e93 '⺓' char
[0x00000002] 0x2e84 '⺄' char
[0x00000003] 0x2e91 '⺑' char
[0x00000004] 0x2ee3 '⻣' char
[0x00000005] 0x2ebd '⺽' char
[0x00000006] 0x2efb '' char
[0x00000007] 0x2ebd '⺽' char
| c# | c | printing | printf | null | null | open | When i try to print out some unicode chars as hex in C, they all have the same value for some reason
===
So for some reason, all these UNICODE characters appear to have the same value when i print them out in C Does anyone have any idea why?
char input[8] = {'⺖', '⺓', '⺄', '⺑', '⻣', '⺽', '', '⺽'};
for( i = 0; i < 9; i++)
{
printf("Input number equivelents in hex %x, in int %i\nj", input[i], (int)input[i]);
}
This is what the UNICODE corresponds to in C#. in C they print out as 0x3f.
C#
[0x00000000] 0x2e96 '⺖' char
[0x00000001] 0x2e93 '⺓' char
[0x00000002] 0x2e84 '⺄' char
[0x00000003] 0x2e91 '⺑' char
[0x00000004] 0x2ee3 '⻣' char
[0x00000005] 0x2ebd '⺽' char
[0x00000006] 0x2efb '' char
[0x00000007] 0x2ebd '⺽' char
| 0 |
11,568,051 | 07/19/2012 19:37:28 | 1,278,030 | 03/19/2012 07:12:24 | 122 | 0 | parsing a text file in sas | So I have a rather messy text file I'm trying to convert to a sas data set. It looks something like this (though much bigger):
0305679 SMITH, JOHN ARCH05 001 2
ARCH05 005 3
ARCH05 001 7
I'm trying to set 5 separate variables (ID, name, job, time, hours) but clearly only 3 of the variables appear after the first line. I tried this:
infile "C:\Users\Desktop\jobs.txt" dlm = ' ' dsd missover;
input ID $ name $ job $ time hours;
and didn't get the right output, then I tried to parse it
> infile "C:\Users\Desktop\jobs.txt" dlm = ' ' dsd missover; input
> allData $; id = substr(allData, find(allData,"305")-2, 7);
but I'm still not getting the right output. Any ideas? | database | sas | null | null | null | null | open | parsing a text file in sas
===
So I have a rather messy text file I'm trying to convert to a sas data set. It looks something like this (though much bigger):
0305679 SMITH, JOHN ARCH05 001 2
ARCH05 005 3
ARCH05 001 7
I'm trying to set 5 separate variables (ID, name, job, time, hours) but clearly only 3 of the variables appear after the first line. I tried this:
infile "C:\Users\Desktop\jobs.txt" dlm = ' ' dsd missover;
input ID $ name $ job $ time hours;
and didn't get the right output, then I tried to parse it
> infile "C:\Users\Desktop\jobs.txt" dlm = ' ' dsd missover; input
> allData $; id = substr(allData, find(allData,"305")-2, 7);
but I'm still not getting the right output. Any ideas? | 0 |
11,568,052 | 07/19/2012 19:37:27 | 401,543 | 07/25/2010 13:35:27 | 138 | 4 | How would I make a UIViewController appear to "slide out" from underneath another VC when using ViewController containment? | I am using ViewController containment, and I am targeting iOS5 and higher. I have a container viewController (A) that contains a sidebar (B), and a content area (C). I want it so when the user taps a button on the sidebar (B), a tableViewController (D) will "slide out" from underneath the sidebar (B) and over the content area (C).
What would be the best way to approach this?
I am just beginning to wrap my head around basic viewController containment (a parent containing two viewControllers), but the sliding out of an additional viewController from underneath a child viewController has stumped.
![][1]
[1]: http://i.stack.imgur.com/C6Axa.jpg | ipad | ios5 | animation | uiviewcontroller | containment | null | open | How would I make a UIViewController appear to "slide out" from underneath another VC when using ViewController containment?
===
I am using ViewController containment, and I am targeting iOS5 and higher. I have a container viewController (A) that contains a sidebar (B), and a content area (C). I want it so when the user taps a button on the sidebar (B), a tableViewController (D) will "slide out" from underneath the sidebar (B) and over the content area (C).
What would be the best way to approach this?
I am just beginning to wrap my head around basic viewController containment (a parent containing two viewControllers), but the sliding out of an additional viewController from underneath a child viewController has stumped.
![][1]
[1]: http://i.stack.imgur.com/C6Axa.jpg | 0 |
11,568,053 | 07/19/2012 19:37:30 | 950,611 | 09/17/2011 20:05:04 | 1 | 1 | Trouble wit CALayer | I have this code and XCode Analyze does not issue any warnings, but in the console every time I get a message:
2012-07-19 23:15:35.122 AttachIt [5725:907] Received memory warning.
I'm using ARC.
Where is my mistake, point it, please.
for(int j=0;j<images;j++){
@autoreleasepool {
NSInteger currentRow = 0;
for(int k = 0; k<i;k++)
currentRow = currentRow + [[assetGroups objectAtIndex:k] numberOfAssets];
asset = [assets objectAtIndex:j+currentRow];
float size = [self getRandomNumberBetweenMin:60.0 andMax:65.0];
CGRect rect;
if(iPad)
rect = CGRectMake(10+j*35.5, 75-size, size, size);
else
rect = CGRectMake(10+j*26, 75-size, size, size);
UIImageView *temp = [[UIImageView alloc] initWithImage:[UIImage imageWithCGImage:[asset thumbnail]]];
temp.frame = rect;
temp.layer.backgroundColor = [UIColor blueColor].CGColor;
temp.layer.shadowOffset = CGSizeMake(0, 3);
temp.layer.shadowRadius = 5.0;
temp.layer.shadowColor = [UIColor blackColor].CGColor;
temp.layer.shadowOpacity = 0.8;
temp.layer.masksToBounds = NO;
temp.layer.borderColor = [[UIColor whiteColor] CGColor];
temp.layer.borderWidth = 2;
[temp setTransform:CGAffineTransformMakeRotation(degreesToRadians([self getRandomNumberBetweenMin:-5 andMax:5]))];
temp.layer.shouldRasterize = TRUE;
[albumRow addSubview:temp];
}
}
| ios | xcode | calayer | null | null | null | open | Trouble wit CALayer
===
I have this code and XCode Analyze does not issue any warnings, but in the console every time I get a message:
2012-07-19 23:15:35.122 AttachIt [5725:907] Received memory warning.
I'm using ARC.
Where is my mistake, point it, please.
for(int j=0;j<images;j++){
@autoreleasepool {
NSInteger currentRow = 0;
for(int k = 0; k<i;k++)
currentRow = currentRow + [[assetGroups objectAtIndex:k] numberOfAssets];
asset = [assets objectAtIndex:j+currentRow];
float size = [self getRandomNumberBetweenMin:60.0 andMax:65.0];
CGRect rect;
if(iPad)
rect = CGRectMake(10+j*35.5, 75-size, size, size);
else
rect = CGRectMake(10+j*26, 75-size, size, size);
UIImageView *temp = [[UIImageView alloc] initWithImage:[UIImage imageWithCGImage:[asset thumbnail]]];
temp.frame = rect;
temp.layer.backgroundColor = [UIColor blueColor].CGColor;
temp.layer.shadowOffset = CGSizeMake(0, 3);
temp.layer.shadowRadius = 5.0;
temp.layer.shadowColor = [UIColor blackColor].CGColor;
temp.layer.shadowOpacity = 0.8;
temp.layer.masksToBounds = NO;
temp.layer.borderColor = [[UIColor whiteColor] CGColor];
temp.layer.borderWidth = 2;
[temp setTransform:CGAffineTransformMakeRotation(degreesToRadians([self getRandomNumberBetweenMin:-5 andMax:5]))];
temp.layer.shouldRasterize = TRUE;
[albumRow addSubview:temp];
}
}
| 0 |
11,568,054 | 07/19/2012 19:37:33 | 138,261 | 07/14/2009 18:35:53 | 2,296 | 105 | Using invalid option for select dropdown with Capybara and RSpec | I'm trying to write a test that checks to see if an error was returned if a value sent with Capybara was invalid. The problem is, one of my form fields is a `<select>` field, and I want to ensure that an invalid input will result in a form error.
Problem is, I can only select the fields that are existing in the select box, all of which are "valid" according to my model's validation. I want to select an invalid field or somehow input some invalid data so that I can test for an error message.
How would I do this? | ruby-on-rails | capybara | null | null | null | null | open | Using invalid option for select dropdown with Capybara and RSpec
===
I'm trying to write a test that checks to see if an error was returned if a value sent with Capybara was invalid. The problem is, one of my form fields is a `<select>` field, and I want to ensure that an invalid input will result in a form error.
Problem is, I can only select the fields that are existing in the select box, all of which are "valid" according to my model's validation. I want to select an invalid field or somehow input some invalid data so that I can test for an error message.
How would I do this? | 0 |
11,500,162 | 07/16/2012 07:54:00 | 1,478,970 | 06/25/2012 03:20:17 | 14 | 0 | About saving data using linq with foreign key | I encounter a problem where this involve foreign key using linq query to do. It's like this, I have 2 tables, "station" and "location". They are linked to another table, "locationstation" using their primary. I need to catch the Station Name from the "station" table and the location at the "location" table.
This is the code I use to join all 3 tables and showed it in the data grid view.
private void Create_LS_Load(object sender, EventArgs e)
{
using (testEntities Setupctx = new testEntities())
{
var storeStation = (from SLS in Setupctx.locationstations
join station s in Setupctx.stations on SLS.idStation equals s.idstations
select s.Station1).Distinct().ToList();
foreach (var LocationStation in storeStation)
{
cbStation.Items.Add(LocationStation);
}
var storeLocation = (from SLS in Setupctx.locationstations
join location l in Setupctx.locations on SLS.idLocation equals l.idlocation
select l.Location1).Distinct().ToList();
foreach (var LocationStation1 in storeLocation)
{
cbLocation.Items.Add(LocationStation1);
}
}
}
After completing in showing into the data grid view, I bind the station name and the location name into 2 respective combo box. This is the codes that I bind into.
string selectStation = cbStation.SelectedItem.ToString();
string selectLocation = cbLocation.SelectedItem.ToString();
After that, I need to create new "locationstation" by selecting the station and location using the combo box. How do I do that? The column name under "locationstation" is still the id of "station" and "location" How to actually creating new locationstation? i'm lost.
Any help will be appreciated. | c# | linq | foreign-keys | null | null | null | open | About saving data using linq with foreign key
===
I encounter a problem where this involve foreign key using linq query to do. It's like this, I have 2 tables, "station" and "location". They are linked to another table, "locationstation" using their primary. I need to catch the Station Name from the "station" table and the location at the "location" table.
This is the code I use to join all 3 tables and showed it in the data grid view.
private void Create_LS_Load(object sender, EventArgs e)
{
using (testEntities Setupctx = new testEntities())
{
var storeStation = (from SLS in Setupctx.locationstations
join station s in Setupctx.stations on SLS.idStation equals s.idstations
select s.Station1).Distinct().ToList();
foreach (var LocationStation in storeStation)
{
cbStation.Items.Add(LocationStation);
}
var storeLocation = (from SLS in Setupctx.locationstations
join location l in Setupctx.locations on SLS.idLocation equals l.idlocation
select l.Location1).Distinct().ToList();
foreach (var LocationStation1 in storeLocation)
{
cbLocation.Items.Add(LocationStation1);
}
}
}
After completing in showing into the data grid view, I bind the station name and the location name into 2 respective combo box. This is the codes that I bind into.
string selectStation = cbStation.SelectedItem.ToString();
string selectLocation = cbLocation.SelectedItem.ToString();
After that, I need to create new "locationstation" by selecting the station and location using the combo box. How do I do that? The column name under "locationstation" is still the id of "station" and "location" How to actually creating new locationstation? i'm lost.
Any help will be appreciated. | 0 |
11,500,164 | 07/16/2012 07:54:04 | 252,207 | 01/16/2010 15:15:47 | 733 | 71 | Keep OperationContext in task parallel library | we have somewhere in a deep abstraction assembly a WCF behavior that reads data from the OperationContext.Current, when this code is executed from within a Task, the OperationContext.Current is empty, is it possible to solve this inside the abstraction assembly or will we need to add some code to all consumers of this assembly?
greetings,
Tim | wcf | task-parallel-library | operationcontext | null | null | null | open | Keep OperationContext in task parallel library
===
we have somewhere in a deep abstraction assembly a WCF behavior that reads data from the OperationContext.Current, when this code is executed from within a Task, the OperationContext.Current is empty, is it possible to solve this inside the abstraction assembly or will we need to add some code to all consumers of this assembly?
greetings,
Tim | 0 |
11,500,171 | 07/16/2012 07:54:32 | 560,287 | 01/02/2011 11:32:58 | 402 | 47 | Check if all background images exist from CSS file | Is there anyway to check if all of the background images exist in a CSS file?
Without using every selector on the page so that this appears in Firebug NET tab.
| css | background-image | null | null | null | null | open | Check if all background images exist from CSS file
===
Is there anyway to check if all of the background images exist in a CSS file?
Without using every selector on the page so that this appears in Firebug NET tab.
| 0 |
8,499,085 | 12/14/2011 03:06:17 | 306,719 | 04/01/2010 08:57:51 | 946 | 1 | Simple 2 way encryption for image | In my browser based application,we have to encrypte the image in the server side,and then decrypte it in the client using flash or other language,then display it.
First, I try to use the "System.Security.Cryptography" int .net2 to do the encrypte,but I am afraid in the client side the image can not be decrpyted using flash or others.
SO I wonder if there is some solution? | encryption | decrypt | null | null | null | null | open | Simple 2 way encryption for image
===
In my browser based application,we have to encrypte the image in the server side,and then decrypte it in the client using flash or other language,then display it.
First, I try to use the "System.Security.Cryptography" int .net2 to do the encrypte,but I am afraid in the client side the image can not be decrpyted using flash or others.
SO I wonder if there is some solution? | 0 |
8,499,086 | 12/14/2011 03:06:35 | 590,636 | 01/26/2011 13:24:52 | 10 | 0 | How to append request contexts while they have different receiver implementation | In google io 2011, David Chandler mentioned that you can chain different request context by using append() method,but in practice, I don't know how to chain them up while they have different receiver,using to() and then fire()?
Please help. | gwt | requestfactory | null | null | null | null | open | How to append request contexts while they have different receiver implementation
===
In google io 2011, David Chandler mentioned that you can chain different request context by using append() method,but in practice, I don't know how to chain them up while they have different receiver,using to() and then fire()?
Please help. | 0 |
11,500,174 | 07/16/2012 07:54:56 | 1,136,108 | 01/07/2012 15:52:13 | 94 | 0 | Facebook upload with tag - Graph api slow | $tags[] = array('tag_uid'=>$id, 'x'=>$x,'y'=>$y);
$facebook->setFileUploadSupport(true);
$arguments = array(
'message' => $some_caption,
'tags' => $tags,
'source' => '@' .realpath( $image),
);
This is what my image uploading to facebook. But it takes longer time?
Is there any other optimized method? | php | facebook | facebook-graph-api | null | null | null | open | Facebook upload with tag - Graph api slow
===
$tags[] = array('tag_uid'=>$id, 'x'=>$x,'y'=>$y);
$facebook->setFileUploadSupport(true);
$arguments = array(
'message' => $some_caption,
'tags' => $tags,
'source' => '@' .realpath( $image),
);
This is what my image uploading to facebook. But it takes longer time?
Is there any other optimized method? | 0 |
11,500,109 | 07/16/2012 07:49:45 | 1,528,188 | 07/16/2012 07:42:58 | 1 | 0 | calcOpticalFlowPyrLK on openCV 2.4.2 | I have some problem with new "calcOpticalFlowPyrLK" function on opencv 2.4.2. This is my old function and parameters : `calcOpticalFlowPyrLK(prevImg, currentImg, prevPts, nextPts, status, err, Size(15,15),3, TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 100, 0.02),OPTFLOW_USE_INITIAL_FLOW,0.0001);`
It works with OpenCV 2.4.1 but now i try to use it on OpenCV 2.4.2 .It gives this error "/src/NaturalFeatureRecognition/OpticalFlowTracker.cpp:164: error: undefined reference to 'cv::calcOpticalFlowPyrLK(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::Size_<int>, `int, cv::TermCriteria, int, double)' " | c++ | opencv | null | null | null | null | open | calcOpticalFlowPyrLK on openCV 2.4.2
===
I have some problem with new "calcOpticalFlowPyrLK" function on opencv 2.4.2. This is my old function and parameters : `calcOpticalFlowPyrLK(prevImg, currentImg, prevPts, nextPts, status, err, Size(15,15),3, TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 100, 0.02),OPTFLOW_USE_INITIAL_FLOW,0.0001);`
It works with OpenCV 2.4.1 but now i try to use it on OpenCV 2.4.2 .It gives this error "/src/NaturalFeatureRecognition/OpticalFlowTracker.cpp:164: error: undefined reference to 'cv::calcOpticalFlowPyrLK(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::Size_<int>, `int, cv::TermCriteria, int, double)' " | 0 |
11,500,185 | 07/16/2012 07:56:14 | 1,492,615 | 06/30/2012 05:53:26 | 12 | 0 | Creating Magento API for sales order | I am new to magento. I have created downloadable products in my magento store.Activation code will be generate for each downloadable product in checkout.When the user will install the product in their domain i need to validate activation key through Magento API.
I don't have much knowledge with Magento API. How to validate the activation code using magento API? can any one guide me? Any default API for activation code validate?
Thanks | magento | null | null | null | null | null | open | Creating Magento API for sales order
===
I am new to magento. I have created downloadable products in my magento store.Activation code will be generate for each downloadable product in checkout.When the user will install the product in their domain i need to validate activation key through Magento API.
I don't have much knowledge with Magento API. How to validate the activation code using magento API? can any one guide me? Any default API for activation code validate?
Thanks | 0 |
11,411,315 | 07/10/2012 10:24:47 | 1,514,435 | 07/10/2012 10:12:15 | 1 | 0 | Tridion UI - "Bad Request" | I have installed Tridion UI 2012 folowing to the documentation and everything seems fine and I can use the UI features such as create a new page, modify an existing page and so on but everynow and then (I haven´t been able to limit when or why) I receive a "Bad Request" error when clicking the "Update Preview".
The detailed error is displayed in the Event Viewer:
Log Name: Tridion
Source: Tridion Publishing
Date: 10/07/2012 12:03:37
Event ID: 100
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: ZZZZZ
Description:
Unable to update or add Binaries using OData Service.
An error occurred while processing this request.
BadRequest
Component: Tridion.SiteEdit.FastTrackPublishing
Errorcode: 1003
User: NT AUTHORITY\NETWORK SERVICE
StackTrace Information Details:
at System.Data.Services.Client.DataServiceContext.SaveResult.<HandleBatchResponse>d__1e.MoveNext()
at System.Data.Services.Client.DataServiceContext.SaveResult.HandleBatchResponse()
at System.Data.Services.Client.DataServiceContext.SaveResult.EndRequest()
at System.Data.Services.Client.DataServiceContext.SaveChanges(SaveChangesOptions options)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.SaveBinaries(RenderedItem renderedItem, ContentDeliveryService service)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.SaveBinaries(RenderedItem renderedItem, ContentDeliveryService service)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.Preview(IEnumerable`1 publishedItemsInfo, TcmUri publishingTargetId)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.Preview(IEnumerable`1 publishedItemsInfo, TcmUri publishingTargetId)
at SyncInvokePreview(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
Have you seen this error before? Any ideas how to avoid/repair it?
Regards
Emma
| tridion | null | null | null | null | null | open | Tridion UI - "Bad Request"
===
I have installed Tridion UI 2012 folowing to the documentation and everything seems fine and I can use the UI features such as create a new page, modify an existing page and so on but everynow and then (I haven´t been able to limit when or why) I receive a "Bad Request" error when clicking the "Update Preview".
The detailed error is displayed in the Event Viewer:
Log Name: Tridion
Source: Tridion Publishing
Date: 10/07/2012 12:03:37
Event ID: 100
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: ZZZZZ
Description:
Unable to update or add Binaries using OData Service.
An error occurred while processing this request.
BadRequest
Component: Tridion.SiteEdit.FastTrackPublishing
Errorcode: 1003
User: NT AUTHORITY\NETWORK SERVICE
StackTrace Information Details:
at System.Data.Services.Client.DataServiceContext.SaveResult.<HandleBatchResponse>d__1e.MoveNext()
at System.Data.Services.Client.DataServiceContext.SaveResult.HandleBatchResponse()
at System.Data.Services.Client.DataServiceContext.SaveResult.EndRequest()
at System.Data.Services.Client.DataServiceContext.SaveChanges(SaveChangesOptions options)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.SaveBinaries(RenderedItem renderedItem, ContentDeliveryService service)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.SaveBinaries(RenderedItem renderedItem, ContentDeliveryService service)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.Preview(IEnumerable`1 publishedItemsInfo, TcmUri publishingTargetId)
at Tridion.SiteEdit.FastTrackPublishing.ServiceImplementation.Preview(IEnumerable`1 publishedItemsInfo, TcmUri publishingTargetId)
at SyncInvokePreview(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
Have you seen this error before? Any ideas how to avoid/repair it?
Regards
Emma
| 0 |
11,411,316 | 07/10/2012 10:24:47 | 1,495,149 | 07/02/2012 04:45:07 | 5 | 0 | how to move to next view controller after showing alertview | I have iphone i want that when alerview is shown and user presses ok button after that view should be changed but it is not happening.
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Thank you" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
return;
[self moveToView];
}
-(void)moveToView{
MainViewController*targetController=[[MainViewController alloc]init];
[self.navigationController pushViewController:targetController animated:YES];
}
| iphone | xcode | null | null | null | null | open | how to move to next view controller after showing alertview
===
I have iphone i want that when alerview is shown and user presses ok button after that view should be changed but it is not happening.
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Thank you" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
return;
[self moveToView];
}
-(void)moveToView{
MainViewController*targetController=[[MainViewController alloc]init];
[self.navigationController pushViewController:targetController animated:YES];
}
| 0 |
11,411,317 | 07/10/2012 10:24:51 | 1,477,580 | 06/24/2012 02:49:27 | 1 | 1 | How to Auto-Colorize Codes Like HTML Editors | I have a Blog, I wana Auto-Colorize its codes when I post something in HTML/CSS/Javascript/Jquery etc.. Just like Stackoverflow
I know em a worst explainer, leme try it..
like this, its automatically colorize the script..
<style type='text/css'>
img.opacity {
opacity: 0.5;
filter: alpha(opacity=50);
-webkit-transition: opacity 1s linear;
}
img.opacity:hover {
opacity: 1;
filter: alpha(opacity=100);
-webkit-transition: opacity 1s linear;
}</style>
I want this feature on my Blog, can you help me pls??
this is my Blog: http://kownleg.blogspot.com/ | javascript | html | css | css-float | css-selectors | null | open | How to Auto-Colorize Codes Like HTML Editors
===
I have a Blog, I wana Auto-Colorize its codes when I post something in HTML/CSS/Javascript/Jquery etc.. Just like Stackoverflow
I know em a worst explainer, leme try it..
like this, its automatically colorize the script..
<style type='text/css'>
img.opacity {
opacity: 0.5;
filter: alpha(opacity=50);
-webkit-transition: opacity 1s linear;
}
img.opacity:hover {
opacity: 1;
filter: alpha(opacity=100);
-webkit-transition: opacity 1s linear;
}</style>
I want this feature on my Blog, can you help me pls??
this is my Blog: http://kownleg.blogspot.com/ | 0 |
11,411,318 | 07/10/2012 10:25:03 | 1,502,470 | 07/04/2012 20:51:01 | 1 | 0 | Converting getting json objects from string pulled from url | I am trying to get json data from a string that i have created from data i have pulled down from a url. So far this is what I have in my code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final TextView tv = (TextView)findViewById(R.id.result);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
String username = "username";
String password = "password";
String url = "http://www.example.com/api/core/v1/my/";
String unp = username+":"+password;
class MyUser {
public String firstName;
public String lastName;
}
try {
HttpClient client = new DefaultHttpClient();
HttpGet header = new HttpGet(url);
String encoded_login = Base64.encodeToString(unp.getBytes(), Base64.NO_WRAP);
header.setHeader(new BasicHeader("Authorization", "Basic "+encoded_login));
HttpResponse response = client.execute(header);
HttpEntity entity = response.getEntity();
BufferedReader reader = new BufferedReader(new InputStreamReader(entity.getContent()));
for (String line; (line = reader.readLine()) != null;line.replaceAll("throw 'allowIllegalResourceCall is false.';", "")) {
Vector<Object> vector = new Vector<Object>();
vector.add(line);
String result = vector.toString();
JSONObject json = (JSONObject)new JSONParser().parse(result);
System.out.println("name=" + json.get("name"));
System.out.println("width=" + json.get("width"));
System.out.println(line);
}
} catch (Exception e) {
e.printStackTrace();
Log.d(MY_APP_TAG, "Error e: " + e);
}
}
This is pulling the correct json data down, but every time i try to parse the data i am getting the following:
E/AndroidRuntime(923): FATAL EXCEPTION: main
E/AndroidRuntime(923): java.lang.NoClassDefFoundError: org.json.simple.parser.JSONParser
E/AndroidRuntime(923): at basic.authentication.BasicAuthenticationActivity.onCreate(BasicAuthenticationActivity.java:85)
E/AndroidRuntime(923): at android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime(923): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
E/AndroidRuntime(923): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
E/AndroidRuntime(923): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
E/AndroidRuntime(923): at android.app.ActivityThread.access$600(ActivityThread.java:123)
E/AndroidRuntime(923): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
E/AndroidRuntime(923): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(923): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(923): at android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime(923): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(923): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(923): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime(923): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime(923): at dalvik.system.NativeStart.main(Native Method)
I am new to json so figuring this out is proving a real big challenge so any help with this is much appreciated.
Also, the json data come through like this:
{
"enabled" : true,
"email" : "[email protected]",
"firstName" : "example firstname",
"lastName" : "example lastname",
"name" : "example fullname",
"level" : {
and i know that these are json objects and not json arrays
Thanks | java | android | json | null | null | null | open | Converting getting json objects from string pulled from url
===
I am trying to get json data from a string that i have created from data i have pulled down from a url. So far this is what I have in my code:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final TextView tv = (TextView)findViewById(R.id.result);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
String username = "username";
String password = "password";
String url = "http://www.example.com/api/core/v1/my/";
String unp = username+":"+password;
class MyUser {
public String firstName;
public String lastName;
}
try {
HttpClient client = new DefaultHttpClient();
HttpGet header = new HttpGet(url);
String encoded_login = Base64.encodeToString(unp.getBytes(), Base64.NO_WRAP);
header.setHeader(new BasicHeader("Authorization", "Basic "+encoded_login));
HttpResponse response = client.execute(header);
HttpEntity entity = response.getEntity();
BufferedReader reader = new BufferedReader(new InputStreamReader(entity.getContent()));
for (String line; (line = reader.readLine()) != null;line.replaceAll("throw 'allowIllegalResourceCall is false.';", "")) {
Vector<Object> vector = new Vector<Object>();
vector.add(line);
String result = vector.toString();
JSONObject json = (JSONObject)new JSONParser().parse(result);
System.out.println("name=" + json.get("name"));
System.out.println("width=" + json.get("width"));
System.out.println(line);
}
} catch (Exception e) {
e.printStackTrace();
Log.d(MY_APP_TAG, "Error e: " + e);
}
}
This is pulling the correct json data down, but every time i try to parse the data i am getting the following:
E/AndroidRuntime(923): FATAL EXCEPTION: main
E/AndroidRuntime(923): java.lang.NoClassDefFoundError: org.json.simple.parser.JSONParser
E/AndroidRuntime(923): at basic.authentication.BasicAuthenticationActivity.onCreate(BasicAuthenticationActivity.java:85)
E/AndroidRuntime(923): at android.app.Activity.performCreate(Activity.java:4465)
E/AndroidRuntime(923): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
E/AndroidRuntime(923): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
E/AndroidRuntime(923): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
E/AndroidRuntime(923): at android.app.ActivityThread.access$600(ActivityThread.java:123)
E/AndroidRuntime(923): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
E/AndroidRuntime(923): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(923): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(923): at android.app.ActivityThread.main(ActivityThread.java:4424)
E/AndroidRuntime(923): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(923): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(923): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
E/AndroidRuntime(923): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
E/AndroidRuntime(923): at dalvik.system.NativeStart.main(Native Method)
I am new to json so figuring this out is proving a real big challenge so any help with this is much appreciated.
Also, the json data come through like this:
{
"enabled" : true,
"email" : "[email protected]",
"firstName" : "example firstname",
"lastName" : "example lastname",
"name" : "example fullname",
"level" : {
and i know that these are json objects and not json arrays
Thanks | 0 |
11,411,320 | 07/10/2012 10:25:06 | 850,360 | 07/18/2011 16:00:17 | 139 | 1 | remove from table 2 if not in table 1, based on 2 fields | They both have fileId and userId fields
table 1:
fileId userId
table 2:
fileId userId
I would like to remove all rows from table 2 if they are not in table 1, based on their fileId and userId.. not just one field but on both...
Kind regards,
J
| php | mysql | null | null | null | null | open | remove from table 2 if not in table 1, based on 2 fields
===
They both have fileId and userId fields
table 1:
fileId userId
table 2:
fileId userId
I would like to remove all rows from table 2 if they are not in table 1, based on their fileId and userId.. not just one field but on both...
Kind regards,
J
| 0 |
11,411,321 | 07/10/2012 10:25:06 | 920,173 | 08/30/2011 16:57:09 | 20 | 4 | Android efficient way to handle multiple lists | My application allows users to chat with friends (like skype or whatsapp), so I have an Activity for displaying a "conversation" (a list).
The user can change from one conversation to another.
So, the problem is changing from one list to another, or "updating" the whole list of messages.
What is the best way to do that? (performance and memory)
- Remove all elements from the list and add the new messages?
- Use multiple ListViews and Adapters?
...
Thanks! | android | null | null | null | null | null | open | Android efficient way to handle multiple lists
===
My application allows users to chat with friends (like skype or whatsapp), so I have an Activity for displaying a "conversation" (a list).
The user can change from one conversation to another.
So, the problem is changing from one list to another, or "updating" the whole list of messages.
What is the best way to do that? (performance and memory)
- Remove all elements from the list and add the new messages?
- Use multiple ListViews and Adapters?
...
Thanks! | 0 |
11,411,324 | 07/10/2012 10:25:11 | 1,307,229 | 04/02/2012 04:38:47 | 25 | 1 | Axis2 Faulty Pojo Web Service | I have created a pojo as below.
package demo;
public class HelloWorld {
public String sayHello(String name) {
return "Hello " + name;
}
}
I placed it in axis2 war and opened
http://localhost:8080/axis2/services/listServices.
Axis 2 is indicating it as faulty service
Faulty Services
<TOMCAT-DIR>\webapps\axis2\WEB-INF\pojo\demo\HelloWorld.class
But when I remove package declaration statement and place it on below location, everything works fine
<TOMCAT-DIR>\webapps\axis2\WEB-INF\pojo\HelloWorld.class
Now there are two possibilities
* Package declaration is not allowed in pojo (and I don't believe this).
* I am missing something.
Can anyone guide me?
| web-services | axis2 | pojo | fault | null | null | open | Axis2 Faulty Pojo Web Service
===
I have created a pojo as below.
package demo;
public class HelloWorld {
public String sayHello(String name) {
return "Hello " + name;
}
}
I placed it in axis2 war and opened
http://localhost:8080/axis2/services/listServices.
Axis 2 is indicating it as faulty service
Faulty Services
<TOMCAT-DIR>\webapps\axis2\WEB-INF\pojo\demo\HelloWorld.class
But when I remove package declaration statement and place it on below location, everything works fine
<TOMCAT-DIR>\webapps\axis2\WEB-INF\pojo\HelloWorld.class
Now there are two possibilities
* Package declaration is not allowed in pojo (and I don't believe this).
* I am missing something.
Can anyone guide me?
| 0 |
11,411,333 | 07/10/2012 10:25:36 | 1,514,404 | 07/10/2012 09:58:04 | 1 | 0 | FOLLOW UP - UILocalNotification Repeat Interval for Custom Alarm | I've searched the net with all the help on how to make custom interval uilocalnotification.
I've also read this post: [link][1]
[1]: http://stackoverflow.com/questions/6966365/uilocalnotification-repeat-interval-for-custom-alarm-sun-mon-tue-wed-thu-f
Im aware that I have to set separate notifications for custom intervals..
from what I understood this,
localNotif.repeatInterval = NSSecondCalendarUnit
bases the repeat on the Date it uses....
if so.. how do I set an alarm on a different day? For example, today is a tuesday 6pm and I want to set an alarm tomorrow (wed) at 6pm. How do I change the day?
and afterwards.... make it every wednesday?
(also I get the time from a datePicker that only uses the time mode...) | uilocalnotification | nscalendar | nsdatecomponents | nsdatepicker | null | null | open | FOLLOW UP - UILocalNotification Repeat Interval for Custom Alarm
===
I've searched the net with all the help on how to make custom interval uilocalnotification.
I've also read this post: [link][1]
[1]: http://stackoverflow.com/questions/6966365/uilocalnotification-repeat-interval-for-custom-alarm-sun-mon-tue-wed-thu-f
Im aware that I have to set separate notifications for custom intervals..
from what I understood this,
localNotif.repeatInterval = NSSecondCalendarUnit
bases the repeat on the Date it uses....
if so.. how do I set an alarm on a different day? For example, today is a tuesday 6pm and I want to set an alarm tomorrow (wed) at 6pm. How do I change the day?
and afterwards.... make it every wednesday?
(also I get the time from a datePicker that only uses the time mode...) | 0 |
11,411,334 | 07/10/2012 10:25:44 | 1,150,863 | 01/15/2012 20:45:32 | 95 | 2 | Zen nth element | I've been using zen coding and I love it. There's just one thing I can't figure out how to do (or if it's even possible.)
Say I typed:
`ul#navigation>li*3`
Which would output:
`<ul id="navigation">
<li></li>
<li></li>
<li></li>
</ul>`
How would I apply a class to a specific numbered element? Such as add a class called 'hello' to the second `<li>?` | zen-coding | null | null | null | null | null | open | Zen nth element
===
I've been using zen coding and I love it. There's just one thing I can't figure out how to do (or if it's even possible.)
Say I typed:
`ul#navigation>li*3`
Which would output:
`<ul id="navigation">
<li></li>
<li></li>
<li></li>
</ul>`
How would I apply a class to a specific numbered element? Such as add a class called 'hello' to the second `<li>?` | 0 |
11,411,336 | 07/10/2012 10:25:48 | 1,292,659 | 03/26/2012 09:40:31 | 220 | 31 | Wrong Object sent to WebService (JAX-RPC) - Stub subtility | Good day to you. I'm facing a problem in my JAX-RPC implementation on which I need to progress quickly. I'll then make it quick.
I have **XML files** with data stored. An **XMLParser** allows to convert those files into **ObjectMap** items.
My web service give a client the opportunity to send an ObjectMap to the server.
This is why I have the following method :
public int sendXML(ObjectMap additionnal_parameter){}
The service is created and works fine (I'm 100% positive about this). I then proceed to create a stub using WSDL2Java. This stub then contains a new version of the ObjectMap class as it's the given parameter to the service.
In my client, I do use that stub and import
a.b.ServiceStub.ObjectMap;
If I create a new ObjectMap, use its setters, I can call the distant service and have the server receive it perfectly.
But I want to load an *ObjectMap from the XMLParser*. I used to do that this way
XMLParser parser = new XMLParser();
List<ObjectMap> maps = parser.readFromXml();
**My problem :**
The XMLParser returns me an a.b.ObjectMap object, and my service requires and a.b.ServiceStub.ObjectMap one.
The Parser doesn't have an altered version in the Stub as not a parameter to the service !
Any quick help would be appreciated. Thanks.
| java | web-services | stub | jax-rpc | null | null | open | Wrong Object sent to WebService (JAX-RPC) - Stub subtility
===
Good day to you. I'm facing a problem in my JAX-RPC implementation on which I need to progress quickly. I'll then make it quick.
I have **XML files** with data stored. An **XMLParser** allows to convert those files into **ObjectMap** items.
My web service give a client the opportunity to send an ObjectMap to the server.
This is why I have the following method :
public int sendXML(ObjectMap additionnal_parameter){}
The service is created and works fine (I'm 100% positive about this). I then proceed to create a stub using WSDL2Java. This stub then contains a new version of the ObjectMap class as it's the given parameter to the service.
In my client, I do use that stub and import
a.b.ServiceStub.ObjectMap;
If I create a new ObjectMap, use its setters, I can call the distant service and have the server receive it perfectly.
But I want to load an *ObjectMap from the XMLParser*. I used to do that this way
XMLParser parser = new XMLParser();
List<ObjectMap> maps = parser.readFromXml();
**My problem :**
The XMLParser returns me an a.b.ObjectMap object, and my service requires and a.b.ServiceStub.ObjectMap one.
The Parser doesn't have an altered version in the Stub as not a parameter to the service !
Any quick help would be appreciated. Thanks.
| 0 |
11,411,346 | 07/10/2012 10:26:41 | 162,530 | 08/25/2009 08:10:38 | 941 | 8 | In tcsh how do you get the exit status of a command in backquotes? | I have the following code in my tcsh startup script:
set _color_count = `sh -c "tput -T${TERM}-256color colors 2>/dev/null"`
if ($? == 0) then # check if it was a valid terminal type
if ($_color_count != 256) then # sanity-check
echo "Warning: Color count '$_color_count' for '${TERM}-256color' is not 256"
endif
setenv TERM "${TERM}-256color"
endif
My problem is that the exit status ($?) is *always* zero, even when the `tput` command returns a non-zero exit status due to an invalid terminal type. If I don't capture the output of the command, checking the exit status works fine:
sh -c "tput -T${TERM}-256color colors 2>/dev/null"
How do I determine whether or not the `tput` command returned a non-zero exit status, given it's in backquotes?
| tcsh | null | null | null | null | null | open | In tcsh how do you get the exit status of a command in backquotes?
===
I have the following code in my tcsh startup script:
set _color_count = `sh -c "tput -T${TERM}-256color colors 2>/dev/null"`
if ($? == 0) then # check if it was a valid terminal type
if ($_color_count != 256) then # sanity-check
echo "Warning: Color count '$_color_count' for '${TERM}-256color' is not 256"
endif
setenv TERM "${TERM}-256color"
endif
My problem is that the exit status ($?) is *always* zero, even when the `tput` command returns a non-zero exit status due to an invalid terminal type. If I don't capture the output of the command, checking the exit status works fine:
sh -c "tput -T${TERM}-256color colors 2>/dev/null"
How do I determine whether or not the `tput` command returned a non-zero exit status, given it's in backquotes?
| 0 |
11,411,277 | 07/10/2012 10:22:15 | 272,839 | 02/14/2010 14:22:32 | 402 | 17 | git remove file from repository and old commit | I have a file with private data.
At the moment it's ok because the repository is private.
I would like to make it public but I don't want that this file stay public.
Is it possible to modify commits of this file to remove this file from the whole repository ? | git | repository | null | null | null | null | open | git remove file from repository and old commit
===
I have a file with private data.
At the moment it's ok because the repository is private.
I would like to make it public but I don't want that this file stay public.
Is it possible to modify commits of this file to remove this file from the whole repository ? | 0 |
11,542,365 | 07/18/2012 13:18:30 | 1,479,895 | 06/25/2012 12:04:00 | 1 | 0 | ASP fileupload control cannot be opened with Jquery in IE and Opera | I have the following problem when I'm browsing with IE 9 and Opera: I have a hidden aps fileupload dialog, which I trigger when the user clicks on an asp button.
<asp:LinkButton ID="btnBrowse" class="button fright marl10" OnClientClick="return openFileDialog()" runat="server" CausesValidation="false"></asp:LinkButton>
And here is the Jquery:
function openFileDialog() {
$('#uploadPhotoDialog').click();
return false;
}
uploadPhotoDialog is the ID of the aps fileupload control.
I'll appreciate any answers.
Thanks in advance. | c# | jquery | asp.net | null | null | null | open | ASP fileupload control cannot be opened with Jquery in IE and Opera
===
I have the following problem when I'm browsing with IE 9 and Opera: I have a hidden aps fileupload dialog, which I trigger when the user clicks on an asp button.
<asp:LinkButton ID="btnBrowse" class="button fright marl10" OnClientClick="return openFileDialog()" runat="server" CausesValidation="false"></asp:LinkButton>
And here is the Jquery:
function openFileDialog() {
$('#uploadPhotoDialog').click();
return false;
}
uploadPhotoDialog is the ID of the aps fileupload control.
I'll appreciate any answers.
Thanks in advance. | 0 |
11,542,627 | 07/18/2012 13:32:03 | 1,544 | 08/16/2008 14:15:09 | 1,810 | 60 | How to call NtUserPostMessage from kernel-mode WFP callout driver? | In order to fit a WFP (Windows Filtering Platform) callout driver into an existing product, I need to have it send window messages to an existing application. Is there a way to do this from a kernel-mode WFP driver?
There's a technique [here](http://x1machine.blogspot.com/2010_08_01_archive.html) for calling NtUserPostMessage from kernel-mode drivers, but I'm not sure if it applies to a WFP driver and it predates Windows 8 so it doesn't have the right syscall address for the new OS.
I'm open to any method of sending window messages (or, more precisely, posting them so there won't be a delay) because it would keep me from having to recode part of the existing app. | c++ | windows | windows-8 | driver | wfp | null | open | How to call NtUserPostMessage from kernel-mode WFP callout driver?
===
In order to fit a WFP (Windows Filtering Platform) callout driver into an existing product, I need to have it send window messages to an existing application. Is there a way to do this from a kernel-mode WFP driver?
There's a technique [here](http://x1machine.blogspot.com/2010_08_01_archive.html) for calling NtUserPostMessage from kernel-mode drivers, but I'm not sure if it applies to a WFP driver and it predates Windows 8 so it doesn't have the right syscall address for the new OS.
I'm open to any method of sending window messages (or, more precisely, posting them so there won't be a delay) because it would keep me from having to recode part of the existing app. | 0 |
9,906,330 | 03/28/2012 11:14:14 | 1,234,607 | 02/27/2012 01:09:34 | 70 | 0 | Keep only a-z and underscore characters | How do I strip all characters from a string, besides `a-z` (with uppercase) and the underscore `_` ? | php | string | null | null | null | null | open | Keep only a-z and underscore characters
===
How do I strip all characters from a string, besides `a-z` (with uppercase) and the underscore `_` ? | 0 |
11,542,655 | 07/18/2012 13:33:25 | 406,457 | 07/30/2010 06:30:03 | 394 | 16 | Drawing graph line using Core Graphics | I am trying draw an random graph which display on imageview, I try this code
-(void)createGraph{
UIGraphicsBeginImageContext(self.drawImage.frame.size);
[drawImage.image drawInRect:CGRectMake(0, 0, drawImage.frame.size.width, drawImage.frame.size.height)];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
CGContextSetLineWidth(context, 2.0);
int i = 0;
while (i<=20) {
int r = rand() % 100;
CGContextMoveToPoint(context, 20, 320);
CGContextAddLineToPoint(context, linePoint.x+20+i*r, linePoint.y+320-i*r);
CGContextStrokePath(context);
i++;
NSLog(@"random value %d",r);
}
drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
}
But its drawing a diagonal on single line. has show in below image
I am expecting to draw a graph line! using coregraphics
![enter image description here][1]
[1]: http://i.stack.imgur.com/SH8ko.png | iphone | ipad | null | null | null | null | open | Drawing graph line using Core Graphics
===
I am trying draw an random graph which display on imageview, I try this code
-(void)createGraph{
UIGraphicsBeginImageContext(self.drawImage.frame.size);
[drawImage.image drawInRect:CGRectMake(0, 0, drawImage.frame.size.width, drawImage.frame.size.height)];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
CGContextSetLineWidth(context, 2.0);
int i = 0;
while (i<=20) {
int r = rand() % 100;
CGContextMoveToPoint(context, 20, 320);
CGContextAddLineToPoint(context, linePoint.x+20+i*r, linePoint.y+320-i*r);
CGContextStrokePath(context);
i++;
NSLog(@"random value %d",r);
}
drawImage.image = UIGraphicsGetImageFromCurrentImageContext();
}
But its drawing a diagonal on single line. has show in below image
I am expecting to draw a graph line! using coregraphics
![enter image description here][1]
[1]: http://i.stack.imgur.com/SH8ko.png | 0 |
11,542,658 | 07/18/2012 13:33:35 | 1,344,968 | 04/19/2012 19:53:39 | 20 | 0 | Join in linq to entities and return only the right side of the relationship | I have two entity that has an one-to-many relationship, I´m trying to select the master entity filtering properties in the child items.
For example:
public class Pedido
{
public int Id { get; set; }
public string Descricao { get; set; }
public virtual ICollection<PedidoItem> Itens { get; set; }
}
public class PedidoItem
{
public int Id { get; set; }
public int PedidoId { get; set; }
public Pedido Pedido { get; set; }
public string Descricao { get; set; }
public int Status { get; set; }
}
public class DataInit : DropCreateDatabaseAlways<Data>
{
protected override void Seed(Data context)
{
context.Pedidos.Add(new Pedido {
Descricao = "PEDIDO UM",
Itens = new List<PedidoItem> {
new PedidoItem {
Descricao = "ITEM UM",
Status = 0 },
new PedidoItem{
Descricao = "ITEM DOIS",
Status = 0 },
new PedidoItem{
Descricao = "ITEM TRES",
Status = 0 },
new PedidoItem{
Descricao = "ITEM QUATRO",
Status = 1 }
}
});
context.SaveChanges();
base.Seed(context);
}
public DataInit()
{
}
}
public class Data : DbContext
{
public DbSet<Pedido> Pedidos { get; set; }
public Data()
{
Database.SetInitializer(new DataInit());
}
}
class Program
{
static void Main(string[] args)
{
Data dt = new Data();
var pedidos = from ped in dt.Pedidos
where ped.Itens.Any(item => item.Status == 1)
select ped;
var lista = pedidos.ToList();
}
}
I have only one Pedido entity in database and one one item with status = 1, I´d like to return only this item that has status = 1 in the collection, How should I do?
I´d like to return Pedido entity with only one item that was filtered(item.Status == 1) | entity-framework | linq-to-entities | ef-code-first | null | null | null | open | Join in linq to entities and return only the right side of the relationship
===
I have two entity that has an one-to-many relationship, I´m trying to select the master entity filtering properties in the child items.
For example:
public class Pedido
{
public int Id { get; set; }
public string Descricao { get; set; }
public virtual ICollection<PedidoItem> Itens { get; set; }
}
public class PedidoItem
{
public int Id { get; set; }
public int PedidoId { get; set; }
public Pedido Pedido { get; set; }
public string Descricao { get; set; }
public int Status { get; set; }
}
public class DataInit : DropCreateDatabaseAlways<Data>
{
protected override void Seed(Data context)
{
context.Pedidos.Add(new Pedido {
Descricao = "PEDIDO UM",
Itens = new List<PedidoItem> {
new PedidoItem {
Descricao = "ITEM UM",
Status = 0 },
new PedidoItem{
Descricao = "ITEM DOIS",
Status = 0 },
new PedidoItem{
Descricao = "ITEM TRES",
Status = 0 },
new PedidoItem{
Descricao = "ITEM QUATRO",
Status = 1 }
}
});
context.SaveChanges();
base.Seed(context);
}
public DataInit()
{
}
}
public class Data : DbContext
{
public DbSet<Pedido> Pedidos { get; set; }
public Data()
{
Database.SetInitializer(new DataInit());
}
}
class Program
{
static void Main(string[] args)
{
Data dt = new Data();
var pedidos = from ped in dt.Pedidos
where ped.Itens.Any(item => item.Status == 1)
select ped;
var lista = pedidos.ToList();
}
}
I have only one Pedido entity in database and one one item with status = 1, I´d like to return only this item that has status = 1 in the collection, How should I do?
I´d like to return Pedido entity with only one item that was filtered(item.Status == 1) | 0 |
11,542,660 | 07/18/2012 13:33:49 | 867,238 | 07/28/2011 10:25:13 | 119 | 1 | Simple HTML Page with Ajax not working | I just started to get an idea of AJAX. For this i am trying out an example i found while searching on my local machine. But it is not working.
The page has some static text when page is loaded, once we scroll down, new dynamic text is added using ajax, but its not adding new text while scrolling.
The html file code is:
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$(window).scroll(function () {
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
sendData();
}
});
function sendData() {
$.ajax(
{
type: "POST",
url: "https://localhost/kailash/cgi/testing/getdata.pl",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: "true",
cache: "false",
success: function (msg) {
$("#myDiv").append(msg.d);
},
Error: function (x, e) {
alert("Some error");
}
});
}
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="myDiv">
<p>
Static data initially rendered.
</p>
It calls getdata.pl. Code in getdata.pl is
our $resp;
my $cgi = new CGI;
print $cgi->header();
$resp = "<p>This content is dynamically appended to the existing content on scrolling.</p>";
return "$resp\n";
So this is not working. can you please help me in getting it working.
Please let me know whats missing in it.
| jquery-ajax | null | null | null | null | null | open | Simple HTML Page with Ajax not working
===
I just started to get an idea of AJAX. For this i am trying out an example i found while searching on my local machine. But it is not working.
The page has some static text when page is loaded, once we scroll down, new dynamic text is added using ajax, but its not adding new text while scrolling.
The html file code is:
<script type="text/javascript" language="javascript">
$(document).ready(function () {
$(window).scroll(function () {
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
sendData();
}
});
function sendData() {
$.ajax(
{
type: "POST",
url: "https://localhost/kailash/cgi/testing/getdata.pl",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: "true",
cache: "false",
success: function (msg) {
$("#myDiv").append(msg.d);
},
Error: function (x, e) {
alert("Some error");
}
});
}
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="myDiv">
<p>
Static data initially rendered.
</p>
It calls getdata.pl. Code in getdata.pl is
our $resp;
my $cgi = new CGI;
print $cgi->header();
$resp = "<p>This content is dynamically appended to the existing content on scrolling.</p>";
return "$resp\n";
So this is not working. can you please help me in getting it working.
Please let me know whats missing in it.
| 0 |
11,542,665 | 07/18/2012 13:34:19 | 658,976 | 01/12/2011 08:40:28 | 630 | 25 | remove unwanted ' \' from json values with html tags , generated using amazonaws json toolkit | I use amazonaws library[com.amazonaws.util.json] (java) for generate json .
I use something as follows
string boldopen = "<b>"
string boldclose = "</b>"
string result = boldopen + "hello" + boldclose;
jsonobj.put("test",result)
I get the response as {"test" : <b>hello<\/b>}.
I need output as without the '\'.
Thanks in advance. | java | json | amazon | null | null | null | open | remove unwanted ' \' from json values with html tags , generated using amazonaws json toolkit
===
I use amazonaws library[com.amazonaws.util.json] (java) for generate json .
I use something as follows
string boldopen = "<b>"
string boldclose = "</b>"
string result = boldopen + "hello" + boldclose;
jsonobj.put("test",result)
I get the response as {"test" : <b>hello<\/b>}.
I need output as without the '\'.
Thanks in advance. | 0 |
11,651,205 | 07/25/2012 13:47:08 | 769,220 | 05/25/2011 08:57:12 | 1,004 | 40 | Image to vector of points | I'm trying to calculate the covariance of a multichannel image patch (using [cv::calcCovarMatrix][1]), so I can in turn calculate the [Mahalonobis distance][2] of a pixel from that patch and I'm really struggling to find the right options to reshape the matrix into the right format.
For example if my matrix has 3 rows, 5 columns, and 2 channels:
// Channel 1:
1 2 3 4
5 6 7 8
9 0 1 2
// Channel 2:
99 98 97 96
95 94 93 92
91 90 89 88
What I believe I need is to reshape the image into a shape with 5x5 rows and 2 columns (or its transpose):
// Desired result:
1 2 3 4 5 6 7 8 9 0 1 2
99 98 97 96 95 94 93 92 91 90 89 88
1. Is this the correct format for cv::calcCovarMatrix?
2. What parameters do I need for .reshape() to achieve this?
An example in code:
#include <opencv2/opencv.hpp>
int main(int argc, char* argv[])
{
// Construct channel 1
cv::Mat_<float> channel1 = (cv::Mat_<float>(3, 4) << 1.0, 2.0, 3.0, 4.0,
5.0, 6.0, 7.0, 8.0,
9.0, 0.0, 1.0, 2.0);
std::cout << "Channel 1: " << std::endl;
std::cout << channel1 << std::endl;
// Construct channel 2
cv::Mat_<float> channel2 = (cv::Mat_<float>(3, 4) << 99.0, 98.0, 97.0, 96.0,
95.0, 94.0, 93.0, 92.0,
91.0, 90.0, 89.0, 88.0);
std::cout << "Channel 2: " << std::endl;
std::cout << channel2 << std::endl;
// Merge together
std::vector<cv::Mat> stack;
cv::Mat merged;
stack.push_back(channel1);
stack.push_back(channel2);
cv::merge(stack, merged);
std::cout << "Merged:" <<std::endl;
std::cout << merged << std::endl;
// Reshape
cv::Mat reshaped = merged.reshape(0,1).reshape(1); // <----Need help with this line
std::cout << "Reshaped:" <<std::endl;
std::cout << reshaped << std::endl;
return 0;
}
[1]: http://opencv.itseez.com/modules/core/doc/operations_on_arrays.html#calccovarmatrix
[2]: http://opencv.itseez.com/modules/core/doc/operations_on_arrays.html#mahalanobis | c++ | opencv | null | null | null | null | open | Image to vector of points
===
I'm trying to calculate the covariance of a multichannel image patch (using [cv::calcCovarMatrix][1]), so I can in turn calculate the [Mahalonobis distance][2] of a pixel from that patch and I'm really struggling to find the right options to reshape the matrix into the right format.
For example if my matrix has 3 rows, 5 columns, and 2 channels:
// Channel 1:
1 2 3 4
5 6 7 8
9 0 1 2
// Channel 2:
99 98 97 96
95 94 93 92
91 90 89 88
What I believe I need is to reshape the image into a shape with 5x5 rows and 2 columns (or its transpose):
// Desired result:
1 2 3 4 5 6 7 8 9 0 1 2
99 98 97 96 95 94 93 92 91 90 89 88
1. Is this the correct format for cv::calcCovarMatrix?
2. What parameters do I need for .reshape() to achieve this?
An example in code:
#include <opencv2/opencv.hpp>
int main(int argc, char* argv[])
{
// Construct channel 1
cv::Mat_<float> channel1 = (cv::Mat_<float>(3, 4) << 1.0, 2.0, 3.0, 4.0,
5.0, 6.0, 7.0, 8.0,
9.0, 0.0, 1.0, 2.0);
std::cout << "Channel 1: " << std::endl;
std::cout << channel1 << std::endl;
// Construct channel 2
cv::Mat_<float> channel2 = (cv::Mat_<float>(3, 4) << 99.0, 98.0, 97.0, 96.0,
95.0, 94.0, 93.0, 92.0,
91.0, 90.0, 89.0, 88.0);
std::cout << "Channel 2: " << std::endl;
std::cout << channel2 << std::endl;
// Merge together
std::vector<cv::Mat> stack;
cv::Mat merged;
stack.push_back(channel1);
stack.push_back(channel2);
cv::merge(stack, merged);
std::cout << "Merged:" <<std::endl;
std::cout << merged << std::endl;
// Reshape
cv::Mat reshaped = merged.reshape(0,1).reshape(1); // <----Need help with this line
std::cout << "Reshaped:" <<std::endl;
std::cout << reshaped << std::endl;
return 0;
}
[1]: http://opencv.itseez.com/modules/core/doc/operations_on_arrays.html#calccovarmatrix
[2]: http://opencv.itseez.com/modules/core/doc/operations_on_arrays.html#mahalanobis | 0 |
11,612,756 | 07/23/2012 12:41:28 | 1,341,708 | 04/18/2012 14:53:57 | 101 | 1 | Powershell: Get-Process won't return remote description | So I'm trying to return a list of running process' descriptions on a machine which I can do no problem via `get-process | select description`
However, when I try: `get-process -computer remote | select description` nothing is returned, only empty strings.
Is there a reason for this?
Thanks | powershell | null | null | null | null | null | open | Powershell: Get-Process won't return remote description
===
So I'm trying to return a list of running process' descriptions on a machine which I can do no problem via `get-process | select description`
However, when I try: `get-process -computer remote | select description` nothing is returned, only empty strings.
Is there a reason for this?
Thanks | 0 |
11,651,207 | 07/25/2012 13:47:15 | 93,422 | 04/20/2009 20:39:20 | 3,327 | 73 | Allowing for more then one "no-value" value in value space | I use a string type for my Id attribute on all my domain abjects. E.g.:
public class Person {
property string Id { get; set; }
// ... more properties
}
no tricks here. `null` represents a "no-value" value, when a new Person is created and before it is persisted, `Id` will remain `null`.
Now there is a discussion to enhance "no-value" space and say that `null`, empty string and white-space strings are all "no-value" values.
I.e. to check if entity is new instead of doing: `if (person.Id == null)` it will become `if (string.IsNullOrWhiteSpace(person.Id))`
In my humble opinion this is a smell or a design principle violation, but I can't figure out which one.
**Question:** which (if any) design principle does this decision violates (the decision to allow for more than just `null` to represent no-value value)?
(I think it should be something similar to Occam's razor principle or entropy or KISS, I just not sure) | oop | design | code-smell | design-principles | null | null | open | Allowing for more then one "no-value" value in value space
===
I use a string type for my Id attribute on all my domain abjects. E.g.:
public class Person {
property string Id { get; set; }
// ... more properties
}
no tricks here. `null` represents a "no-value" value, when a new Person is created and before it is persisted, `Id` will remain `null`.
Now there is a discussion to enhance "no-value" space and say that `null`, empty string and white-space strings are all "no-value" values.
I.e. to check if entity is new instead of doing: `if (person.Id == null)` it will become `if (string.IsNullOrWhiteSpace(person.Id))`
In my humble opinion this is a smell or a design principle violation, but I can't figure out which one.
**Question:** which (if any) design principle does this decision violates (the decision to allow for more than just `null` to represent no-value value)?
(I think it should be something similar to Occam's razor principle or entropy or KISS, I just not sure) | 0 |
9,366,762 | 02/20/2012 18:54:29 | 508,284 | 11/15/2010 13:22:30 | 676 | 2 | Html table layout when binding with asp.net c# repeater | I have asp repeater which looks like this
<asp:Repeater runat="server" ID="Repeater1">
<HeaderTemplate>
<table border="1">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# Eval("Username")%>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
How i can make table layout like this?
![enter image description here][1]
thanks
[1]: http://i.stack.imgur.com/5BZhU.jpg | asp.net | html | table | null | null | null | open | Html table layout when binding with asp.net c# repeater
===
I have asp repeater which looks like this
<asp:Repeater runat="server" ID="Repeater1">
<HeaderTemplate>
<table border="1">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# Eval("Username")%>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
How i can make table layout like this?
![enter image description here][1]
thanks
[1]: http://i.stack.imgur.com/5BZhU.jpg | 0 |
9,366,765 | 02/20/2012 18:54:39 | 893,686 | 08/14/2011 07:24:32 | 106 | 1 | Is it possible to map a whole table to an object? | Is it possible to map a whole table to a .Net object, as opposed to only individual rows? Basically like a DataTable, complete with table name, column structure, table properties, etc. | c# | nhibernate | null | null | null | null | open | Is it possible to map a whole table to an object?
===
Is it possible to map a whole table to a .Net object, as opposed to only individual rows? Basically like a DataTable, complete with table name, column structure, table properties, etc. | 0 |
11,651,209 | 07/25/2012 13:47:40 | 1,137,223 | 01/08/2012 15:34:46 | 24 | 8 | xpath-functions does not identify an external Java class | The following XSLT transformation displays an error whenever I try to use the function node-name().
> *Error: E[Saxon6.5.5]The URI http://www.w3.org/2005/xpath-functions does not identify an external Java class*
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions">
<!--
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-->
<xsl:output method="text" />
<xsl:variable name="in" select="/"/>
<xsl:variable name="filter" select="document('elementsToBeFilterOut.xml')"/>
<xsl:template match="/">
<xsl:apply-templates select="*">
<xsl:with-param name="f" select="$filter/*"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*">
<xsl:param name="f"/>
<xsl:choose>
<xsl:when test="$f/*">
<xsl:copy-of select="fn:node-name()"/>
<!--
<xsl:for-each select="*[fn:node-name(.) = $f/*/fn:node-name(.)]">
<xsl:apply-templates select=".">
<xsl:with-param name="f" select="f/*[fn:node-name() = current()/fn:node-name()]"/>
</xsl:apply-templates>
</xsl:for-each>
-->
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
| xml | xslt | null | null | null | null | open | xpath-functions does not identify an external Java class
===
The following XSLT transformation displays an error whenever I try to use the function node-name().
> *Error: E[Saxon6.5.5]The URI http://www.w3.org/2005/xpath-functions does not identify an external Java class*
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions">
<!--
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-->
<xsl:output method="text" />
<xsl:variable name="in" select="/"/>
<xsl:variable name="filter" select="document('elementsToBeFilterOut.xml')"/>
<xsl:template match="/">
<xsl:apply-templates select="*">
<xsl:with-param name="f" select="$filter/*"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*">
<xsl:param name="f"/>
<xsl:choose>
<xsl:when test="$f/*">
<xsl:copy-of select="fn:node-name()"/>
<!--
<xsl:for-each select="*[fn:node-name(.) = $f/*/fn:node-name(.)]">
<xsl:apply-templates select=".">
<xsl:with-param name="f" select="f/*[fn:node-name() = current()/fn:node-name()]"/>
</xsl:apply-templates>
</xsl:for-each>
-->
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
| 0 |
11,734,799 | 07/31/2012 07:01:10 | 1,130,069 | 01/04/2012 13:55:37 | 337 | 1 | Seem to get segfaults from Copy Constructor? | I'm writing some C++ code for a simple "Node" class. This is basically a class used to manage a linear linked list. I normally perform this with a struct but I'm trying get a better handle of OOP and classes. What I've got thus far for the Node class is (note: the String class is my version (trimmed down) of a typical "string" class, it implements a copy constructor, assignment overload, destructor, etc. In testing it has worked great and seems completely self contained):
class Node {
public:
//Constructor
//-----------
Node() : next_(0) {} //inline (String constructor called)
//Destructor
//----------
~Node();
//Copy Constructor
//----------------
Node(const Node &);
//Operator Overload: =
//---------------------
//In conjunction with copy constructor. Protects Class.
Node & operator=(const Node &);
private:
String relatedEntry_;
Node * next_;
};
Creating one instance works fine (ie. `Node node;`) but when I create an instance that calls the Copy Constructor I end up with segfaults at the very end of my program, as it's cleaning up. The difference between using a struct for a linked list vs a class plays tricks with me a little and I think I'm missing something key here. Here is the implementation for the Default Constructor, Copy Constructor, and Overloaded Assignment Operator:
//Constructor inlined
//Destructor
Node::~Node()
{
Node * curr = next_;
while (curr) //cycle through LL and delete nodes
{
Node * temp = curr; //hold onto current
curr = curr->next_; //increment one
delete temp; //delete former current
}
}
//Copy Constructor
Node::Node(const Node & cp)
{
std::cout << "in CopyCon" << std::endl;
relatedEntry_ = cp.relatedEntry_; //calls String class copy constructor/assignment overload
Node * curr = cp.next_; //for clarity, for traversal
while (curr) //copies related entry structure
{
Node * oldNext = next_;
next_ = new Node;
next_->next_ = oldNext; //'next' field (assign prior)
next_->relatedEntry_ = curr->relatedEntry_; //String class copy
curr = curr->next_; //increment
}
}
//OO: =
Node & Node::operator=(const Node & cp)
{
std::cout << "in OO: =" << std::endl;
if (this == &cp)
return *this; //self assignment
delete next_; //delete LL
relatedEntry_ = cp.relatedEntry_; //String Class Assignment Overload
Node * curr = cp.next_; //for clarity, for traversal
while (curr)
{
Node * oldNext = next_; //hold onto old
next_ = new Node;
next_->next_ = oldNext; //set next to old
next_->relatedEntry_ = curr->relatedEntry_; //set this string to cp string
curr = curr->next_; //increment
}
return *this;
}
Note that using the Overloaded Assignment Function seems to work fine (no segfaults) even though it's virtually the same code... I'm assuming it has to do with the fact that both objects are already initialized *before* the assignment takes place?
//This seems to work ok
Node node1;
Node node2;
node2 = node1;
I've been at this bug for a couple of hours and I have got to get some rest. I'd really appreciate any insight into this. Thanks. | c++ | homework | segmentation-fault | null | null | null | open | Seem to get segfaults from Copy Constructor?
===
I'm writing some C++ code for a simple "Node" class. This is basically a class used to manage a linear linked list. I normally perform this with a struct but I'm trying get a better handle of OOP and classes. What I've got thus far for the Node class is (note: the String class is my version (trimmed down) of a typical "string" class, it implements a copy constructor, assignment overload, destructor, etc. In testing it has worked great and seems completely self contained):
class Node {
public:
//Constructor
//-----------
Node() : next_(0) {} //inline (String constructor called)
//Destructor
//----------
~Node();
//Copy Constructor
//----------------
Node(const Node &);
//Operator Overload: =
//---------------------
//In conjunction with copy constructor. Protects Class.
Node & operator=(const Node &);
private:
String relatedEntry_;
Node * next_;
};
Creating one instance works fine (ie. `Node node;`) but when I create an instance that calls the Copy Constructor I end up with segfaults at the very end of my program, as it's cleaning up. The difference between using a struct for a linked list vs a class plays tricks with me a little and I think I'm missing something key here. Here is the implementation for the Default Constructor, Copy Constructor, and Overloaded Assignment Operator:
//Constructor inlined
//Destructor
Node::~Node()
{
Node * curr = next_;
while (curr) //cycle through LL and delete nodes
{
Node * temp = curr; //hold onto current
curr = curr->next_; //increment one
delete temp; //delete former current
}
}
//Copy Constructor
Node::Node(const Node & cp)
{
std::cout << "in CopyCon" << std::endl;
relatedEntry_ = cp.relatedEntry_; //calls String class copy constructor/assignment overload
Node * curr = cp.next_; //for clarity, for traversal
while (curr) //copies related entry structure
{
Node * oldNext = next_;
next_ = new Node;
next_->next_ = oldNext; //'next' field (assign prior)
next_->relatedEntry_ = curr->relatedEntry_; //String class copy
curr = curr->next_; //increment
}
}
//OO: =
Node & Node::operator=(const Node & cp)
{
std::cout << "in OO: =" << std::endl;
if (this == &cp)
return *this; //self assignment
delete next_; //delete LL
relatedEntry_ = cp.relatedEntry_; //String Class Assignment Overload
Node * curr = cp.next_; //for clarity, for traversal
while (curr)
{
Node * oldNext = next_; //hold onto old
next_ = new Node;
next_->next_ = oldNext; //set next to old
next_->relatedEntry_ = curr->relatedEntry_; //set this string to cp string
curr = curr->next_; //increment
}
return *this;
}
Note that using the Overloaded Assignment Function seems to work fine (no segfaults) even though it's virtually the same code... I'm assuming it has to do with the fact that both objects are already initialized *before* the assignment takes place?
//This seems to work ok
Node node1;
Node node2;
node2 = node1;
I've been at this bug for a couple of hours and I have got to get some rest. I'd really appreciate any insight into this. Thanks. | 0 |
11,734,801 | 07/31/2012 07:01:14 | 610,094 | 02/09/2011 16:41:48 | 714 | 22 | Yii CDbCriteria sql | I'm developing Yii powered application. I want to convert this SQL:
SELECT m.sendDate, m.status, c.name, c.email, mt.name, mt.subject, CONCAT( op.firstName, ' ', op.lastName ) operator
FROM `mail` m, client c, mailTemplate mt, operator op
WHERE m.customerID = c.id
AND m.operatorID = op.id
AND m.templateID = mt.id
AND c.name LIKE '%L%'
AND c.email LIKE '%@gmail.com%'
AND m.sendDate < '2012-07-31'
AND m.sendDate > '2012-06-30'
into CDBcriteria but don't know how.
| php | yii | yii-db | null | null | null | open | Yii CDbCriteria sql
===
I'm developing Yii powered application. I want to convert this SQL:
SELECT m.sendDate, m.status, c.name, c.email, mt.name, mt.subject, CONCAT( op.firstName, ' ', op.lastName ) operator
FROM `mail` m, client c, mailTemplate mt, operator op
WHERE m.customerID = c.id
AND m.operatorID = op.id
AND m.templateID = mt.id
AND c.name LIKE '%L%'
AND c.email LIKE '%@gmail.com%'
AND m.sendDate < '2012-07-31'
AND m.sendDate > '2012-06-30'
into CDBcriteria but don't know how.
| 0 |
11,734,803 | 07/31/2012 07:01:25 | 1,550,847 | 07/25/2012 07:29:49 | 16 | 0 | Load an image from assets folder | I am trying to load an image from the asset folder and then set it to an imageview. I know it's much better if I use the R.id.*** for this, but the premise is I don't know the id of the image. Basically, I'm trying to dynamically load the image via its filename.
For example, I randomly retrieve an element in the database representing let's say a 'cow', now what my application would do is to display an image of a 'cow' via the imageview. This is also true for all element in the database. (The assumption is, for every element there is an equivalent image)
thanks in advance.
**EDIT**
forgot the question, how do I load the image from the asset folder? | android | image | asset | null | null | null | open | Load an image from assets folder
===
I am trying to load an image from the asset folder and then set it to an imageview. I know it's much better if I use the R.id.*** for this, but the premise is I don't know the id of the image. Basically, I'm trying to dynamically load the image via its filename.
For example, I randomly retrieve an element in the database representing let's say a 'cow', now what my application would do is to display an image of a 'cow' via the imageview. This is also true for all element in the database. (The assumption is, for every element there is an equivalent image)
thanks in advance.
**EDIT**
forgot the question, how do I load the image from the asset folder? | 0 |
11,734,805 | 07/31/2012 07:01:34 | 1,323,716 | 04/10/2012 09:48:31 | 5 | 0 | send a request to a distant server | Hello to all and everyone,
I have an access on a site data information concerning legal companies.
I want to display this information on my site, to exploit them. They told me to use xmlrequest but I do not know how to actually submit the Siret number and retrieve the information
I have been told that it was a type system getdata.
they gave me a sample query
<xmlrequest>
<header>
<username>demo</username>
<password>********</password>
<operation>getcompanyinformation</operation>
<language>EN</language>
<country>FR</country>
<chargereference>[Demonstration.aspx]</chargereference>
</header>
<body>
<package>standard</package>
<companynumber>NUMERO SIRET</companynumber>
</body>
</xmlrequest>
I put this code on a page .xml
but when I load it in the browser , it just display the text without xml tags.
So i do not know how to send the message to thge server and to receive the response.
Thanks verry much for your help.
Kind Regards | xml | soap | data | null | null | null | open | send a request to a distant server
===
Hello to all and everyone,
I have an access on a site data information concerning legal companies.
I want to display this information on my site, to exploit them. They told me to use xmlrequest but I do not know how to actually submit the Siret number and retrieve the information
I have been told that it was a type system getdata.
they gave me a sample query
<xmlrequest>
<header>
<username>demo</username>
<password>********</password>
<operation>getcompanyinformation</operation>
<language>EN</language>
<country>FR</country>
<chargereference>[Demonstration.aspx]</chargereference>
</header>
<body>
<package>standard</package>
<companynumber>NUMERO SIRET</companynumber>
</body>
</xmlrequest>
I put this code on a page .xml
but when I load it in the browser , it just display the text without xml tags.
So i do not know how to send the message to thge server and to receive the response.
Thanks verry much for your help.
Kind Regards | 0 |
11,734,807 | 07/31/2012 07:01:35 | 1,564,928 | 07/31/2012 06:56:08 | 1 | 0 | How can I change change the message type to a web link url in wxpython balloontip | How can I change change the message type to a web link url in wxpython balloontip ,which enable user clicking to open the link | wxpython | null | null | null | null | null | open | How can I change change the message type to a web link url in wxpython balloontip
===
How can I change change the message type to a web link url in wxpython balloontip ,which enable user clicking to open the link | 0 |
11,734,816 | 07/31/2012 07:02:23 | 1,472,013 | 06/21/2012 11:57:42 | 1 | 0 | Missing parameter values - Crystal Reports (ASP.NET) | I get this error on ASP.Net page when i make a call to view the report. My code is as follows:
public static void WriteReportContentToPDF(HttpResponse Response, ReportDocument reportDoc)
{
//try
//{
MemoryStream oStream; // using System.IO
oStream = (MemoryStream)reportDoc.ExportToStream((CrystalDecisions.Shared.ExportFormatType.PortableDocFormat));
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
//}
//catch (Exception ex)
//{
//throw ex;
//} QLC Debug
} | asp.net | null | null | null | null | null | open | Missing parameter values - Crystal Reports (ASP.NET)
===
I get this error on ASP.Net page when i make a call to view the report. My code is as follows:
public static void WriteReportContentToPDF(HttpResponse Response, ReportDocument reportDoc)
{
//try
//{
MemoryStream oStream; // using System.IO
oStream = (MemoryStream)reportDoc.ExportToStream((CrystalDecisions.Shared.ExportFormatType.PortableDocFormat));
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
//}
//catch (Exception ex)
//{
//throw ex;
//} QLC Debug
} | 0 |
11,594,627 | 07/21/2012 18:02:13 | 1,476,949 | 06/23/2012 14:44:57 | 17 | 0 | Do mapping between xml:base attribute and other node values of a xml file using XSLT 1.0 | I am having a xml document like below,
<chapter xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="chapter1">
<title>First chapter</title>
<section xml:id="section1">
<imageobject>
<imagedata fileref="images/image1.jpg"/>
</imageobject>
</section>
<chapter xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="chapter2" xml:base="../foder1/section2.xml">
<section xml:id="section2">
<imageobject>
<imagedata fileref="images/image2.jpg"/>
</imageobject>
<imageobject>
<imagedata fileref="images/image3.jpg"/>
</imageobject>
</section>
</chapter>
<chapter xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="chapter3" xml:base="../folder3/section3.xml">
<section xml:id="section3">
<imageobject>
<imagedata fileref="images/image4.jpg"/>
</imageobject>
</section>
</chapter>
</chapter>
As in file, there are relative paths to the images in each xincluded file. I want to get the absolute path of the image. For that I am going to combine xml:base value of each chapter with the relative image paths in that chapter. Then I can get all absolute paths to images in each chapter. For that purpose I used following XSLT 1.o file.
<xsl:template match="/">
<imagepaths>
<xsl:for-each select="chapter/chapter">
<basepath>
<xsl:value-of select="@xml:base"/>
</basepath>
</xsl:for-each>
<xsl:apply-templates select="*" />
</image-paths>
</xsl:template>
<xsl:template match="*">
<xsl:apply-templates select="*" />
</xsl:template>
<xsl:template match="imagedata">
<relativepath>
<xsl:value-of select="@fileref" />
</realtivepath>
</xsl:template>
</xsl:stylesheet>
But this gives all xml:base values and relative paths separately. It does not provide any mapping between xml:base value of each chapter and relative paths in that chapter. I want to have a mapping between xml:base value and all relative paths in that chapter. How I this mapping should do? I think by having output like below, I can do the mapping and get the absolute path of images. Please help me to get following output with my XSLT
<Imagedata>
<chapter>
<basepath>../foder1/section2.xml</basepath>
<relativepath>images/image2.jpg</relativepath>
<relativepath>images/image3.jpg</relativepath>
</chapter>
<chapter>
<basepath>../foder3/section3.xml</basepath>
<relativepath>images/image4.jpg</relativepath>
</chapter>
Thanks in advance..!!
| xml | xslt | xinclude | null | null | null | open | Do mapping between xml:base attribute and other node values of a xml file using XSLT 1.0
===
I am having a xml document like below,
<chapter xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="chapter1">
<title>First chapter</title>
<section xml:id="section1">
<imageobject>
<imagedata fileref="images/image1.jpg"/>
</imageobject>
</section>
<chapter xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="chapter2" xml:base="../foder1/section2.xml">
<section xml:id="section2">
<imageobject>
<imagedata fileref="images/image2.jpg"/>
</imageobject>
<imageobject>
<imagedata fileref="images/image3.jpg"/>
</imageobject>
</section>
</chapter>
<chapter xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="chapter3" xml:base="../folder3/section3.xml">
<section xml:id="section3">
<imageobject>
<imagedata fileref="images/image4.jpg"/>
</imageobject>
</section>
</chapter>
</chapter>
As in file, there are relative paths to the images in each xincluded file. I want to get the absolute path of the image. For that I am going to combine xml:base value of each chapter with the relative image paths in that chapter. Then I can get all absolute paths to images in each chapter. For that purpose I used following XSLT 1.o file.
<xsl:template match="/">
<imagepaths>
<xsl:for-each select="chapter/chapter">
<basepath>
<xsl:value-of select="@xml:base"/>
</basepath>
</xsl:for-each>
<xsl:apply-templates select="*" />
</image-paths>
</xsl:template>
<xsl:template match="*">
<xsl:apply-templates select="*" />
</xsl:template>
<xsl:template match="imagedata">
<relativepath>
<xsl:value-of select="@fileref" />
</realtivepath>
</xsl:template>
</xsl:stylesheet>
But this gives all xml:base values and relative paths separately. It does not provide any mapping between xml:base value of each chapter and relative paths in that chapter. I want to have a mapping between xml:base value and all relative paths in that chapter. How I this mapping should do? I think by having output like below, I can do the mapping and get the absolute path of images. Please help me to get following output with my XSLT
<Imagedata>
<chapter>
<basepath>../foder1/section2.xml</basepath>
<relativepath>images/image2.jpg</relativepath>
<relativepath>images/image3.jpg</relativepath>
</chapter>
<chapter>
<basepath>../foder3/section3.xml</basepath>
<relativepath>images/image4.jpg</relativepath>
</chapter>
Thanks in advance..!!
| 0 |
11,594,628 | 07/21/2012 18:02:24 | 1,504,940 | 07/05/2012 18:54:29 | 19 | 0 | any easy and reliable java API than SMSLib for sending sms? | I want to send sms from my java web application using SMSLib. I followed installation process from http://smslib.org/doc/installation/. but it showing following:
Modem Information:
Manufacturer: Nokia
Model: C2-03
Serial No: 359035041473748
SIM IMSI: ** MASKED **
Signal Level: 1 dBm
Battery Level: 34%
===============================================================================
<< OutboundMessage >>
-------------------------------------------------------------------------------
Gateway Id: *
Message Id: 0
Message UUID: 148a9e1e-9fa9-4bde-8c9c-fc0f8f4deecd
Encoding: 7-bit
Date: Sat Jul 21 23:50:29 ALMT 2012
SMSC Ref No: null
Recipient: +8801719057995
Dispatch Date: null
Message Status: FAILED
Failure Cause: UNKNOWN
Validity Period (Hours): -1
Status Report: false
Source / Destination Ports: -1 / -1
Flash SMS: false
Text: call me, sanchoy
PDU data: E3309B0D6A9759A079D83D46BFF3
Scheduled Delivery: null
if anybody help me by any code or information of java API, i really appreciate.
| java | sms-gateway | null | null | null | null | open | any easy and reliable java API than SMSLib for sending sms?
===
I want to send sms from my java web application using SMSLib. I followed installation process from http://smslib.org/doc/installation/. but it showing following:
Modem Information:
Manufacturer: Nokia
Model: C2-03
Serial No: 359035041473748
SIM IMSI: ** MASKED **
Signal Level: 1 dBm
Battery Level: 34%
===============================================================================
<< OutboundMessage >>
-------------------------------------------------------------------------------
Gateway Id: *
Message Id: 0
Message UUID: 148a9e1e-9fa9-4bde-8c9c-fc0f8f4deecd
Encoding: 7-bit
Date: Sat Jul 21 23:50:29 ALMT 2012
SMSC Ref No: null
Recipient: +8801719057995
Dispatch Date: null
Message Status: FAILED
Failure Cause: UNKNOWN
Validity Period (Hours): -1
Status Report: false
Source / Destination Ports: -1 / -1
Flash SMS: false
Text: call me, sanchoy
PDU data: E3309B0D6A9759A079D83D46BFF3
Scheduled Delivery: null
if anybody help me by any code or information of java API, i really appreciate.
| 0 |
11,594,634 | 07/21/2012 18:03:13 | 841,833 | 07/13/2011 01:35:04 | 410 | 1 | qt widget position | I have a main window with a grid layout and have 8 buttons in 2 rows.
---------------------
| |
| 1 2 3 4 |
| |
| |
| 5 6 7 8 |
| |
---------------------
I'm trying to show a popup dialog next to the button that was clicked. So, I'm trying to get the coordinates of the button in the slot connected to `clicked()` signal.
I have tried
QPoint p = btn->pos();
and
QPoint p = btn->geometry().topLeft();
and both are (0, 0) for some reason. How can I obtain the position of the button that was clicked in this slot?
Thanks
| c++ | qt | position | null | null | null | open | qt widget position
===
I have a main window with a grid layout and have 8 buttons in 2 rows.
---------------------
| |
| 1 2 3 4 |
| |
| |
| 5 6 7 8 |
| |
---------------------
I'm trying to show a popup dialog next to the button that was clicked. So, I'm trying to get the coordinates of the button in the slot connected to `clicked()` signal.
I have tried
QPoint p = btn->pos();
and
QPoint p = btn->geometry().topLeft();
and both are (0, 0) for some reason. How can I obtain the position of the button that was clicked in this slot?
Thanks
| 0 |
11,594,635 | 07/21/2012 18:03:15 | 748,172 | 05/11/2011 07:16:19 | 1 | 0 | how to store & retrive a link in database in rails? | Dear Friends,
I have question and answers functionality in rails, here answer field as a text area. When any user enter or paste any link(website answer) in that answer field. I want to display as a link while displaying results.
Thanks in Advance,
Prasad. | ruby | ruby-on-rails-3 | activerecord | null | null | 07/22/2012 21:47:06 | not a real question | how to store & retrive a link in database in rails?
===
Dear Friends,
I have question and answers functionality in rails, here answer field as a text area. When any user enter or paste any link(website answer) in that answer field. I want to display as a link while displaying results.
Thanks in Advance,
Prasad. | 1 |
11,594,639 | 07/21/2012 18:03:42 | 457,172 | 09/24/2010 10:44:36 | 1,809 | 1 | Android: stopSelf in android service doesn't give a chance for onLocationChanged to fire before exiting | I have setup a service that basically runs every 15 mintues and does a requestLocationUpdates on the GPS provider. I have the listener setup in the service.
Now when the method onStartCommand comes to an end i do a stopSelf as i wish the service to terminate as i know in another 15 minutes it will launch again using the AlarmManager.
But the service quits before the listen event arrives with the location information.
If i comment out the stopSelf that the location is received.
How do i get the service to wait until the location is received. I thought about putting the stopSelf in the event of the onLocationChanged but it may not always fire.
THe other way i though of was implementing a thread sleep, but this feels like code smell
Any pointers really appreciated
Thanks | android | android-service | locationmanager | null | null | null | open | Android: stopSelf in android service doesn't give a chance for onLocationChanged to fire before exiting
===
I have setup a service that basically runs every 15 mintues and does a requestLocationUpdates on the GPS provider. I have the listener setup in the service.
Now when the method onStartCommand comes to an end i do a stopSelf as i wish the service to terminate as i know in another 15 minutes it will launch again using the AlarmManager.
But the service quits before the listen event arrives with the location information.
If i comment out the stopSelf that the location is received.
How do i get the service to wait until the location is received. I thought about putting the stopSelf in the event of the onLocationChanged but it may not always fire.
THe other way i though of was implementing a thread sleep, but this feels like code smell
Any pointers really appreciated
Thanks | 0 |
11,594,630 | 07/21/2012 18:02:40 | 435,276 | 08/30/2010 19:21:25 | 113 | 2 | c#: how to pass method as a parameter for another method | I need to examine in "parent" object is there an acceptable at a definite moment to call some method in the "child". For example, parent object (component) includes child objects (or component parts in other words) and parent is disposing now, so all (or particlar) child activities must be prohibited (i.e. starting new service threads, enqueueing new client requests, ...).
public class Parent
{
public bool IsMethodCallAcceptable(reference_to_method) {...}
}
public class Child
{
public int SomeMethod(int intArg, string stringArg)
{
if(!_parent.IsMethodCallAcceptable(reference_to_SomeMethod_with_actual_args))
throw new ...
...
}
private void AnotherMethod(string param = null) {...}
{
if(!_parent.IsMethodCallAcceptable(reference_to_AnotherMethod_with_actual_args))
throw new ...
...
}
private Guid ThirdMethod()
{
if(!_parent.IsMethodCallAcceptable(reference_to_ThirdMethod))
throw new ...
...
}
}
Is there any way to do it? | c# | null | null | null | null | null | open | c#: how to pass method as a parameter for another method
===
I need to examine in "parent" object is there an acceptable at a definite moment to call some method in the "child". For example, parent object (component) includes child objects (or component parts in other words) and parent is disposing now, so all (or particlar) child activities must be prohibited (i.e. starting new service threads, enqueueing new client requests, ...).
public class Parent
{
public bool IsMethodCallAcceptable(reference_to_method) {...}
}
public class Child
{
public int SomeMethod(int intArg, string stringArg)
{
if(!_parent.IsMethodCallAcceptable(reference_to_SomeMethod_with_actual_args))
throw new ...
...
}
private void AnotherMethod(string param = null) {...}
{
if(!_parent.IsMethodCallAcceptable(reference_to_AnotherMethod_with_actual_args))
throw new ...
...
}
private Guid ThirdMethod()
{
if(!_parent.IsMethodCallAcceptable(reference_to_ThirdMethod))
throw new ...
...
}
}
Is there any way to do it? | 0 |
11,594,640 | 07/21/2012 18:03:47 | 181,970 | 09/30/2009 16:32:22 | 176 | 3 | Some bottleneck OS resource | Having a simple MFC application with web browser controller that navigates to some site and then to another one on and on.
Using a powerfull machine (16 cores and lots of memory) OS is Server 2008 R2.
I can see when launching my app over 30 instances I'm getting the OS UI (each window including my app, mspaint, taskmgr etc..) become very sluggish and slow.
I have monitored the machine resources (CPU, memory and GDI objects) but it seems that all of them are not even close to be in some level of stress.
What is the problematic resource that influence the machine in such way?
10x,
Guy | windows | resources | operating-system | windows-server-2008 | webbrowser-control | null | open | Some bottleneck OS resource
===
Having a simple MFC application with web browser controller that navigates to some site and then to another one on and on.
Using a powerfull machine (16 cores and lots of memory) OS is Server 2008 R2.
I can see when launching my app over 30 instances I'm getting the OS UI (each window including my app, mspaint, taskmgr etc..) become very sluggish and slow.
I have monitored the machine resources (CPU, memory and GDI objects) but it seems that all of them are not even close to be in some level of stress.
What is the problematic resource that influence the machine in such way?
10x,
Guy | 0 |
2,669,719 | 04/19/2010 18:04:32 | 142,321 | 07/21/2009 20:40:30 | 81 | 2 | operator not defined for System.Data.SqlClient.SqlConnection and System.Data.SqlClient.SqlConnection | i hope i'm just doing something wrong here.
Ideally i'm trying to open the connection, open a transaction
execute a ton of prebuilt sqlstatements (with parameters) against this connection
then close the connection. ideally all in the same batch.
i'd like to use the forEach function of the list generic to set the connection as it'll probably be faster than my implementation of calling List.Item(i) but i get some strange errors
Dim sqlStatements As List(Of SqlCommand) = New List(Of SqlCommand)
Dim conn As SqlClient.SqlConnection = New SqlConnection("...")
sqlStatements.Item(0).Connection = conn
'Works
sqlStatements.ForEach(Function(ByRef cmd As SqlCommand) cmd.Connection = conn)
'ERROR: Operator '=' is not defined for types
'System.Data.SqlClient.SqlConnection'
'and 'System.Data.SqlClient.SqlConnection
| vb.net | .net | null | null | null | null | open | operator not defined for System.Data.SqlClient.SqlConnection and System.Data.SqlClient.SqlConnection
===
i hope i'm just doing something wrong here.
Ideally i'm trying to open the connection, open a transaction
execute a ton of prebuilt sqlstatements (with parameters) against this connection
then close the connection. ideally all in the same batch.
i'd like to use the forEach function of the list generic to set the connection as it'll probably be faster than my implementation of calling List.Item(i) but i get some strange errors
Dim sqlStatements As List(Of SqlCommand) = New List(Of SqlCommand)
Dim conn As SqlClient.SqlConnection = New SqlConnection("...")
sqlStatements.Item(0).Connection = conn
'Works
sqlStatements.ForEach(Function(ByRef cmd As SqlCommand) cmd.Connection = conn)
'ERROR: Operator '=' is not defined for types
'System.Data.SqlClient.SqlConnection'
'and 'System.Data.SqlClient.SqlConnection
| 0 |
11,430,607 | 07/11/2012 10:24:59 | 393,473 | 07/16/2010 04:37:46 | 541 | 29 | WCF CommunicationException | I am using WCF service in a web application. Two services are and one method `which returns string` is there in first and returns a `DataTable` in second
`First one is working properly` while i am calling through the service.
But `while calling second one` i get the following `exception`
![enter image description here][1]
[1]: http://i.stack.imgur.com/6CcQO.png
Here is the config in server
> <system.serviceModel>
> <bindings>
> <wsHttpBinding>
> <binding name="wsHttpBindingSettings" maxReceivedMessageSize="2147483647">
> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
> maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
> </binding>
> </wsHttpBinding>
> </bindings> <services>
> <service behaviorConfiguration="ServiceBehavior" name="WCFLibrary.Users">
> <endpoint address="" binding="wsHttpBinding" contract="IRmtService.IUser">
> <identity>
> <dns value="192.168.50.35"/>
> </identity>
> </endpoint>
> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service>
>
> <service behaviorConfiguration="ServiceBehavior" name="RmtUsers.Menu">
> <endpoint address="" binding="wsHttpBinding" contract="IRmtUsers.IMenu">
> <identity>
> <dns value="192.168.50.35"/>
> </identity>
> </endpoint>
> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
> </service>
>
> <service behaviorConfiguration="ServiceBehavior" name="RmtUsers.Product">
> <endpoint address="" binding="wsHttpBinding" contract="IRmtUsers.IProduct">
> <identity>
> <dns value="192.168.50.35"/>
> </identity>
> </endpoint>
> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
> </service>
> </services>
> <behaviors> <serviceBehaviors>
> <behavior name="ServiceBehavior">
> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before
> deployment -->
> <serviceMetadata httpGetEnabled="true"/>
> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment
> to avoid disclosing exception information -->
> <serviceDebug includeExceptionDetailInFaults="true"/>
> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>
In the client
> <bindings>
> <wsHttpBinding>
> <binding name="WSHttpBinding_IMenu" closeTimeout="00:01:00" openTimeout="00:01:00"
> receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
> transactionFlow="false" hostNameComparisonMode="StrongWildcard"
> maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
> textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
> <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
> maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
> <reliableSession ordered="true" inactivityTimeout="00:10:00"
> enabled="false" />
> <security mode="Message">
> <transport clientCredentialType="Windows" proxyCredentialType="None"
> realm="" />
> <message clientCredentialType="Windows" negotiateServiceCredential="true"
> algorithmSuite="Default" />
> </security>
> </binding>
> <binding name="WSHttpBinding_IProduct" closeTimeout="00:10:00"
> openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
> bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
> maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
> textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
> maxBytesPerRead="4096" maxNameTableCharCount="16384" />
> <reliableSession ordered="true" inactivityTimeout="00:10:00"
> enabled="false" />
> <security mode="Message">
> <transport clientCredentialType="Windows" proxyCredentialType="None"
> realm="" />
> <message clientCredentialType="Windows" negotiateServiceCredential="true"
> algorithmSuite="Default" />
> </security>
> </binding>
>
> <client>
> <endpoint address="http://t2.ipixsolutions.net/Services/Users/MenuService.svc"
> binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMenu"
> contract="MenuService.IMenu" name="WSHttpBinding_IMenu">
> <identity>
> <dns value="192.168.50.35" />
> </identity>
> </endpoint>
> <endpoint address="http://t2.ipixsolutions.net/Services/Production/ProductService.svc"
> binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IProduct"
> contract="ProductService.IProduct" name="WSHttpBinding_IProduct">
> <identity>
> <dns value="192.168.50.35" />
> </identity>
> </endpoint> </client> | wcf | exception | null | null | null | null | open | WCF CommunicationException
===
I am using WCF service in a web application. Two services are and one method `which returns string` is there in first and returns a `DataTable` in second
`First one is working properly` while i am calling through the service.
But `while calling second one` i get the following `exception`
![enter image description here][1]
[1]: http://i.stack.imgur.com/6CcQO.png
Here is the config in server
> <system.serviceModel>
> <bindings>
> <wsHttpBinding>
> <binding name="wsHttpBindingSettings" maxReceivedMessageSize="2147483647">
> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
> maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
> </binding>
> </wsHttpBinding>
> </bindings> <services>
> <service behaviorConfiguration="ServiceBehavior" name="WCFLibrary.Users">
> <endpoint address="" binding="wsHttpBinding" contract="IRmtService.IUser">
> <identity>
> <dns value="192.168.50.35"/>
> </identity>
> </endpoint>
> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service>
>
> <service behaviorConfiguration="ServiceBehavior" name="RmtUsers.Menu">
> <endpoint address="" binding="wsHttpBinding" contract="IRmtUsers.IMenu">
> <identity>
> <dns value="192.168.50.35"/>
> </identity>
> </endpoint>
> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
> </service>
>
> <service behaviorConfiguration="ServiceBehavior" name="RmtUsers.Product">
> <endpoint address="" binding="wsHttpBinding" contract="IRmtUsers.IProduct">
> <identity>
> <dns value="192.168.50.35"/>
> </identity>
> </endpoint>
> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
> </service>
> </services>
> <behaviors> <serviceBehaviors>
> <behavior name="ServiceBehavior">
> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before
> deployment -->
> <serviceMetadata httpGetEnabled="true"/>
> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment
> to avoid disclosing exception information -->
> <serviceDebug includeExceptionDetailInFaults="true"/>
> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel>
In the client
> <bindings>
> <wsHttpBinding>
> <binding name="WSHttpBinding_IMenu" closeTimeout="00:01:00" openTimeout="00:01:00"
> receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
> transactionFlow="false" hostNameComparisonMode="StrongWildcard"
> maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
> textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
> <readerQuotas maxDepth="32" maxStringContentLength="2147483647"
> maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
> <reliableSession ordered="true" inactivityTimeout="00:10:00"
> enabled="false" />
> <security mode="Message">
> <transport clientCredentialType="Windows" proxyCredentialType="None"
> realm="" />
> <message clientCredentialType="Windows" negotiateServiceCredential="true"
> algorithmSuite="Default" />
> </security>
> </binding>
> <binding name="WSHttpBinding_IProduct" closeTimeout="00:10:00"
> openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
> bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
> maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
> textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
> maxBytesPerRead="4096" maxNameTableCharCount="16384" />
> <reliableSession ordered="true" inactivityTimeout="00:10:00"
> enabled="false" />
> <security mode="Message">
> <transport clientCredentialType="Windows" proxyCredentialType="None"
> realm="" />
> <message clientCredentialType="Windows" negotiateServiceCredential="true"
> algorithmSuite="Default" />
> </security>
> </binding>
>
> <client>
> <endpoint address="http://t2.ipixsolutions.net/Services/Users/MenuService.svc"
> binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMenu"
> contract="MenuService.IMenu" name="WSHttpBinding_IMenu">
> <identity>
> <dns value="192.168.50.35" />
> </identity>
> </endpoint>
> <endpoint address="http://t2.ipixsolutions.net/Services/Production/ProductService.svc"
> binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IProduct"
> contract="ProductService.IProduct" name="WSHttpBinding_IProduct">
> <identity>
> <dns value="192.168.50.35" />
> </identity>
> </endpoint> </client> | 0 |
11,430,609 | 07/11/2012 10:25:11 | 423,574 | 07/14/2009 11:28:03 | 16 | 1 | SMTP Email hangs in Queue folder until machine is logged off | We have a XP machine which is being used as schedule job platform. There are many schedule jobs deployed on this machine. Most of the schedule jobs do send email alert regarding the status of job.
In order to send the email, we have setup SMTP on it. It happens that if anyone is logged-in to that machine, then emails generated by schedule jobs are not sent. They just pile in the Queue folder under the Mailroot.
When the logged-in user log off from the machine, mails start coming up.
Why is it not able to send the emails if someone is logging? Is there anyway through which it can be configured to send email irrespective of anyone logged in.
| smtp | null | null | null | null | null | open | SMTP Email hangs in Queue folder until machine is logged off
===
We have a XP machine which is being used as schedule job platform. There are many schedule jobs deployed on this machine. Most of the schedule jobs do send email alert regarding the status of job.
In order to send the email, we have setup SMTP on it. It happens that if anyone is logged-in to that machine, then emails generated by schedule jobs are not sent. They just pile in the Queue folder under the Mailroot.
When the logged-in user log off from the machine, mails start coming up.
Why is it not able to send the emails if someone is logging? Is there anyway through which it can be configured to send email irrespective of anyone logged in.
| 0 |
11,430,611 | 07/11/2012 10:25:16 | 1,517,413 | 07/11/2012 10:12:07 | 1 | 0 | program to convert sheet1(excel) into standard sheet2(excel) | Is it possible to have a program that change the order of columns in sheet1(excel) based on a table in standard sheet2(excel).Sheet1 have the same header of each column as sheet2 but the position of column is not same? Finally i have to store the standard sheet into the database. | php | c++ | excel | null | null | null | open | program to convert sheet1(excel) into standard sheet2(excel)
===
Is it possible to have a program that change the order of columns in sheet1(excel) based on a table in standard sheet2(excel).Sheet1 have the same header of each column as sheet2 but the position of column is not same? Finally i have to store the standard sheet into the database. | 0 |
11,430,594 | 07/11/2012 10:24:27 | 1,481,981 | 06/26/2012 07:34:27 | 1 | 0 | query within another query to join to tables | i have 2 tables mstEmp & dailyattendance now i want to run a query
"SELECT mstEmp.empname, dailyattendance.InTime, dailyattendance.OutTime, mstEmp.teamtype FROM dailyattendance ,mstEmp mstEmp where dailyattendance.HolderName IN (select mstEmp.empname from mstEmp where mstEmp.teamtype='$chk' )
here teamtype is matched and corresponding names are fetched from mstEmp and then matched with dailyattendance.HolderName to display the result. | mysql | query | null | null | null | null | open | query within another query to join to tables
===
i have 2 tables mstEmp & dailyattendance now i want to run a query
"SELECT mstEmp.empname, dailyattendance.InTime, dailyattendance.OutTime, mstEmp.teamtype FROM dailyattendance ,mstEmp mstEmp where dailyattendance.HolderName IN (select mstEmp.empname from mstEmp where mstEmp.teamtype='$chk' )
here teamtype is matched and corresponding names are fetched from mstEmp and then matched with dailyattendance.HolderName to display the result. | 0 |
11,430,597 | 07/11/2012 10:24:31 | 492,372 | 10/30/2010 20:02:03 | 522 | 4 | Is it possible to use a support vector machine in combination with agglomerative clusterer? | Is it possible to use support vector machine in combination with a clustering algorithm somehow? What is a sample use-case where both of them need to communicate with each other?
Thanks
Abhishek S | machine-learning | data-mining | svm | hierarchical-clustering | null | null | open | Is it possible to use a support vector machine in combination with agglomerative clusterer?
===
Is it possible to use support vector machine in combination with a clustering algorithm somehow? What is a sample use-case where both of them need to communicate with each other?
Thanks
Abhishek S | 0 |
11,429,317 | 07/11/2012 09:14:13 | 1,517,256 | 07/11/2012 09:08:49 | 1 | 0 | WinApi Get Window Handle of item of ComboBox | I am trying to draw something on the Items of CComboBox in WinApi.
To do this I need a handle of the window which represents the item(which contains particular item).
I have a question is this possible?
How can I do it?
Or mayby have you got another idea how to draw on particular items of ComboBox.
Przemek
| winapi | mfc | combobox | ccombobox | null | null | open | WinApi Get Window Handle of item of ComboBox
===
I am trying to draw something on the Items of CComboBox in WinApi.
To do this I need a handle of the window which represents the item(which contains particular item).
I have a question is this possible?
How can I do it?
Or mayby have you got another idea how to draw on particular items of ComboBox.
Przemek
| 0 |
11,430,617 | 07/11/2012 10:25:27 | 265,431 | 02/03/2010 16:19:15 | 322 | 5 | Active Record WHERE Query not getting a field | I am trying a "Keyword" search. I am looking in the fields ARTWORK_title and ARTWORK_keywords. The ARTWORK_keywords field is where the user can enter multiple tags to search on.
I have built a query up and feel this is the right way, But I am just not getting ARTWORK_title passed back through in the DB Query.
My PHP Function is as follows....
$my_keywords = explode(",", $search_string);
$searchfields = array('ARTWORK_title', 'ARTWORK_keywords');
$this->db->select('*');
$this->db->from('artwork');
$this->db->where('ARTWORK_status', '1');
//$where_string = '(';
foreach($my_keywords as $keyword)
{
foreach($searchfields as $field)
{
$where_string = $field . ' LIKE \'%' . $keyword . '%\' ';
}
//$where_string .= substr($where_string, 4) . ')';
$this->db->where($where_string);
}
However when profiling the SQL Query I am getting the following MySQL Query back....
> SELECT *
FROM (`artwork`)
WHERE `ARTWORK_status` = '1'
AND `ARTWORK_keywords` LIKE '%Blue%'
AND `ARTWORK_keywords` LIKE '%Orange%'
It is just not getting the ARTWORK_title field in the query at all.
Any ideas where I am going wrong?
Many Thanks in advance. | php | codeigniter | activerecord | null | null | null | open | Active Record WHERE Query not getting a field
===
I am trying a "Keyword" search. I am looking in the fields ARTWORK_title and ARTWORK_keywords. The ARTWORK_keywords field is where the user can enter multiple tags to search on.
I have built a query up and feel this is the right way, But I am just not getting ARTWORK_title passed back through in the DB Query.
My PHP Function is as follows....
$my_keywords = explode(",", $search_string);
$searchfields = array('ARTWORK_title', 'ARTWORK_keywords');
$this->db->select('*');
$this->db->from('artwork');
$this->db->where('ARTWORK_status', '1');
//$where_string = '(';
foreach($my_keywords as $keyword)
{
foreach($searchfields as $field)
{
$where_string = $field . ' LIKE \'%' . $keyword . '%\' ';
}
//$where_string .= substr($where_string, 4) . ')';
$this->db->where($where_string);
}
However when profiling the SQL Query I am getting the following MySQL Query back....
> SELECT *
FROM (`artwork`)
WHERE `ARTWORK_status` = '1'
AND `ARTWORK_keywords` LIKE '%Blue%'
AND `ARTWORK_keywords` LIKE '%Orange%'
It is just not getting the ARTWORK_title field in the query at all.
Any ideas where I am going wrong?
Many Thanks in advance. | 0 |
11,430,618 | 07/11/2012 10:25:35 | 730,651 | 04/29/2011 07:37:07 | 174 | 12 | Removing HTML tags from string except hyperlinks and line breaks? | I have strings of HTML markup along with normal text written between it, what I want to do is to remove all HTML tags except hyperlinks and line breaks so that it will look like normal notepad style text but formatted (i.e with line breaks so it remains readable) and hyperlinks to ensure all external links remain visible for user to click.
I have tried some regex solutions but they completely eliminate all HTML markup which I don't want.
Thanks. | c# | html | regex | text | remove | null | open | Removing HTML tags from string except hyperlinks and line breaks?
===
I have strings of HTML markup along with normal text written between it, what I want to do is to remove all HTML tags except hyperlinks and line breaks so that it will look like normal notepad style text but formatted (i.e with line breaks so it remains readable) and hyperlinks to ensure all external links remain visible for user to click.
I have tried some regex solutions but they completely eliminate all HTML markup which I don't want.
Thanks. | 0 |
11,430,620 | 07/11/2012 10:25:41 | 676,625 | 03/25/2011 11:41:35 | 111 | 7 | Is there any API support to make conference calls programatically in Andriod? | I would like to make a conference call by selecting some contacts from my app, is it possible? Is there any Android SDk support,any version is fine for me? Plz give some inputs.. Thanks In Advance. | android | telephonymanager | null | null | null | null | open | Is there any API support to make conference calls programatically in Andriod?
===
I would like to make a conference call by selecting some contacts from my app, is it possible? Is there any Android SDk support,any version is fine for me? Plz give some inputs.. Thanks In Advance. | 0 |
11,430,622 | 07/11/2012 10:25:46 | 1,490,290 | 06/29/2012 04:58:32 | 1 | 0 | Is it possible that I am using input and output ports directly on Raphael.js rectangle object? | I want to know that can u used Graphiti.js Input/Output ports on Raphael.js Rectangle Objects?
so that it is easy for me to get functionality for set operation. | graphiti | null | null | null | null | null | open | Is it possible that I am using input and output ports directly on Raphael.js rectangle object?
===
I want to know that can u used Graphiti.js Input/Output ports on Raphael.js Rectangle Objects?
so that it is easy for me to get functionality for set operation. | 0 |
11,430,576 | 07/11/2012 10:23:41 | 1,358,441 | 04/26/2012 10:37:05 | 53 | 2 | How to set different row height in listfield? | Here is my `listfield`
public class Custom_ListField extends ListField implements ListFieldCallback {
private Vector rows;
private LabelField titlelabel, datelabel, categorylabel;
private Bitmap bg = Bitmap.getBitmapResource("background.png"),
imagebitmap;
private Custom_ListField list;
private BitmapField image;
private Util_ImageLoader loader;
private boolean islatest;
private String imagepath[];
public Custom_ListField(String title[], String date[], String category[],
String imagepath[], boolean islatest) {
super(0, ListField.MULTI_SELECT);
setCallback(this);
Background background = BackgroundFactory.createBitmapBackground(bg);
setBackground(background);
this.islatest = islatest;
this.imagepath = imagepath;
rows = new Vector();
for (int x = 0; x < title.length; x++) {
TableRowManager row = new TableRowManager();
titlelabel = new LabelField(title[x], LabelField.USE_ALL_WIDTH
| DrawStyle.LEFT);
titlelabel.setFont(Font.getDefault().derive(Font.BOLD, 23));
row.add(titlelabel);
datelabel = new LabelField(date[x], DrawStyle.ELLIPSIS
| LabelField.USE_ALL_WIDTH | DrawStyle.LEFT);
datelabel.setFont(Font.getDefault().derive(Font.BOLD, 18));
row.add(datelabel);
if (islatest) {
categorylabel = new LabelField(category[x], DrawStyle.ELLIPSIS
| LabelField.USE_ALL_WIDTH | DrawStyle.LEFT);
categorylabel.setFont(Font.getDefault().derive(Font.BOLD, 18));
row.add(categorylabel);
}
if (!imagepath[x].toString().equals("no picture")) {
loader = new Util_ImageLoader(imagepath[x]);
imagebitmap = loader.getbitmap();
} else {
imagepath[x] = "image_base.png";
imagebitmap = Bitmap.getBitmapResource(imagepath[x]);
}
image = new BitmapField(imagebitmap, Field.FIELD_HCENTER
| Field.FIELD_VCENTER);
row.add(image);
setRowHeight( image.getBitmapHeight() + 10);
rows.addElement(row);
}
setSize(rows.size());
}
public void drawListRow(ListField listField, Graphics g, final int index, int y,
int width) {
list = (Custom_ListField) listField;
TableRowManager rowManager = (TableRowManager) list.rows
.elementAt(index);
rowManager.drawRow(g, 0, y, width, list.getRowHeight());
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
list.invalidate();
}
}, 500, true);
}
private class TableRowManager extends Manager {
public TableRowManager() {
super(0);
}
public void drawRow(Graphics g, int x, int y, int width, int height) {
layout(width, height);
setPosition(x, y);
g.pushRegion(getExtent());
subpaint(g);
g.popContext();
}
protected void sublayout(int width, int height) {
Field field = getField(0);
layoutChild(field,
getPreferredWidth() - 10 - image.getBitmapWidth(), Font
.getDefault().getHeight());
setPositionChild(field, 5, 5);
if (islatest) {
field = getField(1);
layoutChild(field, getPreferredWidth() / 5, Font.getDefault()
.getHeight());
setPositionChild(field, 5, getField(0).getHeight() + 5);
field = getField(2);
layoutChild(field, getPreferredWidth() / 10, Font.getDefault()
.getHeight());
setPositionChild(field, getField(1).getWidth(), getField(0)
.getHeight() + 5);
field = getField(3);
layoutChild(field, image.getBitmapWidth(),
image.getBitmapHeight());
setPositionChild(field,
getPreferredWidth() - 5 - image.getBitmapWidth(), 5);
} else {
field = getField(1);
layoutChild(field, getPreferredWidth() / 5, Font.getDefault()
.getHeight());
setPositionChild(field, 5, getField(0).getHeight() + 5);
field = getField(2);
layoutChild(field, 145, 85);
setPositionChild(field, getPreferredWidth() - 5
- getField(3).getWidth(), 5);
}
width = Math.min(width, getPreferredWidth());
height = Math.min(height, getPreferredHeight());
setExtent(getPreferredWidth(), getPreferredHeight());
}
public int getPreferredWidth() {
return Display.getWidth() - 10;
}
public int getPreferredHeight() {
return getRowHeight();
}
}
protected boolean navigationClick(int status, int time) {
Main.getUiApplication().pushScreen(new Main_NewsDetail());
return true;
}
public Object get(ListField listField, int index) {
return null;
}
public int getPreferredWidth(ListField listField) {
return 0;
}
public int indexOfList(ListField listField, String prefix, int start) {
return 0;
}
}
`if (!imagepath[x].toString().equals("no picture"))` I will display different image. After that i set the row height by `setRowHeight( image.getBitmapHeight() + 10);`.
It does set but it will override previous index. For example, first row is 150 and second row is 200. When display, both will display 200 instead of 150 / 200.
I tried `invalidate()` but still cannot. | blackberry | listfield | null | null | null | null | open | How to set different row height in listfield?
===
Here is my `listfield`
public class Custom_ListField extends ListField implements ListFieldCallback {
private Vector rows;
private LabelField titlelabel, datelabel, categorylabel;
private Bitmap bg = Bitmap.getBitmapResource("background.png"),
imagebitmap;
private Custom_ListField list;
private BitmapField image;
private Util_ImageLoader loader;
private boolean islatest;
private String imagepath[];
public Custom_ListField(String title[], String date[], String category[],
String imagepath[], boolean islatest) {
super(0, ListField.MULTI_SELECT);
setCallback(this);
Background background = BackgroundFactory.createBitmapBackground(bg);
setBackground(background);
this.islatest = islatest;
this.imagepath = imagepath;
rows = new Vector();
for (int x = 0; x < title.length; x++) {
TableRowManager row = new TableRowManager();
titlelabel = new LabelField(title[x], LabelField.USE_ALL_WIDTH
| DrawStyle.LEFT);
titlelabel.setFont(Font.getDefault().derive(Font.BOLD, 23));
row.add(titlelabel);
datelabel = new LabelField(date[x], DrawStyle.ELLIPSIS
| LabelField.USE_ALL_WIDTH | DrawStyle.LEFT);
datelabel.setFont(Font.getDefault().derive(Font.BOLD, 18));
row.add(datelabel);
if (islatest) {
categorylabel = new LabelField(category[x], DrawStyle.ELLIPSIS
| LabelField.USE_ALL_WIDTH | DrawStyle.LEFT);
categorylabel.setFont(Font.getDefault().derive(Font.BOLD, 18));
row.add(categorylabel);
}
if (!imagepath[x].toString().equals("no picture")) {
loader = new Util_ImageLoader(imagepath[x]);
imagebitmap = loader.getbitmap();
} else {
imagepath[x] = "image_base.png";
imagebitmap = Bitmap.getBitmapResource(imagepath[x]);
}
image = new BitmapField(imagebitmap, Field.FIELD_HCENTER
| Field.FIELD_VCENTER);
row.add(image);
setRowHeight( image.getBitmapHeight() + 10);
rows.addElement(row);
}
setSize(rows.size());
}
public void drawListRow(ListField listField, Graphics g, final int index, int y,
int width) {
list = (Custom_ListField) listField;
TableRowManager rowManager = (TableRowManager) list.rows
.elementAt(index);
rowManager.drawRow(g, 0, y, width, list.getRowHeight());
UiApplication.getUiApplication().invokeLater(new Runnable() {
public void run() {
list.invalidate();
}
}, 500, true);
}
private class TableRowManager extends Manager {
public TableRowManager() {
super(0);
}
public void drawRow(Graphics g, int x, int y, int width, int height) {
layout(width, height);
setPosition(x, y);
g.pushRegion(getExtent());
subpaint(g);
g.popContext();
}
protected void sublayout(int width, int height) {
Field field = getField(0);
layoutChild(field,
getPreferredWidth() - 10 - image.getBitmapWidth(), Font
.getDefault().getHeight());
setPositionChild(field, 5, 5);
if (islatest) {
field = getField(1);
layoutChild(field, getPreferredWidth() / 5, Font.getDefault()
.getHeight());
setPositionChild(field, 5, getField(0).getHeight() + 5);
field = getField(2);
layoutChild(field, getPreferredWidth() / 10, Font.getDefault()
.getHeight());
setPositionChild(field, getField(1).getWidth(), getField(0)
.getHeight() + 5);
field = getField(3);
layoutChild(field, image.getBitmapWidth(),
image.getBitmapHeight());
setPositionChild(field,
getPreferredWidth() - 5 - image.getBitmapWidth(), 5);
} else {
field = getField(1);
layoutChild(field, getPreferredWidth() / 5, Font.getDefault()
.getHeight());
setPositionChild(field, 5, getField(0).getHeight() + 5);
field = getField(2);
layoutChild(field, 145, 85);
setPositionChild(field, getPreferredWidth() - 5
- getField(3).getWidth(), 5);
}
width = Math.min(width, getPreferredWidth());
height = Math.min(height, getPreferredHeight());
setExtent(getPreferredWidth(), getPreferredHeight());
}
public int getPreferredWidth() {
return Display.getWidth() - 10;
}
public int getPreferredHeight() {
return getRowHeight();
}
}
protected boolean navigationClick(int status, int time) {
Main.getUiApplication().pushScreen(new Main_NewsDetail());
return true;
}
public Object get(ListField listField, int index) {
return null;
}
public int getPreferredWidth(ListField listField) {
return 0;
}
public int indexOfList(ListField listField, String prefix, int start) {
return 0;
}
}
`if (!imagepath[x].toString().equals("no picture"))` I will display different image. After that i set the row height by `setRowHeight( image.getBitmapHeight() + 10);`.
It does set but it will override previous index. For example, first row is 150 and second row is 200. When display, both will display 200 instead of 150 / 200.
I tried `invalidate()` but still cannot. | 0 |
11,430,578 | 07/11/2012 10:23:46 | 1,444,075 | 06/08/2012 08:41:00 | 3 | 0 | Response header date, always there? | I writing a client application that can communicate with a server and i need to know the current server time (to see if the client time is different).
I´m wondering. Is the response header "Date" always available? | date | header | response | null | null | null | open | Response header date, always there?
===
I writing a client application that can communicate with a server and i need to know the current server time (to see if the client time is different).
I´m wondering. Is the response header "Date" always available? | 0 |
11,373,591 | 07/07/2012 08:45:25 | 261,052 | 01/28/2010 14:28:11 | 888 | 16 | new layout vs MVC in ror | I am learning RoR, and I wanted to know if I want to make a page like google's homepage, must I use Model+Controller+view? or can I use a new Layout (this is because I dont need any DB or entity to save the search query)
Thanks | ruby-on-rails | null | null | null | null | null | open | new layout vs MVC in ror
===
I am learning RoR, and I wanted to know if I want to make a page like google's homepage, must I use Model+Controller+view? or can I use a new Layout (this is because I dont need any DB or entity to save the search query)
Thanks | 0 |
11,373,592 | 07/07/2012 08:46:11 | 1,493,386 | 06/30/2012 18:07:10 | 1 | 1 | [iOS dev]Pie chart LIKE graphic on iphone | For a project I have to represent data on something that 'looks' like a pie chart but really isn't. I have to put the data on the circle with 'pie' pieces but in varying circle width and varying transparancy.
Is there a which would let create such graphics?
This is for iOS development!
| iphone | objective-c | xcode | pie-chart | null | null | open | [iOS dev]Pie chart LIKE graphic on iphone
===
For a project I have to represent data on something that 'looks' like a pie chart but really isn't. I have to put the data on the circle with 'pie' pieces but in varying circle width and varying transparancy.
Is there a which would let create such graphics?
This is for iOS development!
| 0 |
11,370,555 | 07/06/2012 22:40:20 | 996,142 | 10/14/2011 20:47:48 | 147 | 9 | Spring-ws VS Apache cxf VS Apache Axis2 VS Metro | I need to create soap web service. I already have wsdl and interface and implementation (as pojo).
I am now choosing between subj.
I need frame work that will:
* Work as servlet in servlet container
* Require only one servlet mapping in my web.xml
* Have good spring integration (because my service implementation is spring bean)
* No require me to add annotations. I do not have annotations on my interface or implementation.
* Spring-ws: Looks cool, but as far as I understood it forces me to deal with XML directly which I do not want to do. I want framework to deserialize message and pass it as parameter to my POJO.
* Apache cxf is powerful and has spring integration, but if I use Jax-WS frontend for it I will have to use annotations, and I do not want to touch my POJO. What about simple front-end?
* Metro is Jax-WS RI, so it depends on annotations heavily.
Axis2 seems to be my choice. What would you choose?
| java | jax-ws | cxf | axis2 | spring-ws | null | open | Spring-ws VS Apache cxf VS Apache Axis2 VS Metro
===
I need to create soap web service. I already have wsdl and interface and implementation (as pojo).
I am now choosing between subj.
I need frame work that will:
* Work as servlet in servlet container
* Require only one servlet mapping in my web.xml
* Have good spring integration (because my service implementation is spring bean)
* No require me to add annotations. I do not have annotations on my interface or implementation.
* Spring-ws: Looks cool, but as far as I understood it forces me to deal with XML directly which I do not want to do. I want framework to deserialize message and pass it as parameter to my POJO.
* Apache cxf is powerful and has spring integration, but if I use Jax-WS frontend for it I will have to use annotations, and I do not want to touch my POJO. What about simple front-end?
* Metro is Jax-WS RI, so it depends on annotations heavily.
Axis2 seems to be my choice. What would you choose?
| 0 |
11,373,595 | 07/07/2012 08:46:29 | 1,204,874 | 02/12/2012 08:43:13 | 1 | 0 | Java - Implementing interface with Object argument | I was implementing a Java Graph library (to learn ...). Accordingly, I wrote an interface
public interface DigraphInterface {
public boolean isEmpty();
public int size();
public boolean isAdjacent(Object v, Object w);
public void insertEdge(Object v, Object w);
public void insertVertex(Object v);
public void eraseEdge(Object o, Object w);
public void eraseVertex(Object v);
public void printDetails();
}
As the first step towards implementing, I am writing Digraph class that implements above interface. However, to keep things simple, I want the node identifiers as integers, so I defined functions as
@Override
public boolean isAdjacent(int v, int w) {
// TODO Auto-generated method stub
return adjList[v].contains(w) || adjList[w].contains(v);
}
But, I am getting error, that I need to override or implement method with supertype. Can someone explain me the underpinnings for this behavior. Also, if someone can explain, how do we design libraries that allow flexibility to add components of any type. | java | graph | error-message | null | null | null | open | Java - Implementing interface with Object argument
===
I was implementing a Java Graph library (to learn ...). Accordingly, I wrote an interface
public interface DigraphInterface {
public boolean isEmpty();
public int size();
public boolean isAdjacent(Object v, Object w);
public void insertEdge(Object v, Object w);
public void insertVertex(Object v);
public void eraseEdge(Object o, Object w);
public void eraseVertex(Object v);
public void printDetails();
}
As the first step towards implementing, I am writing Digraph class that implements above interface. However, to keep things simple, I want the node identifiers as integers, so I defined functions as
@Override
public boolean isAdjacent(int v, int w) {
// TODO Auto-generated method stub
return adjList[v].contains(w) || adjList[w].contains(v);
}
But, I am getting error, that I need to override or implement method with supertype. Can someone explain me the underpinnings for this behavior. Also, if someone can explain, how do we design libraries that allow flexibility to add components of any type. | 0 |
11,373,597 | 07/07/2012 08:46:55 | 1,505,797 | 07/06/2012 05:15:56 | 1 | 0 | Need to convert MySQL data block for Hyperlink using PHP | I have a table being displayed that converts a file uploaded location (DocLoc) into a hyperlink. However, because the filename has spaces in it, the hyperlink drops them off. If I display the column docloc it shows
uploading/minegem/GUI-MGEM-001 Bullet Programming.pdf
However when I click the hyperlink I get
uploading/minegem/GUI-MGEM-001
How can I have the hyperlink add the rest of the filename so I can open the file from the link.
// printing table rows
while($row = mysql_fetch_array($result))
{
$docname=$row['DocName'];
$docver=$row['DocVer'];
$doctype=$row['DocType'];
$docloc=$row['DocLoc'];
echo "<tr>";
echo "<td><a href=/uploading/$docloc>$docname</a></td>";
echo "<td>$docver</td>";
echo
echo "</tr>";
}
echo "</table>";
Sorry if this is stupid, I have done a bit of googling and reading around here and I'm struggling. Only started learning PHP/MySQL/HTML about 3 days ago. | php | mysql | hyperlink | spaces | null | null | open | Need to convert MySQL data block for Hyperlink using PHP
===
I have a table being displayed that converts a file uploaded location (DocLoc) into a hyperlink. However, because the filename has spaces in it, the hyperlink drops them off. If I display the column docloc it shows
uploading/minegem/GUI-MGEM-001 Bullet Programming.pdf
However when I click the hyperlink I get
uploading/minegem/GUI-MGEM-001
How can I have the hyperlink add the rest of the filename so I can open the file from the link.
// printing table rows
while($row = mysql_fetch_array($result))
{
$docname=$row['DocName'];
$docver=$row['DocVer'];
$doctype=$row['DocType'];
$docloc=$row['DocLoc'];
echo "<tr>";
echo "<td><a href=/uploading/$docloc>$docname</a></td>";
echo "<td>$docver</td>";
echo
echo "</tr>";
}
echo "</table>";
Sorry if this is stupid, I have done a bit of googling and reading around here and I'm struggling. Only started learning PHP/MySQL/HTML about 3 days ago. | 0 |
11,373,599 | 07/07/2012 08:47:04 | 630,238 | 02/23/2011 13:08:30 | 385 | 2 | Grails application is not running after installing Grails activiti plugin | i have found grails activity plugin [Here][1] and following this [document][2] to getting started with this plugin .
on running the application after installing the plugin i am getting following error
| Running Grails application
Activiti Process Engine with Spring Security Initialization ...
Activiti Process Engine Initialization...
Configuring Spring Security Core ...
... finished configuring Spring Security Core
| Error 2012-07-07 14:02:45,500 [pool-7-thread-1] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'transactionMana
erPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tran
actionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.fac
ory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hi
ernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resol
e reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factor
.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.M
taDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionF
ctory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-164])
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.Be
nCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFac
ory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to be
n 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error cre
ting bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialec
]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed
nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.db
p.SQLNestedException: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-1
4])
Line | Method
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean propert
'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve re
erence to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationExcepti
n: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hib
rnate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init
ethod failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apac
e.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localh
st" [90067-164])
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean proper
y 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot
resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.
actory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.sup
ort.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConne
tionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-164])
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean prope
ty 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialect
etector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData
nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Conne
tion refused: connect: localhost" [90067-164])
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.
upport.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableCo
nectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-164])
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create Poolabl
ConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-164])
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by SQLNestedException: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost"
90067-164])
->> 1549 | createPoolableConnectionFactory in org.apache.commons.dbcp.BasicDataSource
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1388 | createDataSource in ''
| 1044 | getConnection in ''
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . in ''
^ 662 | run in java.lang.Thread
Caused by JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-164]
->> 329 | getJdbcSQLException in org.h2.message.DbException
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 158 | get in ''
| 397 | connectServer in org.h2.engine.SessionRemote
| 287 | connectEmbeddedOrServer in ''
| 110 | <init> . in org.h2.jdbc.JdbcConnection
| 94 | <init> in ''
| 72 | connect in org.h2.Driver
| 38 | createConnection in org.apache.commons.dbcp.DriverConnectionFactory
| 582 | makeObject in org.apache.commons.dbcp.PoolableConnectionFactory
| 1556 | validateConnectionFactory in org.apache.commons.dbcp.BasicDataSource
| 1545 | createPoolableConnectionFactory in ''
| 1388 | createDataSource in ''
| 1044 | getConnection in ''
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . in ''
^ 662 | run in java.lang.Thread
Caused by ConnectException: Connection refused: connect
->> 351 | doConnect in java.net.PlainSocketImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 213 | connectToAddress in ''
| 200 | connect in ''
| 366 | connect in java.net.SocksSocketImpl
| 529 | connect in java.net.Socket
| 119 | createSocket in org.h2.util.NetUtils
| 100 | createSocket in ''
| 93 | initTransfer in org.h2.engine.SessionRemote
| 393 | connectServer in ''
| 287 | connectEmbeddedOrServer in ''
| 110 | <init> . in org.h2.jdbc.JdbcConnection
| 94 | <init> in ''
| 72 | connect in org.h2.Driver
| 38 | createConnection in org.apache.commons.dbcp.DriverConnectionFactory
| 582 | makeObject in org.apache.commons.dbcp.PoolableConnectionFactory
| 1556 | validateConnectionFactory in org.apache.commons.dbcp.BasicDataSource
| 1545 | createPoolableConnectionFactory in ''
| 1388 | createDataSource in ''
| 1044 | getConnection in ''
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . in ''
^ 662 | run in java.lang.Thread
what causes this error? how to solve it?
[1]: http://grails.org/plugin/activiti
[2]: http://code.google.com/p/grails-activiti-plugin/
| apache | tomcat | grails | grails-plugin | activiti | null | open | Grails application is not running after installing Grails activiti plugin
===
i have found grails activity plugin [Here][1] and following this [document][2] to getting started with this plugin .
on running the application after installing the plugin i am getting following error
| Running Grails application
Activiti Process Engine with Spring Security Initialization ...
Activiti Process Engine Initialization...
Configuring Spring Security Core ...
... finished configuring Spring Security Core
| Error 2012-07-07 14:02:45,500 [pool-7-thread-1] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'transactionMana
erPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tran
actionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.fac
ory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hi
ernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resol
e reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factor
.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.M
taDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionF
ctory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-164])
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.Be
nCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFac
ory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to be
n 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error cre
ting bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialec
]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed
nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.db
p.SQLNestedException: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-1
4])
Line | Method
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean propert
'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve re
erence to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationExcepti
n: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hib
rnate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init
ethod failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apac
e.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localh
st" [90067-164])
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean proper
y 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot
resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.
actory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.sup
ort.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConne
tionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-164])
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean prope
ty 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialect
etector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData
nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Conne
tion refused: connect: localhost" [90067-164])
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.
upport.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableCo
nectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-164])
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create Poolabl
ConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-164])
->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 138 | run in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run in ''
^ 662 | run . . in java.lang.Thread
Caused by SQLNestedException: Cannot create PoolableConnectionFactory (Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost"
90067-164])
->> 1549 | createPoolableConnectionFactory in org.apache.commons.dbcp.BasicDataSource
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1388 | createDataSource in ''
| 1044 | getConnection in ''
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . in ''
^ 662 | run in java.lang.Thread
Caused by JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-164]
->> 329 | getJdbcSQLException in org.h2.message.DbException
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 158 | get in ''
| 397 | connectServer in org.h2.engine.SessionRemote
| 287 | connectEmbeddedOrServer in ''
| 110 | <init> . in org.h2.jdbc.JdbcConnection
| 94 | <init> in ''
| 72 | connect in org.h2.Driver
| 38 | createConnection in org.apache.commons.dbcp.DriverConnectionFactory
| 582 | makeObject in org.apache.commons.dbcp.PoolableConnectionFactory
| 1556 | validateConnectionFactory in org.apache.commons.dbcp.BasicDataSource
| 1545 | createPoolableConnectionFactory in ''
| 1388 | createDataSource in ''
| 1044 | getConnection in ''
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . in ''
^ 662 | run in java.lang.Thread
Caused by ConnectException: Connection refused: connect
->> 351 | doConnect in java.net.PlainSocketImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 213 | connectToAddress in ''
| 200 | connect in ''
| 366 | connect in java.net.SocksSocketImpl
| 529 | connect in java.net.Socket
| 119 | createSocket in org.h2.util.NetUtils
| 100 | createSocket in ''
| 93 | initTransfer in org.h2.engine.SessionRemote
| 393 | connectServer in ''
| 287 | connectEmbeddedOrServer in ''
| 110 | <init> . in org.h2.jdbc.JdbcConnection
| 94 | <init> in ''
| 72 | connect in org.h2.Driver
| 38 | createConnection in org.apache.commons.dbcp.DriverConnectionFactory
| 582 | makeObject in org.apache.commons.dbcp.PoolableConnectionFactory
| 1556 | validateConnectionFactory in org.apache.commons.dbcp.BasicDataSource
| 1545 | createPoolableConnectionFactory in ''
| 1388 | createDataSource in ''
| 1044 | getConnection in ''
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . in java.util.concurrent.FutureTask
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . in ''
^ 662 | run in java.lang.Thread
what causes this error? how to solve it?
[1]: http://grails.org/plugin/activiti
[2]: http://code.google.com/p/grails-activiti-plugin/
| 0 |
11,373,606 | 07/07/2012 08:47:35 | 1,508,460 | 07/07/2012 08:33:17 | 1 | 0 | Playframework 1.2.5 custom module never hit | Steps:
1. **play new-module firstmodule**
2. Updated the **play.plugins** file of the module to include
10:play.modules.firstmodule.MyPlugin
3. Create the **MyPlugin** class:
package play.modules.firstmodule;
import play.Logger;
import play.PlayPlugin;
public class MyPlugin extends PlayPlugin {
@Override
public void onLoad() {
Logger.info("hello");
}
@Override
public void onApplicationStart() {
Logger.info("hello");
}
@Override
public void onRoutesLoaded() {
Logger.info("hello");
}
}
4. **play build-module**
5. Add module to main project dependencies
require:
- play 1.2.5
- customModules -> firstmodule
repositories:
- playCustomModules:
type: local
artifact: c:\github\firstmodule\dist\firstmodule-0.1.zip
contains:
- customModules -> *
6. **play deps** resolves all dependencies correctly
7. **play run**
Server starts and I hit any page, but the log message "hello" is never printed. What gives? | module | playframework | playback | null | null | null | open | Playframework 1.2.5 custom module never hit
===
Steps:
1. **play new-module firstmodule**
2. Updated the **play.plugins** file of the module to include
10:play.modules.firstmodule.MyPlugin
3. Create the **MyPlugin** class:
package play.modules.firstmodule;
import play.Logger;
import play.PlayPlugin;
public class MyPlugin extends PlayPlugin {
@Override
public void onLoad() {
Logger.info("hello");
}
@Override
public void onApplicationStart() {
Logger.info("hello");
}
@Override
public void onRoutesLoaded() {
Logger.info("hello");
}
}
4. **play build-module**
5. Add module to main project dependencies
require:
- play 1.2.5
- customModules -> firstmodule
repositories:
- playCustomModules:
type: local
artifact: c:\github\firstmodule\dist\firstmodule-0.1.zip
contains:
- customModules -> *
6. **play deps** resolves all dependencies correctly
7. **play run**
Server starts and I hit any page, but the log message "hello" is never printed. What gives? | 0 |
11,350,824 | 07/05/2012 19:01:06 | 1,504,879 | 07/05/2012 18:27:17 | 1 | 0 | Flask-Testing module no such test method error | Coming here after trying both #python and #pocoo. I'm writing a unit test for a flask app, and wanted to test for redirection. The official flask tutorials don't have anything about that, so I tried to use this: http://packages.python.org/Flask-Testing/
Here's the code I have so far to test the tutorial application (the app code is here: https://github.com/mitsuhiko/flask/tree/master/examples/flaskr/ )
from flaskext.testing import TestCase
import flaskr
from flask import Flask
class FlaskrTest(TestCase):
def create_app(self):
app = Flask(__name__)
app.config['TESTING'] = True
return app
def test_add_entry(self, title, text):
resp = app.post('/add', data=dict(title='blah',
text='Blooh'), follow_redirects=True)
self.assertRedirects(resp, '/')
if __name__ == '__main__':
myTest = FlaskrTest()
myTest.test_add_entry()
and here's the error I'm getting:
Traceback (most recent call last):
File "flaskr_test.py", line 17, in <module>
myTest = FlaskrTest()
File "/usr/lib/python2.7/unittest/case.py", line 185, in __init__
(self.__class__, methodName))
ValueError: no such test method in <class '__main__.FlaskrTest'>: runTest
I'll appreciate any help. :)
| python | testing | flask | null | null | null | open | Flask-Testing module no such test method error
===
Coming here after trying both #python and #pocoo. I'm writing a unit test for a flask app, and wanted to test for redirection. The official flask tutorials don't have anything about that, so I tried to use this: http://packages.python.org/Flask-Testing/
Here's the code I have so far to test the tutorial application (the app code is here: https://github.com/mitsuhiko/flask/tree/master/examples/flaskr/ )
from flaskext.testing import TestCase
import flaskr
from flask import Flask
class FlaskrTest(TestCase):
def create_app(self):
app = Flask(__name__)
app.config['TESTING'] = True
return app
def test_add_entry(self, title, text):
resp = app.post('/add', data=dict(title='blah',
text='Blooh'), follow_redirects=True)
self.assertRedirects(resp, '/')
if __name__ == '__main__':
myTest = FlaskrTest()
myTest.test_add_entry()
and here's the error I'm getting:
Traceback (most recent call last):
File "flaskr_test.py", line 17, in <module>
myTest = FlaskrTest()
File "/usr/lib/python2.7/unittest/case.py", line 185, in __init__
(self.__class__, methodName))
ValueError: no such test method in <class '__main__.FlaskrTest'>: runTest
I'll appreciate any help. :)
| 0 |
11,351,223 | 07/05/2012 19:28:15 | 1,460,663 | 06/16/2012 13:14:43 | 6 | 0 | c# OpenXML - How do I set a rich text string in a content control and retain formatting | Forgive me I'm lost and bewildered!
I have a document with several Plain Text Content Controls. So far, I can enumerate the SdtElements in the document , find all the SdtBlocks of interest and replace the text as needed ok.
Next though, I have one field in RichText format that I can retrieve from a database as a string and now need to insert this into the document. I've set up a Rich Text Content Control in the document but how do I set/replace this with the rich text string and retain the proper formatting?
Just to make me more confused, when I open the document with the "Word 2007 Content Control Toolkit" it shows all the Content Controls as expected and properly identifies the one as Rich Text type. When, however, I open the document using the "Open XML SDK 2.0 Productivity Tool" it shows the rich text control as a plain simple SdtBlock that appears completely indistinguishable from the plain text content controls and the reflected code seems identical?
How then to set the RichText string in the document?
| c# | openxml | contentcontrol | richtext | null | null | open | c# OpenXML - How do I set a rich text string in a content control and retain formatting
===
Forgive me I'm lost and bewildered!
I have a document with several Plain Text Content Controls. So far, I can enumerate the SdtElements in the document , find all the SdtBlocks of interest and replace the text as needed ok.
Next though, I have one field in RichText format that I can retrieve from a database as a string and now need to insert this into the document. I've set up a Rich Text Content Control in the document but how do I set/replace this with the rich text string and retain the proper formatting?
Just to make me more confused, when I open the document with the "Word 2007 Content Control Toolkit" it shows all the Content Controls as expected and properly identifies the one as Rich Text type. When, however, I open the document using the "Open XML SDK 2.0 Productivity Tool" it shows the rich text control as a plain simple SdtBlock that appears completely indistinguishable from the plain text content controls and the reflected code seems identical?
How then to set the RichText string in the document?
| 0 |
11,351,224 | 07/05/2012 19:28:22 | 1,460,042 | 12/08/2011 07:00:11 | 178 | 17 | powershell or python for build automation | We are currently using [Psake][1] for build automation and [Pstrami][2] for deployment. Both are Powershell libraries. Other tools we use are 7zip to zip/unzip packages and [Tarantino][3] for database change management. We mostly use this to build and deploy MVC .NET applications for windows.
Build process is pretty simple:
1. Compile and Build the solution using MsBuild
2. Run NUnit tests
3. Package into zip
Deployment script is pretty simple as well:
1. Create few folders
2. Add new IIS Application
3. Create DB
4. etc.
It is all working very well. The only issue I have is Powershell; I really dislike this language. It is very painful for me to work with.
I'm reading about Python and it seems very interesting.
My questions are:
1. Can Python compete with Powershel?
2. What are the Pros and Cons of Python and Powershell and who wins?
3. I'm also curious if anyone is using Python to build and deploy
.NET applications and if you ran into any issues and thought of using anything else because of that.
Note: I have seen few similar question on SO, but could not find anything closely related to CI and Build automation.
[1]: https://github.com/psake/psake
[2]: http://pstrami.codeplex.com/
[3]: https://bitbucket.org/headspringlabs/tarantino/wiki/Home | c# | .net | python | deployment | continuous-integration | 07/08/2012 15:50:22 | not constructive | powershell or python for build automation
===
We are currently using [Psake][1] for build automation and [Pstrami][2] for deployment. Both are Powershell libraries. Other tools we use are 7zip to zip/unzip packages and [Tarantino][3] for database change management. We mostly use this to build and deploy MVC .NET applications for windows.
Build process is pretty simple:
1. Compile and Build the solution using MsBuild
2. Run NUnit tests
3. Package into zip
Deployment script is pretty simple as well:
1. Create few folders
2. Add new IIS Application
3. Create DB
4. etc.
It is all working very well. The only issue I have is Powershell; I really dislike this language. It is very painful for me to work with.
I'm reading about Python and it seems very interesting.
My questions are:
1. Can Python compete with Powershel?
2. What are the Pros and Cons of Python and Powershell and who wins?
3. I'm also curious if anyone is using Python to build and deploy
.NET applications and if you ran into any issues and thought of using anything else because of that.
Note: I have seen few similar question on SO, but could not find anything closely related to CI and Build automation.
[1]: https://github.com/psake/psake
[2]: http://pstrami.codeplex.com/
[3]: https://bitbucket.org/headspringlabs/tarantino/wiki/Home | 4 |
11,351,225 | 07/05/2012 19:28:22 | 110,807 | 05/21/2009 23:11:22 | 28 | 1 | Automated testing of a WebStart program using ABBOT & COSTELLO | I have a tricky one here.
We have this huge Desktop-like WebStart application in our company and now we are trying to create automated tests for it.
Since our applications GUI is not fully implemented using Swing or AWT we have trouble to test it using tools like JUnit, Jelly, UISpec4J and friends, because we can't interact with some objects like Tracks and Curves. We need to use something like Selenium, only for Swing.
The problem is that to start an automated test in Costello you need a JFrame class with a main method. But what we have is a WebStart app that starts like this:
$ javaws app.jnlp
Is there a way to load this program into a JFrame programatically ?!
Something like this.
public class JNLPWindowLoaded extends JFrame{
public JNLPWindowLoaded(String jnlpPath){
//start the app here and load it into this class
}
public static void main(String args[]){
new JNLPWindowLoaded("/home/kirill/test.jnlp");
}
}
Please give me some light over here! | java | automated-tests | jnlp | java-web-start | webstart | null | open | Automated testing of a WebStart program using ABBOT & COSTELLO
===
I have a tricky one here.
We have this huge Desktop-like WebStart application in our company and now we are trying to create automated tests for it.
Since our applications GUI is not fully implemented using Swing or AWT we have trouble to test it using tools like JUnit, Jelly, UISpec4J and friends, because we can't interact with some objects like Tracks and Curves. We need to use something like Selenium, only for Swing.
The problem is that to start an automated test in Costello you need a JFrame class with a main method. But what we have is a WebStart app that starts like this:
$ javaws app.jnlp
Is there a way to load this program into a JFrame programatically ?!
Something like this.
public class JNLPWindowLoaded extends JFrame{
public JNLPWindowLoaded(String jnlpPath){
//start the app here and load it into this class
}
public static void main(String args[]){
new JNLPWindowLoaded("/home/kirill/test.jnlp");
}
}
Please give me some light over here! | 0 |
11,351,239 | 07/05/2012 19:29:16 | 615,120 | 02/13/2011 14:38:11 | 185 | 1 | Photoshop scaling - Making it perfect | I don't know where to ask help other than stackoverflow. I'm building a web application where I need to do some design tweaks. I'm using this UI Kit http://www.icondeposit.com/design:100
Especially the problem is with the buttons. I wan't to scale that button to fit with this text "Upload your picture". But when I do it, **the shape gets differing from the actual one**. I tried **skew and distort**, but still can't make it perfect.
Is there any tricks in photoshop to transform the button to the actual shape and the size we need?
Thanks! | css | design | photoshop | null | null | 07/18/2012 14:12:00 | off topic | Photoshop scaling - Making it perfect
===
I don't know where to ask help other than stackoverflow. I'm building a web application where I need to do some design tweaks. I'm using this UI Kit http://www.icondeposit.com/design:100
Especially the problem is with the buttons. I wan't to scale that button to fit with this text "Upload your picture". But when I do it, **the shape gets differing from the actual one**. I tried **skew and distort**, but still can't make it perfect.
Is there any tricks in photoshop to transform the button to the actual shape and the size we need?
Thanks! | 2 |
11,350,785 | 07/05/2012 18:58:23 | 1,504,901 | 07/05/2012 18:37:10 | 1 | 0 | Display Image using grideview in asp.net | I try out many codes for display images in Grideview but the application gone close in emulator. Here is my code...
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final GridView ObjGrid = (GridView)findViewById(R.id.gridview);
ObjGrid.setAdapter(new ImageAdapter(this));
}
And ImageAdapter class is as above
public class ImageAdapter extends BaseAdapter {
int[] images = new int[]{
R.drawable.pic1,
R.drawable.pic2,
R.drawable.pic3,
R.drawable.pic4,
R.drawable.pic5,
R.drawable.pic6
};
private Context cont;
public ImageAdapter(Context applicationContext) {
cont = applicationContext;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return images.length;
}
@Override
public Object getItem(int arg0) {
// TODO Auto-generated method stub
return arg0;
}
@Override
public long getItemId(int arg0) {
// TODO Auto-generated method stub
return arg0;
}
@Override
public View getView(int arg0, View ConvertView, ViewGroup arg2) {
ImageView iv;
if(ConvertView == null)
{
iv = new ImageView(cont);
iv.setLayoutParams(new GridView.LayoutParams(180, 180));
iv.setScaleType(ScaleType.CENTER_CROP);
iv.setPadding(0, 8, 8, 8);
}
else
{
iv=(ImageView)ConvertView;
}
iv.setImageResource(images[arg0]);
return null;
}
}
Please give me solution, and if there is any possibility to give project file to downlode then it will be very help full to me...
Thank you | android | null | null | null | null | null | open | Display Image using grideview in asp.net
===
I try out many codes for display images in Grideview but the application gone close in emulator. Here is my code...
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final GridView ObjGrid = (GridView)findViewById(R.id.gridview);
ObjGrid.setAdapter(new ImageAdapter(this));
}
And ImageAdapter class is as above
public class ImageAdapter extends BaseAdapter {
int[] images = new int[]{
R.drawable.pic1,
R.drawable.pic2,
R.drawable.pic3,
R.drawable.pic4,
R.drawable.pic5,
R.drawable.pic6
};
private Context cont;
public ImageAdapter(Context applicationContext) {
cont = applicationContext;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return images.length;
}
@Override
public Object getItem(int arg0) {
// TODO Auto-generated method stub
return arg0;
}
@Override
public long getItemId(int arg0) {
// TODO Auto-generated method stub
return arg0;
}
@Override
public View getView(int arg0, View ConvertView, ViewGroup arg2) {
ImageView iv;
if(ConvertView == null)
{
iv = new ImageView(cont);
iv.setLayoutParams(new GridView.LayoutParams(180, 180));
iv.setScaleType(ScaleType.CENTER_CROP);
iv.setPadding(0, 8, 8, 8);
}
else
{
iv=(ImageView)ConvertView;
}
iv.setImageResource(images[arg0]);
return null;
}
}
Please give me solution, and if there is any possibility to give project file to downlode then it will be very help full to me...
Thank you | 0 |
11,472,817 | 07/13/2012 14:45:44 | 1,014,732 | 10/26/2011 14:13:10 | 16 | 0 | Refer form element with javascript | I don't understand why my javascript doesn't work... everything looks ok though...
> <form id = "lol" method="get" name="lol" action="" style="display:inline; vertical-align:middle">
> <table style="display:inline; vertical-align:middle">
> <tr>
> <td style="width:80%">
> xxx
> </td>
> <td>
> <select name="A">
> <option value="xxx">xxx</option>
> <option value="xxx">xxx</option>
> <option value="xxx">xxx</option>
> </select>
> </td>
> <td>
> <input type="submit" value="Valider"/>
> <input type="hidden" name="B" value=""/>
> <input type="hidden" name="C" value=""/>
> </td>
> </tr>
> </table>
> </form>
And my javascript:
> <script>
> var form=document.getElementById("lol");
> form.elements['A'].value="xxx";
> </script>
The form is found, but the element A is not found...
Thank you really much for your help...
| javascript | html | null | null | null | null | open | Refer form element with javascript
===
I don't understand why my javascript doesn't work... everything looks ok though...
> <form id = "lol" method="get" name="lol" action="" style="display:inline; vertical-align:middle">
> <table style="display:inline; vertical-align:middle">
> <tr>
> <td style="width:80%">
> xxx
> </td>
> <td>
> <select name="A">
> <option value="xxx">xxx</option>
> <option value="xxx">xxx</option>
> <option value="xxx">xxx</option>
> </select>
> </td>
> <td>
> <input type="submit" value="Valider"/>
> <input type="hidden" name="B" value=""/>
> <input type="hidden" name="C" value=""/>
> </td>
> </tr>
> </table>
> </form>
And my javascript:
> <script>
> var form=document.getElementById("lol");
> form.elements['A'].value="xxx";
> </script>
The form is found, but the element A is not found...
Thank you really much for your help...
| 0 |
11,472,818 | 07/13/2012 14:45:45 | 999,820 | 10/17/2011 19:08:29 | 1,052 | 71 | Best practices in PHP using $_POST and $_GET variables | Considering a project where will work more than one developer and that will receive constant update and maintenance, what of the two codes below can be considered the best practice in PHP, considering Readability and Security? If we talk in performace, the second option will be a little better, but there are ways to solve this point.
**Option 1**
$user = $_POST['user'];
$pass = $_POST['pass'];
// Prevent SQL Injection and XSS
$user = anti_injection($user);
$pass = anti_injection($pass);
if( strlen($user) <= 8 && strlen($pass) <= 12 )
{
// SQL query
$sql = "SELECT id
FROM users
WHERE username = '$user' AND password = '$pass';";
}
**Option 2**
// Retrieve POST variables and prevent SQL Injection and XSS
$_POST['user'] = anti_injection( $_POST['user'] );
$_POST['pass'] = anti_injection( $_POST['pass'] );
if( strlen($_POST['user']) <= 8 && strlen($_POST['pass']) <= 12 )
{
// SQL query
$sql = "SELECT id
FROM users
WHERE username = '" . $_POST['user']. "' AND password = '" . $_POST['pass'] . "';";
} | php | optimization | null | null | null | null | open | Best practices in PHP using $_POST and $_GET variables
===
Considering a project where will work more than one developer and that will receive constant update and maintenance, what of the two codes below can be considered the best practice in PHP, considering Readability and Security? If we talk in performace, the second option will be a little better, but there are ways to solve this point.
**Option 1**
$user = $_POST['user'];
$pass = $_POST['pass'];
// Prevent SQL Injection and XSS
$user = anti_injection($user);
$pass = anti_injection($pass);
if( strlen($user) <= 8 && strlen($pass) <= 12 )
{
// SQL query
$sql = "SELECT id
FROM users
WHERE username = '$user' AND password = '$pass';";
}
**Option 2**
// Retrieve POST variables and prevent SQL Injection and XSS
$_POST['user'] = anti_injection( $_POST['user'] );
$_POST['pass'] = anti_injection( $_POST['pass'] );
if( strlen($_POST['user']) <= 8 && strlen($_POST['pass']) <= 12 )
{
// SQL query
$sql = "SELECT id
FROM users
WHERE username = '" . $_POST['user']. "' AND password = '" . $_POST['pass'] . "';";
} | 0 |
11,472,819 | 07/13/2012 14:45:46 | 1,069,688 | 11/28/2011 16:04:51 | 1 | 0 | How to authenticate a phone app's facebook user in PHP | I've been having some annoying security problems lately.
I'm trying to determine what is the best way to achieve two goals:
1. Implement client-side facebook authentication (My client app, either whether we're talking about iOS/Android) interacts with Facebook.
2. The client-side app is communicating with my HTTP Server (which is running PHP scripts...), in order to manage the app data for the users of my app.
I'm communicating by posting JSON objects as requests, and by echoing JSON object as responses.
I'm trying to figure out what are the parameters that I should include in my JSON objects in order to be certain know that I'm actually talking to a certain facebook user in a secure way (so a potential attacker won't simply impersonate the client's packets and will operate on behalf of the client.)
Is there any security measurement I could use in order to absolutely know that I'm talking to a Facebook-authenticated user, and not an impersonating attacker?
Thanks. | php | facebook | server-side | null | null | null | open | How to authenticate a phone app's facebook user in PHP
===
I've been having some annoying security problems lately.
I'm trying to determine what is the best way to achieve two goals:
1. Implement client-side facebook authentication (My client app, either whether we're talking about iOS/Android) interacts with Facebook.
2. The client-side app is communicating with my HTTP Server (which is running PHP scripts...), in order to manage the app data for the users of my app.
I'm communicating by posting JSON objects as requests, and by echoing JSON object as responses.
I'm trying to figure out what are the parameters that I should include in my JSON objects in order to be certain know that I'm actually talking to a certain facebook user in a secure way (so a potential attacker won't simply impersonate the client's packets and will operate on behalf of the client.)
Is there any security measurement I could use in order to absolutely know that I'm talking to a Facebook-authenticated user, and not an impersonating attacker?
Thanks. | 0 |
11,472,824 | 07/13/2012 14:46:11 | 564,630 | 01/05/2011 21:41:30 | 113 | 3 | TFS automated build + nuget package restore + shared projects in different solutions | I have a solution that contains shared projects with nuget package restore.
I have a second solution that references projects from the first solution.
I am trying to set up TFS to build the second solution, but it doesn't find references for the projects in shared solution because the packages folder for the first solution is in a different location than that of the second solution. I've included the first solution in the build, but now the build configuration doesn't exist in that solution. | tfs2010 | nuget | null | null | null | null | open | TFS automated build + nuget package restore + shared projects in different solutions
===
I have a solution that contains shared projects with nuget package restore.
I have a second solution that references projects from the first solution.
I am trying to set up TFS to build the second solution, but it doesn't find references for the projects in shared solution because the packages folder for the first solution is in a different location than that of the second solution. I've included the first solution in the build, but now the build configuration doesn't exist in that solution. | 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.