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
5,961,226
1
5,961,284
null
5
11,478
is it possible to set the application badge, while the app is in background mode or even closed? I haven't found anything, yet. ![Application Badge](https://i.stack.imgur.com/IWYWb.png)
iPhone: How to set the application badge, when the app is closed/in background?
CC BY-SA 3.0
0
2011-05-11T08:18:46.770
2016-03-07T20:23:13.517
null
null
76,371
[ "iphone", "cocoa-touch", "ios4", "background", "push-notification" ]
5,961,684
1
5,961,962
null
6
5,100
how to get rid of the following Incompatible debugger version error : php.ini setting : ``` xdebug.remote_enable=true xdebug.remote_host=localhost xdebug.remote_port=10000 xdebug.remote_handler=dbgp xdebug.profiler_enable=1 xdebug.profiler_output_dir="C:\xampp\tmp" ``` ![enter image description here](https://i.stack.imgur.com/5OGcr.jpg)
Incompatible debugger version - error 2006040705
CC BY-SA 3.0
0
2011-05-11T08:59:07.617
2013-01-04T12:28:35.423
null
null
389,288
[ "php", "eclipse", "xdebug" ]
5,962,060
1
5,966,127
null
6
4,349
I'm getting the following error when debugging: ![Error message](https://i.stack.imgur.com/86rFB.jpg) php.ini settings: ``` xdebug.remote_enable=true xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.remote_handler=dbgp ```
Error message: "unexpected termination of script, debugging ended", when debugging PHP with Xdebug and Eclipse
CC BY-SA 3.0
0
2011-05-11T09:31:44.183
2015-12-09T05:03:04.897
2012-06-05T14:35:14.997
1,435,403
389,288
[ "php", "eclipse", "xdebug" ]
5,962,470
1
5,964,641
null
1
179
I need something like on the picture below but I can't find a way to do it using Qt 4.3.3... ![enter image description here](https://i.stack.imgur.com/r6IZC.png)
Is any way to show text line at the top of QTableView exist?
CC BY-SA 3.0
null
2011-05-11T10:03:14.943
2011-05-11T12:58:39.667
null
null
318,499
[ "c++", "qt", "qt4", "label", "qtableview" ]
5,962,545
1
5,962,868
null
0
74
I have a table design problem for which I need a cunning solution. Let's say I have two tables, with relationship: ``` Contract 1---N Payment ``` Now, let's say I have legacy data that needs to go into these tables. The problem though is that many of the legacy Payment entries are aggregated across mulitple contracts So we could actually view this as: New: ``` SomethingAboveContract 1---N Contract 1---N Payment ``` Legacy: ``` SomethingAboveContract 1---N Payment ``` Now, I can get around this by creating an M-N relationship between Contract and Payment. ``` Contract 1---N ContractPayment N---1 Payment ``` (it will be possible for me to identify all the contracts that are linked to the aggregated payment) This is fine for the legacy data, but I actually do want to enforce the 1-N relationship between Contract and Payment going forward. So, using my very unhandy scribble to illustrate, I would like to do this: ![enter image description here](https://i.stack.imgur.com/l7tRR.jpg) I.e. where the payment is aggregate, ContractID will be NULL, otherwise it should not be null. In other words, I need to find a way to enforce the following contingencies on the Payment table: 1. ContractID nullable if PaymentID appears in ContractPayment 2. ContractID not nullable if PaymentID does not appear in ContractPayment I don't know how to do this though. Even if this is possible, it does seem a bit ugly (which legacy data conversion invariably is). So if anyone has a more elegant solution that would be great. Otherwise, anything that works! Thanks Karl
SQL table design with contigent constraints
CC BY-SA 3.0
null
2011-05-11T10:09:07.407
2011-05-11T10:36:43.803
null
null
141,789
[ "sql", "sql-server-2008", "many-to-many", "database-design" ]
5,962,624
1
5,963,583
null
4
2,575
My UITextField's font gets lighter when it is being edited, and bolder whenever editing finishes. These images should illustrate the problem: ![Editing](https://i.stack.imgur.com/49bXD.png) ![Not Editing](https://i.stack.imgur.com/j7C9P.png) Can anyone explain why this is, and how to stop it? This is all the code I've got for it - first my UITextField subclass (which is just there to add margins): ``` @interface RLTextField : UITextField { } @end @implementation RLTextField - (CGRect)editingRectForBounds:(CGRect)bounds { CGRect editingRect = CGRectMake(bounds.origin.x+35, bounds.origin.y-5, bounds.size.width, bounds.size.height); return editingRect; } - (CGRect)textRectForBounds:(CGRect)bounds { CGRect editingRect = CGRectMake(bounds.origin.x+35, bounds.origin.y-5, bounds.size.width, bounds.size.height); return editingRect; } @end ``` And then where it's actually added in my viewController: ``` - (void)viewDidLoad { CGRect noteTitleTextFrame = CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y+10, self.view.bounds.size.width, 44); RLTextField *textField = [[RLTextField alloc] initWithFrame:noteTitleTextFrame]; self.nameTextField = textField; [textField release]; self.nameTextField.delegate = self; self.nameTextField.borderStyle = UITextBorderStyleNone; self.nameTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentBottom; self.nameTextField.font = [UIFont fontWithName:@"Courier" size:21]; [self.view addSubview:self.nameTextField]; } ```
Why does the font of my UITextField change when editing?
CC BY-SA 3.0
0
2011-05-11T10:15:26.650
2011-05-11T11:38:12.393
2011-05-11T10:28:41.200
619,432
619,432
[ "iphone", "cocoa-touch", "uitextfield" ]
5,962,967
1
6,311,710
null
0
1,313
i have problem with jqgrid headers. in firefox it is displaying properly as shown below... ![jqgrid header in firefox](https://i.stack.imgur.com/b4LQ4.jpg) in IE7 it is displaying as shown below... ![jqgrid header in IE7](https://i.stack.imgur.com/2DD1G.jpg) can anyone solve my problem... i used the following html for jqgrid `< table id="list" cellpadding="0" cellspacing="0">< /table>````< div id="pager" >< /div>`
jqgrid - table headers label alignment problem in IE
CC BY-SA 3.0
null
2011-05-11T10:46:06.017
2012-02-09T20:55:52.793
null
null
632,173
[ "jquery", "jqgrid" ]
5,963,015
1
null
null
0
642
![enter image description here](https://i.stack.imgur.com/usiKI.png) I want to remove perspective from 'Open Perspective' dialog at Runtime. Please give me advice.
Is there way that delete perspective from 'open perspective' dialog at Runtime
CC BY-SA 3.0
null
2011-05-11T10:50:36.093
2011-05-11T14:32:45.847
2011-05-11T12:56:44.067
373,861
459,007
[ "eclipse-plugin", "eclipse-rcp", "jface" ]
5,963,350
1
null
null
4
1,164
I've got Activity with gallery widget alongside with other views. I want gallery to be as wide as my Activity is, and I want my image to match gallery size. I'm a little bit confused with [ImageView.ScaleType](http://developer.android.com/reference/android/widget/ImageView.ScaleType.html), but that's what I've chosen: Part of my curtom adapter for Gallery: ``` @Override public View getView(int position, View convertView, ViewGroup parent) { ImageView imageView=new ImageView(activity); imageView.setLayoutParams(new Gallery.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); imageView.setScaleType(ImageView.ScaleType.FIT_CENTER); //imageView.setPadding(10, 10, 10, 10); String imageUrl="my_uri.com/sample.png"; imageLoader.displayImage(imageUrl, activity, imageView); imageView.setTag(imageUrl); return imageView; } ``` Part of my Activity layout: ``` <Gallery android:id="@+id/gallery" android:layout_below="@+id/tvDetailedDescription" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#CCCCCC" /> ``` ![enter image description here](https://i.stack.imgur.com/QAMS6.png) What I need is to get rid of that extra grey part of gallery on top and bottom(marked red). I wonder, why does it have such size? Maybe I do something funny with that scaling type stuff?
Android Gallery issue - gallery size is bigger than expected
CC BY-SA 3.0
0
2011-05-11T11:19:15.067
2011-05-30T12:03:53.257
2011-05-30T12:03:53.257
null
null
[ "android", "android-layout", "android-widget" ]
5,963,466
1
null
null
1
1,626
I have a very weird problem, first: this is my tiny init: ``` function recargar_tiny(){ // General options tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Skin options skin : "o2k7", skin_variant : "silver", // Example content CSS (should be your site CSS) content_css : "css/style.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); } ``` And what i do is to load the form via ajax, and then, call the tinymce init This is the result: ![textarea is gone](https://i.stack.imgur.com/UmAvE.png) Firebug doesn't jumb any error... :? Please note that there should be a textarea there and there is not... :? PS: but if i don't do this via ajax, if i do it onload it works fine... this is driving me mad, can you see something? EDIT2 This is my ajax call with the tiny init ``` function editar_item(id, tipo){ // where id and tipo are int ID's $("#router").load('/includes/router.php?que=editar_item&id='+id+'&tipo='+tipo,{},function(){ // where <textarea id="texto" name = "texto"> tinyMCE.execCommand('mceAddControl', false, 'texto'); }); } ``` Now it's not removing the textarea but it isn't loading the wyswyg either.. :? Any idea? -EDIT3- if i do it like this after the jquery ajax call: ``` tinyMCE.init({ mode : "textareas", theme : "advanced", plugins : "inlinepopups", media_strict: false, // Theme options theme_advanced_buttons1 : "bold,italic,underline,strikethrough,forecolor,image,link,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,|,removeformat,|,bullist,numlist,|,outdent,indent", heme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_buttons4 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, editor_deselector : "no_tiny", // Example content CSS (should be your site CSS) content_css : "/js/tinymce/examples/css/content.css", // Style formats style_formats : [ {title : 'Bold text', inline : 'b'}, {title : 'Blue text', inline : 'span', styles : {color : '#006'}}, {title : 'Blue header', block : 'h1', styles : {color : '#006'}}, {title : 'Codigo fuente', inline : 'code', classes : 'prettyprint', exact: true} ], formats : { alignleft : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'left'}, aligncenter : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'center'}, alignright : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'right'}, alignfull : {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', classes : 'full'}, bold : {inline : 'span', 'classes' : 'bold'}, italic : {inline : 'span', 'classes' : 'italic'}, underline : {inline : 'span', 'classes' : 'underline', exact : true}, strikethrough : {inline : 'del'}, customformat : {inline : 'span', styles : {color : '#00ff00', fontSize : '20px'}, attributes : {title : 'My custom format'}} } ``` }); Then it works!!! but not al the features i need are enabled.... :( thanks!
tinymce removes the textarea
CC BY-SA 3.0
null
2011-05-11T11:29:05.967
2011-05-17T14:37:56.437
2011-05-17T14:37:56.437
533,941
533,941
[ "tinymce", "textarea" ]
5,963,490
1
null
null
0
270
i am using WebSphere development studio that is eclipse while starting i am facing following problem..![enter image description here](https://i.stack.imgur.com/13cUr.jpg) kindly help how to resolve the problem...![enter image description here](https://i.stack.imgur.com/CPZAm.png) this the target value of my shortcut which i am using.. "E:\Program Files\IBM\SDP70\eclipse.exe" -product com.ibm.etools.iseries.wdsc.welcome.ide
Problem while starting Eclipse
CC BY-SA 3.0
null
2011-05-11T11:30:13.933
2011-05-11T12:39:50.403
2011-05-11T12:39:50.403
392,628
392,628
[ "java", "eclipse" ]
5,963,527
1
5,964,620
null
1
1,183
I've got a set of tables as below: > PositionShiftPatternID PositionID EmployeePositionShiftPatternID EmployeePositionID TemplateShiftPatternID WeekID PositionShiftPatternID WeekID EmployeePositionShiftPatternID WeekID TemplateShiftPatternID WeekID So PositionShiftPattern, EmployeePositionShiftPattern and TemplateShiftPattern each have a junction to Week, with one-to-many relationships inbetween. Obviously EF will map the relationships between PositionShiftPattern, EmployeePositionShiftPattern and TemplateShiftPattern and Week as many-to-many and create navigation properties from each table directly to Week. Is it possible to then change the many-to-many relationships to one-to-many relationships (e.g. each Week should map to a single ShiftPattern)? I'm trying to achieve mutual exclusion (see diagram below) and want to avoid just adding PositionShiftPatternID, EmployeePositionShiftPatternID and TemplateShiftPatternID to Week. Should I be looking at another way of achieving mutual exclusion? ![Mutual Exclusion](https://i.stack.imgur.com/rqErp.jpg) Thanks
Junction Tables: Changing many-to-many to one-to-many in Entity Framework model
CC BY-SA 3.0
null
2011-05-11T11:33:06.773
2011-05-11T13:31:12.847
2011-05-11T13:31:12.847
null
null
[ "sql", "entity-framework" ]
5,963,696
1
5,963,872
null
0
2,383
I ran into this problem when trying to add rounded corners to some divs and can't seem to find the solution. I'm using this css for the class assigned to the divs: ``` -moz-box-shadow: 0px 5px 5px #cccccc; -webkit-box-shadow: 0px 5px 5px #cccccc; box-shadow: 0px 5px 5px #cccccc; -moz-border-radius: 5px; -webkit-border-radius: 5px; -khtml-border-radius: 5px; border-radius: 5px; ``` The following is how it shows up in Chrome, Safari and Opera: ![Chrome, Opera, Safari output](https://i.stack.imgur.com/fyf74.png) And here is how it displays in Firefox and IE9: ![Firefox, IE9 output](https://i.stack.imgur.com/67NsF.png) It looks as if the background in Chrome and the others somehow clip over the the background color in the top border. The only css associated with the colored top border is: ``` border-top:8px solid #333333; ``` Any ideas?
CSS3 border radius problem with Chrome, Opera, Safari
CC BY-SA 3.0
0
2011-05-11T11:47:06.697
2011-05-11T17:08:33.057
2011-05-11T11:52:59.097
106,224
524,926
[ "css" ]
5,963,808
1
5,966,145
null
2
378
I got given this question in my tutorial for which I could do parts a) and b). Do you have any ideas for part c)? Question : Symbolically solve the following equation for the quantity `r=y/x`: ``` 3/y^4==3/x^4+a/(x+2y)^4 ``` (a) Use Map or Thread to perform the substitution `y->r x` to both sides of the equation. ``` ans: 3/(r^4 x^4) == 3/x^4 + a/(x + 2 r x)^4 ``` (b) Plot the solutions for `a\[Element]{-1,1}`. For `a\[Element]{-1,1}`, how many solutions are real valued? Does this number depend on `a` ? ``` ans: Graph and 4 solutions and no its doesn't depend on `a`. ``` ![enter image description here](https://i.stack.imgur.com/USckj.jpg) (c) Construct numerical solutions by letting `a` run between -1 and 1 with steps of 0.02 in your solutions obtained above. Use `Cases` to choose solutions whenever they are real, and using `ListPlot`, plot all the real solutions occurring in the interval `a\[Element]{-1,1}`. Ans : no idea.
Symbolical mathematical problem (mathematica)
CC BY-SA 3.0
null
2011-05-11T11:54:47.037
2011-05-11T14:45:07.450
2011-05-11T13:03:45.187
615,464
688,459
[ "wolfram-mathematica" ]
5,963,885
1
5,963,912
null
0
632
Is it possible to change Internet explorer printing settings before printing? I want the following options enabled by the function in the background and only the printer dialog showing up for the user to click 'print' if its not possible, are there any alternatives? ![enter image description here](https://i.stack.imgur.com/tsPtS.gif) ![enter image description here](https://i.stack.imgur.com/6nOfd.jpg)
I need a function or something to change internet explorer settings before printing
CC BY-SA 3.0
null
2011-05-11T12:02:28.963
2011-05-11T12:14:59.637
2011-05-11T12:10:14.557
521,180
521,180
[ "javascript", "jquery" ]
5,964,031
1
5,964,792
null
1
1,133
i start to study asp.Net now, i understand basic html (css not) i need your help how to create my website fit with web browser, like this : ![enter image description here](https://i.stack.imgur.com/pRp0L.png) when i resize first ![enter image description here](https://i.stack.imgur.com/MVG25.png) and last ![enter image description here](https://i.stack.imgur.com/FzcjF.png) i try create with my own skill and my website in a mess
How do I make my website’s layout work gracefully with different browser window sizes, like Tumblr does?
CC BY-SA 3.0
0
2011-05-11T12:15:01.230
2011-05-11T22:48:50.217
2011-05-11T13:05:30.900
20,578
553,779
[ "html", "css" ]
5,964,096
1
5,964,219
null
2
678
Good day my dear community. I'm working on dynamic shadows for a game I shall work on, but as it usually happens I bring you a problem, in hope (I'm certain actually) that someone will help. This is where I am right now:![enter image description here](https://i.stack.imgur.com/QDMaB.jpg) Notice the red square, I want it to gradually fade away as the light source moves out of the sight. I do check if a point of a polygon is inside circle's radius, but that of course doesn't solve it; as I said I want it to fade gradually until it completely blacks out If the light is too far away. There's one idea on my mind but I hope for a better one. I will not talk about it since it's really the last option and I find it to be a 'brute force' technique. This is how I render my light: ``` glBegin(GL_TRIANGLE_FAN); { Graphics::Instance()->SetColor(r_,g_,b_,intensity_); glVertex2f(posX_,posY_); glColor4f(0.f, 0.f, 0.f, 0.0f); for (angle_=0.0; angle_<=3.14159265*2; angle_+=((3.14159265*2)/64.0f) ) { glVertex2f(range_*(float)cos(angle_) + posX_, range_*(float)sin(angle_) + posY_); } glVertex2f(posX_+range_, posY_); } ``` And this is how I blend it: ``` glBlendFunc(GL_SRC_ALPHA, GL_ONE); l0->Render(); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); l0->ProjectShadow(*mmm); l0->ProjectShadow(*bb); ``` That is all. If I didn't made myself clear or If I missed to post relevant code, please do say so and don't downvote.
Dynamic 2d shadows - Blending issue
CC BY-SA 3.0
null
2011-05-11T12:19:55.500
2011-05-11T12:50:05.483
null
null
661,797
[ "c++", "opengl" ]
5,964,193
1
5,965,893
null
2
5,311
I would like to label my plot with the label output of a test, eg., LSD test output (a, b, ab, etc) using LSD.test in library agricolae. Here is the running example. ``` library(ggplot2) library(agricolae) wt<-gl(3,4,108,labels=c("W30","W60","W90")) pl<-gl(3,12,108,labels=c("P0","P1","P2")) gp<-gl(3,36,108,labels=c("A","B","C")) dat<-cbind( A=runif(108), B=runif(108,min=1,max=10), C=runif(108,min=100,max=200), D=runif(108,min=1000,max=1500) ) dat.df<-data.frame(wt,pl,gp,dat) dat.m<-melt(dat.df) ggplot(dat.m,aes(x=wt,y=value,group=pl,facet=gp,fill=pl))+ stat_summary(fun.y=mean,geom="bar",size=2,position="dodge")+ stat_summary(fun.ymin=function(x)(mean(x)-sd(x)/sqrt(length(x))),geom="errorbar", fun.ymax=function(x)(mean(x)+sd(x)/sqrt(length(x))),position="dodge")+ facet_grid(variable~facet,scale="free_y")+ opts(legend.position="top")+ scale_colour_manual(values = c("red", "blue", "green")) ``` Normally, in other library, I tested the data, and pass the label to the text plot, but is it possible to do it in ggplot? eg., in stat_summary(), that use the LSD.test within fun.y? ![The plot for example](https://i.stack.imgur.com/4Gexu.png)
How to label the barplot in ggplot with the labels in another test result?
CC BY-SA 3.0
null
2011-05-11T12:26:28.320
2013-04-27T06:31:28.370
2011-05-12T00:20:51.393
548,334
548,334
[ "r", "ggplot2" ]
5,964,330
1
null
null
0
887
I have a workflow that that runs to update the status of a Case record to Resolved. However, the workflow gets put into status 'waiting' and contains a generic error message. When looking at the system job message it says: ![Error Message](https://i.stack.imgur.com/RFOQJ.png) This has worked on another system (as all I am doing is updating a status) so I assume it has something to do with the customizations in place. Has anyone else ever come across this and how did you resolve it? Thanks in advance I have created a new organisation to test out any possible solutions and to narrow down what might be happening. I created a workflow on the blank organisation and a test case record to try it out on. It worked fine as expected. I then imported the customizations that are on my customers system. Did the same again and it worked fine. I then created a new case record and tried the original workflow, this did not work. I then added a workflow that does the same as the first workflow and tried it on the pre customizations record, it worked. I then tried the new workflow on the new record and once again this did not work. It is therefore appearing that the workflows are not working on any records post customization import. Has anyone come across this before, and what steps were taken to resolve? Thanks again
Dynamics CRM Change Status Workflow error
CC BY-SA 3.0
0
2011-05-11T12:36:48.030
2011-05-16T12:56:03.443
2011-05-16T12:56:03.443
236,115
236,115
[ "workflow", "dynamics-crm", "dynamics-crm-4", "status" ]
5,964,363
1
5,969,141
null
4
177
I'm designing an application for Ubuntu and would like to make it feel natural and integrated in the OS. What are the available libraries, guidelines and frameworks that make an application look&feel native on an Ubuntu/Unity desktop? I don't exclusively mean GUI toolkits, but features like quicklists in Unity: ![enter image description here](https://i.stack.imgur.com/GZyoz.jpg)
How to make an Ubuntu application integrated?
CC BY-SA 3.0
0
2011-05-11T12:38:54.053
2011-05-11T18:51:01.810
2011-05-11T14:28:57.443
140,367
140,367
[ "language-agnostic", "ubuntu", "desktop-integration" ]
5,964,466
1
5,990,851
null
1
696
I have an example application that came with Qt (dialogs/standarddialogs) and modified it so that it displays dialog on every screen: ``` for(int i=0;i<app.desktop()->screenCount();i++) { Dialog* dialog = new Dialog(app.desktop()->screen(i)); dialog->show(); } return app.exec(); ``` When testing on Xnest on application default screen (the one from which the application has been started) everything works ok. However, on the other screen the icons in message boxes are not displayed correctly. ![distorted icons](https://i.stack.imgur.com/9elZm.png) The problem can be reproduced on both solaris and linux. However, when I try Xephyr instead of Xnest the problem disappears (on linux). On the other hand this is not a problem with Xnest itself as on Exceed the problem can also be reproduced (but the icons are not displayed at all). Has anybody seen this kind of problem? Do you think it might be a problem with Qt or configuration of X server? Or maybe I need to compile Qt with some special options?
Qt and multiscreen
CC BY-SA 3.0
null
2011-05-11T12:45:37.440
2011-05-13T10:53:28.730
null
null
333,421
[ "qt", "qt4", "x11", "xorg", "multiscreen" ]
5,964,515
1
5,964,717
null
0
53
am running commonsware project for map but the map display squares and not maps or streets![enter image description here](https://i.stack.imgur.com/AREdP.png)
help for google maps
CC BY-SA 3.0
null
2011-05-11T12:49:49.973
2011-05-11T13:04:09.867
2011-05-11T12:53:55.687
638,400
650,319
[ "android", "google-maps", "maps" ]
5,964,683
1
8,031,215
null
1
1,097
I need to realize a WebSite with a grid that shows all items of my Collection in edit mode like this: ![Grid](https://i.stack.imgur.com/Y9b7T.jpg) On Apply the edited Collection should be saved. On changing selection in the Supplier combobox shoud show the appropriated logo below. (Is it possible to realise it using a binding instead of unbound code-behind implementation?) How to implement it with RadGrid? Is any simplier as RadGrid solution in ASP.Net 4.0 with WebForms?
Show all items in edit mode in RadGrid and save all changes by clicking on submit
CC BY-SA 3.0
null
2011-05-11T13:01:40.243
2011-11-06T23:27:47.573
null
null
104,930
[ "asp.net", "binding", "view", "radgrid", "editmode" ]
5,964,688
1
5,966,349
null
2
5,867
The designer I'm working with has given me a monster of an implementation issue... Page background is grey, and atop of it is a crumpled paper texture (non-repeating with painted design elements) for the first 600 pixels (by 1400 pixels across; currently centered as a non-repeating background). At the bottom is another div with more text on it -- , hovered slightly above the top div. - - - My question is ultimately: Thanks! ![screengrab -- note how the bottom bit overlaps the top texture...](https://i.stack.imgur.com/UwVCy.jpg)
Ripped edge pattern on div?
CC BY-SA 3.0
null
2011-05-11T13:01:58.700
2020-09-25T23:41:52.900
2011-05-11T13:09:19.863
467,760
467,760
[ "html", "css", "background", "photoshop", "styling" ]
5,964,701
1
5,965,325
null
5
9,857
I want to a draw a translucent image on a Delphi form, but for some reason it is not working. Here is the original PNG (border is semi transparent): ![Transparent border](https://i.stack.imgur.com/zO0ZC.png) I load the image in a `TImage` object: ``` Image1.Transparent := True; Form1.Color := clWhite; Form1.TransparentColor := True; Form1.TransparentColorValue := clWhite; ``` ![TImage](https://i.stack.imgur.com/zpTvj.png) The application: ![Application](https://i.stack.imgur.com/kEvFC.png) The image isn't translucent. I am working with a BMP image that contains the alpha channel. Am I missing something?
How to draw a translucent image on a form?
CC BY-SA 4.0
0
2011-05-11T13:02:52.990
2021-05-27T17:23:05.077
2019-04-28T20:48:47.517
715,707
715,707
[ "delphi", "transparency", "delphi-7", "alphablending" ]
5,964,821
1
5,967,113
null
1
729
I'm running Visual Studio 2005 for the first time on my new machine (an HP thin client accessing a virtual machine over their [HP SAM Client](http://h71028.www7.hp.com/enterprise/cache/323204-0-0-225-121.html?jumpid=ex_r2548_go/sam/kimsmb/2H07Collateral/062607) software). When execution halts on an exception, the text for that line appears as below. It appears that it can't find the characters in some font variant or something, but I can't figure it out. I tried changing the font from Courier New to other ones, and it made no difference. This same character showed up in that alternate font. I wasn't even sure what to try searching for on here or Google with this one. I'm seeing this in various other places in my code, even at design-time. It definitely appears linked to some specific font attribute, though I haven't been able to tell which. I'm not sure whether this is surprising or not, but copying and pasting the question marks into another application works as though there's no problem. On the same machine, Visual Studio 2008 behaves as expected (that is to say, normally). To provide additional details on VS2005, I'm running version 8.0.5727.42. ![enter image description here](https://i.stack.imgur.com/FJZkP.png)
Diamond-question-marks in Visual Studio
CC BY-SA 3.0
null
2011-05-11T13:11:53.433
2011-05-11T15:52:00.627
2011-05-11T14:47:41.957
105,717
105,717
[ "visual-studio-2005", "fonts", "thin-client" ]
5,964,866
1
5,972,934
null
0
805
I'm creating visual web part project which connects Oracle database using ODP.NET. When I deploy on SharePoint server 2010 , web part gives Oracle dll missing error. Even I tried to compile in x86 or Any CPU but it gives error. Here is the error, ![enter image description here](https://i.stack.imgur.com/WhRXA.png) SharePoint server 2010 is running on my machine whereas Oracle server is running on different machine. I've verified the code in normal ASP web application and it successfully connects Oracle server. Any thoughts?
How to deploy x86 compile code on SharePoint server 2010 ( x64)
CC BY-SA 3.0
null
2011-05-11T13:15:03.527
2011-05-12T06:15:02.007
2011-05-12T02:51:07.090
263,357
263,357
[ "visual-studio-2010", "sharepoint-2010", "odp.net" ]
5,964,960
1
5,965,020
null
1
108
I have the following question from a past exam paper: ![enter image description here](https://i.stack.imgur.com/s8t1m.png) I am struggling to formalise their definitions within the necessary 15 word limit. So far I have: i) The empty string or set of strings that contain zero or many a's OR b's OR both ii) The set of strings that start with one or many a's, unless preceded by b's, followed by one or many a's with zero or many possible preceding b's. My definitions seem rather cumbersome...I just don;t want to lose any info by oversimplifying the definition.
Describing RE's in English Language
CC BY-SA 3.0
null
2011-05-11T13:21:49.340
2011-05-11T13:45:40.053
2011-05-11T13:23:42.663
421,223
559,142
[ "regex", "regular-language" ]
5,965,137
1
5,973,350
null
1
523
I'm developing an application for a bank, and I need a textbox for entering the money, like ![enter image description here](https://i.stack.imgur.com/odCIG.png) My Idea was to create a textbox that has as a background the image of the grid, and than I just set the text size such that there is only a character in each box. but writing iiiii(5 characters) is as long as wwww (4 characters). Can I set a font or a character spacing such hat i ensure that the characters writen in the textbox will appear in separate boxes. Ps: there are other similar boxes for name, so I don't inpu only digits.
silverlight textbox with equal space between leters
CC BY-SA 3.0
null
2011-05-11T13:34:42.717
2011-05-12T04:36:38.823
2011-05-11T13:37:25.007
109,702
645,924
[ "silverlight", "textbox" ]
5,965,202
1
5,966,207
null
0
320
I have a view with two UILabel (simulating a header and a footer) and a UIScrollView placed between them vertically: ![Layout in NIB file](https://i.stack.imgur.com/sL77B.png) However, if I start the application in simulator the UIScrollView goes a few pixels up while the rest of elements remain in their position: ![Layout in simulator](https://i.stack.imgur.com/YlW4q.png) Is it normal that behaviour? How can I place the UIScrollView exactly at the position I want? Thanks!
UIScrollView placed in NIB file goes up when application starts
CC BY-SA 3.0
null
2011-05-11T13:38:35.107
2011-05-11T14:48:37.800
2011-05-11T13:44:54.623
592,454
592,454
[ "iphone", "ios4", "uiscrollview", "nib" ]
5,965,892
1
5,966,091
null
0
360
When WPF window appear first time, its content seem frozen. To refresh content I need to resize form, then it will be fixed. Or I hit the TAB then find a listbox -it's not visible- and click it and viola! Form updates its content again. What do you think? Weird huh? Thanks in advance! ![enter image description here](https://i.stack.imgur.com/slghc.jpg) Edit: ``` private void Window_Loaded(object sender, RoutedEventArgs e) { this.Show(); while (!AppMain.needClose) { System.Windows.Forms.Application.DoEvents(); DoThings(); } } ```
WPF form should resize to show its content
CC BY-SA 3.0
0
2011-05-11T14:27:56.180
2011-05-11T14:43:54.097
2011-05-11T14:38:24.377
15,369
627,193
[ "c#", "wpf", "wpf-controls" ]
5,966,009
1
null
null
-1
1,337
Is it possible to create chart (as shown on screenshot) in DevExpress Chart control? ![enter image description here](https://i.stack.imgur.com/Bf5aM.png)
DevExpress Charts Question
CC BY-SA 3.0
null
2011-05-11T14:35:55.843
2019-04-28T20:00:05.230
2011-05-11T14:42:32.017
637,449
637,449
[ "c#", "charts", "devexpress" ]
5,966,196
1
5,966,278
null
3
1,989
I am using imagemagick and ghostscript in my windows pc running php5 in apache. I tried ``` <?php $im = new imagick('test.pdf[0]'); $im->setImageFormat( "jpg" ); header( "Content-Type: image/jpeg" ); echo $im; ?> ``` and found its not working. My php info file shows imagick working... ![enter image description here](https://i.stack.imgur.com/q3sMe.jpg) I am trying to generate a thumbnail without saving it in the server hard drive...
pdf thumbnail imagemagick php not working
CC BY-SA 3.0
0
2011-05-11T14:48:01.653
2012-12-20T20:25:49.090
2012-12-20T20:25:49.090
367,456
484,082
[ "php", "imagemagick", "ghostscript" ]
5,966,292
1
null
null
2
1,102
I am searching for a Java Swing calendar component that would allow adding schedule and reminder features, but [MiG Calendar](http://www.migcalendar.com/) is too expensive. Here's a screenshot: ![http://www.migcalendar.com/images/home_screenshot_1.jpg](https://i.stack.imgur.com/lbTBQ.jpg) Any suggestion?
search java swing calendar appointement component
CC BY-SA 3.0
null
2011-05-11T14:53:38.177
2011-12-08T19:40:03.137
2011-12-08T19:40:03.137
84,042
660,503
[ "java", "swing", "javabeans" ]
5,966,388
1
5,966,874
null
9
14,495
I've created a spinner, from where a user can select a value. I CAN change the textcolor of the spinner itself like shown in this picture: ![enter image description here](https://i.stack.imgur.com/4c9fA.png) Unfortunately when I press the spinner a list of items, to be selected, is shown, but these have a white font color on white background, and I just haven't been able to change this: ![enter image description here](https://i.stack.imgur.com/gdagP.png) I've googled the problem and others have experienced the same problem. None of the fixes suggested worked for me. As far as I understand I have to make a custom list of some kind, but well.. I'm not able to make it work. Any suggestions? My code looks like this (array_spinner is a array of strings): ``` ArrayAdapter adapter = new ArrayAdapter(this, R.layout.row, array_spinner); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); ``` And my row.xml: ``` <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/spinnerText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:textColor="#000000" android:textSize="14dp" /> ```
How do I change the font color of the selection list in a spinner?
CC BY-SA 3.0
0
2011-05-11T15:00:46.587
2013-07-21T16:14:30.643
null
null
312,050
[ "android", "spinner" ]
5,966,644
1
5,972,010
null
0
313
I try to set the frame of a UITableView to (190,0,610,768) in landscape mode. The frame parameters are correctly set but display is not correct. To contrast the result, I added a UIlabel with same frame to the bottom: ``` CGRect frame = CGRectMake(190, 0, 610, 768); UILabel *lbtb = [[UILabel alloc] initWithFrame:frame]; lbtb.backgroundColor = [UIColor cyanColor]; lbtb.text = @""; [self.view addSubview:lbtb]; dishMenuVC = [[DishMenuViewController alloc] init] ; dishMenuVC.view.frame = frame; dishMenuVC.view.backgroundColor = [UIColor redColor]; dishMenuVC.view.alpha = 0.5; [self.view addSubview:dishMenuVC.view]; ``` ![enter image description here](https://i.stack.imgur.com/CY9Lr.png)
can't set tableview frame in landscape, parameters set but view is strange [screenshot attached]
CC BY-SA 3.0
null
2011-05-11T15:20:33.903
2011-05-12T00:18:41.433
null
null
665,564
[ "cocoa-touch", "ios", "ipad", "uitableview" ]
5,966,905
1
5,967,002
null
53
34,455
Which MVC diagram is correct? Each have different arrows... ![](https://upload.wikimedia.org/wikipedia/commons/b/b5/ModelViewControllerDiagram2.svg) [](https://i.stack.imgur.com/7RXh4.gif) [stannard.net.au](http://blog.stannard.net.au/blog/media/simple-mvc-framework/mvc.gif) ![](https://betterexplained.com/wp-content/uploads/rails/mvc-rails.png) [](https://i.stack.imgur.com/h6Gz4.gif) [sun.com](http://java.sun.com/blueprints/patterns/images/mvc-structure-generic.gif) [](https://i.stack.imgur.com/eSe7V.png) [shopno-dinga.com](http://www.shopno-dinga.com/dustbin/mvc.png)
What is the right MVC diagram for a web application?
CC BY-SA 4.0
0
2011-05-11T15:38:18.990
2021-07-01T07:06:45.223
2019-08-11T20:42:40.743
4,751,173
635,039
[ "model-view-controller", "design-patterns" ]
5,967,179
1
6,140,071
null
1
264
Is there a way to use the nifty Expression Blend ranged value control in your own projects? This one: ![enter image description here](https://i.stack.imgur.com/O3Wsr.png) I would really, really love to know.
How to use the Expression Blend 4 ranged property control
CC BY-SA 3.0
0
2011-05-11T15:56:45.903
2011-05-26T14:18:01.960
2011-05-26T13:47:38.187
443,602
443,602
[ "silverlight", "controls", "expression-blend" ]
5,967,394
1
5,967,532
null
7
115
I have what I think is some pretty basic css, and it behaves differently in FF4 and IE8. The CSS in question is like this: ``` div.showme { border: 1px dotted blue; position: absolute; top :10px; bottom :10px; left: 1%; right: 33%; overflow: auto; padding: 0.8em 1em 0.8em 1em; line-height:1.75em; } div.showme a { padding: 0em 5px 0em 5px; margin: 0; white-space: nowrap; color: #FF00FF; background-color:#E6E6FA; border: 1px solid grey; padding: 0em 4px 0em 4px; } div.showme a:link { color: blue; } div.showme a:visited { color: #1E90FF; } div.showme a:active { color: red; } ``` The relevant HTML looks like this: ``` <div class='showme'> <a href='one'>one</a> <a href='two'>two</a> ... </div> ``` The problem is, the padding is not consistently displayed, in IE8. ![enter image description here](https://i.stack.imgur.com/46khf.png) In Firefox, it works as I would expect. working example: [http://jsbin.com/ogosa4](http://jsbin.com/ogosa4) Using the above working demonstration, if you resize the window you will see the padding on the "leading" element on each line within the div, change from zero to non-zero. How can I fix this?
How can I workaround this CSS anomaly?
CC BY-SA 3.0
0
2011-05-11T16:13:43.717
2011-05-11T18:44:17.777
null
null
48,082
[ "css" ]
5,967,533
1
null
null
3
147
![Diagram](https://imgur.com/KEGA4.png) See the picture above. Each navigation tab needs to have 2 pixels separation on either side and line up exactly with the header image on the edges. Now they would like to introduce a 5th navigation tab (and possibly a 6th). Is it possible to code this in a way where you could stick a 5th or 6th tab in there and everything would resize appropriately with lists or tables or some other solution? Still keeping the 2 pixels separation and lining up with the edges exactly? I wasn't sure if it was possible or you would just have to define the widths each time for each tab based on the math involved to line it all up correctly flush with the edges.
How to display navigation tabs with the desired border? Table, list, something else?
CC BY-SA 3.0
null
2011-05-11T16:24:09.433
2017-09-21T07:38:54.003
2017-09-21T07:38:54.003
4,370,109
749,093
[ "html", "css", "html-lists" ]
5,967,886
1
5,997,255
null
5
1,413
It's the mix of text sizes that breaks it, if I replace the ``` <item name = "android:textSize">16sp</item> ``` with just a change of colour like ``` <item name="android:textColor">#00ff00</item> ``` then it runs OK. The references to TextLine,measure in the logcat should have given me a clue. I'd still like to fix it though, I'm sure others will have a requirement for a mix of sizes in a single text line. - minimal code example is shown at the end of this post Code which works fine under SDK 2.everything, throws a null pointer exception when run in a 3.0 emulator. I've narrowed it down to the only occurrence of a SpannableString in my code. I'm using this to put some text of differing font sizes in a banner area at the top of the screen. The logcat is: ``` FATAL EXCEPTION: main java.lang.NullPointerException at android.text.style.TextAppearanceSpan.updateDrawState(TextAppearanceSpan.java:209) at android.text.TextLine.handleRun(TextLine.java:848) at android.text.TextLine.measureRun(TextLine.java:399) at android.text.TextLine.measure(TextLine.java:278) at android.text.TextLine.metrics(TextLine.java:252) at android.text.Layout.measurePara(Layout.java:1432) at android.text.Layout.getDesiredWidth(Layout.java:89) at android.text.Layout.getDesiredWidth(Layout.java:68) at android.widget.TextView.onMeasure(TextView.java:5713) at android.view.View.measure(View.java:10577) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:581) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:365) at android.view.View.measure(View.java:10577) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:581) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:365) at android.view.View.measure(View.java:10577) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:581) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:365) at android.view.View.measure(View.java:10577) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4270) at android.widget.FrameLayout.onMeasure(FrameLayout.java:267) at android.view.View.measure(View.java:10577) at android.widget.LinearLayout.measureVertical(LinearLayout.java:764) at android.widget.LinearLayout.onMeasure(LinearLayout.java:519) at android.view.View.measure(View.java:10577) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4270) at android.widget.FrameLayout.onMeasure(FrameLayout.java:267) at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:1876) at android.view.View.measure(View.java:10577) at android.view.ViewRoot.performTraversals(ViewRoot.java:885) at android.view.ViewRoot.handleMessage(ViewRoot.java:1944) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:126) at android.app.ActivityThread.main(ActivityThread.java:3997) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:491) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599) at dalvik.system.NativeStart.main(Native Method) ``` The code is in a handler called by a timer, it writes to a text view with the following essential lines (null checks etc omitted) ``` TextView tvBanner = (TextView) findViewById(R.id.RefText); ..... int startSpan = altDispStr.indexOf("\n"); int endSpan = altDispStr.length(); spanRange = new SpannableString(altDispStr); spanRange.setSpan(new TextAppearanceSpan(this, R.style.custompoint), startSpan, endSpan, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); .... .... tvBanner.setText(spanRange); ``` When I trap it in the debugger (not easy with the 3.0 emulator and 3GB of RAM) it gets through the handler method OK, - spanRange is not null, but the NPE and FC happens sometime later in the main looper. The textview (RefTxt) is in an xml called infobar.xml which is included in the main.xml. The infobar's essential components are: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/BannerRelView" android:layout_alignParentTop="true" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:background="#800000ff" android:layout_width="wrap_content"> <TextView android:id="@+id/BannerOptionsButton" android:layout_alignParentRight="true" .... </TextView> <TextView android:id="@+id/BannerGPS" android:layout_toLeftOf="@+id/BannerOptionsButton" .... </TextView> <TextView android:id="@+id/RefText" android:layout_toLeftOf="@+id/BannerGPS" ...... </TextView> </RelativeLayout> ``` If I replace the SpannableString with a plain old String then the app runs in 3.0 emulators. I'm wondering if there are any extra measures I need to take with Spannables and tablet devices? When it dies, the debug perspective shows ![crash state](https://i.stack.imgur.com/eUPNb.jpg) - mt and tl are both not null I've reduced this to the smallest code example which demonstrates the error, it's OK under 2.1 but crashes with the same NPE under 3.0 Activity code: ``` public class SpanTest extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String dispStr = "I'm the first line\nI'm the second line"; TextView tvBanner = (TextView) findViewById(R.id.textView1); int startSpan = dispStr.indexOf("\n"); int endSpan = dispStr.length(); Spannable spanRange = new SpannableString(dispStr); spanRange.setSpan(new TextAppearanceSpan(this, R.style.custompoint), startSpan, endSpan, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); tvBanner.setText(spanRange); } } ``` main.xml is a LinearLayout containg just the one TextView. My styles.xml containing custompoint is: ``` <?xml version="1.0" encoding="utf-8"?> <resources> <style name="custompoint"> <item name="android:textSize">24sp</item> <item name="android:textStyle">bold</item> </style> </resources> ``` .
API11 (and now12) and Spannable causing runtime NPE
CC BY-SA 3.0
0
2011-05-11T16:55:44.327
2015-06-09T11:58:30.777
2011-05-14T07:35:04.320
440,010
440,010
[ "android" ]
5,967,938
1
5,968,017
null
3
5,880
Here is a small snippet of my HTML: ``` <img src="http://hss.fullerton.edu/philosophy/Red%20Square.gif" id="test1" /> <table id="test2"> <tr><td>Test</td></tr> </table> ``` I have an image of a red square and I want the table to overlap the bottom of it. Here is the CSS: ``` #test1 { width: 42px; height: 42px; display: block; margin-left: auto; margin-right: auto; margin-bottom: -15px; } #test2 { z-index: 1; background-color: pink; width: 80px; height: 50px; margin-left: auto; margin-right: auto; } ``` It isn't working, however: ![enter image description here](https://i.stack.imgur.com/I4C1d.png) As you can see, the image is still on top of the `table` - not what I want. Notice in my CSS that I've explicitly set the table's `z-index` to `1` and it still won't overlap the image. What am I doing wrong? [http://jsfiddle.net/george_edison/uk7Pz/](http://jsfiddle.net/george_edison/uk7Pz/)
How to get a table to overlap an image?
CC BY-SA 3.0
null
2011-05-11T17:01:46.660
2017-09-06T10:18:29.850
2017-09-06T10:18:29.850
4,370,109
193,619
[ "html", "css", "image", "html-table", "overlap" ]
5,968,156
1
5,968,778
null
9
36,932
How can I add an external server in Aptana Studio 3, since there is no Servers view? [Here](http://docs.aptana.com/docs/index.php/Configuring_Aptana_Studio_to_use_an_external_web_server) [are](http://docs.aptana.com/docs/index.php/Setting_up_an_external_web_server_to_preview_PHP_and_other_non-HTML_pages) some instructions on how to do it but they both use Windows > Show view > Servers which is no longer available in Aptana 3. With the console is possible? How? I have a wamp server installed and I can run correctly php files stored inside the htdocs folder. Now I want to run those php files from Aptana but I was getting blank pages. In Project > Run Configurations I noticed the "Use selected server" option but no possibilty to add a server there, so I used "Use base URL" together with "Append project name" and now I can run php files from Aptana but I am still wondering if it is the best option and how I could tell Aptana to use the wamp server. ![adding a server in Aptana Studio 3](https://i.stack.imgur.com/X0sEF.png)
Adding an external server in Aptana Studio 3
CC BY-SA 3.0
0
2011-05-11T17:24:59.250
2014-04-09T19:33:25.603
null
null
129,103
[ "php", "apache", "windows-xp", "aptana" ]
5,968,218
1
6,319,556
null
1
490
I know that Android's Youtube app is not open source, but I pulled apart the apk with apktool and found that they have a class, YoutubeListView used frequently in their app. Is there already an open source implementation of the Youtube Player Activity's title/ fling view/ layout? I know of similar views like Joao Machete's FlingAndScrollViewer, but I need it to be rigge to a title menu and work as smoothly as that on the Youtube app. If there is no open source implementation, either how hard would it be to convince Google to release just that component's source, or to implement it myself? Thanks Btw, the footer in this layout is what I am talking about. It has titles like Info & Related videos that can be clicked and it scrolls to them, and it can be scrolled left and right. ![](https://i.stack.imgur.com/yFbqB.jpg)
Android View similar to Google's Youtube app?
CC BY-SA 3.0
null
2011-05-11T17:30:03.167
2011-06-12T01:24:53.567
null
null
148,824
[ "java", "android", "view", "android-layout", "youtube" ]
5,968,580
1
5,968,750
null
4
1,991
I am trying to build an android layout using `layout_weight` to fit all sizes of devices and I have some trouble understanding its comportment. I noticed that changing the `layout_width`/`layout_height` influenced the `layout_weight` comportment, but I don't understand how. Let's say for example I want to have a vertical `LinearLayout` divided in three inners `LinearLayout` such that the one at the top and the one at the bottom are filling 25% of the screen, and the on in the middle 50%, and that should not depend of the content of the inner layouts. (If the content of a inner `LinearLayout` is too big, it should not shift the others layouts) In order to do this, should I set the `layout_height` attribute of the inner `LinearLayout` to `fill_parent` or to `wrap_content`? Thanks! EDIT: It looks like the layout_weight is inversely proportional to the size the layout will occupate. 3 examples: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <LinearLayout android:id="@+id/layout1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="#FF0000"/> //RED <LinearLayout android:id="@+id/layout2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="#00FF00"/> //GREEN <LinearLayout android:id="@+id/layout3" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="#0000FF"/> //BLUE </LinearLayout> ``` Results: ![enter image description here](https://i.stack.imgur.com/B7eCL.png) ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <LinearLayout android:id="@+id/layout1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="#FF0000"/> //RED <LinearLayout android:id="@+id/layout2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="2" android:background="#00FF00"/> //GREEN <LinearLayout android:id="@+id/layout3" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="#0000FF"/> //BLUE </LinearLayout> ``` Results: ![enter image description here](https://i.stack.imgur.com/Z5lke.png) **Weight 3/2/3 (What I entended to do with 1/2/1): ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/mainLayout" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <LinearLayout android:id="@+id/layout1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="3" android:background="#FF0000"/> //RED <LinearLayout android:id="@+id/layout2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="2" android:background="#00FF00"/> //GREEN <LinearLayout android:id="@+id/layout3" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="3" android:background="#0000FF"/> //BLUE </LinearLayout> ``` Results:![enter image description here](https://i.stack.imgur.com/rL6p0.png)
Android layout_weight comportment
CC BY-SA 3.0
0
2011-05-11T18:03:32.570
2012-12-06T09:46:58.493
2011-05-11T19:31:45.480
488,054
488,054
[ "android", "android-layout", "android-linearlayout" ]
5,968,644
1
5,968,938
null
1
146
I am using a Nib as a template for several buttons. It seemed to work fine, they each have their own independent state. However when I went to release the buttons I would crash in the dealloc. Here is the code... ``` mSoundBtns = new cSoundButton*[mNumSounds]; for(unsigned int i = 0 ; i < mNumSounds; ++i) { mSoundBtns[i] = nil; } for(unsigned int s = 0; s < mNumSounds; ++s) { [[NSBundle mainBundle] loadNibNamed:@"InstanceSoundButton" owner:self options:nil]; //Auto Loads via Outlet into 'soundNib' mSoundBtns[s] = soundNib; soundNib = nil; uint32 count = mSoundBtns[s].retainCount; NSLog(@"Last Count: %d", count); } for(unsigned int j = 0; j < mNumSounds; ++j) { [mSoundBtns[j] release]; //**** Crash here on 7th (of 8) release mSoundBtns[j] = nil; } ``` Header: ``` @interface cLocationContext { ... cSoundButton** mSoundBtns; IBOutlet cSoundButton* soundNib; } @property (nonatomic, assign) IBOutlet cSoundButton* soundNib; @end ``` The Nib is very simple, it just include a parent view and a child view of a custom view type. ![Nib](https://i.stack.imgur.com/kfuTm.png) cSoundButton simply keeps track of a name and a boolean state Mute or Not. Here is the dealloc ``` - (void)dealloc { delete[] mSoundTag; // Call the inherited implementation [super dealloc]; //****Crashes in here } ``` The crash is inside the call to super dealloc, in UIButton -> UIButtonContent dealloc. I assume I am doing something poor with my memory management like deallocing twice but I can't spot where. Is what I am doing by loading the nib multiple times legal?
Failing to Release after Multiple Nib loads
CC BY-SA 3.0
null
2011-05-11T18:08:47.610
2011-05-11T19:27:08.253
null
null
647,315
[ "iphone", "objective-c", "memory-management", "refcounting" ]
5,968,715
1
5,990,640
null
2
1,043
I used to use Subversion for my source control in Xcode 4. Increasingly, I have been having problems with it. Since Xcode now supports Git, I thought I would try that. It seems to be set up and working, but I'm a little concerned about something. Under Organizer -> Repositories, it shows a Git Repository for each project. However, the indicator light on the right side of the Repository name is Yellow. I can find no documentation about this and can't seem to fix it. The samples on Apple's User Guide show the indicators are Green (see below). But, on mine they are Yellow. Is this something to be concerned about? How do I fix it? Do I need to completely uninstall SVN? FYI, I have tried the following: 1. Have removed all .SVN directories from my projects. 2. Have moved the SVN repository to another location because it kept showing up in Organizer. Any help is appreciated! ![This shows the indicators are green.](https://i.stack.imgur.com/rciKO.png)
Yellow Indicator on Git Repository under Xcode 4
CC BY-SA 3.0
0
2011-05-11T18:16:05.797
2011-05-13T18:04:22.323
null
null
399,076
[ "git", "xcode4" ]
5,968,729
1
5,968,763
null
0
193
I want to go with Linq2SQL first and get it to create sql db for me but when I was creating fields I realized I couldn't see any Identity feature or something on Properties window. Here is the snapshot of the selected UserId column in Linq2SQL file. Thanks in advance. ![enter image description here](https://i.stack.imgur.com/hXyNJ.png)
How to Specify Identity Column in Linq2SQL
CC BY-SA 3.0
null
2011-05-11T18:16:52.237
2011-05-11T18:19:44.087
null
null
44,852
[ "c#", "asp.net", "linq-to-sql" ]
5,968,796
1
5,970,018
null
4
950
Let's say I have two entity objects "table" and "chicken." Now let's say, I have a "wing" object, and I want that wing to have a 0..1-1 relationship with table and chicken. In otherwords, I want a nullable table.wing and a nullable chicken.wing. Is there a good way, using Entity Framework 4, to make the wing object have the restriction that it can either be associated with a table OR a chicken? Note: I don't want to have a wingedobjects baseclass in my dictionary- this needs to be a "has one" not an "is one." My thought is that I can't make a unique restraint on the collection of references, so I'll have to wrap the Entity properties with something like: ``` public partial class Wing: ... public Table Table { get { return this.Table; } set { //make sure Chicken is null this.Table = value; } } ... } ``` This strikes me as pretty hacky and not too clean, so I was looking for a better, if not best, practices solution. Edit: To be clear, I currently have a 0..1-1 relationship between table and wing, and a 0..1-1 relationship between chicken and wing. Thus, I can create a table.wing and I can then look at wing.table. What I want is to ensure that I ALWAYS have a null value if I query table.wing.chicken or chicken.wing.table. The wing must be associated with EITHER one table OR one wing. ## Example of current behavoir: In response to @morganppdx's comment: Given this Entity Diagram: ![enter image description here](https://i.stack.imgur.com/YN7GD.png) And the following in Program.cs: ``` class Program { static void Main(string[] args) { Model1Container container = new Model1Container(); Wing chickenwing = new Wing { Shape = "birdlike" }; Chicken chicken1 = new Chicken { Breed = "Andalusian", Wing = chickenwing }; Table table1 = new Table { Style = "Mission", Wing = chickenwing }; // Should throw exception! container.AddToChickens(chicken1); container.AddToTables(table1); container.SaveChanges(); Console.Write(String.Format("Table {0}'s wing has a {1} shape...", table1.Id, table1.Wing.Shape)); Console.Write(String.Format("Table {0} has {1} chicken wings!", table1.Id, table1.Wing.Chicken.Breed)); Console.ReadLine(); //wait for input to give us time to read } } ``` The resulting console will show: ``` Table 1's wing has a birdlike shape...Table 1 has Andalusian chicken wings! ``` This result is what I wish to avoid. It should throw an exception when chickenwing is associated with table1 because it is already associated with chicken1, and cannot be associated with both a table and with a chicken. It is quite possible that I am building the relationship incorrectly, and thus not getting @morganpdx's stated exception where I want it. The code is available at: [https://github.com/mettadore/WingThing](https://github.com/mettadore/WingThing)
Good way to do "either/or" relationship in Entity Framework (SQL Server)
CC BY-SA 3.0
0
2011-05-11T18:22:35.003
2011-05-11T21:25:44.230
2011-05-11T19:58:25.680
74,919
74,919
[ "sql", "entity-framework-4", "one-to-one", "chicken-scheme" ]
5,968,832
1
5,994,284
null
12
856
I work with a lot of monochrome image data and this morning I noticed that there appears to be a significant difference between the way libjpeg and the .Net jpeg codec handle monochrome data. It appears that a monochrome image saved at ANY quality setting using libjpeg and opened using the default .Net jpeg codec actually only loads with 16 different shades of gray and all intermediate shades are rendered as stippled. Here is the histogram of a smooth gradient saved by libjpeg and loaded by .net ![Histogram of codec conflict affected gradient](https://i.stack.imgur.com/Oz6Gj.png) The histogram should have been perfectly level. And here is a (zoomed in) sample of what that gradient looks like (it should a be perfectly smooth transition) ![enter image description here](https://i.stack.imgur.com/C6bz7.png) This should be a smooth transition from gray 85 on the left to gray 136 on the right but only 4 shades of gray are actually rendered to make that transition. My question is am I crazy and if not just how far does this codec discrepancy go? Is there a good workaround if you are using both libraries in different programs? I am not blaming either codec, just pointing out what appears to be a discrepancy. I noticed this with images I knew were created using libjpeg, assumed it was a quality setting issue, tried using faststone image resizer to create test images and got the same result, tried using irfanview and got the same result again. As both of those programs must use some jpeg library I tend to assume they are also using libjpeg and there is a genuine codec conflict. On the loading side I have run into the same result loading images with both my own .net code and using Paint.net. Finally, here is a sample at normal resolution so you can download it and try it yourself. Loading it in some programs will give you a nice gradient (e.g. your browser) but loading it with your own .Net code, or Paint.Net will give you a dithered gradient like the above rendered using only 16 shades of gray. ![enter image description here](https://i.stack.imgur.com/1kSAZ.jpg) Does anyone know more about this, how far it goes and what good workarounds might be?
Do the libjpeg and the .Net jpeg codec really differ significantly on monochrome data?
CC BY-SA 3.0
null
2011-05-11T18:25:25.240
2011-05-13T15:36:46.060
2011-05-13T14:53:17.180
null
null
[ ".net", "image", "image-processing", "jpeg", "libjpeg" ]
5,968,918
1
5,969,019
null
7
1,258
I've noticed that StackOverflow resorted to using a table-based layout for the comments area beneath posts: ![enter image description here](https://i.stack.imgur.com/4nh0E.png) Notice how the text all stays to the right of the button area, regardless of how many lines of text there are. I am trying to accomplish the same effect using a table-less layout, and failing miserably. Is there any good way to do achieve this without tables?
Side-by-side elements without using tables
CC BY-SA 3.0
null
2011-05-11T18:33:34.127
2011-05-11T20:11:04.010
null
null
120,955
[ "html", "css" ]
5,969,254
1
5,981,567
null
2
2,073
I'm trying to line up a menu that I've created using `Ext.menu.Menu`. As you can see below, the menu is displayed to the right of its parent. ![The menu isn't quite right](https://i.stack.imgur.com/KbD2J.png) What's the best way to get this perfectly aligned?. I've looked into `getPostion()` and `setPosition()` briefly and I'm not sure that's the correct way to do this. My menu code is pretty basic: ``` var userMenu = new Ext.menu.Menu({ id: 'userMenu', width: 120, height: 70, items: [ { text: 'My Settings', handler: settingsHandler }, { text: 'Sign out', handler: signoutHandler } ] }); var menuHandler = function(e) { userMenu.show('parent-menu'); }; Ext.get('parent-menu').on('click',menuHandler); ``` Is there anything that I can add here? Thanks in advance!
Ext.menu.Menu positioning
CC BY-SA 3.0
null
2011-05-11T19:01:11.257
2011-05-12T23:23:09.980
2011-05-12T16:43:28.383
643,779
643,779
[ "javascript", "html", "css", "extjs" ]
5,969,447
1
5,969,719
null
43
11,442
How can I create a random integer `n` in Java, between `1` and `k` with a "linear descending distribution", i.e. `1` is most likely, `2` is less likely, `3` less likely, ..., `k` least likely, and the probabilities descend linearly, like this: ![enter image description here](https://i.stack.imgur.com/3aNYw.jpg) I know that there are dozens of threads on this topic already, and I apologize for making a new one, but I can't seem to be able to create what I need from them. I know that using `import java.util.*;`, the code ``` Random r=new Random(); int n=r.nextInt(k)+1; ``` creates a random integer between `1` and `k`, distributed uniformly. Any hints for creating an arbitrarily distributed integer, i.e. `f(n)=some function`, `P(n)=f(n)/(f(1)+...+f(k))`), would also be appreciated, for example: ![enter image description here](https://i.stack.imgur.com/1wjO1.jpg).
Java: random integer with non-uniform distribution
CC BY-SA 4.0
0
2011-05-11T19:20:49.403
2022-04-02T23:54:56.063
2020-07-28T23:49:22.787
214,143
744,221
[ "java", "random", "non-uniform-distribution" ]
5,970,345
1
5,971,364
null
0
3,195
I'm new to android graphic so hold on to your hats! The screen is black whatever i do. I draw a circle and i draw bitmap and noting shows. Here is xml,code and a picture showing my screen. Im thinking i have to set the size of the ImageView maybe that's why it's black??! R.layout.main1 ``` <?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"> <com.hasse.move.DrawView android:id="@+id/mainView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:background="#00FF00" android:adjustViewBounds="true" /> <RelativeLayout android:id="@+id/InnerRelativeLayout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" > <EditText android:id="@+id/edittextaddtext" android:layout_width="fill_parent" android:layout_toLeftOf="@+id/btnsave" android:layout_height="wrap_content" android:text="wrap" /> <Button android:id="@+id/btnsave" android:layout_alignParentRight="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="save" /> </RelativeLayout> </RelativeLayout> ``` DrawView class ``` public class DrawView extends ImageView { private Context ctx; public DrawView(Context context, AttributeSet atts) { super(context, atts); this.ctx = context; } @Override protected void onDraw(Canvas canvas) { String filePath = Environment.getExternalStorageDirectory().toString() + "/PTPPservice/163693fe-7c48-4568-a082-00047123b9f1.2.IMAG2200.jpg"; BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 2; Bitmap bitmap = BitmapFactory.decodeFile(filePath,options); canvas.drawBitmap(bitmap, 10,10, null); canvas.drawCircle(10,10,10,null); } ``` } main Activity ``` public class Main extends Activity { DrawView theImage; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); // draw the view setContentView(R.layout.main1); theImage = (DrawView) findViewById(R.id.mainView); //do stuff } @Override public void onConfigurationChanged(Configuration newConfig) { // Toast.makeText(this, "onConfigurationChanged",Toast.LENGTH_LONG).show(); super.onConfigurationChanged(newConfig); } ``` } Image ![enter image description here](https://i.stack.imgur.com/kRUKK.png)
android - Why is ImageView canvas black?
CC BY-SA 3.0
null
2011-05-11T20:40:09.463
2011-05-11T22:33:44.037
2011-05-11T20:56:36.593
538,837
538,837
[ "android", "canvas", "imageview" ]
5,970,401
1
5,970,623
null
4
695
I'm really hoping I can describe this question in an understandable way. This is a puzzle that I have not been able to begin to solve even though I (mostly) understand it. I'm just not sure where to start, and I'm really hoping someone out there can get me headed in the right direction. I have a LARGE table of data. It describes relationships between objects. Let's say the Y-axis has items numbered 1-1000, and the X-axis has items 1-1000 also. If item #234 on the Y-axis is related to item #791 on X, there will be a mark in the table where the row and column cross. In some industries this is referred to an a Truth Table. One can, at a glance, see how many items in a system relate to each other. The marks in the table can help to identify trends and patterns. Here's some other helpful stuff about the nature of the table: - - - - The end result is that this is going to be a report that needs to be printed. We have successfully printed a table that had about 100-150 items on each axis on an 11in X 17in piece of paper. Any more than that and it begins to be so small it's unreadable. What I am trying to do is split the super large tables into smaller tables, but related points need to stay together. If I grab item 1-100 on X then I would need each item they relate to from Y. I've generated a number of these tables and, while the number of relationships CAN be arbitrary, I have never seen an item relate to all other items. So in real practice the range is more like 1 <= r <= (10% * axisTotal). If an item's relationships exceed this range, it can be split up into multiple tables, but that is not optimal at all. At the end of the day I think we, and our clients, would be happy if a 1000x1000 item table was split into 8 to 10 printed pages of smaller, related tables. Any guidance would be a great help! Thanks. One other thing worth noting, there will be no empty rows or columns in the table. Every item on both the x and y axis will relate to at least 1 item on the opposite axis. Here is an example of a small truth table that I'm describing: ![Example Truth Table](https://i.stack.imgur.com/2fLC5.png). Every row and column has at least one relationship. May 18th, 2011 For what it's worth, I was moving pretty good on this project and I got pulled off for a couple of weeks. So it's going to a little while before I get back to this problem. But it is one that I will have to solve soon. July 11th, 2011 Bummer. Well, looks like I'm not going to be able to solve this problem right now. I was really hoping to be able to figure this out. Through discussion we decided to present the truth table in an Excel spreadsheet as an add-on resource to the main report. Excel 2007 and later will handle 1000's of columns which will more than suffice. Plus, we added some VBA which allows the viewer to double click on the column titles. This action will reduce the rows to only ones where there are interactions. Then it removes empty columns. In this way they can see a small sub-table based on the item they want to view, and can print it if they want.
How would I split a large set of tabular data into smaller relevant tables? (Not a DB Question)
CC BY-SA 3.0
0
2011-05-11T20:45:15.087
2011-07-11T18:58:04.600
2011-07-11T18:58:04.600
579,148
579,148
[ "vb.net", "algorithm", "math", "scripting" ]
5,970,463
1
5,970,760
null
0
177
I am retrieving the contents of a database using a object (its returning only one field) and then comparing it with a string which has been hashed with SHA1 .The code is as follows : ``` protected void Onbutton_click_login(object sender, System.EventArgs e) { var dbcontext = new PrepLicensingSolution2010.DAL.LicensingEntities1(); var user = dbcontext.getloginname(loginName.Text); string HashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile(Password.Text, "sha1"); if (user.ToString() == HashedPassword) { Response.Redirect("faqs.aspx"); } else { Response.Redirect("Default.aspx"); } } ``` I put breakpoints and checked the data at each stage of the flow and the data in the object result set and in the string are the same but even then the conditional fails ![Breakpoint information](https://i.stack.imgur.com/CHkdU.png) whats interesting is both the types being compared are of the type string and of the same value,so why is that that the redirect goes to the default.aspx page. The image contains the data from the breakpoints Any inputs would be great. Thanks
ASP.NET 4 : Comparing the result set of an object and a string
CC BY-SA 3.0
null
2011-05-11T20:50:31.307
2011-05-11T21:19:59.863
null
null
535,583
[ "asp.net" ]
5,970,616
1
5,970,652
null
10
58,647
i am trying to recreate the login form shown on tinypic's main page. ![login](https://i.stack.imgur.com/cCGl2.jpg) in html, i have the 3 elemnts like this: ``` E-Mail: <input type="text" name="id" maxlength="30" value="" /> Password: <input type="text" name="pw" maxlength="30" value="" /> <input type="submit" name="submit" value="Login" /> ``` i have tried putting them into separate divs, using float:left with a unique class in css but the code is really messy unreasonably long. so essentially, i wanted to know if there was a simple way to achieve this layout with html and css. thanks for the time!
displaying html form inputs horizontally
CC BY-SA 3.0
0
2011-05-11T21:06:20.433
2020-12-23T17:41:41.063
null
null
545,632
[ "html", "css", "forms", "input" ]
5,970,636
1
5,972,662
null
0
507
I'm working through the book and have come upon a problem. The book has me install the Blurb plugin, which seems to work, but states that we will be using it as if it were a domain class and using it a pre-existing controller. The code that I am to add to the controller looks like this ``` def blurb = Blurb.findByName("custom_${event.id}" ) if (!blurb){ blurb = new Blurb(name:"custom_${event.id}" , content:"" ).save() } ``` When I do this I receive the same error in the IDE and the run output '' and I am directed specifically to this line `blurb = new Blurb(name:"custom_${event.id}" , content:"" ).save()` Can anyone tell me what might be going wrong? I'm assuming the plugin is installed properly because if I try to access it's controller/action directly '[http://localhost:8080/TekDays/blurb/create](http://localhost:8080/TekDays/blurb/create)' the plugin's provided view renders properly. Thanks! -- For reference I am using STS / Grails 1.3.7 --- I've attached a screenshot showing my project from the STS interface to show how my project is laid out in the event that it is package related as Burt indicated. The issue though is I'm not sure how do to the import statement so perhaps that screenshot will help. Here is the current code in the Dashboard Controller. ``` package tekdays class DashboardController { ... } ``` I've tried adding the following lines per Burt's suggestion, but I obviously don't have it right ``` package tekdays package my.package <--unexpected token: package class DashboardController { ``` I tried changing out my with tekdays and default and both yield the same result. Am I doing that wrong? Thanks! ![Grails ScreenShot](https://i.stack.imgur.com/ua8do.png)
Grails Blurb Plugin - Unable to resolve class Blurb
CC BY-SA 3.0
null
2011-05-11T21:07:30.157
2011-05-12T12:54:26.207
2011-05-12T12:54:26.207
574,814
574,814
[ "grails", "grails-plugin", "grails-domain-class" ]
5,970,651
1
null
null
1
58
I need to have a properly designed my uisearchbar . ``` UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(125.0, 25.0, 150, 40)]; [searchBar setBackgroundColor:[UIColor clearColor]]; searchBar.barStyle=UIBarStyleBlackTranslucent; searchBar.showsCancelButton=NO; searchBar.autocorrectionType=UITextAutocorrectionTypeNo; searchBar.autocapitalizationType = UITextAutocapitalizationTypeNone; ``` In below picture show i need to have only the oval part of search bar. I dont want to have rectangle part of searchBar What to do ? Please help me out. ![enter image description here](https://i.stack.imgur.com/qRDAY.png)
help me with this UIsearch bar need to properly designed in my view
CC BY-SA 3.0
null
2011-05-11T21:09:29.563
2011-05-11T21:36:36.613
2011-05-11T21:16:12.847
465,800
465,800
[ "iphone" ]
5,970,882
1
5,970,970
null
0
618
In a cell, how can you have any number or letter for a given cell without getting an excel warning. I tried converting to text but that seems to have little or no affect. I'm trying to use the x:num or x:str examples: I want the cell to have any combination and not get the little green arrow warning.![Cell with the Little Green Warning Arrow](https://i.stack.imgur.com/8hLXF.jpg)
How can I add any alpha numeric with or without leading zeros to a cell without getting an excel warning?
CC BY-SA 3.0
null
2011-05-11T21:33:51.913
2011-05-11T21:47:34.927
2018-07-09T18:41:45.953
-1
487,328
[ "excel", "vba" ]
5,970,896
1
5,986,561
null
3
13,129
I have a app which requires a connection to a remote windows. What I have done is to use mapped drive to build the connection on Windows startup menu. The partial codes look like this: ``` @IF NOT EXIST \\remotePC\sharedFolder NET USE * \\remotePC\sharedFolder /USER:user1 pwd /PERSISTENT:YES ``` The net use map works fine. The mapped drive will be one from available network drive letters. In my app, then UNC name is used instead(\remotePC\sharedFolder). The issue(not sure it is an issue) is that after several reboots, I can see a list of disconnected drivers from File Explorer: ![enter image description here](https://i.stack.imgur.com/qLXSO.jpg) I am not sure all the letters would be used up if I reboot my PC many times? I would like to clean up all the disconnected network drives. Can I do it from the batch script? I tried to use net use again for a disconnected drive, it deletes OK first time, but it stays in File Explorer. ``` NET USE T: /DELETE ``` Notes: I am not sure the usage of option /PERSISTENT:YES. I think it should reconnect the network drive after log in or reboot. It does not happen. That's why I added my scripts to Start up menu. I also realize that my other file explorer tools also display the disconnected network drives. Each time I reboot, one more disconnected network drive appears. It seems that the disconnected network drives does exists in Windows. Is there any way in scripts to find them and clean them? : I run my test up to 10 times and now I get to the stage that no more letter available for network drive mapping. Here is the snap-shot of my network drive status by using Total Commander: ![enter image description here](https://i.stack.imgur.com/Xrgkj.jpg) If I right click on those disconnected network drives, I can disconnect them. There must be a way to make those disconnected ones back to available. However, it would not be released by the use net /delete command: ``` NET USE X: /DELETE ``` The disconnected ones are caused by reboot or logout. It seems that I have no control over them since 1) I use dynamic mapping, and 2)no place to plugin my script before reboot or logout. One way I can think about is to do reconnect by using the following command (simplified one): ``` IF NOT EXIST Y:\ NET USE \\remotePC\Shared... ``` where Y: may be from a loop. Above is a simplified one. I tried it from cmd and it works. However before I put it with loop to my batch script, I prefer to clean up all the disconnected ones. That comes to another way: to add some scripts to my batch in start up to do the clean up. If there is any script codes or tools available so that I can use in my batch script to make disconnected ones back to available?
Clean Up Disconnected Network Drives
CC BY-SA 3.0
0
2011-05-11T21:34:57.273
2015-11-03T21:49:16.987
2015-11-03T21:49:16.987
1,555,990
62,776
[ "scripting", "batch-file" ]
5,971,081
1
5,972,335
null
8
425
Okay, this is a hard one. I have a Catalyst server I can access just fine from Firefox 4, Chromium 12, and IE 8 and 9 on other computers. When I try to access it from IE9 on my own machine (the same machine the server is on), I get strange timeouts and delays. The Catalyst server's output doesn't show these delays and the IE9 traffic view doesn't even show that the request was ever sent! ![IE9 Request timeline](https://i.stack.imgur.com/hpWCg.png) While the server is hanging up it's using 100% of a processor core but then it drops back to idle without outputting anything. This same request takes 5ms when requested from Chrome or FF. If I ^C the server while it's locked up I get this frighteningly low-level error: What's different about how IE9 routes requests to local sockets? Environment info: - - - -
IE9 loses requests to a local Catalyst server
CC BY-SA 3.0
0
2011-05-11T21:55:12.727
2011-05-12T01:15:19.573
null
null
77,782
[ "perl", "internet-explorer", "networking", "internet-explorer-9", "catalyst" ]
5,971,175
1
null
null
0
381
If you check out google, they have some excellent features on their search bar, but I wondered if anyone could point me in the direction to replicate some of these features ? Example: ![enter image description here](https://i.stack.imgur.com/ybObh.png) We would like to add the X at the end of the search box in the input field, float right. Not sure though how this is done, I presume the css is straightfoward, but not sure on the scripting to do this without refreshing the page. Any ideas please. Our search box is auto suggest, code isnt really necessary ( html ) to display here, but can post if people need to see our simple code. Moreover wondered if anyone had actually added a clear results X within the input field similar to that image.... Or post some links please.. bugger it here is our html. ``` <input name="suburbs" id="suburbs" type="text" placeholder="eg: Apples" onkeyup="lookup(this.value);" onblur="fill();" autocomplete="off" /></input> <!--added autosuggest--> <div class="suggestionsBox" id="suggestions" style="display: none;"> <div class="suggestionList" id="autoSuggestionsList"> &nbsp; </div> </div> <!--//auto suggest end--> ```
customizing our search bar
CC BY-SA 3.0
null
2011-05-11T22:06:19.543
2014-03-17T10:21:45.967
null
null
501,173
[ "jquery", "css", "search" ]
5,971,268
1
5,971,418
null
0
2,934
Look at the picture below. I'm loading an image from sdcard with code belove. I cannot get the picture to automatically fill the ImageView. I set the background to color green only to highlight the problem. I have tried many android:ScaleType like CENTER and FIT_XY but. Im now using inSampleSize = 8 but how can the ImageView automatically scale the image to be in the right hight/width proportions and fill the screen Also another thing, You see the ExitText and Button is placed above the Imageview(I think). I want them to be under and not block the ImageView. Maybe i misunderstand the android layout technical. ![enter image description here](https://i.stack.imgur.com/OUQdX.png) DrawView.java ``` public class DrawView extends ImageView { private Context ctx; public DrawView(Context context, AttributeSet atts) { super(context, atts); this.ctx = context; } @Override protected void onDraw(Canvas canvas) { String filePath = Environment.getExternalStorageDirectory().toString() + "/PTPPservice/163693fe-7c48-4568-a082-00047123b9f1.2.IMAG2200.jpg"; BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 8; Bitmap bitmap = BitmapFactory.decodeFile(filePath,options); Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); canvas.drawBitmap(bitmap, null, rect,null); } ``` } Main1.xml ``` <?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"> <com.hasse.move.DrawView android:id="@+id/mainView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" android:background="#00FF00" android:adjustViewBounds="true" /> <RelativeLayout android:id="@+id/InnerRelativeLayout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" > <EditText android:id="@+id/edittextaddtext" android:layout_width="fill_parent" android:layout_toLeftOf="@+id/btnsave" android:layout_height="wrap_content" android:text="wrap" /> <Button android:id="@+id/btnsave" android:layout_alignParentRight="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="save" /> </RelativeLayout> </RelativeLayout> ``` Main Activity ``` public class Main extends Activity { DrawView theImage; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); // draw the view setContentView(R.layout.main1); theImage = (DrawView) findViewById(R.id.mainView); //do stuff } @Override public void onConfigurationChanged(Configuration newConfig) { // Toast.makeText(this, "onConfigurationChanged",Toast.LENGTH_LONG).show(); super.onConfigurationChanged(newConfig); } } ```
android - How to set image in ImageView to right proportions
CC BY-SA 3.0
0
2011-05-11T22:18:00.663
2011-05-11T22:41:00.553
2011-05-11T22:31:08.267
538,837
538,837
[ "android", "imageview" ]
5,972,306
1
5,972,354
null
4
4,330
I'm looking to build a simple input form for username/password, and I was wondering if it was possible to mimic the functionality that many websites offer, namely a temporary string within a text input displaying what the field's purpose is. Essentially, I need something like this: ![enter image description here](https://i.stack.imgur.com/0b07r.png) When the user hasn't yet focused in on the text input, it should display "USERNAME" in a different format. When the user has focused in on the text field, the field is cleared and focus is set and the style is changed. Is there a way to do this easily?
Set temporary text in a EditText/TextView in Android?
CC BY-SA 3.0
null
2011-05-12T01:10:25.130
2013-02-15T11:29:11.487
null
null
128,967
[ "android", "textview", "android-edittext" ]
5,972,299
1
5,995,323
null
4
798
Using the following table layout: ``` TABLE Something ( SomethingId Name DateCreated IsObsolete ('Y','N') PRIMARY KEY (SomethingId) Foreign Key (SomethingTypeCode) ; TABLE SomethingType ( SomethingTypeCode ('1','2','3') Description PRIMARY KEY (SomethingTypeCode) ); ``` With a PHP/MySQL setup is there some way that I can restrict through a constraint or index that for each SomethingTypeCode (1, 2, 3) identified in the Something table, there can only be one IsObsolete = N associated with it? I hope that explains what I am trying to accomplish. I just don't know what to look into to resolve this. I want data integrity to be maintained as much as possible in the db itself and then extend that to the PHP. --- In response to the confusion I am getting with VoteyDisciple answer. EmailTypeCode: P = Personal, B = Business, S = School ![enter image description here](https://i.stack.imgur.com/C2H62.png) This will allow a Person to have more then one type of email in a given typecode (i.e. 2 business emails) and avoid duplication in the db and not require any nulls. Since i am only concerned with having one active email in each category (the one that will be used by the system) that is where the IsObsolete comes into play. I can keep the history, avoid duplication, avoid nulls, and ensure unique email addresses entered into the system here. Of course this also brings about my problem as stated in original question. VoteyDisciple please let me know if I depicted it wrong (or correct). ![enter image description here](https://i.stack.imgur.com/3qLL8.png) "If there can be only one for a given type" - Only one active not a time, not only one in the system. "Now ActiveId can be NULL" - I have emphasized I do not want NULLs "or it can point to a specific Something record." The type defines the record. On top of my responses above this seems to add undo complexity into any queries. My responses are based on my understanding of what you have presented. We are either not understanding each other or it is only on my end. I appreciate your input, but as presented I don't see it as a viable solution.
Data integrity and restrictions
CC BY-SA 3.0
null
2011-05-12T01:08:59.567
2011-05-15T00:16:03.690
2011-05-15T00:16:03.690
672,315
672,315
[ "php", "mysql", "validation", "data-integrity" ]
5,972,343
1
5,982,256
null
2
1,021
I have an issue while trying to parse an Xml to Objects using Linq in a Windows Phone 7 application. The same linq query works in silverlight. Here is the xml: ``` <?xml version="1.0" encoding="utf-8" ?> <students> <student> <firstName>John</firstName> <lastName>Doe</lastName> </student> <student> <firstName>Jane</firstName> <lastName>Doe</lastName> </student> </students> ``` And all the code that I have is in the MainPage.xaml.cs ``` using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Microsoft.Phone.Controls; using System.Xml.Linq; namespace WindowsPhoneApplication2 { public class Student { public string FirstName { get; set; } public string LastName { get; set; } } public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); XDocument doc = XDocument.Load("my1.xml"); var test = from students in doc.Elements("students").Elements("student") select new Student() { FirstName = students.Element("firstName").Value, LastName = students.Element("lastName").Value }; foreach (var _student in test) { } } } } ``` The error that I get is pretty weird (this is inside the foreach when you quick watch test): System.Collections.Generic.IEnumerator.Current = Could not evaluate expression. System.Collections.Generic.IEnumerator.Current = 'System.Collections.Generic.IEnumerable' does not contain a definition for 'System' and no extension method 'System' accepting a first argument of type 'System.Collections.Generic.IEnumerable In the mean time inside the foreach the _student var has the correct value on each iteration?! Is this error a bug? Or where is it coming from? ... :\ Edit: Here is a screenshot of where I see the error: ![enter image description here](https://i.stack.imgur.com/mxvEV.jpg) The students collection turn out to be correct but having that error there frightens me for when i will push out an application to the App Market. If it helps i am using the emulator to debug. I'm adding this screenshot based on Desnnis's response. ![enter image description here](https://i.stack.imgur.com/4cm76.jpg)
Linq to Objects error in the parsed collection
CC BY-SA 3.0
null
2011-05-12T01:17:09.357
2011-11-21T08:02:21.460
2011-11-21T08:02:21.460
16,026
286,463
[ "linq", "windows-phone-7", "linq-to-xml", "linq-to-objects" ]
5,972,368
1
5,972,572
null
13
3,637
Would it be possible to create a custom `JMenuItem` that contains buttons? For example would it be possible to create a `JMenuITem` with an item similar to this: ![screenshot of Google Chrome's customize and control menu with the edit menu item circled](https://i.stack.imgur.com/MFBie.png) ``` +----------------------------------------+ | JMenuItem [ Button | Button | Button ] | +----------------------------------------+ ```
Custom JMenuItems in Java
CC BY-SA 3.0
0
2011-05-12T01:23:30.787
2015-05-15T15:06:20.913
2012-01-06T19:47:06.010
93,343
749,731
[ "java", "swing", "jmenu", "jmenuitem" ]
5,972,389
1
5,972,435
null
0
1,124
I am trying to join to tables as image attached shows, table 1 will have exactly the same records as table 2 except one field with is not equal I would like to merge them so i will have the extended table : 1. have all records from table2, if we ignore isempty field, table 1 is always in table2 2. when table1.isEmpty=1 , the merged result will have isempty=1, and that record will be overwritten check attached images for more details ![enter image description here](https://i.stack.imgur.com/nmSZN.jpg) ![enter image description here](https://i.stack.imgur.com/D0Rkx.jpg) ![enter image description here](https://i.stack.imgur.com/birrz.jpg) the table 3 as shown, will have all the records from table 2 but overwritten when necessary
joining two tables and overwriting one colum
CC BY-SA 3.0
null
2011-05-12T01:27:39.933
2011-05-12T01:35:25.127
null
null
341,806
[ "sql" ]
5,972,417
1
6,013,385
null
0
147
I am using cute editor in my asp.net website. Problem is the toolbar has transparent background which makes it difficult to see the buttons clearly in Firefox. And this problem is not with IE. How do I fix this problem? 've tried BackColor tag of cutesoft, but transparency still stays. ![Sample Image](https://i.stack.imgur.com/MWGB3.jpg)
Why does CuteEditor's toolbar has trasparent background in Firefox?
CC BY-SA 3.0
null
2011-05-12T01:31:51.880
2011-05-16T05:07:26.163
2011-05-12T01:55:32.517
315,445
315,445
[ "firefox", "transparency", "wysiwyg", "toolbar", "cuteeditor" ]
5,972,744
1
5,972,922
null
1
1,487
I am looking for the best way in which you would setup navigation in an Android game; a best practice for Android Game Activity Navigation. I have the following scenario: - - - Therefore, if the player starts the game and completes two levels they might have an activity stack that looks something like this: ![Diagram of possible program flow.](https://i.stack.imgur.com/DdMXO.png) The problem that I have here is one of expectations when the back button is pressed: - - As far as I can tell everything else will work properly and as the user expects. I guess I just want to know what the best options are to solve this kind of problem. To make sure that the activities in this game occur as expected. Should they even be separate Activities? Thanks.
Android Game Activity Flow - Back to Start
CC BY-SA 3.0
null
2011-05-12T02:37:10.017
2022-04-14T18:50:23.863
2022-04-14T18:50:23.863
4,294,399
83,446
[ "android", "android-activity", "logic" ]
5,972,945
1
5,973,166
null
1
63
Whenevern I try to install Async CTP1 I get the![enter image description here](https://i.stack.imgur.com/QrRvC.png) message popup Can someone help with this?
Error when installing Async CTP1
CC BY-SA 3.0
null
2011-05-12T03:17:05.983
2011-05-12T04:02:28.790
null
null
88,230
[ "async-ctp" ]
5,972,952
1
5,978,301
null
2
585
I am doing some image enhancement experiments so I take photos from my cheap camera. The camera has mosaic artifacts and all images look like grid. I think pillbox (out-of-focus) kernel and Gaussian kernel would not be the best candidates. Any suggestions? : Sample ![enter image description here](https://i.stack.imgur.com/c1ygk.jpg) I suspect this cannot be done via a constant kernel, because the effects on pixels are not the same (so there are "grids").
The blurring kernel of a low-quality camera
CC BY-SA 3.0
0
2011-05-12T03:19:02.760
2011-10-10T15:22:27.237
2011-10-10T15:22:27.237
353,410
688,080
[ "image-processing", "blur", "mosaic" ]
5,973,014
1
5,973,046
null
1
1,608
I have this properties with default value. Can anyone help me on how to have a drop down menu for choices on values?. I want the values on the drop down only appears `1-10` only... ``` private int _margin = 10; [Bindable(true), Category(_category), DefaultValue(10)] public int MarginWidth { get { return _margin; } set { _margin = Math.Abs(value); Invalidate(); } } ``` ![img](https://i.stack.imgur.com/vgyA3.png) Anyway, how do you call this `[Bindable(true), Category(_category), DefaultValue(10)]` just a key for google searching for reference?
Adding Control Properties in C# with drop down menu
CC BY-SA 3.0
0
2011-05-12T03:31:30.307
2011-05-12T04:55:09.653
2011-05-12T03:50:26.217
297,114
403,971
[ "c#", "winforms", "attributes", "properties" ]
5,973,274
1
5,973,354
null
1
505
I'm trying to replicate Apple's layout of its app icons. I'm having trouble using `<merge>` and `<include>` as it doesn't seem to show up in the app when I run it. ![Icon](https://i.stack.imgur.com/zmS18.png) Here's the merge part: ``` <Button android:id="@+id/deleteContact" android:text="X" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <TextView android:id="@+id/personName" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="bottom|right" android:layout_gravity="bottom|right" android:textSize="20sp" android:text="asdfasdf"/> <ImageView android:id="@+id/personImage" android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/icon"/> </merge> ``` The include is here: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> <include layout="@layout/icon"/> </LinearLayout> ``` I'm putting those in a gridview here: ``` <?xml version="1.0" encoding="utf-8"?> <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/contactsGrid" android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="fill_parent" android:numColumns="3" android:horizontalSpacing="3dip" android:verticalSpacing="3dip" /> ``` We've managed to merge the image and the text so far using relativelayouts, however when we add the delete button, the whole icon itself can't be clicked anymore.
Icon layout help
CC BY-SA 3.0
0
2011-05-12T04:25:22.263
2011-05-12T04:37:36.933
null
null
726,781
[ "android", "android-layout", "android-gridview" ]
5,973,371
1
5,973,543
null
3
4,991
I know that Tkinter is just a thin layer over Tcl/Tk. Tkinter you can do a few things to change the windows styling. One example would be `root.attributes('-toolwindow', True)`. This would change the window style, to that of a tool window. However, I'm looking to go a little bit lower level. I suspect at some point Tcl/Tk refrences Windows [window styles](http://msdn.microsoft.com/en-us/library/czada357%28v=vs.80%29.aspx). I'm pretty sure it would have to do this in order to set the window style and by extension the Tkinter window styling. I'm trying to give a Tkinter window what I'm pretty sure is the style. However, I'm unsure how to approach this. I'm wondering where in the Tcl/Tk part of Tkinter does it assign windows styles, and what I'd have to add to get this style. The end goal is to get a Tkinter window border style that looks like the one below (note how it lacks an exit button): ![enter image description here](https://i.stack.imgur.com/hb6jI.png) This is in Windows 7, BTW.
Setting window styles with Tkinter/Tcl: no exit button
CC BY-SA 3.0
null
2011-05-12T04:41:04.437
2015-03-24T00:32:27.530
2015-03-24T00:32:27.530
3,924,118
433,417
[ "python", "windows-7", "tkinter", "tcl", "window-style" ]
5,973,433
1
5,984,994
null
1
2,387
Thanks First. Could any one tell me some reference urls or docs to implement this function. Add a customerized winform tab into lync 2010 client. (in the main window, not the contact window extension.) ![question image](https://i.stack.imgur.com/2fyOA.jpg)
how to add a tab into lync 2010 client
CC BY-SA 3.0
null
2011-05-12T04:54:08.290
2011-05-12T22:00:40.290
null
null
534,508
[ "plugins", "lync-2010" ]
5,973,469
1
5,973,780
null
2
276
(Note: This was formerly titled "How do a query plan's estimated executions/IO/CPU/Executions, etc, influence performance, all other things being equal?", but I renamed it now that I know the answer.) Below is a case where two identical SP calls vary only by the cached plan they are using. The graphical representation of the plan looks identical: it is a simple nested loops join in both cases (see below). However in one case it is using a plan that was cached from an earlier call when many fewer rows in the temp table, and this case is consistently slower than when the SP is recompiled. I am trying to understand what is happening under the hood so that I can better work around the performance problems I am having. Here are the details, along with a script if you want to test this out yourself: A SP is called that populates a temp table with either 10 rows or 400 rows. Then the temp table is joined back to a permanent table with about 4 million rows and the results are selected out. Case 1: Recompile SP, Run the 10 row case first, and the 400 row case second. Case 2: Recompile SP, Run the 400 row case first, and the 10 row case second. The performance of the 400 row temp table is consistently worse in Case 1 than in Case 2 even though the execution plans appear to be the same (250ms vs 125ms). I understand that a plan is cached based on the first run of the SP after recompiling, but in both the 10 and 400 row cases, they both use a very simple nested loops join, so I didn't expect any difference in whether the 400 case ran first or second. But apparently the plan that is cached for the 10 row case is inefficient in the 400 row case. I can see now that there is more to a cached plan than the visual operations & order that is displayed in the Management Studio graphical representation. The problem is, I don't understand what else is going on under the hood that is causing the difference. I did look at the STATISTICS PROFILE output (see below) and saw differences in Estimate Rows, Estimate IO, Estimate CPU, EstimateExecutions and/or TotalSubtree cost. Can anyone explain what is going on? Is the Estimated Number of Executions being used to allocate memory as if only 10 rows are expected, and it continually has to reallocate memory over and over to process 400 rows? I'm just guessing. ![Query Plan](https://i.stack.imgur.com/86eMY.jpg) ![Query Plan 2](https://i.stack.imgur.com/MuH1J.jpg) ![STATISTICS PROFILE OUTPUT](https://i.stack.imgur.com/fNYpZ.jpg) ``` ------------------------------------------------------------------------------------------------------------------------------- -- TEST CASE ------------------------------------------------------------------------------------------------------------------------------- -- 1. SET UP -- Create a table with 4 million rows IF OBJECT_ID('A') IS NOT NULL DROP TABLE A; CREATE TABLE A (ID INT PRIMARY KEY, Val1 VARCHAR(100), Val2 VARCHAR(100)) ;WITH Pass0 AS (SELECT 1 AS C UNION ALL SELECT 1), --2 rows Pass1 AS (SELECT 1 AS C FROM Pass0 AS A, Pass0 AS B),--4 rows Pass2 AS (SELECT 1 AS C FROM Pass1 AS A ,Pass1 AS B),--16 rows Pass3 AS (SELECT 1 AS C FROM Pass2 AS A ,Pass2 AS B),--256 rows Pass4 AS (SELECT 1 AS C FROM Pass3 AS A ,Pass3 AS B, Pass2 AS X, Pass1 AS Y),--65536 x 16 x 4 rows Tally AS (SELECT ROW_NUMBER() OVER (ORDER BY C) AS Number FROM Pass4) INSERT INTO A SELECT Number, 'xxxxxxxxx10xxxxxxxx20xxxxxxxx30xxxxxxxx40', 'xxxxxxxxx10xxxxxxxx20xxxxxxxx30xxxxxxxx40' FROM Tally -- Create SP IF OBJECT_ID('Proc1') IS NOT NULL DROP PROC Proc1 GO CREATE PROC Proc1 ( @TempTableName AS VARCHAR(100) ) AS CREATE TABLE #T (ID INT PRIMARY KEY) EXEC('INSERT INTO #T SELECT ID FROM ' + @TempTableName) SET STATISTICS PROFILE ON SELECT A.* INTO #X FROM #T AS T JOIN A AS A ON A.ID = T.ID SET STATISTICS PROFILE OFF DROP TABLE #X GO -- Generate temp table data IF OBJECT_ID('tempdb..##Temp400') IS NOT NULL DROP TABLE ##Temp400; SELECT TOP 400 ID INTO ##Temp400 FROM A ORDER BY NEWID() IF OBJECT_ID('tempdb..##Temp10') IS NOT NULL DROP TABLE ##Temp10; SELECT TOP 10 ID INTO ##Temp10 FROM A WHERE ID NOT IN (SELECT ID FROM ##Temp400 AS T) ORDER BY NEWID() -- 2. RUN TEST WHILE MONITORING IN PROFILER -- Execute 10 then 400 EXEC sp_recompile Proc1 CHECKPOINT DBCC DROPCLEANBUFFERS GO EXEC Proc1 '##Temp10'; GO EXEC Proc1 '##Temp400'; GO -- Execute 400 then 10 EXEC sp_recompile Proc1 CHECKPOINT DBCC DROPCLEANBUFFERS GO EXEC Proc1 '##Temp400'; GO EXEC Proc1 '##Temp10'; ``` p.s. This is based on a real case where the performance is much more pronounced than in the example given here. Since the optimal plan was highly dependent on the query size, there was no single plan that fit all row sizes well. My solution was to copy the main query in the SP multiple times within several IF statements, forcing the SQL engine to give each case its own optimal plan. It's the best solution I found, but it feels a bit clunky: ``` IF @RowCount < 1 [paste query here] ELSE IF @RowCount < 50 [paste query here] ELSE IF @RowCount < 200 [paste query here] ELSE [paste query here] ```
What influences a query plan's performance besides what is shown in Mgt Studio's graphical output?
CC BY-SA 3.0
0
2011-05-12T05:00:00.417
2011-05-12T16:17:42.720
2011-05-12T16:17:42.720
27,109
27,109
[ "sql-server", "sql-execution-plan" ]
5,973,637
1
5,973,956
null
5
983
I have a ravendb class like such: ``` public class Student { public string Id { get; set; } public string TopLevelProperty { get; set; } public Dictionary&ltstring, string> Attributes { get; set; } public Dictionary&ltstring,List&ltDictionary&ltstring, string>>> CategoryAttributes { get; set; } } ``` and a document like so: ![enter image description here](https://i.stack.imgur.com/xpQY5.png) The following linq will not work due to a selectmany: ``` test = (from student in session.Query() from eduhistory in student.CategoryAttributes["EducationHistory"] where eduhistory["StartYear"] == "2009" select student).ToList(); ``` How can I get all students where StartYear == 2009?
Workaround for selectmany in ravendb using client api
CC BY-SA 3.0
0
2011-05-12T05:26:59.183
2011-05-12T07:13:47.350
null
null
390,330
[ "ravendb" ]
5,973,883
1
5,973,926
null
31
44,149
I need to create a horizontal UIScrollView which to hold hundreds of thumbnail images, just like a slide of thumbnails. For example, there will be 10 thumbnails showing in a single screen, each of them are horizontally adjacent to each other. My problem is that I don't know how to make a horizontal UIScrollView to hold the multiple thumbnails which showing at the same time ? A sample photo is as below. See the bottom part of the screen. ![enter image description here](https://i.stack.imgur.com/VhN2U.jpg) Thanks.
Horizontal UIScrollView and hundreds of thumbnail images in iOS?
CC BY-SA 3.0
0
2011-05-12T05:57:32.257
2015-06-02T17:39:15.640
2011-05-12T06:41:16.230
403,015
403,015
[ "iphone", "ios", "ipad" ]
5,973,994
1
null
null
0
1,034
I've created installation using WIX V3 with localization to French. The installation works fine, but then we found out a weird thing: After installing the produce we try to uninstall it. During the uninstall we press cancel, and then the installation performing rollback (which is fine). The problem is that during the rollback the statuses appears in English... For Example: ![screenshot](https://i.stack.imgur.com/7OpoK.gif) I've search for the strings in English & French wxl but couldn't fine them. The installation was tested on French OS. Does anyone have an idea, where those strings could come from?
WIX: Statuses while rolling back uninstall are not localized in French
CC BY-SA 3.0
null
2011-05-12T06:12:59.053
2013-03-20T17:28:49.093
null
null
269,398
[ "localization", "installation", "wix", "status" ]
5,974,260
1
6,053,911
null
1
1,154
I have customize my UINavigationBar with UINavigationBar drawRect and it is working fine until I fire up MFMailComposeViewController, which gives me a trouble as I couldn't override UIBarButton for the mail class, it create akward view like below: ![enter image description here](https://i.stack.imgur.com/fajHb.png) While I try to prevent the `MFMailComposeViewController` and produce code below for using the default drawRect for `MFMailComposeViewController`, it even worse it create a black `UIBar`: ![enter image description here](https://i.stack.imgur.com/0rkx1.png) The Code: ``` @implementation UINavigationBar (CustomImage) - (void)drawRect:(CGRect)rect { //Prevent Mail Controller For Customizing NavigationBar for (UIView* next = [self superview]; next; next = next.superview) { UIResponder* nextResponder = [next nextResponder]; if ([nextResponder isKindOfClass:[MFMailComposeViewController class]]) { [super drawRect:rect]; return; } } UIImage *image = [UIImage imageNamed: @"titleBar.png"]; [image drawInRect:CGRectMake(0, 0, 320, 44)]; } @end ``` What I am trying to do here is to make sure `MFMailComposeViewController` having the same style of `UINavigationBar` and `UIButtonItem`. It can be either way: 1) Both `UINavigationBar` and `UIButtonItem` have customized background 2) Default `UINavigationBar` style (gradient blue) Would like to know can I achieve this? Thanks in advance.
Problem with custom UINavigationBar for MFMailComposeViewController
CC BY-SA 3.0
null
2011-05-12T06:41:16.007
2011-05-19T04:52:04.000
2011-05-12T07:48:59.973
null
572,438
[ "iphone", "objective-c", "cocoa-touch" ]
5,974,277
1
null
null
3
140
I'm Using TFS and changing different lines of code in different Clases. Is there a tool that can color the lines that been modified in the current changeSet before I do checkin ? I know there's the Compate option but it's clumsy. I just want that the modified lines will be marked once I do a change. Example I maid in PaintBrush : ![enter image description here](https://i.stack.imgur.com/h6cIM.png)
visual studio lines that been modified
CC BY-SA 3.0
null
2011-05-12T06:42:30.830
2011-05-12T06:53:35.783
null
null
138,627
[ ".net", "visual-studio", "add-in", "add-on" ]
5,974,330
1
5,975,299
null
3
1,310
I'm using NHibernate with QueryOver API to query my domain entities. The problem is getting duplicate results. For example when querying following domain: ![domain](https://i.stack.imgur.com/l1IGf.png) I use code like: ``` var list = Session.QueryOver<Post>() .JoinQueryOver<Comment>(x => x.Comments) .Where(c => c.Name == "Name") .Take(5) .List(); ``` Generated SQL will be like following: ``` SELECT Top(5) * FROM Posts p left outer join Comments c on p.Id = c.PostId ``` The problem here is that after left join is done resulting record set has more then 5 rows. And then `TOP` function applies and cuts results. So for example if first post has 5 comments, I will get this post 5 times and won't get others. I know why it happens and found a nice [post](http://nhforge.org/wikis/howtonh/get-unique-results-from-joined-queries.aspx) about it. But Is there a projection that will tell nhibernate to select only columns from the `Post` entity and not add columns from `Comment` entity in select? Maybe some other method (not JoinQueryOver) should be used?
NHibernate entity projection
CC BY-SA 3.0
0
2011-05-12T06:46:54.820
2012-06-27T07:41:19.940
null
null
72,174
[ "c#", ".net", "nhibernate", "criteria-api", "queryover" ]
5,974,349
1
null
null
3
2,194
My Question is as below in two parts…… • To generate [point cloud](https://picasaweb.google.com/paryanh.job/POINTCLOUD?authkey=Gv1sRgCNbwzqi34bTg4gE#5609834316945961266) of real-world object…. • Through 360 degree rotation of it….on rotating table • Getting 360 images… one image at each degree (1° to 360°). • I know how to process image and getting pixel value of it. • See one sample image below…you can see image is black and white...because I have to deal with the objects which are much shiny (glittery)…and it is DIAMOND. So I have setting up background so that shiny object (diamond) converted in to B/W object. And so I can easily scan outer edge of object (e.g. Diamond). • And one thing to consider is I don’t using any laser… I just using one rotating table and one camera for taking image…you can see one sample project over [here](http://www.volunteerlabrat.com/default.html?goto=scanner.html)… but there MATLAB hides all the things…because that guy using MATLAB’s in Built functionality. • I need to have point-cloud of real-world object. So, I can display it in Computer Screen. For that I am using one rotating table. I will put my object on it and I will rotate table a complete 360° degree rotation and I will take 360 images…one image at each degree (1° to 360°). Camera which is used for taking image is well calibrated. I have given one sample image as below. I also know how to scan image and getting pixel value of it. Also take in consideration that my images are [Silhouette](http://en.wikipedia.org/wiki/Silhouette) type…means just black and white... No color images. But my problem is or where I am trapped down is in... Getting Points cloud of object…….from the data which I have getting through processing of image. One same kind of project I found over [here](http://www.volunteerlabrat.com/default.html?goto=scanner.html)…….. But it just using built in MATLAB functions…I am using Microsoft Visual C#.Net so I have to build the entire algorithm myself….because MATLAB hides all the things which I want to know…. Is there any master…….who know this entire thing well and getting me out of trap...!!!! ![enter image description here](https://i.stack.imgur.com/x6daP.png) Thanks…..
Get POINT CLOUD through 360 Degree Rotation and Image Processing
CC BY-SA 3.0
0
2011-05-12T06:48:55.383
2011-05-23T09:04:10.973
2011-05-23T09:04:10.973
468,968
468,968
[ "algorithm", "math", "image-processing", "3d", "scanning" ]
5,974,881
1
null
null
0
844
I want to create new instance of item renderer for my data grid. A single instance of your Item Renderer class (ListIR) is created for each visible item of the list-based control. ![enter image description here](https://i.stack.imgur.com/IaVz8.jpg) As the user scrolls through the items of a data grid control, Item Renderer instances are recycled rather than creating new instances. ![enter image description here](https://i.stack.imgur.com/A8y8T.jpg) But i would like to create new instance ..while scrollling item in datagrid. any idea how to achieve it . thanks in advance javaamtho
create new instance of itemrenderer in MX DataGrid
CC BY-SA 3.0
null
2011-05-12T07:45:02.723
2011-05-12T09:17:44.967
2011-05-12T09:17:44.967
680,503
651,106
[ "apache-flex", "datagrid", "itemrenderer" ]
5,974,889
1
5,984,010
null
1
1,033
Recently I have been struggling with the [sfDoctrineGuardPlugin](http://www.symfony-project.org/plugins/sfDoctrineGuardPlugin) available for [Symfony](http://www.symfony-project.org). The issue is with translation of the plugin. The people behind sfDoctrineGuardPlugin have obviously thought about i18n, as they have provided some translations in the [proper directory](http://trac.symfony-project.org/browser/plugins/sfDoctrineGuardPlugin/trunk/i18n) in their project. The problem however, is that not all text-elements are translated. More specificly the login / signin-form is only partially translated. I have added a translation file for Norwegian (and for simplicity) placed it inside the plugins i18n-directory. I will move it out of there as soon as I get all the items properly translated, but that's another story. My login-form (the default one for sfDoctrineGuardPlugin) looks like this when rendered (styles removed for simplicity): ![Login form as rendered](https://i.stack.imgur.com/WTPLD.png) As you can see the header-element as well as the signin-button get translated, but fields for username/email and password does not. In sfDoctrineGuardPlugin/lib/form/doctrine/base/BasesfGuardFormSignin.class.php the following code is present: ``` if (sfConfig::get('app_sf_guard_plugin_allow_login_with_email', true)) { $this->widgetSchema['username']->setLabel('Username or E-Mail'); } ``` This is one of the text-elements that are not translated. In my sg_guard.nb.xml I have translated all the strings that can be found in the example translations in sfDoctrineGuardPlugins svn-repository. For the abovementioned label I have the following: ``` <trans-unit> <source>Username or E-Mail</source> <target>Brukernavn eller epost</target> </trans-unit> ``` My guess is that the use of setLabel two sections up ensures that the i18n-system is unable to insert my translation where it should. Is sfDoctrineGuardPlugin set to have text replaced from some other catalog than sf_guard.XX.xml? What have done to get translations working? I really do not want to modify the sfDoctrineGuardPlugin source if it can be avoided (so I have clean dependencies). Any pointers are appreciated.
Symfony, sfDoctrineGuardPlugin and translations (I18N / I10N)
CC BY-SA 3.0
0
2011-05-12T07:45:38.883
2011-05-12T20:23:36.323
2011-05-12T10:20:44.507
455,066
455,066
[ "php", "symfony1", "internationalization", "symfony-1.4", "sfdoctrineguard" ]
5,974,979
1
5,976,431
null
4
483
Running e.g. cv.glmnet on a dataset gives me (by default) 100 different models. Now, if my dataset had missing data, I could do multiple imputation (say 10 imputations) and run cv.glmnet on each of the imputations. If I disregard the actual coefficient values for each of the models, and just look at the selected features (i.e. sets of column names), some models are submodels of others. Code like this imitates the results somewhat: ``` usevars<-paste("var", 1:100, sep="") mdls<-replicate(1000, { numVars<-sample.int(length(usevars), 1) sample(usevars, numVars) }) names(mdls)<-paste("mdl", 1:1000, sep="") ``` Now, it's easy enough to get the parent-child relations for submodels in this respect. It is also possible to only include 'direct parenthood' (i.e. if model A is child of B and B is child of C, then don't include the relation between A and C). Finally, I come to my problem: I've used igraph to plot these models and their (direct) relations. I did not, however, find a layout that could group the nodes based on another variable (in this case the model size): in this setting it seems like a good idea to create this graph holding 'bands' of models with the same model size (number of variables in the model). What I ended up doing, was more or less calculate the positions of each node myself through a kludge of code (that I'm too embarassed about to be posting here), but I always kept wondering if I simply missed a better / out-of-the-box solution. My own code resulted in graphs like this one (you can ignore the colours and the labels - just know that the horizontal axis holds the model size): ![enter image description here](https://i.stack.imgur.com/AEuYh.jpg) Suggestions for achieving this sort of graph more elegantly than, well, doing all the hard work myself, are greatly appreciated.
igraph'ing nested models
CC BY-SA 3.0
0
2011-05-12T07:53:50.340
2011-05-12T14:22:29.577
null
null
709,529
[ "r", "layout", "model", "igraph" ]
5,975,198
1
6,015,808
null
2
3,770
How to achieve an `android:background` change effect on multiple `Views` at the same time, on clicking any of them? ![Note that contents vary](https://i.stack.imgur.com/tlKOb.png) I got a "badge" layout in two parts. They act like one button, but the two parts have different `StateListDrawable` (selectors) defining backgrounds for `state_pressed` etc. The first part is a header ("lefter") with an image. The second is a content area getting filled with various sub-contents. I want the two badge parts to stretch separately AND share a common background effect when any of them is pressed. ``` <LinearLayout style="@style/Badge"> <!-- LEFTER --> <LinearLayout style="@style/BadgeLefter" android:background="@drawable/badge_lefter_bg_blue"> <ImageView style="@style/BadgeLefterImage" android:src="@drawable/office_building"/> </LinearLayout> <!-- CONTENT --> <LinearLayout android:id="@+id/badge_blue_content" style="@style/BadgeContent" android:background="@drawable/badge_content_bg_blue"> </LinearLayout> </LinearLayout> ``` Example of `StateListDrawable` background selector (like `@drawable/badge_content_bg_blue` above): ``` <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="false" android:state_pressed="false" android:drawable="@drawable/badge_bg_blue_normal"/> <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/badge_bg_blue_pressed"/> <item android:state_focused="true" android:drawable="@drawable/badge_bg_blue_focused"/> <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/badge_bg_blue_pressed"/> </selector> ``` where `badge_bg_blue_normal` etc are 9-patch png's. I'm new to android. I failed to find a similar question here. It does not help to custom my own `Button` because buttons only have one android:background `selector`. I found no 9-patch supporting multiple stretchable areas. I realize I could build a [custom component](http://developer.android.com/guide/topics/ui/custom-components.html). Is that a good idea here? I use my badges widely around the app. An elegant solution would be greatly appreciated! :) After building a custom component with a `TouchListener` I'm all set: ^_^ ``` public class Badge extends LinearLayout { //... public Badge(Context c, AttributeSet attrs) { super(c, attrs); //... // inflating layouts and setting selector backgrounds here //... setClickable(true); setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { lefter.setPressed(true); contents.setPressed(true); } else if (event.getAction() == MotionEvent.ACTION_UP || !isInside(v, event)) { lefter.setPressed(false); contents.setPressed(false); } return false; } private boolean isInside(View v, MotionEvent event) { //... } }); } //... } ```
state_pressed background for multiple views, onClick
CC BY-SA 3.0
null
2011-05-12T08:17:05.893
2011-05-17T15:47:31.600
2011-05-17T15:47:31.600
237,509
237,509
[ "android", "android-layout", "android-widget", "selector", "nine-patch" ]
5,975,396
1
5,975,687
null
1
1,973
I have this annoying problem with padding. I am building a menu, here is the html code for it (I have taken out all the other tabs and leave only one for better readability): ``` <div id="menu"> <a class="<?php echo $description; ?>" href="<?php echo $path; ?>">Opis</a> </div> ``` $description can take two values: 1. selected 2. notSelected And the $path is just for correct relative addressing. Here is the CSS code: ``` #menu { font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande", "Lucida Sans Unicode", Geneva, Verdana, sans-serif; background-color: #1958b7; padding: 0 0 20px 0; /*Here set the size for tabs.*/ border-top: 10px #2175bc solid; /*Here we add border.*/ } #menu a { color: #fff; /*White color. */ text-decoration: none; /*No decoration.*/ padding: 0px 9px 5px 9px; /*The padding for tab.*/ } .selected { border-left: 8px solid #5ba3e0; /*Defining color and width for left border.*/ border-right: 8px solid #5ba3e0; /*Defining color and width for right border.*/ background-color: #2586d7; } .notSelected { border-left: 8px solid #1958b7; border-right: 8px solid #1958b7; background-color: #2175bc; } ``` Now the problem is with padding from #menu a: ``` padding: 0px 9px 5px 9px; /*The padding for tab.*/ ``` In Opera, Chrome, IE7, IE8 and IE9 it works properly, the result is this: ![The right result.](https://i.stack.imgur.com/Wux6j.png) But in Firefox 4.0.1 (and I remember this was also a problem with FF 3.6) it displays like this: ![The wrong result.](https://i.stack.imgur.com/8z8C5.png) As you can see, the FF puts 1px above tag Opis for no reason, even though I have defined explicitly not to put any padding on top. So now that 1px of strong blue color is visible on top of tab.
Wrong padding only in Firefox
CC BY-SA 3.0
null
2011-05-12T08:35:21.773
2011-05-12T09:16:33.203
null
null
535,661
[ "html", "css", "padding" ]
5,975,737
1
5,975,967
null
21
33,370
I have created simple DataGrid with 4 columns, which go outside the bounds of DataGrid, and horizontal scrollbar is not showing. I tried setting width to each column but nothing changed. Here is my XAML: ``` <Window x:Class="WPFTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <DataGrid Height="200" Width="200" HorizontalScrollBarVisibility="Visible"> <DataGrid.Columns> <DataGridTextColumn Header="Column 1" /> <DataGridTextColumn Header="Column 2" /> <DataGridTextColumn Header="Column 3" /> <DataGridTextColumn Header="Column 4" /> </DataGrid.Columns> </DataGrid> </Grid> </Window> ``` And here is what I get: ![enter image description here](https://i.stack.imgur.com/wpo1G.png) I have also tried wrapping DataGrid with ScrollViewer. Nothing. How can I make scrollbar appear?
WPF DataGrid horizontal scrollbar not showing
CC BY-SA 3.0
0
2011-05-12T09:08:22.000
2022-04-22T22:55:04.130
null
null
676,389
[ "c#", "wpf", ".net-4.0", "scroll" ]
5,975,797
1
null
null
0
143
I am trying to highlight items that are more than one in a list with different colours with jQuery. Is below achievable easily? For example. Take the ul below ``` <ul id="inul"> <li id="s0" class="list"> <span id="ip0">127.0.0.1</span> <span id="ua0">SonyEricssonK800iv/R1KG Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1</span> </li> <li id="s1" class="list"> <span id="ip1">127.0.0.1</span> <span id="ua1">Nokia3120classic/2.0 (09.41) Profile/MIDP-2.1 Configuration/CLDC-1.1 nokia3120classic/UC Browser7.6.1.82/69/352 UNTRUSTED/1.0</span> </li> <li id="s2" class="list"> <span id="ip2">127.0.0.1</span> <span id="ua2">SonyEricssonW580i/R8BE Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1</span> </li> <li id="s3" class="list"> <span id="ip3">127.0.0.1</span> <span id="ua3">SonyEricssonK800iv/R1KG Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1</span> </li> <li id="s4" class="list"> <span id="ip4">127.0.0.1</span> <span id="ua4">Nokia3120classic/2.0 (09.41) Profile/MIDP-2.1 Configuration/CLDC-1.1 nokia3120classic/UC Browser7.6.1.82/69/352 UNTRUSTED/1.0</span> </li> <li id="s5" class="list"> <span id="ip5">127.0.0.2</span> <span id="ua5">SonyEricssonW580i/R8BE Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1</span> </li> </ul> ``` There are two of each browser user agent and 4 of same ip (127.0.0.1) and 1 127.0.0.2. What i am hoping to achieve is that identical spans would be colored with same color while assigning different color to each identical set. Just to be clear, end result should look like image below ![enter image description here](https://i.stack.imgur.com/2F1ku.png) With the help of WSkid I ahve manged to achive what i want. See update [http://pastebin.ca/2058058](http://pastebin.ca/2058058) or working version at [http://jsfiddle.net/mUGVR/15/](http://jsfiddle.net/mUGVR/15/)
jQuery Higlight items that are more than one in ul
CC BY-SA 3.0
null
2011-05-12T09:13:40.957
2013-11-12T01:55:44.917
2013-11-12T01:55:44.917
2,765,666
74,896
[ "javascript", "jquery", "highlighting" ]
5,975,883
1
6,001,105
null
7
4,540
I would like to start using my own templates for iOS applications. I don't want any significant changes, but simpler things like - - `pragma mark`- - - The idea is that we will share these templates when we create apps, but at the same time the default template files that Xcode 4 already provides. So, in the following screenshot, how can I add a "CompanyName Application" section that contains exactly the same templates (Navigation-based, View-based etc), but with my own changes? ![Xcode 4 templates](https://i.stack.imgur.com/YCWgH.png) I found that I can add a folder under `/Developer/Library/Xcode/Templates/` or `/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/` but I'm a bit confused with what do I need to do exactly. I would really appreciate it if you could help me with that, as I have already messed up my folders twice with no luck. Thanks!
How to create a new "templates" category on Xcode 4 and use my own file templates there?
CC BY-SA 3.0
0
2011-05-12T09:22:21.700
2012-03-13T21:26:59.507
2011-05-12T11:10:40.443
289,501
289,501
[ "ios", "templates", "xcode4", "customization" ]
5,975,932
1
6,093,842
null
4
3,326
This is my code (from a Core Data tutorial): ``` [eventsArray insertObject:event atIndex:0]; NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES]; ``` The third line throws an exception: ``` 2011-05-12 13:13:33.740 Locations[8332:207] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 0 beyond bounds for empty array' *** Call stack at first throw: ( 0 CoreFoundation 0x010145a9 __exceptionPreprocess + 185 1 libobjc.A.dylib 0x01168313 objc_exception_throw + 44 2 CoreFoundation 0x0100a0a5 -[__NSArrayM objectAtIndex:] + 261 3 UIKit 0x0010d5b3 -[UITableView(_UITableViewPrivate) _endCellAnimationsWithContext:] + 6156 4 UIKit 0x000fcd36 -[UITableView insertRowsAtIndexPaths:withRowAnimation:] + 56 5 Locations 0x00003462 -[RootViewController addEvent] + 690 ``` I'm new to iPhone development, and I can't understand that does it mean. I'm inserting at the zero index of a tableView, so I have no idea why does not it work with an empty array. Please clarify this to me --- ![stacktrace](https://i.stack.imgur.com/o7TmG.png) eventsArray is an array I populate table view from (probably. at least it is used in `cellForRowAtIndexPath`) --- ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // A date formatter for the time stamp. static NSDateFormatter *dateFormatter = nil; if (dateFormatter == nil) { dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setTimeStyle:NSDateFormatterMediumStyle]; [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; } // A number formatter for the latitude and longitude. static NSNumberFormatter *numberFormatter = nil; if (numberFormatter == nil) { numberFormatter = [[NSNumberFormatter alloc] init]; [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; [numberFormatter setMaximumFractionDigits:3]; } static NSString *CellIdentifier = @"Cell"; // Dequeue or create a new cell. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; } Event *event = (Event *)[eventsArray objectAtIndex:indexPath.row]; cell.textLabel.text = [dateFormatter stringFromDate:[event creationDate]]; NSString *string = [NSString stringWithFormat:@"%@, %@", [numberFormatter stringFromNumber:[event latitude]], [numberFormatter stringFromNumber:[event longitude]]]; cell.detailTextLabel.text = string; return cell; } ```
insertRowsAtIndexPaths:withAnimation: throws NSRangeException
CC BY-SA 3.0
null
2011-05-12T09:26:31.287
2011-05-23T06:56:03.413
2011-05-12T10:12:55.450
145,357
145,357
[ "objective-c", "ios", "ios4" ]
5,975,975
1
null
null
1
1,102
I have this code to create and show a form with monthcalendar control on it. ``` private void showcalendar_Click(object sender, EventArgs e) { ShowCalendar(); } void ShowCalendar() { DateTime current5 = DateTime.Now.AddDays(-5); MonthCalendar cal = new MonthCalendar(); Panel panel = new Panel(); Form f = new Form(); cal.MaxSelectionCount = 1; cal.SetDate(current5); cal.DateSelected += new DateRangeEventHandler(DateSelected); cal.ShowToday = true; panel.Width = cal.Width; panel.Height = cal.Height; panel.BorderStyle = BorderStyle.FixedSingle; panel.Controls.Add(cal); f.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; f.ShowInTaskbar = false; f.Size = panel.Size; f.Location = MousePosition; f.StartPosition = FormStartPosition.Manual; f.Controls.Add(panel); f.Deactivate += delegate { f.Close(); }; f.Show(); } void DateSelected(object sender, DateRangeEventArgs e) { MonthCalendar cal = (MonthCalendar)sender; Form f = cal.FindForm(); f.Close(); } ``` When I invoke ShowCalendar monthcalendar control is displayed and I can select date within it. The problem is that when I click on a certain area(the lowest one with current date depicted) I'm getting an exception - "Cannot access a disposed object. Object name: 'MonthCalendar'." I don't know how this exception arises at all and how to get rid of it. Maybe you have any thoughts? My application is not multithreaded, just simple form with a button which invokes ShowCalendar function. ![Calendar with area selected](https://i.stack.imgur.com/Lho6z.jpg)
Cannot access a disposed object "MonthCalendar"
CC BY-SA 3.0
null
2011-05-12T09:31:20.560
2013-11-12T01:57:17.127
2013-11-12T01:57:17.127
2,765,666
371,967
[ "c#", "winforms", "monthcalendar" ]
5,976,081
1
5,976,819
null
0
1,172
I want to create my own compound view. This view will extend a LinearLayout, and have a HorizontalScrollView in it. This HorizontalScrollView will hold a parent LinearLayout that will hold several TextView. What I want to achieve is like an Alphabet Horizontal Index. With the above approach it works just fine. But it is not enough. Right now letter A can not be at the center of the scroll, as it is the first letter, and you can not scroll more to the left. What I want to achieve is that the user can scroll to the left until the point where the first letter (A) is in the center. And that it works the same way when scrolling to the right and the last letter (Z). I am very confused about how to do this. I know I can set padding to the inner LinearLayout in scroll, but I have to wait until I know how wide the scroll is (it's size is dynamic, FILL_PARENT). I can get this size in onLayout method, calling getMeasuredWidth. Then I can update the inner LinearLayout padding with the desired values, but it looks like eventhough I change the padding, the width of the innerLayout does not change. I have also tried adding 2 spacers (just views) before A and after Z, but the paradigm is the same. I need to change its size when I know about the width of the scroll. Please, help! :D I can post some code if needed. EDIT with image: ![enter image description here](https://i.stack.imgur.com/0sH8q.png) So I want to be able to scroll more to the left, just until letter A is in the middle. Help! Thanks.
Help with Compund View and onLayout and onMeasure (HorizontalScrollView)
CC BY-SA 3.0
null
2011-05-12T09:40:01.033
2011-05-12T10:44:54.803
2011-05-12T10:00:58.597
597,652
597,652
[ "android", "android-layout" ]
5,976,179
1
5,976,265
null
2
395
I am using a logic to highlight cells based on if the cursor is hovering over the row: ``` function setupTable(tbl) { if ($(tbl).find('tbody').size() > 0) { $(tbl).find('tbody tr').hover(function () { $(this).find('td:gt(0)').addClass('highlight'); }, function () { $(this).find('td:gt(0)').removeClass('highlight'); }).click(window.onTrClick); if ($(tbl).find('tbody tr').size() > 10) { setUpPagination(tbl); } } } ``` The style rule is define like the follows: ``` .gridview .data { background-color: White; padding-left: 3px; padding-right: 3px; } .highlight { background-color: #3169C6; color: White; cursor: pointer; } ``` But on hovering the text goes white. The net effect is as if that row of data is blanked out. I open IE's developer toolbar. And try to play around. ![enter image description here](https://i.stack.imgur.com/hDNnQ.png) I try to manipulate the class attribute and find out that ``` class="data highlight" ``` does not give the desired effect. But if I did ``` class="highlight" ``` it sort of works... I am trying to understand why this is so? How will the rules be applied if we do `class="data highlight"`? --- UPDATE: I want the padding of `.data` to be sort-of "inherited" (or maintained) to `.highlight`. What do I do then?
style rule not being applied to td element
CC BY-SA 3.0
null
2011-05-12T09:48:02.323
2011-05-12T16:29:31.570
2011-05-12T16:29:31.570
145,682
145,682
[ "html", "internet-explorer", "css" ]
5,976,339
1
5,976,451
null
0
250
![enter image description here](https://i.stack.imgur.com/5vtAp.png) In the above figure it shows... I need to display complete data in UILabel. This is an alignment problem with UILabel ``` UILabel *lable=[[UILabel alloc]init]; lable.frame=CGRectMake(350, 25, 50, 50); [lable setTextColor:[UIColor whiteColor]]; [lable setBackgroundColor:[UIColor clearColor]]; [lable setText:@"Leveraged Commentary & Data"]; ``` I need to display completed setText on lable @"Leveraged Commentary & Data"; Please help me out. Thanks in advance
UILabel display problem
CC BY-SA 3.0
null
2011-05-12T10:00:42.873
2011-05-12T11:21:52.053
2011-05-12T11:21:52.053
232,053
465,800
[ "iphone" ]
5,976,346
1
5,976,435
null
1
2,389
My page returns multiple records and need to do some action on the records using checkbox. Let me put it in this way. I will display all the records on my template with check box on every record. when I select checkbox option and click on some action button, id's of the selected records should pass to view and perform execute logic on the selected records. Some thing similar what we do in phpmyadmin ![Selecting multiple checkboxes](https://i.stack.imgur.com/Um6so.jpg)
Action on multiple records using checkbox in django
CC BY-SA 3.0
0
2011-05-12T10:01:16.033
2011-05-12T10:25:58.887
null
null
727,495
[ "django", "forms", "checkbox" ]
5,976,365
1
5,978,119
null
1
1,054
![enter image description here](https://i.stack.imgur.com/kozxG.jpg)I have a project where I display content from an array. I also need to display ratings- which is between 1- 5 stars works fine with correct alternate shading for each line- , when I mouse-over, the skinnable countainer in the itemrenderer(named cont) still retains the original color it had for that row. As we are using fxg graphics, we have a a skinnable container box containing the ratings with one shade, that lies just within the larger table - with row color having changed on mouse-over. Screenshot attached- you can see the thin patch of blue between the ratings box(dark grey) and the highlighed row on mouseover... I was told to shift from Datagrid to List to resolve this and for better performance- seems like a biggish task which I messed up. As an easier alternative, was looking to I would like to a) get the skinnable container color to disappear, so I see single color in a row on mouseover b) disable the color change on mouseover for the grid rows, so this issue is avoided messed up previous entry- hence restating issue... Thanks The datagrid is very straighforward as below ``` <mx:DataGrid id="experimentgrid" fontSize="{12}" fontWeight="bold" color="#006837" styleName="dataGridStyle" rowHeight="{15}" borderVisible="false" showHeaders="false" x="{20}" y="{50}" width="{900}" height="{350}" dataProvider="{arr_expList}" itemClick="onItemExp(event);" creationComplete="setColWidths()" verticalScrollPolicy="auto" verticalScrollBarStyleName="scrollStyle" > <mx:columns> <mx:DataGridColumn id="col11" dataField="no" resizable="true" /> <mx:DataGridColumn id="col12" dataField="Name" resizable="true" /> <mx:DataGridColumn id="col13" dataField="Rating" itemRenderer="itemRenderers.experimentGriditemRender" resizable="true"/> </mx:columns> ``` The item renderer code is as follows ``` <?xml version="1.0" encoding="utf-8"?> <s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" focusEnabled="true"> <fx:Script> <![CDATA[ import assets.graphics.dotrating; import mx.controls.dataGridClasses.*; import mx.events.FlexEvent; import spark.core.SpriteVisualElement; private var mydot:SpriteVisualElement; override public function set data(value:Object):void { if(value != null) { cont.removeAllElements(); for(var i:int=0;i<value.Rating;i++) { mydot = new dotrating(); //600 is a stand-in for some calculations mydot.x= (600*0.02)+(i*600*0.02); mydot.y= (600*0.012); //mydot.x = (i*600*0.02); mydot.height = 600*0.013; mydot.width = 600*0.013; cont.addElement(mydot); } } } ]]> </fx:Script> <s:SkinnableContainer id = "cont" top="0" left="0" right="0" bottom="0" height="{600*0.02}"> </s:SkinnableContainer> </s:MXDataGridItemRenderer>![enter image description here][2] ```
flex: border appearing when I mouse-over in datagrid containing skinnable container
CC BY-SA 3.0
null
2011-05-12T10:03:14.397
2011-05-12T12:54:23.220
null
null
611,456
[ "apache-flex", "datagrid", "mouseover" ]