Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
6,461,760
1
6,461,895
null
1
2,111
In my asp.net + VB Gridview, I had bind several column from datatable into one single column of the gridview. But I have no idea how to pass the time value from datatable to MKB TimeSelector in gridview and update. Please help. Thanks. ![Sample Screen](https://i326.photobucket.com/albums/k421/joeyan829/a4.jpg) But I have no idea how to get those value when doing RowEditing & RowUpdating. Please help. Thanks. The following is the VB code: ``` Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) 'Set the edit index. Gridview1.EditIndex = e.NewEditIndex 'Bind data to the GridView control. BindData() End Sub Protected Sub GridView1_RowCancelingEdit(ByVal sender As Object, ByVal e As GridViewCancelEditEventArgs) 'Reset the edit index. Gridview1.EditIndex = -1 'Bind data to the GridView control. BindData() End Sub Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As GridViewUpdateEventArgs) 'Retrieve the table from the session object. Dim dt = CType(Session("dt"), DataTable) 'Update the values. Dim row = Gridview1.Rows(e.RowIndex) ............................. 'Reset the edit index. Gridview1.EditIndex = -1 'Bind data to the GridView control. BindData() End Sub ``` The following is the aspx code: ``` Private Sub CreateDataTable() Dim cmd As New System.Data.SqlClient.SqlCommand Dim sql As String Dim reader As System.Data.SqlClient.SqlDataReader Dim cmd3 As New System.Data.SqlClient.SqlCommand Dim sql3 As String Dim reader3 As System.Data.SqlClient.SqlDataReader Using conn2 As New System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("XXXonnectionString").ConnectionString) conn2.Open() cmd.Connection = conn2 sql = "SET DATEFORMAT dmy;SELECT * FROM XXXX " cmd.CommandText = sql reader = cmd.ExecuteReader() Dim TempStaffKey As Integer Dim TempPostKey As Integer Dim TempShiftDate As DateTime Dim TempStartTime As DateTime Dim TempEndTime As DateTime Dim TempSL As String Dim TempRosterKey As Integer Dim TempVL As String Dim TempML As String Dim TempPH As String Dim TempAPH As String Dim TempTOIL As String Dim TempOthers As String Dim TempShiftType As Integer Dim TempSubmittedBy As Integer Dim dt As New DataTable() dt.Columns.Add(New DataColumn("StaffName", GetType(String))) dt.Columns.Add(New DataColumn("PostCode", GetType(String))) dt.Columns.Add(New DataColumn("StaffKey", GetType(Int32))) dt.Columns.Add(New DataColumn("PostKey", GetType(Int32))) 'Monday dt.Columns.Add(New DataColumn("Col1_RosterKey", GetType(Int32))) dt.Columns.Add(New DataColumn("Col1_ShiftDate", GetType(DateTime))) dt.Columns.Add(New DataColumn("Col1_StartTime", GetType(DateTime))) dt.Columns.Add(New DataColumn("Col1_EndTime", GetType(DateTime))) dt.Columns.Add(New DataColumn("Col1_SL", GetType(String))) dt.Columns.Add(New DataColumn("Col1_VL", GetType(String))) dt.Columns.Add(New DataColumn("Col1_ML", GetType(String))) dt.Columns.Add(New DataColumn("Col1_PH", GetType(String))) dt.Columns.Add(New DataColumn("Col1_APH", GetType(String))) dt.Columns.Add(New DataColumn("Col1_TOIL", GetType(String))) dt.Columns.Add(New DataColumn("Col1_Others", GetType(String))) dt.Columns.Add(New DataColumn("Col1_ShiftType", GetType(Int32))) dt.Columns.Add(New DataColumn("Col1_SubmittedBy", GetType(Int32))) Dim dr As DataRow While reader.Read() '---For each row g_TempStaffKey = "0" TempStaffKey = reader("staff_key") 'will not null g_selectstaffkey = TempStaffKey g_selectpostkey = reader("post_key") g_selectstaffname = RTrim(reader("name_eng")) g_selectpostcode = RTrim(reader("post_code")) Using conn3 As New System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("XXXConnectionString").ConnectionString) conn3.Open() cmd3.Connection = conn3 sql3 = "SET DATEFORMAT dmy;SELECT * FROM xxx" cmd3.CommandText = sql3 reader3 = cmd3.ExecuteReader() If reader3.Read() Then TempStaffKey = reader3("staff_key") If Not IsDBNull(reader3("post_key")) Then TempPostKey = reader3("post_key") End If If Not IsDBNull(reader3("roster_key")) Then TempRosterKey = reader3("roster_key") End If If Not IsDBNull(reader3("shift_date")) Then TempShiftDate = Format(reader3("shift_date"), "dd/MM/yyyy") End If If Not IsDBNull(reader3("start_time")) Then TempStartTime = Format(reader3("start_time"), "HH:mm") End If If Not IsDBNull(reader3("end_time")) Then TempEndTime = Format(reader3("end_time"), "HH:mm") End If If Not IsDBNull(reader3("SL")) Then TempSL = reader3("SL") Else TempSL = "0" End If If Not IsDBNull(reader3("VL")) Then TempVL = reader3("VL") Else TempVL = "0" End If If Not IsDBNull(reader3("ML")) Then TempML = reader3("ML") Else TempML = "0" End If If Not IsDBNull(reader3("PH")) Then TempPH = reader3("PH") Else TempPH = "0" End If If Not IsDBNull(reader3("APH")) Then TempAPH = reader3("APH") Else TempAPH = "0" End If If Not IsDBNull(reader3("TOIL")) Then TempTOIL = reader3("TOIL") Else TempTOIL = "0" End If If Not IsDBNull(reader3("Others")) Then TempOthers = reader3("Others") Else TempOthers = "null" End If If Not IsDBNull(reader3("shift_type")) Then TempShiftType = reader3("shift_type") End If If Not IsDBNull(reader3("submitted_by")) Then TempSubmittedBy = reader3("submitted_by") End If dr = dt.NewRow() dr("StaffName") = g_selectstaffname dr("PostCode") = g_selectpostcode dr("StaffKey") = TempStaffKey dr("PostKey") = TempPostKey 'Col1 If TempShiftDate = g_header1 Then dr("Col1_RosterKey") = TempRosterKey dr("Col1_ShiftDate") = TempShiftDate dr("Col1_StartTime") = TempStartTime dr("Col1_EndTime") = TempEndTime dr("Col1_SL") = TempSL dr("Col1_VL") = TempVL dr("Col1_ML") = TempML dr("Col1_PH") = TempPH dr("Col1_APH") = TempAPH dr("Col1_TOIL") = TempTOIL dr("Col1_Others") = TempOthers dr("Col1_ShiftType") = TempShiftType dr("Col1_SubmittedBy") = TempSubmittedBy End If End If ................. conn3.Close() reader3.Close() End Using End While Gridview1.DataSource = dt Gridview1.DataBind() 'Persist the table in the Session object. Session("dt") = dt reader.Close() End Using End Sub <%@ Page Title="Input" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="sd210.aspx.vb" Inherits="sd210" ValidateRequest="false"%> <%@ Register Assembly="TimePicker" Namespace="MKB.TimePicker" TagPrefix="MKB" %> <asp:Content ID="Content1" ContentPlaceHolderID="CPH1" Runat="Server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:hris_shiftdutyConnectionString %>"SelectCommand="set language english; SET DATEFORMAT dmy; select * from troster"> </asp:SqlDataSource> <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:hris_shiftdutyConnectionString %>" SelectCommand="set language english; select * from tshift_type"> </asp:SqlDataSource> <asp:Label ID="lb_login_name" runat="server" Visible="false" ></asp:Label> <asp:Label ID="lb_login_staff_key" runat="server" Visible="false" ></asp:Label> <asp:Label ID="lb_login_post_key" runat="server" Visible="false" ></asp:Label> <asp:Label ID="lb_test" runat="server" Visible="false" ></asp:Label> <asp:GridView ID="Gridview1" runat="server" AutoGenerateColumns = "false" Font-Names = "Arial" AutoGenerateEditButton="True" Font-Size = "10pt" AlternatingRowStyle-BackColor = "#C2D69B" AllowPaging ="true" PageSize = "20" Caption = "" onrowdatabound="GridView1_RowDataBound" OnRowEditing="GridView1_RowEditing" OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowUpdating="GridView1_RowUpdating" OnPageIndexChanging="GridView1_PageIndexChanging"> <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" /> <Columns> <asp:BoundField DataField = "PostCode" HeaderText = "Post" ReadOnly ="true" /> <asp:BoundField DataField = "StaffName" HeaderText = "Name" ReadOnly ="true" /> <asp:TemplateField HeaderText="Working<br>Time"> <ItemTemplate> <asp:Label ID="lb1_rosterkey" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Col1_RosterKey")%>' Visible ="false" ></asp:Label> <asp:BoundField DataField = "Col1_ShiftType" /> <MKB:TimeSelector ID="Col1_StartTime1" runat="server" DisplaySeconds="False" ReadOnly="true" MinuteIncrement="1" AmPm="AM" BorderColor="Silver" Date="" Hour="07" Minute="0" SelectedTimeFormat="Twelve"></MKB:TimeSelector> <MKB:TimeSelector ID="Col1_EndTime1" runat="server" DisplaySeconds="False" ReadOnly="true" MinuteIncrement="1" AmPm="PM" BorderColor="Silver" Date="" Hour="07" Minute="0" SelectedTimeFormat="Twelve"></MKB:TimeSelector> </ItemTemplate> <EditItemTemplate> <MKB:TimeSelector ID="Col1_StartTime1" runat="server" DisplaySeconds="False" MinuteIncrement="1" AmPm="AM" BorderColor="Silver" Date="" Hour="07" Minute="0" SelectedTimeFormat="Twelve"></MKB:TimeSelector> <MKB:TimeSelector ID="Col1_EndTime1" runat="server" DisplaySeconds="False" MinuteIncrement="1" AmPm="PM" BorderColor="Silver" Date="" Hour="07" Minute="0" SelectedTimeFormat="Twelve"></MKB:TimeSelector> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Leave/TOIL"> <ItemTemplate> <asp:CheckBox ID="cb1_VL" Enabled="false" Text="VL" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_VL")%> /> <asp:CheckBox ID="cb1_SL" Enabled="false" Text="SL" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_SL")%> /> <asp:CheckBox ID="cb1_ML" Enabled="false" Text="ML" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_ML")%> /> <asp:CheckBox ID="cb1_PH" Enabled="false" Text="PH" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_PH")%> /> <asp:CheckBox ID="cb1_APH" Enabled="false" Text="APH" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_APH")%> /> <asp:CheckBox ID="cb1_TOIL" Enabled="false" Text="TOIL" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_TOIL")%> /> <br /> <%#DataBinder.Eval(Container.DataItem, "Col1_Others")%> </ItemTemplate> <EditItemTemplate> <asp:CheckBox ID="cb1_VL" Text="VL" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_VL")%> /> <asp:CheckBox ID="cb1_SL" Text="SL" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_SL")%> /> <asp:CheckBox ID="cb1_ML" Text="ML" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_ML")%> /> <asp:CheckBox ID="cb1_PH" Text="PH" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_PH")%> /> <asp:CheckBox ID="cb1_APH" Text="APH" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_APH")%> /> <asp:CheckBox ID="cb1_TOIL" Text="TOIL" runat="server" Checked=<%#DataBinder.Eval(Container.DataItem, "Col1_TOIL")%> /> <asp:TextBox ID="tb1_Others" runat="server" Width="50" Text='<%#DataBinder.Eval(Container.DataItem, "Col1_Others") %>'></asp:TextBox> </EditItemTemplate> </asp:TemplateField> ``` ............ ``` </Columns> </asp:GridView> </asp:Content> ``` Joe
Gridview - How to pass value from datatable to MKB TimeSelector
CC BY-SA 3.0
null
2011-06-23T23:22:26.763
2011-06-23T23:54:22.387
2017-02-08T14:32:32.847
-1
788,679
[ "asp.net", "gridview" ]
6,461,980
1
6,512,949
null
2
824
I've localized an app for the iPhone. No surprise, the localization includes some accents: > "Touch cards to select. Then touch 'Bid'." = "Touchez les cartes pour les sélectionner, puis touchez 'Miser'."; These work fine in high-level stuff, like when I put the text into a table, but when I try to write them to a UIView by hand, the accents get mangled: ![enter image description here](https://i.stack.imgur.com/RZ2DD.jpg) I'm using kCGEncodingMacRoman and UTF8, both of which should support accents, I think, but I'm clearly missing something: ``` CGContextSelectFont(ctx,fontName,thisWriting.fontSize,kCGEncodingMacRoman); CGContextShowTextAtPoint(ctx, thisWriting.center.x - floor(thisTextSize.width/2), yThusFar, [thisText UTF8String], [thisText length]); ``` The font is some variant of ArialMT. thisText is just an NSString.
How to Display International Accents with Quartz/Core Graphics on iPhone
CC BY-SA 3.0
0
2011-06-23T23:50:24.077
2011-06-30T23:28:13.453
2011-06-30T23:21:29.910
80,263
80,263
[ "iphone", "localization", "core-graphics" ]
6,462,236
1
6,462,267
null
0
4,407
``` <div class="HeaderLink" id="Home"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MDB1</title> <link rel="stylesheet" type="text/css" href="Index.css" /> </head> <body id="HeaderFive"> <div class="HeadPanelElement" lang="en" id="HeadPanel"> <a href="Blog" id="HeaderOne" title="Blog link" target="_self" class="HeadPanelElement">Blog</a> <a href="Videos" id="HeaderTwo" title="Video's link" target="_self" class="HeadPanelElement">Videos</a> <a href="Okay" id="HeaderThree" title="Homepage link" target="_self" class="HeadPanelElement">Home</a> <a href="Contact" id="HeaderFour" title="Contact link" target="_self" class="HeadPanelElement">Contact</a> <a href="About MDB1" id="HeaderFive" title="About MDB1 link" target="_self" class="HeadPanelElement">About MDB1</a> </div> </body> </html> </div> @charset "utf-8"; /* CSS Document */ .HeadPanelElement{ position: absolute; width: 10%; left: -10%; } #HeadPanel{ left: 15%; width: 100%; height: 100%; font-family: Georgia, "Times New Roman", Times, serif; border: dashed; border-color: #C00; border-width: 2px; font-size: 1em; ``` Intentions are for the page to layout like this ![](https://docs.google.com/drawings/pub?id=1YPWi5g5c0G4gFRN1qOlMCIr3fbtwbkfMwP0tgIIBf58&w=970&h=1010) Why aren't the position attributes working?
Position elements with the div tag
CC BY-SA 3.0
0
2011-06-24T00:53:33.297
2011-06-24T04:02:10.157
null
null
507,469
[ "css", "dreamweaver", "html" ]
6,462,271
1
6,462,290
null
3
5,786
I am creating a login form using C# and MySQL. I got stuck in SQLConnection. It says that the keyword I used is not supported. This is my code: ``` using (var con = new SqlConnection("host=localhost;usr=root;password=admin;db=timekeeping;")) using (var cmd = con.CreateCommand()) { con.Open(); cmd.CommandText = "SELECT count(*) FROM receptionist WHERE username = @username AND password = @password;"; cmd.Parameters.AddWithValue("@username", username); cmd.Parameters.AddWithValue("@password", password); var count = (long)cmd.ExecuteScalar(); return count > 0; } ``` This is the screenshot of the error message: ![enter image description here](https://i.stack.imgur.com/TI9GQ.png)
The Keyword Used is Not Supported (MySQL and Visual Studio 2010)
CC BY-SA 3.0
0
2011-06-24T01:02:11.980
2016-06-13T16:32:27.373
null
null
516,160
[ "c#", "mysql", "visual-studio-2010", "error-handling" ]
6,462,501
1
6,462,566
null
0
1,192
I'm having trouble connectiong to MySQL Server database and get the following error: Error Message Login failed for user 'root'. Reason: Not associated with a trusted SQL Server connection. This is the code where the error occurred: ``` public bool IsValid(string username, string password) { using (var con = new SqlConnection("Server=localhost;Database = timekeeping; Uid = root; Pwd = admin;")) using (var cmd = con.CreateCommand()) { con.Open(); cmd.CommandText = "SELECT count(*) FROM receptionist WHERE username = @username AND password = @password;"; cmd.Parameters.AddWithValue("@username", username); cmd.Parameters.AddWithValue("@password", password); var count = (long)cmd.ExecuteScalar(); return count > 0; } } ``` Screenshot: ![enter image description here](https://i.stack.imgur.com/5dh7J.png) This is my config file: ``` <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="ODBCDriver" value="Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=timekeeping;uid=root;pwd=admin;Option=3;"/> </appSettings> <connectionStrings> <add name="connStr" connectionString="Database=timekeeping;uid=root;pwd=admin;Option=3;" /> </connectionStrings> </configuration> ```
Not Associated with a Trusted SQL Server Connection (MySQL)
CC BY-SA 3.0
null
2011-06-24T01:47:07.563
2011-06-24T02:22:34.577
2011-06-24T02:22:34.577
516,160
516,160
[ "mysql", "database", "visual-studio-2010", "mysql-error-1064" ]
6,462,590
1
6,462,746
null
0
921
I want to make my home screen for my android application like Facebook for Android. Is there anyone know how to make this layout? I am still newbie for Android Development. ![Facebook for Android](https://i.stack.imgur.com/PeKix.jpg)
How to make custom "button" like Facebook for Android
CC BY-SA 3.0
0
2011-06-24T02:02:49.307
2011-06-24T02:50:41.327
null
null
246,131
[ "android", "eclipse" ]
6,462,650
1
null
null
0
287
I'm teaching myself more iOS by duplicating Apple's calculator app. I've gotten the whole portrait mode working. Now I want to copy the feature where it resizes the existing buttons, moves them off to the right side, and adds a whole bunch of additional buttons and functionality when the user rotates to landscape. What I've seen in the docs and online so far has a lot of hardwiring, where I have to write code that manually moves each button to a specific location. I would prefer to go by a ratio of the screen size to support different screens. So I'd have to resize the buttons and their text, show/hide a set of extra buttons, change the UILabel, show/hide a couple extra UILabels, etc. can i just have a different xib file with the altered version that it will animate to? or do i have to program the whole thing manually? what would be the best approach here? ![Portrait Calculator](https://i.imgur.com/YwZEw.png) ![Landscape Calculator](https://i.imgur.com/B9Meo.png)
how to neatly re-arrange button display on willAnimateRorationToInterfaceOrientation
CC BY-SA 3.0
null
2011-06-24T02:15:25.800
2012-06-14T13:16:24.617
null
null
792,828
[ "ios", "uibutton", "uilabel", "uiviewanimation", "screen-rotation" ]
6,462,775
1
6,462,933
null
4
2,480
Suppose I have a drop down box to define how many row of input box, then generate the designated rows of input box, after that each row of input box with attach a drop down box, it can define how many input box of each row, illustrated as below: ![enter image description here](https://i.stack.imgur.com/xgRUG.jpg) Could anyone suggest the snippet for this procedure? Thanks
How to generate input box by jQuery
CC BY-SA 3.0
0
2011-06-24T02:42:41.647
2011-11-18T19:38:16.467
2011-11-18T19:38:16.467
548,696
495,452
[ "javascript", "jquery" ]
6,462,851
1
6,463,133
null
2
6,583
I have USB Debugging checked. I can deploy my Android application to my phone. And test. But why my phone is not showing up in Dalvik Debug Monitor. Where as it works fine with Eclipse for development and deployment? Once I have taken the screenshot from here. But now its not showing up. What's went wrong? See the screenshot. Device is in offline mode. I have seen stacktrace of exception on command line, as following: ``` com.android.ddmlib.AdbCommandRejectedException: device offline at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736) at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373) at com.android.ddmlib.Device.executeShellCommand(Device.java:276) at com.android.ddmuilib.SysinfoPanel.loadFromDevice(SysinfoPanel.java:15 ``` ![enter image description here](https://i.stack.imgur.com/nRf65.png)
My Android phone not showing up in Dalvik Debug Monitor
CC BY-SA 3.0
null
2011-06-24T02:58:23.363
2014-05-29T17:21:25.480
2011-06-24T03:21:38.993
170,238
170,238
[ "android" ]
6,462,974
1
null
null
1
270
I have a powerpoint template created in Office 2003. When I opened the SlideMaster of the template in Office 2010, I saw that the font sizes of bulleted body are 24, 22, 20, 18, 16 for level 1, level 2, level 3, level 4, level 5 respectively. The strange thing is that when I used VBA to loop through all bulleted text, I noticed that the font sizes for bulleted text are 32, 28, 24, 20, 20 which are quite different compared to the ones viewed in the app. If I open the template in Office 2003, PowerPoint and VBA show the same result: 32, 28, 24, 20, 20. I'm wondering why in Office 2010 there is the difference between the app and VBA (Please see attachment) ![Font size difference in PowerPoint 2010 and VBA](https://i.stack.imgur.com/CaUsD.png) Thank you very much for your help.
Office 2010 and VBA show different font sizes
CC BY-SA 3.0
0
2011-06-24T03:21:15.217
2020-07-02T09:30:32.363
2020-07-02T09:30:32.363
100,297
497,033
[ "vba", "powerpoint" ]
6,463,005
1
6,471,483
null
0
403
For some reason, a treeview I'm buildling in Silverlight has decided it no longer wants to display the triangle associated with the root level. It still functions correctly though. Pictures below: ![tree1](https://i.stack.imgur.com/ylqOa.png) ![tree2](https://i.stack.imgur.com/HiWKN.png) As you can see, it is just the root level that is exhibiting this behavior. Any ideas on what could be causing this?
Root Level of Treeview in Silverlight Missing "Triangle" Icon
CC BY-SA 3.0
null
2011-06-24T03:26:18.107
2011-06-24T17:27:53.673
null
null
370,639
[ "silverlight", "xaml", "treeview" ]
6,462,996
1
6,529,417
null
1
4,648
I've picked up some incomplete work from another developer that involves displaying the results of a search. His approach was to render the results in an HTML table using inline Javascript and jQuery as follows. ![Grid using table and inline Javascript](https://i.stack.imgur.com/VyuoL.png) I'm trying to finish off the work but I would prefer to write less code and use the jqGrid because it includes sorting functionality, and to get the code tidier. Getting the jqGrid to display the results is easy, but getting the radio buttons in a blank column is harder than I thought it would be. The version of jqGrid in the application is 3.7.2. The grid needs to have radio buttons on the left for selection to keep things consistent with the rest of the application. There doesn't seem to be a way to have an unbound column in jqGrid. That is, each column seems to need a field in the underlying data. If you do not have a dummy field, then the row data and column headers become misaligned. I've come across an [example](http://trirand.com/blog/jqgrid/jqgrid.html) (See Row Editing -> Custom Edit) that returns JSON with a dummy field in the data, and then modifies the grid data to insert buttons. My preference is to not have the dummy data in there, because it :) I would like my JSON to only include the data it needs to represent the results of the search. So I was thinking that it would be better to add the dummy field in the script code instead in order to keep the code on the server side clean. I'm trying to modify the data returned from the AJAX call before jqGrid renders it. I've tried hooking into the `loadComplete` event but when I modify the data it appears to be after it has already rendered. I've also tried hooking into the `success` event on the `ajaxGridOptions` field of `options` but that seems to totally override the event and jqGrid doesn't render the data.
How do you modify the data returned from an AJAX call before it is rendered in the jqGrid?
CC BY-SA 3.0
null
2011-06-24T03:25:11.753
2015-07-23T16:08:34.747
2011-06-27T00:38:55.557
80,282
80,282
[ "jquery", "ajax", "jqgrid" ]
6,463,166
1
6,463,198
null
2
206
I have a custom box that I've made that is a subclass of `NSBox`. I override the `drawRect:` method and draw a gradient in it like this (assuming I already have a `start` & `end` color): ``` -(void)drawRect:(NSRect)dirtyRect { NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:start endingColor:end]; [gradient drawInRect:dirtyRect angle:270]; [gradient release]; } ``` Now this box is added as a subview of a prototype view for a `NSCollectionView`. In the view's original state it looks like this: ![enter image description here](https://i.stack.imgur.com/MeI3Q.png) And after scrolling the view out of sight and back in again, it looks like this: ![enter image description here](https://i.stack.imgur.com/oHYZN.png) Why is my gradient getting corrupted like that, and how can I fix it? Thanks!
NSScrollView messes up NSGradient (corruption)
CC BY-SA 3.0
null
2011-06-24T03:57:55.213
2011-06-24T04:11:34.000
null
null
456,851
[ "objective-c", "cocoa", "nsgradient" ]
6,463,359
1
6,463,702
null
2
99
As you can see in the screenshort, captures the right value , but that property doesn't seem to be available. returns that value but escaped, that's not what I need. Is this the normal behavior with .NET? It's usually the case that shows the same value as the object string, but this time it's escaped. Also, as you can see in the Immediate Window, and even shows the value escaped. Worse yet, is wrapped in quotes, which is not what the regex is supposed to match. I already tried casting to and calling again to see if the real match is hidden in deeper groups but it isn't. Any ideas? ![enter image description here](https://i.stack.imgur.com/cweb0.png)
Regex returns escaped match in .NET - why?
CC BY-SA 3.0
null
2011-06-24T04:26:22.140
2011-06-24T05:15:40.803
null
null
9,776
[ "c#", ".net", "regex", "escaping" ]
6,463,411
1
6,496,137
null
7
467
I had previously [asked a question](https://stackoverflow.com/questions/6326266/issue-with-applying-dotted-border-to-cells-in-table-design) on this issue, to which you guys supplied fantastic answers. I since "discovered" the intoxicating power of contextual styling ([http://www.w3.org/TR/css3-selectors/#selectors](http://www.w3.org/TR/css3-selectors/#selectors)) -- thanks once again to you all -- and now I am hooked. I've made good progress on applying contextual styling to my current design here: [http://jsfiddle.net/gFA4p/200/](http://jsfiddle.net/gFA4p/200/) I've run into a few issues, though. Here's a screenshot of what I'm trying to do: ![enter image description here](https://i.stack.imgur.com/ED2tB.png) My first question, am I being overzealous in trying to apply contextual rules and making it harder than it needs to be? Two, if not, what do I need to do to accomplish my target styling, per the screenshot? Three, how to make this cross-browser compatible? Even as-is, it looks wonky in other browsers. ``
Using contextual styling on table to apply dotted borders to specific cells
CC BY-SA 3.0
0
2011-06-24T04:35:45.807
2017-08-11T16:12:17.353
2017-08-11T16:12:17.353
4,370,109
251,257
[ "css", "css-selectors", "border", "cell", "css-tables" ]
6,463,595
1
6,465,940
null
1
1,540
The case is that the TopTaskGroup(left one) can "grab excess vertical space" while resizing window![enter image description here](https://i.stack.imgur.com/hnBlp.png), but the NewTaskGroup(the right one), after adding a TooBar on it(see the `createAddBtnOnGroup` method), it doesn't grow as you resize the window. Why is that? (I have a shell instance with 2-column GridLayout) ![enter image description here](https://i.stack.imgur.com/obpQn.png) Code is here: ``` private void createTaskWidgets() { createTopTaskGroup(); createNewTaskGroup(); } private void createTopTaskGroup() { Group topTasksGroup = new Group(shell, SWT.SHADOW_NONE); topTasksGroup.setText(TaskConsts.TOP_TASK_LIST); topTasksTable = new TaskTable(topTasksGroup, TaskTable.SORT_BY_VOTES, iteration, this); topTasksTable.setLayoutData(getTableGridData() ); topTasksGroup.setLayout(new GridLayout() ); topTasksGroup.setLayoutData(getTableGridData() ); topTasksGroup.pack(); } private void createNewTaskGroup() { Group newTasksGroup = new Group(shell, SWT.SHADOW_NONE); newTasksGroup.setText(TaskConsts.NEW_TASK_LIST); newTasksTable = new TaskTable(newTasksGroup, TaskTable.SORT_BY_CREATION_TIME, iteration, this); topTasksTable.setLayoutData(getTableGridData() ); ToolBar actionToolBar = createAddBtnOnGroup(newTasksGroup); newTasksGroup.setLayout(new GridLayout() ); newTasksGroup.setLayoutData(getTableGridData() ); newTasksGroup.layout(); newTasksGroup.pack(); // set actionToolBar's location to newTasksGroup's right-top position actionToolBar.setLocation( newTasksGroup.getLocation().x + newTasksGroup.getSize().x - actionToolBar.getSize().x - 5, newTasksGroup.getLocation().y - 2); } private GridData getTableGridData() { GridData gridData = new GridData(0, SWT.FILL, false, true); return gridData; } private ToolBar createAddBtnOnGroup(Group newTasksGroup) { ToolBar actionToolBar = new ToolBar(newTasksGroup, SWT.HORIZONTAL | SWT.RIGHT); addTaskToolItem = new ToolItem(actionToolBar, SWT.PUSH | SWT.RIGHT); addTaskToolItem.setImage(new Image(display, TaskConsts.ICON_PLUS)); final MainWindow mainWindow = this; addTaskToolItem.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { new CreateTask(getShell(), mainWindow); } }); GridData gridData = new GridData(); gridData.exclude = true; actionToolBar.setLayoutData(gridData); actionToolBar.pack(); return actionToolBar; } private void organize() { GridLayout gridLayout = new GridLayout(2, false); shell.setLayout(gridLayout); shell.pack(); } ``` Thanks in advance~
a SWT control refuses to "grab excess vertical space"
CC BY-SA 3.0
0
2011-06-24T05:02:36.890
2011-06-24T09:30:42.977
null
null
390,014
[ "eclipse", "swt", "grid-layout" ]
6,463,758
1
6,464,181
null
5
35,426
I have the below code for my [jqGrid](http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3acolmodel_options), I want to select a row and the corresponding checkbox to be checked, if i click on the same row again, the checkbox should be disabled, how can i achieve this? I am also providing a snapshot. ``` var xmlDoc = $.parseXML(xml); $('#configDiv').empty(); $('<div width="100%">') .attr('id','configDetailsGrid') .html('<table id="list1" width="100%"></table>'+ '<div id="gridpager"></div>'+ '</div>') .appendTo('#configDiv'); var grid = jQuery("#list1"); grid.jqGrid({ datastr : xml, datatype: 'xmlstring', colNames:['cfgId','','Name', 'Host', 'Description','Product', 'Type', 'Last Updated Time','Last Updated By',''], colModel:[ {name:'cfgId',index:'cfgId', width:90, align:"right", hidden:true}, {name:'',index:'', width:15, align:"right",edittype:'checkbox',formatter: "checkbox",editoptions: { value:"True:False"},editable:true,formatoptions: {disabled : false}}, {name:'cfgName',index:'cfgName', width:90, align:"right"}, {name:'hostname',index:'hostname', width:90, align:"right"}, {name:'cfgDesc',index:'cfgDesc', width:90, align:"right"}, {name:'productId',index:'productId', width:60, align:"right"}, {name:'cfgType',index:'cfgType', width:60, align:"right"}, {name:'updateDate',index:'updateDate',sorttype:'Date', width:120, align:"right"}, {name:'emailAddress',index:'emailAddress', width:120, align:"right"}, {name:'absolutePath',index:'absolutePath', width:90, align:"right", hidden:true}, ], pager : '#gridpager', rowNum:10, scrollOffset:0, height: 'auto', autowidth:true, viewrecords: true, gridview: true, xmlReader: { root : "list", row: "com\\.abc\\.db\\.ConfigInfo", userdata: "userdata", repeatitems: false }, onSelectRow: function(id,status){ var rowData = jQuery(this).getRowData(id); configid = rowData['cfgId']; configname=rowData['cfgName']; configdesc=rowData['cfgDesc']; configenv=rowData['cfgType']; if(status==true) { } rowChecked=1; currentrow=id; }, onCellSelect: function(rowid, index, contents, event) { if(index==2) { $(xmlDoc).find('list com\\.abc\\.db\\.ConfigInfo').each(function() { //alert($(this).find('cfgId').text()+" "+configid); if($(this).find('cfgId').text()==configid) { configname=$(this).find('cfgName').text(); configdesc=$(this).find('cfgDesc').text(); configenv=$(this).find('cfgType').text(); filename=$(this).find('fileName').text(); updatedate=$(this).find('updateDate').text(); absolutepath=$(this).find('absolutePath').text(); productname=productMap[$(this).find('productId').text()]; } }); } } }); grid.jqGrid('navGrid','#gridpager',{edit:false,add:false,del:false}); ``` ![enter image description here](https://i.stack.imgur.com/MoToV.jpg) my onSelectRow ``` var ch = jQuery(this).find('#'+id+' input[type=checkbox]').prop('checked'); if(ch) { jQuery(this).find('#'+id+' input[type=checkbox]').prop('checked',false); } else { jQuery(this).find('#'+id+'input[type=checkbox]').prop('checked',true); } ```
In jqgrid how to check checkbox on row select?
CC BY-SA 3.0
0
2011-06-24T05:23:28.420
2011-06-27T06:41:11.587
2011-06-24T06:31:02.350
null
null
[ "jquery", "jqgrid" ]
6,463,776
1
6,465,196
null
2
2,631
![Usage Scenario](https://i.stack.imgur.com/66xgC.png) All the three machines are in the same Domain - - - Ideally, WSHttpBinding automatically transfers the Security Context, from the application to the WCF Service, and hence it should be able to write the file in the shared location. Because, if we directly try to write the file from the Application on Machine 1 to Machien 3 Share Location, it is successful. But, to our surprise, its not able to write the file to the Shared Location, through the Service. We are getting "Access Denied" As I told we are using WSHttpBinding, and ideally the user context get transferred to the Service. In the Client, i.e. Machine 1, the impersonation level is set as System.Security.Principal.TokenImpersonationLevel.Impersonation; So the Network Service can impersonate itself as Domain\user1. Is that enough to write into the folder in the 3rd machine? Or should we set the Client impersonation Level as System.Security.Principal.TokenImpersonationLevel.Delegation? (We tried both and it did not work) Also, another piece of information: Machine 2 is “trusted for delegation”. SPN is setup for this machine in the domain controller. The operation contract is declared as ``` [OperationBehavior(Impersonation = ImpersonationOption.Required)] public void WriteData(string content) { } ``` And still we are facing this issue.
Credential Delegation Issue with WCF
CC BY-SA 3.0
0
2011-06-24T05:26:45.173
2011-06-24T08:25:27.483
2011-06-24T06:20:12.373
730,804
730,804
[ "c#", ".net", "wcf", "credentials", "networkcredentials" ]
6,463,839
1
6,463,959
null
1
238
Basically, I want to have four labels on my contentview. I customised the UITableViewCell in IB, with my own custom class. I wanted the labels to be stacked one after another. However the labels seems to be on top of the others, which makes the other labels not visible. I have the following configuration: ``` title.textAlignment = UITextAlignmentLeft; title.lineBreakMode = UILineBreakModeWordWrap; title.numberOfLines = 0; ``` ![enter image description here](https://i.stack.imgur.com/JB4ot.png) For all of my labels. I also made sure I have the correct height in `heightForRowAtIndexPath` delegate method (which is just adding the height of all the labels). I'm not sure where I went wrong... Can anyone help me? EDIT: Picture of the UITableViewCell for those who are interested: ![enter image description here](https://i.stack.imgur.com/UxjKg.png)
Customising UITableViewCell with many UILabels
CC BY-SA 3.0
0
2011-06-24T05:36:58.560
2013-05-29T17:01:39.123
2011-06-24T05:42:45.547
361,247
361,247
[ "iphone", "cocoa-touch", "uitableview", "interface-builder" ]
6,463,891
1
6,464,092
null
0
2,271
I have a radio button list which I bind with the data source with the following code and it shows as the desired result for me: ``` dv.RowFilter = "VoteId = " + grdVote.DataKeys[e.Row.RowIndex].Value; rdbList.DataSource = dv; rdbList.DataTextField = "VoteOption"; rdbList.DataValueField = "VoteOptionId"; rdbList.DataBind(); ``` Now my question is how can I show the alphabetical serial number with each radio button list items.in below image there should be 'A' before apple and 'B' before banana and so on..... ![extend radio button list to show serial number in front of each radio button list item](https://i.stack.imgur.com/EKYke.png)
How can I show an extra label in front of each radio button list item which have serial number?
CC BY-SA 3.0
null
2011-06-24T05:44:10.483
2011-06-24T07:16:35.050
2011-06-24T06:36:54.307
779,158
779,158
[ "asp.net", "radiobuttonlist" ]
6,463,974
1
6,468,768
null
0
188
I trying to check login credential via xml using php,Following is the piece of code to check DB connection ``` $con = mysql_connect($host,$user,$pass) or die("<result><message>Could not connect to host</message></result>"); ``` if connection fails throws error like ``` "XML Parsing Error: junk after document element Location: http://test.study.com/test/services/checkLogindata.php Line Number 2, Column 1: ...." ``` ![enter image description here](https://i.stack.imgur.com/WVEiw.png) I dont want that message,i want to display simply like , ``` <result> <message>Could not connect to host</message> </result> ``` Is it possible to display like above, if yes kindly help me
How to handle mysql_connect error in xml using php
CC BY-SA 3.0
null
2011-06-24T05:54:39.427
2011-06-24T13:51:33.427
2011-06-24T08:53:37.507
662,038
662,038
[ "php" ]
6,463,994
1
null
null
0
936
![enter image description here](https://i.stack.imgur.com/3HmZe.png) I am using a custom list adapter...to display message i want change it to bubble message... `this.ListAdapter = new IndMessageAdapter(this, R.layout.chatmessage_list, Messages);` --- Criteria s: 1.Bubble should expand according the message length... 2.bubble not shrink or....change it resolution?? any idea how to proceed?? ---
how to send bubble message in android
CC BY-SA 3.0
0
2011-06-24T05:56:54.297
2011-06-24T06:35:10.187
null
null
598,084
[ "java", "android" ]
6,463,983
1
6,470,029
null
18
2,925
I'm currently trying to generate a spam filter by analyzing a corpus I've amassed. I'm using the wikipedia entry [http://en.wikipedia.org/wiki/Bayesian_spam_filtering](http://en.wikipedia.org/wiki/Bayesian_spam_filtering) to develop my classification code. I've implemented code to calculate probability that a message is spam given that it contains a specific word by implementing the following formula from the wiki: ![pr(S|W) = (pr(W|S)*pr(S))/(pr(W|S)*pr(S) + pr(W|H)*pr(H))](https://upload.wikimedia.org/math/c/c/c/ccc7bc9030475b2415e122ebe279d009.png) My PHP code: ``` public function pSpaminess($word) { $ps = $this->pContentIsSpam(); $ph = $this->pContentIsHam(); $pws = $this->pWordInSpam($word); $pwh = $this->pWordInHam($word); $psw = ($pws * $ps) / ($pws * $ps + $pwh * $ph); return $psw; } ``` In accordance with the Combining individual probabilities section, I've implemented code to combine the probabilities of all the unique words in a test message to determine spaminess. From the wiki formula: ![p=(p1*pn)/((p1*pn)+(1-p)(1-pn))](https://upload.wikimedia.org/math/f/1/d/f1d1c65ee72c294f1fc9b4eb156f5768.png) My PHP code: ``` public function predict($content) { $words = $this->tokenize($content); $pProducts = 1; $pSums = 1; foreach($words as $word) { $p = $this->pSpaminess($word); echo "$word: $p\n"; $pProducts *= $p; $pSums *= (1 - $p); } return $pProducts / ($pProducts + $pSums); } ``` On a test string "This isn't very bad at all.", the following output is produced: ``` C:\projects\bayes>php test.php this: 0.19907407407407 isn't: 0.23 very: 0.2 bad: 0.2906976744186 at: 0.17427385892116 all: 0.16098484848485 probability message is spam: float(0.00030795502523944) ``` Here's my question: Am I implementing the combining individual probabilities correctly? Assuming I'm generating valid individual word probabilities, is the combination method correct? My concern is the really small resultant probability of the calculation. I've tested it on a larger test message and ended up with a resulting probability in scientific notation with more than 10 places of zeroes. I was expecting values in the 10s or 100ths places. I'm hoping the problem lies in my PHP implementation--but when I examine the combination function from wikipedia the formula's dividend is a product of fractions. I don't see how a combination of multiple probabilities would end up being even more than .1% probability. If it is the case, such that the longer the message the lower the probability score will be, how do I compensate the spaminess quota to correctly predict spam/ham for small and large test cases? --- My corpus is actually a collection of about 40k reddit comments. I'm actually applying my "spam filter" against these comments. I'm rating an individual comment as spam/ham based on the number of down votes to up votes: If up votes is less than down votes it is considered Ham, otherwise Spam. Now, because of the corpus type it turns out there are actually few words that are used in spam more so than in ham. Ie, here is a top ten list of words that appear in spam more often than ham. ``` +-----------+------------+-----------+ | word | spam_count | ham_count | +-----------+------------+-----------+ | krugman | 30 | 27 | | fetus | 12.5 | 7.5 | | boehner | 12 | 10 | | hatred | 11.5 | 5.5 | | scum | 11 | 10 | | reserve | 11 | 10 | | incapable | 8.5 | 6.5 | | socalled | 8.5 | 5.5 | | jones | 8.5 | 7.5 | | orgasms | 8.5 | 7.5 | +-----------+------------+-----------+ ``` On the contrary, most words are used in great abundance in ham more so than ham. Take for instance, my top 10 list of words with highest spam count. ``` +------+------------+-----------+ | word | spam_count | ham_count | +------+------------+-----------+ | the | 4884 | 17982 | | to | 4006.5 | 14658.5 | | a | 3770.5 | 14057.5 | | of | 3250.5 | 12102.5 | | and | 3130 | 11709 | | is | 3102.5 | 11032.5 | | i | 2987.5 | 10565.5 | | that | 2953.5 | 10725.5 | | it | 2633 | 9639 | | in | 2593.5 | 9780.5 | +------+------------+-----------+ ``` As you can see, frequency of spam usage is significantly less than ham usage. In my corpus of 40k comments 2100 comments are considered spam. As suggested below, a test phrase on a post considered spam rates as follows: Phrase ``` Cops are losers in general. That's why they're cops. ``` Analysis: ``` C:\projects\bayes>php test.php cops: 0.15833333333333 are: 0.2218958611482 losers: 0.44444444444444 in: 0.20959269435914 general: 0.19565217391304 that's: 0.22080730418068 why: 0.24539170506912 they're: 0.19264544456641 float(6.0865969793861E-5) ``` According to this, there is an extremely low probability that this is spam. However, if I were to now analyze a ham comment: Phrase ``` Bill and TED's excellent venture? ``` Analysis ``` C:\projects\bayes>php test.php bill: 0.19534050179211 and: 0.21093065570456 ted's: 1 excellent: 0.16091954022989 venture: 0.30434782608696 float(1) ``` Okay, this is interesting. I'm doing these examples as I'm composing this update so this is the first time I've seen the result for this specific test case. I think my prediction is inverted. Its actually picking out the probability of Ham instead of Spam. This deserves validation. New test on known ham. Phrase ``` Complain about $174,000 salary being too little for self. Complain about $50,000 a year too much for teachers. Scumbag congressman. ``` Analysis ``` C:\projects\bayes>php test.php complain: 0.19736842105263 about: 0.21896031561847 174: 0.044117647058824 000: 0.19665809768638 salary: 0.20786516853933 being: 0.22011494252874 too: 0.21003236245955 little: 0.21134020618557 for: 0.20980452359022 self: 0.21052631578947 50: 0.19245283018868 a: 0.21149315683195 year: 0.21035386631717 much: 0.20139771283355 teachers: 0.21969696969697 scumbag: 0.22727272727273 congressman: 0.27678571428571 float(3.9604152477223E-11) ``` Unfortunately no. Turns out it was a coincidental result. I'm starting to wonder if perhaps comments can't be so easily quantified. Perhaps the nature of a bad comment is too vastly different than the nature of a spam message. Perhaps it may be the case that spam filtering only works when you have a specific word class of spam messages? --- As pointed out in the replies, the weird results were due to the nature of the corpus. Using a comment corpus where there is not a an explicit definition of spam Bayesian classification does not perform. Since it is possible (and likely) that any one comment may receive both spam and ham ratings by various users it is not possible to generate a hard classification for spam comments. Ultimately, I wanted to generate a comment classifier that could determine if a comment post would garnish karma based on a bayesian classification tuned to comment content. I may still investigate tuning the classifier to email spam messages and see if such a classifier can guess at karma response for comment systems. But for now, the question is answered. Thank you all for your input.
Combining individual probabilities in Naive Bayesian spam filtering
CC BY-SA 3.0
0
2011-06-24T05:55:08.443
2014-11-15T15:10:37.787
2017-02-08T14:25:36.500
-1
813,486
[ "php", "probability", "spam-prevention" ]
6,464,260
1
6,464,645
null
1
348
I have run into a issue here that is causing some setbacks for sure. Here is what happened. First, I was moving some large files around in Windows Explorer. And I Copied a 4 gb file into my clipboard to move somewhere. I later choose not to copy the file. Second. Time passes. While the file was still in clipboard, I went back into eclipse and forgot about the file that I had in clipboard. I then clicked on a XML layout file from a different project. And copied that into the clipboard to move to another project. Third. Thinking that the layout was in the clipboard I then pasted the layout file into the project where it did not get pasted. Instead the large file began importing into the project! 4.3 gigs... into the layout folder... ohh noo So I immediatly hit the X cancle operation. And everything jammed up. Since then, every time I compile I have this huge process that goes through. I have gone through every file in the project and see no traces of the half copied large file.. but the compiler keeps on wanting to process the file.. what a nightmare for sure. ![Overgrown APK](https://i.stack.imgur.com/sT96d.png) Fix Attempts.. after blowing away the gen and bin I reloaded eclipe and I thought things were all good... Cleaned project.. it compiled.. perfect.. then made code changes... recompile .. BOOM. APK overgrowth and now .... Conversion to Dalvik format failed with error 1 ![apk file growth](https://i.stack.imgur.com/ih5Dz.png) ![log messages](https://i.stack.imgur.com/U4zuw.png) ![enter image description here](https://i.stack.imgur.com/Nvjpz.png) After the 5+ gigs in growth.. I have come the conclusion that the 4gig copy paste error is not the issue... like wow.. it will fill my hd up.. ahhh ![enter image description here](https://i.stack.imgur.com/iwMeP.png)
Android Error: How to prevent overgrown APK file During compile process in eclipse?
CC BY-SA 3.0
null
2011-06-24T06:33:26.493
2011-06-24T07:20:05.177
2011-06-24T07:05:24.600
560,395
560,395
[ "android", "eclipse", "compilation", "android-install-apk" ]
6,464,379
1
6,464,478
null
1
1,170
![enter image description here](https://i.stack.imgur.com/k5Yff.png) I am using UITextView in above screenshot. But problem is when I am trying to scroll text its getting out of screen of UITextView. I have tried by reducing TextView frame but doing that its reducing UITextVIew Frame... How can i maintain same UITextView height and my text also not go out of the frame ?
UITextView Problem with scrolling text
CC BY-SA 3.0
null
2011-06-24T06:50:03.267
2011-06-24T06:59:39.203
null
null
213,532
[ "iphone", "uiscrollview", "uitextview", "frame", "uitextviewdelegate" ]
6,464,374
1
6,464,790
null
1
10,084
I'm new to Visual Studio 2010. I'm creating a login form and in the login form there is a combobox and a textbox. The items in combobox is the list of positions of the employees. Whenever a user click the login button there should be an if statement in the login button so that there are forms will open in a specific position of the employees. Please help. This is the screenshot: ![enter image description here](https://i.stack.imgur.com/idrxu.png) This is the code: ``` private void loginbutton_Click(object sender, EventArgs e) { string MyConString = "SERVER=localhost;" + "DATABASE=timekeeping;" + "UID=root;" + "PASSWORD=admin;"; MySqlConnection connection = new MySqlConnection(MyConString); MySqlCommand command = connection.CreateCommand(); MySqlDataReader Reader; command.CommandText = "select username, password from users"; connection.Open(); Reader = command.ExecuteReader(); while (Reader.Read()) { if (username_login.Text == Reader[0].ToString() && password_login.Text == Reader[1].ToString().Trim()) { username = Reader[0].ToString(); password = Reader[1].ToString(); } } if (username_login.Text == username && password_login.Text == password.Trim()) { this.Hide(); Home form = new Home(); //form.userSession(lname, fname); form.Show(); } else MessageBox.Show("Invalid User", "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Error); connection.Close(); } ``` I haven't included yet the combobox because I don't know what to put in here.
If-Statement for the Login Button
CC BY-SA 3.0
null
2011-06-24T06:49:27.027
2018-04-22T17:21:56.477
2011-06-24T07:27:47.827
516,160
516,160
[ "c#", "visual-studio-2010", "forms" ]
6,464,455
1
6,464,498
null
3
10,586
I'm new to android development, and I would like to do a drop down menu like in Maps application. schema : ![enter image description here](https://i.stack.imgur.com/omCyO.png) For example, if I click on the third item I'll have more informations about my Item thing, and one or two buttons to launch another activity. thanks.
Drop down-menu on ListView for Android
CC BY-SA 3.0
0
2011-06-24T06:58:18.930
2012-08-26T14:22:38.397
2012-08-26T14:22:38.397
977,676
813,604
[ "android", "android-layout", "android-widget" ]
6,464,543
1
6,683,587
null
4
12,220
in my app i want to place a rounded corner background in an activity. The image i want is as follows ![enter image description here](https://i.stack.imgur.com/3meAX.png) The background image of my app is to be a white screen and inside my rounded corner background i need white spaces. So to identify corners of the rounded background i need to give a black color for it. But my image appears as follows. ![enter image description here](https://i.stack.imgur.com/nUraj.png) Following is my code for rounded background ``` <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#ffffff" /> <stroke android:width="3dp" color="#ff000000" /> <corners android:radius="15dp" android:color="#ababab" /> <padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" /> </shape> ``` How to get the black color as my corner color
how to set color for the rounded corners in android
CC BY-SA 3.0
0
2011-06-24T07:06:27.187
2011-07-19T11:30:21.027
2011-06-24T07:50:35.170
596,364
596,364
[ "android" ]
6,464,679
1
6,464,816
null
8
1,781
What's the meaning of the blue disconnected arrow? Note, it happened after I added a remote head and did `git fetch`. ![enter image description here](https://i.stack.imgur.com/pzJD9.png) ... ![enter image description here](https://i.stack.imgur.com/94qJJ.png)
What does this disconnected arrow mean on gitk?
CC BY-SA 3.0
null
2011-06-24T07:24:09.300
2011-06-24T07:42:36.587
null
null
11,236
[ "git", "gitk" ]
6,464,716
1
6,464,883
null
17
7,151
I created a custom ListView with a UserControl. When the mouse enters the ColumnHeader it should change color at design time. It works, but I need to debug code. How can I debug code at design time? ![Example image](https://i.stack.imgur.com/xaHBc.png)
How can I debug at design time?
CC BY-SA 4.0
0
2011-06-24T07:29:50.500
2019-09-08T10:53:10.793
2019-09-08T10:40:56.833
63,550
755,097
[ "c#", "debugging", "user-controls" ]
6,464,757
1
null
null
3
2,551
I'm suppose to develop an application for my project, it will load past-year examination / exercises paper (word file), detect the sections accordingly, extract the questions and images in that section, and then store the questions and images into the database. (Preview of the question paper is at the bottom of this post) So I need some suggestions on how to extract data from a word file, then inserting them into a database. Currently I have a few methods to do so, however I have no idea how I could implement them when the file contains textboxes with background image. The question has to link with the image. - Questions: - - ``` private object missing = Type.Missing; private object sFilename = @"C:\temp\questionpaper.docx"; private object sFilename2 = @"C:\temp\temp.txt"; private object readOnly = true; object fileFormat = Word.WdSaveFormat.wdFormatText; private void button1_Click(object sender, EventArgs e) { Word.Application wWordApp = new Word.Application(); wWordApp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone; Word.Document dFile = wWordApp.Documents.Open(ref sFilename, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); dFile.SaveAs(ref sFilename2, ref fileFormat, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,ref missing, ref missing,ref missing,ref missing,ref missing,ref missing, ref missing,ref missing); dFile.Close(ref missing, ref missing, ref missing); } ``` ``` private Word.Application wWordApp; private int m_i; private object missing = Type.Missing; private object filename = @"C:\temp\questionpaper.docx"; private object readOnly = true; private void CopyFromClipbordInlineShape(String imageIndex) { Word.InlineShape inlineShape = wWordApp.ActiveDocument.InlineShapes[m_i]; inlineShape.Select(); wWordApp.Selection.Copy(); Computer computer = new Computer(); if (computer.Clipboard.GetDataObject() != null) { System.Windows.Forms.IDataObject data = computer.Clipboard.GetDataObject(); if (data.GetDataPresent(System.Windows.Forms.DataFormats.Bitmap)) { Image image = (Image)data.GetData(System.Windows.Forms.DataFormats.Bitmap, true); image.Save("C:\\temp\\DoCremoveImage" + imageIndex + ".png", System.Drawing.Imaging.ImageFormat.Png); } } } private void button1_Click(object sender, EventArgs e) { wWordApp = new Word.Application(); wWordApp.Documents.Open(ref filename, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); try { for (int i = 1; i <= wWordApp.ActiveDocument.InlineShapes.Count; i++) { m_i = i; CopyFromClipbordInlineShape(Convert.ToString(i)); } } finally { object save = false; wWordApp.Quit(ref save, ref missing, ref missing); wWordApp = null; } } ``` - Any suggestion/help would be greatly appreciated :D ![Preview of the word file](https://i.stack.imgur.com/YF1Ap.png) (backup link: [http://i.stack.imgur.com/YF1Ap.png](https://i.stack.imgur.com/YF1Ap.png))
Need suggestions on how to extract data from .docx/.doc file then into SQL Server
CC BY-SA 3.0
0
2011-06-24T07:34:32.543
2011-07-16T21:30:09.503
2011-06-24T07:42:04.550
13,302
386,199
[ "c#", "interop", "ms-word", "openxml" ]
6,464,887
1
6,486,500
null
2
453
Assume we have hierarchy which consists from several objects, like this: ![enter image description here](https://i.stack.imgur.com/6Rqwr.png) And I want to copy this tree (and maybe somehow change those objects). A simple method to do this is just iterate between objects and create it one-by-one. But performance here is very poor. In addition, i do not like loops ;-) So question - is it possible to do with set-based logic?
What is best wayto copy objects hierarchy in SQL server
CC BY-SA 3.0
0
2011-06-24T07:52:24.360
2011-06-26T20:21:23.473
null
null
544,428
[ "sql", "sql-server", "sql-server-2008" ]
6,464,902
1
6,465,106
null
6
2,820
I am trying to set the Icon of my menu item like this - ``` <Grid> <Grid.Resources> <Image x:Key="ReportIconImage" Height="20" Width="20" Source="/Resource/flag.png"/> <Image x:Key="ReportIconImage1" Height="20" Width="20" Source="/Resource/flag.png"/> </Grid.Resources> <Menu Height="22" Margin="0,9,0,0" Name="menu1" VerticalAlignment="Top"> <MenuItem Header="Menu"> <MenuItem Header="Save" ></MenuItem> <MenuItem Header="Open"/> <MenuItem Header="Exit"/> <MenuItem.ItemContainerStyle> <Style TargetType="{x:Type MenuItem}"> <Setter Property="Icon" Value="{StaticResource ReportIconImage}"> </Setter> </Style> </MenuItem.ItemContainerStyle> </MenuItem> <MenuItem Header="Edit"> <MenuItem Header="Undo"/> <MenuItem Header="Redo"/> <Separator/> <MenuItem Header="Cut"/> <MenuItem Header="Copy"/> <MenuItem Header="Paste"/> <MenuItem.ItemContainerStyle> <Style TargetType="{x:Type MenuItem}"> <Setter Property="Icon" Value="{StaticResource ReportIconImage1}"> </Setter> </Style> </MenuItem.ItemContainerStyle> </MenuItem> </Menu> </Grid> ``` but the icon for only last menu item is displayed and not for first two. ![enter image description here](https://i.stack.imgur.com/3zHKA.jpg) Sample application - [http://weblogs.asp.net/blogs/akjoshi/Samples/WPFMenuItemBugSample.zip](http://weblogs.asp.net/blogs/akjoshi/Samples/WPFMenuItemBugSample.zip) Can anyone provide the reason for this behavior and possible solutions/workarounds.
Unable to set icon for the menu item using ItemContainerStyle
CC BY-SA 3.0
null
2011-06-24T07:53:49.887
2012-08-29T15:02:32.717
2012-08-29T15:02:32.717
45,382
45,382
[ ".net", "wpf", "xaml", "menuitem", "itemcontainerstyle" ]
6,465,328
1
6,465,534
null
0
2,127
I want to test my app on real device not emulator and I try to create archive from my app and share it to IPA but when i save IPA i get this error "The operation couldn’t be completed. No such file or directory". What's going wrong? Is the reason that i i don't have Identity Profile to set? ![enter image description here](https://i.stack.imgur.com/LoAUG.png) IS THERE ANY CHANCE TO SHARE IPA if i don't have apple developer certificate?
Xcode 4 share IPA "The operation couldn’t be completed. No such file or directory"
CC BY-SA 3.0
null
2011-06-24T08:37:24.503
2011-06-27T19:36:25.570
null
null
667,776
[ "iphone", "ios4", "xcode4", "ipa" ]
6,465,403
1
null
null
0
2,212
I have put together a JQuery script that when entering a comment, it goes to a database and pulls the result back and displays it on the page. This works well, however I need a seperate page with just the comments on, which auto refreshes the results every 5 seconds (instead of clicking refresh on the browser). What I would also like is for the comments to FadeIn. I have tried to do this with resources I have found online, but most of them seem to keep replicating my content as well as refreshing. Can you help? ![enter image description here](https://i.stack.imgur.com/9pcAX.jpg) ``` <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="comments.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Live Comments</title> </head> <body> <div id="leaveComment"> <h2>Leave a Comment</h2> <div class="row"> <label>Your Name:</label> <input type="text"> </div> <div class="row"> <label>Comment:</label> <textarea cols="10" rows="5"></textarea> </div> <button id="add">Add</button> </div> <div id="comments"> <h2>Live Comments</h2> </div> <script type="text/javascript" src="jquery-1.6.1.min.js"></script> <script type="text/javascript"> $(function() { //retrieve comments to display on page $.getJSON("comments.php?jsoncallback=?", function(data) { //loop through all items in the JSON array for (var x = 0; x < data.length; x++) { //create a container for each comment var div = $("<div>").addClass("row").appendTo("#comments"); //add author name and comment to container $("<label>").text(data[x].name).appendTo(div); $("<div>").addClass("comment").text(data[x].comment).appendTo(div); } }); //add click handler for button $("#add").click(function() { //define ajax config object var ajaxOpts = { type: "post", url: "addComment.php", data: "&author=" + $("#leaveComment").find("input").val() + "&comment=" + $("#leaveComment").find("textarea").val(), success: function(data) { //create a container for the new comment var div = $("<div>").addClass("row").appendTo("#comments"); //add author name and comment to container $("<label>").text($("#leaveComment").find("input").val()).appendTo(div); $("<div>").addClass("comment").text($("#leaveComment").find("textarea").val()).appendTo(div).hide().fadeIn("slow"); //empty inputs $("#leaveComment").find("input").val(""); $("#leaveComment").find("textarea").val(""); } }; $.ajax(ajaxOpts); }); }); </script> </body> </html> ``` ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link rel="stylesheet" type="text/css" href="comments.css"> </head> <body> <div id="comments"> <h2>Live Comments</h2> </div> <script type="text/javascript" src="jquery-1.6.1.min.js"></script> <script type="text/javascript"> $(function() { //retrieve comments to display on page $.getJSON("comments.php?jsoncallback=?", function(data) { //loop through all items in the JSON array for (var x = 0; x < data.length; x++) { //create a container for each comment var div = $("<div>").addClass("row").appendTo("#comments"); //add author name and comment to container $("<label>").text(data[x].name).appendTo(div); $("<div>").addClass("comment").text(data[x].comment).appendTo(div); } }); //add click handler for button $("#add").click(function() { //define ajax config object var ajaxOpts = { type: "post", url: "addComment.php", data: "&author=" + $("#leaveComment").find("input").val() + "&comment=" + $("#leaveComment").find("textarea").val(), success: function(data) { //create a container for the new comment var div = $("<div>").addClass("row").appendTo("#comments"); //add author name and comment to container $("<label>").text($("#leaveComment").find("input").val()).appendTo(div); $("<div>").addClass("comment").text($("#leaveComment").find("textarea").val()).appendTo(div).hide().fadeIn("slow"); //empty inputs $("#leaveComment").find("input").val(""); $("#leaveComment").find("textarea").val(""); } }; $.ajax(ajaxOpts); }); }); </script> </body> </html> ``` ``` <?php //db connection detils $host = "localhost"; $user = "CommentsDB"; $password = "password"; $database = "comments"; //make connection $server = mysql_connect($host, $user, $password); $connection = mysql_select_db($database, $server); //query the database $query = mysql_query("SELECT * FROM comments"); //loop through and return results for ($x = 0, $numrows = mysql_num_rows($query); $x < $numrows; $x++) { $row = mysql_fetch_assoc($query); $comments[$x] = array("name" => $row["name"], "comment" => $row["comment"]); } //echo JSON to page $response = $_GET["jsoncallback"] . "(" . json_encode($comments) . ")"; echo $response; ?> ``` ``` <?php //db connection detils $host = "localhost"; $user = "CommentsDB"; $password = "password"; $database = "comments"; //make connection $server = mysql_connect($host, $user, $password); $connection = mysql_select_db($database, $server); //get POST data $name = mysql_real_escape_string($_POST["author"]); $comment = mysql_real_escape_string($_POST["comment"]); //add new comment to database mysql_query("INSERT INTO comments VALUES(' $name ',' $comment ')"); ?> ```
Refresh comments section
CC BY-SA 3.0
null
2011-06-24T08:44:16.933
2011-06-24T13:11:35.280
2011-06-24T13:11:35.280
134,227
134,227
[ "php", "javascript", "jquery", "json" ]
6,465,570
1
6,465,604
null
1
2,212
I am trying to import an image in just cell number 1 and 2 ! , but I the result is my image will show in last cell ! I do not know why !! this is the picture that shows my situation : ![enter image description here](https://i.stack.imgur.com/wdsaOtt.jpg) ``` // Configure the cell. NSUInteger row = [indexPath row]; cell.textLabel.text = [titles objectAtIndex:row]; cell.detailTextLabel.text = [subtitle objectAtIndex:row]; switch (indexPath.row) { case 0: cell.imageView.image = [UIImage imageNamed:@"new.png"]; break; case 1: cell.imageView.image = [UIImage imageNamed:@"new.png"]; break; } return cell; } ```
UITableView cell image problem
CC BY-SA 3.0
null
2011-06-24T08:56:56.800
2011-06-24T14:30:15.657
2011-06-24T14:30:15.657
319,097
319,097
[ "iphone", "uitableview" ]
6,465,629
1
6,465,970
null
0
240
When I run my app on Android emulator, the app will load a content of a (large) text file. There's no problem until now, but when I look at the stats, I am confused about what the "free" type means. Does it mean my app has allocated big objects and they are unused now? Or it just says that it's the free memory of the device? ![enter image description here](https://i.stack.imgur.com/EzkvL.png) Regard p.s: I'm new to Android.
What does "Free" means in Heap monitoring screen when running Android app on emulator (eclipse)?
CC BY-SA 3.0
null
2011-06-24T09:01:20.943
2011-06-24T09:33:10.013
null
null
495,558
[ "java", "android", "memory" ]
6,465,643
1
6,465,678
null
4
2,248
I am missing the right terminology thus find it hard to Google / search for a solution - nevertheless, I want to have the pointing arrow of a popup view pointing to different locations, take a look at the following image to see what I am talking about ![popup arrow](https://i.stack.imgur.com/V7mt3.jpg) questions 1. What is Apple's name / term of this element 2. How does one programmatically change it's position 3. Is this element supported by the SDK itself as an element and if state where
Programmatically set the arrow tip of a popup
CC BY-SA 4.0
0
2011-06-24T09:03:06.883
2018-08-18T04:48:24.263
2018-08-18T04:48:24.263
4,099,593
168,273
[ "ios", "iphone", "user-interface", "popup" ]
6,465,640
1
6,465,718
null
0
919
I'm facing a bit of an odd problem here. I just launched: [http://claudiu.phpfogapp.com/](http://claudiu.phpfogapp.com/) To keep it short, when you minify your files or custom code or both, it returns a JSON string containing various data: ``` { "source" : MINIFIED_CSS, "location" : CSS_URL, ... "error_msg" : ERROR_MSG } ``` Where the words typed in caps are actually the values. It works for a few lines of code, but breaks on large values of MINIFIED_CSS. It's weird that JavaScript doesn't issue any errors as well. I read the JSON with jQuery like this: ``` $.get('/minify/', {custom: $('.custom textarea').val(), files: JSON.stringify(request_string)}, function(data) { console.log(data); var response = eval(data); ``` When the MINIFIED_CSS is too large, I can't even see the console.log() call, but inspecting with Firebug you can see the source and can also see the JSON tab in Firebug for the request parsing the JSON nicely. I have no idea what could be wrong. I'm sure that the JSON string doesn't break, I even created a small CSS file with the most awkward characters that could break the JSON: [http://claudiuceia.info/css/small.css](http://claudiuceia.info/css/small.css) but minifying that runs smoothly. Did anyone face this problem before? Any ideas what could be wrong? Hoping that having an actual link to the problem can help finding a solution quicker but if you need anything else please let me know, I don't know what else I could try. Also, note that this stopped working just now, but it worked when I launched a few hours ago? I tested in Chrome and Firefox and it worked, now it doesn't work in any of them. I followed Scottie's suggestion (comment below) and ran the response through JSONlint.com The requests that I'm having problems with don't validate in JSONLint but running them through eval() doesn't issue an error and converts nicely: [http://claudiuceia.info/demo/json/index.html](http://claudiuceia.info/demo/json/index.html) I'm expecting to see that, or at least an error or the console.log() call in the live app as well. The console.log() call should display even if data is null or undefined or whatever it might be. Pictures with the requests working but not being read by JavaScript as well: ![Firebug JSON tab for the request](https://i.stack.imgur.com/kWcUK.png) ![Firebug response tab for the request](https://i.stack.imgur.com/6F2gf.png) Looks like json_encode() didn't escape the CSS text properly for some reason. I had to use a solution found on this page: [PHP's json_encode does not escape all JSON control characters](https://stackoverflow.com/questions/1048487/phps-json-encode-does-not-escape-all-json-control-characters) ``` $escapers = array("\\", "/", "\"", "\n", "\r", "\t", "\x08", "\x0c"); $replacements = array("\\\\", "\\/", "\\\"", "\\n", "\\r", "\\t", "\\f", "\\b"); $result = str_replace($escapers, $replacements, $value); return $result; ```
JavaScript doesn't read JSON string, no error
CC BY-SA 3.0
null
2011-06-24T09:02:18.523
2011-06-24T11:38:19.260
2017-05-23T12:07:02.087
-1
470,877
[ "jquery", "json" ]
6,465,682
1
6,465,736
null
1
4,318
This is my code, i am using firefox's firebug (console.info) ``` var productMap = { "1": "IIR" }; $(xml).find('ConfigInfo').each(function(){ var pid = $(this).find('productId').text(); $(this).find('productId').text(productMap[pid]); console.info($(this).find('productId').text()); }); $(xml).find('ConfigInfo').each(function(){ console.info($(this).find('productId').text()); }); ``` My Xml ``` <list> <com.abc.db.ConfigInfo> <cfgId>83</cfgId> <cfgName>test</cfgName> <cfgDesc>test</cfgDesc> <cfgType>test</cfgType> <fileName>csmclientbenz.xml</fileName> <absolutePath>../webapps/csm/files//1-105101/csmclientbenz.xml</absolutePath> <emailAddress>[email protected]</emailAddress> <projectId>1-105101</projectId> <hostname>benz</hostname> <createDate>2011-06-15 15:29:55.0 IST</createDate> <updateDate>2011-06-15 15:29:55.0 IST</updateDate> <state>1</state> <productId>1</productId> </com.abc.db.ConfigInfo> <com.abc.db.ConfigInfo> <cfgId>102</cfgId> <cfgName>cfgname1</cfgName> <cfgDesc>test</cfgDesc> <cfgType>test</cfgType> <fileName>csmclientestilo.xml</fileName> <absolutePath>../webapps/csm/files//1-105101/csmclientestilo.xml</absolutePath> <emailAddress>[email protected]</emailAddress> <projectId>1-105101</projectId> <hostname>estilo</hostname> <createDate>2011-06-20 18:26:03.0 IST</createDate> <updateDate>2011-06-20 18:26:03.0 IST</updateDate> <state>1</state> <productId>1</productId> </com.abc.db.ConfigInfo> </list> ``` My jqGrid code ``` var xmlDoc = $.parseXML(xml); $('#configDiv').empty(); $('<div width="100%">') .attr('id','configDetailsGrid') .html('<table id="list1" width="100%"></table>'+ '<div id="gridpager"></div>'+ '</div>') .appendTo('#configDiv'); var grid = jQuery("#list1"); grid.jqGrid({ datastr : xml, datatype: 'xmlstring', colNames:['cfgId','','Name', 'Host', 'Description','Product', 'Type', 'Last Updated Time','Last Updated By',''], colModel:[ {name:'cfgId',index:'cfgId', width:90, align:"right", hidden:true}, {name:'',index:'', width:15, align:"right",edittype:'checkbox',formatter: "checkbox",editoptions: { value:"True:False"},editable:true,formatoptions: {disabled : false}}, {name:'cfgName',index:'cfgName', width:90, align:"right"}, {name:'hostname',index:'hostname', width:90, align:"right"}, {name:'cfgDesc',index:'cfgDesc', width:90, align:"right"}, {name:'productId',index:'productId', width:60, align:"right"}, {name:'cfgType',index:'cfgType', width:60, align:"right"}, {name:'updateDate',index:'updateDate',sorttype:'Date', width:120, align:"right"}, {name:'emailAddress',index:'emailAddress', width:120, align:"right"}, {name:'absolutePath',index:'absolutePath', width:90, align:"right", hidden:true}, ], pager : '#gridpager', rowNum:10, scrollOffset:0, height: 'auto', autowidth:true, viewrecords: true, gridview: true, xmlReader: { root : "list", row: "com\\.abc\\.db\\.ConfigInfo", userdata: "userdata", repeatitems: false }, onSelectRow: function(id,status){ var rowData = jQuery(this).getRowData(id); configid = rowData['cfgId']; configname=rowData['cfgName']; configdesc=rowData['cfgDesc']; configenv=rowData['cfgType']; if(status==true) { } rowChecked=1; currentrow=id; }, onCellSelect: function(rowid, index, contents, event) { if(index==2) { $(xmlDoc).find('list com\\.abc\\.db\\.ConfigInfo').each(function() { //alert($(this).find('cfgId').text()+" "+configid); if($(this).find('cfgId').text()==configid) { configname=$(this).find('cfgName').text(); configdesc=$(this).find('cfgDesc').text(); configenv=$(this).find('cfgType').text(); filename=$(this).find('fileName').text(); updatedate=$(this).find('updateDate').text(); absolutepath=$(this).find('absolutePath').text(); productname=productMap[$(this).find('productId').text()]; } }); } } }); grid.jqGrid('navGrid','#gridpager',{edit:false,add:false,del:false}); ``` This is what i get the output as. : How to replace an xml's node value? ![enter image description here](https://i.stack.imgur.com/LkQ8R.jpg) I used `xml=xml.replace(/<productId>1/g, "<productId>"+productMap['1']);` by adding a `/g` it replaced all my string occurances.
How to replace xml node value in jquery
CC BY-SA 3.0
null
2011-06-24T09:07:01.800
2011-06-24T10:16:33.957
2011-06-24T09:37:39.983
707,414
707,414
[ "javascript", "jquery" ]
6,465,910
1
6,466,761
null
3
1,389
My structure has two main chains with side nodes in sub graphs. Every thing looks nice but when i close the two chains all the boxes in the sub graphs jumps to the right side. At the end of my code you can remove the "I"->"J" then you can see the best what I mean. I am not a native English speaker, sorry about my English and I am a graphviz newbie. ``` digraph G { size ="6,6"; node [color=black fontsize=12, shape=box, fontname=Helvetica]; subgraph { rank = same; "b"->"B"[arrowhead=none]; } subgraph { rank=same; "c"->"C"[arrowhead=none]; } subgraph { rank=same; "e"->"E" [arrowhead=none]; } subgraph { rank = same; "f"->"F"[arrowhead=none]; } subgraph { rank = same; "g"->"G"[arrowhead=none]; } "0" -> "A" -> "B" -> "C"->"D" -> "E" -> "F" -> "G" -> "H"->"I"; "0" -> "K"->"L"->"M"->"N"->"O" ->"P"->"1"; subgraph { rank = same; "L"->"l"[arrowhead=none]; } subgraph { rank=same; "M"->"m"[arrowhead=none]; } subgraph { rank=same; "N"->"n" [arrowhead=none]; } subgraph { rank = same; "O"->"o"[arrowhead=none]; } subgraph { rank = same; "P"->"p"[arrowhead=none]; } "1"->"J"; "I"->"J"; } ``` --- ![enter image description here](https://i.stack.imgur.com/F9hpF.png) --- and with `"I"->"J";` removed: ![enter image description here](https://i.stack.imgur.com/5u5rX.png)
Graphviz - Box positioning Problem
CC BY-SA 3.0
0
2011-06-24T09:27:43.337
2011-06-24T10:51:47.497
2011-06-24T09:58:05.103
50,476
813,809
[ "graphviz" ]
6,466,013
1
6,466,105
null
6
6,446
I'm performance tuning my iPhone/iPad app, it seems like not all the memory gets freed which should be. In instruments, after I simulate a memory warning in my simulator, there are lots of "Malloc" entries left; what's about them? Can I get rid of them, what do they mean/what do they stand for? Thanks a lot, Stefan ![enter image description here](https://i.stack.imgur.com/lZ09V.png)
iPhone/Instruments: what's about the "malloc" entries in object summary?
CC BY-SA 3.0
0
2011-06-24T09:37:19.487
2011-06-24T10:24:45.137
null
null
27,404
[ "iphone", "ios", "memory-management", "instruments" ]
6,466,282
1
6,466,392
null
20
10,456
Is there any free tool to style my C# Windows Forms, to make them look like Windows 7 Windows. `**EDIT**` In the designer mode, I have this : ![enter image description here](https://i.stack.imgur.com/BlBTQ.png) But when I run I get this : ![enter image description here](https://i.stack.imgur.com/N8Dwz.png) I don't know why I get that. (Old style) Thanks
Why do my forms look like 'Windows Classic'?
CC BY-SA 3.0
0
2011-06-24T10:02:58.977
2011-06-24T10:25:58.267
2011-06-24T10:25:58.267
346,297
346,297
[ "c#", ".net", "visual-studio", "windows-forms-designer", "skin" ]
6,466,350
1
6,467,708
null
0
10,690
I am using the below code to add row in jqGrid I click on the checkbox to see `id's` by using your code below ``` $(document).delegate('#list1 .jqgrow td input', 'click', function () { /*var grid = $("#list1 .jqgrow"); var rowid = grid.jqGrid('getGridParam', 'selrow');*/ var mydata = $("#list1").jqGrid('getGridParam','data'); var idToDataIndex = $("#list1").jqGrid('getGridParam','_index'); var id; for (id in idToDataIndex) { if (idToDataIndex.hasOwnProperty(id)) { console.info(id+", "+mydata[idToDataIndex[id]]['cfgName']); } } console.info("maxid "+id); }); ``` Here is my output in firebug ![enter image description here](https://i.stack.imgur.com/yx3CE.jpg) How i am getting `jqg1` in place of id? may be this is creating the problem ``` function addRow(cfgid,cfgname,hostname,cfgDesc,productId,cfgType,updateDate,emailAddress,absolutePath) { var myrow = {cfgid:cfgid, '':'', cfgName:cfgname, hostname:hostname, cfgDesc:cfgDesc, productId:productId,hostname:hostname,cfgType:cfgType,updateDate:updateDate,emailAddress:emailAddress,absolutePath:absolutePath}; $("#list1").addRowData(cfgid, myrow,"first"); $("#list1").trigger("reloadGrid"); $("#list1").sortGrid('updateDate', false, 'desc'); } ``` updateRow works fine as i used `currentrow` but how to use max id for adding a new row in `addRow`? ``` function updateRow(cfgid,cfgname,hostname,cfgDesc,cfgType,updateDate,emailAddress,absolutePath) { $("#list1").delRowData( currentrow ); $("#list1").trigger("reloadGrid"); var myrow = {cfgid:cfgid, '':'', cfgName:cfgname, hostname:hostname, cfgDesc:cfgDesc, productId:updateproductid,hostname:hostname,cfgType:cfgType,updateDate:updateDate,emailAddress:emailAddress,absolutePath:absolutePath}; $("#list1").addRowData(currentrow , myrow); $("#list1").sortGrid('updateDate', false, 'desc'); $("#list1").trigger("reloadGrid"); } ``` but is seems when the row is added it gets a duplicate `id` because when i try to select that row, 2 rows get selected. My full jqGrid code ``` var xmlDoc = $.parseXML(xml); $('#configDiv').empty(); $('<div width="100%">') .attr('id','configDetailsGrid') .html('<table id="list1" width="100%"></table>'+ '<div id="gridpager"></div>'+ '</div>') .appendTo('#configDiv'); var grid = jQuery("#list1"); grid.jqGrid({ datastr : xml, datatype: 'xmlstring', colNames:['cfgId','','Name', 'Host', 'Description','Product', 'Type', 'Last Updated Time','Last Updated By',''], colModel:[ {name:'cfgId',index:'cfgId', width:90, align:"right", hidden:true}, {name:'',index:'', width:15, align:"right",edittype:'checkbox',formatter: "checkbox",editoptions: { value:"True:False"},editable:true,formatoptions: {disabled : false}}, {name:'cfgName',index:'cfgName', width:90, align:"right"}, {name:'hostname',index:'hostname', width:90, align:"right"}, {name:'cfgDesc',index:'cfgDesc', width:90, align:"right"}, {name:'productId',index:'productId', width:60, align:"right"}, {name:'cfgType',index:'cfgType', width:60, align:"right"}, {name:'updateDate',index:'updateDate',sorttype:'Date', width:120, align:"right"}, {name:'emailAddress',index:'emailAddress', width:120, align:"right"}, {name:'absolutePath',index:'absolutePath', width:90, align:"right", hidden:true}, ], pager : '#gridpager', rowNum:10, scrollOffset:0, height: 'auto', autowidth:true, viewrecords: true, gridview: true, xmlReader: { root : "list", row: "com\\.abc\\.db\\.ConfigInfo", userdata: "userdata", repeatitems: false }, onSelectRow: function(id,status){ var rowData = jQuery(this).getRowData(id); configid = rowData['cfgId']; configname=rowData['cfgName']; configdesc=rowData['cfgDesc']; configenv=rowData['cfgType']; var ch = jQuery(this).find('#'+id+' input[type=checkbox]').attr('checked'); if(ch) { jQuery(this).find('#'+id+' input[type=checkbox]').attr('checked',false); } else { jQuery(this).find('#'+id+' input[type=checkbox]').attr('checked',true); } rowChecked=1; currentrow=id; }, onCellSelect: function(rowid, index, contents, event) { if(index==2) { $(xmlDoc).find('list com\\.abc\\.db\\.ConfigInfo').each(function() { //alert($(this).find('cfgId').text()+" "+configid); if($(this).find('cfgId').text()==configid) { configname=$(this).find('cfgName').text(); configdesc=$(this).find('cfgDesc').text(); configenv=$(this).find('cfgType').text(); filename=$(this).find('fileName').text(); updatedate=$(this).find('updateDate').text(); absolutepath=$(this).find('absolutePath').text(); productname=productMap[$(this).find('productId').text()]; } }); } } }); grid.jqGrid('navGrid','#gridpager',{edit:false,add:false,del:false}); ``` Where am i going wrong?
problem after adding row in jqgrid
CC BY-SA 3.0
null
2011-06-24T10:09:58.760
2011-06-24T12:39:39.267
2011-06-24T12:39:39.267
null
null
[ "jquery", "jqgrid" ]
6,466,426
1
6,466,582
null
0
669
i have a shop where quantities of cards are sold in 25, 50, 75, 100, 125, 150, 175 and 200. when i add a card, with a quantity of 175 to my basket, the cart total at the top of Magento displays "MY Cart (175 Items)". Obvoulsy it's adding up the quantities, rather than the actual product count. How would i edit this? What templates is this read from? Here's a picture to show you what i mean. ![enter image description here](https://i.stack.imgur.com/XWg41.png)
Change how magento calculates "items in cart"
CC BY-SA 3.0
null
2011-06-24T10:17:49.720
2011-06-24T10:32:36.477
null
null
164,230
[ "php", "html", "magento", "shopping-cart" ]
6,466,557
1
6,492,056
null
1
186
I am transforming xml in an object of an own class called "V6BasicCar", the problem that I'm having is that if I enable the Java cache (in Java control panel): ![enter image description here](https://i.stack.imgur.com/P532Z.gif) each transformation takes about 3-4 seconds, but if I disable caching, it takes just miliseconds. I don't know why this happens, my only guess is that Java is caching the ByteArrayStream per transformation and that makes it slower, but I haven't figured out how to deal with this problem. Is there any alternative to ByteArray Stream that would be faster? Thanks. The code: ``` { .. ByteArrayOutputStream out = new ByteArrayOutputStream(); //1. transform xml transform(getSourceXml(_intype), out); //2. convert to bean XsdConverter<V6BasicCar> v6BasicCarXsdConverter = new XsdConverter<V6BasicCar>(V6BasicCar.class); /* "getObject()" takes about 2 secs */ V6BasicCar newV6BasicCar = v6BasicCarXsdConverter.getObject(convert(out)); .. } protected InputStream getSourceXml(final CsvWrapperMiddle _csvV6Car) throws IOException, JAXBException { ByteArrayOutputStream out = new ByteArrayOutputStream(); /* "getXml" takes about 2 secs */ xsdConverter.getXml(_csvV6Car.getExternalBean(), out); InputStream output = convert(out); return output; } protected InputStream convert(ByteArrayOutputStream out) { return new ByteArrayInputStream(out.toByteArray()); } ```
Java Applet slow when using ByteArrayStream
CC BY-SA 3.0
null
2011-06-24T10:30:17.643
2011-06-27T11:20:18.660
null
null
2,207,432
[ "java", "caching", "applet", "iostream" ]
6,466,686
1
6,473,954
null
0
424
I've just started to develope an LWUIT MIDlet with standard LWUITTheme.res. I added 2 commands (Exit, Search) on my first form, but they appear with no style (black on white). ![Commands rendere with no style](https://i.stack.imgur.com/d1GUg.png) Instead, other 2 commands (Back, Details) on a second form, showed on Search command click, are rendered styled in white on blue, with a blue gradient background. ![Commands rendere with style](https://i.stack.imgur.com/2VXoD.png) The first form has a BorderLayout, the second has no particular layout set. Since I haven't changed commands style in my code, I would expect that their appearance be the same in the first as in the second form, and precisely as they appear in the second form. Am I wrong? Regards -- After @Bhakki first reply, regarding `SoftButton`s, I've checked the `{$LWUIT_FOLDER}/LWUITDemo/src/LWUITTheme.res` file. ![Command and SoftButton unselected appearing in LWUITTheme.res](https://i.stack.imgur.com/kOElR.png) As you can see, both `Command` and `SoftButton` has in the .res file. It seems that the commands in the first form are styled as `Command`, and those in the second form are styled as `SoftButton`. But I added them in the same way in both forms. Am I doing something wrong?
LWUIT 1.4 Plain commands Vs. Styled commands with LWUITTheme.res
CC BY-SA 3.0
null
2011-06-24T10:44:13.193
2011-06-24T21:28:58.517
2011-06-24T12:42:53.477
236,362
236,362
[ "java-me", "command", "lwuit" ]
6,466,824
1
6,466,886
null
0
196
I am trying to use jCarousel ([http://sorgalla.com/projects/jcarousel/](http://sorgalla.com/projects/jcarousel/)) I have set up most part of it. When i click next.. only one element is shown instead of two. ![enter image description here](https://i.stack.imgur.com/egrg7.png) Link: [http://bakasura.in/king/elements/jcarousel/examples/static_circular.html](http://bakasura.in/king/elements/jcarousel/examples/static_circular.html)
Jquery Carousel problem
CC BY-SA 3.0
null
2011-06-24T10:59:00.433
2011-06-24T11:08:00.903
null
null
155,196
[ "jquery", "jquery-plugins", "jcarousel", "carousel" ]
6,466,871
1
null
null
0
428
I'm trying to figure out how to find a point along a line (half way, to be precice). I need this to put a particle emitter in the correct location to leave a smoke-trail after bullets. I've got point A and point C. Point A is the barrel-muzzle, and point C is found using ray-cast. Now, in order to put the emitter in the right location I need to find point D. How do one do this? I attached a picure to make it more visual. No, I could not attach the picture, but here's a link. ![enter image description here](https://i.stack.imgur.com/pgBZG.png) Thanks in advance. -Pimms
Find a point along an angled line
CC BY-SA 3.0
null
2011-06-24T11:04:52.120
2011-06-24T14:04:55.050
2011-06-24T14:04:55.050
128,940
785,060
[ "math", "line", "point" ]
6,466,892
1
6,467,940
null
7
4,787
I am writing a fairly complex iPad app - my first bigger one. This app has some custom UIViews that present fairly complex data, including a table. These views do not take up the whole screen, and there can (and likely will) be many of them on screen at any time (though only one would be in an "expanded" state where the table is shown). Here's a basic example that should convey the basic principle: ![Made with the nice Antetype prototyping app](https://i.stack.imgur.com/CgaY6.png) Please note that these things are not supposed to be in popovers; instead, the FamilyViews expand to show their detailed data. (And please also note that this mockup was only created for the sake of this question and has little to do with how my interface is going to look; I know this is not good screen design) - - - I'm tending towards making each of these "FamilyViews" delegate and datasource for their own tables. Action on these tables will have to be coupled to the FamilyView's delegate (the ViewController), but that shouldn't be a problem, should it?
Custom UIView as UITableView delegate and datasource?
CC BY-SA 3.0
0
2011-06-24T11:08:33.990
2011-06-24T12:40:59.063
2011-06-24T12:30:35.463
534,888
534,888
[ "objective-c", "cocoa-touch", "ipad", "uitableview", "uiview" ]
6,467,063
1
6,467,131
null
14
12,907
My designer has designed a border with a diamond shape on the border corners. See image below. ![Diamond Border](https://i.stack.imgur.com/3RsZ2.jpg) The way I'd go about achieving this would be to save the diamond shape as an image, create a 1px solid border and then place the diamond shape absolutely positioned on the four corners. While this works I'm sure there is a much smarter way to do this without the additional mark up. Maybe using something like :after in css? How would I do this, or is there a better way? I need to have this compatible with IE8+ but if it works with IE7+ even better.
Smart way to add corner image to DIV border on all four corners
CC BY-SA 3.0
0
2011-06-24T11:24:15.217
2011-06-24T11:51:37.137
null
null
367,154
[ "css", "border" ]
6,467,307
1
6,468,154
null
1
398
I recently made an app on a Mac running OS X 10.6. I now want that app to work on 10.5.x systems. I changed the target build in xcode from 10.6 to 10.5 in the project settings which led to some code changes. But when I try it on 10.5 it just shows a "stop-sign" on the app-icon: ![](https://web.archive.org/web/20140120042605/http://img696.imageshack.us/img696/2772/screenshot20110624at104.png) These are my Xcode build settings: [](https://i.stack.imgur.com/OBrTj.png) What should I do?
How to make a Mac app made in 10.6 work in 10.5
CC BY-SA 4.0
null
2011-06-24T11:45:56.710
2019-08-11T09:52:27.320
2020-06-20T09:12:55.060
-1
null
[ "xcode", "cocoa", "osx-snow-leopard", "compatibility", "osx-leopard" ]
6,467,403
1
6,467,457
null
0
1,741
i'm trying to fix this forum where html entities are not displayed correctly. since the owner is m.i.a. i'm trying to do this with an extension. what i see on my screen: ``` euro:&#8364; pound:&#163; ``` view of the html DOM with firebug ![bit of html-dom as seen with firebug](https://i.stack.imgur.com/baXhn.png) my code: ``` GM_log('before text= '+text); text.replace( /amp;/gi, function( $0 ) { GM_log('$0= '+$0); fix=""; return fix; }); GM_log(' after text= '+text); ``` which returns: ``` before text= euro: &amp;#8364; <br>pound: &amp;#163; $0= amp; $0= amp; after text= euro: &amp;#8364; <br>pound: &amp;#163; ``` so my code seems to be working until the point it has to replace. are those rectangles preventing it? did i do something wrong? and if so how can i fix this? thanks.
how to replace &amp;#8364; into &#8364; with javascript?
CC BY-SA 3.0
null
2011-06-24T11:53:44.133
2011-06-24T11:58:07.450
2020-06-20T09:12:55.060
-1
570,512
[ "javascript", "html" ]
6,467,570
1
6,467,630
null
0
3,769
I have a simple question; hope you can help me. I have coded a webpage with Dreamweaver CS5.5, and when I click Live view, it does not load properly (like CSS file is not loaded).![This is the screenshot](https://i.stack.imgur.com/fVZYV.png) Is there any way to fix this ? Thanks
Dreamweaver CS5.5 live view doesn't work properly
CC BY-SA 3.0
null
2011-06-24T12:08:37.923
2012-06-07T15:23:57.587
null
null
570,763
[ "dreamweaver" ]
6,467,732
1
6,583,339
null
4
1,201
Can anyone shed any light on how Apple achieve the tableview cells which appear on the tab? I'm specifically referring to how they draw the border, and how they seem to get it to blend with the underlying green noisey texture. I've tried drawing my own borders using Quartz 2D but cannot seem to get anywhere near the same quality, and I thought drawing with a color which had a low alpha component would achive the texture blending but this doesn't seem to be the case. If anyone can shed any light, or even share any approriate code I would be incredibly greatful. EDIT: Something I've noticed is that the tableview doesn't conform to usual behaviour. In a normal grouped tableview the background is stationary and the cells scroll over it, but in Game Center () the background scrolls with the cells. This is leading me to believe that the tableview is not grouped at all, and this is but an illusion mixing Quartz 2D drawing and images. EDIT: So I've done a little poking around, and it does seem as though Apple a creating an illusion of a grouped tableview by using a standard tableviewcell, a seamless texture, a border texture and a cell mask. All this combined pulls off that illusion and supports my reasoning about why the background scrolls with the cells (). Game Center cell background texture () ![Cell Background](https://i.stack.imgur.com/EkEh4.png) Game Center cell border texture ![Game Center cell border texture](https://i.stack.imgur.com/riPdD.png) Game Center cell mask ![Game Center cell mask](https://i.stack.imgur.com/RNww7.png) Now I've just got to figure out how they combine all these together to pull off this illusion. Any help will be greatly appreciated. The differences between the actual Game Center table and the solution @psycho suggested below which you can see is still some way off; the cell widths are too narrow, the border too thin and the corner radius too large. ![@psycho solution](https://i.stack.imgur.com/UXopm.png)
Drawing Game Center like tableview cells
CC BY-SA 3.0
0
2011-06-24T12:23:03.970
2011-07-05T14:07:55.187
2011-07-05T14:07:55.187
null
null
[ "iphone", "objective-c", "ios", "quartz-2d", "game-center" ]
6,468,104
1
6,468,180
null
0
629
I have a series of file( with format shown in below) with different names such as: 100107_902988_6188DAAXX_s_6.sorted 100107_902988_6188DAAXX_s_7.sorted (if you notice only the part 6 and 7 are different in the file name) ![enter image description here](https://i.stack.imgur.com/DwzAJ.png) I would like to have the average of the last column with numbers (column number 8 the one which start with 15) for all these files! if possible in a text file such as: 100107_902988_6188DAAXX_s_6.sorted : 15 (or what ever the average is) 100107_902988_6188DAAXX_s_7.sorted : 17 I tried with the data.split command and then using e[7] column but I got the average of each line!!!! such as 3 for 15 (which I assume that my script made the 1+5/2) I wonder if someone can help me thanks in advance!
How to calculate the average of only one column in a series of file with python?
CC BY-SA 3.0
null
2011-06-24T12:57:08.840
2011-06-24T13:09:23.197
null
null
752,007
[ "python", "average", "series" ]
6,468,109
1
8,846,207
null
11
46,052
Am working on web Services... and am a beginner, Am trying to get Oracle Db connection in a service File and am getting below error: ``` javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at DatabaseConnection.shamDBConn.getShamStage(shamDBConn.java:25) at lineItemPrice.itemDetails.getUserId(itemDetails.java:17) at ServerSevices.availableServices.useridService(availableServices.java:11) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194) at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102) at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40) at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176) at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) ``` And refered below link for DB configuration in Apache Tomcat 6.0.32 with Oracle 10g [http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html](http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html) n i have made settings like below: ![enter image description here](https://i.stack.imgur.com/xpLZt.png) And am getting error for below line: ``` DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle"); ``` Am i missing something....? Thank you.........
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
CC BY-SA 3.0
0
2011-06-24T12:57:51.693
2019-01-17T14:23:53.787
null
null
659,952
[ "web-services", "jdbc", "error-handling", "tomcat6" ]
6,468,637
1
6,475,222
null
1
1,014
I have been using CouchDB for quite sometime without any issues. That is up until now. I recently saw something in my map/reduce results which I had overlooked! This is before performing a `sum` on the "avgs" variable. I'm basically trying to find the average of all values pertaining to a particular key. Nothing fancy. The result is as expected. Note the result for timestamp 1308474660000 (4th row in the table): ![Before summing avgs](https://i.stack.imgur.com/HA1Ap.png) --- Now I `sum` the "avgs" array. Now here is something that is peculiar about the result. The sum for the key with timestamp 1308474660000 is a `null`!! Why is CouchDB spitting out `null`s for a simple `sum`? I tried with a custom addition function and its the same problem. ![enter image description here](https://i.stack.imgur.com/JbBAu.png) Can someone explain to me why is there this issue with my map/reduce result? CouchDB version: 1.0.1 --- After doing a rereduce I get a reduce overflow error! ``` Error: reduce_overflow_error Reduce output must shrink more rapidly: Current output: '["001,1,1,1,1,1,11,1,1,1,1,1,1,11,1,1,1,1,1,1,11,1,1,1,1,1,1,11,1,1,1,1,1,101,1,1,1,1,1,1,11,1,1,1,1'... (first 100 of 396 bytes) ``` This is my modified reduce function: ``` function (key, values, rereduce) { if(!rereduce) { var avgs = []; for(var i=values.length-1; i>=0 ; i--) { avgs.push(Number(values[i][0])/Number(values[i][1])); } return avgs; } else { return sum(values); }; } ``` --- Well now it has gotten worse. Its selectively rereducing. Also, the ones it has rereduced show wrong results. The length of the value in 4th row for timestamp (1308474660000) should be 2 and not 3. ![enter image description here](https://i.stack.imgur.com/cZT3h.png) I finally got it to work. I hadn't understood the specifics of rereduce properly. AFAIK, Couchdb itself decides how to/when to rereduce. In this example, whenever the array was long enough to process, Couchdb would send it to rereduce. So I basically had to `sum` twice. Once in reduce, and again in rereduce. ``` function (key, values, rereduce) { if(!rereduce) { var avgs = []; for(var i=values.length-1; i>=0 ; i--) { avgs.push(Number(values[i][0])/Number(values[i][1])); } return sum(avgs); } else { return sum(values); //If my understanding of rereduce is correct, it only receives only the avgs that are large enough to not be processed by reduce. } } ```
Peculiar Map/Reduce result from CouchDB
CC BY-SA 3.0
null
2011-06-24T13:41:42.193
2012-04-04T17:32:30.343
2011-06-25T06:01:29.493
277,537
277,537
[ "nosql", "couchdb", "mapreduce" ]
6,468,738
1
6,746,030
null
5
7,805
I'm trying to create a 'glow' effect using the Android Path class. However, the gradient is not being warped to fit around the path. Instead, it is simply being display 'above' it and clipped to the path's stroke. Using a square path, the image below shows what I mean: ![Path-gradient fail](https://i.stack.imgur.com/kne9q.png) Instead, that should look more like this: ![enter image description here](https://i.stack.imgur.com/xIUBC.png) In other words, the gradient follows the path, and in particular wraps around the corners according to the radius set in the CornerPathEffect. Here is the relevant part of the code: ``` paint = new Paint(); paint.setStyle(Style.STROKE); paint.setStrokeWidth(20); paint.setAntiAlias(true); LinearGradient gradient = new LinearGradient(30, 0, 50, 0, new int[] {0x00000000, 0xFF0000FF, 0x00000000}, null, Shader.TileMode.MIRROR); paint.setShader(gradient); PathEffect cornerEffect = new CornerPathEffect(10); paint.setPathEffect(cornerEffect); canvas.drawPath(boxPath, paint); ``` Any ideas? --- Another alternative is to get a 'soft-edged brush' effect when defining the stroke width. I've experimented with BlurMaskFilters, but those give a uniform blur rather than a transition from opaque to transparent. Does anyone know if that's possible?
Using a gradient along a path
CC BY-SA 3.0
0
2011-06-24T13:49:04.540
2018-07-17T16:04:04.637
2011-07-07T17:50:58.683
235,654
235,654
[ "android", "graphics", "path", "gradient", "shader" ]
6,468,745
1
6,469,631
null
0
356
Ok, so bear with me: as this is an Objective-C related question, there's obviously a lot of code and subclassing. So here's my issue. Right now, I've got an iPad app that programmatically creates a button and two colored UIViews. These colored UIViews are controlled by SubViewControllers, and the entire thing is in a UIView controlled by a MainViewController. (i.e. MainViewController = [UIButton, SubViewController, SubViewController]) Now, all of this happens as it should, and I end up with what I expect (below): ![viewtools](https://i.stack.imgur.com/XxsD9.png) However, when I click the button, and the console shows "flipSubView1", nothing happens. No modal view gets shown, and no errors occur. Just nothing. What I expect is that either subView1 or the entire view will flip horizontally and show subView3. Is there some code that I'm missing that would cause that to happen / is there some bug that I'm overlooking? viewtoolsAppDelegate.m ``` @implementation viewtoolsAppDelegate @synthesize window = _window; @synthesize mvc; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; mvc = [[MainViewController alloc] initWithFrame:self.window.frame]; [self.window addSubview:mvc.theView]; [self.window makeKeyAndVisible]; return YES; } ``` MainViewController.m ``` @implementation MainViewController @synthesize theView; @synthesize subView1, subView2, subView3; - (id)initWithFrame:(CGRect) frame { theView = [[UIView alloc] initWithFrame:frame]; CGRect sV1Rect = CGRectMake(frame.origin.x+44, frame.origin.y, frame.size.width-44, frame.size.height/2); CGRect sV2Rect = CGRectMake(frame.origin.x+44, frame.origin.y+frame.size.height/2, frame.size.width-44, frame.size.height/2); subView1 = [[SubViewController alloc] initWithFrame:sV1Rect andColor:[UIColor blueColor]]; subView2 = [[SubViewController alloc] initWithFrame:sV2Rect andColor:[UIColor greenColor]]; subView3 = [[SubViewController alloc] initWithFrame:sV1Rect andColor:[UIColor redColor]]; [theView addSubview:subView1.theView]; [theView addSubview:subView2.theView]; UIButton *aButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [aButton addTarget:self action:@selector(flipSubView1:) forControlEvents:(UIControlEvents)UIControlEventTouchDown]; [aButton setFrame:CGRectMake(0, 0, 44, frame.size.height)]; [theView addSubview:aButton]; return self; } - (void)flipSubView1:(id) sender { NSLog(@"flipSubView1"); [subView3 setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal]; [subView1 presentModalViewController:subView3 animated:YES]; } ``` SubViewController.m ``` @implementation SubViewController @synthesize theView; - (id)initWithFrame:(CGRect)frame andColor:(UIColor *)color { theView = [[UIView alloc] initWithFrame:frame]; theView.backgroundColor = color; return self; } ``` TLDR: modal view not working. should see flip. don't.
ModalViewController for Single Subview
CC BY-SA 3.0
null
2011-06-24T13:49:57.487
2011-06-24T14:58:22.863
null
null
809,150
[ "objective-c", "ios", "view", "controller", "modal-dialog" ]
6,468,813
1
6,469,076
null
53
143,312
I have got a user in my database that hasn't got an associated login. It seems to have been created without login. Whenever I attempt to connect to the database with this user I get the following error: ``` Msg 916, Level 14, State 1, Line 1 The server principal "UserName" is not able to access the database "DatabaseName" under the current security context. ``` I'd like to specify a login for this user so that I can actually use it to access the database. I've tried the following script to associate a login with the user. ``` USE [DatabaseName] ALTER USER [UserName] WITH LOGIN = [UserName] ``` But this gives me the following error: ``` Msg 33016, Level 16, State 1, Line 2 The user cannot be remapped to a login. Remapping can only be done for users that were mapped to Windows or SQL logins. ``` Is there any way I can assign a login to this user? I'd like to not have to start from scratch because this user has a lot of permissions that would need setting up again. in response to Philip Kelley's question, here's what I get when I run `select * from sys.database_principals where name = 'username'`. ![SQL User](https://i.stack.imgur.com/lcfY8.gif) Apologies for the size of the image, you'll need to open it in a new tab to view it properly. Ok, I've dropped the existing LOGIN as suggested by gbn, and I'm using the following script to create a new LOGIN with same SID as the user. ``` CREATE LOGIN [UserName] WITH PASSWORD=N'Password1', DEFAULT_DATABASE=[DatabaseName], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF, SID=0x0105000000000009030000001139F53436663A4CA5B9D5D067A02390 ``` It's now giving me the following error message, it appears that the SID is too long for the LOGIN's SID field. ``` Msg 15419, Level 16, State 1, Line 1 Supplied parameter sid should be binary(16). ``` Am I up the creek without a paddle?
Assign a login to a user created without login (SQL Server)
CC BY-SA 3.0
0
2011-06-24T13:55:23.163
2018-07-16T12:37:48.157
2011-06-24T15:21:06.450
39,277
39,277
[ "sql-server", "sql-server-2008" ]
6,468,918
1
null
null
2
1,904
How do i get this? Which control shows some text when i keep the mouse cursor there for a while? ![enter image description here](https://i.stack.imgur.com/RaP1I.png) Edit: I have a timeline in my program. I want the tooltip to show the time value in milliseconds at the point where the mouse cursor is... Is it possible to have a flexible tooltip over a control?
Control to show text based on where mouse pointer is
CC BY-SA 3.0
null
2011-06-24T14:04:56.770
2012-12-07T06:28:47.810
2011-06-24T14:19:19.723
782,900
782,900
[ "c#", ".net", "winforms", "controls" ]
6,468,990
1
6,472,694
null
2
4,505
![My question](https://i.stack.imgur.com/TojY0.gif)
keyboard shortcut csv file column header width autofit in excel
CC BY-SA 3.0
0
2011-06-24T14:10:32.967
2011-06-24T21:26:10.210
2011-06-24T21:26:10.210
666,490
666,490
[ "c#", "vb.net", "excel", "csv", "export-to-csv" ]
6,469,033
1
6,469,077
null
4
201
I'm trying to use the System.Drawing.Color namespace. I'm not able to define it at the top of the class: ![enter image description here](https://i.stack.imgur.com/lC3Dk.jpg) However, I can reference it within the class. That is, I can use this line of code, and it works: ``` txtBox.BackColor = System.Drawing.Color.LightPink; ``` ... but I'd rather just be able to do this: ``` txtBox.BackColor = Color.LightPink; ``` If it's a matter of a missing reference/dll, why am I able to make reference to System.Drawing.Color in my code?
Weird issue with namespace
CC BY-SA 3.0
null
2011-06-24T14:13:27.843
2011-06-24T14:55:19.183
2011-06-24T14:26:40.680
2,084
590,719
[ "c#", "asp.net", "winforms", "using-statement" ]
6,469,051
1
6,469,543
null
6
2,864
A x64-DLL injected into a x64-process hooking a x86-DLL fails using C++ and EasyHook. It works if Loader, InjectionLibrary and InjectionTarget(it's available in both versions and i need both to be hooked) are x86. Getting the address of the exported procedure(GetProcAddress itself) isn't a problem at x64. The InjectionTarget has HookTarget(Kernel32.dll) as a dependency at x64 aswell. LhInstallHook(...) returns STATUS_NOT_SUPPORTED where the source comments say that happens when: "The target entry point contains unsupported instructions." Due to the fact that the source is fine for x86 builds i've decided to not add it. I've scratched a little diagram ![enter image description here](https://i.stack.imgur.com/nH585.png)
A x64-DLL injected into a x64-process hooking a x86-DLL fails using C++ and EasyHook
CC BY-SA 3.0
0
2011-06-24T14:15:06.413
2021-07-06T19:42:51.367
2021-07-06T19:42:51.367
3,195,477
814,161
[ "c++", "hook", "32bit-64bit", "32-bit", "easyhook" ]
6,469,102
1
6,469,744
null
1
417
C# WinForms: I am trying to find a good way for my resizing issue in this picture attached. the blue area: I want it to have a FIXED sized regardless of the Form size. the red area: I want it to Resize when I resize the form. The Only time I want the Blue area to Resize properly is when I change the language so some non-English lang so if the translated text in labels, check boxes,etc gets longer well I want it to still fit in there. I thought I can use TableLayout with two columns, drop a Panel inside the left column of this table layout and draw my controls inside it,... but how I can keep the left panel on a Fixed size for the blue area that meets my requirements ? Thanks ![enter image description here](https://i.stack.imgur.com/wmVlZ.png)
Some ideas for creating a re-sizable UI form
CC BY-SA 3.0
null
2011-06-24T14:18:16.297
2011-06-24T15:06:59.257
null
null
320,724
[ "c#", "winforms" ]
6,469,173
1
6,469,221
null
2
841
I am working on an app that disallows rotation unless a movie is playing. I have the app rotated just fine, but the issue comes about when I try to view the movie. The simulator is forced to rotate, but the movie does not. An example of this is below: ![Movie Player Error](https://i.stack.imgur.com/Tg6qV.png) I can't figure out how to rotate the movie too. I am looking to rotate only the subview. My code is below: ``` MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:finalURL]]; if ([moviePlayer respondsToSelector:@selector(setFullscreen:animated:)]) { // Use the 3.2 style API moviePlayer.controlStyle = MPMovieControlStyleDefault; moviePlayer.shouldAutoplay = YES; [self.view addSubview:moviePlayer.view]; [moviePlayer setFullscreen:YES animated:YES]; [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO]; // Rotate the view for landscape playback [[moviePlayer view] setBounds:CGRectMake(0, 0, 480, 320)]; [[moviePlayer view] setCenter:CGPointMake(160, 240)]; [[moviePlayer view] setTransform:CGAffineTransformMakeRotation(M_PI / 2)]; // Set frame of movieplayer [[moviePlayer view] setFrame:CGRectMake(0, 0, 480, 320)]; } else { // Use the 2.0 style API moviePlayer.movieControlMode = MPMovieControlModeHidden; [moviePlayer play]; } } ``` I tried `[moviePlayer setOrientation UIInterfaceOrientationLandscapeRight];` but the complier gives me an error and nothing happens
iPhone Movie Rotation For Only Subview
CC BY-SA 3.0
null
2011-06-24T14:23:01.880
2011-06-24T18:55:24.943
2011-06-24T18:55:24.943
616,454
616,454
[ "iphone", "objective-c", "xcode", "rotation", "mpmovieplayercontroller" ]
6,469,205
1
6,469,398
null
27
8,023
First, let me say that I abominate this feature in Windows Vista and Windows 7. Second, I want to do it. [Here](https://stackoverflow.com/questions/1218394/how-can-i-toggle-the-main-menu-visibility-using-the-alt-key-in-wpf) is a question asking how to do what I want here, in WPF. I want to do the same thing, but in Delphi, using VCL stock components, TMainMenu or Action Manager menus, or some available third party components, even Toolbar2000 or some other library. Feature of Windows Vista/Windows 7 explorer main-menus: - - - - - (* Windows Explorer Hotkeys Example: Ctrl+A in Microsoft Windows Explorer selects all even when the menus are invisible, Alt+T = bring up Tools popup menu, even when the whole menu is hidden). ![enter image description here](https://i.stack.imgur.com/xg9NC.png) Demo using accepted answer can be downloaded [here](https://skydrive.live.com/?cid=f5bb35ae00415bc7&sc=documents&id=F5BB35AE00415BC7!245#). (HiddenMenu.zip)
Hidden Main Menu in a delphi program, automatically shown using Alt key
CC BY-SA 3.0
0
2011-06-24T14:25:41.117
2011-06-24T18:07:52.097
2017-05-23T12:01:43.717
-1
84,704
[ "delphi", "menu", "delphi-xe" ]
6,469,288
1
6,474,799
null
1
203
Considering the following : ``` Manipulate[ If[Intersection[Row1, Row2] == {}, Style[Plus @@ {Plus @@ Row1, Plus @@ Row2}, Bold, 20], "Error"], {{Row1, {1}}, {1, 2, 3, 4, 5}, ControlType -> TogglerBar}, {{Row2, {2}}, {1, 2, 3, 4, 5}, ControlType -> TogglerBar} ] ``` ![enter image description here](https://i.stack.imgur.com/cHoDC.png)
Adding Alignment to a Manipulate Ouput in Mathematica
CC BY-SA 3.0
null
2011-06-24T14:31:17.643
2015-08-06T11:12:09.000
2015-08-06T11:12:09.000
1,743,957
769,551
[ "coding-style", "alignment", "wolfram-mathematica" ]
6,469,415
1
6,471,542
null
0
340
I'm running into an interesting issue with jQuery templates. I want to be able to get a dynamic template via JSON (which I have working) and then data to match that template via JSON, which is where my problem lies. Here is what I have for the template stuff: ``` $.getJSON('@Url.Action("GenerateAdminTemplate", "Home", new { area = "" })', function (data) { if (data.Success) { adminListTemplate = data.Result; $("#adminListHeader").html(data.Header); $.getJSON('@Url.Action("GenerateAdminSheet", "Home", new {area = ""})', function (dataz) { if (dataz.Success) { $("#templateListing").text(data.Result); $("#markupBeforeTemplateListing").text(dataz.Result); var myTemplate = $.template(null, data.Result); //var arr = [ // { Name: "User1", Administrator: "yes", Supervisor: "no", User: "yes" }, // { Name: "User2", Administrator: "yes", Supervisor: "no", User: "no" } //]; var arr = dataz.Result; $.tmpl(myTemplate, arr).appendTo("#adminListBody"); } else { } }); } else { } }); ``` The template itself comes back and is successful. When I uncomment the hardcoded array (arr) and use that instead of the returned value, the table appears EXACTLY as I expect it to. When I use the JSON returned data however, I get something that looks like this (I removed the username, which is the blank space on the left): ![jQueryTemplateResult](https://i.stack.imgur.com/Om6yj.jpg) The data that comes back from the JSON request is 100% identical to the "hardcoded" array (arr). I've used Beyond Compare on the results and they are 100% identical. For thoroughness: Here is the code that returns the JSon Data: ``` public JsonResult GenerateAdminSheet() { bool success = false; String errorMessage = String.Empty; StringBuilder result = new StringBuilder(); try { List<String> listOfUsersAndRoles = new List<String>(); using (DataUtilityEntities data = new DataUtilityEntities(ConfigurationManager.ConnectionStrings["DataUtilityConnection"].ConnectionString)) { List<User> users = data.Users.ToList(); foreach (User u in users) { List<Role> rolesUserBelongsTo = data.UserInRoles.Where(o => o.UserId == u.UserId).Select(p => p.Role).ToList(); CustomDictionary allRoles = new CustomDictionary(); //add the username as the first entry in the dictionary allRoles.Add("Name", u.Username); List<Role> allRolesList = data.Roles.ToList(); foreach (Role r in allRolesList) { allRoles.Add(String.Format("{0}", r.Name), rolesUserBelongsTo.Exists(p => p.Name == r.Name) ? "yes" : "no"); } listOfUsersAndRoles.Add(allRoles.ToString()); } } //We have the list of the objects to pass back, now we just need to format them so they will work properly result.Append("["); foreach (String item in listOfUsersAndRoles) { result.Append(item); if (listOfUsersAndRoles.Last() != item) result.Append(", "); } result.Append("]"); success = true; } catch (Exception e) { success = false; errorMessage = String.Format("@There was an error: {0}{1}", e.Message, e.InnerException == null ? String.Empty : String.Format("@({0})", e.InnerException.Message)); } return Json(new { Success = success, ErrorMessage = errorMessage, Result = result.ToString() }, JsonRequestBehavior.AllowGet); ``` CustomDictionary is just an override of the .ToString(): ``` public override string ToString() { StringBuilder result = new StringBuilder(); result.Append("{ "); foreach (var pair in this) { result.Append(String.Format("{0}: \"{1}\"{2}", pair.Key, pair.Value, this.Last().Key == pair.Key ? String.Empty : ", ")); } result.Append(" }"); return result.ToString(); } ``` Is there something Im missing when the result comes back from the JSon Request?
jquery templates with a JSON call for the template and data
CC BY-SA 3.0
null
2011-06-24T14:42:05.960
2012-06-13T21:46:21.863
2012-06-13T21:46:21.863
727,208
158,722
[ "jquery", "asp.net-mvc", "jquery-templates" ]
6,469,656
1
6,573,001
null
0
1,867
My setup is like this. ``` <div id="header"> <div id="heading">Title</div> <div id="flow"> Enter Something: <input type="textbox" size="30" id="id" class="class" onkeyup="dosomething()" /> <input id="show" type="button" value="Add" onclick="dosomething()"> <input id="hide" type="button" value="Search" onclick="dosomething()"> <input id="hide1" type="button" value="Clear" onclick="dosomething()"> <input class="floatr" type="button" value="Val" onClick="dosomething()"> <input class="floatr" type="button" value="Val" onclick="dosomething()"> </div> <div id="flow1"> <textarea readonly="readonly" cols="56" rows="1" value="" id="Search" class="allSearch"/></textarea> <input class="floatr" type="button" value="val" onClick="dosomething()"> <input class="floatr" type="button" value="val" onClick="dosomething()"> </div> </div> ``` I did try this from a questions asked before but it doesn't seem to work. In chrome and firefox it works fine without the overflow and white-space, but I need to it work in IE6 and IE8(I know they are old but let's not go there, I don't like working in it myself) [HTML+CSS: How to force div contents to stay in one line?](https://stackoverflow.com/questions/5232310/htmlcss-how-to-force-div-contents-to-stay-in-one-line) ``` overflow: hidden; white-space: nowrap; ``` I am using jquery to show and hide depending on the action of the user. Not sure if that is messing it up. When I go to developers mode in IE two divs flow and flow1 are two rows instead of one. Any suggestions? Edit: CSS part ``` #heading { text-align:center; font-size:20px; } #header { background-color:#85C2FF; padding-bottom:.6em; padding-left:.4em; padding-right:.4em; white-space: nowrap; overflow: hidden; } .floatr { float:right; } ``` I did try putting the whitespace and overflow within #flow div but with no result. The javascript part is LONG(VERY LONG). @Mrchief I don't think the js has any relevance. Without clicking anything the page doesn't load properly. The CSS is included now. @Phil This is how it should look like - it does in chrome ![This is how it should look like - it does in chrome](https://i.stack.imgur.com/etMZa.jpg) ![This is how it looks like in IE. See the blue border that's the div flow. It's two rows. I am trying to display it in one row.](https://i.stack.imgur.com/8h6wO.jpg) This is how it looks like in IE. See the blue border that's the div flow. It's two rows. I am trying to display it in one row. Hope that's a bit clear now. Edit: Figured out the problem. The 'floatr' css is the problem. If I delete that everything moves the left and in one line. With float:right it moves to the right but to the next row. I am guessing that IE specific problem. Any insights? OK. Figured it out! The problem with this is when float:right is read IE doesn't know which line to start the float on so it moves to the next line. To solve the problem you can do this. Put the float code FIRST! ``` <div id="flow"> <input class="floatr" type="button" value="Val" onClick="dosomething()"> <input class="floatr" type="button" value="Val" onclick="dosomething()"> Enter Something: <input type="textbox" size="30" id="id" class="class" onkeyup="dosomething()" /> <input id="show" type="button" value="Add" onclick="dosomething()"> <input id="hide" type="button" value="Search" onclick="dosomething()"> <input id="hide1" type="button" value="Clear" onclick="dosomething()"> </div> ``` Hope this helps someone. I have been banging my head over this for the last two hours. Thanks for all your help guys.
Force a div to one line in internet explorer
CC BY-SA 3.0
null
2011-06-24T14:59:27.097
2011-07-04T14:48:03.223
2017-05-23T10:33:17.643
-1
783,204
[ "jquery", "html", "css" ]
6,469,801
1
6,469,933
null
4
645
How can I make a image float next to a centered box? What would be the correct HTML/CSS-code? Here's a outline of what I'm trying to make: ![enter image description here](https://i.stack.imgur.com/cPVBK.png) Thanks in advance.
How can I have an image float next to a centered div?
CC BY-SA 3.0
0
2011-06-24T15:11:49.277
2012-05-11T17:32:26.263
2012-05-11T17:32:26.263
44,390
814,301
[ "html", "css-float" ]
6,470,026
1
null
null
0
1,362
Is there a way to check if the requester of a document using the InfoPath form is the proponent and further check if that user is the division head? I can't seem to find a component on this under the Events Wizards. I used these tutorials as references: [here](http://www.youtube.com/watch?v=rx3Y-c6D_7k&feature=player_embedded) and [here](http://www.youtube.com/watch?v=oanH3xkIoO4&feature=related). I have here a screenshot on this issue. ![enter image description here](https://i.stack.imgur.com/ftxww.png) Please help. Thanks.
K2 BlackPearl User, Roles, Groups Validation
CC BY-SA 3.0
null
2011-06-24T15:25:01.677
2011-07-08T10:34:10.820
null
null
476,584
[ "sharepoint-2010", "k2", "infopath2010" ]
6,470,200
1
null
null
0
1,377
I want to use fully transparent Modal form in my application, with being able to fill it with partially-transparent image; For this, I used to remove all visible elements from the form and got the code below. ``` class WinScreenshotWindow : Form { public WinScreenshotWindow() { // Create from without erasing background with a color // Going not to use transparent form instead, it will produce context menu bugs in textboxes for child form this.SuspendLayout(); this.MaximizeBox = false; this.MinimizeBox = false; this.ShowIcon = false; this.ShowInTaskbar = false; this.FormBorderStyle = FormBorderStyle.None; this.StartPosition = FormStartPosition.Manual; this.ControlBox = false; this.Visible = false; this.Size = new Size(100, 100); this.Location = new Point(200, 200); this.ResumeLayout(); } protected override void OnPaintBackground(PaintEventArgs e) { // Erase Background Windows message: } protected override void OnPaint(PaintEventArgs e) { Rectangle clientRect = e.ClipRectangle; e.Graphics.FillRectangle(Brushes.Transparent, clientRect); } } static void Main() { Form form = new Form(); form.Size = new Size(400, 400); form.Show(); var ww = new WinScreenshotWindow(); ww.ShowDialog(form); } ``` But the result is something strange: ![Bug](https://i.stack.imgur.com/ZIcTW.png) When I remove filling in OnPaint(), it is not visible at all. The question is - why does this happen? If the background is transparent why do it shows the form in such way? And what can be done in this situation? Any help appreciated.
C# - Transparent modal form on a window
CC BY-SA 3.0
0
2011-06-24T15:37:43.240
2011-06-24T16:40:58.703
null
null
654,238
[ "c#", "forms", "graphics", "transparency" ]
6,470,263
1
6,471,943
null
15
11,177
I've got a simple if statement set up in a worksheet where the if condition is VBA user defined function: ``` Function CellIsFormula(ByRef rng) CellIsFormula = rng(1).HasFormula End Function ``` This function seems to work fine: ![Evaluate 1](https://i.stack.imgur.com/EusEg.png) ![Evaluate 2](https://i.stack.imgur.com/vzx1d.png) But for some reason that I can't figure out, the cell is evaluating to an error. What's worse, is when evaluating the formula, excel is attributing the error to a calculation step that doesn't produce an error: ![Evaluate 4](https://i.stack.imgur.com/WEUf2.png) ![Evaluate 5](https://i.stack.imgur.com/xYqE4.png) ![Evaluate 6](https://i.stack.imgur.com/p6oDi.png) To top it all off, and what really blows my mind, is that if I simply re-enter the formula, or force a full recalculation (++) - the formulas evaluate no problem! ![Re-Enter Formula](https://i.stack.imgur.com/Ra9N6.png) ![Calculation worked](https://i.stack.imgur.com/mTpOf.png) I've tried making the formula volatile by adding `Application.Volatile` to the function code, but it didn't change anything. Other methods to refresh the calculation, such as setting calculation to manual and then back to automatic, hidding "recalculate sheet", or just using or + do not work, only re-entering the formula or ++ will cause the function to recalculate properly. Changing one of the cells referenced in the if statement will not fix the problem, , changing the cell referenced by the "CellIsFormula" function, does fix the problem. Every time the sheet is re-opened though, the error is back.
Excel is calculating a formula with a VBA function as an error unless it is re-entered
CC BY-SA 3.0
0
2011-06-24T15:41:44.097
2013-07-24T07:42:54.010
2013-07-24T07:42:54.010
2,231,069
529,618
[ "excel", "vba", "user-defined-functions" ]
6,470,289
1
6,470,357
null
2
5,909
In XAML, I have: ``` <DataTemplate x:Key="AgeItemTemplate"> <Border BorderThickness="0,0,0,0" BorderBrush="#6FBDE8"> <TextBlock Margin="2" Text="{Binding Age}" VerticalAlignment="Center" Grid.Column="1" /> </Border> </DataTemplate> ``` How could I use that DataTemplate in code? ![enter image description here](https://i.stack.imgur.com/6ia2h.png) I know I can create a new template and linked to a gridview column but I want to define that template in xaml. Is there any way to modify and use that dataTemplate in code behind?
How to edit/use xaml datatemplate in code
CC BY-SA 3.0
null
2011-06-24T15:43:28.470
2017-10-30T10:31:43.417
2017-10-30T10:31:43.417
13,302
637,142
[ "c#", "xaml", "binding", "datatemplate" ]
6,470,310
1
null
null
1
346
I have shown a part of my Winform application here. The Top most part is the Timeline, The Vertical Lines there indicate the appearance of certain type of messages at those time Instants. Its is linked to the contents of the datagridview which is linked to a SQLite Database ![](https://i.stack.imgur.com/06zvp.png) In normal operation what happens is I load a database. And The database is shown in the datagrid view and then, different type of messages are marked in the Timeline by red/blue/yellow line. The Timeline can be scrolled horizontal by dragging the mouse across.. (i.e It doesnt have an explicit scroll bar) What I need to do now is that.. If I right click a point on the timeline and click on , The DGV down should automatically scroll down to that line in the DGV that has the same timestamp. How can this be done??
Linking two different controls
CC BY-SA 3.0
0
2011-06-24T15:44:50.777
2011-06-25T05:12:55.163
2011-06-24T17:14:43.327
782,900
782,900
[ "c#", ".net", "winforms", "sqlite", "datagridview" ]
6,470,645
1
6,556,857
null
2
2,396
I'm trying to lay out images in a grid, with a few featured ones being 4x as big. I'm sure it's a well known layout algorithm, but i don't know what it is called. The effect I'm looking for is similar to the screenshot shown below. Can anyone point me in the right direction? To be more specific, lets limit it to the case of there being only the two sizes shown in the example. There can be an infinite number of items, with a set margin between them. Hope that clarifies things. ![enter image description here](https://i.stack.imgur.com/Nw0f4.jpg)
Algorithm for laying out images of different sizes in a grid-like way
CC BY-SA 3.0
0
2011-06-24T16:11:18.523
2011-07-25T00:09:14.033
2011-06-25T01:36:03.440
2,712
2,712
[ "iphone", "objective-c", "algorithm", "layout" ]
6,471,059
1
6,471,108
null
0
98
How can I place a div at the bottom of another div (so within the bigger div) ? ![enter image description here](https://i.stack.imgur.com/kjYSK.png) Thanks in advance.
How can I place a div at the bottom of another div (so within the bigger div)?
CC BY-SA 3.0
null
2011-06-24T16:47:46.250
2011-06-24T16:53:39.830
null
null
814,301
[ "html" ]
6,471,095
1
6,472,779
null
5
907
I need to get the (Centroid) for components in a set of binary images with subpixel accuracy. Mathematica 8 comes with a nice addition: ``` i = Import@"http://i.stack.imgur.com/2pxrN.png"; m1 = ComponentMeasurements[MorphologicalComponents[i], "Centroid"] /. Rule[_, x_] -> x (* -> {{403.229, 453.551}, {660.404, 371.383}, {114.389, 434.646}, {295.5, 206.}} *) ``` But I went through some troubles when those results showed some inconsistencies with other calculations done elsewhere. So I rolled my own, perhaps not nice: ``` i = Import@"http://i.stack.imgur.com/2pxrN.png"; f[i_] := N@{#[[2]], ImageDimensions[i][[2]] - #[[1]]} & /@ ( Mean /@ Function[x, Map[ Position[x, #, 2] &, Complement[Union@Flatten[x], {0}]]] [MorphologicalComponents[i]]); f[i] Show[i, Graphics[{Red, Disk[#, 10] & /@ f[i]}]] (* -> {{403.729, 453.051}, {660.904, 370.883}, {114.889, 434.146}, {296., 205.5}} *) ``` ![enter image description here](https://i.stack.imgur.com/xmhVY.png) You can see that there is a .5 offset between these results: ``` Thread[Subtract[m1, f[i]]] (* -> {{-0.5, -0.5, -0.5, -0.5}, {0.5, 0.5, 0.5, 0.5}} *) ``` At first I thought that the problem was related with the image dimensions being even or odd, but that is not the case. I'd prefer using `ComponentMeasurements[ ..,"Centroid"]` and correcting the results, but I'm afraid future Mma versions may modify this behavior and spoil the results. I could also run a previous "calibration" with a known image and calculate the offsets, so it will auto-correct, but I would like to understand what is going on first. Is this a bug? Any ideas about why is this happening?
ComponentMeasurements[ _ ,"Centroid"] results offset
CC BY-SA 3.0
null
2011-06-24T16:50:56.327
2011-08-24T07:58:13.657
2011-08-24T07:58:13.657
618,728
353,410
[ "image-processing", "mathematica-8", "wolfram-mathematica" ]
6,471,122
1
6,471,199
null
1
456
I have a block-level element of unknown width. This element needs to be horizontally centered on the page, and its `position` needs to be `relative` so that its absolutely positioned child will show up in the right place. You can [see it in action here](http://jsfiddle.net/mlms13/vhUGL/). As far as I know, the best way to center an element of unknown width is to set its `display` to `table`. Semantically, this seems incorrect, because my element has nothing in common with a real table. Even worse, [Firefox doesn't apply position to tables](https://bugzilla.mozilla.org/show_bug.cgi?id=35168), so the absolutely positioned child shows up in the wrong spot: ![enter image description here](https://i.stack.imgur.com/FXEXm.png) Are there any workarounds for this that: - - I'd like a pure CSS fix, and I'm running out of ideas...
Center a relatively positioned element with unknown width in Firefox
CC BY-SA 3.0
null
2011-06-24T16:53:10.350
2013-01-09T12:03:28.937
2011-06-24T17:15:56.437
468,793
388,639
[ "html", "css", "layout" ]
6,471,131
1
6,471,157
null
1
1,167
So, I just wanted to use properties-files again, but currently I am just not able to load them! I've already wasted 1h of work just to get this working, but somehow I couldnt. My problem is similar to [this one](https://stackoverflow.com/questions/6296539/issue-loading-properties-file), but Java just doesn't get the file! Here's my code: package fast.ProfileManager; import java.io.FileInputStream; import java.util.Properties; import android.app.Activity; import android.content.Context; import android.net.wifi.WifiManager; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.CheckBox; import android.widget.Toast; ``` public class PMMain extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String defaultProfileProperties = "defaultProfile.properties"; Properties properties = new Properties(); properties.load(new FileInputStream(defaultProfileProperties)); ... ``` I've already tried to put an "/" infront of the filename, but it didnt work either. Here's my Project-Directory: ![enter image description here](https://i.stack.imgur.com/Et71g.jpg) I'm getting an IOException on the line "properties.load ... "
Properties-File won't get recognised!
CC BY-SA 3.0
0
2011-06-24T16:54:40.843
2011-06-24T16:57:09.717
2017-05-23T12:05:58.687
-1
715,888
[ "java", "android", "file", "properties" ]
6,471,281
1
6,471,498
null
1
189
I was creating a Syntax Highlighter in PHP but I was failed! You see when I was creating script comments (`//`) Syntax Highlighting (`gray`) , I was facing some problems. So I just created a shortened version of my Syntax Highlighting Function to show you all my problem. See whenever a PHP variable ,i.e., `$example`, is inserted in between the comment it doesn't get `grayed` as it should be according to my Syntax Highlighter. You see I'm using `preg_replace()` to achieve this. But the `regex` of it which I'm using currently doesn't seem to be right. I tried out almost everything that I know about it, but it doesn't work. See the demo code below. ``` <?php $str = ' <?php //This is a php comment $test and resulted bad! $text_cool++; ?> '; $result = str_replace(array('<','>','/'),array('[',']','%%'),$str); $result = preg_replace("/%%%%(.*?)(?=(\n))/","<span style=\"color:gray;\">$0</span>",$result); $result = preg_replace("/(?<!\"|'|%%%%\w\s\t)[\$](?!\()(.*?)(?=(\W))/","<span style=\"color:green;\">$0</span>",$result); $result = str_replace(array('[',']','%%'),array('&lt;','&gt;','/'),$result); $resultArray = explode("\n",$result); foreach ($resultArray as $i) { echo $i.'</br>'; } ?> ``` ![enter image description here](https://i.stack.imgur.com/xCnAV.jpg) So you see the result I want is that `$test` in the comment string of the 'Demo Screen' above should also be colored as `gray`!(See below.) ![enter image description here](https://i.stack.imgur.com/ziTFb.jpg) Can anyone help me solve this problem? ``` I'm Aware of highlight_string() function! ```
PHP Regex problem!
CC BY-SA 3.0
0
2011-06-24T17:08:19.833
2012-12-19T01:46:26.703
2012-12-19T01:46:26.703
367,456
637,378
[ "php", "html", "regex", "syntax" ]
6,471,302
1
6,471,470
null
3
583
Building up on [Sjoerd solution to add alignment to a manipulate object](https://stackoverflow.com/questions/6469288/adding-alignment-to-a-manipulate-ouput-in-mathematica) : Consider the following : ``` Manipulate[ Panel[Style[Row1, Bold, 20], ImageSize -> 150, Alignment -> Center] Panel[Style[Row2, Bold, 20], ImageSize -> 150, Alignment -> Center], {{Row1, {1}}, {1, 2, 3, 4, 5}, ControlType -> SetterBar,ControlPlacement -> Left}, {{Row2, {2}}, {1, 2, 3, 4, 5}, ControlType -> SetterBar,ControlPlacement -> Left}] ``` ![enter image description here](https://i.stack.imgur.com/K2aYW.png)
Adjust Panel Location in a Manipulate object in mathematica
CC BY-SA 3.0
0
2011-06-24T17:10:59.983
2015-08-06T11:12:00.900
2017-05-23T12:06:11.360
-1
769,551
[ "wolfram-mathematica", "panel", "setter" ]
6,471,429
1
6,471,478
null
4
2,254
There are a ViewController = VC1, and two views , view1 = "A" , view2 = "B". View "A" do horizontal flip and turns to "B". How do I solve the problem? Please, see the picture. ![enter image description here](https://i.stack.imgur.com/acXLC.png)
How can I do horizontal flip of two views. Please, see the picture
CC BY-SA 3.0
0
2011-06-24T17:21:45.627
2011-06-24T17:27:17.260
null
null
499,825
[ "iphone", "uiview", "uiviewcontroller", "uiviewanimationtransition" ]
6,471,624
1
6,477,098
null
2
1,091
In Winforms, is there a way to have a single DataGridView row span multiple lines? So that the cells of a single row can be stacked onto two lines. Something like this: ![enter image description here](https://i.stack.imgur.com/LVvHC.png)
One data row that spans multiple DataGridView lines
CC BY-SA 3.0
0
2011-06-24T17:40:41.700
2011-08-10T13:03:53.327
null
null
283,936
[ "winforms", "datagridview" ]
6,471,615
1
6,471,660
null
-1
88
when i made my website i made it with div tags not tables, which is what most people do, then i positioned them with the margin property and i have tried it with position:absolute, and relative properties but when i re-size my browser everything changes place, like this - ![enter image description here](https://i.stack.imgur.com/zhQgf.png) i want it to stay in place were it is like most websites that use div tags, when you re-size them they don't move, i wonder what trick they use... and by the way my website is still in progress lol... Thank You My Code ``` <html> <head> <title></title> <link rel = "stylesheet" type = "text/css" href = "verdanacssstylesheet.css" /> <script type="text/javascript" src="external files/jquery.js"></script> <!-----------START OF SCRIPT------------------------> <script type = "text/javascript" > </script> <!------------END OF SCRIPT AND START OF STYLE--> <style type = "text/css" > div {border:2px solid black;} </style> <!---------------END OF STYLE AND HEAD AND START OF BODY----------> </head> <body style="margin:0px;padding:0px;" text="black" > <div style="" > <div id = "header" style="100%;height:150px;" > <div id = "headerinside" style="margin-left:auto;margin-right:auto;width:1030px;height:150px;" ><div></div></div> </div> <div style="width:1030px;height:;margin-left:auto;margin-right:auto" > <div style = "border:2px solid red;height:30px;" id = "navigationbar" > <ul style = "list-style:none;" id = "navbar" > <li style = "float:left;padding-left:45px;line-height:3px;" >hello</li> <li style = "float:left;padding-left:120px;line-height:3px;" >hello</li> <li style = "float:left;padding-left:120px;line-height:3px;" >hello</li> <li style = "float:left;padding-left:120px;line-height:3px;" >hello</li> <li style = "float:left;padding-left:120px;line-height:3px;" >hello</li> <li style = "float:left;padding-left:120px;line-height:3px;" >hello</li> </ul> </div> <div id = "main" style=""> <div style="width:1026px;text-align:center;" ><p>hello</p></div> </div> <div id = "footer" style="100%;height:150px;" > <div id = "footerinside" style="margin-left:auto;margin-right:auto;width:1030px;;height:150px;" ><div></div></div> </div> </div> </body> <!---------------EDN OF BODY-------------------> </html> ```
Overflow on Website
CC BY-SA 3.0
null
2011-06-24T17:39:15.967
2013-08-09T13:59:12.743
2013-08-09T13:59:12.743
null
812,919
[ "css", "html", "xhtml" ]
6,471,626
1
6,496,200
null
0
3,402
I have 2 VBA macro codes that run in Outlook 2007. 1. Search and replace text by clicking a button in Compose Mail Window 2. Search and replace text by clicking a button in Inbox Message Window I need to create an application file to automatically install the buttons in the toolbar window for other users to run the macros. As far as I know, I need to use Visual Studio to create an add in and then I need to program it accordingly to perform the operation. Is there any other way to do the application file, or is using Visual Studio the only way? If using Visual Studio is the only way, I have seen some sample add ins that create buttons in the main Outlook 2007 window, but have not seen any sample add in that create buttons in the . I am using Visual Studio 2005 to create the add in for Outlook 2007. ![Sample image](https://i.stack.imgur.com/LWFcQ.jpg)
Create Add in Buttons in compose\read message window in Outlook 2007
CC BY-SA 4.0
null
2011-06-24T17:40:57.537
2021-05-25T14:00:58.800
2021-05-25T14:00:58.800
-1
803,700
[ "c#", "vba", "visual-studio", "outlook", "add-in" ]
6,471,781
1
6,471,869
null
1
3,146
I have a viewcontroller containing a TabController. Before this loads, I want a user to login so I can check what they have access to. In my AppDelegate, bot the rootViewController (with the tabs) and the LoginViewController are declared, and they're also wired up in IB: I have this in my AppDelegate: ``` - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // [window addSubview:[rootController view]]; [window addSubview:[loginViewController view]]; [self.window makeKeyAndVisible]; return YES; } ``` My plan was to dismiss the login form after authenticating and show the rootController, but the rootController displays straight away. I was going to do: ``` -(IBAction)DidClickLoginButton:(id)sender { NotesAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; [delegate.window addSubview:[delegate.rootController view]]; [self dismissModalViewControllerAnimated:YES]; } ``` ![iNotesAppDelegate](https://i.stack.imgur.com/SaBXJ.png) Is there an easier way to do this? I can't see why the LoginViewController isn't presented. Eventually got this working by adding it to the rootController in my AppDelegate's didFinishLaunchingWithOptions method ``` - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // [window addSubview:[rootController view]]; [self.window makeKeyAndVisible]; LoginViewController *loginViewController =[[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil]; [self.rootController presentModalViewController:loginViewController animated:YES]; return YES; } ```
Modal LoginView with iPhone
CC BY-SA 3.0
0
2011-06-24T17:51:39.043
2011-06-24T18:23:14.143
2011-06-24T18:16:20.547
30,512
30,512
[ "iphone", "ios", "ios4", "modalviewcontroller" ]
6,471,916
1
6,494,021
null
2
780
In my class I attempt to define 3 markers, one for errors, one for warnings, and one for breakpoints. This worked well when I was only attempting to define 2 markers, but for some reason the third of these markers doesn't appear when added to a line. If you switch the ordering of the definitions, it is always the third one that fails to appear when markerAdd() is called. The pixmaps are valid, and Scintilla's return values appear to be correct for both defining and adding markers. This is more of a general Scintilla question rather than a QScintilla question I believe, because QScintilla simply does some checks before calling the underlying scintilla code. I have no idea where to even begin in debugging this code. If anyone can shed some light on this, whether it is a known scintilla quirk or it is my fault, I would be eternally grateful. ``` m_errorIndicator = ui_editor->markerDefine(QPixmap(":/sourcefile/icon_set/icons/bullet_red.png")); m_breakIndicator = ui_editor->markerDefine(QPixmap(":/sourcefile/icon_set/icons/bullet_black.png")); m_warningIndicator = ui_editor->markerDefine(QPixmap(":/sourcefile/icon_set/icons/bullet_yellow.png")); void SourceFile::on_actionAddBreakpoint_triggered() { qWarning() << "Added breakpoint to " << m_currentLine; qWarning() << ui_editor->markerAdd(m_currentLine, m_breakIndicator); m_breakpoints.append(m_currentLine); } void SourceFile::on_actionRemoveBreakpoint_triggered() { ui_editor->markerDelete(m_currentLine, m_breakIndicator); m_breakpoints.removeAll(m_currentLine); } void SourceFile::clearProblems() { ui_editor->markerDeleteAll(m_errorIndicator); ui_editor->markerDeleteAll(m_warningIndicator); } void SourceFile::markProblems(const QStringList& errors, const QStringList& warnings) { foreach(const QString& error, errors) { int line = error.section(":", 1, 1).toInt(); if(--line < 0) continue; ui_editor->markerAdd(line, m_errorIndicator); } foreach(const QString& warning, warnings) { int line = warning.section(":", 1, 1).toInt(); if(--line < 0) continue; ui_editor->markerAdd(line, m_warningIndicator); } } ``` There should be a yellow bullet next to the printf statement. If the warning and breakpoint definitions are switched, the yellow bullet will show up and the black bullet will disappear. ![](https://i.stack.imgur.com/h384A.png)
Scintilla (QScintilla) 3rd marker define fails
CC BY-SA 3.0
null
2011-06-24T18:02:01.613
2016-01-11T12:20:22.767
null
null
183,604
[ "qt", "marker", "scintilla", "qscintilla" ]
6,471,924
1
6,472,148
null
9
29,550
I would like to produce a plot like the following in matlab. ![enter image description here](https://i.stack.imgur.com/h5eFf.png) Or may be something like this ![enter image description here](https://i.stack.imgur.com/yhNv6.jpg)
side by side multiply histogram in matlab
CC BY-SA 3.0
0
2011-06-24T18:02:26.753
2017-06-21T19:16:24.567
2013-02-05T20:11:16.537
102,441
702,846
[ "matlab", "histogram" ]
6,471,941
1
6,472,033
null
3
371
In my application resources I have: ``` <Application.Resources> <Border x:Key="border1" BorderBrush="{x:Null}" BorderThickness="0" Height="159" Width="5" > <Border.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFFC0C0C" Offset="0" /> <GradientStop Color="#63FF0000" Offset="0.999" /> <GradientStop Color="#6AFE0000" Offset="0.048" /> </LinearGradientBrush> </Border.Background> </Border> </Application.Resources> ``` I will like to add that border to a stack panel like: ``` Border temp = new Border(); temp = (Border)FindResource("border1"); temp.Name = "bar" + i; stackPanel1.Children.Add(temp); ``` This works fine. The only problem is that I would like to add two instances of that border. Therefore I have placed that inside a loop: ``` for (int i = 0; i < 10; i++) { Border temp = new Border(); temp = (Border)FindResource("border1"); temp.Name = "bar" + i; stackPanel1.Children.Add(temp); } ``` on the second iteration I get the error: ![enter image description here](https://i.stack.imgur.com/oqO63.png) But to me there does not seem to be a parse exeption because note how there is no problem on the first iteration: ![enter image description here](https://i.stack.imgur.com/iTlcO.png) How could I use a resource several times? I know I could create that resource dynamically but I need to actually use the resource.
How to use a resource twice?
CC BY-SA 3.0
0
2011-06-24T18:04:25.350
2011-06-24T18:18:38.353
null
null
637,142
[ "c#", "xaml", "resources", "resourcedictionary" ]
6,471,982
1
6,472,099
null
6
3,456
I made an html wich links to a CSS file, open it in browsers, and the styles show correctly. Then I load it in a WebView and the styles don't show. I even tried to insert a `<link>` into the DOM from Objective-C, which is my ultimate goal, but neither worked. Do I have to enable CSS on the webView somehow? edit: the CSS include in the html: `<link rel='StyleSheet' href="file://localhost/Users/petruza/Source/Scrape/build/Debug/Scrape.app/Contents/Resources/Scrape.css" type="text/css" >` the CSS inserted in the DOM: (I checked and it does get inserted) ``` NSURL *cssUrl = [[NSBundle mainBundle] URLForResource:@"Scrape.css" withExtension: nil]; DOMDocument* dom = [[web mainFrame] DOMDocument]; [window setTitleWithRepresentedFilename: lastRunScript]; DOMElement* link = [dom createElement:@"link"]; [link setAttribute:@"rel" value:@"StyleSheet"]; [link setAttribute:@"type" value:@"text/css"]; [link setAttribute:@"href" value: [cssUrl absoluteString]]; DOMElement* head = (DOMElement*) [[dom getElementsByTagName:@"head"] item:0]; DOMElement* headFirstChild = head.firstElementChild; if( headFirstChild ) [head insertBefore:link refChild:(DOMNode *)headFirstChild]; else [head appendChild:(DOMNode *)link]; ``` edit2: Same exact html shown in my WebView and in Safari: ![enter image description here](https://i.stack.imgur.com/T9KV9.png)
How do I make a WebKit WebView use a CSS style sheet?
CC BY-SA 4.0
0
2011-06-24T18:08:20.947
2021-02-08T15:21:17.263
2021-02-08T15:21:17.263
2,318,649
221,650
[ "css", "cocoa", "macos", "webkit", "webview" ]
6,472,602
1
6,473,545
null
5
3,349
I want to save the state of a multiple choice listview checkbox's. I have the following layout. ![enter image description here](https://i.stack.imgur.com/Wkuqz.png) What i want to do is to save the state of, for instance, "test1 and test3" and when i return to this activity this checkboxs are checked. I'm using shared preferences. I have the following code. This loads my list: ``` mList = (ListView) findViewById(R.id.ListViewTarefas); final TarefaDbAdapter db = new TarefaDbAdapter(this); db.open(); data = db.getAllTarefas(getIntent().getExtras().get("nomeUtilizadorTarefa").toString()); adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice,data); mList.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); mList.setAdapter(adapter); LoadSelections(); ``` and this is the following code loads and saves the state of the checkboxs (supposedly). ``` @Override protected void onPause() { // always handle the onPause to make sure selections are saved if user clicks back button SaveSelections(); super.onPause(); } private void ClearSelections() { // user has clicked clear button so uncheck all the items int count = this.mList.getAdapter().getCount(); for (int i = 0; i < count; i++) { this.mList.setItemChecked(i, false); } // also clear the saved selections SaveSelections(); } private void LoadSelections() { // if the selections were previously saved load them SharedPreferences settingsActivity = getPreferences(MODE_PRIVATE); if (settingsActivity.contains(data.toString())) { String savedItems = settingsActivity.getString(data.toString(), ""); this.data.addAll(Arrays.asList(savedItems.split(","))); int count = this.mList.getAdapter().getCount(); for (int i = 0; i < count; i++) { String currentItem = (String) this.mList.getAdapter().getItem(i); if (this.data.contains(currentItem)) { this.mList.setItemChecked(i, true); } } } } private void SaveSelections() { // save the selections in the shared preference in private mode for the user SharedPreferences settingsActivity = getPreferences(MODE_PRIVATE); SharedPreferences.Editor prefEditor = settingsActivity.edit(); String savedItems = getSavedItems(); prefEditor.putString(data.toString(), savedItems); prefEditor.commit(); } private String getSavedItems() { String savedItems = ""; int count = this.mList.getAdapter().getCount(); for (int i = 0; i < count; i++) { if (this.mList.isItemChecked(i)) { if (savedItems.length() > 0) { savedItems += "," + this.mList.getItemAtPosition(i); } else { savedItems += this.mList.getItemAtPosition(i); } } } return savedItems; } ``` Than i load the SaveSelections and Clear Selections methods in buttons. The problem is that this isn't working. can somebody help me please? My regards.
Multiple choice ListView and SharedPreferences
CC BY-SA 3.0
0
2011-06-24T19:07:46.127
2013-01-28T11:51:34.840
2011-06-25T19:53:27.647
670,488
670,488
[ "java", "android", "listview", "android-listview", "sharedpreferences" ]
6,472,722
1
null
null
-3
61
I have tried everything I could but the submit button isnt sending `something.php` the list of numbers that are added in the list..... [http://pastebin.com/0NexQW6a](http://pastebin.com/0NexQW6a) something.php's code: ``` <?php $username= $_POST['SUBMIT']; echo $username; ?> ``` When user clicks submit the values in the list should get POSTED to something.php...![enter image description here](https://i.stack.imgur.com/duitZ.png)
Javascript JQuery help PHP
CC BY-SA 3.0
null
2011-06-24T19:18:55.820
2011-06-24T19:36:11.383
2011-06-24T19:33:10.177
761,669
761,669
[ "php", "javascript", "jquery" ]
6,472,751
1
null
null
1
772
I am extending GWT [DialogBox](http://google-web-toolkit.googlecode.com/svn/javadoc/2.3/index.html) and my constructor looks like: ``` public MyBox() { setGlassEnabled(true); setAnimationEnabled(true); setWidth("400px"); VerticalPanel contents = new VerticalPanel(); contents.setWidth("400px"); // init widgets } ``` When I comment out second line everything works well. With animation enabled is the size of my dialog "broken". When I inspect HTML site the element has correctly 400px, but it just doesn't fully animate :/ I have few such widgets (animated boxes) and some (smaller ones) works well. What might be the problem? Thanks ![enter image description here](https://i.stack.imgur.com/gBntX.png) Here is weird thing. The table element has 432px, but my DialogBox has 400px set everywhere and no padding set. I tried to force padding 0 with css and still no result.
GWT: Why doesn't "setAnimationEnabled(true);" respect DialogBox size?
CC BY-SA 3.0
null
2011-06-24T19:21:21.777
2011-06-24T20:58:29.427
2011-06-24T20:58:29.427
314,073
314,073
[ "java", "gwt", "animation" ]
6,472,775
1
6,512,410
null
2
818
I have a Windows Form designed with Visual Studio 2010. It has a `ToolStripContainer` with a `StatusStrip` control placed on the bottom. From the Visual Studio IDE's Designer, the control looks fine: ![Designer View](https://i.stack.imgur.com/PCGzQ.png) When I run the application, the `StatusStrip` object on the bottom becomes transparent/opaque, and is very hard to read. This project is only about 2 weeks old, and I have not done anything to monkey with the transparency or opacity of any of the controls. What could be causing this? How would I debug it? ![Running View](https://i.stack.imgur.com/VFcGo.png) So, I did a search on my on the control's name (). Unfortunately, there is very little information. I also ran a search on the `ToolStripContainer`, but it had roughly the same information - nothing that should cause the display to be transparent. The `StatusStrip` search result is shown below: ![Find Results](https://i.stack.imgur.com/cnM7S.png)
VS2010: ToolStripContainer with Washed Out StatusStrip on Bottom (Win7, Winform)
CC BY-SA 3.0
0
2011-06-24T19:23:04.170
2011-06-28T20:01:20.363
2011-06-24T21:14:12.067
153,923
153,923
[ "c#", "visual-studio-2010", "transparency" ]
6,472,907
1
6,474,162
null
1
581
Considering the following list : ``` dalist = {{1, a, 1}, {2, s, 0}, {1, d, 0}, {2, f, 0}, {1, g, 1}} ``` ![enter image description here](https://i.stack.imgur.com/1zAmp.png) I would like to count the number of times a certain value in the first column takes a certain value in column 3. So in this example my desired output would be: {{1,1,2}, {1,0,1}, {2,1,0}, {2,0,2}} or : ![enter image description here](https://i.stack.imgur.com/BE0vW.png) Where the latest sublist {2,0,2} being read as: When the value is 2 in the first column, a corresponding value (same row in matrices world) in column 3 of 0 is present twice. I hope this is not to confusing. I added the second Column to convey the fact that the columns are distant to each other. If possible, no reordering should happen. EDIT : {1,2,3,4,5} {1,0} are the exact values taken by the columns I am actually dealing with in my data. I know I am missing the correct description. Please edit if you can and know it. Thank you
Conditional Counting in Mathematica
CC BY-SA 3.0
null
2011-06-24T19:38:22.397
2011-08-24T07:44:42.620
2011-06-25T01:07:21.793
769,551
769,551
[ "count", "wolfram-mathematica", "conditional-statements" ]
6,472,991
1
null
null
9
12,194
There is some text whose formatting I would like to render in HTML. Here is an image: ![Image of formatted text](https://i.stack.imgur.com/vwWux.png) Note the gray lines with the bullet points and the paragraph numbers. The bullets should be centered on the page and the numbers should be justified right. I've been trying to think of how to do this in HTML and am coming up blank. How would you capture this formatting?
How do you do tab stops in HTML/CSS
CC BY-SA 3.0
0
2011-06-24T19:45:33.417
2022-08-24T11:47:20.817
2011-06-26T05:14:09.837
56,338
338
[ "html", "css", "formatting", "tabstop" ]
6,473,355
1
6,473,449
null
1
6,849
I am trying to create a UITableView cell that says "View this devotional online" with a large font. The issue I am having is the text in the cell is not wrapping so I end up with part of the phrase. ![text not wrapping](https://i.stack.imgur.com/qsCWL.png) The code I have for this is: ``` // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // Get cell static NSString *CellIdentifier = @"CellA"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } // Display cell.textLabel.textColor = [UIColor blackColor]; cell.textLabel.font = [UIFont systemFontOfSize:15]; if (item) { // Item Info NSString *itemTitle = item.title ? [item.title stringByConvertingHTMLToPlainText] : @"[No Title]"; // Display switch (indexPath.section) { case SectionHeader: { // Header switch (indexPath.row) { case SectionHeaderTitle: cell.textLabel.font = [UIFont boldSystemFontOfSize:15]; cell.textLabel.text = itemTitle; break; case SectionHeaderDate: cell.textLabel.text = dateString ? dateString : @"[No Date]"; break; case SectionHeaderURL: cell.textLabel.text = @"View this devotional in full website"; cell.textLabel.textColor = [UIColor blackColor]; cell.textLabel.font = [UIFont systemFontOfSize:36]; cell.imageView.image = [UIImage imageNamed:@"Safari.png"]; cell.textLabel.numberOfLines = 0; // Multiline break; } break; } case SectionDetail: { // Summary cell.textLabel.text = summaryString; cell.textLabel.numberOfLines = 0; // Multiline break; } } } return cell; } ``` The following line worked before, but it doesn't seem to work here. `cell.textLabel.numberOfLines = 0; // Multiline` Could someone show me how to wrap my text?
iPhone Wrapping Text In UITableViewCell
CC BY-SA 3.0
null
2011-06-24T20:22:46.843
2012-12-29T01:16:34.473
2012-09-02T11:31:38.867
308,315
616,454
[ "iphone", "objective-c", "xcode", "uitableview", "word-wrap" ]