Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
4,512,088
1
4,512,264
null
0
445
I have a problem with the following language: ![alt text](https://i.stack.imgur.com/f7b73.jpg) I must write a context-free grammar: ![alt text](https://i.stack.imgur.com/FrwHM.jpg) which describes it. I have already done a few exercises but this one is really hard for me.I'm sitting around for hours without an useful approach. It wouldn't be a problem to write a grammar without the part . But i don't how to get this one done. I would be very thankful for any advice.
Context-free grammar for a language
CC BY-SA 2.5
null
2010-12-22T17:53:35.670
2010-12-22T19:36:57.830
null
null
483,859
[ "compiler-construction", "language-design", "computation-theory" ]
4,512,358
1
4,548,912
null
45
19,640
I'm running EclEmma, the Emma plugin for Eclipse, and the coverage report shows only partial coverage for an Enum I've defined, even though it shows the only value in the Enum as being covered. I'm assuming that there is a coverage gap for the implied methods that back the Enum, but I'm not quite sure. For example, with this Enum, EclEmma highlights everything in green, except for the package declaration: ``` package com.blah; public enum UserRole { HAS_ACCESS } ``` If I pull up the coverage details for the class, I see this: ![alt text](https://i.stack.imgur.com/teguJ.jpg) My question is, what is the best way to get 100% coverage on my Enum classes using EclEmma?
Emma coverage on Enum types
CC BY-SA 2.5
0
2010-12-22T18:25:59.853
2014-10-31T19:40:45.563
null
null
254,046
[ "java", "eclipse", "code-coverage", "emma" ]
4,512,366
1
4,512,556
null
1
246
I've programmed a PHP/PostgreSQL/Oracle script for internal usage at my work, where links are displayed as light-blue "tags", which can also be hidden by clicking an "x" near them: ![alt text](https://i.stack.imgur.com/gsElV.png) This works pretty well sofar and my colleagues are already impressed. The CSS-appearance for the "tags" I have stolen from Stackoverflow (since my own CSS/JS skills are very limited and also ): ``` a.hide { color:#3E6D8E; background-color: #E0EAF1; border-bottom: 1px solid #3E6D8E; border-right: 1px solid #7F9FB6; padding: 3px 4px 3px 4px; margin: 2px 2px 2px 0; text-decoration: none; font-size: 90%; line-height: 2.4; white-space: nowrap; } a.hide:hover { background-color: #e7540c; color: #E0EAF1; border-bottom: 1px solid #A33B08; border-right: 1px solid #A33B08; text-decoration: none; } a.tag { color:#3E6D8E; background-color: #E0EAF1; border-bottom: 1px solid #3E6D8E; border-right: 1px solid #7F9FB6; padding: 3px 4px 3px 4px; margin: 2px 2px 2px 0; text-decoration: none; font-size: 90%; line-height: 2.4; white-space: nowrap; } a.tag:hover { background-color: #3E6D8E; color: #E0EAF1; border-bottom: 1px solid #37607D; border-right: 1px solid #37607D; text-decoration: none; } ``` Now I would like to enhance my script by few JavaScript lines and (the links should still work of course). Maybe make them fly up or maybe even explode? Does anybody have an idea here or can share a nice trick? I'd prefer not to use jQuery, because I haven't learnt it yet. Thank you and I hope for your creativity :-) Alex
JavaScript: clicked link should disappear in a spectacular way
CC BY-SA 2.5
0
2010-12-22T18:26:53.067
2010-12-22T18:48:37.227
null
null
165,071
[ "javascript", "css", "unobtrusive-javascript" ]
4,512,401
1
null
null
1
1,677
Rounded Borders not working in IE . I've tried to use CSS3 for my GWT web app , and I'm struggling to inject *.htc into my code. How to reference *.htc file via GWT; 1.I've tried using `ClienBundle` to get it as a resource file. 2.I've referenced its relative path from css file. Both of the ways couldn't help me. Is there any way using CSS3 with GWT? Is anybody using *.htc with GWT or GWT doesn't support CSS3 yet? I want a div with rounded borders something like that:[demo](http://curved-corner.googlecode.com/files/border-radius-demo.zip) My project structure is: ![image](https://i.stack.imgur.com/lkKOo.png) ``` public class Css3 implements EntryPoint { interface MyResources extends ClientBundle { @ClientBundle.Source("myHTCfile.htc") DataResource htcResource(); } public void onModuleLoad() { final MyResources myResources=(MyResources) GWT.create(MyResources.class); final FlowPanel roundedDiv =new FlowPanel(); roundedDiv.setStyleName("myClass"); roundedDiv.add(new Label("lorem ipsum dolor sit amet lorem dolor" + "sit amet lorem ipsum dolor sit amet ")); roundedDiv.setSize("200px","200px"); myResources.htcResource().getUrl(); //For what is this necessary? RootPanel.get().add(roundedDiv); } ``` } Css3.css ``` @url myHTCFile htcResource; .myClass { behavoir: url(css3/myHTCFile); border-radius:10px; background-color:red; padding:10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; } ``` Thanks in advance!!!
How to use HTML Component File(.htc) with GWT for applying CSS3?
CC BY-SA 2.5
0
2010-12-22T18:31:09.517
2012-01-30T13:37:36.000
2011-01-19T22:54:00.413
416,996
416,996
[ "java", "gwt", "css" ]
4,512,868
1
4,514,455
null
1
173
My Rewrite Rule: ``` RewriteRule ^(?!user?)([a-z0-9.-]+)+(\/)?$ index.php?page=$1 ``` So if I go to `http://localhost/hello/`, I want to get `hello` in the `$1` But if I go to `http://localhost/user/` I want to do nothing in this RewriteRule :) Because other RewriteRule is handling the special pages :) Instead getting `hello` as `$1` , I get `index.php`, why and how should I fix this? I also tested the regex with `preg_replace` here: [http://regex.larsolavtorvik.com/](http://regex.larsolavtorvik.com/) and works :\ ![alt text](https://i.stack.imgur.com/rUgKR.png)
Htaccess - Rewrite Rule
CC BY-SA 3.0
0
2010-12-22T19:23:37.497
2012-03-08T21:20:20.860
2012-03-08T21:20:20.860
205,245
380,562
[ "regex", ".htaccess", "mod-rewrite" ]
4,513,030
1
null
null
10
1,066
I have found that while rendering opaque text in Java (latest version 6u23) uses sub-pixel AA just fine, rendering translucent text does not. Sub-pixel AA: ![alt text](https://i.stack.imgur.com/ed1l4.gif) ![alt text](https://i.stack.imgur.com/oEDgp.gif) The same text for which only the color has been changed from 0xFFFFFFFF to 0xBFFFFFFF: ![alt text](https://i.stack.imgur.com/mfQky.gif) ![alt text](https://i.stack.imgur.com/F3rlJ.gif) As you can see, the translucent text is clearly standard AA and rather than a clean translucent rendering, it has that awful '90s "spidery" appearance. Is this due to a technical limitation for sub-pixel AA in general, or a bug in Java, or just because Java doesn't even try for translucent text, or have I missed something? --- ``` dbGraphics=(Graphics2D)dbImage.getGraphics(); if(dctRoot.properties.getBoolean("Antialias",true)) { try { Map hnts=(Map)(dctRoot.awtComponent.getToolkit().getDesktopProperty("awt.font.desktophints")); // SET AA ON OVERALL (NOTE: GENERAL AA MUST BE OFF FOR SUBPIXEL AA TO BE HONORED - TEXT WIDGETS MUST DO THIS THEMSELVES) dbGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); if(hnts!=null) { // SET FONT RENDERING HINTS FROM DESKTOP dbGraphics.addRenderingHints(hnts); } else { try { // SET TEXT AA TO FONT-SPECIFIED GASP AA (JAVA 6+) dbGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.class.getField("VALUE_TEXT_ANTIALIAS_GASP").get(null)); } catch(Throwable thr3) { // SET TEXT AA TO DEFAULT dbGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_ON); } } } catch(Throwable thr) { dctRoot.log.println("Antialiasing not supported on this JVM ("+thr+")."); dctRoot.setProperty("Antialias","False"); // turn off AA for subsequent painting } } else { try { dbGraphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF); dbGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); } catch(Throwable thr) {;} // ignore exception } ``` ``` Object oaa=disableGeneralAA(gc); ... gc.drawString(tl,xx,(ty+(xa*met.getHeight()))); restoreGeneralAA(gc,oaa); ... static private volatile boolean hasRenderingHints=true; // ***************************************************************************** // STATIC INIT & MAIN // ***************************************************************************** // ***************************************************************************** // STATIC METHODS // ***************************************************************************** /** * Disable the general anti-aliasing rendering hint, returning whether the old value was RenderingHints.VALUE_ANTIALIAS_ON. * <p> * This method is needed for text rendering due to a bug in AWT; as of Java 6_20 when general AA is on text is not rendered using subpixel * AA, so general AA has to be turned off before rendering text and turned back on when done. This method abstracts that work and deals * with the possibility that the JVM does not support rendering hints, such as is the case with JME JVMs. */ static public Object disableGeneralAA(Graphics2D gc) { Object old=null; if(hasRenderingHints) { try { old=gc.getRenderingHint(RenderingHints.KEY_ANTIALIASING); gc.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF); } catch(NoClassDefFoundError thr) { hasRenderingHints=false; } catch(NoSuchFieldError thr) { hasRenderingHints=false; } catch(NoSuchMethodError thr) { hasRenderingHints=false; } } return old; } /** * Disable the general anti-aliasing rendering hint, returning whether the old value was RenderingHints.VALUE_ANTIALIAS_ON. * <p> * This method is needed for text rendering due to a bug in AWT; as of Java 6_20 when general AA is on text is not rendered using subpixel * AA, so general AA has to be turned off before rendering text and turned back on when done. This method abstracts that work and deals * with the possibility that the JVM does not support rendering hints, such as is the case with JME JVMs. */ static public void restoreGeneralAA(Graphics2D gc, Object val) { Object old=null; if(hasRenderingHints && val!=null) { try { gc.setRenderingHint(RenderingHints.KEY_ANTIALIASING,val); } catch(NoClassDefFoundError thr) { hasRenderingHints=false; } catch(NoSuchFieldError thr) { hasRenderingHints=false; } catch(NoSuchMethodError thr) { hasRenderingHints=false; } } } ```
Can Java render translucent text using sub-pixel AA?
CC BY-SA 2.5
0
2010-12-22T19:40:42.050
2017-08-14T23:22:50.430
2011-01-16T05:41:29.567
8,946
8,946
[ "java", "text-rendering" ]
4,513,055
1
4,513,106
null
3
1,186
maybe anyone have an idea this is happening it ? ![alt text](https://i.stack.imgur.com/Ll3Fv.jpg) ``` p { display: block; margin: 1em 0px; } p.description { color: #969797; font-family: Calibri, sans-serif; font-size: 15px; font-style: normal; font-weight: lighter; letter-spacing: -0.05em; line-height: 1em; text-decoration: none; text-shadow: none; text-transform: none; word-spacing: 0em; } ```
firefox font rendering problem/issue
CC BY-SA 2.5
null
2010-12-22T19:43:42.377
2010-12-22T21:03:57.923
2010-12-22T21:03:57.923
5,369
5,369
[ "firefox", "google-chrome", "fonts", "safari", "rendering" ]
4,513,461
1
4,513,871
null
13
3,033
I know that a servlet container, such as Apache Tomcat, runs in a single instance of the JVM, which means all of its servlets will run in the same process. I also know that the architecture of the servlet container means each web application exists in its own context, which suggests it is isolated from other web applications. As depicted here: ![alt text](https://i.stack.imgur.com/8BGnQ.jpg) Accepting that each web application is isolated, I would expect that you could create 2 copies of an identical web application, change the names and context paths of each (as well as any other relevant configuration), and run them in parallel without one affecting the other. The answers to [this question](https://stackoverflow.com/questions/2050354/running-multiple-versions-of-a-servlet-web-application-parallel) appear to support this view. However, a colleague disagrees based on their experience of attempting just that. They took a web application and tried to run 2 separate instances (with different names etc) in the same servlet container and experienced issues with the 2 instances conflicting (I'm unable to elaborate more as I wasn't involved in that work). Based on this, they argue that since the web applications run in the same process space, they can't be isolated and things such as class attributes would end up being inadvertently shared. [This answer](https://stackoverflow.com/questions/393378/starting-a-threadpool-in-a-servlet-container/393384#393384) appears to suggest the same thing The two views don't seem to be compatible, so I ask you: If , If , and finally, , perhaps scenarios involving resources on the file system, native code, or database connections?
Do servlet containers prevent web applications from causing each other interference and how do they do it?
CC BY-SA 2.5
0
2010-12-22T20:34:22.467
2019-10-09T05:52:03.670
2017-05-23T12:18:15.390
-1
110,255
[ "java", "web-applications", "tomcat", "jakarta-ee" ]
4,513,729
1
4,513,821
null
0
20,339
I want to achieve this: ![alt text](https://i.stack.imgur.com/E9OMI.png) I want to display boxes, one main box and below each box a smaller box as you can see in the picture. I define this with the following html structure: ``` <div class='content'> <div class='box'> <a>test</a> <div class='money'><div id='maxnumber'> <h3 id='max'>max</h3><h3 id='digit'>0000</h3> </div></div> <div id='numbereuro'><h3 id='digit2'></h3> <h3 id='euro'></h3> </div> </div> <div class='utility'>test</div> </div> ``` Here is a working example that shows the result without the smaller box: [http://jsfiddle.net/](http://jsfiddle.net/) `.box` names the bigger box and `.utility` the smaller box below bot wrapped in `.content`. I use the following css:[http://jsfiddle.net/76fXa/](http://jsfiddle.net/76fXa/) ``` .content { margin: 5px; padding: 5px; font-size: 11px; float: left; } .utility{ position:relative; height:50px; width:100px; background:red; } .box { margin: 5px; padding: 5px; background: #BBE3A8; font-size: 11px; float: left; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } .box { position: relative; padding: 5px; width: 180px; height:auto; cursor:pointer; } ``` and I get the following result: [http://jsfiddle.net/76fXa/1/](http://jsfiddle.net/76fXa/1/) ![alt text](https://i.stack.imgur.com/BMypX.png) any ideas?
Position div boxes with css
CC BY-SA 2.5
0
2010-12-22T21:06:23.883
2010-12-22T22:03:13.060
2010-12-22T21:13:41.920
401,025
401,025
[ "css", "html", "css-float" ]
4,513,907
1
4,514,416
null
0
587
I am looking for a counter looks like the one in [iphonepicker.com](http://iphonepicker.com/demo.php) in jQuery. I was thinking to use the one from iphonepicker.com but it is written using Prototype lib and I need jQuery version. Here is [the sample image taken from here](http://iphonepicker.com/demo.php): ![iphone picker](https://i.stack.imgur.com/RpbaM.jpg)
iPhonePicker-like-Countdown Plugin for jQuery
CC BY-SA 3.0
null
2010-12-22T21:27:22.777
2011-11-02T18:16:27.340
2011-11-02T18:16:27.340
540,162
44,852
[ "jquery", "countdown" ]
4,514,041
1
4,523,495
null
4
2,954
Here is the button gradient I'm trying to build with just CSS gradients: ![alt text](https://i.stack.imgur.com/7kawf.png) This would typically be pretty easy to do, but as you can see, the gradient at the top looks more like a large clipped radial gradient since it dips down in the middle a bit and doesn't extend all the way to the edges. So, any ideas how to pull this off with CSS?
Radial CSS gradient with width constraints?
CC BY-SA 2.5
0
2010-12-22T21:46:02.317
2010-12-24T00:34:42.077
null
null
147,586
[ "css", "gradient" ]
4,514,326
1
4,514,864
null
1
223
I recently ran into a problem with my app, On most android phones I have encountered, the UI seems to be mostly light colored. Now though, it seems phones are making a switch over to a darker UI(droid x). Now I found this to be a problem for instance with spinners. I have not set a font color on my spinner, but it gets defaulted to black on all the UI's I have tested on, making it harder to read on the darker UI's. What is the best way to handle this? Pick a neutral color? Design for each UI? Or is there a way to set the font color so the phone's UI can pick it up and set it to their default color?![alt text](https://i.stack.imgur.com/exq1H.png)
How to handle different android UI's
CC BY-SA 2.5
0
2010-12-22T22:34:36.670
2010-12-23T00:08:17.047
null
null
408,079
[ "android" ]
4,514,753
1
4,514,888
null
1
81
Hi I'd really appreciate if anyone could confirm if these instructions ![http://www.cowsgomoo.uni.cc/fail.png](https://i.stack.imgur.com/pRkAW.png) [http://www.cowsgomoo.uni.cc/fail.png](http://www.cowsgomoo.uni.cc/fail.png) Will produce this answer :
Will these instructions create this binary tree?
CC BY-SA 2.5
0
2010-12-22T23:46:04.670
2010-12-23T02:01:28.650
2010-12-23T02:01:28.650
30,225
551,841
[ "computer-science", "binary-tree" ]
4,514,801
1
4,515,197
null
0
655
Is there a way to get the default NSPathControl to have drop down like in xcode 4? by default i mean without subclassing ![alt text](https://i.stack.imgur.com/zNf4s.png)
drop down nspathcontrol
CC BY-SA 2.5
0
2010-12-22T23:54:19.963
2010-12-23T01:36:01.787
null
null
251,420
[ "cocoa", "nspathcontrol" ]
4,514,915
1
4,540,711
null
3
1,295
I'm replacing the default Button template's ContentPresenter with a TextBlock, so the text can be trimmed when it's too long. Works fine in WPF. In Silverlight the text gets pushed to one edge and cut off on the left, even when there's space on the right: ![alt text](https://i.stack.imgur.com/JUVlB.png) Template is nothing special, just replaced the ContentPresenter with the TextBlock: ``` <Border x:Name="bdrBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" /> <Rectangle x:Name="rectMouseOverVisualElement" Opacity="0"> <Rectangle.Fill> <SolidColorBrush x:Name="rectMouseOverColor" Color="{StaticResource MouseOverItemBgColor}"/> </Rectangle.Fill> </Rectangle> <Rectangle x:Name="rectPressedVisualElement" Opacity="0" Style="{TemplateBinding Tag}"/> <TextBlock x:Name="textblock" Text="{TemplateBinding Content}" TextTrimming="WordEllipsis" TextWrapping="NoWrap" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> <Rectangle x:Name="rectDisabledVisualElement" Opacity="0" Style="{StaticResource RectangleDisabledStyle}"/> <Rectangle x:Name="rectFocusVisualElement" Opacity="0" Style="{StaticResource RectangleFocusStyle}"/> </Grid> </ControlTemplate> ``` How do I fix this? --- More info: With the latest comment about HorizontalAlignment, it's clear that SL's implementation of TextTrimming differs from WPF's. In SL, TextTrimming only really works if the text is aligned left. SL isn't smart enough to align the text the way WPF does. For instance: WPF button: ![alt text](https://i.stack.imgur.com/uegUM.png) SL button with the textblock horizontalalignment = left: ![alt text](https://i.stack.imgur.com/o1UQT.png) SL button with textblock horizontalalignment = center: ![alt text](https://i.stack.imgur.com/VQxj3.png)
Silverlight: Button template with texttrimming cut off
CC BY-SA 2.5
null
2010-12-23T00:20:25.460
2010-12-27T18:04:35.593
2010-12-23T16:46:55.060
389,809
389,809
[ "silverlight", "templates", "button", "texttrimming" ]
4,514,928
1
5,678,411
null
9
11,321
I am trying to have a node (or a subgraph, enclosing a node - whichever is possible/easier) rotated, like shown in this image: ![desired rotated node effect](https://i.stack.imgur.com/PLRF6.png) ( 'verti-*' )   However, the closest I can to that, is the following `dot` code: ``` digraph graphname { node [fontname=Monospace, fontsize=14]; subgraph clusterMasterBox { node [shape=record]; l1 [label = "{ horiz-1 \r| \ horiz-2 \r| \ horiz-3 \r| \ horiz-4 \r} \ "]; subgraph clusterSubRotateBox { rotate=90; node [shape=record,rotate=90]; l2 [label = "{ verti-1 \r| \ verti-2 \r| \ verti-3 \r| \ verti-4 \r} \ "]; label="B"; } label="A" } } ``` The only reason I have the `subgraph clusterSubRotateBox` there (and the only reason why it is nested inside the `clusterMasterBox`), is because I hoped I could assign rotation to it, but apparently I cannot - as the above code generates this image: ![gviz rotate actual](https://i.stack.imgur.com/0IL0O.png) So my question is - is there a way to rotate a record node; if not on its own, then maybe as a part of subgraph (or a different kind of 'object')? Thanks in advance for any suggestions, Cheers!
Graphviz: how to rotate a node (or a subgraph)?
CC BY-SA 2.5
0
2010-12-23T00:22:51.567
2022-06-15T03:23:37.160
null
null
277,826
[ "rotation", "graphviz", "subgraph" ]
4,514,973
1
4,515,324
null
5
4,865
I have a Person table, an Employee table, and a Contractor table. All Employees are people, all Contractors are people and every Person is either an employee or a Contractor. Like so: ![alt text](https://i.stack.imgur.com/uzQDb.jpg) How would I be able to accomplish this concept using Model First? Inheritance?
Entity Framework: Model First, Inheritance?
CC BY-SA 2.5
0
2010-12-23T00:34:10.713
2014-03-17T11:41:49.550
2012-07-09T13:50:56.667
41,956
337,806
[ ".net", "entity-framework", "inheritance", "ef-model-first" ]
4,515,248
1
4,516,157
null
22
110,059
I am trying to load a PDF document inside a .NET web browser control. In versions of Adobe Reader prior to v10 (aka "X"), the PDF loaded without the toolbar displayed—you would just see the PDF document. In the newly-released Reader v10, there is a toolbar that I do not wish to see. I am wondering if anyone knows how to hide this toolbar. I'm thinking that the answer may lie in the Registry, as there is no direct code that I am using to access Reader. Everything is handled by mime types through the `WebBrowser` control. My code to load the PDF file is as follows: ``` string url = @"http://www.domain.com/file.pdf"; this._WebBrowser.Navigate(url); ``` ![Adobe Reader toolbar that I wish to hide](https://i.stack.imgur.com/qD5eB.png)
How can I hide the Adobe Reader toolbar when displaying a PDF in the .NET WebBrowser control?
CC BY-SA 2.5
0
2010-12-23T01:52:10.577
2017-02-01T17:42:10.320
2010-12-23T05:43:43.707
366,904
96,854
[ ".net", "pdf", "webbrowser-control", "acrobat", "adobe-reader" ]
4,515,251
1
43,988,319
null
12
13,187
I am trying to make a css layout that looks like this ![enter image description here](https://i.stack.imgur.com/yTzXI.jpg) The CSS term for this type of layout is known as the "holy grail" I think. The problem I am facing is that when I use layouts and solutions I find online I do not get them to work properly as I want them to. What I am trying to do is make a page that, regardless of content, will have the footer at the bottom of the browser and the columns stretching down to it. So far I have only seen pages that have the footer placed where the content stop, the result is some blank space under the footer. If anyone could help me out on this it would be greatly appreciated!
Holy grail layout with 100% height
CC BY-SA 3.0
0
2010-12-23T01:53:18.150
2020-07-18T21:27:24.117
2012-12-21T19:40:46.623
604,156
549,320
[ "css", "layout" ]
4,515,264
1
null
null
2
6,509
I've been working on drawing an isometric map with C# / XNA Game Studio, and while I've gotten pretty far it doesn't look quite right and I was wondering if anybody can help. Here's the code I have for drawing the map: ``` public void Draw(SpriteBatch theBatch, int drawX, int drawY) { if ((drawY % 2 == 0)) theBatch.Draw(tileTexture, new Rectangle((drawX * width), (drawY * length / 2), width, length), Color.White); else theBatch.Draw(tileTexture, new Rectangle(((drawX * width) + (width / 2)), (drawY * length / 2), width, length), Color.White); } ``` The code within this method acts as if it were inside a nested for loop, drawing left to right, top to bottom. When the y-value is odd, the row is shifted over to fit, however it looks a bit off. This is the produced output for an 8x5 map: ![http://imgur.com/xpDRU.png](https://i.stack.imgur.com/uBned.png) As you can see, it doesn't quite look right, and I'm not sure if its an issue with the math in my code, or if it has to do with the order everything is being drawn in. I'm very new to C# and working with sprites, so any help would be greatly appreciated. Because it might be helpful, here is the other relevant parts of code which draw the map. The entire Tile Class: ``` public class Tile { // Dimension variables int height; int width; int length; String type; Texture2D tileTexture; Vector2 coordinates; /// /// Tile Constructor /// public Tile(ContentManager theContent, String theType, Vector2 theCoordinates) { width = 68; length = 46; type = theType; coordinates = theCoordinates; // Sets the right texture to the texture ref if (theType == "grass") tileTexture = theContent.Load<Texture2D>(@"Tiles\iso_grass"); } /// /// Draws the tile at the given location /// public void Draw(SpriteBatch theBatch, int drawX, int drawY) { if ((drawY % 2 == 0)) theBatch.Draw(tileTexture, new Rectangle((drawX * width), (drawY * length / 2), width, length), Color.White); else theBatch.Draw(tileTexture, new Rectangle(((drawX * width) + (width / 2)), (drawY * length / 2), width, length), Color.White); } } ``` The TileRow class, which holds one row of tiles. ``` public class TileRow { public List<Tile> Row = new List<Tile>(); public int rowLength; public TileRow(int theLength, int yIndex, ContentManager theContent) { rowLength = theLength; Tile thisTile; // Here the tiles are created and added to the row for (int x = 0; x < rowLength; x++) { thisTile = new Tile(theContent, "grass", new Vector2(x, yIndex)); Row.Add(thisTile); } } /// /// Draw -- invokes the draw method of each tile in the row /// public void DrawRow(SpriteBatch theBatch, int currentY) { for (int x = 0; x < rowLength; x++) { Row[x].Draw(theBatch, currentY, x); } } } } ``` and the MapStruct class, which holds all the rows ``` public class MapStruct { public List<TileRow> allRows = new List<TileRow>(); int depth; // Constructor public MapStruct(ContentManager theContent, int theDepth, int rowLength) { depth = theDepth; TileRow thisRow; // Here we make a row of tiles for each level of depth for (int y = 0; y < depth; y++) { thisRow = new TileRow(rowLength, depth, theContent); allRows.Add(thisRow); } } /// /// Draw - this method invokes the draw method in each tile row, which then draws each tile /// public void DrawMap(SpriteBatch theBatch) { for (int y = 0; y < depth; y++) { allRows[y].DrawRow(theBatch, y); } } } ``` Any help on how I could fix this issue, as well as advice on how I could improve my code would be greatly appreciated!
Drawing Isometric Tilemaps
CC BY-SA 3.0
null
2010-12-23T01:55:01.527
2011-12-04T13:19:20.937
2011-12-04T13:19:20.937
497,043
551,892
[ "c#", "xna", "2d", "isometric" ]
4,515,352
1
4,515,409
null
0
114
I have a database set up like so: ![alt text](https://i.stack.imgur.com/QI66u.png) Lets say that I have a product group with id of 12. How do I get the CategoryID for this particular Product Group? Would I have to do a join?
Help with multi table linq query
CC BY-SA 2.5
null
2010-12-23T02:13:55.930
2010-12-23T13:27:47.340
null
null
445,303
[ "c#", "linq-to-sql" ]
4,515,403
1
4,515,523
null
2
516
I have the following intellisense problem, which only occurs in the Release configuration, even though both Debug and Release use the exact same file paths. ![](https://www.imgdumper.nl/uploads3/4d12b1ed6dc42/4d12b1ed6bd05-derp.gif) I've never had problems like this with Visual C++ 2010.
Visual Studio 2010 intellisense problem
CC BY-SA 2.5
null
2010-12-23T02:29:20.437
2010-12-23T02:53:42.380
2017-02-08T14:31:14.237
-1
238,180
[ "visual-studio-2010", "file", "path" ]
4,515,525
1
10,733,334
null
2
4,486
You don't really need to know here that it is generating Pareto's points; but we never know, maybe someone will say "just use the hidden awesome built-in pareto function!". ## The problem I have a query returning: ``` resource | activity_percentage 1 | P(1) 2 | P(2) 3 | P(3) ... N - 1 | P(N - 1) N | P(N) ``` Where: - - - I need to group the resources one by one ({1}, {1; 2}, {1; 2; 3}, ...; {1; 2; ...; N}), accumulating the activity_percentage of the resources present in the group. The final result will be: ``` resource_percentage | activity_percentage R(1) | A(1) R(2) | A(2) ... R(N - 1) | A(N - 1) ``` Where - - ## My Solution ## 1. Query to get a resource rank and its activity percentage ``` -- Query assigning a number to each resource according to its rank of activity percentage. SELECT row_number() OVER (ORDER BY activity_percentage DESC) AS resource, activity_percentage AS activity_percentage FROM Resource_Table ``` We obtain here: ``` resource | activity_percentage 1 | P(1) 2 | P(2) 3 | P(3) ... N - 1 | P(N - 1) N | P(N) ``` ## 2. Create a serie of number from 1 to N Is there a SQL feature doing that? For now, I use the same query as above, which is bad and slow... ``` -- Creates a serie from 1 to the number of resources SELECT row_number() OVER (ORDER BY activity_percentage DESC) AS i FROM Resource_Table ``` We obtain: ``` i 1 2 3 ... N ``` ## 3. Add the percentage of resources contained per group To be able to say, for example, group 1 contains only 1 which represent (100 * 1/N) percent of resources; group N contains every resources; 100 * N / N = 100% ``` SELECT i, -- i is the number of the group but it actually gives the number of resources it contains too cast(i AS float) / resources.nb_resources AS resource_percentage FROM ( -- Creates a number serie from 1 to the number of resources SELECT row_number() OVER (ORDER BY activity_percentage DESC) AS i FROM Resource ) groups JOIN ( -- Query only getting the number of resources... SELECT count(DISTINCT resource_id) AS nb_resources FROM Resource_Table ) customers ON 1 = 1 ``` I hate this one since I am doing another query to get the number of resources, which is finally max(i) or the number of lines returned by the query (count(*))... ## 4. Group the resources together So now, we just have to join these queries with the condition: resource <= i ``` SELECT groups.i AS group_number, groups.resource_percentage, activity_percentage.resource, activity_percentage.activity_percentage FROM ( SELECT i, -- i is the number of the group but it actually gives the number of resources it contains too cast(i AS float) / resources.nb_resources AS resource_percentage FROM ( -- Creates a number serie from 1 to the number of resources SELECT row_number() OVER (ORDER BY activity_percentage DESC) AS i FROM Resource ) groups JOIN ( -- Query only getting the number of resources... SELECT count(DISTINCT resource_id) AS nb_resources FROM Resource_Table ) customers ON 1 = 1 ) groups JOIN ( -- Query assigning a number to every resource according to its activity percentage. SELECT row_number() OVER (ORDER BY activity_percentage DESC) AS resource, activity_percentage AS activity_percentage FROM Resource_Table ) activity_percentage ON activity_percentage.resource <= groups.i ``` We obtain: ``` group_number | resource_percentage | resource | activity_percentage 1 | R(1) | 1 | P(1) 2 | R(2) | 1 | P(1) 2 | R(2) | 2 | P(2) 3 | R(3) | 1 | P(1) 3 | R(3) | 2 | P(2) 3 | R(3) | 3 | P(3) ... N | R(N) | 1 | P(1) N | R(N) | 2 | P(2) N | R(N) | ... | ... N | R(N) | N | P(N) ``` ## 5. Simply aggregate per group_number Changing the above query: ``` SELECT groups.resource_percentage, sum(activity_percentage.activity_percentage) AS activity_percentage FROM ... GROUP BY groups.resource_percentage ``` Grouping by the group_number or group_percentage does not matter since each group_number has a corresponding group_percentage. That's it! We obtain: ``` resource_percentage | activity_percentage R(1) | A(1) = P(1) R(2) | A(2) = P(1) + P(2) ... R(N) | A(N) = P(1) + P(2) + ... + P(N) ``` Graphically: ![](https://i.stack.imgur.com/tX3sy.png) ## Conclusion I obtain a very long query, mostly due to the creation of groups (my N is 25 550) but I would be very pleased to know a better solution, mostly for steps 2 & 3. Thanks!!
Optimizing a SQL expression generating Pareto's Points - How to efficiently group by each combination?
CC BY-SA 3.0
null
2010-12-23T02:53:51.977
2012-05-24T07:59:01.263
2012-05-24T07:59:01.263
303,726
303,726
[ "sql", "sql-server", "sql-server-2005", "optimization", "query-optimization" ]
4,516,139
1
4,516,720
null
4
2,322
I'm trying to map a many-to-many relationship between two entities, but I need to decorate that entity with a number of properties - see the diagram below: ![Many-to-Many Relationship with additional attributes on relationship table](https://i.stack.imgur.com/H5VOs.png) is my relationship table in this case - I added an identity column on it in order to avoid using a composite key, but the valuable information here is really the UserId, the FeedItemId, and the TimeRead attribute. Here is how I have tried to map this relationship, based on similar examples I've seen on StackOverFlow: ``` public class UserMap : ClassMap<User> { public UserMap() { Id(x => x.UserId).GeneratedBy.Identity(); Map(x => x.UserName).Length(DataConstants.UserNameLength).Unique().Not.Nullable(); Map(x => x.EmailAddress).Length(DataConstants.EmailAddressLength).Unique().Not.Nullable(); Map(x => x.DateJoined).Not.Nullable(); Map(x => x.Password).Length(DataConstants.PasswordHashLength).Not.Nullable(); HasManyToMany(x => x.UserRoles).Cascade.AllDeleteOrphan().AsBag().Table("UsersInRole"); HasManyToMany(x => x.SubscribedFeeds).Cascade.DeleteOrphan().AsBag().Table("Subscriptions"); HasManyToMany(x => x.OwnedFeeds).Cascade.All().AsBag().Table("FeedOwners"); HasMany(x => x.Reads).Cascade.DeleteOrphan().Fetch.Join().Inverse().KeyColumn("UserId"); } } ``` ``` public class FeedItemMap : ClassMap<FeedItem> { public FeedItemMap() { Id(x => x.FeedItemId).GeneratedBy.Identity(); Map(x => x.OriginalUri).Not.Nullable().Unique().Length(DataConstants.FeedUriLength); Map(x => x.DatePublished).Not.Nullable(); Map(x => x.Title).Not.Nullable().Length(DataConstants.FeedItemTitleLength); References(x => x.Feed); HasManyToMany(x => x.Tags).Cascade.All().Table("PostTags"); HasManyToMany(x => x.Categories).Cascade.All().Table("PostsInCategory"); HasMany(x => x.Reads).Cascade.AllDeleteOrphan().Inverse().Fetch.Join().KeyColumn("FeedItemId"); } } ``` : ``` public class FeedReadMap : ClassMap<FeedRead> { public FeedReadMap() { Table("Reads"); //CompositeId() // .KeyProperty(x => x.TimeRead, "TimeRead") // .KeyReference(x => x.ItemRead, "FeedItemId") // .KeyReference(x => x.Reader, "UserId"); Id(x => x.ReadId).GeneratedBy.Identity(); Map(x => x.TimeRead).Not.Nullable(); References(x => x.Reader).Not.Nullable().Cascade.SaveUpdate().Column("UserId"); References(x => x.ItemRead).Not.Nullable().Cascade.SaveUpdate().Column("FeedItemId"); } } ``` --- This code doesn't raise errors as-is, but nothing is ever persisted to the Reads table when I try to do the following: ``` var read = new FeedRead {ItemRead = feed.Items[0], Reader = user, TimeRead = DateTime.Now}; user.Reads.Add(read); feed.Items[0].Reads.Add(read); _repository.SaveUser(user); ``` This is probably because of the fact that both User and FeedItem have a on the relationship mapping - I did it this way because it's what I saw in most other examples that tried to model this same relationship. When I remove the .Inverse off of the User mapping, I get this error instead: > NHibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing. My ultimate goal is to be able to do Session.SaveOrUpdate(user) and have it insert any new feed reads directly into the Reads table, but I haven't been able to find a way to do it yet. What am I doing wrong? I've read through virtually every other question on StackOverFlow about this topic already and haven't found a clear answer to this question.
Fluent NHibernate: How do I map Many-to-Many Relationships with additional attributes on the relationship table?
CC BY-SA 2.5
0
2010-12-23T05:32:53.490
2010-12-23T07:34:22.303
null
null
377,476
[ "c#", "nhibernate", "orm", "fluent-nhibernate", "nhibernate-mapping" ]
4,516,290
1
4,516,341
null
2
2,332
![Database Schema](https://i.stack.imgur.com/15CmJ.png) My question is related to `ServiceASpecificField` and `ServiceBSpecificField`. I feel that these two fields are placed inappropriately because for all records of `service A` for all subscribers in `SubscriberServiceMap` table, `ServiceBSpecificField` will have null value and vice versa. If I move these two fields in Subscribers table, then I will have another problem. All those subscribers who only avail `service A` will have null value in `Subscribers.ServiceBSpecificField`. So what should be done ideally?
How to Handle Optional Columns
CC BY-SA 2.5
0
2010-12-23T06:01:53.680
2011-01-06T12:35:56.773
2011-01-06T12:35:56.773
148,271
148,271
[ "database", "database-design", "normalization", "relational-database" ]
4,516,503
1
4,523,685
null
1
1,450
I try to use the following script to transfer a text file located in web server, to client (The text file is in UTF-16). ``` import cgi print "Content-Type: text/plain" print "Content-Disposition: attachment; filename=TEST.txt" print filename = "C:\\TEST.TXT" f = open(filename, 'r') for line in f: print line ``` However, when I open up the downloaded file, the file is all having weird characters. I try to use `rb` flag, it doesn't either. Is there anything I had missed out? What I wish is, the file (TEST.TXT) downloaded by the client by making query to the above script, will be exactly same as the one in server. I also try to specific the encoding explicitly. ``` import cgi print "Content-Type: text/plain; charset=UTF-16" print "Content-Disposition: attachment; filename=TEST.txt" print filename = "C:\\TEST.TXT" f = open(filename, 'r') for line in f: print line.encode('utf-16') ``` That doesn't work either. --- ![alt text](https://i.stack.imgur.com/S6SjX.png) --- ![alt text](https://i.stack.imgur.com/l39Lc.png) --- I will have the [original text file](https://sites.google.com/site/yanchengcheok/Home/TEST.TXT?attredirects=0&d=1) being posted here in case you are interested to experiment it out.
Transfer Text File in Web Server to Client
CC BY-SA 2.5
null
2010-12-23T06:52:07.847
2010-12-24T01:30:59.727
2010-12-23T07:40:56.067
72,437
72,437
[ "python" ]
4,516,688
1
4,516,716
null
2
263
In SQL Server 2008, I have 3 tables: Definitions, Params, and Items. The fist table contains the min and max value that a Param may be. Params contains 0 or more parameters against a given definition, for an item. I wish to get the valid Item IDs by doing the appropriate conditional joins/evals. To illustrate: ![alt text](https://i.stack.imgur.com/md2e5.png) ItemID = 1 would be returned because nothing in Params violates Definitions.Min|Max. ItemsID = 2 would not be returned because Hi = 103 violates Definitions.Max where DefID = 2. Given this, the fact the last entry violates Definitions.Low is inconsequential, but shown for clear illustration. ItemID = 3 will match because it has a Param that is within range. There is no need to join all Definitions.
Tricky join based on results of an aggregate evaluation
CC BY-SA 2.5
null
2010-12-23T07:29:11.680
2010-12-23T08:21:22.403
null
null
401,584
[ "sql-server", "join", "filtering", "aggregate" ]
4,516,845
1
null
null
0
99
I am using google maps in my application but using a webView...I have loaded a webview see image![alt text](https://i.stack.imgur.com/mPdaW.png) I do not want that textfield .... Is there any way to remove it Please help
Hiding textfield of webView
CC BY-SA 2.5
null
2010-12-23T07:59:49.920
2010-12-23T08:14:34.570
null
null
426,006
[ "iphone", "uiwebview" ]
4,516,959
1
null
null
0
1,332
I implemented tab bar in android application but i m facing a issue with black line.Can any one help me with this ![alt text](https://i.stack.imgur.com/LZjkg.png) ``` <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" style="@style/tabhost"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TabWidget android:id="@android:id/tabs" android:layout_width="wrap_content" android:layout_height="wrap_content"></TabWidget> <FrameLayout android:id="@android:id/tabcontent" style="@style/tabcontent"/> </LinearLayout> </TabHost> <style name="tabhost"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">fill_parent</item> <item name="android:background">#b1b1b1</item> </style> <style name="tabcontent"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">fill_parent</item> <item name="android:background">#FFFFFF</item> <item name="android:paddingTop">1dip</item> </style> ```
How to remove black line from tabbar in Android?
CC BY-SA 2.5
null
2010-12-23T08:20:44.750
2011-05-28T04:43:17.263
null
null
396,473
[ "android" ]
4,517,073
1
4,594,842
null
0
328
I want to create a simple TabActivity and followed the tutorial on the developer site. The implementation works fine, but the layout bothers me. First of all the text is white, when the background is white and gray, when the background is gray. I thought the regular behavior would be the opposite. But also this one white line on the bottom, that should connect the different tabs is missing. Here are my layouts: ``` <TabHost android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </LinearLayout> </TabHost> <include layout="@layout/menu_back_only" /> </LinearLayout> ``` ``` <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/menu_home" android:state_selected="true" /> <item android:drawable="@drawable/menu_logout" /> </selector> ``` And this is, how it looks right now: ![Wrong Tab Layout](https://i.stack.imgur.com/FIMKX.png)
Why does my TabWidget not look, like it is supposed to?
CC BY-SA 2.5
null
2010-12-23T08:41:29.113
2011-01-04T14:48:31.127
null
null
463,910
[ "android", "tabwidget" ]
4,517,134
1
4,517,294
null
5
7,342
Usually, when I want to transfer a web server text file to client, here is what I did ``` import cgi print "Content-Type: text/plain" print "Content-Disposition: attachment; filename=TEST.txt" print filename = "C:\\TEST.TXT" f = open(filename, 'r') for line in f: print line ``` Works very fine for ANSI file. However, say, I have a binary file `a.exe` (This file is in web server secret path, and user shall not have direct access to that directory path). I wish to use the similar method to transfer. How I can do so? - - I use the following code. ``` #!c:/Python27/python.exe -u import cgi print "Content-Type: application/octet-stream" print "Content-Disposition: attachment; filename=jstock.exe" print filename = "C:\\jstock.exe" f = open(filename, 'rb') for line in f: print line ``` However, when I compare the downloaded file with original file, it seems there is an extra whitespace (or more) for after every single line. ![alt text](https://i.stack.imgur.com/bcM8P.png)
Serving binary file from web server to client
CC BY-SA 2.5
0
2010-12-23T08:49:25.170
2015-07-18T23:07:20.200
2010-12-23T09:36:33.257
130,929
72,437
[ "python", "content-type" ]
4,517,138
1
4,517,221
null
0
8,658
Problem:- I need to embed a progressbar that will run continuously until the completion of the operation. ExtJS provides a Progressbar which will:- a) Run Continuously using method b) Run after updating the method. In both the cases output of the progressbar will be ![alt text](https://i.stack.imgur.com/tYkzD.png) The solution that i am trying for is:- Step 1 : ![alt text](https://i.stack.imgur.com/Skous.png) Step 2 : ![alt text](https://i.stack.imgur.com/uwnl1.png) Step 3 : ![alt text](https://i.stack.imgur.com/k92PL.png) Kindly suggest me a solution or a approach. The JavaScript library that i am using is ExtJS. Thanks in Advance. Links Referred for the example:- [http://dev.sencha.com/deploy/dev/examples/simple-widgets/progress-bar.html](http://dev.sencha.com/deploy/dev/examples/simple-widgets/progress-bar.html) ---
To Show a Continuous ProgressBar using ExtJS
CC BY-SA 2.5
null
2010-12-23T08:49:42.287
2010-12-23T11:15:32.557
2020-06-20T09:12:55.060
-1
501,964
[ "javascript", "extjs" ]
4,517,500
1
null
null
0
493
I faced with such problem, different paint of the same xml layout on same screen sizes, there are two images, first is eclipse ADT layout paint, and second is emulator layout paint. ![alt text](https://i.stack.imgur.com/oc9dE.jpg) ![alt text](https://i.stack.imgur.com/YR6U3.jpg) My questions: 1. Why it so different? 2. How to create normal textfields which are not cutted(on both images)? layout xml: ``` <?xml version="1.0" encoding= "utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:gravity= "center" android:layout_weight="1" > <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="0.33" > </LinearLayout> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="0.33" android:gravity= "center"> <TextView android:text="@string/entertitle" android:id="@+id/EnterTitle" android:gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="bold" ></TextView> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="horizontal" android:gravity="center" > <LinearLayout android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="0.3" android:orientation="vertical" android:gravity="center" > <TextView android:text="@string/yourlogin" android:id="@+id/YourLogin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minWidth='150dp' ></TextView> <TextView android:text="@string/password" android:id="@+id/YourPass" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minWidth='150dp' ></TextView> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="0.7" android:orientation="vertical" android:gravity="center" > <EditText android:text="" android:id="@+id/EditLogin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minWidth='150dp' android:gravity="right" ></EditText> <EditText android:text="" android:id="@+id/EditPass" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="right" android:minWidth='150dp' ></EditText> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:orientation="horizontal" android:gravity="center" > <CheckBox android:text="@string/saveauth" android:id="@+id/CheckSavePass" android:layout_width="wrap_content" android:layout_height="wrap_content" ></CheckBox> <Button android:text="@string/entertitle" android:id="@+id/ButtonEnter" android:layout_width="wrap_content" android:layout_height="wrap_content" ></Button> </LinearLayout> </LinearLayout> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="0.33" > </LinearLayout> </LinearLayout> ```
android displayed layout with cutted EditText
CC BY-SA 2.5
null
2010-12-23T09:39:13.323
2012-04-10T06:16:34.510
null
null
309,955
[ "android", "layout" ]
4,517,602
1
4,517,607
null
1
333
I have a PHP/PostgreSQL/Oracle-script which displays links as "tags", which can be clicked to display only the database records matching that "tag". And then I have an "X" near every "tag", so that the user can hide uninteresting "tags": ![alt text](https://i.stack.imgur.com/GtF4R.png) I would like to add a fade out effect to the both elements (the "tag" and the "X") - when the "X" has been clicked. So I am trying: ``` <!DOCTYPE html> <html> <head> <style> a.hide { color:#3E6D8E; background-color: #E0EAF1; border-bottom: 1px solid #3E6D8E; border-right: 1px solid #7F9FB6; padding: 3px 4px 3px 4px; margin: 2px 2px 2px 0; text-decoration: none; font-size: 90%; line-height: 2.4; white-space: nowrap; } a.hide:hover { background-color: #e7540c; color: #E0EAF1; border-bottom: 1px solid #A33B08; border-right: 1px solid #A33B08; text-decoration: none; } a.filter { color:#3E6D8E; background-color: #E0EAF1; border-bottom: 1px solid #3E6D8E; border-right: 1px solid #7F9FB6; padding: 3px 4px 3px 4px; margin: 2px 2px 2px 0; text-decoration: none; font-size: 90%; line-height: 2.4; white-space: nowrap; } a.filter:hover { background-color: #3E6D8E; color: #E0EAF1; border-bottom: 1px solid #37607D; border-right: 1px solid #37607D; text-decoration: none; } </style> <script src="http://code.jquery.com/jquery-1.4.4.js"></script> <script> $(document).ready(function () { $('a.hide').click(function () { $(this).fadeOut('fast'); }); }); </script> </head> <body> <p>Please click on <a class="filter" href="?filter=1">Tag 1</a><a class="hide" href="?hide=1">X</a></p> <p>Please click on <a class="filter" href="?filter=2">Tag 2</a><a class="hide" href="?hide=2">X</a></p> </body> </html> ``` However I have 2 problems: 1. When my PHP-script is quick, then I don't see any fade effect at all. (This is a minor problem, because my real script is far from being quick :-) ) 2. I only manage to fade out the clicked "X". How can I fade out the "tag" on the left from it? (And I can't use #id here, because my real script has hundreds of such "tags") Please push the jQuery newbie in correct direction! Alex
jQuery: fading out 2 elements, when 1 has been clicked
CC BY-SA 2.5
null
2010-12-23T09:53:43.863
2010-12-23T10:09:45.800
null
null
165,071
[ "javascript", "jquery", "fadeout" ]
4,517,727
1
4,519,519
null
0
309
I'm trying and organizing Official Versions of my solutions and projects within Sharepoint Libraries, and I stumbled across this problem: There are certain published packages which contain more than one project. I'm currently grouping by a "Project" column I created, but some packages seem to belong in more than one area. ![alt text](https://i.stack.imgur.com/kb97o.png) As to say, I want to Split "2011/01 Branch" into 4 website projects. But some packages include more than one website, so I want to see the same file inside every "group". For instance, I could have a column named Projects with multiple values, so "file_cabbage" would have "Project A", "Project B" and "Project C" as Projects. So I would have: Project A: - Project B: - - Project C: - - Project D: - - How to accomplish this? Thanks in advance.
TFS Sharepoint App - I want a document library column to accept multiple values and... group by?
CC BY-SA 2.5
null
2010-12-23T10:08:37.297
2010-12-23T15:08:35.257
null
null
405,978
[ "sharepoint" ]
4,517,736
1
4,518,207
null
0
531
I have an Ext.FormPanel which has a `Save` button which is supposed to do two things in this order: the data, to the page from where it was called. ``` buttons: [{ text: 'Save', handler: function() { if(panel_form.getForm().isValid()){ panel_form.getForm().getEl().dom.action = 'backend/page/blocks/edit_positioned_post/17.html'; panel_form.getForm().getEl().dom.method = 'POST'; panel_form.getForm().submit(); //FIRST POST DATA replace_region_with_uri_content('/backend/page'); //THEN GO BACK } else { Ext.Msg.minWidth = 360; Ext.Msg.alert('Invalid Form', 'Some fields are invalid, please correct.'); } } },{ text: 'Cancel', handler: function(){ replace_region_with_uri_content('/backend/page'); } }] ``` However what is backwards, as I can see in Firebug, i.e. it , and the data, which leads to the situation that the grid that it returns to . ![alt text](https://i.stack.imgur.com/nKi1P.png) `replace_region_with_uri_content()``panel_form.getForm().submit()`
How to make sure a function is not executed until Ext.FormPanel has successfully submitted its data?
CC BY-SA 2.5
null
2010-12-23T10:09:13.210
2010-12-23T11:08:52.433
null
null
4,639
[ "javascript", "extjs", "callback" ]
4,517,977
1
4,518,240
null
0
1,617
I'm working in window phone. I have to bind data in to grid in windows phone.![alt text](https://i.stack.imgur.com/IB6Tt.png) ![alt text](https://i.stack.imgur.com/XVVjd.png) I got results from web service such as name , address, id, category. I need When I click the name, it displays the all details. So, how can I do to display those details?
How to bind the values web service in to grid in windows phone 7?
CC BY-SA 2.5
0
2010-12-23T10:41:50.120
2010-12-23T11:14:11.327
2010-12-23T10:46:44.743
362,218
504,130
[ "c#", ".net", "silverlight", "windows-phone-7" ]
4,518,000
1
4,518,137
null
15
12,914
Recently, I managed (by accident, don't ask) to delete my Core Data datamodel files and classes. And I was completely and utterly unable to create the files again to be exactly the same as they would be in a freshly started project where those files are being prepared automatically by XCode. In a new project, the files would look like this: ![alt text](https://i.stack.imgur.com/aKRVn.jpg) while all I was able to create was: ![alt text](https://i.stack.imgur.com/Yk2AZ.jpg) Did I mention that the app didn't work anymore this way? It crashed saying the model must not be `nil`. The problem was solved by starting a new project with the same name and dragging the files over to the old one - not the most elegant solution, I suppose. I figured however that there are things about Core Data that I still don't quite understand, obviously. Please, enlighten me - what's the magic behind the .xcdatamodeld folder? Why would Foo.xcdatamodel feature that green checked-icon? Does the datamodel need to be compiled or processed in some way? Thanks alot guys!!!
How to create the magic .xcdatamodeld folder / package?
CC BY-SA 2.5
0
2010-12-23T10:45:09.990
2013-08-27T16:19:32.483
null
null
416,600
[ "iphone", "objective-c", "xcode", "core-data" ]
4,518,036
1
4,518,062
null
1
1,629
I am making use of jQuery 1.4.4 and jQuery UI 1.8.7 in a legacy code base. I have added a few combobox() ui-widgets, these comboboxes live along side normal `<select>` dropdowns. I am finding it difficult to get the two elements to look the same, i.e. the unstyled `<select>` with it's Internet Explorer / Windows based style and the most basic jQuery UI Themed ui-widget combobox. The screenshot shows an unstyled `<select>` on the left and a jQuery ui-widget combobox on the right: ![alt text](https://i.stack.imgur.com/6NX6L.png) Is it possible to make the two look the same?
How do I style jQuery Combobox to look like a normal select dropdown
CC BY-SA 2.5
0
2010-12-23T10:48:31.087
2010-12-23T10:52:08.857
null
null
174,359
[ "jquery", "css", "jquery-ui" ]
4,518,050
1
4,518,204
null
2
155
Our buildserver compiles and runs testsuites for many different c++ programs. From time to time the programs are buggy, and can crash. When they crash, Windows7 will always throw this modal dialog: ![alt text](https://i.stack.imgur.com/4O46m.jpg) Which has to be clicked away by a human being, causing the buildserver to sit idle. Is there a way to at a system level prevent this from happening? I know I can do it from within the process itself, but I'd love to be able to do it across the entire system.
Prevent windows from presenting any dialog on native code unhandled exception
CC BY-SA 2.5
0
2010-12-23T10:51:00.657
2010-12-23T11:08:13.450
null
null
47,901
[ "c++", "windows" ]
4,518,175
1
4,520,613
null
7
414
This error is so weird I Just can't really figure out what is really wrong! In UserController I have ``` public virtual ActionResult Index() { var usersmdl = from u in RepositoryFactory.GetUserRepo().GetAll() select new UserViewModel { ID = u.ID, UserName = u.Username, UserGroupName = u.UserGroupMain.GroupName, BranchName = u.Branch.BranchName, Password = u.Password, Ace = u.ACE, CIF = u.CIF, PF = u.PF }; if (usersmdl != null) { return View(usersmdl.AsEnumerable()); } return View(); } ``` My view is of type `@model IEnumerable<UserViewModel>` on the top. This is what happens: ![alt text](https://i.stack.imgur.com/c0B6y.jpg) Where and what exactly IS null!? I create the users from a fake repository with . I also wrote unit tests, which pass, to ensure the right amount of mocked users are returned. Maybe someone can point me in the right direction here? Top of the stack trace is : ``` at lambda_method(Closure , User ) at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext() at ASP.Index_cshtml.Execute() ``` Is it something to do with linq here? Tell me If I should include the full stack trace. --- `<BangsHeadOnWall />` Wow, I cannot believe it was `u.UserGroupMain.GroupName` thanks . It was a mockup repo, and I had a unit test to check if the mock repo user had a mock of UserGroupMain but I didn't Assert if the wee property `GroupName` had been set! Thanks you're suggestion got the code to break in the controller itself. Plus I learnt something new. Thanks , first time I used the [immediate window](http://dotnetdud.blogspot.com/2007/12/visual-studio-immediate-window.html) wow its cool! =D Guess you live, code and learn!
odd nullreference error at foreach when rendering view
CC BY-SA 2.5
null
2010-12-23T11:04:21.347
2010-12-23T17:56:06.320
2010-12-23T17:56:06.320
368,070
368,070
[ "c#", "asp.net-mvc", "linq-to-entities", "moq", "asp.net-mvc-3" ]
4,518,195
1
4,518,551
null
1
1,807
how can I create class for JSON web service result? This is my JSON result which i get from google api. so, how to create class and deserialization for this JSON object. ![alt text](https://i.stack.imgur.com/e59gJ.png) I created class to deserialization this JSON object like this, ``` string mapdetail = e.Result; var djosn = new DataContractJsonSerializer(typeof(mapResult)); var mstr = new MemoryStream(Encoding.UTF8.GetBytes(mapdetail)); mapResult reslt = (mapResult)djosn.ReadObject(mstr); ``` mapResult class: ``` [DataContract] public class mapResult { [DataMember] public string status { get; set; } [DataMember] public IList<Resultdetail> result { get; set; } } ``` So i creadet list for result details and others: ``` [DataContract] public class Resultdetail { [DataMember] public List<string> types { get; set; } [DataMember] public string formatted_address { get; set; } [DataMember] public List<object> address_components { get; set; } [DataMember] public List<Geometry> geometry { get; set; } } [DataContract] public class Geometry { [DataMember] public List<GeoLocation> location { get; set; } [DataMember] public string location_type { get; set; } [DataMember] public List<object> viewport { get; set; } [DataMember] public List<object> bounds { get; set; } } [DataContract] public class GeoLocation { [DataMember] public double lat { get; set; } [DataMember] public double lng { get; set; } } ``` Now I'm getting Null reference; ![alt text](https://i.stack.imgur.com/pGpL1.png)
How to create class for JSON web service result in windows phone 7?
CC BY-SA 2.5
0
2010-12-23T11:06:51.757
2010-12-23T13:11:33.613
2010-12-23T11:16:15.693
1,755
504,130
[ "c#", "silverlight-3.0", "windows-phone-7" ]
4,518,459
1
4,524,346
null
0
1,190
Is there anyway to execute/run unix/linux executable on a mac (10.6)? Specifically, i'm trying to run this: [http://www.cs.ubc.ca/~kevinlb/CATS/](http://www.cs.ubc.ca/~kevinlb/CATS/) I have Xcode SDK/gcc/g++, but the source provided on this website is not compiling/executing on my mac (os x 10.6). That's where i need help. Thanking in anticipation. "make -j16" produces following results: ![Console Output - 1](https://i.stack.imgur.com/CSk9r.png) ![Console Output - 2](https://i.stack.imgur.com/uqLbo.png)
Compiling and running UNIX based code on Mac OSX
CC BY-SA 2.5
0
2010-12-23T11:47:36.220
2010-12-24T11:38:15.983
2010-12-24T06:57:13.787
49,739
49,739
[ "macos", "unix", "compilation", "executable" ]
4,518,678
1
4,520,262
null
4
3,209
![alt text](https://i.stack.imgur.com/Fa9C0.png) I used the following code to generate a form in attached image. Is it possible to change the size of the fields in the form. I want to decrease size of input field of Estimated time and the dropbox field to the right of it ``` {{=form.custom.begin}} <table> <table><tr> <td><b>Type :</b></td><td><div>{{=form.custom.widget.type}}</div></td> </tr><tr> <td><b>Title :</b></td><td><div>{{=form.custom.widget.title}}</div></td> </tr><tr> <td><b>Description :</b></td><td><div>{{=form.custom.widget.description}}</div></td> </tr><tr> <td><b>Estimated Time :</b></td><div'><td>{{=form.custom.widget.estimated_time}}{{=form.custom.widget.estimated_time_unit}}</td> </div> </tr> <tr> <td></td><td><div align='center'>{{=form.custom.submit}}</div></td> </tr> </table> {{=form.custom.end}} ```
customizing size of form fields created using field.custom.widget
CC BY-SA 3.0
0
2010-12-23T12:17:17.660
2014-10-24T04:55:14.557
2014-10-24T04:55:14.557
1,675,004
417,266
[ "forms", "web2py" ]
4,518,747
1
4,518,921
null
0
792
i try to write a kind of generic repository to add method. Everything is ok to add but I have table which is related with two tables with FOREIGN KEY.But Not working because of foreign key ![alt text](https://i.stack.imgur.com/3y2Az.png) ``` public class DomainRepository<TModel> : IDomainRepository<TModel> where TModel : class { private ObjectContext _context; private IObjectSet&#60;TModel&#62; _objectSet; public DomainRepository(ObjectContext context) { _context = context; _objectSet = _context.CreateObjectSet&#60;TModel&#62;(); } // do something... public TModel Add<TModel>(TModel entity) where TModel : IEntityWithKey { EntityKey key = _context.CreateEntityKey(entity.GetType().Name, entity); _context.AddObject(key.EntitySetName, entity); _context.SaveChanges(); return entity; } // do something... } ``` Calling Repository: ``` // insert-update-delete public partial class AddtoTables { public table3 Add(int TaskId, int RefAircraftsId) { using (DomainRepository<table3> repTask = new DomainRepository<table3>(new TaskEntities())) { return repTask.Add&#60;table3&#62;(new table3() { TaskId = TaskId, TaskRefAircraftsID = RefAircraftsId }); } } } ``` How to add a new value if this table includes foreign key relation? ![alt text](https://i.stack.imgur.com/a9Cj8.png)
How to add new value with generic Repository if there are foreign keys (EF-4)?
CC BY-SA 3.0
0
2010-12-23T12:27:23.423
2016-01-22T20:41:29.493
2016-01-22T20:41:29.493
3,618,581
52,420
[ "c#", "visual-studio-2010", "entity-framework-4", "generic-programming" ]
4,518,754
1
4,518,773
null
0
1,772
I am trying to create a table in my MS SQL database for Languages. I want to store an English name of Language and a local name of language in the database. i.e. English, English German, Deutsch Italian, Italiano Japanese, 日本語 ... ... I have 279 languages that I want to import, but when I import it shows '?????' for some like japanese, Russian and arabic etc The database Collation is Latin1_General_CI_AS. I would also like advise on multilingual websites; if i have a database of product descriptions and I want to have translation in multiple languages, should I go for separate databases or Can I have translation in one databse? (I prefer not to duplicate data!). Anything else to make sure users are able to write comments in different languages (char encoding on web?) and can be stored in database. ![Select language result](https://i.stack.imgur.com/ju9cy.jpg)
SQL Insert multilingual characters
CC BY-SA 2.5
null
2010-12-23T12:28:38.010
2010-12-23T14:28:27.560
2010-12-23T13:22:26.090
193,098
193,098
[ "asp.net", "sql", "localization", "globalization", "multilingual" ]
4,519,243
1
4,521,876
null
2
4,071
I hope that it is clear enough in the image, I have a triangle with shadow effect that doesn't look so good, seems to be broken somehow. Any help will be greatly appreciated. ( the rectangle and the path have to be separated) ![alt text](https://i.stack.imgur.com/XTppX.png) XAML: ``` <Grid Height="50" Width="60" > <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="20" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Rectangle Grid.Column="1" Stroke="Black" Fill="White"> <Rectangle.Effect> <DropShadowEffect Opacity="0.5" ShadowDepth="4" BlurRadius="10" /> </Rectangle.Effect> </Rectangle> <Path Fill="White" Stretch="Fill" Stroke="Black" HorizontalAlignment="Left" Margin="0,15,-1,15" Data="M44.386378,164.8791 L22.983157,171.42119 44.713478,176.58567" Width="23.167"> <Path.Effect> <DropShadowEffect BlurRadius="10" Opacity="0.5" ShadowDepth="4" /> </Path.Effect> </Path> </Grid> </Grid> ```
Path with broken shadow effect
CC BY-SA 2.5
null
2010-12-23T13:41:48.307
2010-12-23T19:34:37.157
2010-12-23T16:26:50.990
138,627
138,627
[ "wpf", "xaml", "path", "effects", "shadow" ]
4,519,619
1
4,519,705
null
1
548
with [Stackoverflow users help](https://stackoverflow.com/questions/4517602/jquery-fading-out-2-elements-when-1-has-been-clicked) I have now links, which fade out when clicked: ![alt text](https://i.stack.imgur.com/GtF4R.png) ``` <!DOCTYPE html> <html> <head> <style> a.toggle { color:#3E6D8E; background-color: #E0EAF1; border-bottom: 1px solid #3E6D8E; border-right: 1px solid #7F9FB6; padding: 3px 4px 3px 4px; margin: 2px 2px 2px 0; text-decoration: none; font-size: 90%; line-height: 2.4; white-space: nowrap; } a.toggle:hover { background-color: #e7540c; color: #E0EAF1; border-bottom: 1px solid #A33B08; border-right: 1px solid #A33B08; text-decoration: none; } a.filter { color:#3E6D8E; background-color: #E0EAF1; border-bottom: 1px solid #3E6D8E; border-right: 1px solid #7F9FB6; padding: 3px 4px 3px 4px; margin: 2px 2px 2px 0; text-decoration: none; font-size: 90%; line-height: 2.4; white-space: nowrap; } a.filter:hover { background-color: #3E6D8E; color: #E0EAF1; border-bottom: 1px solid #37607D; border-right: 1px solid #37607D; text-decoration: none; } </style> <script src="http://code.jquery.com/jquery-1.4.4.js"></script> <script> $(document).ready(function () { $('a.toggle').click(function () { $(this).prev().andSelf().fadeOut('fast'); }); }); </script> </head> <body> <p>Please click on <a class="filter" href="?filter=1">Tag 1</a><a class="toggle" href="/?toggle=2">X</a></p> <p>Please click on <a class="filter" href="?filter=2">Tag 2</a><a class="toggle" href="/?toggle=2">X</a></p> </body> </html> ``` But I have now the new problem, that when the "X" link has been clicked and it starts to fade out, then it can still be clicked again and this is bad for my script - because "X" shouldn't completely removes a "tag", but just move it under a hidden section as you can see in this screenshot. And then subsequent click should move it back: ![alt text](https://i.stack.imgur.com/gsElV.png) How could I prevent subsequent clicks please? I probably should call ? But what should be the new value here? Thank you! Alex
jQuery: clicked link should fade out, do not accept further clicks
CC BY-SA 2.5
null
2010-12-23T14:31:33.333
2010-12-23T14:39:20.793
2017-05-23T10:30:21.980
-1
165,071
[ "javascript", "jquery", "fade", "fadeout" ]
4,519,666
1
4,519,765
null
0
2,959
I'm using jQuery 1.4.4 with jQueryUI 1.8.7 to display a modal `dialog` box. I'm having a problem where IE8 renders a scrollbar and appears to ignore the `minHeight` and `height` options in all the many different combinations I've tried them in. In Chrome 8 and Firefox 3.6 my dialogue looks like: ![alt text](https://i.stack.imgur.com/0zgYO.jpg) In IE 8 it looks like: ![alt text](https://i.stack.imgur.com/9uJ6F.jpg) The markup and script looks like: ``` <a id="create" href="#">Create New Thing</a> <div id="dlg-create-thing" title="Create new thing?"> <form name="create-thing-form" id="dlg-create-thing-form"> <p style="text-align:left"> <span>Name: <input id="thingName" name="thingName" maxlength="12" size="30" /></span> <br /><br /> <b>Thing options:</b><br /><br /> <input type="radio" id="option1" name="theoptions" value="0" checked="checked" />Use this option<br /> <input type="radio" id="option1AndMem" name="theoptions" value="1" />Use this other option </p> </form> </div> <script type="text/javascript"> $(function () { $("#dlg-create-thing").dialog({ autoOpen: false, resizable: false, width: 500, modal: true, minHeight: 280, buttons: { "Create": function () { /* do stuff */ }, "Cancel": function () { /* do other stuff */} } }); $("body").delegate("a[id='create']", "click", function () { $("#dlg-create-thing").dialog('open'); return false; } ); }); </script> ``` How can I fix this (preferably in a nice browser agnostic way, but I'd settle for anything)?
IE8 ignores jQuery UI 'dialog' minHeight and height settings
CC BY-SA 2.5
0
2010-12-23T14:35:24.117
2010-12-23T14:47:35.147
null
null
419
[ "javascript", "jquery", "jquery-ui" ]
4,519,875
1
4,523,266
null
8
4,608
This is what I want: 1.) When I click my Expander button and it expands it should stretch down to the end of the Grid see sample image => ![alt text](https://i.stack.imgur.com/737oc.png) 2.) When I write more Text than space is available in the RichTextBox within the Expander ScrollBars must be visible and I should be able to scroll down. Putting a scrollviewer around the Expander content ain't hard but it does not help even with setting on "Auto" they never appear. Set the scrollviewer on "Visible" I can't scroll because the content of the Expander goes down endlessly. Thats my Sample code: ``` <Grid Margin="30,0,0,0"> <Grid.RowDefinitions> <RowDefinition Height="30" /> <RowDefinition Height="*" /> <RowDefinition Height="30" /> </Grid.RowDefinitions> <StackPanel Background="LightCoral" Orientation="Horizontal"> <TextBlock Grid.Column="0" Text="Incident type:" VerticalAlignment="Center" /> <ComboBox Grid.Column="1" IsEditable="True" Margin="0,7" Text="{Binding SelectedIncidentReport.IncidentType,Mode=TwoWay}" /> <TextBlock Grid.Column="0" Grid.Row="1" Text="Teachers name:" VerticalAlignment="Center" /> <TextBox Grid.Column="1" Grid.Row="1" Height="25" Text="{Binding SelectedIncidentReport.TeacherName,Mode=TwoWay}" /> <TextBlock Grid.Column="0" Grid.Row="2" Text="Tutor group:" VerticalAlignment="Center" /> <TextBox Grid.Column="1" Grid.Row="2" Margin="0,7" Text="{Binding SelectedIncidentReport.TutorGroup,Mode=TwoWay}" /> </StackPanel> <Grid Background="LightBlue" Grid.Row="1" > <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Expander Background="Purple" Grid.Row="0" Height="Auto" Header="Report details" IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource ExpanderToBooleanConverter}, ConverterParameter=1}"> <Controls:RichTextBox VerticalScrollBarVisibility="Auto" Text="{Binding SelectedIncidentReport.ReportDetails,UpdateSourceTrigger=LostFocus,IsAsync=True}" AcceptsReturn="True" AutoWordSelection="True" AllowDrop="False" SelectionBrush="#FFAC5BCB" HorizontalScrollBarVisibility="Auto" /> </Expander> <Expander Background="Red" Grid.Row="1" Header="Action taken" IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource ExpanderToBooleanConverter}, ConverterParameter=2}"> <Controls:RichTextBox VerticalScrollBarVisibility="Auto" Text="{Binding SelectedIncidentReport.ActionTaken,UpdateSourceTrigger=LostFocus,IsAsync=True}" AcceptsReturn="True" AutoWordSelection="True" AllowDrop="False" SelectionBrush="#FFAC5BCB" HorizontalScrollBarVisibility="Auto" /> </Expander> <Expander Background="Lavender" Grid.Row="2" Header="Further action" IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource ExpanderToBooleanConverter}, ConverterParameter=3}" > <Controls:RichTextBox VerticalScrollBarVisibility="Auto" Text="{Binding SelectedIncidentReport.FurtherAction,UpdateSourceTrigger=LostFocus,IsAsync=True}" AcceptsReturn="True" AutoWordSelection="True" AllowDrop="False" SelectionBrush="#FFAC5BCB" HorizontalScrollBarVisibility="Auto" /> </Expander> <Expander Background="YellowGreen" Grid.Row="3" Header="Home contact" IsExpanded="{Binding SelectedExpander, Mode=TwoWay, Converter={StaticResource ExpanderToBooleanConverter}, ConverterParameter=4}" > <Controls:RichTextBox VerticalScrollBarVisibility="Auto" Text="{Binding SelectedIncidentReport.HomeContact,UpdateSourceTrigger=LostFocus,IsAsync=True}" AcceptsReturn="True" AutoWordSelection="True" AllowDrop="False" SelectionBrush="#FFAC5BCB" HorizontalScrollBarVisibility="Auto" /> </Expander> </Grid> <Grid Background="LawnGreen" Grid.Row="2" > <Grid.ColumnDefinitions> <ColumnDefinition Width="100" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="Documents:" Grid.Column="0" /> <View:DocumentComboView DataContext="{Binding Path=SelectedIncidentReport.Documents}" Grid.Column="1" HorizontalAlignment="Stretch" /> </Grid> </Grid> ```
Scroll AND Stretch the content of an Expander
CC BY-SA 3.0
0
2010-12-23T14:59:34.660
2011-12-09T15:17:06.853
2011-12-09T15:17:06.853
546,730
320,460
[ "wpf", "scroll", "scrollviewer", "expander", "stretch" ]
4,520,058
1
null
null
2
2,106
I'm learning C on my own and as a exercise i have written a program but it does not work. The program is splitted into 3 parts. A header file, a main file for executing the program a file to define the functions. I'm not using all the functions yet but that shouldn't be the problem. Here is my header file, nothing special in it. ``` #ifndef EMPLOYEE_H #define EMPLOYEE_H struct Employee { char first[21]; char last[21]; char title[21]; int salary; }; struct Employee* createEmployee(char*, char*, char*, int); // Creates a struct Employee object on the heap. char* getfirstname (struct Employee*); char* getlastname (struct Employee*); char* gettitle (struct Employee*); int getsalary (struct Employee*); void setfirstname (struct Employee*, char*); void setlastname (struct Employee*, char*); void settitle (struct Employee*, char*); void setsalary (struct Employee*, int); void printEmployee(struct Employee*); #endif ``` In this file i define the functions and how they work: ``` #include "7.1.h" #include <stdio.h> #include <stdlib.h> #include <string.h> struct Employee* createEmployee(char* first, char* last, char* title, int salary) // Creates a struct Employee object on the heap. { struct Employee* p = (struct Employee*) malloc(sizeof(struct Employee)); if (p != NULL) { strcpy(p->first, first); strcpy(p->last, last); strcpy(p->title, title); p->salary = salary; } return p; } char* getfirstname (struct Employee* p) { if (p != NULL) return p ? p->first : ""; } char* getlastname (struct Employee* p) { if (p != NULL) return p ? p->last : ""; } char* gettitle (struct Employee* p) { if (p != NULL) return p ? p->title : ""; } int getsalary (struct Employee* p) { if (p != NULL) return p ? p->salary : 0; } void setfirstname (struct Employee* p, char* first) { if (p != NULL) strcpy(p->first, first); } void setlastname (struct Employee* p, char* last) { if (p != NULL) strcpy(p->last, last); } void settitle (struct Employee* p, char* title) { if (p != NULL) strcpy(p->title, title); } void setsalary (struct Employee* p, char* salary) { if (p != NULL) p->salary = salary; } void printEmployee(struct Employee* p) { if (p != NULL) { printf("%s, %s, %s, %d", p->first, p->last, p->salary, p->salary ); } } ``` And the last file is used to executed the program/functions: ``` #include "7.1.h" #include <stdio.h> #include <stdlib.h> int main () { char decision; struct Employee emp; struct Employee* emps[3]; for ( int i = 0; i < 1; i ++) { printf("Please type in the emplooyes data.\nFirstname:"); scanf("%s", emp.first); printf("Lastname:"); scanf("%s", emp.last); printf("Title:"); scanf("%s", emp.title); printf("Salary:"); scanf("%d", &emp.salary); emps[i] = createEmployee(emp.first, emp.last, emp.title, emp.salary); } printf("Do you want to print out your information? (Y/N):"); scanf("%c", &decision); if (decision == 'y' || decision == 'Y') { printEmployee(emps[1]); } } ``` I don't know what the problem is. I 'm always getting the following error message after typing in for the time. The error is written in german. It means: ![alt text](https://i.stack.imgur.com/N4zFl.jpg) I could fix the first problem with the hints given below. Now when i want to print out the employee data using the function:`printEmployee(emps[1]);`, I get the same kind of error with access violation.
Memory error, access violation
CC BY-SA 2.5
0
2010-12-23T15:25:43.117
2010-12-25T20:14:34.463
2010-12-25T20:14:34.463
483,859
483,859
[ "c" ]
4,520,127
1
4,520,161
null
3
906
I'd like to get some advice on database design. Specifically, consider the following (hypothetical) scenario: - - - ![alt text](https://i.stack.imgur.com/vUpn8.png) In this scenario, if an employee leaves the company I also want to make sure I delete them from the `Users` table so that they can no longer access the software. I can achieve this using `ON DELETE CASCADE` as part of the FK relationship between `EmployeeID` in `Employees` and `Users`. However, I don't want to delete their details from the `UserLog` as I am interested in collating data on how long people spend on the software and the fact that they no longer work at the company does not mean their user behaviour is no longer relevant. What I am left with is a table `UserLog` that has no relationships with any other tables in my database. Having looked through books etc / googled online I haven't come across any DB schemas with tables that have no relationships with others and so my gut instinct here is saying that my approach is not robust... I'd appreciate some guidance please.
Is it sensible to have a table that does not reference any other in a database design?
CC BY-SA 2.5
null
2010-12-23T15:34:10.543
2010-12-26T15:13:05.320
2010-12-26T15:13:05.320
235,442
235,442
[ "sql-server-2005", "database-design" ]
4,520,327
1
4,520,404
null
1
4,896
I have a problem with my connection tunneling. So I'm using two ubuntu server virtual machines where the oracle xe (port 1521) is installed, lets call them uvm1 and uvm2. My goal is to create two tunnels for both servers and to map the ports to the host machine and make the connection to both database systems accessable. The port mapping should look like: For tunnel creation I'm using putty on my windows machine: the configuration of putty for connection to the uvm1 looks like: ![](https://dl.dropbox.com/u/5511902/uvm1.png) And the configuration of putty for connection to the uvm2 looks like: ![](https://dl.dropbox.com/u/5511902/uvm2.png) I'm able to connect via ssh to both of the machines. The strage issue is that my tunneling for uvm1 works and for the uvm2 not. Do anyone know how can I fix this strange issue?! Cheers, Kevin
port forwarding with putty (tunneling)
CC BY-SA 2.5
null
2010-12-23T15:57:04.870
2010-12-23T16:03:16.123
2017-02-08T14:31:15.363
-1
498,407
[ "networking", "ssh", "putty", "tunneling" ]
4,520,629
1
4,520,713
null
2
120
I don't know why this is happening. I have [this code here](http://www.jsfiddle.net/Trufa/Yr6Dk/). It works fine but "sometimes" (and many times in a row) for no apparent reason, this happens: ![alt text](https://i.stack.imgur.com/Nu38w.png) To all the `.box` class. Sorry I have to share "all" my code but I have no idea why this is. This is what it should look like: ![alt text](https://i.stack.imgur.com/xlEnK.png) I don't know if this is usual but id you want, you can download the two files from [here](http://www.box.net/shared/b6i335rguy) (HTML and CSS + Images) because in jsfiddle seems to work all of the times, I don't know whether it matters or not but I'm using chrome (latest) on a mac. I seems to work fine in safari every time. Thanks in advance!! Please ask for any clarification needed! --- By the way my title is absolutely horrible, sorry! but I have no idea what the problem is so I can't really describe it, feel free to edit or comment any suggestion.
Weird bug in my CSS code making the text randomly get a huge "margin"
CC BY-SA 2.5
null
2010-12-23T16:32:58.997
2010-12-23T16:50:13.013
2010-12-23T16:46:28.790
463,065
463,065
[ "html", "css", "alignment", "margin" ]
4,520,865
1
null
null
2
1,485
Given set of points in 3D ( X = (x1, x2, x3), Y = (y1, y2, y3) ), how can I fit transformation from X to Y? As far as I know this is called projective transformation. Here is example of X and Y. Blue and red lines in X are parallel, but they are not parallel in Y. ![alt text](https://i.stack.imgur.com/P4JTG.png) ![alt text](https://i.stack.imgur.com/tAsqu.png)
Projective transformation fitting
CC BY-SA 2.5
0
2010-12-23T17:03:08.273
2011-09-15T14:23:01.703
2010-12-23T17:12:29.250
483,965
483,965
[ "algorithm", "math" ]
4,520,952
1
4,522,489
null
3
4,050
After numerically solving a differential equation and plotting the results I would like to determine the single maximum value in the plotted range but do not know how. The code below works for numerically solving the differential equation and plotting the results. ``` s = NDSolve[{x''[t] + x[t] - 0.167 x[t]^3 == 0.005 Cos[t + -0.0000977162*t^2/2], x[0] == 0, x'[0] == 0}, x, {t, 0, 1000}] Plot[Evaluate[x[t] /. s], {t, 0, 1000}, Frame -> {True, True, False, False}, FrameLabel -> {"t", "x"}, FrameStyle -> Directive[FontSize -> 15], Axes -> False] ``` ![Mathematica graphics](https://i.stack.imgur.com/65FDY.png)
Mathematica - Find Maximum value NDSolve Plot
CC BY-SA 3.0
0
2010-12-23T17:13:18.253
2012-01-02T22:51:11.560
2012-01-02T22:51:11.560
615,464
552,642
[ "wolfram-mathematica" ]
4,520,941
1
4,521,690
null
20
13,151
We wanted to use a UITabBar in our iPhone app, but with one exception: we have a "sync" button which I wanted to rotate while the sync operation is happening. ![alt text](https://i.stack.imgur.com/Hzz2j.png) Unfortunately this meant having to create a custom tab bar, but that's neither here nor there: the animation I implemented using Core Animation looks awesome. The problem is that while animating, it adversely affects the performance of everything else using animation on the screen: UITableView scrolling, MKMapView panning and pin drops, etc. My test device is an iPhone 4. The problem seems to be how I've implemented the tab bar - I wanted to achieve something very similar to UITabBar, where you just supply a PNG for the icon and it uses the alpha channel to create the normal and highlighted states by masking a background image. I accomplished this with CALayer's `mask` property: ``` // Inside a UIView subclass' init method... // Create the mask layer by settings its contents as our PNG icon. CALayer *maskLayer = [CALayer layer]; maskLayer.frame = CGRectMake(0, 0, 31, 31); maskLayer.contentsGravity = kCAGravityCenter; maskLayer.contentsScale = [[UIScreen mainScreen] scale]; maskLayer.rasterizationScale = [[UIScreen mainScreen] scale]; maskLayer.contents = (id)symbolImage.CGImage; maskLayer.shouldRasterize = YES; maskLayer.opaque = YES; fgLayer = [[CALayer layer] retain]; fgLayer.frame = self.layer.frame; fgLayer.backgroundColor = [UIColor colorWithImageNamed:@"tabbar-normal-bg.png"].CGColor; fgLayer.mask = maskLayer; // Apply the mask fgLayer.shouldRasterize = YES; fgLayer.opaque = YES; [self.layer addSublayer:fgLayer]; ``` (Note: in the screenshot above you can see I've also added a shadow layer, but for simplicity I removed that from the code. I remove the shadow layer from the sync icon when it is animating, so it shouldn't be relevant.) To animate, I simply rotate the mask layer: ``` - (void)startAnimating { CABasicAnimation* animation = [CABasicAnimation animationWithKeyPath: @"transform"]; CATransform3D transform = CATransform3DMakeRotation(RADIANS(179.9), 0.0, 0.0, 1.0); animation.toValue = [NSValue valueWithCATransform3D:transform]; animation.duration = 5; animation.repeatCount = 10000; animation.removedOnCompletion = YES; [fgLayer.mask addAnimation:animation forKey:@"rotate"]; // Add animation to the mask } ``` So this all works great except for performance. You can see I've already tried tips that turned up on Google about rasterizing layers / making them opaque - hasn't helped. I think I've identified the mask layer as being the culprit. When I take out the mask layer and just rotate the `fgLayer` instead of its mask, performance is wonderful, though it's certainly not the affect I'm going for: ![alt text](https://i.stack.imgur.com/dsbr4.png) Performance is also just as bad as before if I rotate the `fgLayer` instead of the mask the mask is applied. So if having to recomposite the mask each frame of the animation is the slow down, are there any other techniques I can use to achieve a similar affect that will have better performance? Using a path instead of an image for the mask layer? Or am I going to have to drop down to OpenGL or something to get good performance? further reinforcing the idea that the mask is the slowdown, my coworker suggested trying to rotate a CALayer with just the image as the contents -- so similar to my example above w/o a mask -- and performance was also good that way. So I can really only do a solid color like that (no gradient), but it may be a good interim solution. I'd still love to achieve rotating a mask with good performance though, so suggestions welcome :)
Core Animation CALayer mask animation performance
CC BY-SA 2.5
0
2010-12-23T17:12:26.367
2010-12-23T19:19:56.920
2010-12-23T17:42:45.647
24,848
24,848
[ "iphone", "objective-c", "ios", "core-animation", "calayer" ]
4,521,008
1
4,525,622
null
0
255
I have a problem with the core graphic of iPhone. Below is a drawing which demonstrate this problem: ![alt text](https://i.stack.imgur.com/a8B1T.png) There is a mask with a human shape, I'm put the mask upon an image, I'm doing (this is the part I need help with), I remove the mask, and finally the image became human-shape transparent.
Iphone core graphic, mask
CC BY-SA 3.0
null
2010-12-23T17:19:56.087
2017-09-24T15:20:24.703
2017-09-24T15:20:24.703
1,033,581
415,752
[ "iphone", "core-graphics" ]
4,521,800
1
4,521,857
null
0
125
![texbox](https://i.stack.imgur.com/0tjKs.gif) I'm using PHP to retrieve the data from a database. Every time I retrieve it from database it doesn't show the whole letters. It's being removed off after space??? I want like the first text box, show all the letters both code doesn't work ``` <input type="text" class="textinput" value=' . $r['newsletter_title'] . '> <input type="text" class="textinput" value=' . htmlspecialchars($r['newsletter_title']) . '> ``` I checked the database it's showing the whole letters "80% sale On Day" Does anyone knows what causes this? Any solution please!!!
Textbox doesn't show properly
CC BY-SA 3.0
null
2010-12-23T19:25:12.377
2017-03-26T13:33:46.863
2017-03-26T13:33:46.863
4,752,675
551,559
[ "php", "text", "textbox" ]
4,521,973
1
4,586,307
null
16
34,896
I'm trying to add an external icon from an *.ico file to a window that I'm creating using the WindowBuilder design window. I can select the shell, which brings up an "image" properties field. ![alt text](https://i.stack.imgur.com/zcY0X.png) That brings up the image chooser dialog box: ![alt text](https://i.stack.imgur.com/abOpe.png) How do I make my icon show up in this menu as a classpath resource? The image works if an absolute path is given, but I don't want to use that option in my application. Thanks!
How do I add an icon as a classpath resource to an SWT window created with WindowBuilder?
CC BY-SA 2.5
0
2010-12-23T19:49:52.093
2014-05-19T14:45:50.950
2010-12-27T21:19:00.173
446,746
446,746
[ "java", "eclipse", "swt", "classpath", "windowbuilder" ]
4,522,017
1
4,522,039
null
0
8,503
![alt text](https://i.stack.imgur.com/qaG7o.gif) ``` <input type="password" value="<?php echo md5($row['password']);?>"> <input type="password" value="<?php echo $row['password'];?>"> ``` im trying to retrive the password from the database. In input box, i want it show, let say password : 12345, instead of MD5 version of 12345.
php Password textbox!
CC BY-SA 2.5
0
2010-12-23T19:55:13.280
2010-12-23T20:20:17.463
2010-12-23T20:00:54.230
551,559
551,559
[ "php", "text", "textbox", "passwords" ]
4,522,108
1
4,578,563
null
4
514
On the Motorola Bravo, at the left bottom of a MapView, there is an ugly orange square rather than the google logo. I notice this not only on my app, but on say, Yelp -- see screen shot: ![alt text](https://i.stack.imgur.com/HOjeg.png) Has anyone else seen this, and is there a workaround? I don't know if it happens on other motorola phones, but I'm guessing it does because there is another, similar problem with a missing image on google maps, which is easy enough to solve and [documented elsewhere](http://dimitar.me/applications-that-use-the-mylocationoverlay-class-crash-on-the-new-droid-x/) as being on Droid phones as well.
google maps glitch on motorola phones
CC BY-SA 2.5
0
2010-12-23T20:09:24.077
2011-01-03T01:55:05.597
null
null
226,507
[ "android", "google-maps" ]
4,522,325
1
4,522,359
null
4
3,328
I installed iOS 4.2 on my 2nd-generation iPod Touch last week. I tried running my application on the device through Xcode, but it didn't work (because Xcode didn't yet support iOS 4). To solve that, I installed Xcode 3.2.5 and the iOS SDK 4.2. Now I can get the app to run in the iPhone/iPad Simulator just fine. However, I can no longer select "Device" from the menu at the top of the screen. It's a choice, but when I try to click on it, it never actually gets a check mark. ![Can't select Device from the XCode menu](https://i.stack.imgur.com/bVC0z.png) Because of this, I can no longer run the app on my iPod. The other (related) problem is that I can't choose "Build and Archive" from the Build menu anymore because the target is not a device. Why is this happening? Do I need to change some settings in my project, or something with my device itself? Upon closer investigation, it appears that I can't select anything but the iPhone Simulator 4.0. Maybe there's something wrong with the project file.
Can't run on device after installing iOS 4.2 and the 4.2 SDK
CC BY-SA 2.5
0
2010-12-23T20:41:41.187
2011-01-03T10:47:50.477
2011-01-03T10:47:50.477
433,794
191,521
[ "xcode", "ios", "ios4", "ios-4.2" ]
4,522,410
1
4,522,915
null
3
555
How is it possible to dynamically fill a container? Let's say to fill a big circle with small circles, recursively. Just fill the space fine. I would like to use it for data hierarchy display. To make it clear: ![alt text](https://i.stack.imgur.com/EulAG.png)
WPF - Dynamically rearrange control hierarchy
CC BY-SA 2.5
0
2010-12-23T20:56:25.900
2010-12-23T22:27:02.220
2010-12-23T21:17:11.037
72,563
72,563
[ "c#", "wpf", "wpf-controls", "graph-algorithm" ]
4,522,697
1
4,522,779
null
0
163
Using the Entity Framework 4. I have created a Code First database in the past and a piece of code needs to delete and add 16 objects, this takes 6 seconds each. That's 300+ ms for each query! The deletes/adds occur in a `foreach` scope and there is a `SaveChanges()` outside the `foreach`. ![alt text](https://i.stack.imgur.com/o6t1N.png) In the above image you see that each takes 6 seconds, which is 34% of the time, for 16 calls. That doesn't sound normal to me... If there is no solution: Are there any workarounds I can use? It would be a pain to rewrite my project...
Why do a small amount of add/deletes take several seconds in EF4?
CC BY-SA 2.5
null
2010-12-23T21:49:14.703
2010-12-23T22:03:05.780
null
null
47,064
[ "c#", "performance", "entity-framework-4", "code-first" ]
4,522,773
1
4,522,833
null
0
500
I've been skipping math classes, and now I have problems. :) Can you please explain to me how I should write this expression in Javascript? ![sin-1](https://i.stack.imgur.com/zctrr.gif) Big thanks! :)
How to represent sinh-1(a) in script?
CC BY-SA 2.5
null
2010-12-23T22:02:22.907
2010-12-23T22:13:16.003
null
null
83,910
[ "javascript", "math", "trigonometry" ]
4,522,770
1
null
null
4
4,179
CTEs are a bit new to me so I am hoping someone can help with the following one which I wrote that will take a category table and build a hierarchy out of it for display. I know this kind of thing is asked all the time, but I think my situation with the sorting makes it a bit unique. I would expect a number of suggestions to use HierarchyID, but sadly that is not an option for a long list of reasons that are not relevant here. The solution I have come up with though works and gives me the data I expect, but I am wondering if there is a better/more elegant way of accomplishing this. The basic requirements are as follows: 1. Categories can have an unlimited number of children 2. Categories can be an unlimited number of levels deep 3. Categories with the same parent will be sorted based on a "sort" field. If one is not specified (default is 0) or is the same as another sibling category, it will sorted alphabetically. Table Definition: ``` CREATE TABLE [dbo].[TreeTest] ( [id] [int] NOT NULL, [parent] [int] NULL, [title] [varchar](50) NOT NULL, [sort] [int] NOT NULL ) GO ALTER TABLE [dbo].[TreeTest] ADD CONSTRAINT [DF_TreeTest_sort] DEFAULT ((0)) FOR [sort] GO ``` Insert statements: ``` INSERT TreeTest(id,parent,title,sort) VALUES('1',NULL,'Parent 1','0') INSERT TreeTest(id,parent,title,sort) VALUES('2',NULL,'Parent 2','0') INSERT TreeTest(id,parent,title,sort) VALUES('3',NULL,'Parent 3','2') INSERT TreeTest(id,parent,title,sort) VALUES('4',NULL,'Parent 4','1') INSERT TreeTest(id,parent,title,sort) VALUES('5','1','Child 1a','0') INSERT TreeTest(id,parent,title,sort) VALUES('6','2','Child 2a','0') INSERT TreeTest(id,parent,title,sort) VALUES('7','3','Child 3a','0') INSERT TreeTest(id,parent,title,sort) VALUES('8','1','Child 1b','1') INSERT TreeTest(id,parent,title,sort) VALUES('9','1','Child 1c','2') INSERT TreeTest(id,parent,title,sort) VALUES('10','1','Child 1d','1') INSERT TreeTest(id,parent,title,sort) VALUES('11','6','Child 2a 1','0') INSERT TreeTest(id,parent,title,sort) VALUES('12','6','Child 2a 2','1') INSERT TreeTest(id,parent,title,sort) VALUES('13','6','Child 2a 3','0') INSERT TreeTest(id,parent,title,sort) VALUES('14','6','Child 2a 4','2') ``` CTE: ``` WITH TreeList (id, parent, title, sort, title_path, level_id, level_id_path) as ( SELECT p.id, p.parent, p.title, p.sort, CONVERT(nvarchar(max), p.title), ROW_NUMBER() OVER(PARTITION BY parent ORDER BY p.sort, p.title), CAST(ROW_NUMBER() OVER(PARTITION BY parent ORDER BY p.sort) AS varchar(max)) FROM TreeTest p WHERE p.parent is null UNION ALL SELECT c.id, c.parent, c.title, c.sort, r.title_path + '/' + c.title, ROW_NUMBER() OVER(PARTITION BY c.parent ORDER BY c.sort, c.title), CONVERT(varchar(max), r.level_id_path + '.' + CAST(ROW_NUMBER() OVER(PARTITION BY c.parent ORDER BY c.sort, c.title) AS VARCHAR)) FROM TreeTest AS c INNER JOIN treelist AS r ON c.parent = r.id ) SELECT * FROM TreeList ORDER BY level_id_path ``` Output (I figured an image was the easiest way to show the output) ![output](https://i.stack.imgur.com/brAu6.png) Again, this works according to the specifications I have, but I'm not sure about the efficiency and whether or not there is a better way to do this. When I look at the execution plan for this, it seems like the most expensive piece is the sorting/index scanning, but this seems expected given the lack of indexes in this example. If anyone has any input it would be greatly appreciated.
Hierarchical CTE with additional sort column per level
CC BY-SA 2.5
0
2010-12-23T22:01:48.557
2013-06-03T12:01:31.057
2010-12-23T22:24:16.853
149,917
149,917
[ "sql", "path", "hierarchy", "common-table-expression" ]
4,522,806
1
4,522,923
null
4
341
I'm working on a custom control for Silverlight 4 in VS2010 and Expression Blend 4. Early on I was using generic.xaml with no problems and was actually able to see a preview of the styles I was playing with inside Blend. But as I added complexity I suddenly started getting this error whenever I open generic.xaml in Blend and so far I've been unable to find the culprit... ![alt text](https://i.stack.imgur.com/0xPjh.png) Strangely, the project still builds and the styles work as expected. So I can in fact make design changes by changing generic.xaml and rebuilding. But I'd hope to fix this problem so I can make modifications within Blend more easily. Any ideas?
How to diagnose a vague XamlParseException in Blend?
CC BY-SA 2.5
0
2010-12-23T22:08:00.740
2010-12-23T22:46:18.957
2010-12-23T22:13:56.917
102,896
102,896
[ "silverlight", "custom-controls", "expression-blend" ]
4,523,045
1
4,530,265
null
0
1,842
I want to make a custom design for my magento store like this : ![alt text](https://i.stack.imgur.com/SyBfh.jpg) How can I proceed to do that, specially for the products from category1 and category2, I want there a new header for this list, with a little images, not like the standard category grid... Thanks a lot for help;
Magento design - new homepage columns
CC BY-SA 2.5
0
2010-12-23T22:52:42.783
2010-12-29T11:58:33.450
2010-12-29T11:58:33.450
471,559
536,116
[ "templates", "layout", "magento", "magento-1.4" ]
4,523,057
1
4,523,096
null
2
140
I have problem with floating in IE6. The HTML code: ``` <div id="stran"> <img src="../Slike/prejsnja.png" alt="Prejšnja" onclick="prejsnja();" onmouseover="this.style.cursor='pointer';" id="prejsnja" /> STRAN <?php dobiStran(); ?> <img src="../Slike/naslednja.png" alt="Naslednja" onclick="naslednja();" onmouseover="this.style.cursor='pointer';" id="naslednja" /> </div> ``` CSS: ``` #prejsnja { float: left; } #naslednja { float: right; } #stran { position: relative; width: 400px; border: 2px black solid; margin: 0 auto; font-family: "Comic Sans MS"; /*Izberemo drugo pisavo, kot pa tista ki je definirana v body.*/ color: #599cd4; text-align: center; /*Postavimo na center.*/ font-size: 30px; /*Vecja pisava, ker gre za naslov.*/ } ``` The left image floats to the left, as it should, the text is centered, the right image also floats to the right as it should, but has for some reason some kind of margin-top, that only appears in IE6. Here is example in other browsers: ![alt text](https://i.stack.imgur.com/F8nOo.png) And in IE6: ![alt text](https://i.stack.imgur.com/qiW4e.png)
Problem with float and IE6
CC BY-SA 2.5
null
2010-12-23T22:56:54.337
2010-12-24T23:11:37.380
2010-12-24T23:11:37.380
535,661
535,661
[ "html", "css", "internet-explorer-6" ]
4,523,127
1
null
null
1
3,605
I'd like to know if there's any way to send data to the server for the selected rows using the checkboxes I've put on those rows? I mean , how can I send only the data of those selected rows to the server? ![alt text](https://i.stack.imgur.com/G8huE.jpg) Here's the html code I use: ``` <table> <thead> <tr class="tableheader"> <td width="10%"></td> <td width="30%">Vehicle</td> <td width="40%">Driver</td> <td width="10%">Mileage</td> </tr> </thead> <tbody> <c:forEach items="${list}" var="item"> <tr> <td align="center"> <input type="checkbox" name="selectedItems" value="c:out value="${item.numberPlate}"/>"/> </td> <td align="left"><c:out value="${item.numberPlate}"/></td> <td align="left"><c:out value="${item.driver.fullName}" /></td> <td align="left"><input type="text" name="mileage" value="" /></td> </tr> </c:forEach> </tbody> </table> ``` I really hope you can give some guidance on this. Thanks in beforehand.
How to pass data from selected rows using checkboxes from JSP to the server
CC BY-SA 2.5
0
2010-12-23T23:11:17.910
2010-12-24T01:05:57.337
2010-12-24T01:05:57.337
530,911
530,911
[ "java", "html", "jsp" ]
4,523,328
1
4,523,601
null
1
2,444
Here is my XML layout: ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> </ListView> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_alignParentBottom="true"> <EditText xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1" /> <Button xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="2" /> </LinearLayout> </RelativeLayout> ``` Which causes this problem: ![The problem](https://i.stack.imgur.com/kXKX9.png) The listview item (outlined in red) is behind the fixed footer and cannot be used. Any solutions? I would prefer to be pointed out the changes in my code to fix that problem and then some sort of explanation. But that's just my preference.
Fixed footer not displaying the bottom-most list item
CC BY-SA 2.5
null
2010-12-23T23:52:32.820
2012-07-14T18:21:16.820
2010-12-24T00:15:30.580
200,477
200,477
[ "android", "xml", "listview", "footer" ]
4,523,609
1
4,536,955
null
63
52,082
I'm trying to create a screen with both text and images. I want the images to be laid out like a grid, as shown below, but I want them to have no scroll functionality other that the one provided by the surrounding ScrollView. An image will best illustrate my question: ![alt text](https://i.stack.imgur.com/RaW7R.png) ``` <ScrollView> <LinearLayout> <ImageView /> <TextView /> <GridView /> <TextView /> </LinearLayout> </ScrollView> ``` What is the best way to make show a grid of a varying number of images, where the grid does not have scroll functionality? Please note that disabling the scroll functionality for the GridView does not work, as this just disables the scrollbars but does not show all items. Update: The image below shows what it looks like with scrollbars disabled in the GridView. ![alt text](https://i.stack.imgur.com/shsDH.png)
Grid of images inside ScrollView
CC BY-SA 2.5
0
2010-12-24T01:03:54.730
2022-12-26T23:29:37.807
2010-12-24T08:15:59.747
340,145
340,145
[ "android", "user-interface", "gridview", "imageview", "scrollview" ]
4,523,892
1
null
null
3
801
## Willing to award a +500 bounty for a working example. The YouTube interface for iPad is pretty interesting, the grid of videos. eBay on iPad has a similar type of grid interface. I am interested in knowing what that style is called? Are there any example projects that demonstrate how to achieve this, or is it pretty simple to write? ![alt text](https://i.stack.imgur.com/ZFMDd.png) or ![alt text](https://i.stack.imgur.com/NdVqq.png) Also, what other apps out there for iPad have this type of interface?
How to create a YouTube or eBay style interface for iPad?
CC BY-SA 2.5
0
2010-12-24T02:45:24.490
2011-02-02T22:50:48.277
2011-02-02T22:50:48.277
171,206
171,206
[ "ipad", "ios", "uitableview", "uiscrollview", "grid" ]
4,524,072
1
4,524,088
null
2
1,850
How can I go about adding a separator in between treeview nodes? uTorrent manages to do this but I can't find any documentation. ![alt text](https://i.stack.imgur.com/nwxPF.png)
C# - Add Separator to TreeView
CC BY-SA 3.0
null
2010-12-24T03:49:55.810
2013-12-18T10:11:11.963
2013-12-18T10:11:11.963
759,866
141,831
[ "c#", ".net", "winforms", "treeview" ]
4,524,124
1
4,525,467
null
2
4,109
What I'm trying to do is this: ![alt text](https://i.stack.imgur.com/hPkhB.png) In text form: ``` XXX Some text here YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY ZZZZZZZZZ Body body body Sidebar! Body body body Sidebar! Body body body Sidebar! ``` X, Y, and Z are images (3 images total). Y can stretch along the X axis, and does so above, to fill the available space. (But doesn't cause "Some text here" to get squished and start breaking into multiple lines) I'd like to keep the "Some text here" part in one line. A line breaking here will not end happily. Is this possible, or should I simplify the layout around HTML? --- My current attempt using tables: ``` <table cellspacing="0" cellpadding="0" border="0" style="height: 20px; width: 100%;"> <tr> <td style="width: 205px; height: 20px; background: url('images/horz_bar_left_end.png');">&nbsp;</td> <td style="width: 5px; height: 20px; background: url('images/transparent.gif');"/>&nbsp;</td> <td valign="center" style="height: 20px; white-space: nowrap; font-weight: bold;">THIS IS A TITLE</td> <td style="width: 5px; height: 20px; background: url('images/transparent.gif');">&nbsp;</td> <td style="width: 100%; background: url('images/blue.gif');">&nbsp;</td> <td style="width: 190px; height: 20px; background: url('images/horz_bar_right_upper.png');">&nbsp;</td> </tr> </table> ``` Close... ish. of the columns (except the one with the text, and the `width: 100%` one) are ignoring their CSS width attribute in both Firefox and Chrome. This is what it looks like: ![alt text](https://i.stack.imgur.com/RtLuD.png) My attempt using `<div>` and all that CSS jazz. ``` <div style="white-space: nowrap;"> <div style="float:left; width: 25px; height: 20px; background: url('images/horz_bar_left_end2.png');">&nbsp;</div> <div style="float:left;">Some Text</div> <div style="float:left; width: 100%; height: 20px; background: url('images/blue.gif') repeat;">&nbsp;</div> <div style="float:left; width: 190px; height: 20px; background: url('images/horz_bar_right_upper.png');">&nbsp;</div> <div style="clear: both;"></div> <div style="float:left; width: 500px;"> body </div> <div style="float:left; width: 100px;"> sidebar </div> </div> ``` ...massively fails. It's on like three lines. For those wanting to play at home, here are the images: - ![alt text](https://i.stack.imgur.com/nf2iu.png)- ![alt text](https://i.stack.imgur.com/tAtUb.png)- -
HTML: Fill available width
CC BY-SA 2.5
0
2010-12-24T04:04:19.727
2010-12-25T06:42:08.763
2010-12-24T19:18:25.080
101,999
101,999
[ "html", "css" ]
4,524,176
1
4,524,442
null
1
3,589
I've been doing some cross browser testing for a webpage I'm working on for a client, and things are going pretty smoothly so far. However, I'm noticing a lot of white space showing up only in IE8 at the bottom of my #main div. I've tried removing the padding at the bottom of the div using an IE8-specific stylesheet, but it's not removing the gap. Developer toolbar shows that the style is being applied, and before trying the IE8-specific sheet, I removed the padding via the developer toolbar and it worked fine, but once applying the actual style it doesn't. I'm not seeing this bug in any other browser, and so far I've tested with: Firefox (OS X/Win XP), Safari (OS X/ Win XP), Chrome (OS X/Win XP), Internet Explorer 7, and Internet Explorer 8. I've also tried negative margins, and just moving the boxes down so there's less of a gap on both sides. Neither seem to move the boxes at all. So, its a bit confusing. Here's a pic of it in IE 8: ![alt text](https://i.stack.imgur.com/Fe4E6.jpg) And here's how it shows up in any other browser (this screenshot is from IE 7): ![alt text](https://i.stack.imgur.com/s0Vms.jpg) The site can be browsed live [here](http://www.savagefreelance.com/fuel_tank/). Any help is greatly appreciated!
Extra White Space Appearing Only On IE8
CC BY-SA 2.5
0
2010-12-24T04:14:44.583
2010-12-24T05:36:10.387
null
null
290,844
[ "css", "internet-explorer-8", "whitespace", "padding" ]
4,524,222
1
4,524,273
null
0
158
i am working on a categorization service. I want the experience to behave similarly to Facebook's invite/tagging function Does anyone have any experience implementing this? This includes: - - Would be super happy to hear any experiences, plugins that might be useful in helping me build this out ![alt text](https://i.stack.imgur.com/ZZcnL.png) ![alt text](https://i.stack.imgur.com/Y3YF6.png) ![alt text](https://i.stack.imgur.com/gC0qT.png)
Facebook-like invitation page for my categorization service
CC BY-SA 2.5
0
2010-12-24T04:32:41.360
2010-12-24T04:50:52.420
null
null
180,663
[ "javascript", "jquery", "html", "ruby-on-rails", "user-interface" ]
4,524,308
1
4,524,393
null
1
137
My guess is I am missing something very basic and obvious which some one can point out to me. The below screen capture of a short command-line session shows the following: I can see the `pysal` directory exists in the `sys.path` yet I get an ImportError when I try to `import pysal`? ![alt text](https://i.stack.imgur.com/Px7es.png)
I can see the directory in the python sys.path yet I get an error when I try to import the library?
CC BY-SA 2.5
null
2010-12-24T05:00:24.977
2010-12-24T05:21:29.203
null
null
290,150
[ "python", "windows", "import", "path" ]
4,524,365
1
4,524,395
null
4
1,342
![alt text](https://i.stack.imgur.com/cOXXF.png) See the image groups A and B. You can easily find the difference. Group A has a smoother RED line whereas Group B has RED line but it is not smoother. My problem is, I want to make red line smoother in Group B. Which algorithm will help me? Or suggest me best algorithm for make that line smoother
Line Smooth Algorithm
CC BY-SA 2.5
0
2010-12-24T05:14:47.347
2010-12-24T05:39:06.697
null
null
468,968
[ "algorithm" ]
4,524,322
1
4,534,974
null
1
1,803
I have a problem with a list view and a custom cursor adapter and I just can't seem to figure out what is wrong with my code. Basically, in my activity I call initalize() that does a bunch of stuff to handle getting the proper data and initializing the listview. On first run of the activity you can see from the images that one of the items is missing from the list. If I go to another activity and go back to this activity the item that was missing shows up. I believe it has something to do with setContentView(R.layout.parent). If I move that to my initialize() then the item never shows up even when returning from another activity. So, for some reason, returning from another activity bypasses setContentView(R.layout.parent) and everything works fine. I know it's impossible for me to bypass setContentView(R.layout.parent) so I need to figure out what the problem is. Also, I did not include the layout because it is nothing more then two textviews. Also, the images I have attached do not show that the missing item is the last one on the list.![alt text](https://i.stack.imgur.com/74vs1.png)![alt text](https://i.stack.imgur.com/Ss47O.png) Custom Cursor Adapter: ``` public class CustomCursorAdapter extends SimpleCursorAdapter { private Context context; private int layout; public CustomCursorAdapter (Context context, int layout, Cursor c, String[] from, int[] to) { super(context, layout, c, from, to); this.context = context; this.layout = layout; } public View newView(Context context, Cursor cursor, ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(context); final View view = inflater.inflate(layout, parent, false); return view; } @Override public void bindView(View v, Context context, Cursor c) { if (c.getColumnName(0).matches("section")){ int nameCol = c.getColumnIndex("section"); String section = c.getString(nameCol); TextView section_text = (TextView) v.findViewById(R.id.text1); if ((section.length() > 0)) { section_text.setText(section); } else { //so we don't have an empty spot section_text.setText(""); section_text.setVisibility(2); section_text.setHeight(1); } } else if (c.getColumnName(0).matches("code")) { int nameCol = c.getColumnIndex("code"); String mCode = c.getString(nameCol); TextView code_text = (TextView) v.findViewById(R.id.text1); if (code_text != null) { int i = 167; byte[] data = {(byte) i}; String strSymbol = EncodingUtils.getString(data, "windows-1252"); mCode = strSymbol + " " + mCode; code_text.setText(mCode); code_text.setSingleLine(); } } if (c.getColumnName(1).matches("title")){ int nameCol = c.getColumnIndex("title"); String mTitle = c.getString(nameCol); TextView title_text = (TextView) v.findViewById(R.id.text2); if (title_text != null) { title_text.setText(mTitle); } } else if (c.getColumnName(1).matches("excerpt")) { int nameCol = c.getColumnIndex("excerpt"); String mExcerpt = c.getString(nameCol); TextView excerpt_text = (TextView) v.findViewById(R.id.text2); if (excerpt_text != null) { excerpt_text.setText(mExcerpt); excerpt_text.setSingleLine(); } } } ``` The Activity: ``` public class parent extends ListActivity { private static String[] TITLE_FROM = { SECTION, TITLE, _ID, }; private static String[] CODE_FROM = { CODE, EXCERPT, _ID, }; private static String ORDER_BY = _ID + " ASC"; private static int[] TO = { R.id.text1, R.id.text2, }; String breadcrumb = null; private MyData data; private SQLiteDatabase db; CharSequence parent_id = ""; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); data = new MyData(this); db = data.getReadableDatabase(); setContentView(R.layout.parent); initialize(); } public void initialize() { breadcrumb = null; Bundle bun = getIntent().getExtras(); TextView tvBreadCrumb; tvBreadCrumb = (TextView)findViewById(R.id.breadcrumb); if (bun == null) { //this is the first run tvBreadCrumb.setText(null); tvBreadCrumb.setHeight(0); parent_id = "0"; try { Cursor cursor = getData(parent_id); showSectionData(cursor); } finally { data.close(); } } else { CharSequence state = bun.getString("state"); breadcrumb = bun.getString("breadcrumb"); tvBreadCrumb.setText(breadcrumb); CharSequence code = bun.getString("code"); parent_id = code; if (state.equals("chapter")) { try { Cursor cursor = getData(parent_id); showSectionData(cursor); } finally { data.close(); } } else if (state.equals("code")) { try { Cursor cursor = getCodeData(parent_id); showCodeData(cursor); } finally { data.close(); } } } } @Override public void onStart() { //initialize(); super.onResume(); } @Override public void onResume() { initialize(); super.onResume(); } private Cursor getData(CharSequence parent_id) { Cursor cTitles = db.query(TITLES_TABLE_NAME, TITLE_FROM, "parent_id = " + parent_id, null, null, null, ORDER_BY); Cursor cCodes = db.query(CODES_TABLE_NAME, CODE_FROM, "parent_id = " + parent_id, null, null, null, ORDER_BY); Cursor[] c = {cTitles, cCodes}; Cursor cursor = new MergeCursor(c); startManagingCursor(cursor); return cursor; } private Cursor getCodeData(CharSequence parent_id2) { Bundle bun = getIntent().getExtras(); CharSequence intent = bun.getString("intent"); CharSequence searchtype = bun.getString("searchtype"); //SQLiteDatabase db = data.getReadableDatabase(); if (intent != null) { String sWhere = null; if(searchtype.equals("code")) { sWhere = "code LIKE '%"+parent_id2+"%'"; } else if(searchtype.equals("within")){ sWhere = "definition LIKE '%"+parent_id2+"%'"; } //This is a search request Cursor cursor = db.query(CODES_TABLE_NAME, CODE_FROM, sWhere, null, null, null, ORDER_BY); startManagingCursor(cursor); return cursor; } else { Cursor cursor = db.query(CODES_TABLE_NAME, CODE_FROM, "parent_id = "+ parent_id2, null, null, null, ORDER_BY); startManagingCursor(cursor); return cursor; } } private void showSectionData(Cursor cursor) { CustomCursorAdapter adapter= new CustomCursorAdapter(this, R.layout.item, cursor, TITLE_FROM, TO); setListAdapter(adapter); } private void showCodeData(Cursor cursor) { CustomCursorAdapter adapter = new CustomCursorAdapter(this, R.layout.item, cursor, CODE_FROM, TO); setListAdapter(adapter); Bundle bun = getIntent().getExtras(); CharSequence intent = bun.getString("intent"); if (intent != null) { Cursor cursor1 = ((CursorAdapter)getListAdapter()).getCursor(); startManagingCursor(cursor1); TextView tvBreadCrumb; tvBreadCrumb = (TextView)findViewById(R.id.breadcrumb); tvBreadCrumb.setText(cursor1.getCount() + " Records Found"); //cursor1.close(); //mdl } } ```
Android strange behavior with listview and custom cursor adapter
CC BY-SA 2.5
null
2010-12-24T05:04:36.340
2010-12-26T18:47:02.753
2010-12-24T08:01:56.963
485,438
485,438
[ "android", "listview", "cursor" ]
4,524,562
1
4,524,745
null
1
1,550
i want to set image view in bottom. if possible how to set? this is for my xml file: ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="match_parent"> <VideoView android:id="@+id/VideoView01" android:layout_width="wrap_content" android:layout_height="500dip" android:layout_centerVertical="true"/> <Button android:text="Back" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"> </Button> </RelativeLayout> ``` and this is for my emulator screen: ![alt text](https://i.stack.imgur.com/tc3yD.png) now my videos play in this emulator...at the same time i want to set imageview in this bottom.... ![alt text](https://i.stack.imgur.com/WH2ZR.png)
how to set imageview in bottom
CC BY-SA 2.5
null
2010-12-24T06:11:42.503
2010-12-27T08:36:50.487
2010-12-27T08:36:50.487
486,554
486,554
[ "java", "android", "video", "imageview" ]
4,524,752
1
4,525,030
null
112
158,899
I'm using Eclipse to develop applications for android, and I want to integrate Admob to make money. The tutorial says I should watch the LogCat to find ID, but where is it? ![alt text](https://i.stack.imgur.com/hAF2V.png) When I run in either the test mode or the real mode, sometimes the eclipse will notify that Ads returned, yet it does not show in the emu... can anyone explain?
How can I get device ID for Admob
CC BY-SA 2.5
0
2010-12-24T06:58:19.340
2022-12-26T00:54:00.170
null
null
552,319
[ "android", "eclipse", "admob" ]
4,524,770
1
null
null
0
793
After the view is loaded, I changed the orientation to Landscape. There, I see a blue strip and the view is moved down. When I go to other tabs and come back, it is working fine. Can anyone help me with this? I have done this to autosize the view: ``` -viewDidLoad: { self.view.autoresizingMask =( UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleRightMargin); self.view.autoresizesSubviews; [super viewDidLoad]; } -shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } ``` Here is a screenshot: ![alt text](https://i.stack.imgur.com/7OGlJ.png)
Why is view autoresizing not working for the first time orientation?
CC BY-SA 2.5
null
2010-12-24T07:04:11.310
2010-12-30T16:54:57.880
2010-12-30T15:53:57.423
19,679
548,616
[ "iphone", "autoresize", "uiinterfaceorientation" ]
4,525,115
1
null
null
0
900
ok so Im new to mvc. What Im making is a -create user form-. The UserViewModel has a branchcode property of type `long`. I want a small branch selector, where instead of a plain textbox for the code I have a textbox and a link, when clicked would return the name of the branch with some ajax. So I made a branch selector and put it under Shared/EditorTemplates. Looks like this ``` @model long <div class="editor-label"> Branch ID: @Html.TextBoxFor(model => model) @Ajax.ActionLink("Get Branch Name", MVC.Admin.Home.BranchDetail(Model), new AjaxOptions { UpdateTargetId = "BranchName", LoadingElementId = "loading" }) <p id="loading" style="display: none"> Loading... </p> </div> <div id="BranchName" class="editor-field"> </div> ``` I have the UIHint setup in the viewmodel so when I say EditFor(model.BranchName) it shows up perfectly like this: ![alt text](https://i.stack.imgur.com/tpvAa.jpg) My problems: There is When I click it goes the the url : [http://localhost:1159/Admin/Home/BranchDetail?brcd=0](http://localhost:1159/Admin/Home/BranchDetail?brcd=0) And then the URL throws an error because there is no BranchDetailsView anywhere. This is what the controller looks like: ``` public virtual ActionResult BranchDetail(long brcd) { if (Request.IsAjaxRequest()) { //code to find branch if (br == null) { return Content("No Branch Found"); } else { return Content(br.BranchName + "Circle: " + br.Circle); } } return View();//we should not be here. } ``` Another problem is, how do I get the AjaxLink to return what code what typed. If you notice the screenie, the url to the link has `brcd=0`. I want to send over the branch code to the controller! I tried `BeginRouteForm` with an input button inside the editor, but that ends up submitting the entire Create page form? Would that be the right way to do this? Note: Im using T4MVC, also, Initially I forgot but I did reference both `microsoft.ajax.js` and `microsoft.mvc.ajax.js` in the create page. --- : I managed to get this working with JQuery and it seems pretty nice and simple. However, I would really like to know how this kind of thing would be generally done with `Ajax.BeginForm` since Im learning MVC.
reusable ajax editor for model in asp.net mvc not going ajax
CC BY-SA 2.5
null
2010-12-24T08:22:51.353
2011-12-08T03:46:52.797
2011-12-08T03:46:52.797
210,916
368,070
[ "asp.net-mvc", "ajax", "asp.net-mvc-3", "editorfor" ]
4,525,152
1
4,525,194
null
19
4,574
I have PNG (as well as JPEG) images uploaded to my site. They should be static (i.e. one frame). There is such thing as [APNG](https://en.wikipedia.org/wiki/APNG). ![Bouncy ball](https://i.stack.imgur.com/mgOGz.png) (it will be animated in Firefox). According to the [Wikipedia article](https://en.wikipedia.org/wiki/APNG)... > APNG hides the subsequent frames in PNG ancillary chunks in such a way that APNG-unaware applications would ignore them, but there are otherwise no changes to the format to allow software to distinguish between animated and non-animated images. Does this mean it is impossible to determine if a PNG is animated with code? If it is possible, can you please point me in the right direction PHP wise (GD, ImageMagick)?
Can I programmatically determine if a PNG is animated?
CC BY-SA 4.0
0
2010-12-24T08:37:16.337
2022-06-01T23:56:46.550
2018-11-02T12:19:13.327
1,033,581
31,671
[ "php", "image", "png", "apng" ]
4,525,166
1
4,525,274
null
0
395
how to create xib files like this? below is the screen shot what am looking for? note:- i want to create like sub file ( en) ![alt text](https://i.stack.imgur.com/836J6.png)
creating xib file
CC BY-SA 2.5
0
2010-12-24T08:41:12.523
2010-12-24T09:02:33.270
null
null
494,589
[ "iphone", "interface-builder" ]
4,526,127
1
null
null
3
547
Every time I run a certain application it is showing a Not Found error![alt text](https://i.stack.imgur.com/akzF2.png) Does anyone know how to resolve this? I placed a debugger on the page_load event in the default.aspx.cs file but it is not getting called. Below is the routing configuration: ``` routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // parameters new { controller = "Home", action = "Index", id = "" } // Parametedefaults ); ``` I tried everything I can think of, but it is not working.
Not found error in asp.net-mvc
CC BY-SA 3.0
null
2010-12-24T11:47:57.490
2012-10-01T12:56:39.803
2012-10-01T12:56:39.803
30,913
400,962
[ "asp.net", "asp.net-mvc" ]
4,526,179
1
null
null
0
359
I'm regularly an IntelliJ IDEA user, but because jsTestDriver doesn't work with IDEA, I am forced to use eclipse. I am getting a very annoying error message every time I save my javascript files with - shortcut. In IDEA, it just saves the files for me... and I never run into any problems ever. It is literally the most unobtrusive saving model ever, and I love it. But with this IDE - eclipse - I have to constantly save the files manually. Anyway, I've gotten used to it, but if I am making changes to 2 or more files, when I press CTRL-S, this error message pops up 2+ times. It is so annoying. ![Error message](https://i.stack.imgur.com/ZYfpb.jpg) Even worse, it's affecting my unit test results with jsTestDriver! Sometimes 0 tests runs, other times it crashes half-way... all because the files weren't saved. Can anyone help me fix this? IDEA is not running at the same time either. Just STS/Eclipse.
Saving multiple files in Eclipse using Ctrl+s causes "The file cannot be edited"
CC BY-SA 3.0
null
2010-12-24T11:57:52.317
2017-12-14T15:10:35.903
2017-12-14T15:10:35.903
150,926
331,439
[ "eclipse", "file", "locking", "save", "js-test-driver" ]
4,526,336
1
null
null
2
2,472
Is there a way to erase the black background for that image ![alt text](https://i.stack.imgur.com/Qdoqf.png) I've found this sample code found on this [topic](https://stackoverflow.com/questions/1487601) but i don't understand how it works ``` - (void)clipImage { UIImage *img = imgView.image; CGSize s = img.size; UIGraphicsBeginImageContext(s); CGContextRef g = UIGraphicsGetCurrentContext(); CGContextAddPath(g,erasePath); CGContextAddRect(g,CGRectMake(0,0,s.width,s.height)); CGContextEOClip(g); [img drawAtPoint:CGPointZero]; imageView.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); } ``` Maybe I'm in the wrong way. Regards, kl94
How erase part of UIImage
CC BY-SA 2.5
0
2010-12-24T12:32:24.293
2013-12-08T15:26:47.500
2017-05-23T11:48:24.847
-1
553,488
[ "iphone", "objective-c", "ipad", "uiimageview", "uiimage" ]
4,526,614
1
null
null
2
2,135
For some time now I've been trying to remove the blue highlight in UIPickerView when you're using the `pickerView:viewForRow:forComponent:reusingView:` delegate. I'm sure many here have been there and wanted to remove that ugly blue highlight in the UIPickerView. The `UIPickerView` has a `UITableView` - rather a `UIPickerTable` inside which has cells where your `UILabels/UIViews/UIImageViews` or whatever lay. Logically, if it's a tableview, then we can just access the cell and `setSelectionStyle:UITableViewCellSelectionStyleNone` right? `UIPickerTable` is a private class of the API and does not allow you to set anything in there. I've managed to get all the subviews in my picker ``` [[myPickerView subviews] objectAtIndex:someIndexValue]; ``` So I tried this in `pickerView:didSelectRow:` and `pickerView:viewForRow:` ``` NSIndexPath *path = [[[myPickerView subviews] objectAtIndex:5] indexPathForSelectedRow]; [[[[myPickerView subviews] objectAtIndex:5] cellForRowAtIndexPath:path] setSelectionStyle:UITableViewCellSelectionStyleNone]; ``` And this: ``` [[[myPickerView subviews] objectAtIndex:5] setSelectionStyle:UITableViewCellSelectionStyleNone]; ``` None of them worked 'cause it's private. Giving me this error: I know about setting the `view`'s frame to the size of the `pickerView:rowHeightForComponent:` and then doing: ``` label.UserInteractionEnabled = YES; ``` Before returning it on `pickerView:viewForRow` method. But it doesn't really remove the highlight, it just it and removes the UIPickerView's ability to autoscroll when some item is just clicked. `UIPickerView``UILabel/UIView/UIImageView` I'm talking about the selectionIndicator. This is the highlight that appears when you click an image inside the pickerView: ![alt text](https://i.stack.imgur.com/fr7hM.png) PS: This pickerView has NO selectionIndicator and is customized. However, the customization has nothing to do with the issue. This issue is simply for the fact that there's an object that inherits form UIView inside the picker's cell and `viewForRow` is being used.
Removing UIPickerView Blue Highlight
CC BY-SA 2.5
null
2010-12-24T13:33:53.900
2011-01-09T17:39:33.497
2011-01-09T13:30:29.307
480,430
480,430
[ "iphone", "objective-c", "api", "uipickerview" ]
4,526,690
1
null
null
0
1,696
I've wrote a code ``` $(".ka_opinions_quote a").click(function(){ var quoted_text = $(this).parents("div.o_opinion").find(".ka_opinion_txt").text(); var cite_uri = $(this).parents("div.o_opinion").prev().find("a").attr("href"); var curr_text = $(".editor").text(); $(".editor").text(curr_text+'<quote cite="<?php echo mb_substr(JURI::base(), 0, -1); ?>'+cite_uri+'">'+quoted_text+'</quote>'); }); ``` After click text insert in textarea. But if user insert or write some text into textarea or delete text and after click on quote link, text not displaying in textarea but in Firebug I've see but actually text already exists ![alt text](https://i.stack.imgur.com/HXshW.png) Any ideas how I do implement a proper text insertion?
Insert text into Markitup text editor
CC BY-SA 2.5
null
2010-12-24T13:53:13.587
2010-12-24T16:27:39.580
null
null
345,874
[ "jquery", "markitup" ]
4,526,852
1
4,527,045
null
7
2,022
I'm implementing an approach from a research paper. Part of the approach calls for a major edge detector, which the authors describe as follows: 1. Obtain DC image (effectively downsample by 8 for both width and height) 2. Calculate Sobel gradient of DC image 3. Threshold Sobel gradient image (using T=120) 4. Morphological operations to clean up edge image Note that this Canny edge detection -- they don't bother with things like non-maximum suppression, etc. I could of course do this with Canny edge detection, but I want to implement things exactly as they are expressed in the paper. That last step is the one I'm a bit stuck on. Here is exactly what the authors say about it: > After obtaining the binary edge map from the edge detection process, a binary morphological operation is employed to remove isolated edge pixels, which might cause false alarms during the edge detection Here's how things are supposed to look like at the end of it all (edge blocks have been filled in black): ![alt text](https://i.stack.imgur.com/xDpni.png) Here's what I have if I skip the last step: ![alt text](https://i.stack.imgur.com/RpA6R.png) It seems to be on the right track. So here's what happens if I do erosion for step 4: ![alt text](https://i.stack.imgur.com/bKB55.png) I've tried combinations of erosion and dilation to obtain the same result as they do, but don't get anywhere close. Can anyone suggest a combination of morphological operators that will get me the desired result? Here's the binarization output, in case anyone wants to play around with it: ![alt text](https://i.stack.imgur.com/nX5J3.png) And if you're really keen, here is the source code (C++): ``` #include <cv.h> #include <highgui.h> #include <stdlib.h> #include <assert.h> using cv::Mat; using cv::Size; #include <stdio.h> #define DCTSIZE 8 #define EDGE_PX 255 /* * Display a matrix as an image on the screen. */ void show_mat(char *heading, Mat const &m) { Mat clone = m.clone(); Mat scaled(clone.size(), CV_8UC1); convertScaleAbs(clone, scaled); IplImage ipl = scaled; cvNamedWindow(heading, CV_WINDOW_AUTOSIZE); cvShowImage(heading, &ipl); cvWaitKey(0); } /* * Get the DC components of the specified matrix as an image. */ Mat get_dc(Mat const &m) { Size s = m.size(); assert(s.width % DCTSIZE == 0); assert(s.height % DCTSIZE == 0); Size dc_size = Size(s.height/DCTSIZE, s.width/DCTSIZE); Mat dc(dc_size, CV_32FC1); cv::resize(m, dc, dc_size, 0, 0, cv::INTER_AREA); return dc; } /* * Detect the edges: * * Sobel operator * Thresholding * Morphological operations */ Mat detect_edges(Mat const &src, int T) { Mat sobelx = Mat(src.size(), CV_32FC1); Mat sobely = Mat(src.size(), CV_32FC1); Mat sobel_sum = Mat(src.size(), CV_32FC1); cv::Sobel(src, sobelx, CV_32F, 1, 0, 3, 0.5); cv::Sobel(src, sobely, CV_32F, 0, 1, 3, 0.5); cv::add(cv::abs(sobelx), cv::abs(sobely), sobel_sum); Mat binarized = src.clone(); cv::threshold(sobel_sum, binarized, T, EDGE_PX, cv::THRESH_BINARY); cv::imwrite("binarized.png", binarized); // // TODO: this is the part I'm having problems with. // #if 0 // // Try a 3x3 cross structuring element. // Mat elt(3,3, CV_8UC1); elt.at<uchar>(0, 1) = 0; elt.at<uchar>(1, 0) = 0; elt.at<uchar>(1, 1) = 0; elt.at<uchar>(1, 2) = 0; elt.at<uchar>(2, 1) = 0; #endif Mat dilated = binarized.clone(); //cv::dilate(binarized, dilated, Mat()); cv::imwrite("dilated.png", dilated); Mat eroded = dilated.clone(); cv::erode(dilated, eroded, Mat()); cv::imwrite("eroded.png", eroded); return eroded; } /* * Black out the blocks in the image that contain DC edges. */ void censure_edge_blocks(Mat &orig, Mat const &edges) { Size s = edges.size(); for (int i = 0; i < s.height; ++i) for (int j = 0; j < s.width; ++j) { if (edges.at<float>(i, j) != EDGE_PX) continue; int row = i*DCTSIZE; int col = j*DCTSIZE; for (int m = 0; m < DCTSIZE; ++m) for (int n = 0; n < DCTSIZE; ++n) orig.at<uchar>(row + m, col + n) = 0; } } /* * Load the image and return the first channel. */ Mat load_grayscale(char *filename) { Mat orig = cv::imread(filename); std::vector<Mat> channels(orig.channels()); cv::split(orig, channels); Mat grey = channels[0]; return grey; } int main(int argc, char **argv) { assert(argc == 3); int bin_thres = atoi(argv[2]); Mat orig = load_grayscale(argv[1]); //show_mat("orig", orig); Mat dc = get_dc(orig); cv::imwrite("dc.png", dc); Mat dc_edges = detect_edges(dc, bin_thres); cv::imwrite("dc_edges.png", dc_edges); censure_edge_blocks(orig, dc_edges); show_mat("censured", orig); cv::imwrite("censured.png", orig); return 0; } ```
Need help implementing a special edge detector
CC BY-SA 2.5
0
2010-12-24T14:34:39.880
2010-12-27T21:30:38.837
null
null
356,020
[ "c++", "image-processing", "opencv" ]
4,526,895
1
null
null
6
9,465
I have IR sensor which have [TRS connector](http://en.wikipedia.org/wiki/TRS_connector) and I can record my remotes signals into audio. Now I want to control my computer with TV remote, but I don't have any clue how to compare audio input with pre-recorded audio. But after I realized that these audio waves contains only some kind data (binary) I can turn these into binary or hex, so it is much easier to compare. Waves look just like this: ![wave 1](https://i.stack.imgur.com/lCIyl.png) And this: ![wave 2](https://i.stack.imgur.com/goJ6d.png) These are records of "OK" button, sometimes there are some impulses on right channel too and I don't know why, it seems like connections in sensor are damaged maybe. Ok thats not matter, anyway I know it's sounds like "Do it for me, while I enjoy my life", but I don't have experiences with sound transforming/reading... I've looking for python examples for recording and reading audio, but unsuccessfully.
Get binary data from audio impulses
CC BY-SA 2.5
0
2010-12-24T14:45:58.857
2010-12-25T23:19:10.603
2010-12-24T17:01:12.530
355,230
553,375
[ "python", "audio", "fft" ]
4,527,069
1
4,527,120
null
1
3,280
From ![alt text](https://i.stack.imgur.com/8g3qN.jpg) I want to create ![alt text](https://i.stack.imgur.com/Huaeu.jpg) Is this possible with php?
Can i 3d rotate an image on the Y axis 10-15 degrees from php?
CC BY-SA 3.0
null
2010-12-24T15:35:48.683
2015-10-08T08:27:10.540
2015-10-08T08:27:10.540
3,545,094
1,196,559
[ "php", "rotation", "gd", "jpeg" ]
4,527,182
1
4,528,323
null
5
1,965
`ã``a`. NOTE2: Before you blame this on CMD.EXE and Windows pipe weirdness, see Experiment 2 below which gets a similar problem using File::Find. The particular problem I'm trying to fix involves working with image files stored on a local drive, and manipulating the file names which may contain foreign characters. The two experiments shown below are intermediate debugging steps. The `ã` character is common in latin languages. e.g. [](http://pt.wikipedia.org/wiki/C%C3%A3o)[http://pt.wikipedia.org/wiki/Cão](http://pt.wikipedia.org/wiki/C%C3%A3o) Look closely, note how `cão` becomes `cao`. ![alt text](https://i.stack.imgur.com/y9V0T.png) Here I tried using File::Find instead of piped input, in case the issue was with the Windows implementation of the `|` shell operator. The issue actually gets worse, as the `~a` becomes `Pi`: ![alt text](https://i.stack.imgur.com/oxfLd.png) --- Debugging update: I tried some of the tricks listed at [http://perldoc.perl.org/perlunicode.html](http://perldoc.perl.org/perlunicode.html), e.g. `use utf8`, `use feature 'unicode_strings'`, etc, to no avail. --- The OS is Windows 7, 64-bit. The Perl is: ``` This is perl 5, version 12, subversion 2 (v5.12.2) built for MSWin32-x64-multi-thread (with 8 registered patches, see perl -V for more detail) Copyright 1987-2010, Larry Wall Binary build 1202 [293621] provided by ActiveState http://www.ActiveState.com Built Sep 6 2010 22:53:42 ```
Why does Perl lose foreign characters on Windows; can this be fixed (if so, how)?
CC BY-SA 2.5
0
2010-12-24T16:01:46.937
2010-12-25T01:18:43.413
2010-12-25T01:18:43.413
196,032
196,032
[ "perl", "unicode", "windows-7" ]
4,527,903
1
4,534,770
null
1
1,363
This one is really weird. I had a perfectly working Eclipse + Android 2.2 SDK working in Administrator account LUA (Limited User Account) under Windows XP. Then I decided to add the Android 1.6 SDK (I could do it from an Administrator account only). It seemed to have gone well, since it still works perfectly -- but only in that Administrator account! When I try to start Eclipse under a LUA, I receive the following error message box: ![alt text](https://i.stack.imgur.com/CkLHH.png) Which disappears within 2-3 seconds and replaced with: ![alt text](https://i.stack.imgur.com/h7Ge5.png) I then tried to check the Preferences page, but again, all I receive is error messages: ![alt text](https://i.stack.imgur.com/KdQc3.png) and: ![alt text](https://i.stack.imgur.com/kMpjZ.png) Any idea why this is happening and how to fix this? (I would love to be able to continue working from a LUA) : I have uploaded the [error log file](https://doc-0s-68-docs.googleusercontent.com/docs/securesc/va467pin5j2onoki8telv4ohu2s1fe4h/uqs3cd2dk1k456db6c9aggo9v9ilnf3q/1318187700000/14031223452686937345/11871178236052463999/0B9-S3uwjca3jMzM0ZGJiYWMtMGUxNi00Yjc2LWJmNzUtYTQxNDZlNzI2ZWEx?authkey=COWwsLQD&e=download&nonce=vkuub5ko0se9a&user=11871178236052463999&hash=a7qm4urv202gqefvdunlvaaj154rh8b3) (referred to in the "Show Error Log" in the message boxes), for your expert examination. Hopefully this can shed some light on the mystery.
Huh? Android Preferences page refuses to load after adding SDK 1.6
CC BY-SA 3.0
0
2010-12-24T18:58:38.117
2011-10-09T19:26:46.510
2011-10-09T19:26:46.510
540,162
418,055
[ "android", "windows", "sdk", "android-sdk-1.6", "limited-user" ]
4,527,931
1
4,573,944
null
4
2,054
# Intro Here is an example to illustrate the problem. Consider I am tracking and displaying mouse global current position and last click button and position to the user. Here is an image: ![alt text](https://i.stack.imgur.com/5UvPc.png) To archive capturing click events on windows box, that would and will be sent to the other programs event messaging queue, I create a hook using winapi namely `user32.dll` library. This is outside JDK sandbox, so I use JNA to call the native library. This all works perfectly, but it does not close as I expect it to. My question is - How do I properly close following example program? ## Example source Code below is not fully written by Me, but taken from [this](http://forums.oracle.com/forums/thread.jspa?threadID=1546451) question in Oracle forum and partly fixed. ``` import java.awt.AWTException; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.GridLayout; import java.awt.MouseInfo; import java.awt.Point; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JFrame; import javax.swing.JLabel; import com.sun.jna.Native; import com.sun.jna.NativeLong; import com.sun.jna.Platform; import com.sun.jna.Structure; import com.sun.jna.platform.win32.BaseTSD.ULONG_PTR; import com.sun.jna.platform.win32.Kernel32; import com.sun.jna.platform.win32.User32; import com.sun.jna.platform.win32.WinDef.HWND; import com.sun.jna.platform.win32.WinDef.LRESULT; import com.sun.jna.platform.win32.WinDef.WPARAM; import com.sun.jna.platform.win32.WinUser.HHOOK; import com.sun.jna.platform.win32.WinUser.HOOKPROC; import com.sun.jna.platform.win32.WinUser.MSG; import com.sun.jna.platform.win32.WinUser.POINT; public class MouseExample { final JFrame jf; final JLabel jl1, jl2; final CWMouseHook mh; final Ticker jt; public class Ticker extends Thread { public boolean update = true; public void done() { update = false; } public void run() { try { Point p, l = MouseInfo.getPointerInfo().getLocation(); int i = 0; while (update == true) { try { p = MouseInfo.getPointerInfo().getLocation(); if (!p.equals(l)) { l = p; jl1.setText(new GlobalMouseClick(p.x, p.y) .toString()); } Thread.sleep(35); } catch (InterruptedException e) { e.printStackTrace(); return; } } } catch (Exception e) { update = false; } } } public MouseExample() throws AWTException, UnsupportedOperationException { this.jl1 = new JLabel("{}"); this.jl2 = new JLabel("{}"); this.jf = new JFrame(); this.jt = new Ticker(); this.jt.start(); this.mh = new CWMouseHook() { @Override public void globalClickEvent(GlobalMouseClick m) { jl2.setText(m.toString()); } }; mh.setMouseHook(); jf.setLayout(new GridLayout(2, 2)); jf.add(new JLabel("Position")); jf.add(jl1); jf.add(new JLabel("Last click")); jf.add(jl2); jf.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { mh.dispose(); jt.done(); jf.dispose(); } }); jf.setLocation(new Point(0, 0)); jf.setPreferredSize(new Dimension(200, 90)); jf.pack(); jf.setVisible(true); } public static class GlobalMouseClick { private char c; private int x, y; public GlobalMouseClick(char c, int x, int y) { super(); this.c = c; this.x = x; this.y = y; } public GlobalMouseClick(int x, int y) { super(); this.x = x; this.y = y; } public char getC() { return c; } public void setC(char c) { this.c = c; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } @Override public String toString() { return (c != 0 ? c : "") + " [" + x + "," + y + "]"; } } public static class CWMouseHook { public User32 USER32INST; public CWMouseHook() throws UnsupportedOperationException { if (!Platform.isWindows()) { throw new UnsupportedOperationException( "Not supported on this platform."); } USER32INST = User32.INSTANCE; mouseHook = hookTheMouse(); Native.setProtected(true); } private static LowLevelMouseProc mouseHook; private HHOOK hhk; private boolean isHooked = false; public static final int WM_LBUTTONDOWN = 513; public static final int WM_LBUTTONUP = 514; public static final int WM_RBUTTONDOWN = 516; public static final int WM_RBUTTONUP = 517; public static final int WM_MBUTTONDOWN = 519; public static final int WM_MBUTTONUP = 520; public void dispose() { unsetMouseHook(); mousehook_thread = null; mouseHook = null; hhk = null; USER32INST = null; } public void unsetMouseHook() { isHooked = false; USER32INST.UnhookWindowsHookEx(hhk); System.out.println("Mouse hook is unset."); } public boolean isIsHooked() { return isHooked; } public void globalClickEvent(GlobalMouseClick m) { System.out.println(m); } private Thread mousehook_thread; public void setMouseHook() { mousehook_thread = new Thread(new Runnable() { @Override public void run() { try { if (!isHooked) { hhk = USER32INST.SetWindowsHookEx(14, mouseHook, Kernel32.INSTANCE.GetModuleHandle(null), 0); isHooked = true; System.out .println("Mouse hook is set. Click anywhere."); // message dispatch loop (message pump) MSG msg = new MSG(); while ((USER32INST.GetMessage(msg, null, 0, 0)) != 0) { USER32INST.TranslateMessage(msg); USER32INST.DispatchMessage(msg); if (!isHooked) break; } } else System.out .println("The Hook is already installed."); } catch (Exception e) { System.err.println("Caught exception in MouseHook!"); } } }); mousehook_thread.start(); } private interface LowLevelMouseProc extends HOOKPROC { LRESULT callback(int nCode, WPARAM wParam, MOUSEHOOKSTRUCT lParam); } private LowLevelMouseProc hookTheMouse() { return new LowLevelMouseProc() { @Override public LRESULT callback(int nCode, WPARAM wParam, MOUSEHOOKSTRUCT info) { if (nCode >= 0) { switch (wParam.intValue()) { case CWMouseHook.WM_LBUTTONDOWN: globalClickEvent(new GlobalMouseClick('L', info.pt.x, info.pt.y)); break; case CWMouseHook.WM_RBUTTONDOWN: globalClickEvent(new GlobalMouseClick('R', info.pt.x, info.pt.y)); break; case CWMouseHook.WM_MBUTTONDOWN: globalClickEvent(new GlobalMouseClick('M', info.pt.x, info.pt.y)); break; default: break; } } return USER32INST.CallNextHookEx(hhk, nCode, wParam, info.getPointer()); } }; } public class Point extends Structure { public class ByReference extends Point implements Structure.ByReference { }; public NativeLong x; public NativeLong y; } public static class MOUSEHOOKSTRUCT extends Structure { public static class ByReference extends MOUSEHOOKSTRUCT implements Structure.ByReference { }; public POINT pt; public HWND hwnd; public int wHitTestCode; public ULONG_PTR dwExtraInfo; } } public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { @Override public void run() { try { new MouseExample(); } catch (AWTException e) { e.printStackTrace(); } } }); } } ```
Closing a hook that captures global input events
CC BY-SA 2.5
0
2010-12-24T19:06:03.457
2011-01-01T11:46:08.097
2020-06-20T09:12:55.060
-1
97,754
[ "java", "multithreading", "winapi", "hook", "jna" ]
4,528,065
1
4,529,768
null
1
2,683
Hello here I have a big problem that I hope to find help here I have two entities `@Entity``@Inheritance(strategy=InheritanceType.JOINED) @DiscriminatorColumn(name="Role", discriminatorType=DiscriminatorType.STRING) public class Utilisateur implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name="id") private Long id; @Column(name="nom",nullable=false) private String nom; @Column(name="Role",nullable=false, insertable=false) private String Role ; //... }``` ``` @Entity ``` @Table(name="ResCom") @DiscriminatorValue("ResCom") public class ResCom extends Utilisateur { /... } the first thing I do ``` ResCom rsCom= new ResCom(nom,prenom, email,civilite, SysQl.crypePasse(pass)); gr.create(rsCom); ``` I check my database I see that property is ResCom insert but when I check the value of role I get null ``` Utilisateur tets= gr.findByEmail(email); message=tets.getEmail()+" and Role :"+tets.getRole()+""; ``` but in my bass it ResCom !!!!! ![alt text](https://i.stack.imgur.com/7wyMh.jpg) the problem disappears when I deploy the project again I hope you have a solution And thank you in advance sorry for my English
how to force ejb3 to reload value from data base and not use those of the context
CC BY-SA 2.5
null
2010-12-24T19:40:56.553
2010-12-25T08:41:22.613
2010-12-24T23:38:58.533
514,612
514,612
[ "jpa", "jakarta-ee", "ejb-3.0", "java-ee-6" ]
4,528,399
1
4,528,673
null
8
4,333
I have a html table with a column of text boxes (), all of them are disabled when the page loads, and I need that when user clicks on a check box, the text box for that column should be enabled and become a required field, and then if the user unchecks the checkbox, the textbox on that row must be disabled and the required class removed. ![alt text](https://i.stack.imgur.com/64WTh.jpg) I already have the function to enable and disable the text boxes (column ) when the user clicks on the corresponding checkbox, but it is written in javascript.However, for some reason it only works in IE). Here is the html code ``` <tbody> <c:forEach items="${list}" var="item"> <tr> <td align="center"> <input type="checkbox" name="selectItems" value="<c:out value="${item.numberPlate}"/>" onchange="enableTextField(this)" /> </td> <td align="left"><c:out value="${item.numberPlate}"/></td> <td align="left"><c:out value="${item.driver.fullName}"/></td> <td align="left"><input type="text" name="mileage_<c:out value="${item.numberPlate}"/>" value="" disabled="true"/></td> </tr> </c:forEach> </tbody> ``` And the javascript code: ``` function enableTextField(r) { var node = r.parentNode; while( node && node.tagName !== 'TR' ) { node = node.parentNode; } var i=node.rowIndex; if(document.form1.selectItems[i-1].checked) { document.getElementById('mileage_' + document.form1.selectItems[i-1].value).disabled=false; } else { document.getElementById('mileage_' + document.form1.selectItems[i-1].value).value=""; document.getElementById('mileage_' + document.form1.selectItems[i-1].value).disabled=true; } } ``` Now, I know that in order to add or remove dynamically validation rules I have to use: addClass('required'); o removeClass('required') ,but I don't know how to detect whether a check box is selected or not, and based on that ,enable or disable the text box for that row. I really hope you can help me out with this.
How to check if a checkbox in a checkbox array is checked with jquery
CC BY-SA 2.5
0
2010-12-24T21:27:17.337
2010-12-25T00:12:04.233
2010-12-24T22:27:32.457
530,911
530,911
[ "jquery", "html" ]