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
sequence
2,242,722
1
2,242,825
null
1
202
I understand threads in theory, but I have no idea how to implement them in Java. ![setup](https://i.imgur.com/xIk6S.png) The circles are supposed to be threads and the rectangles are supposed to be buffers. I have this all coded but it doesn't work, so I am starting new. My source of confusion comes from the fact that I need this cycle to repeat many times and in this order, but I can't predict what thread will run first. If thread B that relies in data from A runs first, what happens? Also how can I keep the threads running indefinitely?
confused about threads in java
CC BY-SA 2.5
null
2010-02-11T06:39:16.103
2010-02-11T07:19:09.313
null
null
211,983
[ "java", "multithreading", "synchronization" ]
2,242,947
1
2,244,060
null
1
2,292
I am writing a web application (While learning JSF from scratch, and thanks to this site I was able to do this). I have managed to get pretty far but there is something I can't figure how to approach to. Currently I have this: ![Screenshot](https://farm5.static.flickr.com/4070/4348395096_68dd5d7785_o.png) [Link to full size screenshot](https://farm5.static.flickr.com/4070/4348395096_68dd5d7785_o.png) As you can see, I don't know how to place things where I want them. At this point just stacking the buttons (sleep timer and message text) and the input-spinner at the top of each panel would suffice, but I would like to learn how to control this better. (Place each component at a chosen location inside the panel) The JSP code: ``` <h:panelGrid id="ActionsPanel" styleClass="leftcol" binding="#{actions.actionPanel}"> </h:panelGrid> <h:panelGrid id="EditPanel" styleClass="rightcol" binding="#{actions.editorPanel}"> </h:panelGrid> ``` And the CSS: ``` .leftcol { display: block; width : 20%; height: 300px; float: left; border: 1px solid #000; width: 20%; height : 300px; float : left; border : 1px solid #000; border-top: 0; } .rightcol { width: 70%; height: 300px; float: left; border: 1px solid #000; border-top: 0; border-left: 0; } ``` Thanks! Ben.
How to control the layout in JSF?
CC BY-SA 2.5
null
2010-02-11T07:44:02.287
2010-02-11T12:00:05.660
2017-02-08T14:21:00.827
-1
128,076
[ "css", "jsf" ]
2,243,245
1
2,246,722
null
161
122,773
I have 3 levels of `div`: - `div``overflow: hidden`- `div``position: relative`- `div``position: absolute``div` I'd like to have the blue box be taken out of the flow and expand beyond the green box, but be positioned relative to the red box as in: ![](https://i.stack.imgur.com/iaky5.png) However, with the code below, I get: ![](https://i.stack.imgur.com/heZOW.png) And removing the `position: relative` on the red box, now the blue box is allowed to get out of the green box, but is not positioned anymore relative to the red box: ![](https://i.stack.imgur.com/hkrpU.png) Is there a way to: - `overflow: hidden`- The full source: ``` #d1 { overflow: hidden; background: #efe; padding: 5px; width: 125px; } #d2 { position: relative; background: #fee; padding: 2px; width: 100px; height: 100px; } #d3 { position: absolute; top: 10px; background: #eef; padding: 2px; width: 75px; height: 150px; } ``` ``` <br/><br/><br/> <div id="d1" > <div id="d2" > <div id="d3"></div> </div> </div> ```
CSS: How to have position:absolute div inside a position:relative div not be cropped by an overflow:hidden on a container
CC BY-SA 4.0
0
2010-02-11T08:53:35.537
2022-05-18T12:51:30.427
2019-09-06T22:28:54.860
1,324
5,295
[ "css", "overflow", "css-position" ]
2,243,607
1
2,348,632
null
1
1,847
I'm developing an application which draws some charts and I'm using Google Chart. After I have all the needed data I build the URL dinamically. The problem is that Google Chart doesn't always fix the maximum and minimum of the chart to the values I provide. I calculate Max and Min Values based on the data of the cart. I've set them to be always an integer to avoid any problem. I'm going to set an example with numbers: (I write it in different lines with "comments (//)" so it can be read easily, though it is in the same line with any comment at all) ``` http://chart.apis.google.com/chart? cht=bvs& //chart type chs=250x250& //chart size chd=t:10,0|4.48,0|15,-58.42|0,4.73|0,73.44& //chart data chco=4D89D9,C6D9FD,FF0000,00FF00,0000FF& //chart colors chds=-59,80& //data scaling chf=bg,s,edf5ff|c,s,f6e426& //chart fill color chtt=my_title& //chart title chdl=A|B|C|D|E& //chart legend chdlp=r& //legend position chxt=x,y& //chart axis chxl=0:|Col_1|Col_2& //Axis labels chxr=1,-59,80& //Axis range chbh=r,1,0& //Bar thickness and spacing chg=0,12.5 //Grid Lines ``` with this configuration I'd get this chart. As you can see the zero line is over zero because data has not been scaled isn a good way. ![alt text](https://chart.apis.google.com/chart?cht=bvs&chs=250x250&chd=t:10,0|4.48,0|15,-58.42|0,4.73|0,73.44&chco=4D89D9,C6D9FD,FF0000,00FF00,0000FF&chds=-59,80&chf=bg,s,edf5ff|c,s,f6e426&chtt=my_title&chdl=A|B|C|D|E&chdlp=r&chxt=x,y&chxl=0:|Col_1|Col_2&chxr=1,-59,80&chbh=r,1,0&chg=0,12.5) but If I change the maximum and minumum of the chart to -60,80 I get it in a good way It would be this code: ``` http://chart.apis.google.com/chart? cht=bvs& //chart type chs=250x250& //chart size chd=t:10,0|4.48,0|15,-58.42|0,4.73|0,73.44& //chart data chco=4D89D9,C6D9FD,FF0000,00FF00,0000FF& //chart colors chds=-60,80& //data scaling (CHANGE IN THIS LINE) chf=bg,s,edf5ff|c,s,f6e426& //chart fill color chtt=my_title& //chart title chdl=A|B|C|D|E& //chart legend chdlp=r& //legend position chxt=x,y& //chart axis chxl=0:|Col_1|Col_2& //Axis labels chxr=1,-60,80& //Axis range (CHANGE IN THIS LINE) chbh=r,1,0& //Bar thickness and spacing chg=0,12.5 //Grid Lines ``` And this chart which seems to be OK: ![alt text](https://chart.apis.google.com/chart?cht=bvs&chs=250x250&chd=t:10,0|4.48,0|15,-58.42|0,4.73|0,73.44&chco=4D89D9,C6D9FD,FF0000,00FF00,0000FF&chds=-60,80&chf=bg,s,edf5ff|c,s,f6e426&chtt=my_title&chdl=A|B|C|D|E&chdlp=r&chxt=x,y&chxl=0:|Col_1|Col_2&chxr=1,-60,80&chbh=r,1,0&chg=0,12.5) Can anyone tell me why Google Chart behaves in this way? Thanks
Problem with Google Chart
CC BY-SA 2.5
0
2010-02-11T09:58:01.480
2010-02-27T19:25:58.773
2017-02-08T14:21:01.673
-1
249,699
[ "charts", "google-visualization" ]
2,244,599
1
2,247,119
null
3
3,679
I'm building a first person shooter using OpenGL, and I'm trying to get a gun model to float in front of the camera. I've ripped a model from Fallout 3 using a resource decompiler (converted to .obj and loaded in). However, this is what it looks like on the screen: ![Screenshot](https://imgur.com/cA3r8.png) Half the gun's triangles are clipped to what appears to be the frustum. I put it in front of my camera like this: ``` glPushMatrix(); glLoadIdentity(); glTranslatef(m_GunPos.x, m_GunPos.y, m_GunPos.z); glRotatef(m_GunRot.x, 1, 0, 0); glRotatef(m_GunRot.y, 0, 1, 0); glRotatef(m_GunRot.z, 0, 0, 1); glScalef(m_GunScale.x, m_GunScale.y, m_GunScale.z); m_Gun->Render(NULL); glPopMatrix(); ``` So I save the original `GL_MODELVIEW` matrix, load the identity matrix, translate my gun to be slightly to the right of my camera and render it. This is my render routine for a SceneNode: ``` glPushMatrix(); if (m_Model) { m_Model->Render(&final); } if (m_Children.size() > 0) { for (std::vector<SceneNode*>::iterator i = m_Children.begin(); i != m_Children.end(); ++i) { (*i)->Render(&final); } } glPopMatrix(); ``` So it renders its own model and any child SceneNode's. Finally, the actual mesh rendering looks like this: ``` if (m_Material) { glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_Material->m_TexDiffuse); } glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glVertexPointer(3, GL_FLOAT, sizeof(Vec3), &m_Vertex[0]); glNormalPointer(GL_FLOAT, sizeof(Vec3), &m_Normal[0]); glTexCoordPointer(2, GL_FLOAT, 0, &m_UV[0]); glDrawArrays(GL_TRIANGLES, 0, m_Vertex.size()); glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); ``` Is there any way to turn off clipping for just the gun? How do other games do this? Thanks in advance.
Building an FPS in OpenGL: My gun is being clipped agains the frustum
CC BY-SA 2.5
null
2010-02-11T13:11:08.263
2010-02-12T13:11:56.420
null
null
141,057
[ "c++", "opengl", "frame-rate" ]
2,244,774
1
null
null
90
134,610
I like the dark "FakeVim" color scheme in Qt Creator. However it only makes the editor part dark while everything else stays normal, which is a bit disturbing. Is there any way to make such dark scheme global for Qt Creator? Vim (dark) Color Scheme ![Vim Color Scheme](https://i.stack.imgur.com/Rcrew.png) Color scheme is applied solely to text editor (as this is the only option), and not the environment. ![Vim applied to text editor](https://i.stack.imgur.com/2Hr97.png)
Qt Creator color scheme
CC BY-SA 3.0
0
2010-02-11T13:44:35.813
2019-08-08T13:54:44.533
2012-08-06T12:53:29.613
389,823
44,556
[ "qt-creator", "color-scheme", "ide-customization" ]
2,245,191
1
2,245,646
null
1
253
When I deploy my app on other machines, this error comes up: ![alt text](https://i488.photobucket.com/albums/rr245/lolwtf_album/Error-2.png) Now if I uninstall my app and re-install it, the error message does not come up. Has anyone else encountered this? I cant make sense of the stack trace either.
Weird installation error in .net
CC BY-SA 2.5
0
2010-02-11T14:48:33.083
2010-02-11T15:51:42.140
2017-02-08T14:21:02.370
-1
203,948
[ ".net", "vb.net", "visual-studio" ]
2,245,235
1
null
null
9
9,499
I use a simple ASP.NET MVC web (the template you use when you create a new site) and the web works as expected in my live environment. I now try to use IIS Application Request Routing version 2. I have a rule that send all requests to a different server that match a rule. The settings are a bit like this: [http://blogs.iis.net/wonyoo/archive/2008/07/09/application-request-routing-arr-as-a-reverse-proxy.aspx](http://blogs.iis.net/wonyoo/archive/2008/07/09/application-request-routing-arr-as-a-reverse-proxy.aspx) ![alt text](https://blogs.iis.net/blogs/wonyoo/reverseproxy.jpg) My rule is just a bit different it is /shop(.*). Only requests that contain shop are send to a different server. I have to use rewrite, not redirect (The same as in the Picture) This works as long as the original requests go to a non ASP.NET MVC web. I tried to use a plain htm file in the webfolder and it worked. If put a compiled ASP.NET application into the webfolder it worked. But as soon as I put an ASP.NET MVC web into the folder, request arr served by this application. My understanding is that the ARR should kick in before the web application gets the chance to handle the request. Did anybody use ARR sucessfully as a reverse proxy for a ASP.NET MVC web? Here is the resulting web config when the rewrite roule is entered. With this rule I get a 404 that indicates that the rule is not used. ``` <?xml version="1.0" encoding="UTF-8"?> <configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" /> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> </sectionGroup> </sectionGroup> </sectionGroup> </configSections> <appSettings /> <connectionStrings> <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" /> </connectionStrings> <system.web> <!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development. --> <compilation debug="false"> <assemblies> <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> </assemblies> </compilation> <!-- The <authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" /> </authentication> <membership> <providers> <clear /> <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/" /> </providers> </membership> <profile> <providers> <clear /> <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ApplicationServices" applicationName="/" /> </providers> </profile> <roleManager enabled="false"> <providers> <clear /> <add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </providers> </roleManager> <!-- The <customErrors> section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> <pages> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </controls> <namespaces> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> <add namespace="System.Linq" /> <add namespace="System.Collections.Generic" /> </namespaces> </pages> <httpHandlers> <remove verb="*" path="*.asmx" /> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" /> <add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </httpModules> </system.web> <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <providerOption name="CompilerVersion" value="v3.5" /> <providerOption name="WarnAsError" value="false" /> </compiler> <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <providerOption name="CompilerVersion" value="v3.5" /> <providerOption name="OptionInfer" value="true" /> <providerOption name="WarnAsError" value="false" /> </compiler> </compilers> </system.codedom> <system.web.extensions /> <!-- The system.webServer section is required for running ASP.NET AJAX under Internet Information Services 7.0. It is not necessary for previous version of IIS. --> <system.webServer> <rewrite> <rules> <rule name="shop" stopProcessing="true"> <match url="^shop/([_0-9a-z-.]+)" /> <action type="Rewrite" url="article.aspx?title={R:1}" logRewrittenUrl="true" /> </rule> </rules> </rewrite> <validation validateIntegratedModeConfiguration="false" /> <modules runAllManagedModulesForAllRequests="true"> <remove name="ScriptModule" /> <remove name="UrlRoutingModule" /> <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> </modules> <handlers> <remove name="WebServiceHandlerFactory-Integrated" /> <remove name="ScriptHandlerFactory" /> <remove name="ScriptHandlerFactoryAppServices" /> <remove name="ScriptResource" /> <remove name="MvcHttpHandler" /> <remove name="UrlRoutingHandler" /> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </handlers> </system.webServer> </configuration> ```
Using IIS Application Request Routing (ARR) for ASP.NET MVC
CC BY-SA 3.0
0
2010-02-11T14:55:02.383
2015-01-23T08:42:19.387
2017-02-08T14:21:02.727
-1
13,442
[ "asp.net-mvc", "iis-7", "asp.net-mvc-routing" ]
2,246,874
1
2,291,450
null
2
575
iWork has the ability to highlight text and then tag a comment to that text. The comment then is linked with a line to the highlighted text. ![alt text](https://i.stack.imgur.com/yj8C6.png) I'm curious if something like this could be implemented in JQUERY. What has me puzzled is: A. How to draw a line and have it update when a user changes the text B. How to highlight text and have it tagged somehow? Id love to hear your thoughts on if this is even possible with JQUERY and any ideas or plugins to point me in the right direction.
iWork Comment Ability, Is this possible to implement using JQUERY
CC BY-SA 3.0
0
2010-02-11T18:52:13.937
2014-01-21T20:32:21.177
2014-01-21T20:32:21.177
881,229
149,080
[ "jquery", "jquery-plugins", "iwork" ]
2,247,063
1
2,247,212
null
6
9,342
I am trying to trace the path of a node in a binary tree (not a binary search tree). Given a node, I am trying to print the values of the path from the root. ![alt text](https://4.bp.blogspot.com/_kRev2kjeMro/S3RMNVO4v4I/AAAAAAAACEg/0jv0ztv1Gfo/s320/Trace+path+in+a+binary+tree.png) I have written the following program. ``` package dsa.tree; import java.util.Stack; public class TracePath { private Node n1; public static void main(String args[]){ TracePath nodeFinder = new TracePath(); nodeFinder.find(); } public void find(){ Tree t = getSampleTree(); tracePath(t,n1); } private Tree getSampleTree() { Tree bsTree = new BinarySearchTree(); int randomData[] = {43,887,11,3,8,33,6,0,46,32,78,76,334,45}; for(int i=0;i<randomData.length;i++){ bsTree.add(randomData[i]); } n1 = bsTree.search(76); return bsTree; } public void tracePath(Tree t, Node node){ trace(t,node); } Stack<Node> mainStack = new Stack<Node>(); public void trace(Tree t, Node node){ trace(t.getRoot(),node); } private void trace(Node parent, Node node){ mainStack.push(parent); if(node.data == parent.data){ for(Node iNode:mainStack){ System.out.println(iNode.data); } return; } if(parent.left != null){ trace(parent.left, node); } if(parent.right!=null){ trace(parent.right, node); } mainStack.pop(); } } ``` I am getting the output properly. But its kind of messy. If you see the method trace(Node, Node), I am printing the values which I should not do. I want the trace method to properly complete. At least, I should kill the recursive structure at the stage i encounter the if condition. Please advise.
Need help in returning from a recursive method
CC BY-SA 2.5
0
2010-02-11T19:20:28.423
2010-02-11T22:20:05.550
2017-02-08T14:21:03.097
-1
1,977,903
[ "java", "algorithm", "data-structures", "binary-tree", "traversal" ]
2,247,778
1
2,248,168
null
2
1,566
I'm having amazing difficulties with a high-precision pixel-oriented image program in WPF and starting to suspect that the `Cursors.Cross` cursor hotspot is not at its centre, as you would expect. I'm debugging using [Magnifier](https://www.microsoft.com/enable/training/windowsvista/magnifier.aspx) at 16x and mouse set to the lowest acceleration. The code is based on [DrawTools from CodeProject](https://www.codeproject.com/KB/WPF/WPF_DrawTools.aspx). ![image captured from Magnifier](https://i.stack.imgur.com/fED6K.png) Is this the same cursor as you get in Winforms? If so, I can look at that cursor's hotspot - the [Cursor](https://msdn.microsoft.com/en-us/library/system.windows.input.cursor.aspx) class in System.Windows.Input doesn't have the HotSpot property. UPDATE In case anyone is looking for a workaround, in my case I already have a delegate being invoked to filter the points so I can implement snap-to-grid behaviour. It was trivial to offset the point by 1 to compensate. This was a lot easier than creating a custom cursor and has the advantage that I'm still using the stock cursor if its appearance should change.
Is the hotspot of the WPF Cross cursor in the middle of the crosshair?
CC BY-SA 4.0
null
2010-02-11T21:19:58.567
2023-02-19T07:05:34.497
2023-02-19T07:05:34.497
53,870
53,870
[ "wpf", "mouse-cursor" ]
2,250,606
1
2,250,772
null
3
1,102
I've built a UserControl that extends the functionality of the ComboBox in interesting and useful ways. It looks like this when it's dropped down: ![My user control](https://i.imgur.com/Sw17Nl.png) I've built a whole bunch of features into the control and they all work smoothly. This leads me to believe that I have something of a clue as to what I'm doing. You'd think it would be a trivial matter to have the UserControl's style set the editable TextBox's background brush. In fact, it appears to be freaking impossible. And I'm baffled. The UserControl's XAML, abbreviated (you'll thank me for this), looks like this: ``` <UserControl x:Class="MyApp.CodeLookupBox" x:Name="MainControl"> <UserControl.Resources> <!-- tons of DataTemplates and Styles, most notably the style that contains the control template for the ComboBox --> <UserControl.Resources> <ComboBox x:Name="ComboBox" Margin="0" Style="{DynamicResource ComboBoxStyle1}" VerticalAlignment="Top" ItemTemplate="{StaticResource GridViewStyleTemplate}"/> </UserControl> ``` There's a lot of code-behind in this control, mostly dependency properties that I use for things like selecting the template that's used in the dropdown. What's making me crazy is the editable text box. I want to be able to set its background brush from the user control's style - e.g., when I declare one of these user controls in my XAML, it uses a style like this: ``` <Style TargetType="{x:Type local:CodeLookupBox}"> <Style.Triggers> <DataTrigger Binding="{Binding IsRequired}" Value="True"> <Setter Property="EditableTextBoxBackground" Value="{StaticResource RequiredFieldBrush}"/> </DataTrigger> </Style.Triggers> </Style> ``` I started out life simply setting the UserControl's Background, but that set the background the editable TextBox. The TextBox itself remained white. Inside the template for the ComboBox, there's a style that controls that TextBox: ``` <Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}"> <Setter Property="OverridesDefaultStyle" Value="true"/> <Setter Property="AllowDrop" Value="true"/> <Setter Property="MinWidth" Value="0"/> <Setter Property="MinHeight" Value="0"/> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TextBox}"> <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/> </ControlTemplate> </Setter.Value> </Setter> </Style> ``` And there is the TextBox (inside the ComboBox's control template) its bad self: ``` <TextBox x:Name="PART_EditableTextBox" Margin="{TemplateBinding Padding}" Style="{StaticResource ComboBoxEditableTextBox}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"/> ``` Now, there's a definite element of Things Man Was Not Meant To Know about that ComboBoxEditableTextBox style. What is that ScrollViewer doing in there? I have no idea. I can tell you that if I comment out the part of the style that sets the TextBox's ControlTemplate, very bad things happen. And I also know this: If I explicitly set the TextBox's Background brush as one of the style's setters, nothing happens. If I explicitly set the Background on the PART_EditableTextBox, nothing happens. (I can set its Foreground, or its FontFamily, and they work just fine.) If I explicitly set the Background of that ScrollViewer to Green, though, voila, the TextBox turns green. Okay then, so the TextBox is ignoring its own Background, and using the one from its control template. Actually, it's not, strictly speaking, using the one from the control template either. When I set the ScrollViewer's background, there's a decided margin around the edges of the color, instead of the color filling the TextBox entirely. But that margin is white, not the background color. Unless I can figure out why the TextBox is ignoring its Background, I have to live with tweaking the ScrollViewer. So how do I get it to get the brush from the user control's EditableTextBoxBackground property? I've made this a dependency property that raises the PropertyChanged event properly when it changes. I'm binding to it in the mysterious ScrollViewer's XAML like this: ``` Background="{Binding ElementName=MainControl, Path=EditableTextBoxBackground, Converter={StaticResource DebuggingConverter}}" ``` I've set a breakpoint in my debugging converter. When the control is first drawn, it gets hit twice. The first time, the value of the brush is null. The second time, it's the right value. And if I set the property in my UserControl's , it works. So here's what I know: My UserControl's property is being set properly. The binding on the TextBox's style is correctly bound to the UserControl's property. The binding on the ScrollViewer in the TextBox's control template is bound to the right property. The property raises PropertyChanged with the right property name when it's changed, and the binding pushes the value out to the ScrollViewer Background property. And nothing happens. So I guess I have a three part question: 1) Why? 2) What the heck is that ScrollViewer doing in there in the first place? I have my suspicions, but it's one in the morning and it's getting hard for me to articulate them. 3) Why did Blend give me a different control template to work with than the much more comprehensible one found [here](http://msdn.microsoft.com/en-us/library/ms752094.aspx)? Really, any help would be appreciated.
Why can't I reset the Background of the TextBox in my UserControl?
CC BY-SA 2.5
0
2010-02-12T09:00:56.113
2011-08-15T17:30:16.477
2011-08-15T17:30:16.477
305,637
19,403
[ "wpf", "templates", "user-controls", "controls", "styles" ]
2,254,913
1
2,254,925
null
189
113,701
How can I display an infinity symbol (like the one in the picture) using HTML? ![infinity symbol](https://upload.wikimedia.org/wikipedia/commons/thumb/c/c8/Infinite.svg/200px-Infinite.svg.png)
Infinity symbol with HTML
CC BY-SA 3.0
0
2010-02-12T20:29:13.913
2018-05-29T03:47:20.873
2017-02-08T14:21:03.793
-1
94,154
[ "html", "html-entities", "infinity" ]
2,256,053
1
null
null
0
3,103
I am trying to access the current 'active' top level node from a sitemap repeater from outside of the ASP.NET repeater used to render it, this is for CSS styling purposes as I want to place the child nodes on the subsequent row with different styling horizontally. At present I have the following code which I can't get to display correctly using CSS. ``` <asp:SiteMapDataSource ID="topNavLevel" runat="server" ShowStartingNode="false" /> <asp:Repeater runat="server" ID="rptParent" DataSourceID="topNavLevel"> <HeaderTemplate><ul id="lawMenu" class="topMenu"></HeaderTemplate> <ItemTemplate> <li> <asp:HyperLink runat="server" ID="parentLink" NavigateUrl='<%# Eval("Url") %>'><span class="t"><%# Eval("Title") %></span><span class="l"></span><span class="r"></span></asp:HyperLink> <asp:Repeater ID="rptChild" runat="server" DataSource='<%# ((SiteMapNode) Container.DataItem).ChildNodes %>'> <HeaderTemplate> <ul> </HeaderTemplate> <ItemTemplate> <li> <asp:HyperLink ID="childLink" runat="server" NavigateUrl='<%# Eval("Url") %>'><span class="t"><%# Eval("Title") %></span><span class="l"></span><span class="r"></span></asp:HyperLink> </li> </ItemTemplate> <FooterTemplate> </ul> </FooterTemplate> </asp:Repeater> </li> </ItemTemplate> <FooterTemplate> </ul></FooterTemplate> </asp:Repeater> ``` I would like to display the child nodes on the next light blue element which I can do perfectly well from a seperate div if this was not rendered using a child repeater. In the image below Blog and Services are top level nodes and their subseqent nodes (2 for each) should be displayed on the light-blue row below. Is this possible? ![image](https://i.stack.imgur.com/YH6Ey.png)
Accessing SiteMapNode Container.DataItem from outside of Parent Repeater
CC BY-SA 4.0
null
2010-02-13T00:55:47.487
2019-05-24T19:59:25.203
2019-05-24T19:59:25.203
6,296,561
260,012
[ "asp.net", "css", "repeater", "sitemap" ]
2,256,325
1
2,256,331
null
0
134
If I enter 'localhost' on my browser, I'm taken to XAMPP's welcome screen so everything is installed correctly. What folder do I have to put my html files in? ![alt text](https://imgur.com/TFdHV.png) Thanks.
I installed XAMMP on my machine, where do I have to put my HTML files to view them?
CC BY-SA 2.5
null
2010-02-13T03:06:32.937
2010-02-13T03:09:35.230
null
null
null
[ "php", "html", "apache", "xampp" ]
2,256,942
1
2,260,563
null
12
4,965
Let me show you: ![alt text](https://i.imgur.com/lnC3x.png) As you can see "Item foreground" is disabled. I want to believe there's something wrong on my end because being able to choose the colors you use to program in is a basic right for a programmer. No one should ever take that feature away and go unpunished.
I can't edit selected text foreground color in Visual Studio 2010. Anyone know how to do this?
CC BY-SA 2.5
0
2010-02-13T08:27:19.593
2012-05-03T11:57:44.077
2010-02-18T21:40:32.093
103,912
9,776
[ "visual-studio-2010", "fonts", "themes", "colors" ]
2,257,711
1
2,257,724
null
0
117
according to picture it report an object leak how can i fix this issue? ![alt text](https://i708.photobucket.com/albums/ww82/RAGOpoR/Screenshot2010-02-13at83031PM-1.png)
How to resolve this object Leak?
CC BY-SA 2.5
null
2010-02-13T13:36:45.943
2010-02-13T13:49:12.393
2017-02-08T14:21:04.137
-1
203,372
[ "iphone", "objective-c", "xcode" ]
2,259,021
1
2,259,212
null
7
2,410
Here is a window with a simple list: ![](https://trotsenko.com.ua/stackoverflow/2010_02_13%20ListBoxItemWidth%20screenshot.png) The code is straight-forward: ``` <Window x:Class="Wpf_List.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" Title="MainWindow" Height="350" Width="525"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Border BorderBrush="Black" BorderThickness="2" Grid.Column="1"> <ListBox> <ListBox.ItemTemplate> <DataTemplate> <!--HorizontalAlignment="Stretch" below has no effect :(--> <Border CornerRadius="5" BorderBrush="DarkRed" SnapsToDevicePixels="True" BorderThickness="1" Margin="1" Padding="4,2" HorizontalAlignment="Stretch" > <TextBlock Text="{Binding}"/> </Border> </DataTemplate> </ListBox.ItemTemplate> <sys:String>First</sys:String> <sys:String>Second</sys:String> <sys:String>Some item with a long name</sys:String> </ListBox> </Border> </Grid> </Window> ``` The width of each item is different. Looks like "Auto". I tried various ways, but didn't found one to make items stretch horizontally without hard-coding the width. How do I?
How to make list item horizontally stretched?
CC BY-SA 2.5
0
2010-02-13T20:55:15.403
2010-02-13T21:55:53.220
2017-02-08T14:21:04.987
-1
58,768
[ "wpf", "listbox" ]
2,261,641
1
2,293,549
null
1
1,286
I'm using Three20 TTStyledTextLabel and when I change the default font (Helvetica) to something else it creates some kind of height difference between links and regular text The following code demonstrate my problem: ``` #import <Three20/Three20.h> @interface TestController : UIViewController { } @end @implementation TestController -(id)init{ self = [super init]; TTStyledTextLabel* label = [[[TTStyledTextLabel alloc] initWithFrame:CGRectMake(0, 0, 320, 230)] autorelease]; label.text = [TTStyledText textFromXHTML:@"<a href=\"aa://link1\">link</a> text" lineBreaks:YES URLs:YES]; [label setFont:[UIFont systemFontOfSize:16]]; [[self view] addSubview:label]; TTStyledTextLabel* label2 = [[[TTStyledTextLabel alloc] initWithFrame:CGRectMake(0, 230, 320, 230)] autorelease]; label2.text = [TTStyledText textFromXHTML:@"<a href=\"aa://link1\">link2</a> text2" lineBreaks:YES URLs:YES]; [label2 setFont:[UIFont fontWithName:@"HelveticaNeue" size:16]]; [[self view] addSubview:label2]; return self; } @end ``` ![Screen Shot](https://i.stack.imgur.com/whzgk.png) In the screen shot you can see that the first link is aligned and the second one isn't How do I fix it? I think there is a bug in the TTStyledTextLabel code...
TTStyledTextLabel offset between link and regular text when changing from default font
CC BY-SA 3.0
0
2010-02-14T15:51:02.017
2012-03-28T21:14:03.470
2012-03-28T21:14:03.470
1,219,121
248,037
[ "iphone", "three20", "ttstyledtextlabel" ]
2,261,910
1
2,306,073
null
1
4,810
I have a favorite image to display on a `UIBarButtonItem`, on an toolbar. How do you do to change it when this item is unselected/selected? like this screenshot: ![enter image description here](https://i.stack.imgur.com/8vTn5.jpg) Thanks!
UIBarButtonItem : selected / unselected an item
CC BY-SA 2.5
0
2010-02-14T17:01:24.723
2014-09-02T06:39:56.013
2011-03-03T05:23:37.613
19,329
null
[ "iphone", "uibarbuttonitem", "uitoolbar" ]
2,264,157
1
2,295,775
null
19
7,957
I am looking for a Java or Python library that can render graphs in the Dot language as image file. The problem is that I need a library that I can use on Google App Engine. Basically I am looking for a library that can convert the text description of a directed graph into an image of the graph. For example: Covert this edge list: ``` [A,B] [B,C] [A,C] [C,D] ``` Into this image: ![example image](https://i.imgur.com/TrAjJ.png) I used [Graphviz](http://www.graphviz.org/) for this example, but I know it is not possible for me to use it with Google App Engine.
Library to render Directed Graphs (similar to graphviz) on Google App Engine
CC BY-SA 2.5
0
2010-02-15T05:23:31.313
2016-07-26T22:25:48.803
2010-02-15T11:41:42.873
230,513
272,321
[ "java", "python", "google-app-engine", "graph", "graphviz" ]
2,264,815
1
2,264,823
null
5
4,464
I can't find any reference to add a 'notification' to an icon, preferably into a UITabBar, like the image attached, number 8. I suppose I don't have to create manually ALL the numbers inside a circle, or create it every time I need and update the image manually with some of my icons ? thanks, r. ![alt text](https://i166.photobucket.com/albums/u112/windsurfeta/iphone/show.png)
Notification Icon on UITabBar
CC BY-SA 2.5
0
2010-02-15T08:59:21.917
2017-06-07T06:53:30.897
2017-02-08T14:21:07.767
-1
266,276
[ "iphone", "uitabbarcontroller" ]
2,265,550
1
2,265,562
null
0
309
Does anyone know a way that I can set my picker to default / startup with row values that are not right at the start of my datasource? If possible I would like the picker to start with a middle value so I don't get the blank white area at the top. ![alt text](https://farm5.static.flickr.com/4012/4359192070_a319c0d55a_m.jpg) # EDIT_001 Added the following lines to viewDidLoad, which seems to be the best place to call these as the UI is being built. ``` [doublePicker selectRow:2 inComponent:kCoffeeIndex animated:NO]; [doublePicker selectRow:2 inComponent:kCakeIndex animated:NO]; ``` gary
Picker, setting startup / default row?
CC BY-SA 2.5
null
2010-02-15T11:28:27.083
2010-02-15T12:33:31.147
2017-02-08T14:21:08.107
-1
164,216
[ "cocoa-touch" ]
2,266,229
1
2,268,163
null
0
2,647
I am trying to display the contents of a table from an Access 2007 Database inside a List-view Box. I am using a Combo Box to select the user I wish to see the details about: ``` Private Sub Admin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ReadUsers() con.ConnectionString = ("Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=E:\Computing\Projects\Login\Login\bds.accdb;") con.Open() Sql = "Select * From Clients" da = New OleDb.OleDbDataAdapter(Sql, con) da.Fill(ds, "Clients") MaxRows = ds.Tables("Clients").Rows.Count intCounter = -1 ComboBoxClients.DisplayMember = "ClientName" ComboBoxClients.ValueMember = "ID" ComboBoxClients.DataSource = ds.Tables("Clients") ``` Then inside the List View: ``` Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged Dim Test As Integer ListView1.Clear() For i = 0 To MaxRows - 1 Test = ds.Tables("Clients").Rows(i).Item("ClientName") If Test = ComboBoxClients.SelectedValue Then For intCounter As Integer = 0 To ds.Tables("Clients").Columns.Count - 1 ListView1.Columns.Add(ds.Tables("Clients").Columns(intCounter).ColumnName, 80, HorizontalAlignment.Center) Next Dim ListItem = New ListViewItem ListItem = ListView1.Items.Add(ds.Tables("Clients").Rows(i).Item(0)) ListItem.SubItems.Add(ds.Tables("Clients").Rows(i).Item(1)) ListItem.SubItems.Add(ds.Tables("Clients").Rows(i).Item(2)) ListItem.SubItems.Add(ds.Tables("Clients").Rows(i).Item(3)) ListItem.SubItems.Add(ds.Tables("Clients").Rows(i).Item(4)) End If Next End Sub ``` The listview box currently doesn't display anything: ![The listview box currently doesn't display anything](https://i.stack.imgur.com/i5m5f.gif) Any help would be great, thanks. ListView1 Revision: ``` Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged Dim Test As Integer Dim ListItem = New ListViewItem ListView1.Clear() For i = 0 To MaxRows - 1 Test = ds.Tables("Clients").Rows(i).Item("ClientName") If Test = ComboBoxClients.SelectedValue Then For intCounter As Integer = 0 To ds.Tables("Clients").Columns.Count - 1 ListView1.Columns.Add(ds.Tables("Clients").Columns(intCounter).ColumnName, 80, HorizontalAlignment.Center) Next ListItem.SubItems.Add(ds.Tables("Clients").Rows(i).Item(0)) ListItem.SubItems.Add(ds.Tables("Clients").Rows(i).Item(1)) ListItem.SubItems.Add(ds.Tables("Clients").Rows(i).Item(2)) ListItem.SubItems.Add(ds.Tables("Clients").Rows(i).Item(3)) ListItem.SubItems.Add(ds.Tables("Clients").Rows(i).Item(4)) ListView1.Items.Add(ListItem) End If Next End Sub ```
View Access 2007 Database Table Contents using VB.net
CC BY-SA 2.5
0
2010-02-15T13:33:00.620
2011-03-12T14:38:16.297
2011-03-12T14:38:16.297
617,750
273,173
[ "database", "vb.net" ]
2,266,721
1
2,266,766
null
33
40,761
I was wondering how I can generate a strong and secure password in C#. I googled a little bit and saw this formula in Wikipedia, where `L` is the length of the password and `N` is the number of possible symbols: ![alt text](https://upload.wikimedia.org/math/1/7/f/17fc16b5e23ca94b3c92c2c227b748c9.png) Also, I've found [this question](https://stackoverflow.com/questions/54991/generating-random-passwords), but for some reason the method `Membership.GeneratePassword` just returns a random number with 1 digit, which absolutely no password. All the rest solutions, were very slow (>= 0.5 secs). I need help implementing this formula (I don't know where to start). You may also suggest another solution or explain why the `GeneratePassword` isn't working.
Generating a strong password in C#?
CC BY-SA 3.0
0
2010-02-15T14:58:06.653
2022-11-04T18:25:09.633
2017-05-23T11:46:34.823
-1
140,937
[ "c#", ".net", "passwords" ]
2,266,955
1
2,267,181
null
0
291
I've been working on some custom graphics controls, and I found this weird problem with windows 7 rendering my button controls. I've used Photoshop to delete the pixels in the background all around the button image I'm using, then saved it as a GIF, and imported it into VS to use as the background image of my button. When windows XP renders it, it is fine, but when windows 7 renders it, all 4 corners have an odd white border around them. You can barely see them in this pic, but they are much more apparent when looking at them on the client PC's. ![alt text](https://i19.photobucket.com/albums/b151/Jrud/WhiteCorners-1.png) Is there something wrong with the way I am transfering the image? should I not use a gif? is there something wrong with the way I am displaying it on the button? What can I do about it?
.NET Graphics on Windows 7: White corners around images?
CC BY-SA 2.5
null
2010-02-15T15:30:48.133
2010-02-15T16:08:13.330
2017-02-08T14:21:08.780
-1
202,848
[ "vb.net", "image", "graphics", "windows-7", "custom-controls" ]
2,267,994
1
2,268,031
null
5
5,574
I just downloaded [blender souce](http://download.blender.org/source/blender-2.49b.tar.gz). I tried `make` command, but I am getting this: ![alt text](https://i.imgur.com/PgDIa.jpg) Btw, I am doing this on Windows using Cygwin.
How to compile Blender from source?
CC BY-SA 2.5
0
2010-02-15T18:14:28.783
2017-02-26T14:05:34.240
2010-02-15T18:20:57.893
182,959
182,959
[ "build", "cygwin", "makefile", "blender" ]
2,268,239
1
2,268,256
null
160
56,308
I'm debugging my Android application using the AVD (Android Virtual Device). When I try to enter text in a text field, my characters are being interpreted as Chinese in the IME. I don't know how I got into this mode or how to get out of it (I just want to enter alphabetic keys)? Here's a screen shot: ![http://u.go2.me/3cn](https://i.stack.imgur.com/KAtNu.jpg)
Why is my Android emulator keyboard in Chinese character mode?
CC BY-SA 3.0
0
2010-02-15T18:57:58.120
2016-04-22T08:26:26.130
2011-08-11T00:27:14.657
71,421
178,521
[ "android", "android-emulator" ]
2,268,569
1
2,268,811
null
22
41,586
I've been messing around with this for a few days now, hopefully someone here can lend me a hand. I have a simple two-column layout, the left side is a navigation bar with buttons, the right side is a content panel. When the user taps one of the buttons (say, the third one down), I'd like to have a floating view aligned to the right of this button but floating on top of the content pane. Here's a picture to illustrate what I mean: ![Layout](https://imgur.com/GQzCv.jpg) Everything I've tried shoves the floating menu inside the navigation bar or inside the content panel, which is not what I want. Any ideas? Here's basically what I have so far: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" > <LinearLayout android:layout_width="wrap_content" android:layout_height="fill_parent" android:orientation="vertical" android:layout_alignParentLeft="true" android:id="@+id/navigation_bar" > <FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.14" > <ImageButton android:id="@+id/button1_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/icon" android:layout_gravity="center" /> </FrameLayout> <FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.14" > <ImageButton android:id="@+id/button2_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/icon" android:layout_gravity="center" /> </FrameLayout> </LinearLayout> <FrameLayout android:id="@+id/content" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="0.14" android:layout_toRightOf="@id/navigation_bar" > </FrameLayout> </RelativeLayout> ```
Android floating view (over other views)
CC BY-SA 2.5
0
2010-02-15T20:02:51.020
2020-08-22T19:13:54.010
2011-10-15T21:03:35.907
501,932
87,316
[ "java", "android", "mobile", "android-layout" ]
2,269,798
1
2,270,300
null
20
7,456
In the past, I have used Vim as a note taking platform by creating an index.txt file with a list of tags using the Vim help file format and then creating a bunch of text files that have the normal `*Help_Tag*` link syntax so that using `CTRL-]` on a tag in the index.txt file will jump to the respective tag in an arbitrary notes text file. You need to do `:helptags dir` to generate the tags for the directory (where dir is the path to the notes directory). ![alt text](https://lh4.ggpht.com/_30zj9FuIzUk/S3neNqjMpOI/AAAAAAAAAFY/kI8Z-eVv0bw/vimnotes.png) What I am looking for is a simple way to be on the left split window and open the tag under the cursor in the right split window. Something like `CTRL-W v` but for tag jumping and using the already open vertical split window. The problem is if you do `CTRL-]` it will open the tag in the left pane and if you do `CTRL-W CTRL-]` it creates a horizontally split window in the left pane. There must be a way to do this that I'm overlooking.
Vim as a note taking platform: Jump to tag in vertically split windows
CC BY-SA 2.5
0
2010-02-16T00:01:41.357
2018-01-05T02:19:44.913
2017-02-08T14:21:10.163
-1
135,360
[ "vim", "tags" ]
2,269,838
1
2,275,223
null
6
9,135
Consider a database server whose job today is to house one database. Likely the database will be moved in the future to another database instance which houses multiple databases & schemas. Let's pretend the app/project is called Invoicer 2.0. The database is called AcmeInvoice. The database holds all the invoice, customer, and product information. Here's a diagram of the actors and their roles and behaviour. ![alt text](https://i.imgur.com/qwHrY.png) The schema(s) will largely be used to easily assign permissions to roles. The added benefit here is that the objects aren't under `dbo`, and that the objects & permissions can be ported to another machine in the future. - -
SQL Server: conventions for naming a schema
CC BY-SA 2.5
null
2010-02-16T00:10:31.300
2010-02-16T18:18:29.253
2010-02-16T17:04:49.230
23,199
23,199
[ "sql-server", "sql-server-2005", "sql-server-2008", "schema", "naming-conventions" ]
2,271,264
1
2,271,658
null
5
2,768
I'm having trouble determining from [this research paper](http://www.scribd.com/doc/26921668/Automatic-language-recognition-using-acoustic-features?secret_password=1x67rkr596a21hkuc8fd) exactly how I can reproduce the Standard Vector Quantization algorithm to determine the language of an unidentified speech input, based on a training set of data. Here's some basic info: Language recognition (e.g. Japanese, English, German, etc) using acoustic features is an important yet difficult problem for current speech technology. ... The speech data base used in this paper contains 20 languages: 16 sentences uttered twice by 4 males and 4 females. The duration of each sentence is about 8 seconds. The first algorithm is based on the standard Vector Quantization (VQ) technique. Every language is characterized by its own VQ codebook, ![alt text](https://latex.codecogs.com/gif.latex?V_k). The first algorithm is based on the standard Vector Quantization (VQ) technique. Every language, `k`, is characterized by its own VQ codebook, ![alt text](https://latex.codecogs.com/gif.latex?V_k). In the recognition stage input speech is quantized by ![alt text](https://latex.codecogs.com/gif.latex?V_k) and the accumulated quantization distortion, d_k, is calculated. The language which as the minimal distortion is recognized. Calcualating VQ distortion, several LPC spectral distortion measures are applied...in this case, the WLR -- weighted least ratio -- distance: [](https://i.stack.imgur.com/t8QMQ.gif) . A codebook, [](https://i.stack.imgur.com/I40h5.gif) , for each language is generated using training sentences. The accumulated distance for input vector in sentence, ![alt text][4], is defined as: [![alt text][5]][5] The distance `d` can be any distance which corresponds to the acoustic features and it must be the same as the one used for codebook generation. Each language is characterized by its VQ codebook, ![alt text](https://latex.codecogs.com/gif.latex?V_k). My question is, how exactly do I do this? I have a set of 50 sentences in English. In MATLAB, I can easily calculated the WLR for any given signal. But, how do I formulate a codebook, since I must use the WLR for "codebook generation" for English. I'm also curious as to how to compare a VQ codebook of size 16 (which was found to be the best size), to a given input signal. If anyone could help distill this paper down for me, I'd appreciate it greatly. Thanks!
Vector Quantization in Speech Processing Explanation
CC BY-SA 4.0
0
2010-02-16T07:34:38.150
2021-04-09T14:39:26.637
2021-04-09T14:39:26.637
4,751,173
100,208
[ "vector", "speech", "audio-processing", "quantization" ]
2,271,704
1
2,275,691
null
49
31,433
I am trying to draw a family tree with Dot and GraphViz. This is what I currently have: ``` # just graph set-up digraph simpsons { ratio = "auto" mincross = 2.0 # draw some nodes "Abraham" [shape=box, regular=1, color="blue"] ; "Mona" [shape=box, regular=1, color="pink"] ; "Clancy" [shape=box, regular=1, color="blue"] ; "Jackeline" [shape=box, regular=1, color="pink"] ; "Herb" [shape=box, regular=1, color="blue"] ; "Homer" [shape=box, regular=1, color="blue"] ; "Marge" [shape=box, regular=1, color="pink"] ; "Patty" [shape=box, regular=1, color="pink"] ; "Selma" [shape=box, regular=1, color="pink"] ; "Bart" [shape=box, regular=1, color="blue"] ; "Lisa" [shape=box, regular=1, color="pink"] ; "Maggie" [shape=box, regular=1, color="pink"] ; "Ling" [shape=box, regular=1, color="blue"] ; # creating tiny nodes w/ no label, no color "ParentsHomer" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "ParentsMarge" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "ParentsBart" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # draw the edges "Abraham" -> "ParentsHomer" [dir=none, weight=1] ; "Mona" -> "ParentsHomer" [dir=none, weight=1] ; "ParentsHomer" -> "Homer" [dir=none, weight=2] ; "ParentsHomer" -> "Herb" [dir=none, weight=2] ; "Clancy" -> "ParentsMarge" [dir=none, weight=1] ; "Jackeline" -> "ParentsMarge" [dir=none, weight=1] ; "ParentsMarge" -> "Marge" [dir=none, weight=2] ; "ParentsMarge" -> "Patty" [dir=none, weight=2] ; "ParentsMarge" -> "Selma" [dir=none, weight=2] ; "Homer" -> "ParentsBart" [dir=none, weight=1] ; "Marge" -> "ParentsBart" [dir=none, weight=1] ; "ParentsBart" -> "Bart" [dir=none, weight=2] ; "ParentsBart" -> "Lisa" [dir=none, weight=2] ; "ParentsBart" -> "Maggie" [dir=none, weight=2] ; "Selma" -> "Ling" [dir=none, weight=2] ; } ``` If I run this through dot (`dot simpsons.dot -Tsvg > simpsons.svg`), I get the following layout: ![Original, made by dot/graphviz](https://i.imgur.com/gxSzS.png) However, I'd like the edges to be more "family tree"-like: a T-junction between two married persons with the vertical line of the T again branching in an upside-down T-junction with small subdivisions for each of the children, like this mock-up, done in KolourPaint: ![what I would like to achieve](https://i.imgur.com/H7jAX.png) What is the dot syntax that I have to use to achieve this?
Family tree layout with Dot/GraphViz
CC BY-SA 2.5
0
2010-02-16T09:19:47.767
2021-02-13T23:42:49.030
2019-03-22T08:29:36.917
50,065
50,065
[ "graphviz", "dot", "family-tree", "graph-layout", "genealogy" ]
2,272,502
1
null
null
1
1,042
I followed roughly the recipe in this blog entry [http://eclipsercptutorials.blogspot.com/2009/05/add-toolbar-to-view-in-eclipse-rcp.html](http://eclipsercptutorials.blogspot.com/2009/05/add-toolbar-to-view-in-eclipse-rcp.html) Which looks like that — the image appears left to the minimize/maximize icons ![alt text](https://imgur.com/RFiID.png) The thing is, if I don't assign an image to the action, then the item doesn't appear in the header, but in a separate toolbar! ![alt text](https://imgur.com/gIS2h.png) Why?
Confusion over Eclipse SWT ViewPart and its Toolbars?
CC BY-SA 2.5
null
2010-02-16T11:32:12.203
2010-02-16T11:36:19.527
null
null
917
[ "java", "eclipse", "swt", "eclipse-rcp" ]
2,275,606
1
2,275,615
null
14
59,562
I have this image: ![enter image description here](https://i.stack.imgur.com/6shGh.png) But i want to place text in the middle like this: ![This is how i wanted.](https://i.stack.imgur.com/kCiNW.png) How can I achieve this? I would like to do this in html, so I would use a `<div>` or a `<span>`
Position text over image
CC BY-SA 3.0
0
2010-02-16T19:14:06.583
2015-07-27T02:06:29.807
2015-07-27T02:06:29.807
2,930,477
267,304
[ "html", "css" ]
2,275,812
1
null
null
0
444
I duplicated default build target. Some code files are duplicated also. Problem is, duplicated info.plist file is not formatted by Xcode. I don't think this is normal. Any workaround? Or any way to specify formatting of plist? (which may format other type of .plist by my custom formatting rules) ![alt text](https://farm5.static.flickr.com/4048/4363183298_d3ca6ef0b0_o.png)
How can I recover formatting of application's info.plist in Xcode?
CC BY-SA 2.5
null
2010-02-16T19:47:29.220
2012-12-21T17:54:20.237
2017-02-08T14:21:13.653
-1
246,776
[ "xcode", "plist", "target", "duplication" ]
2,276,705
1
2,277,200
null
5
5,636
I have parent child relationship between two entities(Parent and Child). My Parent mapping is as follows: ``` <class name="Parent" table="Parents"> ... <bag name="Children" cascade="all"> <key column="ParentID"></key> <one-to-many class="Child"></one-to-many> </bag> </class> ``` I would like to execute the following: ``` someParent.Children.Remove(someChild); ``` The Child class has a reference to another parent class, Type. The relationship looks like ![relation diagram](https://yuml.me/diagram/scruffy/class/%5BParent%5D+1-%3E%5C*%5BChild%5D%2C%20%5BType%5D+1-%3E*%5BChild%5D) Due to this relationship, when the above code is called, instead of a DELETE query, an UPDATE query is generated which removes the ParentID from the Child table(sets to null). Is it possible to force NHibernate to delete the child record completely, when removed from the Parent.Children collection? @Spencer's Solution Very attractive solution as this is something that can be implemented in future classes. However, due to the way sessions are handled(in my particular case) in the repository pattern, this is near impossible as we would have to pass session types(CallSessionContext/WebSessionContext) depending on the application. @Jamie's Solution Simple and quick to implement, however I've hit another road block. My child entity looks as follows: ![entity object](https://yuml.me/diagram/class/%5BChild%7CChildID%3BParentID%3BTypeID%3BName%3B%5D) When using the new method, NHibernate generates an update statement setting the TypeID and ParentID to null, as opposed to a single delete outright. If I missed something within the implementation, let me know as this method would be painless to move forward with. @[The One-Shot-Delete solution described here](http://knol.google.com/k/fabio-maulo/nhibernate-chapter-16/1nr4enxv3dpeq/19#16(2E)5(2E)(C2)(A0)Understanding_Collection_performance), outlines an idea dereferencing the collection to force a single delete. Same results as above however, an update statement is issued. ``` //Instantiate new collection and add persisted items List<Child> children = new List<Child>(); children.AddRange(parent.Children); //Find and remove requested items from new collection var childrenToRemove = children .Where(c => c.Type.TypeID == 1) .ToList(); foreach (var c in childrenToRemove) { children.Remove(m); } parent.Children = null; //Set persisted collection to new list parent.Children = Children; ``` Took a bit of digging, but Jamie's solution came through with some additional modifications. For future readers, based on my class model above: Type mapping - Inverse = true, Cascade = all Parent mapping - Inverse = true, Cascade = all-delete-orphan Remove methods as described in Jamie's solution works. This does produce a single delete statement per orphaned item, so there is the possibility for tuning in the future, however the end result is successful.
Removing an item from a collection(NHibernate)
CC BY-SA 3.0
null
2010-02-16T22:04:49.760
2017-03-23T14:41:45.177
2017-03-23T14:41:45.177
179,669
133,753
[ "c#", "nhibernate" ]
2,277,396
1
null
null
5
3,790
Inside the weblogic console, when you click on a deployment, there is a tab named 'Monitoring' and a subtab named 'Health'. How can i expose my application health to this tab? Is there a developer's guide somewhere? ![enter image description here](https://i.stack.imgur.com/GLH9L.jpg) To clarify what i want to do: Output my application background process states to this 'Health' monitoring page in the WLS admin page.
Weblogic health monitoring feature
CC BY-SA 3.0
0
2010-02-17T00:11:43.503
2013-04-16T15:18:05.077
2013-04-16T15:18:05.077
2,273,628
99,033
[ "java", "weblogic", "jmx" ]
2,280,142
1
2,280,223
null
1
4,754
I am working with Dundas maps and need to overlay the map with bubbles depicting some data. I want to add shapes to the map in order to achieve this. I can add a triangle (or any straight-line-polygon) like this: ``` public static void AddShape(this MapControl map, List<MapPoint> points, Color color, string name) { if (points[0].X != points[points.Count - 1].X && points[0].Y != points[points.Count - 1].Y) points.Add(points[0]); var shape = new Shape { Name = name, BorderColor = color, BorderStyle = MapDashStyle.Solid, BorderWidth = 1, Color = Color.FromArgb((int)(255 * (0.3)), color) }; var segments = new[] {new ShapeSegment {Type = SegmentType.Polygon, Length = points.Count}}; shape.AddSegments(points.ToArray(), segments); map.Shapes.Add(shape); } public static void AddBermudaTriangle(this MapControl map) { var points = new List<MapPoint> { new MapPoint(-80.15, 26.0667), new MapPoint(-64.75, 32.333), new MapPoint(-66.07, 18.41) }; map.AddShape(points, Color.Red, "Bermuda Triangle"); } ``` ![Bermuda Triangle](https://lh3.ggpht.com/_Psti3TsSy9w/S3vOCKkbEwI/AAAAAAAAQbI/MKlv08SJtY4/s800/Bermuda.png) You can see that the Bermuda Triangle overlays the map in red. Now I want to calculate a set of points to pass to my AddShape method that would draw an elipse or circle. I just need a simple algorithm for calculating the x and y coordinates of a given number of points. Perhaps starting with a given point that would represent the centre of the circle. For example: ``` public static void AddCircle(this MapControl map, Point centre, double radius, string name) { var points = new List<MapPoint>(); const int n = 360; for(var i = 0; i < n; i++) { //calculate x & y using n, radius and centre double x = 0; double y = 0; points.Add(new MapPoint(x, y)); } map.AddShape(points, Color.Red, name); } ``` I know that the x,y calculation is simple trigonometry but I'm suffering a brain freeze. Help! EDIT (Solved using tur!ng's code): ``` public static void AddCircle(this MapControl map, Color color, MapPoint centre, double radius, string name) { var points = new List<MapPoint>(); const int n = 360; for(var i = 0; i < n; i++) { var x = (radius * Math.Cos(i * Math.PI / 180)) + centre.X; var y = (radius * Math.Sin(i * Math.PI / 180)) + centre.Y; points.Add(new MapPoint(x, y)); } map.AddShape(points, color, name); } ``` ![alt text](https://lh3.ggpht.com/_Psti3TsSy9w/S3vZ7ncRx_I/AAAAAAAAQcQ/IIWUu1eesHY/s800/Greenwich.png) The blue circle (over Greenwich) is distorted because of the map projection over a Robinson grid.
Calculate points to create a curve or spline to draw an ellipse
CC BY-SA 3.0
null
2010-02-17T11:23:09.343
2011-07-01T18:55:37.493
2017-02-08T14:21:14.670
-1
68,115
[ "c#", "algorithm", "graphics", "dundas" ]
2,280,515
1
2,280,865
null
0
1,134
while running maven from eclipse you have option to execute these launch configurations by default .. here is the image of that : ![alt text](https://i.stack.imgur.com/oBUG6.gif) Now I can add my own launch configurations and execute them. Like this : ![alt text](https://i.stack.imgur.com/3TQ6O.gif) Now instead of running run configurations every time, is it possible that I put my own launch configuration called "Clean install skip tests with assembly" instead of default run configuration #1(Maven assembly:assembly) or can I add #10 configuration to be my created configuration. Thank you
Maven launch configurations in Eclipse
CC BY-SA 4.0
0
2010-02-17T12:28:01.297
2019-06-17T11:02:27.390
2019-06-17T11:02:27.390
4,751,173
169,277
[ "java", "eclipse", "maven-2", "m2eclipse" ]
2,281,159
1
2,281,225
null
2
2,134
i'd like to be able to calculate the 'mean brightest point' in a line of pixels. It's for a primitive 3D scanner. for testing i simply stepped through the pixels and if the current pixel is brighter than the one before, the brightest point of that line will be set to the current pixel. This of course gives very jittery results throughout the image(s). i'd like to get the 'average center of the brightness' instead, if that makes sense. ![alt text](https://dl.dropbox.com/u/1358257/line.png) has to be a common thing, i'm simply lacking the right words for a google search.
how do i calculate the centroid of the brightest spot in a line of pixels?
CC BY-SA 2.5
null
2010-02-17T13:52:12.237
2010-02-17T22:08:21.630
2020-06-20T09:12:55.060
-1
252,641
[ "computer-vision", "pixel" ]
2,283,580
1
4,027,823
null
7
2,400
I'm using the System.Windows.Controls.WebBrowser for various things in my app and I've noticed that adorners are cut off when they are supposed to appear over a WebBrowser. I realize that the WebBrowser control is really a wrapper around a COM component and probably renders differently, but I wondered if anyone figured out how to solve this. This is the problem I'm seeing. Here I have just a sample adorner that is supposed to draw a big red circle in the top corner of something (as a sample). When I adorn the WebBrowser with this, I get this result: ![](https://dl.dropbox.com/u/376992/adorner.PNG) I expect to see the full circle. Here's the code for this worthless adorner, in case that is helpful: ``` public class SillyAdorner : Adorner { public SillyAdorner(UIElement element) : base(element) { } protected override void OnRender(DrawingContext drawingContext) { drawingContext.DrawEllipse(new SolidColorBrush(Colors.Red), new Pen(), new Point(7, 7), 30, 30); base.OnRender(drawingContext); } } ``` And here is how I apply it to the browser in the OnRender method of the host control: ``` protected override void OnRender(DrawingContext drawingContext) { base.OnRender(drawingContext); var layer = AdornerLayer.GetAdornerLayer(browser); layer.Add(new SillyAdorner(browser)); } ``` Anyone have any hacks or workarounds for this?
Display an Adorner over a WebBrowser control
CC BY-SA 2.5
0
2010-02-17T19:04:29.463
2019-09-24T13:12:07.850
2017-02-08T14:21:16.520
-1
3,244
[ "wpf", "com", "webbrowser-control", "hwnd", "adorner" ]
2,283,617
1
2,312,187
null
17
6,551
I have an HTML table whose cells contain, among other things, spans, like this: ``` ... <td> <span style="height: 20px; width: 20px; margin-left: 2px;"> <span style="height: 20px; width: 20px; margin-left: 2px;"> <span style="height: 20px; width: 20px; margin-left: 2px;"> </td> ... ``` I'm looking for a way to shrink the width of those spans, rather than line wrap them, when the containing table cell is too narrow to show them all on one line. I tried playing around with setting the spans' `max-width` to `20px` and then using a percent for the width, but that does not work because the table cell tries to be only as wide as its contents. The minimum table cell width would be the width needed to display the header on 1 line. For the visual types, here's what I currently have when there is enough width: ![enter image description here](https://i.stack.imgur.com/7ivbk.png) Here's what I currently have when there is not enough width: ![enter image description here](https://i.stack.imgur.com/47OPT.png) And here's what I would like it to look like when there is not enough width for each span to be a full 20px: ![enter image description here](https://i.stack.imgur.com/FXKaE.png) In case it's not obvious, the spans are the colored squares in the `TXEs`, `RDBs`, and `RavenNets` columns.
Setting width of table cell contents based on available width
CC BY-SA 3.0
0
2010-02-17T19:09:04.367
2013-01-16T16:06:12.430
2013-01-16T16:06:12.430
139,010
139,010
[ "html", "css" ]
2,283,923
1
2,284,591
null
1
8,388
I am trying to change the value of the onblur attribute of a text input after the page has finished loading. When I do the following, it simply fires the function: `ip.onblur = stopCalcUpInt(this,10);` When I do the following, I have success: `ip.onblur = function onblur(event){stopCalcUpInt(this,10);}` Unfortunately, the whole point of this is to be able to dynamically set the second parameter for stopCalcUpInt(). If I hard code a value for it... it works fine... but any attempts to pass varibles to this fails... instead of putting the value of the variable as the second param it just puts the plain text of the variable name itself. Here is ideally what I am TRYING to do: `ip.onblur = function onblur(event){stopCalcUpInt(this,this.value);}` In this example, when I alert the ip.onblur I get: ![](https://imgur.com/ihuA7.png)
How to programmatically change an inputs onblur?
CC BY-SA 4.0
0
2010-02-17T19:52:22.207
2018-10-10T05:35:31.423
2018-10-10T05:35:31.423
1,033,581
268,826
[ "javascript" ]
2,284,059
1
null
null
4
9,785
I'm trying to build an app to detect images which are advertisements from the webpages. Once I detect those I`ll not be allowing those to be displayed on the client side. From the help that I got on [this Stackoverflow question](https://stackoverflow.com/questions/1991113/optimization-of-neural-network-input-data), I thought SVM is the best approach to my aim. So, I have coded SVM and an SMO myself. The dataset which I have got from UCI data repository has 3280 instances ( [Link to Dataset](http://archive.ics.uci.edu/ml/datasets/Internet+Advertisements) ) where around 400 of them are from class representing Advertisement images and rest of them representing non-advertisement images. Right now I'm taking the first 2800 input sets and training the SVM. But after looking at the accuracy rate I realised that most of those 2800 input sets are from non-advertisement image class. So I`m getting very good accuracy for that class. So what can I do here? About how many input set shall I give to SVM to train and how many of them for each class? Thanks. Cheers. ( Basically made a new question because the context was different from my previous question. [Optimization of Neural Network input data](https://stackoverflow.com/questions/1991113/optimization-of-neural-network-input-data) ) --- Thanks for the reply. I want to check whether I`m deriving the C values for ad and non-ad class correctly or not. Please give me feedback on this. ![enter image description here](https://i.stack.imgur.com/tbSz5.jpg) Or you u can see the doc version [here](http://amolkimi.0fees.net/weightedSVM.doc). You can see graph of y1 eqaul to y2 here ![enter image description here](https://i.stack.imgur.com/dPqif.jpg) and y1 not equal to y2 here ![enter image description here](https://i.stack.imgur.com/KTP5k.jpg)
SVM Classification - minimum number of input sets for each class
CC BY-SA 3.0
0
2010-02-17T20:16:51.577
2015-01-12T20:21:34.323
2017-05-23T12:13:24.810
-1
242,233
[ "machine-learning", "classification", "svm", "training-data" ]
2,285,950
1
2,286,229
null
2
3,671
I'm using SSRS 2008 to make something for label printing. I want to make use of all horizontal and vertical space on the page to fit as many labels as possible, so I'm thinking I probably want multiple Report Columns. [This technet article](http://technet.microsoft.com/en-us/library/bb677374.aspx) would have you believe that you can set the number of Report Columns to make what they call "newsletter-style columns" in the Report Properties window. If I bring up the Report Designer in my Visual Studio 2008 installation and click on Report -> Report Properties from the top menu, I see this: ![Hosted by imgur.com](https://imgur.com/atQDa.png) I can't find anything relating to columns, and no combination of the other settings on this page will make it change to multiple columns (yes, I'm rendering to PDF, not just checking the HTML preview.) Any ideas? Thanks for your help!
Multiple Report Columns in Reporting Services 2008
CC BY-SA 2.5
null
2010-02-18T02:46:18.700
2013-11-07T21:03:16.523
null
null
41,457
[ "ssrs-2008" ]
2,286,637
1
2,536,657
null
5
2,996
I'm implementing the TTThumbsViewController from the Three20 project and things are finally starting to take shape. I push the TTThumbsViewController from the current view controller by just pushing it onto the current stack and animate the transition (common navigation controller push). My problem is that when I pop the TThumbsViewController view controller, the navigation controller is stuck in a mode where its view controllers are drawn UNDER the navigation bar (which is now translucent). ![alt text](https://people.engr.ncsu.edu/sbklein/start.PNG) [](https://i.stack.imgur.com/zg58I.png) [ncsu.edu](https://people.engr.ncsu.edu/sbklein/push.PNG) [](https://i.stack.imgur.com/0B816.png) [ncsu.edu](https://people.engr.ncsu.edu/sbklein/pop.PNG)
View controller is drawing under my navigation bar after popping ttthumbsviewcontroller
CC BY-SA 4.0
0
2010-02-18T06:02:31.880
2023-03-01T09:32:22.613
2023-03-01T09:32:22.613
4,751,173
247,205
[ "iphone", "uinavigationcontroller", "three20" ]
2,288,864
1
2,290,615
null
5
1,213
Is there any algorithm for projecting images onto a non-flat (deformed) surface? It is not deformed too much. It is a really glassy surface covered with high-quality, durable tracing paper. I have a 3-dimensional model of it. How can I texturise it with a projector? ![projection](https://www.win.tue.nl/~wieger/images/5.jpg) I want to write a program in C\C++\C# for Windows, which would be able to texturise any surface given by a 3-dimensional model using a projector. I need an algorithm or open source libraries containing algorithms.
Is there any algorithm for projecting images onto a non-flat surface?
CC BY-SA 2.5
0
2010-02-18T13:26:36.570
2014-06-19T23:09:08.957
2017-02-08T14:21:19.570
-1
434,051
[ "algorithm", "model", "3d", "projector", "geometry-surface" ]
2,290,387
1
2,290,526
null
0
1,172
I have a function that return a results, here is the results: ``` 3.98901669117011 vm 0.138912911874081 nvm 2.30800830234368 hg 1.13724811900026 ms 2.33557467785177 ls 90.0912392977601 none ``` I want the words to be in the top of the table, and the numbers in the rows, and in the sides some string, here is an example: ![Table example](https://i.stack.imgur.com/X3IpG.png) How can I create a table in C# and write to it what I wrote?
Create and write to table in C#
CC BY-SA 3.0
null
2010-02-18T16:47:48.157
2017-05-08T18:44:23.900
2017-05-08T18:44:23.900
4,370,109
236,626
[ "c#", "console-application" ]
2,290,992
1
null
null
2
2,584
Have stumbled upon what seems to be a bug with how mobile safari renders the cursor when a window.scrollTo() is executed while a user is entering text into a textarea. Have attached source code which illustrates the issue. I'm wondering if anyone has any advice on how I might work around this. If a user is entering text into a textarea and a window.scrollTo() is executed, the cursor remains rendered at the position the textarea to be, not at it's current position. Load the following web page using mobile safari. Touch the textarea, which will open the keyboard. Type a couple of characters and wait. As text is added dynamically to the page, and the window scrolled, you'll see the cursor artifact Have tried setting the focus() back to the textarea after the scroll, but that doesn't seem to have any effect. Thanks! ``` <html> <head> <meta id="viewport" name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;" /> <style type="text/css" media="screen"> textarea { margin-top:50px; } </style> <script type="text/javascript" charset="utf-8"> window.addEventListener('load', function() { setTimeout(addContent,5000); }, false); function addContent() { var elem = document.createElement('p'); elem.appendChild(document.createTextNode('Some new text')) document.getElementById('newContentContainer').appendChild(elem); window.scrollTo(0,20); setTimeout(addContent,5000); } </script> </head> <body> <div id="newContentContainer"></div> <div> <textarea></textarea> </div> </body> </html> ``` Here's a photo which shows the problem: ![alt text](https://farm5.static.flickr.com/4047/4367774363_a30925d7ba_o.jpg)
Mobile Safari scrollTo w/ textarea bug
CC BY-SA 2.5
0
2010-02-18T18:10:59.667
2010-06-29T11:00:08.117
2017-02-08T14:21:20.577
-1
26,241
[ "javascript", "html", "mobile-safari" ]
2,291,437
1
2,291,971
null
2
1,679
I have a webpage where I put a text into a "pre" tag that is inside a "div" that resizes with the window size. If the "div" is so small that the text in the "pre" overflows horizontally, I want the text to wrap at a word break. Here is the html that demonstrates the problem: ``` <html> <head> <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'></script> </head> <body> <style type="text/css"> pre { white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */ white-space: -pre-wrap; /* Opera */ white-space: -o-pre-wrap; /* Opera */ white-space: pre-wrap; /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */ word-wrap: break-word; /* IE 5.5+ */ } </style> <div id="test"> <pre> this is some long text that seems to wrap inappropriately if the window in ie8 is the wrong width. this is some long text that seems to wrap inappropriately if the window in ie8 is the wrong width. this is some long text that seems to wrap inappropriately if the window in ie8 is the wrong width. this is some long text that seems to wrap inappropriately if the window in ie8 is the wrong width. this is some long text that seems to wrap inappropriately if the window in ie8 is the wrong width. this is some long text that seems to wrap inappropriately if the window in ie8 is the wrong width. </pre> </div> <script type="text/javascript"> //<![CDATA[ $(function() { $(window).resize(function() { $("#test").height($(window).height() - $("#test").offset().top - 20 + "px"); $("#test").width($(window).width() - $("#test").offset().left - 20 + "px"); }); $(window).resize(); }); //]]> </script> </body> </html> ``` This works fine in the versions of Firefox, Safari and Chrome that I've tested, but I get some duplication of text in IE8. ![](https://i.stack.imgur.com/50b7R.jpg) The first line has the word "width" repeated. Any ideas how to address this?
IE8 duplicates text in wrapping <pre> tags
CC BY-SA 4.0
0
2010-02-18T19:10:23.387
2019-06-18T04:04:01.860
2019-06-18T04:04:01.860
4,751,173
118,218
[ "html", "internet-explorer-8", "word-wrap" ]
2,291,486
1
2,389,356
null
1
1,974
I have a UITableViewCell with the UITableViewStyleGrouped style and I would like to change the background color of the cell. ``` - (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)ip { // Do cell creation stuff ... cell.backgroundColor = [UIColor colorWithRed:255.0/255.0 green:243.0/255.0 blue:175.0/255.0 alpha:0.50]; } ``` The trouble is, this doesn't display properly on a grid with the `UITableViewStyleGrouped`; I use the same color on a `UITableViewStylePlain` and it displays correctly. I'm developing for OS 3.0 and have read the [multiple](https://stackoverflow.com/questions/1784827/change-background-color-of-tableview-cell-uitableviewcell-got-the-code-work) [posts](https://stackoverflow.com/questions/1164459/changing-uitableviewcell-textlabel-background-color-to-clear) on setting background color. I can set the color it just doesn't set properly! What am I missing? ![Incorrect yellow background with Alpha](https://i.imgur.com/WVhlL.png) ![Correct yellow background with Alpha](https://i.imgur.com/xQMIj.png)
UITableViewCell displaying incorrect alpha based background colors
CC BY-SA 2.5
null
2010-02-18T19:16:22.540
2012-01-31T17:54:42.853
2017-05-23T12:01:08.460
-1
33,226
[ "iphone", "objective-c", "cocoa", "xcode" ]
2,292,920
1
2,292,971
null
3
929
The styles: ``` h2 { color: #71D0FF; font-size: 11px; font-weight: bold; margin: 0px 0px 5px 0px; } a.box { color: #FFFFFF !important; cursor: pointer; display: block; padding: 10px; text-align: justify; } a.box:hover { background-color: #0C0C0C; } a.box span.down { display: block; color: #D04242; float: right; font-size: 11px; margin-left: 5px; } a.box span.up { display: block; color: #71D013; float: right; font-size: 11px; } span.noob { color: #FFA142; } span.pro { color: #A142A1; } ``` The HTML (this is basically repeated for each link): ``` <a href="/library/blaze" class="box"> <span class="down">-0</span> <span class="up">+0</span> <h2><span class="noob">NOOB</span> BLAZE</h2> HAS CREATED 0 MAPS, WON 0 BATTLES, AND LOST 0 MAPS </a> ``` What I'm not understanding is why it renders differently in Firefox occasionally. Sometimes it shows up like it's supposed to and sometimes it shows up in this weird format as seen here: ![Example](https://i.stack.imgur.com/RkZde.jpg) I've never had anything like this happen before, does anyone know what's causing it? Does it even do this for anyone else? Like I stated before, sometimes it loads just fine (exact same HTML, CSS, and everything) and sometimes it doesn't. It seems kind of random. It loads just fine in IE with no weird problems at all.
What could cause this HTML/CSS rendering issue in Firefox?
CC BY-SA 3.0
null
2010-02-18T23:06:17.453
2013-02-14T21:07:25.617
2013-02-14T21:07:25.617
246,246
246,246
[ "html", "css", "xhtml" ]
2,293,461
1
null
null
1
4,844
if I want to partially download a file and define a single range in the request Header, I get the byte-stream of the requested file in the response body. But if i specify multiple ranges as below, I always get for each defined range an additional response header (wich describes the requested range) within the response body that corrupts the downloaded file. ``` static void Main(string[] args) { Console.Write("Please enter target File: "); string Target = Console.ReadLine(); string Source = @"http://mozilla-mirror.3347.voxcdn.com/pub/mozilla.org/firefox/releases/3.6/win32/de/Firefox%20Setup%203.6.exe"; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(Source); request.Credentials = CredentialCache.DefaultCredentials; // define multiple Ranges request.AddRange( 0, 1000000); request.AddRange(1000000, 2000000); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); using (Stream source = response.GetResponseStream()) { using (FileStream target = File.Open(Target, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite)) { byte[] buffer = new byte[4096]; int BytesRead = 0; int TotalBytesRead = 0; while((BytesRead = source.Read(buffer, 0, buffer.Length)) > 0) { target.Write(buffer, 0, BytesRead); TotalBytesRead += BytesRead; Console.WriteLine("{0}", TotalBytesRead); } } } Console.WriteLine("Downloading Finished!"); Console.ReadLine(); } ``` Request as shown in Wireshark: ``` http://img197.imageshack.us/img197/8199/requesty.png ``` Response Body should only contain the Byte-Stream of the file, but additionally contains the unwanted Response-Header at the beginning of each defined Range: ![Response hex dump](https://i.stack.imgur.com/GbEAL.png) Is it possible to avoid the additional response header in the body without requesting each Range separately? or Is there a build-in way to filter the additional response header, whose size could vary depending on the HTTP-Server?
HTTP Request with multiple Ranges
CC BY-SA 3.0
0
2010-02-19T01:14:02.803
2013-09-24T08:53:52.507
2013-09-24T08:53:52.507
445,517
276,613
[ "c#", ".net", "http", "httpwebrequest" ]
2,293,616
1
2,297,417
null
1
294
How to copy only selected renderings ![alt text](https://mcore.files.wordpress.com/2009/07/072209_1928_compositela1.png?w=497) from one to another item using sitecore content editor? Default "Copy To" function copy all renderings i want to copy and paste only selected. ![alt text](https://e0ufdw.bay.livefilestore.com/y1mutNhaPzmpL0R7J4q5dd1zt2or73V6PM1u91nDW7BXB19omiXkMayDlSVLGIPFRMxA3CGtSnzOxZsNsSttYjlc1w_J9z5G9b74RmuO3gVkUiBo3buWPyreJZD9K3OuqUlR9vZN-9VhCE/renderings.jpg)
How to copy only selected renderings from one to another item using sitecore content editor?
CC BY-SA 2.5
null
2010-02-19T02:01:44.250
2010-02-19T15:31:39.600
2017-02-08T14:21:20.913
-1
84,201
[ "sitecore", "sitecore6" ]
2,293,751
1
2,352,314
null
0
1,410
Ok, I'm going to try to make this more clear because my last question was extremely confusing. I've included a picture this time. Each one of these circles is a UIImageView and they are each assigned a random image which is one of 7 colors. So each circle could be one of 7 colors. I want to make it so that the user has to hit the circles in order of a pre-determined order according to color. For example, blue, green, yellow, pink, purple, orange, red. My HUGE problem is that I can't seem to figure out how to determine whether or not a color that isn't supposed to be hit got hit. Is there a way to assign multiple image views the same value and then somehow have an if statement that says.... ``` if(a blue circle is hit && ANY ORANGE CIRCLE IS STILL IN VIEW){ do something } ``` The only way I know how to code this would be an insane amount of code, because of all the random images being assigned. ``` bluebubble = [UIImage imageNamed:@"bluebubble.png"]; greenbubble = [UIImage imageNamed:@"greenbubble.png"]; redbubble = [UIImage imageNamed:@"redbubble.png"]; yellowbubble = [UIImage imageNamed:@"yellowbubble.png"]; orangebubble = [UIImage imageNamed:@"orangebubble.png"]; pinkbubble = [UIImage imageNamed:@"pinkbubble.png"]; purplebubble = [UIImage imageNamed:@"purplebubble.png"]; image1 = arc4random()%7; if(image1 == 0){ [test setImage:bluebubble]; } else if(image1 == 1){ [test setImage:greenbubble]; } else if(image1 == 2){ [test setImage:redbubble]; } else if(image1 == 3){ [test setImage:yellowbubble]; } else if(image1 == 4){ [test setImage:orangebubble]; } else if(image1 == 5){ [test setImage:pinkbubble]; } else if(image1 == 6){ [test setImage:purplebubble]; } image2 = arc4random()%7; if(image2 == 0){ [test2 setImage:bluebubble]; } else if(image2 == 1){ [test2 setImage:greenbubble]; } else if(image2 == 2){ [test2 setImage:redbubble]; } else if(image2 == 3){ [test2 setImage:yellowbubble]; } else if(image2 == 4){ [test2 setImage:orangebubble]; } else if(image2 == 5){ [test2 setImage:pinkbubble]; } else if(image2 == 6){ [test2 setImage:purplebubble]; } ``` ![alt text](https://i796.photobucket.com/albums/yy245/NextRev/colors.png?t=1266561378)
Assigning random image with arc4random?
CC BY-SA 2.5
0
2010-02-19T02:39:06.890
2010-02-28T19:39:44.513
2017-02-08T14:21:21.253
-1
266,316
[ "iphone", "image", "sdk", "uiimage", "imageview" ]
2,295,095
1
4,316,700
null
36
58,914
Elements with css font-size <12px doesn't have effect in Google Chrome - remains font-size 12px. What should I do? My Google Chrome browser uses default settings. My version is 4.0.249.89. I am using Windows XP. You can paste the following code to your Google Chrome to test it: ``` <html> <body> <p style="font-size:6px;">test 6px</p> <p style="font-size:7px;">test 7px</p> <p style="font-size:8px;">test 8px</p> <p style="font-size:9px;">test 9px</p> <p style="font-size:10px;">test 10px</p> <p style="font-size:11px;">test 11px</p> <p style="font-size:12px;">test 12px</p> <p style="font-size:13px;">test 13px</p> <p style="font-size:14px;">test 14px</p> <p style="font-size:15px;">test 15px</p> <p style="font-size:16px;">test 16px</p> </body> </html> ``` Results from different browser: ![https://i178.photobucket.com/albums/w258/neodeep2001/chrome-font-size-diff.jpg](https://i178.photobucket.com/albums/w258/neodeep2001/chrome-font-size-diff.jpg)
Font-size <12px doesn't have effect in Google Chrome
CC BY-SA 2.5
0
2010-02-19T09:12:31.203
2020-12-14T14:31:39.803
2017-02-08T14:21:21.933
-1
64,873
[ "css", "google-chrome" ]
2,303,520
1
2,303,549
null
13
6,058
I created a standard Java Project in Eclipse, placed a XML file in the `src` folder with the intent to grab it by `Class#getResourceAsStream()`, and I was baffled when Eclipse can't seem to locate the XML file in the classpath. After a little test it turns out that files with other extensions are perfectly located. Here's a screen which says it all: ![enter image description here](https://i.stack.imgur.com/2gLsw.png) It prints `null` for the `/test.xml` resource. The `Class#getResourceAsStream()` obviously doesn't make any difference. I checked the project's `/bin` folder and the XML file is indeed not there. I've checked all settings to see if there isn't some filter to exclude certain files from ending up in the `/bin` folder during the build, but all in vain. How is this caused and how can I solve it? I'm using Eclipse Galileo with build id 20090920-1017.
Eclipse doesn't put XML files in project's own buildpath
CC BY-SA 3.0
0
2010-02-20T20:06:46.967
2013-02-27T01:29:22.203
2013-02-27T01:29:22.203
157,882
157,882
[ "xml", "eclipse", "classpath" ]
2,303,694
1
2,303,838
null
0
318
See the screenshot below, this is the only leak the Leaks Instrument finds in my app. Seems odd that main is leaking since it's out-of-the-box. Is this common? ![main.m](https://i766.photobucket.com/albums/xx302/conorgriffin/Screenshot2010-02-20at205006.png) ![top of call stack](https://i766.photobucket.com/albums/xx302/conorgriffin/Screenshot2010-02-21at120240.png) ![bottom of call stack](https://i766.photobucket.com/albums/xx302/conorgriffin/Screenshot2010-02-21at120748.png)
Why is main leaking in my iPhone app?
CC BY-SA 2.5
null
2010-02-20T20:59:09.710
2010-02-21T12:05:32.320
2017-02-08T14:21:26.063
-1
253,609
[ "iphone", "objective-c", "cocoa-touch", "xcode", "instruments" ]
2,303,690
1
3,223,466
null
336
313,915
I'm trying to create a thumbnail image on the client side using javascript and a canvas element, but when I shrink the image down, it looks terrible. It looks as if it was downsized in photoshop with the resampling set to 'Nearest Neighbor' instead of Bicubic. I know its possible to get this to look right, because [this site](http://www.rigasa.ch/~labo/labo/pixastic/editor/) can do it just fine using a canvas as well. I've tried using the same code they do as shown in the "[Source]" link, but it still looks terrible. Is there something I'm missing, some setting that needs to be set or something? EDIT: I'm trying to resize a jpg. I have tried resizing the same jpg on the linked site and in photoshop, and it looks fine when downsized. Here is the relevant code: ``` reader.onloadend = function(e) { var img = new Image(); var ctx = canvas.getContext("2d"); var canvasCopy = document.createElement("canvas"); var copyContext = canvasCopy.getContext("2d"); img.onload = function() { var ratio = 1; if(img.width > maxWidth) ratio = maxWidth / img.width; else if(img.height > maxHeight) ratio = maxHeight / img.height; canvasCopy.width = img.width; canvasCopy.height = img.height; copyContext.drawImage(img, 0, 0); canvas.width = img.width * ratio; canvas.height = img.height * ratio; ctx.drawImage(canvasCopy, 0, 0, canvasCopy.width, canvasCopy.height, 0, 0, canvas.width, canvas.height); }; img.src = reader.result; } ``` EDIT2: Seems I was mistaken, the linked website wasn't doing any better of a job of downsizing the image. I tried the other methods suggested and none of them look any better. This is what the different methods resulted in: Photoshop: ![alt text](https://i.stack.imgur.com/K6ztq.png) Canvas: ![alt text](https://i.stack.imgur.com/nD3FJ.png) Image with image-rendering: optimizeQuality set and scaled with width/height: ![alt text](https://i.stack.imgur.com/I6RkV.png) Image with image-rendering: optimizeQuality set and scaled with -moz-transform: ![alt text](https://i.stack.imgur.com/ZWiVC.png) Canvas resize on pixastic: ![alt text](https://i.stack.imgur.com/PEsYM.png) I guess this means firefox isn't using bicubic sampling like its supposed to. I'll just have to wait until they actually add it. EDIT3: [Original Image](https://i.stack.imgur.com/5x1UP.jpg)
Resizing an image in an HTML5 canvas
CC BY-SA 4.0
0
2010-02-20T20:58:29.953
2021-03-13T14:22:28.090
2018-11-27T16:36:41.763
10,657,589
149,986
[ "javascript", "html", "canvas", "image-resizing" ]
2,306,043
1
2,348,337
null
14
13,017
I'm looking for method to add gradually fading or maybe blured border (I don't exactly know how to name this effect) to arbitrary UIView. I don't need animated effect, I need static effect, for example I my UITableView border being partially transparent. I've made the example: ![enter image description here](https://i.stack.imgur.com/Nwv49.png) So you can see what I'm trying to do. Can anyone help me?
UIView border with fade or blur effect
CC BY-SA 3.0
0
2010-02-21T13:43:04.563
2013-09-05T18:50:12.047
2013-06-20T05:15:04.290
1,903,074
278,105
[ "objective-c", "iphone", "uitableview", "uikit", "uiview" ]
2,306,873
1
2,307,020
null
7
4,870
I'm building an MSBuild file and using it with the MSBuild Build Runner within TeamCity (5.0.2 (build 10784)), but I don't think it's running the right version of MSBuild because I keep getting the following error: > error MSB5014: File format version is not recognized. MSBuild can only read solution files between versions 7.0 and 9.0, inclusive. I'm a total newbie with TeamCity, so I'm not sure where to begin to look how to configure this. As you can see from the screenshot below, I have selected version 4.0 in the build runner configuration screen. ![Build Configuration](https://imgur.com/T66Fb.png)
TeamCity Using Wrong MSBuild Executable?
CC BY-SA 2.5
0
2010-02-21T18:20:32.243
2010-04-15T19:24:06.910
null
null
10,792
[ "teamcity", "teamcity-5.0" ]
2,306,940
1
2,337,923
null
11
18,241
I have a pretty simple console project with an entity model (containing two simple entities), two handmade POCOs and a handmade Context class. The program fires a simple query against the DB and everything including LazyLoading works fine. As soon as i add another Entity data model (even if i add an empty one), the calls to CreateObjectSet in Ef2PlaygroundModel_3Container throw the following exception: ``` Unhandled Exception: System.InvalidOperationException: Mapping and metadata information could not be found for EntityType 'EF2_Playground.Driver'. at System.Data.Objects.ObjectContext.GetTypeUsage(Type entityCLRType) at System.Data.Objects.ObjectContext.GetEntitySetFromContainer(EntityContainer container, Type entityCLRType, String exceptionParameterName) at System.Data.Objects.ObjectContext.GetEntitySetForType(Type entityCLRType, String exceptionParameterName) at System.Data.Objects.ObjectContext.CreateObjectSet[TEntity]() at EF2_Playground.Ef2PlaygroundModel_3Container.get_Drivers() in C:\...\Ef2PlaygroundModel_3Pocos.cs:line 64 at EF2_Playground.Program.Main(String[] args) in C:\...\Program.cs:line 15 ``` Does anyone have an idea about what is going wrong here? --- ## That is the working project: ![EF4 Data Model](https://content.screencast.com/users/JRoppert/folders/Jing/media/79d776db-9ee3-42c2-8d27-43fd26af1993/2010-02-21_1909.png) Code Generation Strategy is set to "None" ``` <?xml version="1.0" encoding="utf-8"?> <edmx:Edmx Version="2.0" xmlns:edmx="http://schemas.microsoft.com/ado/2008/10/edmx"> <!-- EF Runtime content --> <edmx:Runtime> <!-- SSDL content --> <edmx:StorageModels> <Schema Namespace="Ef2PlaygroundModel_3.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2008" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl"> <EntityContainer Name="Ef2PlaygroundModel_3StoreContainer"> <EntitySet Name="Cars" EntityType="Ef2PlaygroundModel_3.Store.Cars" store:Type="Tables" Schema="dbo"/> <EntitySet Name="Drivers" EntityType="Ef2PlaygroundModel_3.Store.Drivers" store:Type="Tables" Schema="dbo"/> <EntitySet Name="CarDriver" EntityType="Ef2PlaygroundModel_3.Store.CarDriver" store:Type="Tables" Schema="dbo"/> <AssociationSet Name="FK_CarDriver_Car" Association="Ef2PlaygroundModel_3.Store.FK_CarDriver_Car"> <End Role="Car" EntitySet="Cars"/> <End Role="CarDriver" EntitySet="CarDriver"/> </AssociationSet> <AssociationSet Name="FK_CarDriver_Driver" Association="Ef2PlaygroundModel_3.Store.FK_CarDriver_Driver"> <End Role="Driver" EntitySet="Drivers"/> <End Role="CarDriver" EntitySet="CarDriver"/> </AssociationSet> </EntityContainer> <EntityType Name="Cars"> <Key> <PropertyRef Name="Id"/> </Key> <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false"/> <Property Name="Brand" Type="nvarchar(max)" Nullable="false"/> <Property Name="Model" Type="nvarchar(max)" Nullable="false"/> <Property Name="ReleaseDate" Type="datetime" Nullable="true"/> </EntityType> <EntityType Name="Drivers"> <Key> <PropertyRef Name="Id"/> </Key> <Property Name="Id" Type="int" StoreGeneratedPattern="Identity" Nullable="false"/> <Property Name="Name" Type="nvarchar(max)" Nullable="false"/> </EntityType> <EntityType Name="CarDriver"> <Key> <PropertyRef Name="Cars_Id"/> <PropertyRef Name="Drivers_Id"/> </Key> <Property Name="Cars_Id" Type="int" Nullable="false"/> <Property Name="Drivers_Id" Type="int" Nullable="false"/> </EntityType> <Association Name="FK_CarDriver_Car"> <End Role="Car" Type="Ef2PlaygroundModel_3.Store.Cars" Multiplicity="1"/> <End Role="CarDriver" Type="Ef2PlaygroundModel_3.Store.CarDriver" Multiplicity="*"/> <ReferentialConstraint> <Principal Role="Car"> <PropertyRef Name="Id"/> </Principal> <Dependent Role="CarDriver"> <PropertyRef Name="Cars_Id"/> </Dependent> </ReferentialConstraint> </Association> <Association Name="FK_CarDriver_Driver"> <End Role="CarDriver" Type="Ef2PlaygroundModel_3.Store.CarDriver" Multiplicity="*"/> <End Role="Driver" Type="Ef2PlaygroundModel_3.Store.Drivers" Multiplicity="1"/> <ReferentialConstraint> <Principal Role="Driver"> <PropertyRef Name="Id"/> </Principal> <Dependent Role="CarDriver"> <PropertyRef Name="Drivers_Id"/> </Dependent> </ReferentialConstraint> </Association> </Schema> </edmx:StorageModels> <!-- CSDL content --> <edmx:ConceptualModels> <Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" xmlns:cg="http://schemas.microsoft.com/ado/2006/04/codegeneration" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" Namespace="Ef2PlaygroundModel_3" Alias="Self" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation"> <EntityContainer Name="Ef2PlaygroundModel_3Container" annotation:LazyLoadingEnabled="true"> <EntitySet Name="Cars" EntityType="Ef2PlaygroundModel_3.Car"/> <EntitySet Name="Drivers" EntityType="Ef2PlaygroundModel_3.Driver"/> <AssociationSet Name="CarDriver" Association="Ef2PlaygroundModel_3.CarDriver"> <End Role="Car" EntitySet="Cars"/> <End Role="Driver" EntitySet="Drivers"/> </AssociationSet> </EntityContainer> <EntityType Name="Car"> <Key> <PropertyRef Name="Id"/> </Key> <Property Type="Int32" Name="Id" Nullable="false" annotation:StoreGeneratedPattern="Identity"/> <Property Type="String" Name="Brand" Nullable="false"/> <Property Type="String" Name="Model" Nullable="false"/> <Property Type="DateTime" Name="ReleaseDate" Nullable="true"/> <NavigationProperty Name="Drivers" Relationship="Ef2PlaygroundModel_3.CarDriver" FromRole="Car" ToRole="Driver"/> </EntityType> <EntityType Name="Driver"> <Key> <PropertyRef Name="Id"/> </Key> <Property Type="Int32" Name="Id" Nullable="false" annotation:StoreGeneratedPattern="Identity"/> <Property Type="String" Name="Name" Nullable="false"/> <NavigationProperty Name="Cars" Relationship="Ef2PlaygroundModel_3.CarDriver" FromRole="Driver" ToRole="Car"/> </EntityType> <Association Name="CarDriver"> <End Type="Ef2PlaygroundModel_3.Car" Role="Car" Multiplicity="*"/> <End Type="Ef2PlaygroundModel_3.Driver" Role="Driver" Multiplicity="*"/> </Association> </Schema> </edmx:ConceptualModels> <!-- C-S mapping content --> <edmx:Mappings> <Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2008/09/mapping/cs"> <EntityContainerMapping StorageEntityContainer="Ef2PlaygroundModel_3StoreContainer" CdmEntityContainer="Ef2PlaygroundModel_3Container"> <EntitySetMapping Name="Cars"> <EntityTypeMapping TypeName="IsTypeOf(Ef2PlaygroundModel_3.Car)"> <MappingFragment StoreEntitySet="Cars"> <ScalarProperty Name="Id" ColumnName="Id"/> <ScalarProperty Name="Brand" ColumnName="Brand"/> <ScalarProperty Name="Model" ColumnName="Model"/> <ScalarProperty Name="ReleaseDate" ColumnName="ReleaseDate"/> </MappingFragment> </EntityTypeMapping> </EntitySetMapping> <EntitySetMapping Name="Drivers"> <EntityTypeMapping TypeName="IsTypeOf(Ef2PlaygroundModel_3.Driver)"> <MappingFragment StoreEntitySet="Drivers"> <ScalarProperty Name="Id" ColumnName="Id"/> <ScalarProperty Name="Name" ColumnName="Name"/> </MappingFragment> </EntityTypeMapping> </EntitySetMapping> <AssociationSetMapping Name="CarDriver" TypeName="Ef2PlaygroundModel_3.CarDriver" StoreEntitySet="CarDriver"> <EndProperty Name="Car"> <ScalarProperty Name="Id" ColumnName="Cars_Id"/> </EndProperty> <EndProperty Name="Driver"> <ScalarProperty Name="Id" ColumnName="Drivers_Id"/> </EndProperty> </AssociationSetMapping> </EntityContainerMapping> </Mapping> </edmx:Mappings> </edmx:Runtime> <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) --> <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2008/10/edmx"> <edmx:Connection> <DesignerInfoPropertySet> <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly"/> </DesignerInfoPropertySet> </edmx:Connection> <edmx:Options> <DesignerInfoPropertySet> <DesignerProperty Name="ValidateOnBuild" Value="true"/> <DesignerProperty Name="EnablePluralization" Value="False"/> <DesignerProperty Name="CodeGenerationStrategy" Value="None"/> </DesignerInfoPropertySet> </edmx:Options> <!-- Diagram content (shape and connector positions) --> <edmx:Diagrams> <Diagram Name="Ef2PlaygroundModel_3"> <EntityTypeShape EntityType="Ef2PlaygroundModel_3.Car" Width="1.5" PointX="3.25" PointY="1.625" Height="1.787985026041667"/> <EntityTypeShape EntityType="Ef2PlaygroundModel_3.Driver" Width="1.5" PointX="5.375" PointY="1.625" Height="1.59568359375"/> <AssociationConnector Association="Ef2PlaygroundModel_3.CarDriver"> <ConnectorPoint PointX="4.75" PointY="2.422841796875"/> <ConnectorPoint PointX="5.375" PointY="2.422841796875"/> </AssociationConnector> </Diagram> </edmx:Diagrams> </edmx:Designer> </edmx:Edmx> ``` ``` <configuration> <connectionStrings> <add name="Ef2PlaygroundModel_3Container" connectionString="metadata=res://*/Ef2PlaygroundModel_3.csdl|res://*/Ef2PlaygroundModel_3.ssdl|res://*/Ef2PlaygroundModel_3.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SqlExpress;Initial Catalog=Ef2PlaygroundModel_3;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /> </connectionStrings> </configuration> ``` ``` using System; using System.Collections.Generic; using System.Data.Objects; namespace EF2_Playground { public class Car { public Car() { Drivers = new List<Driver>(); } public int Id { get; set; } public string Brand { get; set; } public string Model { get; set; } public DateTime? ReleaseDate { get; set; } public virtual List<Driver> Drivers { get; private set; } } public class Driver { public Driver() { Cars = new List<Car>(); } public int Id { get; set; } public string Name { get; set; } public virtual List<Car> Cars { get; private set; } } public class Ef2PlaygroundModel_3Container : ObjectContext { public Ef2PlaygroundModel_3Container() : base("name=Ef2PlaygroundModel_3Container") { ContextOptions.LazyLoadingEnabled = true; } public IObjectSet<Car> Cars { get { return CreateObjectSet<Car>(); } } public IObjectSet<Driver> Drivers { get { return CreateObjectSet<Driver>(); } } } } ``` ``` using System; namespace EF2_Playground { class Program { static void Main(string[] args) { using (var ctx = new Ef2PlaygroundModel_3Container()) { foreach (var driver in ctx.Drivers) { Console.WriteLine(driver.Name); foreach (var car in driver.Cars) { Console.WriteLine(" drives a {0} - {1} (released on {2})", car.Brand, car.Model, car.ReleaseDate); } } } } } } ``` ``` <?xml version="1.0" encoding="utf-8"?> <edmx:Edmx Version="2.0" xmlns:edmx="http://schemas.microsoft.com/ado/2008/10/edmx"> <!-- EF Runtime content --> <edmx:Runtime> <!-- SSDL content --> <edmx:StorageModels> <Schema xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl" Namespace="Model1.Store" Alias="Self" Provider="System.Data.SqlClient" ProviderManifestToken="2005"> <EntityContainer Name="Model1TargetContainer"> </EntityContainer> </Schema> </edmx:StorageModels> <!-- CSDL content --> <edmx:ConceptualModels> <Schema xmlns="http://schemas.microsoft.com/ado/2008/09/edm" xmlns:cg="http://schemas.microsoft.com/ado/2006/04/codegeneration" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" Namespace="Model1" Alias="Self" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation"> <EntityContainer Name="Model1Container" annotation:LazyLoadingEnabled="true"> </EntityContainer> </Schema> </edmx:ConceptualModels> <!-- C-S mapping content --> <edmx:Mappings> <Mapping xmlns="http://schemas.microsoft.com/ado/2008/09/mapping/cs" Space="C-S"> <Alias Key="Model" Value="Model1"/> <Alias Key="Target" Value="Model1.Store"/> <EntityContainerMapping CdmEntityContainer="Model1Container" StorageEntityContainer="Model1TargetContainer"> </EntityContainerMapping> </Mapping> </edmx:Mappings> </edmx:Runtime> <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) --> <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2008/10/edmx"> <edmx:Connection> <DesignerInfoPropertySet> <DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly"/> </DesignerInfoPropertySet> </edmx:Connection> <edmx:Options> <DesignerInfoPropertySet> <DesignerProperty Name="ValidateOnBuild" Value="true"/> <DesignerProperty Name="EnablePluralization" Value="False"/> </DesignerInfoPropertySet> </edmx:Options> <!-- Diagram content (shape and connector positions) --> <edmx:Diagrams> <Diagram Name="Model1"/> </edmx:Diagrams> </edmx:Designer> </edmx:Edmx> ```
EF4 POCO (not using T4): Mapping and metadata information could not be found for EntityType
CC BY-SA 2.5
0
2010-02-21T18:38:11.140
2011-05-09T16:44:54.687
2017-02-08T14:21:27.827
-1
6,777
[ "entity-framework", ".net-4.0", "entity-framework-4" ]
2,307,655
1
2,307,979
null
6
16,343
I'm trying to get ListView row to look like the following: ``` | Text-Text-Text <ImageButton> | ``` With the imagebutton snapped to the right edge. How can I do this? Here's the current layout code I'm using. What am I doing wrong? ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layercontainer" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#699"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:layout_gravity="left"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="YO HOW SI IT GOESSDA" /> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:layout_gravity="right"> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/trash" /> </LinearLayout> </LinearLayout> ``` My code currently produces this: ![grrr](https://i.stack.imgur.com/FzKvh.png)
ListView row styling - left aligned text, and right-aligned icon
CC BY-SA 3.0
0
2010-02-21T22:12:38.357
2015-02-09T21:25:29.063
2015-02-09T21:25:29.063
3,063,884
118,241
[ "android", "android-layout", "android-listview", "android-xml" ]
2,308,744
1
null
null
2
1,328
How does the Eclipse editor work to enable code completion? For example, within the XML editor for Hibernate property files, if I - within a tag, a list of possible value relevant to hibernate will show up. ![Eclipse suggests fields defined in a Java class within a Hibernate hbm.xml file.](https://i.stack.imgur.com/zptzq.gif) I understand that the XML editor is pre-configured to understand xml tag, but how about tag specific to a particular framework? How does Eclipse know about that?
How does Eclipse do code completion specific to third-party frameworks?
CC BY-SA 3.0
0
2010-02-22T04:11:22.970
2016-01-17T17:39:30.573
2014-05-30T02:22:46.097
200,291
278,438
[ "eclipse", "code-completion" ]
2,309,091
1
2,309,156
null
15
14,402
I am following a tutorial and one of the steps its asking is to go to my projects properties and click on c/c++ and add a path to "Additional Include Directories" property. I am using visual C++ Express Edition 2008. the tutorial is using the same thing. Is there away to get this or an alternative ?? This is my screen ![alt text](https://i159.photobucket.com/albums/t150/numerical25/Untitledpicture.png) This is tutorials screen ![alt text](https://wiki.allegro.cc/pub/9/9d/Install_allegro5_binary_msvc_proj_props_2.PNG)
can not find C/C++ in project properties
CC BY-SA 2.5
0
2010-02-22T05:57:44.257
2021-11-13T13:21:19.553
2017-02-08T14:21:28.850
-1
201,934
[ ".net", "c++", "c", "visual-studio", "visual-studio-2008" ]
2,310,531
1
null
null
0
95
I am attempting to debug a website on Windows XP. To be more specific, I am trying to debug an install of SiteFinity CMS. This CMS was installed via Microsoft's Web Platform Installer. It was installed to the default location of `C:\Inetput\wwwroot`. The first error I got when attempting to debug the website with VS2008 was relatively straightforward and I solved it by changing the authentication of the web application in the IIS manager. Here is that error: ![Error 1](https://i.imgur.com/I6yuk.png) The second error, the one that has me stumped, is not really an error message at all. When I go to debug the website now, I get an authentication prompt from `localhost:80`: ![Error 2](https://i.imgur.com/6OuHI.png) I tried putting my windows user credentials in, but that did not work. Any suggestions on what user I should try, or better yet how to eliminate the need to enter credentials at all?
Having issues debugging website with VS2008
CC BY-SA 2.5
null
2010-02-22T11:28:00.893
2010-02-23T17:09:38.127
2010-02-23T17:09:38.127
3,043
25,515
[ "visual-studio-2008", "web", "windows-xp", "debugging" ]
2,312,555
1
2,316,739
null
4
3,157
I'd like to enable code completion for facelets + JSF 1.2 in NetBeans 6.8. I'd prefer to enable it for a free-form project that I build using my own Ant build.xml, but I see no options to enable that, so I'm willing to go with a "Web Application with Existing Sources". I just want to show what I did. ![Choose a Project dialog](https://i247.photobucket.com/albums/gg155/catchthebonus/ChooseProject.png) ![Name & Location dialog](https://i247.photobucket.com/albums/gg155/catchthebonus/NameAndLocation.png) ![Server & Settings dialog](https://i247.photobucket.com/albums/gg155/catchthebonus/ServerAndSettings.png) ![Existing Sources & Libraries dialog](https://i247.photobucket.com/albums/gg155/catchthebonus/ExistingSourcesAndLibraries.png) ![Frameworks dialog with Libraries tab selected](https://i247.photobucket.com/albums/gg155/catchthebonus/ProjectPropertiesFrameworksLibrarie.png) ![Frameworks dialog with Configuration tab selected](https://i247.photobucket.com/albums/gg155/catchthebonus/ProjectPropertiesFrameworksConfigur.png) After setup and configuration, code-completion within facelets still doesn't work. ![Showing editor with failed code-completion](https://i247.photobucket.com/albums/gg155/catchthebonus/NoCodeCompletion.png) Am I missing something? Am I going about this in the wrong way? # Solution Here's what I ended up doing: 1. I switched from a Standard Java project to a Web project (duh!) 2. I took Awano's advice and switched the MIME type for xhtml files back to text/xhtml. 3. I added the tld file from the facelets site to the meta-inf directory in the jsf-facelets.jar and included it in my project. 4. I added the rendered attribute to the fragment tag in the jsf-ui.tld file. It was missing for some reason: <attribute> <name>rendered</name> <required>false</required> <rtexprvalue>false</rtexprvalue> <description>Renders the contents of this tag if the attribute resolves to true.</description> </attribute>
How do I enable code-completion in Netbeans 6.8 for facelets in JSF 1.2?
CC BY-SA 2.5
null
2010-02-22T16:57:59.957
2010-03-02T21:58:32.177
2017-05-23T12:08:51.063
-1
28,991
[ "java", "jsf", "netbeans", "jboss", "facelets" ]
2,312,635
1
2,316,297
null
4
766
I'm creating the database for monitoring status of applications' functionalities. The logic is following: Each application has its own, specific list of functionalities that I'm monitoring. Each functionality belongs to only one application. There is a Functionality table that has foreign key to Application Each application runs on one or more machines. Each machine can run one or more applications. This is MTM connection, so there is ApplicationInstance table connection Applications with Machines. The actual monitoring is about querying ApplicationInstance. If there is a problem, information about it goes to AppInstanceError table, wich holds foreign key to ApplicationInstance. If the query is successful, we get a list of statuses of each functionality. So we have a FunctionalityStatus table with foreign keys to ApplicationInstance & Functionality. I think this is kind of bad design - why do we have multiple reference to Application? What guarantees that both will point to the same Application? Or is there any way to ensure this? So my proposition of fix is to connect FunctionalityStatus with foreign keys to Machines & Functionality. But in this case they define ApplicationInstance so what is the guarantee of having ApplicationInstance for each pair? Shouldn't they be connected somehow? In the real world connection exists and is obvious, so is it OK not to have it in database? Is there a "propper way" of solving this problem, or of ensuring connections invisible from data design? To make it more clear I prepared design of DB that I have now: ![DB design](https://i.stack.imgur.com/gLDsd.png) The only thing that is missing is a connection from FunctionalityStatus to Machine. I see two ways ow making such a connection: 1. Add foreign key to ApplicationInstance - then my doubts are: How to make sure that ApplicationId from Functionality is the same that one from ApplicationInstance? Isn this data duplication really needed? 2. Add foreign key to Machine - and doubts: Will there be a propper ApplicationInstance record for every FunctionalityStatus record? If there is an obvious connection between ApplicationInstance and FunctionalityStatus (mentioned in first doubt) whu can't we see it in database? Again data redundancy becouse all ApplicationInstance records are (or should be) visible in FunctionalityStatus table Or maybe the whole design is screwed up and I should figure out something totally else?
Database design for monitoring status of applications' functionalities
CC BY-SA 4.0
0
2010-02-22T17:11:46.363
2019-06-29T22:41:32.723
2019-06-29T22:41:32.723
3,404,097
160,760
[ "sql", "database", "database-design", "database-normalization" ]
2,313,252
1
null
null
17
17,947
I want to move a row to the bottom of my `UITableView` with cool animation effect just like in [this Grocery Shopping List app](http://www.grocerygadgets.com/how-grocery-gadgets-work.aspx). Just like we can move rows with reordering control like: ![reordering uitableview rows programmatically](https://i.stack.imgur.com/vOtcZ.jpg) How can I create such animation?
Programmaticlaly moving rows with animation in UITableView
CC BY-SA 3.0
0
2010-02-22T18:45:28.660
2012-09-11T07:47:23.650
2012-05-05T16:08:39.133
29,995
194,759
[ "iphone", "cocoa-touch", "uitableview", "animation", "core-animation" ]
2,313,830
1
null
null
1
1,087
I can't seem to get a handle on my list of sortables. They are a list of list elements, each with a form inside, which I need to get the values from. ``` Sortables.implement({ serialize: function(){ var serial = []; this.list.getChildren().each(function(el, i){ serial[i] = el.getProperty('id'); }, this); return serial; } }); var sort = new Sortables('.teams', { handle: '.drag-handle', clone: true, onStart: function(el) { el.fade('hide'); }, onComplete: function(el) { //go go gadget go order = this.serialize(); alert(order); for(var i=0; i<order.length;i++) { if (order[i]) { //alert(order[i].substr(5, order[i].length)); } } } }); ``` the sortables list is then added to a list in a loop with `sort.addItems(li);` . But when I try to get the sortables outside of the sortables onComplete declaration, js says this.list is undefined. --- Trying to loop through the DOM gives me equally bizarre results. Here are the firebug console results for some code: ``` var a = document.getElementById('teams').childNodes; var b = document.getElementById('teams').childNodes.length; try { console.log('myVar: ', a); console.log('myVar.length: ', b); } catch(e) { alert("error logging"); } ``` ![firebug](https://i.imgur.com/bCzmq.png) Trying to get the objects with `document.getElementById('teams').childNodes[i]` returns undefined. thank you for any help!
looping through DOM / mootools sortables
CC BY-SA 2.5
null
2010-02-22T20:14:01.097
2012-01-24T22:11:52.853
2012-01-24T22:11:52.853
102,937
135,056
[ "serialization", "loops", "mootools", "mootools-sortable" ]
2,314,311
1
2,314,354
null
1
2,656
I am following a tutorial. And I am trying to draw a .bmp file to the screen. It builds with no errors but no image appears. according to the book, I should see the image pop up in random places. Below is my code. The author doesnt recommend this technique for drawing objects, he is just doing for demostration. In case your wondering. The image is a 25x25 square red square. ``` #include <windows.h> #include <iostream> #include <time.h> using namespace std; const string APPTITLE = "Game Loop"; HWND window; HDC device; bool gameover = false; void DrawBitmap(char *filename, int x, int y) { //load the bitmap image HBITMAP image = (HBITMAP)LoadImage(0,"c.bmp", IMAGE_BITMAP,0,0, LR_LOADFROMFILE); BITMAP bm; GetObject(image, sizeof(BITMAP), &bm); HDC hdcImage = CreateCompatibleDC(device); SelectObject(hdcImage,image); BitBlt( device, x,y, bm.bmWidth, bm.bmHeight, hdcImage, 0,0, SRCCOPY); //deletec the device context and bitmap DeleteDC(hdcImage); DeleteObject((HBITMAP)image); } bool Game_Init() { srand(time(NULL)); return 1; } void Game_Run() { if(gameover == true) return; RECT rect; GetClientRect(window, &rect); //draw bitmap at random location int x = rand() % (rect.right - rect.left); int y = rand() % (rect.bottom - rect.top); DrawBitmap("c.bmp",x,y); } void Game_End() { //free the device ReleaseDC(window,device); } LRESULT CALLBACK WinProc(HWND hWnd, UINT message, WPARAM WParam, LPARAM lparam) { switch(message) { case WM_DESTROY: gameover = true; PostQuitMessage(0); break; } return DefWindowProc(hWnd, message, WParam, lparam); } ATOM MyRegisterClass(HINSTANCE hInstance) { //set the new windows properties WNDCLASSEX wc; wc.cbSize = sizeof(WNDCLASSEX); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = (WNDPROC) WinProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = NULL; wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); wc.lpszMenuName = NULL; wc.lpszClassName= APPTITLE.c_str(); wc.hIconSm = NULL; return RegisterClassEx(&wc); } bool InitInstance(HINSTANCE hInstance, int nCmdShow) { //create a new window window = CreateWindow( APPTITLE.c_str(), APPTITLE.c_str(), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 640,480, NULL, NULL, hInstance, NULL); //was there an error creating the window ? if(window == 0) return 0; //display the window ShowWindow(window, nCmdShow); UpdateWindow(window); device = GetDC(window); return 1; } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { //declare variables MSG msg; //register the class MyRegisterClass(hInstance); //initialize application if(!InitInstance(hInstance, nCmdShow)) return 0; //initilize the game if(!Game_Init()) return 0; //main message loop while(!gameover) { if(PeekMessage(&msg,NULL, 0, 0,PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } Game_Run(); } Game_End(); return msg.wParam; } ``` I am not sure if its because I have the image in the wrong location. but if that was the case. I figure it would throw a error. I have the image placed at the root of my source folder. [EDIT] Also , when I rebuild, I get a warning which might be a cause but here is the warning ``` 1>------ Rebuild All started: Project: Begin, Configuration: Debug Win32 ------ 1>Deleting intermediate and output files for project 'Begin', configuration 'Debug|Win32' 1>Compiling... 1>main.cpp 1>c:\users\numerical25\documents\visual studio 2008\projects\begin\begin\main.cpp(39) : warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data 1>Compiling manifest to resources... 1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1 1>Copyright (C) Microsoft Corporation. All rights reserved. 1>Linking... 1>LINK : C:\Users\numerical25\Documents\Visual Studio 2008\Projects\Begin\Debug\Begin.exe not found or not built by the last incremental link; performing full link 1>Embedding manifest... 1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1 1>Copyright (C) Microsoft Corporation. All rights reserved. 1>Build log was saved at "file://c:\Users\numerical25\Documents\Visual Studio 2008\Projects\Begin\Begin\Debug\BuildLog.htm" 1>Begin - 0 error(s), 1 warning(s) ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ========== ``` ![alt text](https://i159.photobucket.com/albums/t150/numerical25/blackScreen.png)
Image wont draw to screen C++
CC BY-SA 2.5
0
2010-02-22T21:23:09.333
2016-05-24T01:48:27.123
2017-02-08T14:21:33.583
-1
201,934
[ "c++", "visual-studio", "visual-studio-2008" ]
2,314,847
1
null
null
1
2,556
I am trying to develop a website with C# ASP.net MVC. It's my first time using Visual Studio, C# and ASP.net so I have lots to learn but so far so good. So far... I started a C# ASP.net MVC project and added a database by going to the Database Explorer and clicking "add connection". I then did some standard CRUD controllers and views. I am at the stage where I want to implement User authentication. I'm a bit confused here. I am trying to make a custom Membership Provider. So I added it to my web.config file with the correct connection string etc. When I run the project and go to register I get an error. "Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'." From searching, I see lots of people have this problem and they always reference their hosting. People say this ([http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx](http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx)) is their solution but when I try pick a database I get an error. Not even sure of my server name. So at this point I am wondering, did I set up the database right? Adding in a few pics to show exactly what I am doing. This is the aspnet_regsql.exe: ![alt text](https://imgur.com/ZtLnJ.png) ![alt text](https://imgur.com/3tZWH.png) This is the provider with connection string, taken from an example on one of the links given. ![alt text](https://imgur.com/HuhiH.png) This is my customized provider with connection string pointing to the last image. ![alt text](https://imgur.com/fO45A.png) This is a screen cap when I run the project and go to the default project Account register action: ![alt text](https://imgur.com/T4XYa.png) and finally, this is the error screen when I submit ![alt text](https://imgur.com/wEhLM.png) Another update.. I sorted something out but I am not sure if it is correct. I am now getting an error when the page loads: "Invalid object name 'dbo.Tag'"
C# ASP.net MVC database questions
CC BY-SA 2.5
null
2010-02-22T22:41:37.573
2011-07-21T14:01:47.230
2010-02-23T01:50:17.963
null
null
[ "c#", "sql", "asp.net-mvc", "database", "visual-studio" ]
2,320,596
1
2,321,801
null
2
1,603
I am trying to create a ToolBar in my WPF application. I don't want the strip (as shown in the bellow figure) to show up, I just want all the items to be placed in the general area. I tried setting the ToolBar.OverflowMode to Never ut it doesn't help. ![l](https://farm5.static.flickr.com/4043/4382772446_25c85715b2_o.png)
Unable to hide tool-bar grip
CC BY-SA 2.5
null
2010-02-23T18:12:01.743
2010-02-23T21:17:47.967
2017-02-08T14:21:35.297
-1
75,500
[ "wpf", "toolbar", "grip" ]
2,321,341
1
2,321,915
null
2
1,907
I learned how to get a ScrollViewer's scrollbars to display after scaling an element within in a ScrollViewer from this post: [http://www.eightyeightpercentnerd.dreamhosters.com/?p=92](http://www.eightyeightpercentnerd.dreamhosters.com/?p=92) Now, I'm trying to get the scaled object (a canvas in this case) to center correctly within the ScrollViewer. I'm going to let images tell my story here (please help me before Screencast.com purges my files). ; My XAML: ``` <ScrollViewer x:Name="ScrollViewer" VerticalAlignment="Top" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Width="300" Height="300" Margin="0" Padding="0" Background="White"> <Canvas x:Name="DesignSurface" Background="Red"> <Canvas x:Name="Surface" Background="Blue" Height="100" Width="100"> <Canvas.RenderTransform> <TransformGroup> <ScaleTransform x:Name="SurfaceScaleTransform" /> </TransformGroup> </Canvas.RenderTransform> <!-- ... --> </Canvas> </Canvas> </ScrollViewer> ``` On initial load, my blue canvas is centered and at 100%: ![alt text](https://content.screencast.com/users/beaudetious/folders/Jing/media/b4896d12-6f91-40a8-9aff-91cdfd6f8b92/2010-02-23_1432.png) After decreasing by 50%, the blue canvas is still centered: ![alt text](https://content.screencast.com/users/beaudetious/folders/Jing/media/35ca0d43-4325-46c3-9376-455cad80a68f/2010-02-23_1433.png) After increasing 400% and scrolling to display the top left corner of the blue canvas: ![alt text](https://content.screencast.com/users/beaudetious/folders/Jing/media/995edd41-47d9-4051-9e73-c42c577fa3d5/2010-02-23_1435.png) After increasing 400% and scrolling to display the bottom right corner of the blue canvas: ![alt text](https://content.screencast.com/users/beaudetious/folders/Jing/media/15a28ec8-2716-4449-8168-4368c58ec9a1/2010-02-23_1436.png) So my question is simply how do I get the blue canvas centered correctly in the ScrollViewer or red canvas or whatever?
Silverlight: Centering After ScaleTransform
CC BY-SA 2.5
null
2010-02-23T20:10:36.000
2010-02-23T21:35:22.403
2017-02-08T14:21:36.707
-1
3,622
[ "silverlight" ]
2,326,187
1
2,326,856
null
0
151
``` if(count($this->form->email->getMessages()) > 0) { $e = '<ul>'; $m = $this->form->email->getMessages(); foreach($m as $me) { $e .= '<li>'; $e .= $me; $e .= '</li>'; } $e .= '</ul>'; echo $e; unset($e); unset($m); } ``` I'm currenly passing form object to VIEW and echo every elemen manually. But when comes to errors, it takes a lot of code to write. Could someone tell, how to output errors for each element without such amount of code? Thanks! Here is the picture of all decorators before the output: ![alt text](https://i192.photobucket.com/albums/z228/Somebi/form-decorators.jpg)
Zend Framework configuring decorator
CC BY-SA 2.5
null
2010-02-24T13:14:50.030
2010-02-24T14:51:32.297
2017-02-08T14:21:37.753
-1
849,669
[ "zend-framework", "forms", "decorator" ]
2,326,381
1
2,326,539
null
0
246
I'm using SWFKit to create a native windows app from flash project. I want to embed video in project via SWFKit and then use it in flash. Looks like I've found a way to embed external file but I can't find manual about how to access this embedded file via ActionScript in flash movie. ![alt text](https://i.imgur.com/rRAhO.jpg) So the question is how can I access file "bridge.flv" in compiled project using ActionScript?
How to access embedded files in SWFKit
CC BY-SA 2.5
null
2010-02-24T13:45:53.020
2010-02-24T14:09:11.303
null
null
179,746
[ "flash", "flv", "embedded-resource", "exe" ]
2,327,965
1
2,337,468
null
1
2,530
Trying to learn Linq syntax and am struggling with method-based vs expressions. I have 8 tables that allow users to associate to groups and orgs and have forms associated to groups. To further explain, I assign a form to a group. That group may have a user assigned directly or via an org that the user belongs to. I need a Linq statement that will correctly join/union up the tables so I can return the forms assigned to a given user. Here is the basic schema: ``` CREATE TABLE [dbo].[Org]( [orgID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](100) NULL, CONSTRAINT [PK_Org] PRIMARY KEY CLUSTERED ( [orgID] ASC ) CREATE TABLE [dbo].[Groups]( [groupID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](50) NOT NULL, CONSTRAINT [PK_Group] PRIMARY KEY CLUSTERED ( [groupID] ASC ) CREATE TABLE [dbo].[Form]( [ID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](100) NULL, CONSTRAINT [PK_Form] PRIMARY KEY CLUSTERED ( [ID] ASC ) CREATE TABLE [dbo].[Users]( [userID] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](50) NOT NULL, CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED ( [userID] ASC ) ############################################################### Link tables and FKs ############################################################### CREATE TABLE [dbo].[User_Org]( [userID] [int] NOT NULL, [orgID] [int] NOT NULL) ALTER TABLE [dbo].[User_Org] WITH CHECK ADD CONSTRAINT [FK_User_Org_Org] FOREIGN KEY([orgID]) REFERENCES [dbo].[Org] ([orgID]) ALTER TABLE [dbo].[User_Org] CHECK CONSTRAINT [FK_User_Org_Org] ALTER TABLE [dbo].[User_Org] WITH CHECK ADD CONSTRAINT [FK_User_Org_Users] FOREIGN KEY([userID]) REFERENCES [dbo].[Users] ([userID]) ALTER TABLE [dbo].[User_Org] CHECK CONSTRAINT [FK_User_Org_Users] ############################################################### CREATE TABLE [dbo].[User_Group]( [userID] [int] NOT NULL, [groupID] [int] NOT NULL) ALTER TABLE [dbo].[Org_Group] CHECK CONSTRAINT [FK_Org_Group_Org] ALTER TABLE [dbo].[User_Group] WITH CHECK ADD CONSTRAINT [FK_User_Group_Group] FOREIGN KEY([groupID]) REFERENCES [dbo].[Groups] ([groupID]) ALTER TABLE [dbo].[User_Group] CHECK CONSTRAINT [FK_User_Group_Group] ALTER TABLE [dbo].[User_Group] WITH CHECK ADD CONSTRAINT [FK_User_Group_Users] FOREIGN KEY([userID]) REFERENCES [dbo].[Users] ([userID]) ALTER TABLE [dbo].[User_Group] CHECK CONSTRAINT [FK_User_Group_Users] ############################################################### CREATE TABLE [dbo].[Org_Group]( [orgID] [int] NOT NULL, [groupID] [int] NOT NULL) ALTER TABLE [dbo].[Org_Group] WITH CHECK ADD CONSTRAINT [FK_Org_Group_Group] FOREIGN KEY([groupID]) REFERENCES [dbo].[Groups] ([groupID]) ALTER TABLE [dbo].[Org_Group] CHECK CONSTRAINT [FK_Org_Group_Group] ALTER TABLE [dbo].[Org_Group] WITH CHECK ADD CONSTRAINT [FK_Org_Group_Org] FOREIGN KEY([orgID]) REFERENCES [dbo].[Org] ([orgID]) ############################################################### CREATE TABLE [dbo].[Form_Group]( [FormID] [int] NOT NULL, [groupID] [int] NOT NULL) ALTER TABLE [dbo].[Form_Group] WITH CHECK ADD CONSTRAINT [FK_Form_Group_Form] FOREIGN KEY([FormID]) REFERENCES [dbo].[Form] ([ID]) ALTER TABLE [dbo].[Form_Group] CHECK CONSTRAINT [FK_Form_Group_Form] ALTER TABLE [dbo].[Form_Group] WITH CHECK ADD CONSTRAINT [FK_Form_Group_Groups] FOREIGN KEY([groupID]) REFERENCES [dbo].[Groups] ([groupID]) ALTER TABLE [dbo].[Form_Group] CHECK CONSTRAINT [FK_Form_Group_Groups] ``` ![alt text](https://i1025.photobucket.com/albums/y320/andy67_pics/EntityDesignerDiagram.jpg) The lousy T-SQL statement that gives me what I want is: ``` declare @userid int set @userid = 1 select distinct(f.id) from Form f join Form_Group fg on f.id = fg.formid join Groups g on fg.groupid = g.groupid where exists ((select g1.groupid from Groups g1 join User_Group ug on g1.groupid = ug.groupid join Users u on ug.userid = u.userid where u.userid = @userid and g.groupid = g1.groupid) union (select g2.groupid from Groups g2 join Org_group og on g2.groupid = og.groupid join Org o on og.orgid = o.orgid join User_org uo on o.orgid = uo.orgid join Users u on uo.userid = u.userid where u.userid = @userid and g.groupid = g2.groupid) ) ``` Please and thanks!
Linq to Entities Join/Union Statement Help
CC BY-SA 2.5
null
2010-02-24T17:16:28.523
2010-02-26T14:30:44.933
2017-02-08T14:21:38.433
-1
280,507
[ "linq-to-entities" ]
2,329,999
1
2,330,058
null
0
879
My studio toolbox icons are all messed up. Is there a way to fix them? ![alt text](https://i.imgur.com/izgdll.png)
Visual studio 2005 toolbox icons messed up
CC BY-SA 2.5
0
2010-02-24T22:10:15.707
2010-03-01T01:43:28.237
null
null
259,712
[ "visual-studio-2005", "icons", "toolbox" ]
2,334,629
1
2,340,216
null
8
6,304
I am looking for [self-organizing map](http://en.wikipedia.org/wiki/Self-organizing_map) on Python. ![hexagonal tiling](https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Tiling_Regular_6-3_Hexagonal.svg/200px-Tiling_Regular_6-3_Hexagonal.svg.png) 1. ready module. If one exists. 2. way to plot hexagonal cell 3. algorithms to work with hexagonal cells as array or smth else : A self-organizing map (SOM) or self-organizing feature map (SOFM) is a type of artificial neural network that is trained using unsupervised learning to produce a low-dimensional (typically two-dimensional)
Hexagonal Self-Organizing map in Python
CC BY-SA 3.0
0
2010-02-25T14:27:14.813
2018-06-28T09:14:15.273
2017-02-08T14:21:41.280
-1
279,046
[ "python", "module", "artificial-intelligence", "neural-network", "self-organizing-maps" ]
2,334,859
1
2,362,778
null
2
6,692
I'm having a terrible time managing RDLC reports. I couldn't find any comprehensive tutorials in the internet and MSDN isn't as helpful as I wish it could have been either. Particularly, I've been having a problem trying to get a particular table/matrix to appear based on a client's requirement. It goes like this. In the DB I have two tables: (substituted fake names for secrecy's sake) - - The table in the report should come out as something like this: [https://i53.photobucket.com/albums/g59/Sazabi02/Capture.png](https://i53.photobucket.com/albums/g59/Sazabi02/Capture.png) ![Table](https://i53.photobucket.com/albums/g59/Sazabi02/Capture.png). - - - Things to take note of include: - - - between non-dynamic columns. (having problems with this. AFAIK columns are automatically placed on the right side and there's no option to place them in between. I've tried out a few things. Pounding my head on the keyboard didn't work after frustratingly trying to make the matrix work as I think it was intended to and Like separating it into three separate tables. One for the totals. One for the dynamics and one for the fixed columns. (Two actually because one fixed column should be before and the others after the dynamic ones.) Can anyone provide some insights on how to do this in Visual Studio RDLC reports?
.NET RDLC Report Matrices
CC BY-SA 2.5
null
2010-02-25T14:52:53.983
2010-03-02T11:36:58.820
2017-02-08T14:21:51.430
-1
245,268
[ ".net", "matrix", "report", "rdlc" ]
2,336,463
1
2,336,520
null
1
162
I want to add explanation between cells. I'm experimenting with sections, trying to make the cell opaque, without borders, ... but sure it exists a better approach ... thanks, m. ![alt text](https://i166.photobucket.com/albums/u112/windsurfeta/iphone/IMG_0198.png)
How I can do this ? Adding exaplanations between sections (of cells)
CC BY-SA 2.5
null
2010-02-25T18:12:22.390
2010-02-25T18:24:09.213
2017-02-08T14:21:52.463
-1
266,276
[ "iphone", "uitableview", "footer" ]
2,337,124
1
2,337,143
null
1
878
I have a WinForms combobox to which I bind a list of anonymous objects (printer descriptions and locations). The here is a to select a default printer (which matches printer location). But within a `foreach` loop below, I am having trouble accessing the anonymous object's properties. ![alt text](https://farm3.static.flickr.com/2698/4388181166_206a50b74d_o.png) I know of a work-around (I tried a private nested DTO with Location & Description property) but ? Maybe I was just lazy here...
How to access anonymous object's property
CC BY-SA 2.5
null
2010-02-25T19:50:06.467
2010-02-25T19:54:27.390
2017-02-08T14:21:52.800
-1
4,035
[ "c#", ".net", "winforms", "data-binding", "anonymous-types" ]
2,337,226
1
null
null
0
1,191
I am currently building my own CMS for various reasons that could take a long to explain... However I am looking for a dynamic solution to create templates for pages within the CMS and all areas must be editable via the administration area, maybe large text areas broken into multiple areas, text and image area on a page etc. ----- edit ----- Following on from the above I would like to create the following: Create a new page (selecting a pre-defined template like below) ![example](https://i.stack.imgur.com/iXnGJ.png) [http://img525.imageshack.us/img525/9872/nestedpages.png](http://img525.imageshack.us/img525/9872/nestedpages.png) and then upon editing the page it would have created as many text editors required for each editable region or a file upload control for an image area. I am thinking of using nested masterpages for the design elements, just unsure the best-practice way to achieve the above (db structure etc) I some how hope this provides a little more information.
Dynamic Template Builder ASP.NET CMS - Rolling My Own
CC BY-SA 3.0
0
2010-02-25T20:07:39.047
2011-11-29T23:23:05.117
2011-11-29T23:23:05.117
234,976
281,560
[ "asp.net", "sql-server", "content-management-system" ]
2,337,363
1
2,337,389
null
0
1,107
How do I make the cursor in Emacs a black box with underneath text displayed in white? like so: ![reverse cursor](https://cobbal.s3.amazonaws.com/drop/reverse.png) Screenshot is from the Carbon Emacs package, but I want the same behavior in Cocoa Emacs 23.
Reverse video cursor in Emacs
CC BY-SA 3.0
null
2010-02-25T20:25:21.413
2011-07-06T07:55:11.417
2017-02-08T14:21:53.353
-1
73,681
[ "emacs" ]
2,337,534
1
20,499,030
null
3
7,625
I have applied the following style to the `pre` element: ``` pre { background-color: #FFFFCC; border: 2px dashed #FF6666; padding-top: 7px; padding-bottom: 8px; padding-left: 10px; float: none; padding-right: 10px; margin: 10px; } ``` The text overflows the box. When I applied the `float:right` property the box behaved as expected but in large screens the rest floated around the box naturally. Not happy. EDIT2 : I made it (but for ie6), using float + clear. I have posted [another question on the new bugs](https://stackoverflow.com/questions/2358129/ie6-weird-h3-div-behavior-no-right-margin-bug-in-ff) I am new to CSS and HTML - I am sure there is a simple solution. Please help. :( : closer to the mark : ``` pre { background-color: #FFFFCC; border: 2px dashed #FF6666; padding-top: 7px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; margin: 10px; white-space: pre-wrap; } ``` This one displays exactly as I want in ie6 - in ff 3.5 the text wraps - I know this is is the way it should be - but how can I carry the ie behavior to ff ? Images for the styled pre tag with `white-space: pre;` ie6 : [https://i1032.photobucket.com/albums/a406/dardanov/ie6pre.jpg](https://i1032.photobucket.com/albums/a406/dardanov/ie6pre.jpg) ![](https://i1032.photobucket.com/albums/a406/dardanov/ie6pre.jpg) ff 3.5 : [](https://i1032.photobucket.com/albums/a406/dardanov/ff35pre.jpg)[https://i1032.photobucket.com/albums/a406/dardanov/ff35pre.jpg](https://i1032.photobucket.com/albums/a406/dardanov/ff35pre.jpg) ![](https://i1032.photobucket.com/albums/a406/dardanov/ff35pre.jpg) for `white-space: pre-wrap;` firefox wraps and ie stays the same. How can I get the ie behavior (autoexpanding of the code box) in ff ? : see answer below
pre tag- text overflows the box
CC BY-SA 3.0
null
2010-02-25T20:52:29.317
2021-03-23T15:28:21.303
2017-05-23T10:29:31.030
-1
281,545
[ "html", "css", "text", "tags", "pre" ]
2,340,045
1
2,340,077
null
4
3,070
I am doing a simple $.ajax request: ``` $.ajax({ type: "POST", url: "/Run/" + param1 + "/" + param2, dataType: 'html', error: function(error) { }, success: function(html) { } }); ``` If my value is like [http://localhost/pub/file?val1=Some](http://localhost/pub/file?val1=Some) then encoding done using doesn't help. And I get following ERROR --> My Questions --> 1. How should I encode param2 ? 2. What is the maximum length of request URL in $.ajax call ? 3. Is request URL max length dependent on type of browser from which request is made ? 4. I have observed that if I use Ajax.ActionLink then I do not need to encode the parameters passed to action and I can pass parameters with length > 10,000 characters as well. But I do not know how to make an explicit call using Ajax.ActionLink from my java script. I need to click on that actionlink to make call through Ajax.ActionLink. Please see the length of parameter passed to action using (This is mine observation) ![alt text](https://7vtcea.blu.livefilestore.com/y1phjGz0E6u0virhn527leu-kn9ZAb92ErW7kcgyYsYY7T6auZ5lz_oT7eAAmFa7Raxd1fli5zO7iu1HI77OTtYit6SwoSGw-3K/26.png) ![alt text](https://public.blu.livefilestore.com/y1pQpMGkF8_SXOaSmssqODxua3cP_rBWqrxnXY8xhXkXjUNwW2xmNLMA8Bk3apUxZvrRrIo2XETCUoq49DS_i323A/27.png)
Request URL encoding issue in $.ajax call and Max request URL length in $.ajax as compared to Ajax.ActionLink
CC BY-SA 2.5
null
2010-02-26T07:20:13.017
2010-02-26T07:28:12.050
2017-02-08T14:21:57.910
-1
212,823
[ "asp.net-mvc", "jquery" ]
2,340,691
1
2,340,820
null
3
1,766
I want to make a 2D game in using the engine. In this game, you will control a tiny ship in a cave of some sort. This cave will be created automatically (the game will have random levels) and will look like this: ![Cave](https://i.imgur.com/HxEI3.png) Suppose I already have the the points of the polygon of the inside of the cave (the white part). How should I render this shape on the screen and use it for collision detection? From what I've read around different sites, I should use a triangulation algorithm to make meshes of the walls of the cave (the black part) using the polygon of the inside of the cave (the white part). Then, I can also use these meshes for collision detection. Is this really the best way to do it? Do you know if Irrlicht has some built-in functions that can help me achieve this? Any advice will be apreciated.
Techniques for generating a 2D game world
CC BY-SA 2.5
0
2010-02-26T09:51:08.820
2010-02-26T10:32:54.693
null
null
148,388
[ "c++", "3d", "2d", "irrlicht" ]
2,341,053
1
2,341,086
null
4
8,835
Well, thats the html code: ``` <ul> <li>first item</li> <li>second item</li> </ul> ``` And the css: ``` ul, li { margin: 0px; padding: 0px; } ``` Nothing fancy, right? And nothing to be proud of, it just shows a list without any margins or padding. Well, almost... ![](https://i.stack.imgur.com/Lk9XU.gif) What about this space there? I can't seem to get rid of it. Any ideas? :]
Getting rid of the margin between list style type and text
CC BY-SA 4.0
null
2010-02-26T11:01:24.127
2019-06-22T16:04:26.900
2019-06-22T16:04:26.900
4,751,173
244,751
[ "html", "css", "html-lists" ]
2,342,470
1
null
null
1
218
I have a problem with the JQuery autocomplete plugin. It's hard for me to explain but whenever I try to press a key it keeps looping with requests to the server. See: ![loop](https://i.stack.imgur.com/cTuT0.jpg) [http://members.lycos.nl/saccon/loop.jpg](http://members.lycos.nl/saccon/loop.jpg) It should only request once! Can anyone help me please?
Jquery autocomplete loops HTTP requests
CC BY-SA 3.0
null
2010-02-26T15:00:50.067
2011-12-01T04:10:29.703
2011-12-01T04:10:29.703
234,976
282,122
[ "jquery", "autocomplete" ]
2,346,129
1
2,349,245
null
1
1,331
This relates to both physical programming as well as Ruby running on a web server. I have an array of RGB leds, which is 5x5 so a total of 25 leds. They are numbered and individually addressable as such: ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ``` Here is a photo: ![led matrix](https://s3.amazonaws.com/satisfaction-production/s3_images/164738/photo.jpg) As for the hardware (which really isn't important, because it works fine), the system consists of 25 [BlinkM](http://thingm.com/products/blinkm)'s, an [Arduino](http://www.arduino.cc/), and some various cabling and connectors. The led's are sent commands via serial with a command as such: ``` @sp.write ["\x01", led, "\x04\x00", "c", color] ``` Which writes the byte array out to serial using ruby's [Serialport gem](http://github.com/hparra/ruby-serialport), the variables "led" and "color" are substituted with the hex of each, so for example if I wanted to make led number 8 turn red, my output would read: ``` @sp.write ["\x01","\x08", "\x04\x00", "c", "\xff\x00\x00"] ``` So far all of this works wonders, and I'm really happy with what I have, now my question relates pretty much to general mathematics and simple programming, but somehow the implementation goes over my head. [Here is a sample of such animation.](http://www.youtube.com/watch?v=GeBMQ4zCvNI) Mostly I'm interesting in how one could animate patterns using ruby here. I recall certain "processing" animation scripts, just looping over a function using the array as an object and affecting the elements of the array creating interesting animations just due to the mathematics of the output. Does anyone have any idea on how I could get started with something like that? I'm currently able to affect the LED's one at a time with my script, and I can string them together with `sleep x` after each command and manually build animations, but how could I make one run indefinitely with some sort of procedural animation? --- I really didn't describe the bytecode array in its entirety, here are what each part does: ``` @sp.write ["\x01", led, "\x04\x00", "c", color] ^ ^ ^ ^ ^ ^ a b c d e f a. start byte (not important, tells serial that it is the start of a command) b. hex for LED address, ex. `\x07` is led 7 c. length of command (starting at "e") d. bytes to be read (always 0 in our case) e. the "fade to color" command f. the color we want to fade to in rrggbb hex format. ```
Animating with Ruby
CC BY-SA 2.5
null
2010-02-27T03:38:05.813
2010-02-27T22:48:38.100
2017-02-08T14:22:00.200
-1
103,739
[ "ruby", "animation" ]
2,346,478
1
null
null
3
687
I am having a simple Azure cloud app(WebRole=ASP.Net MVC) which draws charts using ASP.Net Charting control. Specifications--> 1. Chart RenderType = ImageMap 2. Chart ImageLocation = "/Images/Chart_#SEQ(1000,1)" 3. Number of app instances deployed on Windows Azure = 5 4. App contains a button which draws charts as per users parameters. When user clicks on this button, MVC action is called which provides necessary ViewData for drawing chart and returns a partial view which after getting rendered sends ImageMap and Image location to client. ![alt text](https://7vtcea.blu.livefilestore.com/y1pFN_JLELVaaKs-FSm5Lrysx5GSeE-rTUCHIxKta4-ZoeCm_yp2guFPlNW0hen8Vn0WM8YB2uKs3UwkO1RiC0OZphzDYms7b92/Azure%20%26%20Charts.png) When I try to draw charts from IE8 I always get the charts as per my parameters but when I simulataneously try to draw charts on FireFox sometimes I get wrong charts(wrong images). Is it due to roundrobin used - #SEQ(1000,1) or due to mutiple instances of my cloud app ?
#SEQ keyword in Asp.Net Charting control with multiple Azure Cloud app instances
CC BY-SA 3.0
null
2010-02-27T06:41:13.893
2011-08-05T23:10:59.290
2017-02-08T14:22:00.550
-1
212,823
[ "asp.net", "asp.net-mvc", "azure", "charts" ]
2,348,267
1
2,348,350
null
1
767
My app crash when I try to access any property of my NSDecimalNumber amount_before_current_year: ``` [amount_before_current_year stringValue] Program received signal: “EXC_BAD_ACCESS”. ``` The object is a NSDecimalNumber as shown in the image attached. I created it in the viewDidLoad, it exists in the header file: ``` .h ... NSDecimalNumber *amount_before_current_year; ... @property (nonatomic, retain) NSDecimalNumber *amount_before_current_year; ... ``` also in the implementation file: ``` @synthesize amount_before_current_year; amount_before_current_year = [NSDecimalNumber decimalNumberWithString:@"100.00"]; ``` here I call it again: ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *test = [amount_before_current_year stringValue]; // HARD CRASH !!! ``` so, I don't know what to do now, I've spent some hours with this ..... any ideas ?????? thanks, r. ![alt text](https://i166.photobucket.com/albums/u112/windsurfeta/iphone/error.png)
Hard crash using [NSDecimalNumber stringValue]
CC BY-SA 2.5
null
2010-02-27T17:27:21.040
2010-02-27T17:52:54.220
2017-02-08T14:22:01.870
-1
266,276
[ "iphone", "nsnumber" ]
2,349,002
1
2,349,018
null
1
552
I need to edit format for JFormatedTextField in a Java program. NetBeans are "helping" me with something called Format editor. But, I have no clue how the pattern works. ![format editor](https://imgur.com/VE9mj.png) For `#,##0.###` , it returns `1,234.567`, as pictured above. However, I want to change the thousands delimiter to space and decimal separator to comma. I would guess `# ##0,###` is the right format, but no, that returns "Malformed pattern # ##0,###". How can I change the thousand separator to space and decimal to comma? Is that even possible, using Format editor?
How does "Format editor" for JFormatedTextField in NetBeans work?
CC BY-SA 2.5
null
2010-02-27T21:11:42.117
2010-02-27T21:25:11.680
null
null
101,152
[ "netbeans" ]
2,349,113
1
2,349,966
null
4
1,232
I've added a few components to the NavigationBar in an app I'm creating. The height of the bar changes dynamically, like in Safari for the iPhone, when you click on the URL field. I have all of the interactions and resizings working perfectly, except when I move to another tab and return. If I start the app, click on second tab the navbar displays correctly. ![navbar OK](https://content.screencast.com/users/GeneM/folders/Default/media/2ad0f467-5a2b-484a-a0ef-d3ab687564fe/NavBar%20OK.png) If I then immediately click on the first tab, and then back to the second tab again, the NavigationBar is clipped. ![navbar clipped](https://content.screencast.com/users/GeneM/folders/Default/media/9439273f-f87d-4808-b528-1506c54a558a/NavBar%20Clipped.png) I'm customizing the navbar in my viewWillAppear method ``` - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; if (navBar == nil) { CGFloat width = self.view.frame.size.width; navBar = [self.navigationController.navigationBar autorelease]; navBar.frame = CGRectMake(0,20,width,52); //This doesn't appear to have any effect- was set to //UIViewAutoresizingFlexibleWidth and worked but with with the same issue. navBar.autoresizingMask = UIViewAutoresizingFlexibleHeight; self.navigationItem.title = nil; label = [[UILabel alloc] initWithFrame: CGRectMake(10,2,width-20,14)]; label.autoresizingMask = UIViewAutoresizingFlexibleWidth; label.text = @"My Custom NavBar"; label.backgroundColor = [UIColor clearColor]; label.font = [UIFont systemFontOfSize:12]; label.textAlignment = UITextAlignmentCenter; [navBar addSubview:label]; urlTextField = [[UITextField alloc] initWithFrame: CGRectMake(10,19,width-75,26)]; urlTextField.clearButtonMode = UITextFieldViewModeWhileEditing; [urlTextField addTarget:(id)self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; bookmarkButton = [UIButton buttonWithType:UIButtonTypeCustom]; bookmarkButton.frame = CGRectMake(0,0,21,21); [bookmarkButton setImage:[UIImage imageNamed:@"bookmark.png"] forState:UIControlStateNormal]; [bookmarkButton addTarget:self action:@selector(bookmarkPressed:) forControlEvents:UIControlEventTouchUpInside]; urlTextField.leftView = bookmarkButton; urlTextField.leftViewMode = UITextFieldViewModeAlways; actionButton = [UIButton buttonWithType:UIButtonTypeCustom]; actionButton.frame = CGRectMake(0,0,21,21); [actionButton setImage:[UIImage imageNamed:@"refresh.png"] forState:UIControlStateNormal]; [actionButton addTarget:self action:@selector(actionPressed:) forControlEvents:UIControlEventTouchUpInside]; urlTextField.rightView = actionButton; urlTextField.rightViewMode = UITextFieldViewModeAlways; urlTextField.autoresizingMask = UIViewAutoresizingFlexibleWidth; urlTextField.borderStyle = UITextBorderStyleRoundedRect; urlTextField.font = [UIFont systemFontOfSize:17]; urlTextField.delegate = self; [navBar addSubview:urlTextField]; } else { //XXX This does make the navBar display correctly //but I don't really want the keyboard visible when returning from another tab //[urlTextField becomeFirstResponder]; } } ``` Note the final comment in the code above- If I force the keyboard to display, or if the user clicks in the UITextField, the NavBar is displayed correctly from therein. I've tried a lot of things- checking the frames sizes of the View (View 2 in the images), the NavBar, but with no luck. Does any one have any idea what the problem might be? I'll be happy to give further detail. Thanks.
Customized NavigationBar not displaying correctly after return to Tab
CC BY-SA 2.5
null
2010-02-27T22:01:17.480
2010-02-28T11:58:27.760
2017-02-08T14:22:02.910
-1
133,470
[ "iphone", "cocoa-touch", "uinavigationcontroller", "uitabbarcontroller" ]
2,349,592
1
2,350,745
null
3
8,705
there are some buttons on the top of the winform, and when I click one of them, the panel below will load different predefined panel, how can I implement this ? please see this example: ![enter image description here](https://i.stack.imgur.com/f3IW7.png)
How to dynamically load a panel in Windows Forms?
CC BY-SA 3.0
0
2010-02-28T00:50:55.797
2012-03-04T19:23:46.270
2012-03-04T19:23:46.270
116,923
140,899
[ "c#", "winforms", "panel" ]
2,350,984
1
2,351,046
null
3
11,420
Here's two screen shots, showing the effect with a small viewport that has to be scrolled. ![alt text](https://imgur.com/4d2vq.png) ![alt text](https://imgur.com/Aox4x.png) HTML looks like this: (ignoring head and html tags) ``` <body> <div id="grad1"></div> <div id="wrapper"> <header> <h1 class="logo"><a href="/">Business Name</a></h1> </header> <nav> <ul> <li><a class="first" id="index" href="/index.php">Home</a></li> <li><a id="whatwedo" href="/whatwedo.php">What we do</a></li> <li><a id="communicating" href="/communicating.php">Communicating</a></li> <li><a class="last" id="contact" href="/contact.php">Contact Us</a></li> </ul> </nav> <div style="clear:both;"></div> <section> <?= $content ?> </section> <footer> &copy; 2010 </footer> </div> </body> ``` And the (trimmed down) CSS relating to body, grad1 and wrapper look like this: ``` body { color: #111; background-color: #3E9C9D; } #grad1 { height: 600px; position: absolute; top: 0; left: 0; z-index: -100; width: 100%; background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#3E9C9D)); background-image: -moz-linear-gradient(#fff 0%, #3E9C9D 100%); } #wrapper { max-width:960px; min-width:840px; margin: 0 auto; } ``` How do I fix this? I have to have the gradient on a different div as far as I know, because I need to specify the height. (I am aware that the CSS gradient doesn't work in IE - there is a background-image there to emulate the behaviour. It has the same problem.)
CSS: Setting a background gradient to width 100% fine unless page scrolls
CC BY-SA 3.0
0
2010-02-28T12:14:02.220
2012-06-02T12:39:03.527
2012-06-02T09:01:11.247
16,511
16,511
[ "html", "css" ]
2,353,438
1
2,353,567
null
2
858
I need to delete rows where a datetime field is over 2 weeks old. This is what I have came up with ``` $duration = Date::WEEK * 2; // int(1209600) $query = 'DELETE FROM properties WHERE TIMEDIFF(' . date(DATE_ISO8601) . ', reserved_datetime) > ' . $duration; ``` I don't often write complicated queries (preferring to do stuff in PHP, where I'm more comfortable) but I'd like to know more about them, plus doing this sort of thing in PHP would be very inefficient and I am handling a large amount of rows. Anyone know what I'm doing wrong? Cheers. ## Update I gave [Wallyk's answer](https://stackoverflow.com/questions/2353438/help-with-writing-a-mysql-query-involving-date-differences/2353479#2353479) a shot, changing it slightly in phpMyAdmin to SELECT just so I could see what was going on. This is what I used ``` SELECT * FROM properties WHERE date_sub( `reserved_datetime` , INTERVAL 2 week ) >0 LIMIT 0 , 30 ``` The only problem however, is that it has returned rows where the `reserved_datetime` is `2010-02-28 10:45:59`, definitely less than 2 weeks ago (from now). I thought of checking MySQL's internal date. I have been using `date(DATE_ISO8601)` in my queries, because MySQL's `NOW()` wasn't exactly right (it just returned if interested `2010-02-28 20:09:19`). Is there a way to specify the current date in that query? Any other suggestions? Many thanks ## Another Update Here is a screenshot from phpMyAdmin that may demonstrate anything better than my words can. Oh, and the reason it has returned 3 only is because all the others have blank values, i.e. `0000-00-00 00:00:00` ![query](https://i.stack.imgur.com/PMda9.png)
How to delete rows based on date differences with MySQL?
CC BY-SA 4.0
0
2010-03-01T01:36:25.840
2019-06-23T19:32:41.913
2019-06-23T19:32:41.913
4,751,173
31,671
[ "php", "mysql", "kohana-3" ]
2,355,608
1
2,355,700
null
0
321
I've got a model that looks something like this: ![Model](https://i.imgur.com/MpMtj.jpg) One Account has many Branches, and each Statement is generated for one Account. The model is redundant because the Account (the AccountID on the header) can be inferred from the BranchID on a transaction (a statement will always have one or more transactions). Should the AccountID be removed from the StatementHeader, or is this level of redundancy OK? Or is there a better solution?
Eliminating redundant relationships when modeling Header/Detail relationships?
CC BY-SA 2.5
null
2010-03-01T12:07:43.027
2010-03-03T17:39:50.653
null
null
9,825
[ "data-modeling" ]
2,355,714
1
2,355,938
null
2
2,267
I am trying to draw a textured cube using just 8 vertices and one `DrawIndexedPrimitives` call. Is this even possible? I am having problems with the UV co-ordinates. I am finding it impossible to come up with suitable UV values which will work for all faces of the cube. Take the following numbering as an example: ![Cube with UV Values](https://sites.google.com/site/agnelkurian/home/uv_blues.png) UV is set to (0, 0) for vertex A. For all vertices diagonally opposite to A (on all three faces sharing A as a vertex), I am setting UV to (1, 1). Now the three faces which do not have A as a vertex end up having two vertices each which have a UV value of (1, 1). It is my understanding that this should not be the case. What then is the solution?
Direct3D: Draw textured cube with single DrawIndexedPrimitives call. Possible?
CC BY-SA 2.5
null
2010-03-01T12:28:34.093
2010-03-09T18:32:23.470
2017-02-08T14:22:03.253
-1
45,603
[ "3d", "direct3d", "textures", "texture-mapping" ]