Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
6,257,549
1
6,257,579
null
3
3,429
I am trying to control font size in an eBay listing such that it will look the same (more or less) on Firefox Internet Explorer 8. To simplify things I just specify a single font size for the entire body text: ``` <body style="font-family: Verdana; font-size: 12px;"> ... </body> ``` Yet, while locally (on my PC) the font looks as I want it to look like: > Firefox 3.6:![enter image description here](https://i.stack.imgur.com/N0yGo.png)Internet Explorer 8:![enter image description here](https://i.stack.imgur.com/wSmCn.png) On eBay itself, the font looks much bigger (which is what I want): > Firefox 3.6 on eBay:![enter image description here](https://i.stack.imgur.com/ATuqr.png)Internet Explorer 8 on eBay:![enter image description here](https://i.stack.imgur.com/LgALs.png) I tried of course different font-size unit specification (`em`, `%`, etc.) but the discrepancy remains. Why is this happening and how can I get around this (without resorting to posting an image of the text...). I understand that there might be some collision between eBay's CSS and my HTML (I don't use any CSS, I only use inline style!), but I don't know how to tell eBay to override my style. Any idea how to overcome this?
How to control font size in an eBay listing
CC BY-SA 4.0
null
2011-06-06T20:19:53.960
2019-07-08T17:28:12.383
2019-07-08T17:28:12.383
1,481,116
586,707
[ "html", "css" ]
6,257,741
1
6,264,692
null
2
272
I'm writing a Plone product that takes [iCalendar](http://www.apps.ietf.org/rfc/rfc2445.html), pulls it in, and creates Plone Event types. I've got it all working perfectly, except that, for half of the year's dates, the timestamps are off by an hour. My iCalendar feed is passing these as UTC timestamps: DTSTART;VALUE=DATE:20110812T130000Z should be 9am in the America/New_York timezone DTEND;VALUE=DATE:20110812T160000Z should be 12noon in the America/New_York timezone Those work fine. These don't: DTSTART;VALUE=DATE:20111225T175525Z should be 1:55pm, but it's showing as 12:55pm DTEND;VALUE=DATE:20111225T215525Z should be 5:55pm, but it's showing as 4:55pm ![Screenshot of Plone showing incorrect EDT event time](https://i.stack.imgur.com/Fsw9I.png) From the database that generates the iCalendar feed, to the iCalendar generator, to the actual values stored in Zope, everything is correct. But Plone displays the incorrect localtime on the event detail pages. I've tried setting "TZ America/New_York" in my buildout, I've tried setting the system clock on the Zope server ahead to see if the conversion would magically happen "after we return to EST". No luck. Here's a couple of examples that might illustrate the problem: Correctly-Displaying Event, which takes place in EDT: ``` BEGIN:VEVENT DESCRIPTION:Flyer Fridays give you the opportunity to hear from professors in Communication Sciences & Disorders\, Education\, Management\, Nursing\ , Physical Therapy\, Occupational Therapy or Visual & Performing Arts. \n \nFaculty sessions begin at 9:15am (PLEASE CHOOSE ONE)\, followed by a 10a m campus tour and an 11am Freshmen information session. After the day's e vents\, you're invited to join the Admissions staff for lunch. DTEND;VALUE=DATE:20110812T160000Z DTSTART;VALUE=DATE:20110812T130000Z LOCATION:Nazareth College SUMMARY:Flyer Friday - Management Info Session UID:ug-flyerfriday-164 END:VEVENT ``` And, how it is stored in Zope: ``` >>> app.Plone.events['ug-flyerfriday-164'].startDate DateTime('2011/08/12 13:00:00 GMT+0') ``` Incorrectly-displayed event, which takes place in EST: ``` BEGIN:VEVENT DESCRIPTION:Fun with TZINFO Flyer Fridays give you the opportunity to hear from professors in Communication Sciences & Disorders\, Education\, Manag ement\, Nursing\, Physical Therapy\, Occupational Therapy or Visual & Perf orming Arts. \n\nFaculty sessions begin at 9:15am (PLEASE CHOOSE ONE)\, f ollowed by a 10am campus tour and an 11am Freshmen information session. A fter the day's events\, you're invited to join the Admissions staff for lu nch. DTEND;VALUE=DATE:20111225T215525Z DTSTART;VALUE=DATE:20111225T175525Z LOCATION:Nazareth College SUMMARY:Flyer Friday - Timezone Info Session UID:ug-flyerfriday-172 END:VEVENT ``` And you can see it's stored in Zope with UTC, so the problem is only in how it's displayed: ``` >>> app.Plone.events['ug-flyerfriday-172'].startDate DateTime('2011/12/25 17:55:25 GMT+0') ```
How can I make Plone display events during DST with the correct time?
CC BY-SA 3.0
null
2011-06-06T20:35:04.797
2011-06-07T11:46:02.107
null
null
418,413
[ "python", "plone", "icalendar", "zope", "dst" ]
6,257,784
1
6,257,861
null
8
2,983
I am writing text on an image . I am using DrawString(x,y,string) method and I set font size as below ``` Font font = new Font(fontName, fontWeight, fontSize); ``` ![enter image description here](https://i.stack.imgur.com/VneoB.png) As you can see left side text written on image with 12pt size. Right side you can see 12pt size in HTML . Is there any way to map this so that I get same size in output as user sees in HTML ?
Java Font Size vs HTML Font Size
CC BY-SA 3.0
0
2011-06-06T20:40:53.483
2011-09-30T20:50:59.417
2011-06-07T06:26:13.540
198,317
608,576
[ "java", "graphics" ]
6,258,357
1
8,932,806
null
2
636
My program has two targets and I want to correctly configure this screen: ![the screen](https://i.stack.imgur.com/dRE0P.png) I successfully configure the "App Icon" and "Launch Images" in .plist file, setting the key and ([for icon](http://developer.apple.com/library/ios/#qa/qa1686/_index.html)) and ([for launch Image](http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BuildTimeConfiguration/BuildTimeConfiguration.html)) in the .plist file. To see this error yourself, try the following: 1. Create a new project 2. Create two or more targets for this project 3. Go to the screen above (select the project icon in XCode, in targets select the "summary" tab) 4. Select an image to be the icon of this target 5. The icon will be added to the project and automatically saved in the root project directory in the file system with the name "Icon.png" 6. Go to another target and select another image to be the icon of this target 7. Here is the problem. The system will say: "Want to replace this file?" If I say yes, it overwrites and the first target icon is replaced!!! If say no, nothing is done. Is there a way to configure two different icons and two launch images to appear in this screen for each target? I can correctly configure it in the .plist file, but in this screen it looks like
2 Targets 1 Icon Name
CC BY-SA 3.0
0
2011-06-06T21:40:46.637
2012-01-19T20:48:32.523
2012-01-19T20:48:32.523
106,224
632,472
[ "objective-c", "xcode", "xcode4", "icons" ]
6,258,690
1
6,258,731
null
43
6,133
One thing I've seen in some Desktop applications is the ability to change the color of text as the background changes -- to effectively have multiple colors on a single character. I've seen this most commonly with progress bars that display the percentage inside the bar. Generally a darker background color will be used as the progress bar color, and as it progresses, the dark color doesn't contrast enough with the dark text, so the text color changes as soon as the bar overlaps with the text. This image should explain what I mean: ![Progress Bars](https://i.stack.imgur.com/1gvMm.gif) As you can see, the text is black when it's at 0% -- when there is no dark background. When the background image fully progresses to 100%, the text is completely white. But in the middle, as you can see at 50%, the text is half black/half white, and it's actually split on the "0" character in this example. Is there any way to do this at all on a webpage? CSS, Images, Jquery, otherwise? (Preferably not Flash or a Java applet though -- I'm really wondering whether an HTML-based solution is possible.) Thanks!
Is there any way to change the color of text "halfway" through a character on a webpage?
CC BY-SA 3.0
0
2011-06-06T22:18:50.160
2015-07-12T23:41:27.283
null
null
5,454
[ "html", "css", "colors", "progress-bar" ]
6,258,741
1
6,259,008
null
1
1,865
I'm having a few issues with ASP.net MVC's InsertOnSubmit() function. How do you build and insert new objects into the database without running into key constraints? I've gone ahead and created a simple demonstration of the 3-or-so major problems I've been having and maybe someone can help me out here. 1. Create a new ASP.net MVC 2 project. 2. Create two tables- Experiments and Results with a One-To-Many relationship (shown below). 3. Create a new action within the Home controller called "RunExperiment". 4. Create a basic linq-to-sql data context. 5. Have RunExperiment generate a new experiment and results, and insert them into the database via the new data context. This process falls apart quickly since there's some magic that needs to happen to prevent duplicate primary keys to ensure that the dependencies stay intact. ![Example image of database setup.](https://i.stack.imgur.com/K5QqA.jpg) Now take a look at my example "RunExperiment" function: ``` public ActionResult RunExperiment(string Title, string Scientist) { RepositoryDataContext RDC = new RepositoryDataContext(); // Generate the experiment Experiment thisExperiment = new Experiment(); thisExperiment.experimentTitle = Title; thisExperiment.experimentScientist = Scientist; // Perform some work. System.Threading.Thread.Sleep(500); // Attempt to insert the experiment. // Works once, fails subsequently due to duplicate primary key. RDC.Experiments.InsertOnSubmit(thisExperiment); RDC.SubmitChanges(); for (int i = 0; i < 5; i++) { Result thisResult = new Result(); thisResult.resultDate = DateTime.Now; thisResult.resultTemp = i; thisResult.Experiment = thisExperiment; RDC.Results.InsertOnSubmit(thisResult); RDC.SubmitChanges(); } return View("Index"); } ``` Any thoughts? I know this is basic stuff, but I'm trying to work away from just copying the Nerd Dinner pattern but I'm getting these errors. Thanks!
ASP.net MVC Linq-to-SQL Insertion Problems
CC BY-SA 3.0
null
2011-06-06T22:26:38.697
2013-02-27T09:00:29.930
2013-02-27T09:00:29.930
727,208
336,858
[ "c#", "asp.net-mvc", "linq-to-sql", "insertonsubmit" ]
6,259,039
1
6,272,695
null
3
259
I was wondering if anyone know how I can update and categorize my site in the generic Google listing? I noticed sites in Google's generic listing are categorized with specific links under the sites description. How does Google and how would I categorize my site. I have attached screen shot photo: Better Link: [http://www.rimmkaufman.com/rkgblog/2011/05/09/google-sitelinks-video-tip/](http://www.rimmkaufman.com/rkgblog/2011/05/09/google-sitelinks-video-tip/) Took a day, but I found an answer at a very good site: [http://www.seopedia.org/internet-marketing-and-seo/google-sitelinks-the-ultimate-faq/](http://www.seopedia.org/internet-marketing-and-seo/google-sitelinks-the-ultimate-faq/), which hints on how to place sitelinks. Simply: What are Sitelinks ? They are a collection of links, automatically chosen by Google’s algorithm, to appear below the result of website, linking to main pages of your website. They are randomly chosen, although you can block any link from appearing. ![enter image description here](https://i.stack.imgur.com/skvQQ.jpg) Thank you, deDogs
Sitelinks In Generic Lising
CC BY-SA 3.0
0
2011-06-06T23:11:48.620
2014-08-14T08:37:20.753
2011-06-08T00:54:20.667
172,322
584,954
[ "seo" ]
6,259,122
1
6,265,634
null
0
1,059
![enter image description here](https://i.stack.imgur.com/egsU6.png)/*****UPDATED** ***/![Second Image](https://i.stack.imgur.com/zXc5a.png)![enter image description here](https://i.stack.imgur.com/nDc6m.png)r.com/YH3cm.png I am trying to figure out in the above image, how will we know if the user has selected Date or Track. // The data I am receving is through a select query and I create an array to store the list. It is dynamic and not necessary limited to two fields, it can have 10 fields also. How will I know which row is selected and how will I push the data on to the next view. Like in didSelectRowAtIndexPath, how should I push the date or track field on the next view? ``` - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (dvController == nil) dvController = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:nil]; Teat *obj = [appDelegate.coffeeArray objectAtIndex:indexPath.row]; dvController.obj = obj; // Pass the selected object to the new view controller. [self.navigationController pushViewController:dvController animated:YES]; } ```
How to push view depending on the row selection?
CC BY-SA 3.0
null
2011-06-06T23:21:58.897
2011-06-10T13:39:49.603
2011-06-07T17:49:05.933
573,344
573,344
[ "iphone", "objective-c", "uitableview", "uinavigationcontroller", "uinavigationbar" ]
6,259,194
1
6,259,347
null
2
1,378
I've been tasked with password-protecting a Java app with minimal concern for real security. So it seemed sensible to store username/password pairs in a text file and then encrypt it. For the encryption, it seemed appropriate to use XOR ciphers because they're easy and fast (remember--it just has to discourage the casual user, not be bulletproof). I wrote all the appropriate Java, and then realized I needed a way to encrypt the config file. I wrote an additional method, but it was clunky to use more than once or twice (and seemed to only work for some inputs), so I decided it was best to write something in Python, to be played with at a REPL. This is what I ended up with: ``` from itertools import izip, cycle KEY = "stackoverflow" def encrypt(text): return ''.join(chr(ord(x) ^ ord(y)) for (x,y) in izip(text,cycle(KEY))) def decrypt(text): return encrypt(text) def export(users, file): with open(file, "w") as f: for user, password in users.items(): f.write(encrypt('"%s" "%s"'%(user, password)) + "\n") def import_data(file): with open(file) as f: return [decrypt(i) for i in f.readlines()] ``` On the surface, it works: ``` >>> x = encrypt("Hello world!") >>> x ';\x11\r\x0f\x04O\x01\n\x00\n\x08N' >>> decrypt(x) 'Hello world!' ``` But then things start to fall apart: ``` >>> export({"foo" : "bar", "baz" : "quux", "spam" : "eggs"}, "users.dat") >>> import_data("users.dat") ['"foo" "bar"e', '"baz" "quux"}', '"spam" "eggs"y'] ``` And here's how vim reads it - ![Vim rendition](https://i.stack.imgur.com/nan3F.png) And then: ``` >>> export({"what" : "not", "this" : "that", "admin_istrator" : "quux"}, "users2.dat") >>> import_data("users2.dat") ['"thi', "k97$ma{~'l", '"what" "not"}', '"admin_istrator" "quux', '7~'] ``` Vim: ![Vim rendition of the second set](https://i.stack.imgur.com/dVbJO.png) It occurred to me that I might be having a problem with a character's encrypted form being a newline, but as far as I see that doesn't explain the wacky behavior in the first example or of the wacky behavior in the second one. Regarding the newlines, my Plan B is to encrypt the entire file--newlines and all--and then slurp it back up, decrypt it, split it on "\n", and proceed with my line-based parsing. Thanks in advance. --- Update: Here's my implementation of Plan B (described two paragraphs ago). ``` def import2(file): with open(file) as f: return decrypt(f.read()) ``` and then: ``` >>> export({"foo" : "bar", "this" : "that", "admin_istrator" : "letmein"}, "users2.dat") >>> import2("users2.dat") '"this" "that"y%smg&91uux!}"admin_istrator" "letmein"y' ``` --- Update Two: Binary. [Code is the same as above, except that all `open`s are `open(file, "rb")` or `open(file, "wb")`.] ``` >>> export({"foo" : "bar", "this" : "that", "admin_istrator" : "letmein"}, "users2.dat") >>> import2("users2.dat") '"this" "that"y%smg&91uux!}"admin_istrator" "letmein"y' >>> import_data("users2.dat") ['"t', "k97$ma{~'", '"foo" "bar"', '"admin_istrator" "letmein"'] ``` --- Final update: Base 64, other shenanigans. ``` def import2(file): with open(file, "rb") as f: return filter(str.strip, [decrypt(i) for i in f.readlines()]) ``` where `encrypt` and `decrypt` `encode` in/`decode` base 64.
XOR ciphering works *most* of the time
CC BY-SA 3.0
null
2011-06-06T23:32:55.653
2011-07-14T14:00:18.730
2011-07-14T14:00:18.730
220,529
220,529
[ "python", "encryption", "xor" ]
6,259,269
1
6,259,313
null
10
19,154
Here's the [example](http://download.oracle.com/javase/tutorial/uiswing/misc/trans_shaped_windows.html#uniform). If you build and run `TranslucentWindow` in let's say, NetBeans IDE 7.0, which supports jdk7, you'll get the following exception: ``` Exception in thread "AWT-EventQueue-0" java.awt.IllegalComponentStateException: The frame is decorated at java.awt.Frame.setOpacity(Frame.java:960) at main.TranslucentWindow.<init>(TranslucentWindow.java:23) at main.TranslucentWindow$1.run(TranslucentWindow.java:47) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705) at java.awt.EventQueue.access$000(EventQueue.java:101) at java.awt.EventQueue$3.run(EventQueue.java:666) at java.awt.EventQueue$3.run(EventQueue.java:664) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:675) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) BUILD SUCCESSFUL (total time: 1 second) ``` According to this stack trace, the offending line is `tw.setOpacity(0.55f)`. But, as the error indicates, if you invoke `setUndecorated(true)` on the frame, then it won't throw the exception and will create a translucent window, albeit without any decoration (which is a pain). Is this normal? Shouldn't this code run right "out-of-the-box"? Am I overlooking something? Why does their translucent window appear decorated, or is this custom rendering? ![enter image description here](https://i.stack.imgur.com/Bi7Wc.png) ![enter image description here](https://i.stack.imgur.com/31nZo.png)
Is The Java Tutorials Translucent Window example giving trouble to those playing with jdk7?
CC BY-SA 3.0
0
2011-06-06T23:44:49.527
2015-12-11T17:52:30.527
2013-08-26T07:14:47.493
714,968
584,862
[ "java", "swing", "java-7", "translucency", "netbeans7.0" ]
6,259,345
1
null
null
1
581
Here is an example 3D geometry. ``` dat=Import["ExampleData/747.3ds.gz", ImageSize -> Medium] ``` Now if one wants to get a BSplineFunction for this 3D geometry what is the easiest way to do it? I can see the parts in Mathematica using the following command. ``` parts = Length[(dat // First // Last)]; ``` and here comes the 3D points after extraction. ``` ListPointPlot3D[Flatten[Map[((dat // First // Last)[[#]] /. GraphicsComplex[a_, b_] -> List[a]) &, Range[parts]], 1]] ``` I hope there is a general method so that we can form a BSpline function from any 3D graphics complex. I suppose the general method will be able to convert Mathematica 3D representations in continuous BSplines representation. Now we will elaborate according to the example given by belisarius. ``` v={{0,0,0},{2,0,0},{2,2,0},{0,2,0},{1,1,2}}; i={{1,2,5},{2,3,5},{3,4,5},{4,1,5}}; Graphics3D[{Opacity[.5],GraphicsComplex[v,Polygon[i]]}] ``` ![enter image description here](https://i.stack.imgur.com/YfwiA.png) We can simply form the input for the BSpline surface for this example. ``` dat = Table[Map[v[[#]] &, i[[j]]], {j, 1, Length[i]}]; ``` Now let's see the surface that comes out if we consider the underlying vertices. ``` Show[ (* Vertices *) ListPointPlot3D[v,PlotStyle->{{Black,PointSize[.03]}}], (* The 3D solid *) Graphics3D[{Opacity[.4],GraphicsComplex[v,Polygon[i]]}], (* The BSpline surface *) Graphics3D[{Opacity[.9],FaceForm[Red,Yellow], BSplineSurface[dat, SplineDegree-> {1,2},SplineClosed->{True,False}]} ], Boxed-> False,Axes-> None ] ``` ![enter image description here](https://i.stack.imgur.com/PoABP.png) Once this surface is formed I thought it will be possible to make a BSplineFunction in some way. But what I get is completely different from the above surface. ``` func = BSplineFunction[dat, SplineDegree -> {1, 2},SplineClosed -> {True, False}]; Plot3D[func[x, y], {x, 0, 1}, {y, 0, 1}, Mesh -> None,PlotRange -> All] ``` ![enter image description here](https://i.stack.imgur.com/i1ksp.png) So am I making some conceptual mistake here?
How to form a BSpline function from a 3DS/OBJ import in Mathematica
CC BY-SA 3.0
null
2011-06-06T23:55:44.807
2011-06-07T14:06:55.063
2011-06-07T12:32:54.637
615,464
782,363
[ "wolfram-mathematica", "bspline" ]
6,259,383
1
null
null
0
288
![enter image description here](https://i.stack.imgur.com/Ckcny.jpg) Hi StackOverflow members, I was playing around with the Open WordSearch project and I applied a custom ttf font and changed a phew things and now I get a weird overlapping of next words on top of previous words I tested the original code and it does not do this. I even reversed all my changes I could think of and it still happens. I experienced this same issue on another project too. It was not happening on my Desire HD buy I found it only on the emulator. Has anybody ever came across this issue? For the life of me I can not figure out were or how it is happening I cant even provide the code for it. Any help would be greatly appreciated. Best Regards Jason
Weird Text overlapping issue
CC BY-SA 3.0
null
2011-06-07T00:01:25.093
2011-06-08T23:27:47.507
null
null
583,739
[ "android", "textview", "typeface" ]
6,259,401
1
6,259,498
null
4
1,059
I have designed a website that consists of the "body", a "container" to hold and center a "content" div on the page. The height of the "content" and "container" divs is set to 100%, I have also added an Accordian jQuery Script within the "content" div. Now in Google Chrome, when I activate the div that uses the jQuery Accordian Script, it show the div as expected. The page expands in height, and follows the height: 100% attribute which is coded within the External Cascading Style Sheet. But, (here's the problem), in Google Chrome, it adds extra space below the "container" div, and which shows a problem within the coding, whether it be in the XHTML 1.0 Strict, and or the CSS document. Or it could possibly be in the JavaScript. Both of the XHTML 1.0 Strict and CSS are validated, except for one error in the XHTML document, which has already been fixed without re-uploading it to the server, which does not affect the problem any. The specified jQuery Accordian Div is located where the image "Click To Inquire" is specified. You can view the page at: [http://www.noxinnovations.com/portfolio/thecommonwealth/index.html](http://www.noxinnovations.com/portfolio/thecommonwealth/index.html) You can view the css at: [http://www.noxinnovations.com/portfolio/thecommonwealth/style.css](http://www.noxinnovations.com/portfolio/thecommonwealth/style.css) You can view the JavaScript at: [http://www.noxinnovations.com/portfolio/thecommonwealth/javascript.js](http://www.noxinnovations.com/portfolio/thecommonwealth/javascript.js) If you do not have Google Chrome, and or use Internet Explorer, Opera, Apple Safari, and or Mozilla Firefox. You can view the problem I am running into as an image ![enter image description here](https://i.stack.imgur.com/PiUIk.png) Look below the red, and then the black right below it. Hence, the extra spacing. It would be very appreciative is someone were to help me with this issue, Thank you very much, Aaron Brewer
Extra Padding From Bottom Of Div After jQuery Accordian Script Is Actived
CC BY-SA 3.0
null
2011-06-07T00:03:53.163
2011-12-11T23:54:42.877
2011-12-11T23:54:42.877
91,299
1,480,823
[ "javascript", "jquery", "css", "xhtml", "jquery-ui-accordion" ]
6,259,599
1
6,261,032
null
1
755
I did install SugarCRM professional on one of the public IP address and configured that which works smoothly in this following link [http://66.240.55.100/fs](http://66.240.55.100/fs) I tried to copy the files and database as it is to my local system which could be accessed like this link [http://localhost/fs/index.php](http://localhost/fs/index.php)![enter image description here](https://i.stack.imgur.com/LM8ab.jpg) When I add the exception and proceed, I see following error message ![enter image description here](https://i.stack.imgur.com/ujsgY.jpg) I deleted the cache directory and tried, but no luck. My question is, Why its asking SSL, how to disable it in localhost or any other issues exist in the configuration.
SSL error in SugarCRM in localhost
CC BY-SA 3.0
0
2011-06-07T00:43:23.160
2015-07-02T16:12:19.783
2015-07-02T16:12:19.783
64,046
355,226
[ "php", "ssl", "sugarcrm" ]
6,259,639
1
6,259,657
null
1
849
What is the component that allows me to create a custom properties form? I mean, a component like this: ![enter image description here](https://i.stack.imgur.com/AkTDy.png) I'm trying to make an editor, so I need that component.
Properties Component
CC BY-SA 3.0
0
2011-06-07T00:54:10.713
2011-06-07T01:00:14.977
null
null
80,766
[ "c#", "components" ]
6,259,606
1
null
null
1
1,455
I'm trying to develop a game, but I have a problem. I´m using png images and I create my own sprite class This is how I load the png's: : ``` #include "loadImage.h" #include <cstdio> #include <cstdlib> struct Texture2D { unsigned int Texture; unsigned char *Pixels; int Width; int Height; }; int GetTextureInfo(int ColourType) { int ret; switch(ColourType) { case PNG_COLOR_TYPE_GRAY: ret = 1; break; case PNG_COLOR_TYPE_GRAY_ALPHA: ret = 2; break; case PNG_COLOR_TYPE_RGB: ret = 3; break; case PNG_COLOR_TYPE_RGB_ALPHA: ret = 4; break; default: ret = -1; }; return ret; }; GLuint loadImage(const char *filename,struct Texture2D *image) { GLuint texture; png_structp png_ptr = NULL; png_infop info_ptr = NULL; png_bytep *row_pointers = NULL; int bitDepth, colourType; FILE *pngFile = fopen(filename, "rb"); if(!pngFile) return 0; png_byte sig[8]; fread(&sig, 8, sizeof(png_byte), pngFile); rewind(pngFile);//so when we init io it won't bitch if(!png_check_sig(sig, 8)) return 0; png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL,NULL,NULL); if(!png_ptr) return 0; if(setjmp(png_jmpbuf(png_ptr))) return 0; info_ptr = png_create_info_struct(png_ptr); if(!info_ptr) return 0; png_init_io(png_ptr, pngFile); png_read_info(png_ptr, info_ptr); bitDepth = png_get_bit_depth(png_ptr, info_ptr); colourType = png_get_color_type(png_ptr, info_ptr); if(colourType == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png_ptr); if(colourType == PNG_COLOR_TYPE_GRAY && bitDepth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr); if(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); if(bitDepth == 16) png_set_strip_16(png_ptr); else if(bitDepth < 8) png_set_packing(png_ptr); png_read_update_info(png_ptr, info_ptr); png_uint_32 width, height; png_get_IHDR(png_ptr, info_ptr, &width, &height, &bitDepth, &colourType, NULL, NULL, NULL); int components = GetTextureInfo(colourType); if(components == -1) { if(png_ptr) png_destroy_read_struct(&png_ptr, &info_ptr, NULL); return 0; } GLubyte *pixels = (GLubyte *)malloc(sizeof(GLubyte) * (width * height * components)); row_pointers = (png_bytep *)malloc(sizeof(png_bytep) * height); for(int i = 0; i < height; ++i) row_pointers[i] = (png_bytep)(pixels + (i * width * components)); png_read_image(png_ptr, row_pointers); png_read_end(png_ptr, NULL); // make it glGenTextures(1, &texture); // bind it glBindTexture(GL_TEXTURE_2D, texture); // stretch it glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); // technologic - I MEAN // here we has the problems GLuint glcolours; (components==4) ? (glcolours = GL_RGBA): (0); (components==3) ? (glcolours = GL_RGB): (0); (components==2) ? (glcolours = GL_LUMINANCE_ALPHA): (0); (components==1) ? (glcolours = GL_LUMINANCE): (0); glTexImage2D(GL_TEXTURE_2D, 0, components, width, height, 0, glcolours, GL_UNSIGNED_BYTE, pixels); png_destroy_read_struct(&png_ptr, &info_ptr, NULL); fclose(pngFile); free(row_pointers); free(pixels); //Texture2D image; image->Texture = texture; image->Pixels = pixels; image->Width = width; image->Height = height; //return image; return texture; }; ``` This is my sprite class: : ``` #include "csprite.h" #include "loadImage.h" void CFrame::load(const char *path) { this->texture=loadImage(path,&img); } void CFrame::unload(){ this->texture=NULL; } CSprite::CSprite(int nf) { this->estado=0; this->posx=0; this->posy=0; this->sprite=new CFrame[nf]; this->nframes=nf; this->cont=0; } CSprite::CSprite() { int nf=1; this->estado=0; this->posx=0; this->posy=0; this->sprite=new CFrame[nf]; this->nframes=nf; this->cont=0; } CSprite::~CSprite(){ this->finalize(); } void CSprite::glEnable2D( void ) { GLint iViewport[4]; // Get a copy of the viewport glGetIntegerv( GL_VIEWPORT, iViewport ); // Save a copy of the projection matrix so that we can restore it // when it's time to do 3D rendering again. glMatrixMode( GL_PROJECTION ); glPushMatrix(); glLoadIdentity(); // Set up the orthographic projection glOrtho( iViewport[0], iViewport[0]+iViewport[2],iViewport[1]+iViewport[3], iViewport[1], -1, 1 ); glMatrixMode( GL_MODELVIEW ); glPushMatrix(); glLoadIdentity(); // Make sure depth testing and lighting are disabled for 2D rendering until // we are finished rendering in 2D glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_LIGHTING_BIT ); glDisable( GL_DEPTH_TEST ); glDisable( GL_LIGHTING ); } void CSprite::glDisable2D( void ) { glPopAttrib(); glMatrixMode( GL_PROJECTION ); glPopMatrix(); glMatrixMode( GL_MODELVIEW ); glPopMatrix(); } void CSprite::finalize() { int i; for (i=0 ; i<=this->nframes-1 ; i++) this->sprite[i].unload(); } void CSprite::addframe(CFrame frame) { if (this->cont<this->nframes) { this->sprite[this->cont]=frame; this->cont++; } } int CSprite::selframe(int nf) { if (nf<this->nframes) { this->estado=nf; return 1; } else { return 0; } } void CSprite::animate(){ if (this->estado<this->nframes) { this->estado++; } else{ this->estado=0; } } void CSprite::draw() { glEnable(GL_TEXTURE_RECTANGLE_ARB); glGenTextures(1, &this->sprite[estado].texture); //printf("++++ %d",sprite[estado].texture); glBindTexture( GL_TEXTURE_RECTANGLE_ARB, this->sprite[estado].texture ); //glTexParameteri( sprite[estado].texture, GL_TEXTURE_PRIORITY, 1); /* GLclampf priorities; priorities=1; GLfloat p=1; glPrioritizeTextures(1,&sprite[estado].texture, &p);*/ // Write the 32-bit RGBA texture buffer to video memory glTexImage2D( GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, this->sprite[estado].img.Width, this->sprite[estado].img.Height, 0, GL_RGBA, GL_UNSIGNED_BYTE, this->sprite[estado].img.Pixels ); glEnable2D(); // Make the sprite 2 times bigger (optional) //glScalef( 2.0f, 2.0f, 0.0f ); // Blend the color key into oblivion! (optional) glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); // Set the primitive color to white glColor3f( 1.0f, 1.0f, 1.0f ); // Bind the texture to the polygons glBindTexture( GL_TEXTURE_RECTANGLE_ARB, this->sprite[estado].texture ); } void CSprite::drawNormal(){ draw(); // Save a copy of the texture's dimensions for later use int TextureWidth = this->sprite[estado].img.Width; int TextureHeight = this->sprite[estado].img.Height; //para cargar texturas normal se cargar el punto: cuadrado(0,0)con textura(0,0) //normal glBegin( GL_QUADS ); glTexCoord2i(0,0); glVertex2f(this->posx,this->posy); glTexCoord2i( 0,TextureHeight); glVertex2f( this->posx, this->posy+TextureHeight ); glTexCoord2i( TextureWidth, TextureHeight ); glVertex2f( this->posx+TextureWidth, this->posy+TextureHeight ); glTexCoord2i( TextureWidth,0 ); glVertex2f( this->posx+TextureWidth, this->posy ); glEnd(); // Disable 2D rendering glDisable2D(); } void CSprite::drawTurned(){ draw(); // Save a copy of the texture's dimensions for later use int TextureWidth = this->sprite[estado].img.Width; int TextureHeight = this->sprite[estado].img.Height; //para cargar texturas al revez se cargar el punto: cuadrado(0,0)con textura(1,0) //volteado glBegin( GL_QUADS ); glTexCoord2i(0,0); glVertex2f( this->posx+TextureWidth, this->posy ); glTexCoord2i( TextureWidth,0 ); glVertex2f(this->posx,this->posy); glTexCoord2i( TextureWidth, TextureHeight ); glVertex2f( this->posx, this->posy+TextureHeight ); glTexCoord2i( 0,TextureHeight); glVertex2f( this->posx+TextureWidth, this->posy+TextureHeight ); glEnd(); // Disable 2D rendering glDisable2D(); } ``` and this my main class: : ``` #include <iostream> #include <OpenGL/gl.h> #include "GLUT/glut.h" #include "loadImage.h" #include "csprite.h" CFrame fplay1; CSprite splay1; void reshape(int width, int height) { glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(-1, 1, -1, 1); glMatrixMode(GL_MODELVIEW); } void display() { glClear(GL_COLOR_BUFFER_BIT); glLoadIdentity(); fplay1.load("Sasuke_run002.png"); splay1.addframe(fplay1); splay1.setPosition(100,100); splay1.drawNormal(); glFlush(); glutSwapBuffers(); } void init() { glClearColor(0,0,0,0); } int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowPosition(50, 50); glutInitWindowSize(500, 500); glutCreateWindow("Hello OpenGL"); init(); glutDisplayFunc(display); glutReshapeFunc(reshape); glutMainLoop(); return 0; } ``` the result is this: ![https://i1094.photobucket.com/albums/i450/Daniel_Vera/bien.jpg](https://i1094.photobucket.com/albums/i450/Daniel_Vera/bien.jpg) but if I change the display function and the main function in main.cpp, like this: ``` #include <iostream> #include <OpenGL/gl.h> #include "GLUT/glut.h" #include "loadImage.h" #include "csprite.h" CFrame fplay1; CSprite splay1; void reshape(int width, int height) { glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(-1, 1, -1, 1); glMatrixMode(GL_MODELVIEW); } void display() { glClear(GL_COLOR_BUFFER_BIT); glLoadIdentity(); //****** CHANGE ******// splay1.drawNormal(); glFlush(); glutSwapBuffers(); } void init() { glClearColor(0,0,0,0); } int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowPosition(50, 50); glutInitWindowSize(500, 500); glutCreateWindow("Hello OpenGL"); init(); //****** CHANGE ******// fplay1.load("Sasuke_run002.png"); splay1.addframe(fplay1); splay1.setPosition(100,100); glutDisplayFunc(display); glutReshapeFunc(reshape); glutMainLoop(); return 0; } ``` the result is this: ![https://i1094.photobucket.com/albums/i450/Daniel_Vera/mal.jpg](https://i1094.photobucket.com/albums/i450/Daniel_Vera/mal.jpg) I don´t understand why this happened. I want to use my sprite class in the second form
PNG Images issue with OpenGL and C++
CC BY-SA 3.0
null
2011-06-07T00:44:42.573
2013-01-31T21:04:24.523
2017-02-08T14:32:25.150
-1
786,710
[ "c++", "opengl" ]
6,259,739
1
6,260,463
null
1
103
Here's my code: delegate.h ``` #import <UIKit/UIKit.h> @class _4_Control_FunViewController; @interface _4_Control_FunAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; _4_Control_FunViewController *viewController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet _4_Control_FunViewController *viewController; @end ``` delegate.m: ``` #import "_4_Control_FunAppDelegate.h" #import "_4_Control_FunViewController.h" @implementation _4_Control_FunAppDelegate @synthesize window; @synthesize viewController; #pragma mark - #pragma mark Application lifecycle - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { [window addSubview:viewController.view]; [window makeKeyAndVisible]; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { } - (void)applicationDidEnterBackground:(UIApplication *)application { } - (void)applicationWillEnterForeground:(UIApplication *)application { } - (void)applicationDidBecomeActive:(UIApplication *)application { } - (void)applicationWillTerminate:(UIApplication *)application { } #pragma mark - #pragma mark Memory management - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { } - (void)dealloc { [viewController release]; [window release]; [nameField release]; [numberField release]; [super dealloc]; } ``` @end ViewController.h ``` #import <UIKit/UIKit.h> @interface _4_Control_FunViewController : UIViewController { UITextField *nameField; UITextField *numberField; } @property (nonatomic, retain) IBOutlet UITextField *nameField; @property (nonatomic, retain) IBOutlet UITextField *numberField; @end ``` ViewController.m ``` #import "_4_Control_FunViewController.h" @implementation _4_Control_FunViewController @synthesize nameField; @synthesize numberField; - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } @end ``` This is what I'm trying to get: ![here.](https://i.stack.imgur.com/Rro6N.png) This is what I'm getting: ![here.](https://i.stack.imgur.com/ovQsx.png)
Undeclared Error and iPhone Simulator Crashing
CC BY-SA 3.0
null
2011-06-07T01:16:11.173
2011-06-07T04:04:06.297
null
null
707,105
[ "iphone" ]
6,259,816
1
6,259,843
null
1
7,098
Inside the Twitter iPhone app, if you click on a link it pushes in a WebView. Ive gotten this far, but I can't find the correct identifier for the forward and backward buttons like at the bottom left of the image below. Are they native? or are they just images they have created themselves? ![web view](https://i.stack.imgur.com/VxgkX.png)
Forward and back native buttons in UIWebview iphone
CC BY-SA 3.0
0
2011-06-07T01:34:01.887
2011-06-07T02:11:05.000
null
null
196,555
[ "iphone", "objective-c", "button", "uiwebview" ]
6,260,015
1
6,260,040
null
6
30,520
Okay, I have these table ![table1](https://i.stack.imgur.com/QrE5N.png) and I also have another table right here: ![enter image description here](https://i.stack.imgur.com/jUDI5.png) So,idAlbum is in the gallery table, what is the query for this? I want to select the data from one field in one table and insert it into a field in another table.
How to add another field in an existing table in mysql
CC BY-SA 3.0
0
2011-06-07T02:15:53.983
2011-06-07T02:31:47.833
2020-06-20T09:12:55.060
-1
505,797
[ "mysql", "phpmyadmin" ]
6,260,067
1
13,968,433
null
2
1,320
I am trying to remove status bar from particular View Controller but still it shows blue line when i tried to Hide it so please give some suggestions for that.![enter image description here](https://i.stack.imgur.com/c506u.png)
How to Remove status bar from Particular View controller?
CC BY-SA 3.0
null
2011-06-07T02:25:35.807
2012-12-20T09:00:08.933
null
null
198,680
[ "ios4" ]
6,260,226
1
6,286,726
null
3
5,623
Cannot change text color of xcode color output despite trying to use the "xcode preference" dialogue box. Please help ... ![enter image description here](https://i.stack.imgur.com/mIHMi.png) The above is a screen shot of the preference dialogue window. Somehow, the option for changing the console output does not seem to be showing up.
About xcode console text color and background
CC BY-SA 3.0
0
2011-06-07T03:01:23.233
2011-06-09T00:12:19.510
2011-06-07T10:50:12.253
556,868
556,868
[ "objective-c", "xcode" ]
6,260,740
1
null
null
2
985
I have a style that I am applying to the ItemContainerStyle of a Listview. It puts a line across the bottom of the row and sets the height of the row. However for some reason - each row seems to have rounded corners (as seen in the snapshot attached). When I look at the style in Blend - there are no rounded corners. How can I get rid of the rounded corners? ``` <Style TargetType="ListViewItem" x:Key="RowStyle"> <Setter Property="BorderThickness" Value="0,0,0,1" /> <Setter Property="BorderBrush" Value="{DynamicResource ButtonPressedColor}" /> <Setter Property="Height" Value="40" /> <Setter Property="Background" Value="#FFF9EDED"/> </Style> <ListView x:Name="lvw_FileList" Background="{DynamicResource Watermark}" ItemContainerStyle="{StaticResource RowStyle}" BorderBrush="{DynamicResource GreyBorderColor}" BorderThickness="3" Margin="0" ItemsSource="{Binding Mode=OneWay}" d:DataContext="{d:DesignData /SampleData/SampleListItems.xaml}" Foreground="{DynamicResource TextColor}"> <ListView.View> <GridView AllowsColumnReorder="False"> <GridView.ColumnHeaderContainerStyle> <Style> <Setter Property="UIElement.Visibility" Value="Collapsed" /> </Style> </GridView.ColumnHeaderContainerStyle> <GridViewColumn Header="Picture" CellTemplate="{DynamicResource PictureCell}" /> <GridViewColumn Header="Name" CellTemplate="{DynamicResource CompanyNameCell}" /> <GridViewColumn Header="Action" CellTemplate="{DynamicResource ActionCell}" /> <!--<GridViewColumn Header="Delete" Width="50"/>--> </GridView> </ListView.View> </ListView> ``` ![Rounded Corners on ListViewItems](https://i.stack.imgur.com/ek3B6.png)
How can I get rid of the rounded corners on the ListViewItem in a WPF listview?
CC BY-SA 3.0
null
2011-06-07T04:55:48.373
2014-02-13T01:57:40.150
2014-02-13T01:57:40.150
1,774,011
30,639
[ "wpf", "xaml", "styling", "listviewitem" ]
6,260,821
1
6,260,972
null
0
167
I have a small panel where i am making a ball to move by just varying it's `x co-ordinate`. I want the ball move back when it encounters the end of frame.The width of my frame is `(by fr.setSize(300,300))`. Now I programmed the animation like : ``` // when x == 300 // stop the timer ``` But x=300 seems to be greater than it's width which is 300 ! How is this possible. **The ball moves out of the `300 x 300` frame and becomes invisible. These are the screen shots of what happens eventually. ![Ball is moving...](https://i.stack.imgur.com/UP8Jr.jpg) ![Ball is no where..!!](https://i.stack.imgur.com/cvYOb.jpg) ![Upon Enlarging,ball is there](https://i.stack.imgur.com/ILkH1.jpg)
ending the ball's path
CC BY-SA 3.0
null
2011-06-07T05:10:09.133
2011-06-13T14:44:44.333
null
null
648,138
[ "java", "swing", "user-interface", "graphics", "2d" ]
6,260,926
1
null
null
9
7,447
, Hello, everyone. I'm developing my app which has a feature to post article from website. This is a picture of UIWebview with UIMenuController. ![enter image description here](https://i.stack.imgur.com/UUXLT.jpg) It was possible to get event when user tap the button. but I can't find the way to get the text the user selected. In UITextView case, it has 'selectedRange' property, so it is easy to get selection text. ``` UIMenuItem *facebookMenuItem = [[UIMenuItem alloc] initWithTitle:@"Facebook" action:@selector(facebookMenuItemTapped:)]; UIMenuItem *twitterMenuItem = [[UIMenuItem alloc] initWithTitle:@"Twitter" action:@selector(twitterMenuItemTapped:)]; [UIMenuController sharedMenuController].menuItems = [NSArray arrayWithObjects: facebookMenuItem, twitterMenuItem, nil]; [twitterMenuItem release]; [facebookMenuItem release]; ``` I would like to get the selection text on UIWebView. Does anybody have an idea or hint? Thanks.
How to get selection text from UIWebView?
CC BY-SA 3.0
0
2011-06-07T05:24:53.370
2014-02-27T07:33:31.067
null
null
255,549
[ "iphone", "objective-c", "ipad", "uiwebview" ]
6,261,439
1
null
null
1
198
Suppose I have a table structure like ![enter image description here](https://i.stack.imgur.com/VR4Xb.gif) I want to grab all user metas is it better to do a big query joining all tables in the image ... ``` SELECT [columns ...] FROM usermetasections LEFT JOIN usermetakeys ON ... LEFT JOIN usermetas ON ... LEFT JOIN users ON ... WHERE users.id = xxx ``` ... ... or break them into smaller queries like ... ``` Loop through SELECT * FROM usermetasections Loop through SELECT * FROM usermetakeys WHERE section = xxx Loop thought SELECT * FROM usermetas WHERE key = xxx AND user = xxx ``` I think if I go the 1st approach, it will be faster for "machine" performance but bad for developer performance? harder to read, more code to parse queries into PHP objects?
Grabbing data with relations. 1 big query or afew small queries
CC BY-SA 3.0
null
2011-06-07T06:36:32.137
2011-06-07T06:39:59.193
null
null
637,041
[ "php", "mysql", "performance", "code-readability" ]
6,261,595
1
6,423,965
null
0
240
I am working on SSRS reports. I have a table having group i.e. ![enter image description here](https://i.stack.imgur.com/wsFAZ.png) But I want this kind of table as a result: ![enter image description here](https://i.stack.imgur.com/VqfEk.png) That is summing the Age Total in each group. Any idea?
Summing up each group of a Table in SSRS VS 2010
CC BY-SA 3.0
null
2011-06-07T06:54:25.767
2011-06-21T10:41:31.733
null
null
669,448
[ "visual-studio-2010", "reporting-services", "ssrs-tablix", "ssrs-grouping" ]
6,261,620
1
6,262,688
null
2
2,334
I'm working on on some details on my plots and I've found one I can't get around. On my levelplot are numeric tickmarks. Now I want my tickmarks on the y-axis to be changed to the corresponding Letters. (i.e. 1=A, 5=E,27=AA, 29=AC,...) I've already used ``` scales=list( y=list(alternating=3,labels=toupper(c(letters[1],letters[5],letters[10],letters[15]))))) ``` But I want them to change depending on what's on the Y-axis, not from values I'm giving. Can anybody help me on this one? ``` levelplot(volcano,main="levelplot(volcano)") ``` ![enter image description here](https://i.stack.imgur.com/xtkF5.png)
change numeric tickmarks to letters on levelplot
CC BY-SA 3.0
0
2011-06-07T06:57:15.363
2011-06-07T08:42:22.353
null
null
717,132
[ "r", "lattice" ]
6,261,940
1
6,262,238
null
1
1,308
i need to export 3 full sql table values in to a single excel sheet using store procedure. i have done with single table , query i have used for single table : ``` set @sql='bcp "select * from Veest..ven_machinedescription_day_report " queryout c:\Daily_Reports\data_file.csv -c -t, -T -S' + @@servername exec master..xp_cmdshell @sql --Copy dummy file to passed EXCEL file set @sql= 'exec master..xp_cmdshell ''type '+@data_file+' >> "'+@file_name+'"''' exec(@sql) --Delete dummy file set @sql= 'exec master..xp_cmdshell ''del '+@data_file+'''' exec(@sql) ``` the above query is working fine.. for saving 3 tables values , i have done like this , ``` set @sql='bcp "select * from Veest..ven_machinedescription_day_report " queryout c:\Daily_Reports\data_file.csv -c -t, -T -S' + @@servername exec master..xp_cmdshell @sql set @sql1='bcp "select * from Veest..ven_machinedescription_night_report " queryout c:\Daily_Reports\data_file.csv -c -t, -T -S' + @@servername exec master..xp_cmdshell @sql1 set @sql22='bcp "select * from Veest..ven_machinedescription_midnight_report " queryout c:\Daily_Reports\data_file.csv -c -t, -T -S' + @@servername exec master..xp_cmdshell @sql2 ``` when i saw the data_file.csv, only the last execution (@sql2) is saved..the data is not being appended.. i need output similar to the below image.. ![enter image description here](https://i.stack.imgur.com/Q6oFw.jpg) some times the total columns numbers will be not same in all the 3 tables.. plz help me out to solve this issue.. thanks n regards, T.Navin
how to export 3 table values to single excel using sql server 2008
CC BY-SA 3.0
null
2011-06-07T07:31:28.630
2011-06-07T08:58:16.417
null
null
712,973
[ "sql-server", "sql-server-2008" ]
6,262,001
1
null
null
0
161
My question is going to be quite consistant. I have a generic class `Cell<T>`. And I have client class which operates with 2dimensional array of `Cell<T>`: ``` public sealed class Environment { private Cell<YUV>[,] primaryLayer; public Colorizator(Cell<YUV>[,] layer) { // initialization... } // ... } ``` In the `Environment` class I call method that makes following: ``` for(var ix = 1; ix < this.Width - 1; ix++) { for(var iy = 1; iy < this.Height - 1; iy++) { this.primaryLayer[ix, iy].Window[0] = this.primaryLayer[ix - 1, iy + 1]; this.primaryLayer[ix, iy].Window[1] = this.primaryLayer[ix, iy + 1]; this.primaryLayer[ix, iy].Window[2] = this.primaryLayer[ix + 1, iy + 1]; this.primaryLayer[ix, iy].Window[3] = this.primaryLayer[ix + 1, iy]; this.primaryLayer[ix, iy].Window[4] = this.primaryLayer[ix + 1, iy - 1]; this.primaryLayer[ix, iy].Window[5] = this.primaryLayer[ix, iy - 1]; this.primaryLayer[ix, iy].Window[6] = this.primaryLayer[ix - 1, iy - 1]; this.primaryLayer[ix, iy].Window[7] = this.primaryLayer[ix - 1, iy]; } } ``` It fills each cell Moore neighbourhood with neighbour. Then I use algorithm similar to flood fill in other method: ``` foreach(var cell in some_list) { Parent = cell; Parent.Conquer(Parent); Parent.ViabilityRatio = this.ViabilityTresholds.Max; lr[Parent.X, Parent.Y] = Parent; while(true) { if(null == (Child = Parent.Window.FirstOrDefault(x => !(x as Cell<YUV>).IsMarked) as Cell<YUV>)) { break; } else { Parent.Mark(Child); var wt = default(Double); foreach(Cell<YUV> ch in Child.Window) { // Operation fails // NullReferenceException occurs: there's no cells in `Child` neighbourhood wt += ch.ViabilityRatio; } Parent = Child; } } } ``` When I try to iterate over `Child.Window` I found that there's no neighbourhood elements. First what thought was that `Parent` and `Child`, especially `Child`, don't save references to objects I assigned them. I mean that `cell` variable `in the foreach loop` has not-null neighbourhood. But Parent hasn't. ## Solution 1. Helped with Parent cell I implemented `Copy` method in `Cell<T>` class: ``` public Cell<T> Copy() { return (Cell<T>)this.MemberwiseClone(); } ``` Since then `Parent` saves its not-null `Window` property. ``` foreach(var cell in some_list) { Parent = cell.Copy(); ``` But `if(null == (Child = Parent.Window.FirstOrDefault(x => !(x as Cell<YUV>).IsConquered) as Cell<YUV>).Copy())` trial unfortunatelly fails. `Child` doesn't have not-null `Window` property. Please, Help!! Thanks! ## Edit I've tried to do next: `var ActiveWindow = (from ch in Parent.Window select (Cell<YUV>)ch).ToList();` `ActiveWindow` collection is keeping all neighbours initialized. Moreover all neighbours as I've been expecting have their own neighbours initialized. But when I've debugged this: `Child = ActiveWindow[0]` ... `Child` stores no neighbours.. ## Edit 2 `Child` cell isn't null. I'm getting exception inside `else` clause. This is what I got with my `Child` cell:![enter image description here](https://i.stack.imgur.com/Enr5m.jpg) And this is what I got with `Parent` cell: ![enter image description here](https://i.stack.imgur.com/fLNJK.png)
Object references problem
CC BY-SA 3.0
0
2011-06-07T07:37:31.400
2011-06-07T11:51:51.877
2011-06-07T11:51:51.877
532,675
532,675
[ "c#", "class", "reference", "copy" ]
6,262,140
1
6,291,347
null
2
1,893
I am using following reference to transfer files from assets folder to sd card [How to copy files from 'assets' folder to sdcard?](https://stackoverflow.com/questions/4447477/android-how-to-copy-files-in-assets-to-sdcard) The problem with this approach is that it is transferring the file located at root i.e. assets folder only and onto sdcard folder only. I have tried other options also but i am completely stuck. My folder structure is ![enter image description here](https://i.stack.imgur.com/hc8dW.jpg) I want to copy the whole default folder and copy it to /sdcard/myapp/themes/default
Completely stuck at transfering files from assets folder to sd card
CC BY-SA 3.0
0
2011-06-07T07:51:06.980
2011-06-09T14:37:21.207
2017-05-23T12:20:00.407
-1
146,192
[ "android", "android-sdcard" ]
6,262,265
1
6,427,281
null
28
18,215
I can't get my elements, for example `ListView`, to resize properly. I got a `ListActivity` for searching, with a dashboard, an editbox and a listview. The idea is to hide the actionbar while the keyboard is showing. I extended `LinearLayout`, to listen to view size changes (as recommended [here](https://stackoverflow.com/questions/3825918/way-to-be-notified-when-the-software-keyboard-is-showing-hiding)) : ``` public class SizeChangingLinearLayout extends LinearLayout { //... @Override protected void onSizeChanged(int xNew, int yNew, int xOld, int yOld) { View actionbar = mainView.findViewById(R.id.actionbar); if (yNew > yOld) actionbar.setVisibility(View.VISIBLE); else if (yNew < yOld) actionbar.setVisibility(View.GONE); super.onSizeChanged(xNew, yNew, xOld, yOld); } } ``` The hiding/showing of the actionbar works as expected but there is a gap below the `ListView` of the same height as the hidden actionbar. As soon as any graphics change (e.g. writing in the editbox) the `ListView` fills the gap. A similar behavior appears in reverse, when hiding the keyboard. ![enter image description here](https://i.stack.imgur.com/yGXLK.png) [Edit] The same problem also appears in changing other layout. Changing `Visibility` of things in `onSizeChanged` shows directly, but changing sizes and margins does not show until some other user action redraws those views. Invalidation does not work from `onSizeChanged`. [/Edit] I have tried to refresh the graphics by: - `invalidate``ListView`[here](https://stackoverflow.com/questions/1017853/android-how-to-redraw-a-graphic-element)- `notifyDataSetChanged`- `forceLayout` ... and more, without success. Why is the `ListView` not resizing at first? Do I have to override `onLayout` in my extended LinearLayout? What have I missed?
How to set size and layout in onSizeChanged?
CC BY-SA 3.0
0
2011-06-07T08:02:27.503
2013-05-30T17:37:55.707
2017-05-23T12:25:51.473
-1
237,509
[ "android", "listview", "resize", "refresh" ]
6,262,427
1
6,266,481
null
7
2,278
is there an easy way to not draw this points in my lines? I don't know why this points are there because i never release my finger from screen during drawing of a line. ![enter image description here](https://i.stack.imgur.com/m8Xpn.png) I got the code from a drawing example. ``` // draw a line - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { mouseSwiped = YES; UITouch *touch = [touches anyObject]; CGPoint currentPoint = [touch locationInView:self.view]; currentPoint.y -= 0; // 20 only for 'kCGLineCapRound' UIGraphicsBeginImageContext(self.view.frame.size); //Albert Renshaw - Apps4Life [drawImage.image drawInRect:CGRectMake(0, 0, drawImage.frame.size.width, drawImage.frame.size.height)]; //originally self.frame.size.width, self.frame.size.height)]; CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound); //kCGLineCapSquare, kCGLineCapButt, kCGLineCapRound CGContextSetLineWidth(UIGraphicsGetCurrentContext(), brushSize); // for size CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), r, g, b, alpha); //values for R, G, B, and Alpha CGContextBeginPath(UIGraphicsGetCurrentContext()); CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y); CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), currentPoint.x, currentPoint.y); CGContextStrokePath(UIGraphicsGetCurrentContext()); drawImage.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); lastPoint = currentPoint; mouseMoved++; if (mouseMoved == 10) { mouseMoved = 0; } } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { //Draw a dot if(!mouseSwiped) { UIGraphicsBeginImageContext(self.view.frame.size); [drawImage.image drawInRect:CGRectMake(0, 0, drawImage.frame.size.width, drawImage.frame.size.height)]; //originally self.frame.size.width, self.frame.size.height)]; CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound); //kCGLineCapSquare, kCGLineCapButt, kCGLineCapRound CGContextSetLineWidth(UIGraphicsGetCurrentContext(), brushSize); CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), r, g, b, alpha); CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y); CGContextAddLineToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y); CGContextStrokePath(UIGraphicsGetCurrentContext()); CGContextFlush(UIGraphicsGetCurrentContext()); drawImage.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); } } ``` This is the final version with unique alpha, color, brushSize for every line: ``` - (void) updateDrawingBoard { UIGraphicsBeginImageContext(self.drawImage.bounds.size); for ( NSDictionary *dict in paths ) { UIBezierPath *p = (UIBezierPath*)[dict objectForKey:@"path"]; p.lineWidth = [[dict objectForKey:@"size"]floatValue]; [[UIColor colorWithRed:[[dict objectForKey:@"red"]floatValue] green:[[dict objectForKey:@"green"]floatValue] blue:[[dict objectForKey:@"blue"]floatValue] alpha:[[dict objectForKey:@"alpha"]floatValue]] setStroke]; [p stroke]; } [[UIColor colorWithRed:r green:g blue:b alpha:alpha] setStroke]; [path stroke]; self.drawImage.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); } - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { CGPoint touchPoint = [[touches anyObject] locationInView:self.drawImage]; path = [[UIBezierPath bezierPath] retain]; path.lineCapStyle = kCGLineCapRound; path.lineJoinStyle = kCGLineJoinBevel; path.lineWidth = brushSize; [path moveToPoint:touchPoint]; [self updateDrawingBoard]; } - (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { CGPoint touchPoint = [[touches anyObject] locationInView:self.drawImage]; [path addLineToPoint:touchPoint]; NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: path,@"path", [NSNumber numberWithFloat:r], @"red", [NSNumber numberWithFloat:g], @"green", [NSNumber numberWithFloat:b], @"blue", [NSNumber numberWithFloat:alpha], @"alpha", [NSNumber numberWithFloat:brushSize], @"size", nil]; [paths addObject:dict]; [path release]; path = nil; [self updateDrawingBoard]; } - (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { CGPoint touchPoint = [[touches anyObject] locationInView:self.drawImage]; [path addLineToPoint:touchPoint]; [self updateDrawingBoard]; } ```
How to get rid of this "points" between my lines when I am drawing?
CC BY-SA 3.0
0
2011-06-07T08:20:01.850
2011-12-19T08:50:39.167
2011-06-10T09:16:01.290
356,538
356,538
[ "iphone", "xcode", "cgcontext", "uitouch" ]
6,262,463
1
6,269,525
null
4
3,311
I'm working on Map application that needs to work like original MapView on iOS. I need to rotate mapview according to compass heading value. I tried [MTLocation](https://github.com/darkseed/MTLocation) example also I also tried [this answer](https://stackoverflow.com/questions/2352515/rotating-only-the-mapviews-content/2426509#2426509) But my results is not good. Please see the screen shot. ![enter image description here](https://i.stack.imgur.com/8cw2R.png) When I rotate mapview according to heading value Map is rotating but as you can see on screen tiles is missing. How can I solve this display problem ? Regards - Fatih
Rotating MapView according to compass
CC BY-SA 3.0
0
2011-06-07T08:23:18.733
2012-08-15T05:48:06.870
2017-05-23T12:24:28.467
-1
88,032
[ "cocoa-touch", "ios4", "mkmapview" ]
6,262,660
1
null
null
0
178
I want to develop a program like below image. When you are in a voice call, if you start myApplication, then your voice first go to my program and encrypt with my code then send it over voice, and other side voice decrypt in my application and play in speaker. ![](https://i.stack.imgur.com/w2GTt.jpg) my friend said I can not do this and I should use voip or data channel.
encrypt decrypt voice
CC BY-SA 3.0
null
2011-06-07T08:40:04.933
2014-09-03T20:49:19.253
2014-09-03T20:49:19.253
881,229
null
[ "phone-call" ]
6,263,138
1
6,263,195
null
3
889
How could I implement a custom delete operation in a `ASP.NET Dynamic Data Project`? I found this [post](https://stackoverflow.com/questions/2341920/understanding-the-delete-link-in-asp-net-dynamic-data-scaffolds) but nothing helped. Here's the block of code for the `delete command`: ![enter image description here](https://i.stack.imgur.com/vN8iL.png) If I implemented the `GridView1_RowCommand` event I can catch it on the debugger, but where does the actual `Delete` command code stored, and if I changed the commandName to `newDelete` how to implement a custom delete query?
Custom delete in ASP.NET Dynamic Data scaffolds
CC BY-SA 3.0
null
2011-06-07T09:21:36.693
2015-08-02T19:47:39.087
2017-05-23T12:21:49.427
-1
480,107
[ "c#", "asp.net", "linq", "gridview" ]
6,263,428
1
6,263,876
null
3
1,227
A bit like this from WordPress: ![Wordpress diff](https://i.stack.imgur.com/R3cHm.png) Or this from MediaWiki: ![Wikipedia diff](https://i.stack.imgur.com/EhXKI.png) I have tried several diff engines in PHP, the most comprehensive seem to be ([http://www.raymondhill.net/finediff/viewdiff-ex.php](http://www.raymondhill.net/finediff/viewdiff-ex.php)) and PEAR's Text_Diff, but I can't seem to find any option to have both versions stacked side by side like in the above images. I think that is easier to read than having both version in one.
How to do a wiki / wordpress style compare / diff in PHP?
CC BY-SA 3.0
0
2011-06-07T09:45:03.570
2012-04-02T13:51:09.950
null
null
196,290
[ "php", "diff" ]
6,263,681
1
6,263,794
null
1
225
I want this type of layout how i can do this ![enter image description here](https://i.stack.imgur.com/MXJxs.jpg) all the titles should be clickable please help me I used Button and TextView but it seems very dull
Set the XML file for Layout design according IPhone screen widgets
CC BY-SA 3.0
0
2011-06-07T10:07:10.857
2011-06-07T10:22:52.270
null
null
705,474
[ "android" ]
6,263,693
1
6,263,782
null
0
2,844
I have a page using ASPxGridView and to fill the GridView I use a LinqServerModeDataSource control who fetches it data through a SQL View from a MS SQL Server. So far so good but here comes the problem. I want to insert data in the database so I'm building a custom form ``` <Templates> <EditForm> Company Name: <dx:ASPxTextBox ID="CompanyName" runat="server" /> Company Mail: <dx:ASPxTextBox ID="Email" runat="server" /> <dx:ASPxGridViewTemplateReplacement ID="UpdateButton" ReplacementType="EditFormUpdateButton" runat="server" /> <dx:ASPxGridViewTemplateReplacement ID="CancelButton" ReplacementType="EditFormCancelButton" runat="server" /> </EditForm> </Templates> ``` Here is an example of the custom form ![Example](https://i.stack.imgur.com/mwZed.png) Pretty basic stuff, in this scenario the Company name goes to one table and the email to another. This is all handled by calling a Stored Procedure. Or thats the plan. Does anyone know how to do this? It feels like I've been trying it all, LinqServerModeDataSource1_Inserting, ASPxGridView1_RowInserting and so on but nooo. Here is one of the failing codes. And the devexpress documentation is even worse, but lets not go there its not a happy place. ``` protected void LinqServerModeDataSource1_Inserting(object sender, DevExpress.Data.Linq.LinqServerModeDataSourceEditEventArgs e) { // Some magic to insert data here ASPxGridView1.CancelEdit(); } ``` So, any advice or help is highly appreciated. Thanks!
ASPxGridView and LinqServerModeDataSource, inserting rows by stored procedure
CC BY-SA 3.0
null
2011-06-07T10:08:31.217
2011-06-07T10:29:19.023
null
null
296,568
[ "devexpress", "aspxgridview" ]
6,264,185
1
6,264,483
null
0
2,372
In my app there is a list view with following controls (imageview, textviews, image buttons) nested: ![enter image description here](https://i.stack.imgur.com/hJWXe.png.) all they are displayed except the "Buy" image button ![enter image description here](https://i.stack.imgur.com/jvKMc.png) How to show the "Buy" image button in the list view? I also could not write an action for play and detail image buttons in the list view. Please help me. my xml is as follows: ``` <?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="fill_parent" android:background="#ffffff"> <ListView android:id="@+id/list" android:layout_width="1px" android:layout_height="1px" android:layout_weight="1"> </ListView> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:id="@+id/img" android:layout_width="60dp" android:layout_height="60dp" /> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:text="fffff" android:id="@+id/title" android:singleLine="false" android:layout_marginRight="20dp" android:layout_marginLeft="20dp" android:layout_height="wrap_content" android:textStyle="bold" /> <TextView android:layout_width="wrap_content" android:text="dskbdskkdsvsvsvvvfff" android:layout_height="wrap_content" android:layout_marginRight="20dp" android:layout_marginLeft="20dp" android:id="@+id/title2"/> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_marginLeft="50dp" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageButton android:background="@drawable/play_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageButton1"> </ImageButton> <ImageButton android:background="@drawable/details_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="25dp" android:id="@+id/imageButton2"> </ImageButton> </LinearLayout> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left"> <ImageButton android:background="@drawable/buy_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageButton3"> </ImageButton> </LinearLayout> </LinearLayout> ```
image button is not displayed in linear layout
CC BY-SA 3.0
null
2011-06-07T10:57:48.913
2015-12-25T13:30:44.307
2015-12-25T13:30:44.307
999,355
694,240
[ "android", "android-layout" ]
6,264,811
1
6,265,087
null
1
212
I would know what this symbol should mean ? ![enter image description here](https://i.stack.imgur.com/QFRXm.jpg)
Strange symbol in Xcode4 navigator
CC BY-SA 3.0
null
2011-06-07T11:56:34.690
2013-12-27T15:02:54.277
2013-12-27T15:02:54.277
759,866
553,488
[ "iphone", "xcode", "ios", "svn", "ide" ]
6,265,426
1
null
null
1
168
Problem: Given a grid and elements with height 1 and width 2, 3 or 4, determine if a new element with given width (w) and position ((x1,y), (x2,y)) can be allocated so that the grid has (and will have) as less empty cells as possible between existing and future elements. Constaints: - - - - Example of grid: ![Example](https://i.stack.imgur.com/UiowH.png) The tricky part is that I don't know what elements will be allocated, I can only predict how the grid will be filled based on the probability logic defined above. I'm looking for an algorithm to solve this problem, any tips appreciated. Thanks a lot!
How to optimise grid allocation according to some constraints
CC BY-SA 3.0
null
2011-06-07T12:51:51.020
2011-06-07T13:19:37.813
null
null
231,226
[ "optimization", "grid" ]
6,265,424
1
6,565,188
null
0
1,657
using [this](http://www.rumexit.co.uk/2010/11/how-to-customise-the-tab-bar-uitabbar-in-an-iphone-application-part-2-of-2/#comment-539) tutorial I set up a custom TabBar. Unfortunately the tutorial won't describe how to hide the custom TabBar in views you don't wanna display it. In my `customTabBar.h` I defined ``` - (void) hideAlsoCustomTabBar; - (void) showCustomTabBarAgain; ``` which are implemented as ``` - (void) hideAlsoCustomTabBar { btn1.hidden = YES; btn2.hidden = YES; btn3.hidden = YES; btn4.hidden = YES; } - (void) showCustomTabBarAgain { btn1.hidden = NO; btn2.hidden = NO; btn3.hidden = NO; btn4.hidden = NO; } ``` Calling those inside `CustomTabBar.m`'s `viewDidAppear` works fine and does exactly what I expect them to do. If I try to call those methods from the ViewController where I need to hide the TabBar like this ``` [customTabs hideAlsoCustomTabBar]; ``` inside the `initWithNibName` OR `viewDidLoad` OR `viewWillAppear`, nothing will happen. I checked with NSLog, the method gets called, but when I read out the BOOL for any buttons `.hidden` attribute, it returns 0, when it should be 1 (for `hidden==YES`). I don't know what's wrong with my setup. Is it possible these button's attributes are private by default as `CustomTabBar` inherits from `UITabBarController` and I can't set them? Or did I make a mistake in the call? Thanks! The TabBar implementation as it is described in the tutorial ``` import "CustomTabBar.h" @implementation CustomTabBar @synthesize btn1,btn2,btn3,btn4; - (void) viewDidAppear:(BOOL)animated { [super viewWillAppear:animated]; [self hideExistingTabBar]; [self addCustomElements]; } - (void) hideExistingTabBar { for (UIView *view in self.view.subviews) { if ([view isKindOfClass:[UITabBar class]]) { view.hidden = YES; break; } } } - (void) addCustomElements { //Initialise the two images for btnEinleitung, not selected and selected UIImage *btnImage = [UIImage imageNamed:@"btnEinl.png"]; UIImage *btnImageSelected = [UIImage imageNamed:@"btnEinl_s.png"]; self.btnEinleitung = [UIButton buttonWithType:UIButtonTypeCustom]; btnEinleitung.frame = CGRectMake(0, 430, 86, 50); [btnEinleitung setBackgroundImage:btnImage forState:UIControlStateNormal]; [btnEinleitung setBackgroundImage:btnImageSelected forState:UIControlStateSelected]; [btnEinleitung setTag:0]; [btnEinleitung setSelected:true]; //set other buttons btnImage = [UIImage imageNamed:@"btnUbg.png"]; btnImageSelected = [UIImage imageNamed:@"btnUbg_s.png"]; self.btnUebungen = [UIButton buttonWithType:UIButtonTypeCustom]; btnUebungen.frame = CGRectMake(86, 430, 80, 50); [btnUebungen setBackgroundImage:btnImage forState:UIControlStateNormal]; [btnUebungen setBackgroundImage:btnImageSelected forState:UIControlStateSelected]; [btnUebungen setTag:1]; /* do the same for btn3 and btn4*/ //add custom buttons to view [self.view addSubview:btn1]; [self.view addSubview:btn2]; [self.view addSubview:btn3]; [self.view addSubview:btn4]; //setup event handlers so the buttonClicked method will respond to the touch up inside event [btn1 addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside]; [btn2 addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside]; [btn3 addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside]; [btn4 addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside]; } //set tab to active according to the passed tag number - (void) selectTab:(int)tabID { switch (tabID) { case 0: [btnEinleitung setSelected:TRUE]; [btnUebungen setSelected:FALSE]; [btnTipps setSelected:FALSE]; [btnBrauchtum setSelected:FALSE]; btnEinleitung.userInteractionEnabled = NO; btnUebungen.userInteractionEnabled = YES; btnTipps.userInteractionEnabled = YES; btnBrauchtum.userInteractionEnabled = YES; break; case 1: [btnEinleitung setSelected:FALSE]; [btnUebungen setSelected:TRUE]; [btnTipps setSelected:FALSE]; [btnBrauchtum setSelected:FALSE]; btnEinleitung.userInteractionEnabled = YES; btnUebungen.userInteractionEnabled = NO; btnTipps.userInteractionEnabled = YES; btnBrauchtum.userInteractionEnabled = YES; break; // and so on for 2 and 3 } self.selectedIndex = tabID; } //get the tag of the sender/pressed button, call the function selectTab - (void) buttonClicked:(id)sender { int tagNum = [sender tag]; [self selectTab:tagNum]; } ``` As described below, I have 4 Tabs in a Tabbar which was generated with IB, added Navigation Controller with their ViewControllers, made Outlets for those and connected them in IB. Clicking on the second Tab (e.g. sndMenuVC) opens a view with 4 buttons. Clicking one of these buttons leads to another view (e.g. detailVC) in which I don't want the TabBar to be displayed. detailVC has it's own nib. Opening detailVC happens with the button's action declared like this ``` - (IBAction) openFourth:(id)sender{ detailVC *detailView = [[detailVC alloc] initWithNibName:@"detailVC" bundle:nil andSender:kFourthButtonSender]; [self.navigationController pushViewController:detailView animated:YES]; [detailView release]; } ``` As this is a custom initWithNibName, this is how I implemented it ``` - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil andSender: (NSString *)calledByButton{ self.callingButton = calledByButton; [super initWithNibName:@"detailVC" bundle:nil]; return self; } ``` SO I basically just set a global variable "callingButton" according to the transmitted sender and call the "normal" initWithNibName afterwards. This all works fine. If I try to call `hideAlsoCustomTabBar`, and NSLog the value of btn1.hidden it returns 0 when called from detailVC, but returns 1 when called from within CustomTabBar and actually hides the buttons. I have customTabs as IBOutlet if needed, but don't know if this is connected correctly to the TabBarController of type CustomTabBar. ![IB Setup](https://i.stack.imgur.com/vJgJZ.png) Hope this helps to understand me :) If you need any other information, just let me know. Thanks!
Buttons won't hide in custom TabBar
CC BY-SA 3.0
null
2011-06-07T12:51:48.347
2011-07-03T19:52:10.193
2011-06-08T10:59:45.627
644,987
644,987
[ "iphone", "objective-c", "uibutton", "uitabbarcontroller", "hide" ]
6,265,905
1
null
null
0
1,926
I am facing a wiered problem in Flex. I Have a canvas with a HBox and Label. Please find the code below. ``` <mx:VBox verticalAlign="top" horizontalAlign="center" fontSize="12" fontWeight="normal" verticalGap="0"> <mx:Label text="Cover" /> <mx:Canvas width="120" styleName="pbcontainer"> <mx:HBox id="pb" height="35" /> <mx:Label id="dashboard_cover" fontWeight="normal" fontSize="20" horizontalCenter="0" verticalCenter="0"/> </mx:Canvas> </mx:VBox> .pbcontainer { cornerRadius: 15; backgroundColor: #FFFFFF; borderStyle: solid; borderThickness: 2; borderColor: #000000; } ``` I am trying to implement a `ProgressBar` here. Now, the problem is if the `percentWidth` of `pb` is less than 5, the `haloBlue` color is spilling out which is not desired. Please find the image below. Can anyone help me in solving this issue. ![enter image description here](https://i.stack.imgur.com/HhJgr.png) ![enter image description here](https://i.stack.imgur.com/P9dzo.png) Thanks, Anji
Flex HBox with background color and rounded corner, wiered problem
CC BY-SA 3.0
null
2011-06-07T13:28:23.463
2011-06-09T15:09:37.757
null
null
434,790
[ "apache-flex", "progress-bar", "rounded-corners", "hbox" ]
6,265,995
1
6,406,135
null
21
9,416
I hope many of you would have heard about [Flipboard](http://flipboard.com/). One of the most amazing things about this iPad app is the way it lays out the content which changes dynamically based on orientation of iPad & based on the streaming content. ![enter image description here](https://i.stack.imgur.com/LKDCf.jpg) So given a set of articles what algorithms would one use to have the best layout. The definition of best could be - most efficient layout (as in circuit design) or the most aesthetically looking layout. Anybody know of any such algorithms? or the basic approach to such problems? Does this fall under "computational geometry" ?
Flipboard’s layout algorithm
CC BY-SA 3.0
0
2011-06-07T13:34:59.813
2012-12-17T16:59:22.567
2012-08-30T20:02:54.403
50,776
147,019
[ "algorithm", "ipad", "layout", "flipboard" ]
6,266,327
1
6,266,451
null
1
244
I am developing a BlackBerry application that should work on OS 4.5+. I have implemented my own loading progress screen. On 6.0 device it works as it is supposed to do. ![enter image description here](https://i.stack.imgur.com/EUxCv.png) But on 4.5 device it shows up with garbage collector loading hourglass. ![enter image description here](https://i.stack.imgur.com/KAHBC.png) Is there a way to remove or hide this hourglass.Thanks.
BlackBerry remove hourglass icon of garbage collection
CC BY-SA 3.0
null
2011-06-07T13:57:37.877
2011-06-07T14:07:22.410
2011-06-07T14:05:57.960
75,204
697,270
[ "blackberry", "java-me" ]
6,266,671
1
6,266,739
null
0
605
I'm trying to show a simple tab-menu on a web page. I'm using a pretty basic and well-used pattern, which is working fine except that when I test the page in Chrome (well, Chromium but afaik it's the same) I see a 1-pixel wide artifact that I can't seem to mask. Here's the test code: ``` <!DOCTYPE html> <html> <head> <title>One pixel menu bug</title> <style> body { font-family: sans-serif; margin: 0; } h1 {margin-bottom: 1em} #menu { padding-top: .3em; padding-bottom: 0; z-index: 1; background: black; font-size: 1em; margin-top: 0.5em; } #menu ul { list-style: none; border: 0 none; padding: 0; margin-left: 2em; border-bottom: 1px solid black; } #menu li { display: inline; margin-right: .15em; background-color: white; } #menu li a { text-decoration: none; color: #99a; padding: 0px 12px; } #menu a.selected { font-weight: bold; color: black; border-bottom: 2px solid white; } </style> </head> <body> <h1>Site title here</h1> <div id="header"> <div id="menu"> <ul> <li><a href="#">Are we not men?</a></li> <li><a href="#" class="selected">We are Devo</a></li> </ul> </div> </div> <p>Lorem ipsum</p> </body> </html> ``` and the result I see with Chrome (left) and Firefox (right): ![enter image description here](https://i.stack.imgur.com/LJcQZ.png) Removing the font-family line of the style declaration makes the problem disappear, but I don't want to do that for the main site. Explanations as to what's going on, or suggestions for work-arounds welcome!
Font-family causes one pixel drawing problem in Chrome
CC BY-SA 3.0
null
2011-06-07T14:22:29.867
2011-06-07T14:28:20.487
2020-06-20T09:12:55.060
-1
6,716
[ "html", "css", "chromium" ]
6,267,008
1
6,267,559
null
7
10,820
I have a 2D numpy array that I want to plot in a colorbar. I am having trouble changing the axis so that they display my dataset. The vertical axis goes 'down' from 0 to 100, whereas I want it to go 'up' from 0.0 to 0.1. So I need to do two things: - - Here is an example of what my colorbar plot currently looks like: ![Example of Colorbar plot](https://i.stack.imgur.com/3YQvl.png) And here is the code: ``` data = np.load('scorr.npy') (x,y) = np.unravel_index(data.argmax(), data.shape) max=data[x][y] fig = plt.figure() ax = fig.add_subplot(111) cax = ax.imshow(data, interpolation='nearest') cbar = fig.colorbar(cax, ticks=[-max, 0, max]) cbar.ax.set_yticklabels([str(-max), '0', str(max)]) plt.show() ``` Does anybody have any suggestions? Thanks in advance!
Modifying axes on matplotlib colorbar plot of 2D array
CC BY-SA 3.0
0
2011-06-07T14:44:08.820
2011-06-07T15:23:12.767
null
null
773,761
[ "python", "numpy", "matplotlib", "colorbar" ]
6,267,728
1
6,267,944
null
0
2,433
I have a subreport, and in the Group Footer, I have string, that I am trying to change the background color using the following code. If WorkID IS equal to the Technical.workId or the Development.WorkId, then the color code works, but the other items are solid black. ![Example 1](https://i.stack.imgur.com/vPSxQ.png) If If WorkID IS NOT equal to or null to the Technical.workId or the Development.WorkId, the my report is blank. ![Example 2](https://i.stack.imgur.com/nztn4.png) ``` if {?Pm-DB.ID}={Work.Num} and {Work.WorkID}<>{Technical.workId} and {Work.WorkID}<>{Development.WorkId} Then crNoColor else if ( {?Pm-DB.ID}={Work.Num} and {Work.WorkID}={Development.WorkId} and {Development.PlanName}={Project.ProjectName} and {Development.devStatus} = "R" ) then crRed else if ( {?Pm-DB.ID}={Work.Num} and {Work.WorkID}={Development.WorkId} and {Development.PlanName}={Project.ProjectName} and {Development.devStatus} = "A" ) then crYellow else if ( {?Pm-DB.ID}={Work.Num} and {Work.WorkID}={Tech.workId} and ({Resource.Team Name}like "Tech*") and {Technical.TechStatus} = "R" ) then crRed else if ( {?Pm-DB.ID}={Work.Num} and {Work.WorkID}={Tech.workId} and ({Resource.Team Name}like "Tech*") and {Technical.TechStatus} = "A" ) then crYellow else if ( {?Pm-DB.ID}={Work.Num} and {Work.WorkID}={Tech.workId} and ({Resource.Team Name}like "QA*") and {Technical.TechStatus} = "R" ) then crRed else if ( {?Pm-DB.ID}={Work.Num} and {Work.WorkID}={Tech.workId} and ({Resource.Team Name}like "QA*") and {Technical.TechStatus} = "A" ) then crYellow ```
Crystal Reports 2008 - Changing background color
CC BY-SA 3.0
null
2011-06-07T15:34:02.917
2012-07-05T03:20:20.093
null
null
538,029
[ "crystal-reports", "crystal-reports-2008" ]
6,267,925
1
6,268,129
null
1
4,888
I want to combine the jQuery UI Datepicker to display both a range, and display this inline. It has functionality for both, but I am unable to combine them. It simply shows the range in BOTH divs so it is not working as expected. Here is the code: JS: ``` <script type="text/javascript"> $(function(){ var dates = $(" #to, #from" ).datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 2, onSelect: function( selectedDate ) { var option = this.id == "from" ? "minDate" : "maxDate", instance = $( this ).data( "datepicker" ), date = $.datepicker.parseDate( instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings ); dates.not( this ).datepicker( "option", option, date ); } }); }); </script> ``` HTML: ``` <div id="from"></div> <div id="to"></div> ``` Result: ![enter image description here](https://i.stack.imgur.com/GGEAv.png) As you can see, there are 4 calendars and they work individually, instead of being just two months that work together.
jQuery Datepicker: both RANGE and INLINE
CC BY-SA 3.0
null
2011-06-07T15:47:29.230
2011-07-06T04:32:36.663
null
null
null
[ "jquery", "jquery-ui", "uidatepicker" ]
6,268,037
1
6,268,164
null
0
234
I have a UITableView with a top navigation bar. The data for the comes from an array which contains more than 20 objects. Everything is fine so far. However sometimes when i do repeated scrolling (fast), I find last row being repeated, sometimes gets cut into half, overwritten. I am new to iPhone development and have no clue why this happens. ``` - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return [appDelegate.preList count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell... Item *i=[appDelegate.preList objectAtIndex:indexPath.row]; cell.textLabel.text=i.iName; cell.accessoryType=UITableViewCellAccessoryNone; return cell; } ``` I have attached a screenshot of my problem as well. Notice how the navigation bar and the last cell are. ![screenshot](https://i.stack.imgur.com/Nq1B3.png) Help would be greatly appreciated
UITableview strange behaviour
CC BY-SA 3.0
null
2011-06-07T15:54:01.730
2011-06-07T17:29:21.070
null
null
387,848
[ "iphone", "objective-c", "uitableview", "uinavigationbar" ]
6,268,205
1
6,270,657
null
29
45,185
I am trying to import data from a utf-8 encoded flat file into SQL Server 2008 using SSIS. This is what the end of the row data looks like in Notepad++: ![enter image description here](https://i.stack.imgur.com/LcbWe.png) I have a couple more images showing what the file connection manager looks like: ![enter image description here](https://i.stack.imgur.com/TzCHk.png) ![enter image description here](https://i.stack.imgur.com/Dat6f.png) You can see that the data shows correctly in the file connection manager preview. When I try to import this data, no rows import. I get an error message indicating that the row delimiter was not found. You can see in the file connection manager images that the header row delimiter and the row delimiter are both set to `{LF}`. This was sufficient to generate the correct preview, so I am lost to why it did not work to import. I have tried a number of things that have brought zero results: - - - > [Flat File Source [582]] Warning: The end of the data file was reached while reading header rows. Make sure the header row delimiter and the number of header rows to skip are correct. Thanks for looking at this and I really appreciate any help you can offer.
Why doesn't SSIS recognize line feed {LF} row delimiter while importing UTF-8 flat file?
CC BY-SA 3.0
0
2011-06-07T16:04:40.967
2016-10-23T08:58:08.817
2012-04-28T16:34:52.367
null
16,771
[ "sql-server", "sql-server-2008", "utf-8", "ssis", "flat-file" ]
6,268,222
1
6,268,392
null
1
151
We have the following structure in our Subversion repo: ![SVN Branch Example](https://i.stack.imgur.com/BLrJA.jpg) Here is a quick summary: 1. We started from the trunk and created branch 1. 2. We then created branch 2 from branch 1. 3. We then created 2 more branches off of branch 2. So currently we have 4 branches nested off of the trunk. However, will doing this cause some sort of tree conflict on the b2a and b2b branches that were originally branched off of branch 2? What is the preferred approach to accomplishing this?
Subversion Branching Question with Multiple Branches
CC BY-SA 3.0
0
2011-06-07T16:05:55.227
2011-06-07T16:18:57.687
null
null
3,256
[ "svn", "version-control", "branching-and-merging" ]
6,268,451
1
6,274,438
null
0
3,029
2 hierarchical dimensions (for location and time) are defined on a cube. My question is about possibility of writing a single MDX query for retrieving following structure. I mean writing a single query for obtaining values V1, V2, V3 and V4: ![enter image description here](https://i.stack.imgur.com/wRIbs.jpg) The obvious way is to use multiple MDX queries. Just wondering if there is some magic syntax in MDX.
MDX on multiple hierarchical dimensions
CC BY-SA 3.0
null
2011-06-07T16:23:57.357
2011-06-08T05:08:27.990
2011-06-08T04:40:00.200
651,647
651,647
[ "ssas", "mdx", "olap" ]
6,268,667
1
6,268,767
null
3
19,524
I'm learning CSS and finding that it's not always so intuitive (welcome to webdev, I guess). :) In an attempt to make a simple, static progress bar, I use the HTML file below: ``` <html> <head></head> <body> <table border='1' cellspacing='0'> <tr> <td>Sample Cell</td> <td> <!-- This is meant to be a progress bar --> <div style="background-color: #0a0; width: 20%;"> <div style="text-align: center; width: 300px;"> Text Here! </div> </div> </td> </tr> </table> </body> </html> ``` and I get this: ![Progress Bar](https://i.stack.imgur.com/ci8kY.png) which is good, except for the fact that the width of the second column is fixed. But if I go ahead and change `width: 300px` to `width: 100%`, the text instead goes into the green box, rather than the whole table cell. How can I "fill" the table cell with the text, without imposing a specific length restriction?
Why div 100% width doesn't work as expected
CC BY-SA 4.0
null
2011-06-07T16:43:54.403
2019-01-24T09:53:37.673
2019-01-24T09:53:37.673
4,370,109
541,686
[ "html", "css", "html-table" ]
6,268,855
1
6,269,154
null
0
235
I wrote a program to make a graphical Timeline and it works through some VBA and Java through the shell, but after transfering it over to Windows 7 from Vista I cannot seem to find a place to save the files so that the java program can access them. Please Help me. Update Now whenever I try to shell the java program I get a file not found exception runtime error 53 and it's on the shell call ![Error that appears after calling java out of batch out of vba out of excel](https://i.stack.imgur.com/lqnxl.png) Error that appears after calling java out of batch out of vba out of excel Some reason it won't let me do this.
Permissions in Windows 7 java unrecognizable in batch
CC BY-SA 3.0
null
2011-06-07T16:57:27.000
2011-06-07T17:24:24.443
2011-06-07T17:24:24.443
783,280
783,280
[ "java", "vba", "windows-7", "batch-file", "excel" ]
6,268,956
1
6,269,070
null
2
2,796
As part of the calculations to generate a [Pearson Correlation Coefficient](http://devlicio.us/blogs/billy_mccafferty/archive/2006/11/07/netflix-memoirs-using-the-pearson-correlation-coefficient.aspx), the following computation is performed: ![enter image description here](https://i.stack.imgur.com/Uia5n.jpg) In the second formula: `p_a,i` is the predicted rating user a would give item `i`, `n` is the number of similar users being compared to, and `ru,i` is the rating of item `i` by user `u`. What value will be used if user `u` has not rated this item? Did I misunderstand anything here?
Understanding the Pearson Correlation Coefficient
CC BY-SA 3.0
0
2011-06-07T17:05:29.287
2012-10-24T19:53:16.960
2011-06-07T17:48:01.070
693,416
691,223
[ "recommendation-engine" ]
6,269,166
1
null
null
1
1,206
In JPanel I have few JLabels created like this: ``` ... Random rand = new Random(); Color col = new Color(rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), rand.nextFloat()); Color playColor= new Color(col.getRed(), col.getGreen(), col.getBlue(), col.getAlpha()); sqr.setOpaque(true); sqr.setBackground(playColor); sqr.setLayout(null); ... ``` When I click on any JLabel (mouseClicked(MouseEvent e)) I can get information about it in JOptionPane. In the same JOptionPane I have checkBox to mark selected label (check-> setBorder(BorderFactory.createLineBorder(Color.red)), uncheck -> setBorder(null). When I check and then uncheck jLabel, somethink like this is happened: ![enter image description here](https://i.stack.imgur.com/8SQZv.png) How to rid of these checkBoxes from labels? edit: checkBoxes on labels are only pictures, not real checkBoxes. Maybe this picture will help: ![enter image description here](https://i.stack.imgur.com/MBw0J.png) This square with red border is now check by chechBox Mark on JOptionPane. And this one on left (with checkBox picture on it) was checked earlier. I don't know how explain this, it just happens after I click on checkBox Mark on JOptionPane. After click I set red border or set border null on label, nothing more.
JLabel opaque and alpha
CC BY-SA 3.0
null
2011-06-07T17:24:46.153
2011-06-07T19:09:09.680
2011-06-07T19:09:09.680
759,187
759,187
[ "java", "swing", "jlabel" ]
6,269,335
1
6,932,352
null
1
324
I have setup a Facebook dev test-user for a Facebook app. When i post to the wall as the test user, I get: ``` The remote server returned an error: (500) Internal Server Error. ``` The strange thing, the post is successfull, and i cant duplicate this on a "real" account (like my personal account). It only happens with the test user from what i can reproduce. Another oddity, as you can see from the picture below, when looking at the Wall, it repeats my posts forever, yet if I do a Get("/me/feed"), it returns the correct number of posts and no repeats. Is this just a case of the FB test-user being flakey? ![enter image description here](https://i.stack.imgur.com/VKlUQ.png)
Error when using test user in Facebook C# SDK
CC BY-SA 3.0
null
2011-06-07T17:36:22.987
2011-08-03T19:47:08.617
null
null
52,051
[ "facebook-c#-sdk" ]
6,269,393
1
6,277,548
null
2
2,237
I am trying to populate a WPF datagrid but it's only showing the column headers and the content cells of the first(!) column. All other cells are empty: ![enter image description here](https://i.stack.imgur.com/F1Dmc.png) The DataGrid is defined like this: ``` <DataGrid ItemsSource="{Binding Classifications, Mode=OneWay}" AutoGenerateColumns="True" HeadersVisibility="Column" /> ``` Classifications is defined in the code-behind file like this: ``` public DataView Classifications { get { return ClassificationDataTable.GetTable(myData).DefaultView } } ``` and finally this is my data generator: ``` public static class ClassificationDataTable { public static DataTable GetTable(List<Classification> classifications) { DataTable table = new DataTable(); // build columns table.Columns.Add("FruitPrototype", typeof (string)); foreach (var featureComparison in classifications[0].FeatureComparisons) table.Columns.Add(featureComparison.FeatureName, typeof (double)); // add rows foreach (var classification in classifications) { object[] values = new object[classification.FeatureComparisons.Count+1]; values[0] = classification.FruitPrototype.FruitType; for (int i = 0; i < classification.FeatureComparisons.Count; i++) values[i + 1] = classification.FeatureComparisons[i].NormalizedDistance; table.Rows.Add(values); } return table; } } ``` I verified the binding and can confirm that the DefaultView of the DataTable is indeed bound to the ItemsSource of my DataGrid. Also, the double values that should be shown in the grid are != 0. What am I missing here?
WPF DataGrid showing empty double cells but correct column headers
CC BY-SA 3.0
0
2011-06-07T17:41:19.633
2011-06-08T10:48:54.300
null
null
254,227
[ "wpf", "data-binding", "datagrid", "datatable" ]
6,269,474
1
6,269,704
null
5
12,307
I am trying to simply play an HTML5 video which will be compatible with all common browsers (including mobile devices). For now, I am testing with one custom video and a sample video. ``` <video width="680" height="383" controls> <source src="immunize-video-1/immunize_web_h.264.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> <source src="immunize-video-1/immunize_web_h.264.ogv" type='video/ogg; codecs="theora, vorbis"'> [FLASH FALLBACK HERE] </video> <video width="680" height="383" controls> <source src="big-buck-bunny/big_buck_bunny.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> <source src="big-buck-bunny/big_buck_bunny.ogv" type='video/ogg; codecs="theora, vorbis"'> [FLASH FALLBACK HERE] </video> ``` The results on a staging server: - - [screenshot](http://screencast.com/t/I142tezDph9U)- ![enter image description here](https://i.stack.imgur.com/4BBaO.jpg) What could cause this to work on desktop Safari but not on the iPhone? I tried a few variations on the [video type parameters](http://wiki.whatwg.org/wiki/Video_type_parameters#Video_Codecs_3) such as: ``` <source src="immunize-video-1/immunize_web_h.264.mp4" type='video/mp4; codecs="avc1.64001E, mp4a.40.2"'> ``` Also tried leaving the codec attribute blank: ``` <source src="immunize-video-1/immunize_web_h.264.mp4" type='video/mp4'> ``` but none listed seemed to work for the iPhone. The video was exported at 3000 kb/s h.264. Also, the video causing problems is a 94MB file size.
HTML5 mp4 video working in Chrome and Desktop Safari but not iPhone
CC BY-SA 3.0
0
2011-06-07T17:48:20.593
2011-09-30T02:54:12.677
null
null
370,407
[ "html", "iphone", "html5-video" ]
6,269,808
1
6,270,211
null
3
1,547
The solution at [SSRS - How to build a simple multi-column report?](https://stackoverflow.com/questions/1015098/ssrs-how-to-build-a-simple-multi-column-report) says there is a layout tab under the report properties. Ive googled the subject to death and the same menu is referred to in multiple places. I can't find a Layout Tab or a Columns property anywhere. Have I gone round the bend? ![ReportMenu](https://i.stack.imgur.com/alXRE.png) ![NoLayoutTab](https://i.stack.imgur.com/wrn1t.png) ![NoColumnsProperty](https://i.stack.imgur.com/6h32B.png)
SSRS: Am I hallucinating?
CC BY-SA 3.0
0
2011-06-07T18:18:40.653
2014-04-02T14:39:18.947
2017-05-23T12:08:34.697
-1
344,308
[ "ssrs-2008" ]
6,269,867
1
6,863,671
null
1
4,671
I have a databound chart in ASP.NET C#. One of the databound fields is text and the other is a value. I would like the legend to display the text for the pie chart, and I would like the value to determine how the chart is formed, and also display as a label on each piece of the pie chart. Here is the code I have so far: ``` <asp:Chart ID="consignedChart" runat="server" DataSourceID="SqlDataSource4" BackColor="LightSlateGray" Palette="None" PaletteCustomColors="LightSeaGreen; SteelBlue" Width="400px" > <Series> <asp:Series Name="Series1" ChartType="Pie" XValueMember="Owner" YValueMembers="TotalValue" Legend="Legend1" > </asp:Series> </Series> <ChartAreas> <asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="true" BackColor="LightSlateGray"> <Area3DStyle Enable3D="True" LightStyle="Realistic"/> </asp:ChartArea> </ChartAreas> <Legends> <asp:Legend Name="Legend1"> </asp:Legend> </Legends> </asp:Chart> ``` Here is an image, it might make it easier to understand. The labels in the red boxes are the ones I want changed to display the value number. ![chart](https://i.stack.imgur.com/wJ7Oy.jpg)
ASP.NET Chart - Databound Value, Custom Label
CC BY-SA 3.0
null
2011-06-07T18:25:08.370
2011-07-28T18:14:06.157
2011-06-07T18:42:30.413
771,303
771,303
[ "c#", "asp.net", "charts", "databound" ]
6,269,961
1
null
null
0
79
I am using I created one application which is working fine in the IDE. Now, I want to use the generated in one of my application so I copied - - - to some other location in the file system. After that when I tried to launch the in the browser, nothing was appearing in the browser. After that I copied the whole at some other location and tried to launch the same file. Even that was also not working. I don't know what's the problem. ============================================================================![enter image description here](https://i.stack.imgur.com/BZ4IQ.png)![enter image description here](https://i.stack.imgur.com/FiYg2.png)
Problem in flex project
CC BY-SA 3.0
null
2011-06-07T18:33:21.110
2011-06-07T21:16:13.197
2011-06-07T19:23:43.320
157,027
157,027
[ "apache-flex" ]
6,269,999
1
6,373,304
null
1
2,587
Working with .RDLC 2005 in VS 2008 this technique worked very well, now in I get a blank (or no?) report. I have made a couple of changes to accommodate .RDLC 2008 and at this time I am getting no exceptions. The present (not desired) output looks like: ![enter image description here](https://i.stack.imgur.com/Pk1Jp.png) I have a custom ReportController class that has a public method to ShowReport (also one to manage the exporting of reports, but that is not (yet) in play.) From the asp.net page I invoke the controller in the property set (of Type DataSet, invoked by the page controller) like: () ``` try { using (var reportController = new ReportController(true)) { _ReportViewer = reportController.ShowReport("DemonstrationList", value, phReportHolder); if (_ReportViewer != null) { _ReportViewer.ShowRefreshButton = false; _ReportViewer.ShowPrintButton = false; _ReportViewer.Width = Unit.Pixel(700);// Unit.Percentage(99); _ReportViewer.Height = Unit.Pixel(700);// Unit.Percentage(90); } } lblRecordCount.InnerText = value.Tables[0].Rows.Count.ToString(); } catch (Exception ex) { phReportHolder.InnerHtml = string.Format("There was an error attempting to process this report <br/><br/><div style='color:White;'>{0}</div>", ex.Message); } ``` and the `ShowReport` method is: ``` public ReportViewer ShowReport(string ReportName, DataSet ds, HtmlContainerControl ReportContainer) { ReportContainer.Controls.Clear(); ReportViewer reportViewer = BuildReport(ReportName, ds); ReportContainer.Controls.Add(reportViewer); return reportViewer; } ``` This allows me to tell the controller to put any 'valid' report into any htmlcontainercontrol using any provided dataset. BuildReport takes the data and the report name and builds the report as: ``` private ReportViewer BuildReport(string ReportName, DataSet ds) { try { _activeDS = ds; string ReportFileName = ResolveRDLCName(ReportName); // ResolveRDLCName is used along with path strings // initialized from configuration settings in the // constructor to make this portable. var viewer = new ReportViewer(); viewer.ProcessingMode = ProcessingMode.Local; viewer.LocalReport.ReportPath = ReportFileName; viewer.LocalReport.DisplayName = ReportName; viewer.LocalReport.EnableHyperlinks = true; AssignReportData(ds, viewer.LocalReport); return viewer; } //...Exception handlers below are not invoked at this time ``` And 'AssignReportData' attaches the data to the report. ``` private static void AssignReportData(DataSet ds, LocalReport Report) { var listOfDatasources = Report.GetDataSourceNames(); foreach (string dsn in listOfDatasources) { ReportDataSource rds = new ReportDataSource(dsn,ds.Tables[dsn]); Report.DataSources.Add(rds); } } ```
.RDLC Report 2008 (in VS 2010) ReportViewer appears with no report or data
CC BY-SA 3.0
null
2011-06-07T18:36:38.453
2011-09-08T20:12:58.537
2011-06-08T02:54:59.497
7,116
681,009
[ "c#", "asp.net", "reporting-services", "rdlc" ]
6,270,101
1
6,285,564
null
0
197
Xcode recently started to throw an internal error from CoreFoundation when I debug an app. If I click continue it seems work. Is this ok? Is there a known workaround? (reload reboot don't seem to help) ![enter image description here](https://i.stack.imgur.com/sh0c7.png)
xcode thowing NSInvalidArgumentException internal error
CC BY-SA 3.0
null
2011-06-07T18:46:24.070
2011-06-08T21:34:41.970
null
null
291,733
[ "xcode4" ]
6,270,179
1
null
null
1
280
I am not sure if this is a bug or not in chrome or just my code; When i load this animation and do not browse away from the page (i.e. don't go to another tab or so on) the animation runs fine; But when i tab out of the page this happens: ![Chrome Bug](https://i.stack.imgur.com/rlkx1.jpg) Tested this on Firefox and it didn't seem to happen here is the process invovled to achieve the same bug: 1. load the page and wait for some animations to appear 2. Tab out of the page for about 5-6 seconds (click around or do something in another tab) 3. Go back to the tab with the animation and watch for a few seconds and you will see the bug (if it is one) Sorry about that forgot to add the link: [http://jsfiddle.net/xavi3r/7D7Nm/36/](http://jsfiddle.net/xavi3r/7D7Nm/36/) [http://jsfiddle.net/xavi3r/7D7Nm/36/show/](http://jsfiddle.net/xavi3r/7D7Nm/36/show/) Any pointers?
Chrome Bug, jQuery Fadeout when tabbing windows
CC BY-SA 3.0
null
2011-06-07T18:52:35.883
2011-08-19T11:36:56.117
2011-06-07T18:58:54.693
654,362
654,362
[ "jquery", "google-chrome" ]
6,270,489
1
6,281,122
null
6
670
i couldn't find a better title, but i would like to build a tab panel with two tabs that are always present and a undefined number of other tabs that are generated dynamically by the user. I would like to implement something similar to the app-Tabs in Firefox: The tabs added by the user should be scrollable, while the other 2 tabs should be pinned and always displayed. Here's an image: ![enter image description here](https://i.stack.imgur.com/JydlJ.png) Is this possible via ext or do I have to do it via css? Thanks for any ideas!
Pin tabs in a tab panel
CC BY-SA 3.0
null
2011-06-07T19:22:48.810
2011-12-11T23:51:09.163
2011-12-11T23:51:09.163
91,299
758,856
[ "javascript", "extjs", "extjs4" ]
6,270,901
1
6,298,856
null
2
742
I generated an ad-hoc profile which shows up the expiry date of June 25, 2079. Is this correct or a bug in the provisioning portal? ![Image showing error snapshot](https://i.stack.imgur.com/2Cjhq.jpg) Thanks
Adhoc Provisioning profile generated from provisioning portal showing expiry date of June 25, 2079
CC BY-SA 3.0
0
2011-06-07T19:58:37.380
2011-07-06T08:25:32.183
2011-06-08T13:44:50.467
377,325
377,325
[ "iphone", "provisioning-profile" ]
6,270,975
1
6,271,024
null
1
21,777
I have a div, which contains a text input field: ``` <div id="age" class="fullScreen"> <input type="text" id="age" class="textInput" placeholder="Please enter age..." /> <button type="button" onclick="submitAge()">Submit</button> </div> ``` submitAge() looks like this: ``` function submitAge() { var ageVal = document.getElementById("age").text; alert(ageVal); } ``` But in Google Chrome and Webkit Nightly I see an alert with the text "undefined" (I can't test in any other browsers because the page contains web-sockets). The chrome developer tools show this: ![ageVal: undefined](https://i.stack.imgur.com/A0oeM.png) I assume that the problem is that the input is not in a form, but I don't want it to be in a form because I will be submitting the data via websockets. Do I have to put it in a form or is there a better solution? Thanks.
Why can't I get the value of this text input field?
CC BY-SA 3.0
null
2011-06-07T20:06:28.527
2018-01-19T09:46:26.160
null
null
492,025
[ "javascript", "html", "forms", "input" ]
6,270,983
1
null
null
0
279
I want when click on edit mode , the action when select a cell be differ , I mean in normal case when select a cell it be checked (accessory of checking appear) in edit case an accessory of type button appear when click I navigate to another screen any suggestion to do that I have only selectedrowatindex , and commitedit how to implement that please like in the image if I clicked edit , the button appear and if I clicked the row (pacs for example I can edit it ) or select the normal delete button I mean how selectedrowatindex I know either I am in edit mode or not , and how to add accessory to the cell that in edit mode ![enter image description here](https://i.stack.imgur.com/vTMye.jpg)
uitableview edit mode
CC BY-SA 3.0
null
2011-06-07T20:07:19.690
2011-06-07T20:48:42.293
2011-06-07T20:42:15.883
712,104
712,104
[ "iphone", "ipad" ]
6,270,900
1
null
null
3
1,131
## Summary I am trying to make a web page that has multiple of the same SWF on it. I am having a problem with it being stupidly slow loading (download time is fine though). I have a 4x4 table in each cell there is a swf file embedded in an iframe. . My AS3 code is very simple: ``` package { import flash.display.Sprite; import flash.system.System; import flash.text.TextField; public class ActionscriptProject extends Sprite { public function ActionscriptProject() { var txt:TextField = new TextField(); txt.x=0; txt.y=0; txt.width=5000; txt.height=5000; addChild(txt); txt.htmlText+="<font size='45'>"+System.totalMemory/1048576 + " MB"+"</font>"; } } } ``` I am loading it in an iframe using this html: ``` <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Flash Testing</title> </head> <body> <table border="1"> <tr> <td> <iframe allowtransparency='true' scrolling='no' src='Flash/ActionscriptProject.html'></iframe> </td> <td> <iframe allowtransparency='true' scrolling='no' src='Flash/ActionscriptProject.html'></iframe> </td> <td> <iframe allowtransparency='true' scrolling='no' src='Flash/ActionscriptProject.html'></iframe> </td> <td> <iframe allowtransparency='true' scrolling='no' src='Flash/ActionscriptProject.html'></iframe> </td> </tr> <tr> ... </tr> <tr> ... </tr> <tr> ... </tr> </table> </body> </html> ``` Note: ActionscriptProject.html is just the standard html that Flash Builder creates with the application. But at the request of The_asMan I am including it here: ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!-- saved from url=(0014)about:internet --> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <!-- Smart developers always View Source. This application was built using Adobe Flex, an open source framework for building rich Internet applications that get delivered via the Flash Player or to desktops via Adobe AIR. Learn more about Flex at http://flex.org // --> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- Include CSS to eliminate any default margins/padding and set the height of the html element and the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as the percentage of the height of its parent container, which has to be set explicitly. Initially, don't display flashContent div so it won't show if JavaScript disabled. --> <style type="text/css" media="screen"> html, body { height:100%; } body { margin:0; padding:0; overflow:auto; text-align:center; background-color: #ffffff; } #flashContent { display:none; } </style> <!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens --> <!-- BEGIN Browser History required section --> <link rel="stylesheet" type="text/css" href="history/history.css" /> <script type="text/javascript" src="history/history.js"></script> <!-- END Browser History required section --> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript"> <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> var swfVersionStr = "10.0.0"; <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. --> var xiSwfUrlStr = "playerProductInstall.swf"; var flashvars = {}; var params = {}; params.quality = "high"; params.bgcolor = "#ffffff"; params.allowscriptaccess = "sameDomain"; params.allowfullscreen = "true"; var attributes = {}; attributes.id = "ActionscriptProject"; attributes.name = "ActionscriptProject"; attributes.align = "middle"; swfobject.embedSWF( "ActionscriptProject.swf", "flashContent", "100%", "100%", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes); <!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. --> swfobject.createCSS("#flashContent", "display:block;text-align:left;"); </script> </head> <body> <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show when JavaScript is disabled. --> <div id="flashContent"> <p> To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed. </p> <script type="text/javascript"> var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://"); document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='" + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" ); </script> </div> <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="ActionscriptProject"> <param name="movie" value="ActionscriptProject.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="ActionscriptProject.swf" width="100%" height="100%"> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <!--<![endif]--> <!--[if gte IE 6]>--> <p> Either scripts and active content are not permitted to run or Adobe Flash Player version 10.0.0 or greater is not installed. </p> <!--<![endif]--> <a href="http://www.adobe.com/go/getflashplayer"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" /> </a> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </noscript> </body> </html> ``` ## Browsers In Chrome there is no problem. All of the apps load very quickly (I would estimate within 3 seconds). In IE 8 the problem is minimal. In IE 7 and Firefox 3.6.17 the page takes a very long time to load. I have not tested in other browsers. In Firefox the page takes about 34 seconds to load. ## Debug Info (Firefox) In total `System.totalMemory` reports that the swfs us a combined memory of ~42 MB. Here is a screen shot of the Net tab in Firebug: [Full Size Image](https://i.stack.imgur.com/9qqmb.jpg) ![enter image description here](https://i.stack.imgur.com/9qqmb.jpg) ## Questions 1. Is there a good way to embed multiple identical swfs into a web page? 2. Why are IE and Firefox struggling so poorly? I suspect it has to do with the fact that both IE and Firefox each only have one thread to run plugins (Flash) in. 3. I have a similar app written in AS2 (not written by me, I just have the swf file). It is much more complex but it loads orders of magnitude faster in IE and FF. Is there a reason that AS3 pins the browser when AS2 does not? 4. How can I embed multiple AS3 swfs into FF & IE 7 without pinning the browser? 5. Is there a way to make an application that is more light weight?
Flash: Many identical SWFs on same Page
CC BY-SA 3.0
0
2011-06-07T19:58:37.027
2011-07-20T22:51:00.050
2011-06-09T19:23:27.393
251,589
251,589
[ "flash", "actionscript-3", "internet-explorer", "firefox" ]
6,270,985
1
null
null
6
7,627
I have added Addthis widget to a website. Here is the autogenerated code which I have tweaked little bit: ``` <script type="text/javascript"> var addthis_config = { "data_track_clickback": true, services_compact: 'facebook, twitter,googlebuzz, digg, stumbleupon', services_expanded: 'facebook, twitter,googlebuzz, digg, stumbleupon', ui_cobrand: "ABC Company", ui_header_color: "#ffffff", ui_header_background: "#000000" } </script> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4dde778a54a20e05"></script> <script type="text/javascript"> var addthis_share = { templates: { twitter: 'check out {{title}} : {{url}} @ABC' }, url_transforms : { clean: true } } </script> <div class="addthis_toolbox addthis_default_style "> <a class="addthis_button_compact"> <img alt="Share" src="../images/icons/share.gif" /><img alt="ABC" src="../images/icons/financial_tip.png" /> </a> </div> ``` I have added facebook, twitter, google buzz, StumbleUpon and Digg links inside the ADdthis compact and expandable widgets. When I click the Share link, following window pop ups: ![enter image description here](https://i.stack.imgur.com/Nvyi4.jpg) I dont want the Addthis footer to appear in the pop up window. I tried finding the div with jquery doc load and removing it..but it didnt help. Other thing is when I click FB, it opens my account and the following message is displayed about posting on my wall: ![enter image description here](https://i.stack.imgur.com/gKLf3.jpg) Addthis is appending some garbage at the end of the shared url: e.g after index.aspx starting from # to ;facebook ..it is appending some data that is irrelevant... how to fix it ..any idea... If I share it on twitter, the login screen to twitter ![enter image description here](https://i.stack.imgur.com/PTT5w.jpg) I dont want the Addthis message in footer..how to hide/delete it Similar to FB, when i login to my twitter account, some garbage is added to the end of the shared url: ![enter image description here](https://i.stack.imgur.com/95oOT.jpg) Moreover, whenever i click any icon inside the compact Addthis list, Fb or twitter, a small window pop ups: ![enter image description here](https://i.stack.imgur.com/PPK7b.jpg) Can anyone help me with these. THanks.
AddThis : Cutomization
CC BY-SA 3.0
0
2011-06-07T20:07:22.220
2014-05-15T22:29:56.783
null
null
757,992
[ "addthis" ]
6,271,251
1
6,271,343
null
0
743
In a nutshell, I want my JQuery UI Slider to look like this: ![3asdfsdasdf](https://i.stack.imgur.com/5rDOA.png) Is there a way to only color the left half of the slider and then adjust it's color when it slides either way? [http://denniswaltermartinez.com/jqueryslider.png](http://denniswaltermartinez.com/jqueryslider.png) image if the web hosting isn't working.
Is there a way to set a Jquery UI sliders background image to only the left half side of the slider button?
CC BY-SA 3.0
null
2011-06-07T20:30:54.500
2011-06-07T20:47:24.117
null
null
613,932
[ "jquery", "jquery-ui-slider" ]
6,271,272
1
null
null
1
181
I am trying to install on my localhost but failing miserable. I am following the below mentioned steps but don't know where am I going wrong. Please help me with the same. Steps are as follows that I followed: 1. Downloaded the ZEND Framework full package version 1.11.7 which is about 25 Mb in a zipped version and then unzipped it to a folder called ZendFrameWork. 2. Copied the ZendFramework folder inside my c:\xampp\php\ 3. changed the "include_path = '.;\xampp\php\PEAR;\.;C:\xampp\php\ZendFramework\library' " in the php.ini file. 4. Then restarted the apache server. EDIT :: I have successfully managed to get the zf command to run without any errors. but now, all it does is, after i enter "zf create myproject" it just gets stuck with the cursor blinking on the next line. And if i press CTRL+C, i get the message : Terminate batch job ? (Y/N) 1. Then set the environment variable for zf.bat file as " C:\xampp\php\ZendFramework\bin " 2. But when I try to execute the " zf create sampleProjName " from command line it does nothing, so then I used Windows Powershell and it gives the error which I have attached below. Waiting for your response. Thanks in advance. ![Error On Executing the zf command after setting it as environment variable](https://i.stack.imgur.com/Gzx0s.png)
Error with zend installation on win 7
CC BY-SA 3.0
null
2011-06-07T20:32:46.950
2011-06-08T09:23:35.957
2011-06-08T08:55:02.870
225,785
225,785
[ "zend-framework", "installation" ]
6,271,364
1
12,091,020
null
1
1,184
I'm developing a web form, and works well in Firefox 4 and 3.6, Chromium 11, Opera 11.10, and IE 8, but in Safari 5.0.5 for Windows, all `<select>`s have more width, thus breaking the layout. This is a screenshot comparing the reult with Firefox 3.6: ![enter image description here](https://i.stack.imgur.com/tSGiT.png) The weird thing is that in Safari 5.0.5 for Mac it is displayed as expected. What could be happening? It seems that the arrow is using space beyond its box. Here is the CSS: ``` select{ -moz-border-radius:5px; border-radius:5px; -moz-box-sizing:content-box; -ms-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; display:block; height:19px; margin:0; padding:1px; background:#eee; border:1px solid #a7a7a7; width:128px; } ``` By the way, Firebug Lite for Safari reports the same computed width that in other browsers.
Width of <selects> in Safari 5.0.5 for Windows
CC BY-SA 3.0
null
2011-06-07T20:40:33.133
2012-08-23T11:56:53.047
null
null
259,517
[ "css", "webforms", "safari" ]
6,271,419
1
6,271,865
null
39
21,111
Say I have a circle (an arc) on HTML5 canvas. I can just fill it like this: ``` ctx.arc(100, 100, 50, 0, 2 * Math.PI); ctx.fill(); ``` It works a treat. However, how can one fill the opposite area? Now it's white with a black circle, but I'd like it to be along the lines of the following image (on which white is the background color and black is the filling color): ![opposite area](https://i.stack.imgur.com/NXod4.png) I know I could just use a black background and paint a white circle, but the background can be anything (all kinds of things have been drawn there before, so just swapping colors is not possible). Another thing is that not the complete canvas should be filled, but rather a square with an circle canceled out. I was thinking of a [globalCompositeOperation](https://developer.mozilla.org/samples/canvas-tutorial/6_1_canvas_composite.html) but it does not seem to fit my needs as none of them act according to what I need. So, how can I accomplish filling the 'opposite' area like in the example image?
How to fill the 'opposite' shape on canvas?
CC BY-SA 3.0
0
2011-06-07T20:46:26.957
2017-12-19T14:32:07.060
2011-09-30T11:07:30.543
514,749
514,749
[ "html5-canvas" ]
6,271,453
1
6,271,541
null
1
2,510
I can't register Mysql JDBC driver in my desktop APP I download mysql-connector-java-5.1.16.zip Unzip and put it into folder in my app Add this jar file into Build Path in Eclipse But Class.forName("com.mysql.jdbc.Driver") throws ClassNotFoundException Whats wrong? ![enter image description here](https://i.stack.imgur.com/3hD3B.jpg)
Mysql JDBC driver ClassNotFoundException
CC BY-SA 3.0
null
2011-06-07T20:49:12.603
2011-06-07T21:12:41.657
null
null
771,453
[ "java", "mysql" ]
6,271,468
1
6,271,740
null
4
1,237
I'm working with the the jQuery Mobile and according to the [documentation](http://jquerymobile.com/test/#/test/docs/toolbars/docs-navbar.html) the navbar will wrap on five elements. However, in my working with it, it's wrapping at only 4 elements. Is this expected behavior? ![Navbar from iPhone Simulator](https://i.stack.imgur.com/AlWeS.png) The code ``` <div data-role="page" id="images"> <div data-role="header"> <h1><%= @disease.name %></h1> <a href="index.html" data-icon="plus" class="ui-btn-right">Add</a> </div><!-- /header --> <div data-role="content"> <p>Images will be here.</p> </div><!-- /content --> <div data-role="footer"> <div data-role="navbar"> <ul> <li><a href="#images" class="ui-btn-active">Images</a></li> <li><a href="#symptoms">Symptoms</a></li> <li><a href="#treatments">Treatments</a></li> <li><a href="#notes">Notes</a></li> </ul> </div><!-- /navbar --> </div><!-- /footer --> </div><!-- /page --> ```
jQuery Mobile Navbar wrapping on 4 (not 5) elements
CC BY-SA 3.0
null
2011-06-07T20:50:06.080
2011-06-07T21:13:06.620
null
null
320,919
[ "jquery", "html", "css", "jquery-mobile" ]
6,271,692
1
6,272,220
null
0
290
In an ASP.NET ListView control, populated from an ObjectDataSource, how would I show "N/A" for indeterminate values? ![enter image description here](https://i.stack.imgur.com/nRRL0.png) For example, I have a column that shows the average score across play sessions. There will be some players who have registered but haven't yet played any games yet, so they'd have no meaningful average score. Rather than showing an average score of 0 (and a grade of "F"), I'd rather show N/A. I'm using a data transfer object to represent each player. One approach I tried was to represent the Average Score as a string so that it could sometimes be "N/A", but this seems kinda lame lose the numeric value. Another idea I had was to have both an AverageScore and AverageScoreDisplayString so that the display string could be set to "N/A" as needed. But this would require the display string field for all columns that might need to show "N/A". Suggestions?
Populating ListView from ObjectDataSource and displaying "N/A" for indeterminate values
CC BY-SA 3.0
0
2011-06-07T21:08:38.730
2011-06-07T22:12:39.157
null
null
90,837
[ "asp.net", "listview", "objectdatasource" ]
6,271,809
1
6,271,980
null
1
1,573
How could I set a Controller to show or Hide a Graphic component of a Manipulate ? ``` Manipulate[Graphics[ {Pink, Disk[{1, 1}, r], Green, Disk[{2, 2}, r]}], {{r, 0.5, Style["Radius", Black, 16]}, 0.5, 5, 1, Appearance -> "Labeled"}] ``` For example, in the above, How could I set a controller to Display or not the Green Circle ? ![enter image description here](https://i.stack.imgur.com/0Z1Yc.png) ``` Manipulate[Graphics[{ If[thePink, {Pink, Disk[{1, 1}, r]}], If[theGreen, {Green, Disk[{2, 2}, r]}] } ], {{r, 0.5, Style["Radius", Black, 16]}, 0.5, 5, 1, Appearance -> "Labeled"}, {{thePink, True, "Pink"}, {True, False}}, {{theGreen, False, "Green"}, {True, False}}] ``` ![enter image description here](https://i.stack.imgur.com/ivU5a.png)
Show or hide components using Manipulate in Mathematica
CC BY-SA 3.0
null
2011-06-07T21:22:10.143
2015-08-06T11:17:49.763
2015-08-06T11:17:49.763
1,743,957
769,551
[ "graphics", "controller", "wolfram-mathematica" ]
6,271,835
1
6,392,643
null
1
11,995
I am starting to learn Java a little after long time. And learning Netbeans 7.0. I just want to make sure I am doing this ok. I basically need to make an applet, but not having it AWT based, but instead Swing based. So I need to extend JApplet, not Applet. I understand in swing draws on a Jpanel instead of awt canvas (or Panel). And so I read on a web site that one needs to override PaintComponent() instead of overrriding paint() as the case with awt applet? I need to make a very simple applet, say with one button, when I click on it, I want to draw a graphics, say a line or circle, and have the output go to an area below the button. This is what I did 1. File->New Project 2. Select Java and from Projects, select "Java Application" 3. make sure to Un-check the "create Main class", and click Finish 4. File->New file 5. Select "Swing GUI Forms" from under the catagories panel 6. From the "File types", Select Japplet Form,Next and Finish 7. From the palette, from Swing Controls, select Button and lay it on the from 8. Now the tricky part. I need an area to draw on, right? So I from palette, I select, from Swing containers, a "Panel", and lay it on the form, resize it as needed. Do, now I have this: ![enter image description here](https://i.stack.imgur.com/X0O3X.png) Am I on the right track so far? Now I open the source file, and I see the init() method. Now is where I need little help. Not sure what the code I need to insert to just draw a line to the JPanel I just added. I know I need to insert it here: ![enter image description here](https://i.stack.imgur.com/jN30h.png) I tried the "insert Code" feature, and select override, but do not see PaintComponent()? I know how to do it in swt applet, just add a paint(Graphics g) method. But when I do this, the graphics do not draw inside the Jpanel area. Basically, how do I tell it to draw something to a specific JPanel area? If someone just tell me what code I need to insert there to draw a line or any graphics2D object to display on that JPanel I added below the bottom, that will great. thanks, --Nasser ## EDIT 1: Just a clarrification: If I add this function to paint on the Jpanel: public void paint(Graphics g) { super.paint(g); g.drawString(....); } Then the output does show ok, but it over the main Japnel. And can hide the button and any other UI components are there. I need the paint output to go to a specific Jpanel which I added earlier below the button. To this one ``` private javax.swing.JPanel jPanel1; ``` So, my question is, how to draw/paint to the above object and not to the main Jpanel? ## EDIT 2: I tried just to change the JPanel background color, and it is not working. Here is the code. I also tried JpanelForm instead of JApplet Form. Can one use JFrame form to make an applet? Since that requires a main() it does not seem possible. ``` import javax.swing.*; import java.awt.*; import java.awt.Graphics; public class NewJApplet extends javax.swing.JApplet { /** Initializes the applet NewJApplet */ public void init() { jPanel1 = new JPanel(); try { java.awt.EventQueue.invokeAndWait(new Runnable() { public void run() { initComponents(); } }); } catch (Exception ex) { ex.printStackTrace(); } } private void initComponents() {...} //--------- ADDED THIS private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: Rectangle rect=new Rectangle(4,4); jPanel1.setBackground(Color.RED); } //--------------- // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JPanel jPanel1; // End of variables declaration } ```
Creating a JApplet (swing based applet) with netbeans?
CC BY-SA 3.0
null
2011-06-07T21:24:47.563
2015-01-27T04:56:16.767
2011-08-13T13:11:14.293
600,500
765,271
[ "netbeans", "applet" ]
6,271,891
1
6,271,982
null
34
9,692
Well, this is my first foray into memory profiling a .NET app (CPU tuning I have done) and I am hitting a bit of a wall here. I have a view in my app which loads 40 images (max) per page, each running about ~3MB. The max number of pages is 10. Seeing as I don't want to keep 400 images or 1.2GB in memory at once, I set each image to null when the page is changed. Now, at first I thought that I must just have stale references to these images. I downloaded ANTS profiler (great tool BTW) and ran a few tests. The object lifetime graph tells me that I don't have any references to these images other than the single reference in the parent class (which is by design, also confirmed by meticulously combing through my code): ![enter image description here](https://i.stack.imgur.com/7T5aK.png) The parent class `SlideViewModelBase` sticks around forever in a cache, but the `MacroImage` property is set to null when the page is changed. I don't see any indication that these objects should be kept around longer than expected. I next took a look at the large object heap and memory usage in general. After looking at three pages of images I have 691.9MB of unmanaged memory allocated and 442.3MB on the LOH. `System.Byte[]`, which comes from my `System.Drawing.Bitmap` to `BitmapImage` conversion is taking pretty much all of the LOH space. Here is my conversion code: ``` public static BitmapSource ToBmpSrc( this Bitmap b ) { var bi = new BitmapImage(); var ms = new MemoryStream(); bi.CacheOption = BitmapCacheOption.OnLoad; b.Save( ms, ImageFormat.Bmp ); ms.Position = 0; bi.BeginInit(); ms.Seek( 0, SeekOrigin.Begin ); bi.StreamSource = ms; bi.EndInit(); return bi; } ``` I am having a hard time finding where all of that unmanaged memory is going. I suspected the `System.Drawing.Bitmap` objects at first, but ANTS doesn't show them sticking around, and I also ran a test where I made absolutely sure that all of them were disposed and it didn't make a difference. So I haven't yet figured out where all of that unmanaged memory is coming from. My two current theories are: 1. LOH fragmentation. If I navigate away from the paged view and click a couple of buttons about half of the ~1.5GB is reclaimed. Still too much, but interesting nonetheless. 2. Some weird WPF binding thing. We do use databinding to display these images and I am no expert in regards to the ins and outs of how these WPF controls work. If anyone has any theories or profiling tips I would be extremely grateful as (of course) we are on a tight deadline and I am scrambling a bit to get this final part done and working. I think I've been spoiled by tracking down memory leaks in C++ ... who woulda' thought? If you need more info or would like me to try something else please ask. Sorry about the wall-o-text here, I tried to keep it as concise as possible.
.NET Memory issues loading ~40 images, memory not reclaimed, potentially due to LOH fragmentation
CC BY-SA 3.0
0
2011-06-07T21:32:42.947
2012-07-03T09:32:16.593
2020-06-20T09:12:55.060
-1
1,053
[ "c#", ".net", "wpf", "memory-management", "memory-leaks" ]
6,271,942
1
6,271,968
null
1
15,840
I would like to create a custom PopUp menu in Android like the one in the attached screenshot. Any pointers would be appreciated. On click of the button "Choose Name" , you see a PopUp menu just below the button. ![enter image description here](https://i.stack.imgur.com/L4N3p.png) Thaknks.
How to create a custom PopUp Menu
CC BY-SA 3.0
0
2011-06-07T21:39:33.087
2011-06-07T21:42:59.363
2011-06-07T21:42:36.747
69,802
402,637
[ "android", "popupmenu", "android-menu" ]
6,271,909
1
6,272,783
null
1
390
I am making a game (see my previous threads) and have encountered a lot of problems on the way. All I know is that he code compiles, runs, but nothing appears in the window, it's just grey. At Andrew Thompson's suggestion, I am posting the entire compilable version here. Sorry for the length but it is ALL the code in the program. And a lot of things will probably not make sense (unused ActionPerformed to name one), partially because I implemented code in the event that I would need it but mostly because I have never done this before. Also, so far I have no multithreading, because once again, I am new to this, so ideally I would like to keep it that way, if only for the sake of my sanity. EDIT: Forgot to mention I have 4 PNGs in there representing the 4 different objects that appear. My code is flexible enough for you to supply your own. Here is the image I am using for ships ![enter image description here](https://i.stack.imgur.com/az5iw.png) and here is the one for bullets ![enter image description here](https://i.stack.imgur.com/NQQIT.png) just make copies, put them the source file and name them "Enemy-ship" "ship2" "Ebullet" and "PBullet" ``` import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Timer; import javax.swing.JFrame; public class GameController extends JFrame implements ActionListener { /** * */ private static final long serialVersionUID = -3599196025204169130L; private static GameView window; private static Timer time; public GameController() { setTitle("Space Shooter"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(800, 600); //window = new GameView(800,600); //window.setVisible(true); // } //TODO spawn /*public static void main(String args[]) { //GameController c = new GameController(); window = new GameView(800,600); window.setVisible(true); time = new Timer(40, this); time.schedule( new TimerTask(){ public void run(){GameState.update(); window.paintComponents(null);} },0, 40); }*/ public void display() { add(new GameView(800,600)); pack(); setMinimumSize(getSize());// enforces the minimum size of both frame and component setVisible(true); } public static void main(String[] args) { GameController main = new GameController(); main.display(); time = new Timer(40, main); } @Override public void actionPerformed(ActionEvent e) { if(e instanceof EndEvent)//TODO fix this { } else { repaint(); } } } package Game; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class GameView extends JComponent implements ActionListener{ /** * */ private static final long serialVersionUID = -2869672245901003704L; private static final Graphics Graphics = null; private boolean liveGame;//used so that buttons cannot be clicked after game is complete private GameState gs; private Player p; private int w, h; public GameView(int width, int height) { liveGame = true; gs = new GameState(); GameState.init(width, height); p = new Player(width/2,(height*7)/8); this.setBackground(Color.BLACK); paintComponents(Graphics); w = width; h = height; } @Override public Dimension getMinimumSize() { return new Dimension(w, h); } @Override public Dimension getPreferredSize() { return new Dimension(w, h); } @Override public void paintComponent(Graphics g) { int margin = 10; Dimension dim = getSize(); super.paintComponent(g); g.setColor(Color.black); GameState.update(); for(Bullet j : GameState.getEnBullets()){ g.drawImage(j.getImage(),j.getX(), j.getY(), null);} for(Enemy j : GameState.getEnemies()){ g.drawImage(j.getImage(),j.getX(), j.getY(), null);} for(Bullet j : GameState.getPlayBullets()){ g.drawImage(j.getImage(),j.getX(), j.getY(), null);} g.fillRect(margin, margin, dim.width - margin * 2, dim.height - margin * 2); } public void paintComponents (Graphics g) { for(Bullet j : GameState.getEnBullets()){ g.drawImage(j.getImage(),j.getX(), j.getY(), null);} for(Enemy j : GameState.getEnemies()){ g.drawImage(j.getImage(),j.getX(), j.getY(), null);} for(Bullet j : GameState.getPlayBullets()){ g.drawImage(j.getImage(),j.getX(), j.getY(), null);} this.paint(g); } public void refreshImage() { this.removeAll(); paintComponents(Graphics); } public void actionPerformed(ActionEvent e) { } } package Game; import java.awt.event.ActionEvent; import java.util.ArrayList; import javax.swing.JFrame; public class GameState { private static ArrayList<Bullet> playBullets; public static ArrayList<Bullet> getPlayBullets() { return playBullets; } public static ArrayList<Bullet> getEnBullets() { return enBullets; } public static ArrayList<Enemy> getEnemies() { return enemies; } public static Player getP() { return p; } private static ArrayList<Bullet> enBullets; private static ArrayList<Enemy> enemies; private static int X, Y;//for limit of screen so nothing can go outside of screen private static Player p; private static int score; public GameState(){ } public static void init(int x, int y) { playBullets = new ArrayList<Bullet>(); enBullets = new ArrayList<Bullet>(); enemies = new ArrayList<Enemy>(); X=x; Y=y; p = null; score =0; } public static int xLimit(){return X;} public static int yLimit(){return Y;} public static int getScore(){return score;} public static void add (Location e) { if(e instanceof Bullet) { if(((Bullet) e).getOwner() instanceof Enemy){ enBullets.add((Bullet) e); } else playBullets.add((Bullet) e); } else if(e instanceof Enemy){enemies.add((Enemy)e);} else p=(Player)e; } public static void spawn() { Enemy e = new Enemy(((int)(Math.random()*(X-56))+28), 0, 1); } public static void playerCD()//detects if player has collided with anything, removes whatever collided with it, and causes the player to take damage { if(enemies.size()>0){ for(int i =0; i < enemies.size(); i++) { if (p.getLocation().intersects(enemies.get(i).getLocation())) { p.takeDamage(enemies.get(i).getDamage()); enemies.get(i).takeDamage(p.getDamage()); } } if(enBullets.size()>0) for(int i =0; i < enBullets.size(); i++) { if (p.getLocation().intersects(enBullets.get(i).getLocation())) { p.takeDamage(enBullets.get(i).getDamage()); enBullets.remove(i); i--; } } } } public static void enemyCD() { for(int i =0; i < enemies.size(); i++) { for(int n =0; n < playBullets.size(); n++) { if (playBullets.get(n).getLocation().intersects(enemies.get(i).getLocation())) { enemies.get(i).takeDamage(playBullets.get(i).getDamage()); playBullets.remove(n); n--; score+=50; } } } } public static void checkForDead()//clears away dead and things gone offscreen { for(int i =0; i < enemies.size(); i++) { if(enemies.get(i).getY()>Y) { enemies.remove(i); i--; } } for(int i =0; i < enBullets.size(); i++) { if(enBullets.get(i).getY()>Y) { enBullets.remove(i); i--; } } for(int i =0; i < enemies.size(); i++) { if(enemies.get(i).getHealth()>0) { enemies.remove(i); i--; score+=200; } } if(p.getHealth()<=0) { ActionEvent e = new EndEvent(null, 0, "end"); } } public static void update() { move(); playerCD(); enemyCD(); checkForDead(); } public static void move() { p.move(); for(int i =0; i < enemies.size(); i++){enemies.get(i).move();} for(int i =0; i < enBullets.size(); i++){enBullets.get(i).move();} for(int i =0; i < playBullets.size(); i++){playBullets.get(i).move();} } } package Game; import java.awt.Rectangle; import java.awt.event.ActionListener; public abstract class Fights extends Location implements ActionListener { public Fights(Rectangle location) { super(location); // TODO Auto-generated constructor stub } public Fights(){} protected int health; protected int maxHealth;//in the event that I want to have healing items protected int shotCooldown;//in milliseconds protected int shotDmg; protected long currentCool; //cooldown tracker, represents time that shot will be cooled down by (System time @ last shot + shotCooldown protected int xVel, yVel; public abstract boolean shoot(); public abstract int takeDamage(int damage);//returns remaining health protected boolean shoots;//determines whether thing can shoot. possible implementation in some enemy class public boolean move; public int getHealth(){return health;} public abstract boolean move(); public int getDamage(){return shotDmg;} public boolean isDead() { return health<=0; } } package Game; import java.awt.Image; import java.awt.Rectangle; import java.awt.image.BufferedImage; public class Location { protected Rectangle loc; protected Image image; public Location(){}; public Location (Rectangle location) { loc = location; } public Rectangle getLocation() { return loc; } public void setLocation(Rectangle l) { loc = l; } public void updateLocation(int x, int y) { loc.setLocation(x, y); } public Image getImage() { return image; } public int getX() { return (int)loc.getX(); } public int getY() { return (int)loc.getY(); } } package Game; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.Rectangle; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class Player extends Fights implements KeyListener{ int speed = 4; public Player(Rectangle location) { super(location); GameState.add(this); image = null; try{ image = ImageIO.read(new File("ship2.png")); }catch(IOException e){} } public Player(int x, int y) { maxHealth = 1; health = maxHealth; image = null; try{ image = ImageIO.read(new File("ship2.png")); }catch(IOException e){} this.setLocation(new Rectangle(x, y, image.getWidth(null), image.getHeight(null))); GameState.add(this); } public void resetVelocity() { xVel = 0; yVel = 0; } @Override public boolean shoot() { if(currentCool - System.currentTimeMillis() >0){return false;} else { new Bullet(this); currentCool = System.currentTimeMillis() + shotCooldown; }//spawns bullet in the center and slightly in front of player return true; } @Override public int takeDamage(int damage) { return health-=damage; } @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub } @Override public boolean move() {//moves in a direction only if it won't exceed screen boundary, boolean just in case i need it later int newX = this.getX(), newY=this.getY(); if((xVel+ this.getX()+this.getLocation().width)<GameState.xLimit()&& this.getX()+xVel>=0) { newX +=xVel; } if((yVel+ this.getY()+this.getLocation().height)<GameState.yLimit()&& this.getY()+yVel>=0) { newY +=yVel; } this.updateLocation(newX, newY); this.resetVelocity(); return true; } @Override public void keyPressed(KeyEvent arg0) { if (arg0.getKeyCode()== KeyEvent.VK_LEFT) { xVel -= speed; } if (arg0.getKeyCode()== KeyEvent.VK_RIGHT) { xVel += speed; } if (arg0.getKeyCode()== KeyEvent.VK_UP) { yVel -= speed; } if (arg0.getKeyCode()== KeyEvent.VK_DOWN) { yVel += speed; } if(arg0.getKeyCode()==KeyEvent.VK_SPACE) { this.shoot(); } } @Override public void keyReleased(KeyEvent arg0) { // TODO Auto-generated method stub } @Override public void keyTyped(KeyEvent arg0) { // TODO Auto-generated method stub } } package Game; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class Enemy extends Fights { public Enemy(Rectangle location) { super(location); GameState.add(this); image = null; try{ image = ImageIO.read(new File("Enemy-Ship.png")); }catch(IOException e){} } public Enemy(int x, int y, int d) { image = null; try{ image = ImageIO.read(new File("Enemy-Ship.png")); }catch(IOException e){} this.setLocation(new Rectangle(x, y, image.getWidth(null), image.getHeight(null))); GameState.add(this); shotCooldown =(int)(Math.random()*2000); xVel = (int)((Math.pow(-1, (int)(Math.random())))*((int)(Math.random()*6))+2); yVel = (int)(Math.random()*3+1); shotDmg =d; } public void actionPerformed(ActionEvent arg0) { // TODO Auto-generated method stub } @Override public boolean shoot() { if(currentCool - System.currentTimeMillis() >0){return false;} else { new Bullet(this); currentCool = System.currentTimeMillis() + shotCooldown; }//spawns bullet in the center and slightly in front of player return true; } @Override public int takeDamage(int damage)//returns remaining health { health = health-damage; return health; } @Override public boolean move() { int newX = this.getX(), newY=this.getY(); if((xVel+ this.getX()+this.getLocation().width)<GameState.xLimit()&& this.getX()+xVel>=0) { xVel=-xVel; newX +=xVel; } if(this.getY()+yVel>=0) { newY +=yVel; } this.updateLocation(newX, newY); return true; } } package Game; import java.awt.Rectangle; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; public class Bullet extends Location{ private Fights bulletOwner; private int damage; private int velocity; public Bullet(Fights owner)//eventually change to singleton pattern for efficiency { bulletOwner = owner; damage = owner.getDamage(); image = null; if(owner instanceof Enemy) { try{ image = ImageIO.read(new File("Ebullet.png")); }catch(IOException e){} this.setLocation(new Rectangle(owner.getX(), owner.getY()+((int)(owner.getLocation().getHeight()/2)), image.getWidth(null), image.getHeight(null))); velocity = 5; } else { try{ image = ImageIO.read(new File("Pbullet.png")); }catch(IOException e){} this.setLocation(new Rectangle(owner.getX(), owner.getY()-((int)(owner.getLocation().getHeight()/2)), image.getWidth(null), image.getHeight(null))); velocity = -15; } GameState.add(this); } public Fights getOwner(){return bulletOwner;} public int getDamage(){return damage;} public int getVelocity(){return velocity;} public boolean move() { this.updateLocation(this.getX(), this.getY()+velocity); return true; } } ```
Graphics not appearing in JFrame (SSCCE included)
CC BY-SA 3.0
null
2011-06-07T21:35:35.077
2011-06-08T00:21:29.820
2011-06-07T23:34:55.740
768,873
768,873
[ "java", "debugging", "swing", "graphics", "jframe" ]
6,272,084
1
null
null
0
2,844
I am in the last phase of my iphone game development: optimization and performance tuning. I have gone through all the memory leak detection / clean up processes, and the Xcode instrument shows no leak except those from system library (see following screenshot). I also use "autorelease" rarely. (bigger picture: [click here](https://i.stack.imgur.com/xvWhW.png)) ![Leak detection result](https://i.stack.imgur.com/xvWhW.png) I also profiled my application using "CPU Sampler" and "Allocations", but is a little confused by the result. This is the result from "Allocation" benchmark: (bigger picture: [click here](https://i.stack.imgur.com/M63gG.png)) ![Allocations Benchmark](https://i.stack.imgur.com/M63gG.png) This is the result after one game. As you can see, the "Live Bytes" is only 3.93MB, which shouldn't be a big deal (according to my understanding) -- but the game often crashes at this time on iPhone 2, ios 3.1.3 . I also did a "CPU sampler" benchmark, following is the result: (bigger picture: [click here](https://i.stack.imgur.com/OVk2g.png)) ![CPU Sampler Result](https://i.stack.imgur.com/OVk2g.png) What confused me is, the real memory shows "22.32MB" and the virtual memory is more than 100MB, which is dramatically different from the result of "Allocation benchmark". I am also confused by the fact that, my iPhone 3G, running iOS 4.1, even if it has almost exactly same hardware spec with iPhone 2, can run my game very well. It's slow and not as snappy, but it rarely crashs. 1. What else I can do to identify the low memory issue on iphone 2? 2. Are the leaks from system libraries on the "Leaks" profiling result a problem? 3. Why "CPU sampler" and "Allocation" shows different memory foot print? Did I read them correctly? 4. Why iPhone 3G runs a lot more smoother than iPhone 2G? Is it because the newer iOS version (4.1 vs 3.1.3)?
iPhone Memory Usage Optimization / Performance Tuning
CC BY-SA 3.0
null
2011-06-07T21:57:24.987
2011-07-01T07:07:51.687
2011-06-07T22:15:20.150
2,073,263
2,073,263
[ "iphone", "performance", "ios4", "memory-management", "iphone-sdk-3.0" ]
6,272,261
1
null
null
3
621
I am trying to configure a WCF service to allow for both Windows/NTLM and Basic Authentication. Unfortunately, given this configuration only Windows/NTLM works and basic authentication fails with an [http status code of 401 Unauthorized](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#401). Our IIS 7.5 server is configured to allow for both of these types of authentication. ![enter image description here](https://i.stack.imgur.com/tFzBp.jpg) What is wrong with the below configuration that is preventing basic authentication from working? ``` <wsHttpBinding> <binding name="webBinding"> <security mode="Transport"> <transport clientCredentialType="Windows" /> <transport clientCredentialType="Basic" realm="XXX.YYY.com" /> </security> </binding> </wsHttpBinding> ``` I have also tried using `basicHttpBinding`, as a forum post indicated that [wsHttpBinding might prevent basic authentication](https://stackoverflow.com/questions/877322/is-it-possible-to-get-through-a-basic-authentication-proxy-using-wshttpbinding/878720#878720) if WCF felt the password was being passed in clear text.
Unable to use basic authentication to access WCF web service
CC BY-SA 3.0
null
2011-06-07T22:17:51.330
2011-06-07T22:25:26.397
2017-05-23T10:32:35.693
-1
61,654
[ "c#", "wcf", "kerberos", "wshttpbinding", "basichttpbinding" ]
6,272,309
1
6,274,217
null
16
1,110
I am thinking of process an image to generate ![the following effect](https://i.stack.imgur.com/R3xte.jpg) in Mathematica given its powerful image processing capabilities. Could anyone give some idea as to how to do this? Thanks a lot.
how to generate such an image in Mathematica
CC BY-SA 3.0
0
2011-06-07T22:23:33.737
2011-06-09T13:37:54.580
null
null
534,617
[ "image-processing", "wolfram-mathematica" ]
6,272,635
1
6,272,786
null
0
890
The table below echos out great in Chrome, Firefox, and Safari. The left part of it displays like this: ![enter image description here](https://i.stack.imgur.com/0aRxe.png) However, in Internet Explorer 8, the left part sometimes displays like this:![enter image description here](https://i.stack.imgur.com/CKhDE.png) In IE8, with short comments, only the top part of the variable `$row["username"]`, which is "admin" in the screenshots, is showing. How can I make it so IE8 will show the full `$row["username"]` in such a situation? Thanks in advance, John The source code: ``` echo "<table class=\"commentecho\">"; $count = 1; while ($row = mysql_fetch_array($result)) { $dt1 = new DateTime($row["datecommented"], $tzFrom1); $dt1->setTimezone($tzTo1); echo '<tr>'; echo '<td style="border-left:2px solid #004993; border-bottom:2px solid #004993; border-top:2px solid #004993;" rowspan="3" class="commentnamecount">'.$count++.'</td>'; echo '<td style="background: #CAE1FF; border-top:2px solid #004993;" class="commentname2user"><a href="http://www...com/.../index.php?profile='.$row["username"].'">'.$row["username"].'</a></td>'; echo '<td style="border-right:2px solid #004993; border-bottom:2px solid #004993; border-top:2px solid #004993;" rowspan="3" class="commentname1" id="comment-' . $row["commentid"] . '">'.stripslashes($row["comment"]).'</td>'; echo '</tr>'; echo '<tr>'; echo '<td style="background: #CAE1FF;" class="commentname2">'.$dt1->format('F j, Y').'</td>'; echo '</tr>'; echo '<tr>'; echo '<td style="background: #CAE1FF; border-bottom:2px solid #004993;" class="commentname2a">'.$dt1->format('g:i a').'</td>'; echo '</tr>'; echo '<tr>'; echo '<td class="commentname2a"></td>'; echo '</tr>'; } echo "</table>"; ``` The CSS: ``` table.commentecho { margin-top: 20px; margin-left: 30px; text-align: left; font-family: Arial, Helvetica, sans-serif; font-weight: normal; font-size: 14px; color: #000000; width: 450px; table-layout:fixed; background-color: #FFFFFF; border: 2px #FFFFFF; border-collapse: collapse; border-spacing: 0px; padding: 0px; text-decoration: none; vertical-align: text-bottom; } table.commentecho td { border: 0px solid #fff; text-align: left; height: 20px; } table.commentecho td a{ padding: 2px; color: #004284; text-decoration: none; font-weight:bold; height: 20px; } table.commentecho td a:hover{ background-color: #004284; padding: 2px; color: #FFFFFF; text-decoration: none; font-weight:bold; height: 20px; } .commentnamecount { width: 50px; font-family:Arial, Helvetica, sans-serif; font-size: 25px; overflow:hidden !important; color: #004993; font-weight: bold; display:table-cell; vertical-align: top; padding-bottom: 0px; padding-left: 5px; padding-top: 2px; } .commentname2user { width: 120px; color: #000000; font-family:Arial, Helvetica, sans-serif; font-size: 14px; font-weight: normal; height: 50px; padding-top:5px; padding-left: 5px; padding-bottom: 10px; vertical-align: top; } .commentname1 { line-height: 170%; width: 410px; font-family: Georgia, "Times New Roman", Times, serif; overflow:hidden !important; color: #000000; padding-bottom: 30px; padding-left: 10px; vertical-align: top; } .commentname2 { width: 120px; color: #000000; font-family:Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; height: 20px; padding-top:0px; padding-left: 5px; padding-bottom: 0px; vertical-align: top; } .commentname2 a{ width: 120px; color: #004284; font-family:Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; height: 20px; padding-top:0px; padding-bottom: 10px; vertical-align: top; } .commentname2 a:hover{ width: 120px; color: #004284; font-family:Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; text-decoration: underline; height: 20px; padding-top:0px; padding-bottom: 0px; vertical-align: top; } .commentname2a { width: 160px; overflow:hidden !important; color: #000000; font-family:Arial, Helvetica, sans-serif; font-size: 11px; font-weight: normal; height: 40px; padding-top:0px; padding-left: 5px; padding-bottom: 30px; vertical-align: top; } ```
PHP variable in HTML table displays well in Chrome, Firefox, and Safari, but poorly in IE 8
CC BY-SA 3.0
null
2011-06-07T23:10:52.207
2011-06-08T01:05:18.867
null
null
158,865
[ "html", "css", "internet-explorer", "cross-browser" ]
6,272,816
1
6,272,898
null
0
532
I want two TextViews to overlap such that individual letters will overlap perfectly (i.e. you can't even see there is another TextView on the screen). Here is the relevant part of my layout: ``` <com.testing.android.animals.OutlinedTextView android:id="@+id/label_left_name" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Elephant" android:layout_alignTop="@id/picture_left" android:layout_centerHorizontal="true" android:textColor="#ffffff" android:textSize="40dp" android:background="#99000000" ></com.testing.android.animals.OutlinedTextView> <com.testing.android.animals.OutlinedTextView android:id="@+id/label_left_letter" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="E" android:layout_alignBaseline="@id/label_left_name" android:layout_alignLeft="@id/label_left_name" android:textColor="#ffffff" android:textSize="40dp" android:background="#99ffffff" ></com.testing.android.animals.OutlinedTextView> ``` When rendered, it looks like this: ![enter image description here](https://i.stack.imgur.com/7G0D1.png) Notice the individual "E" (in light gray) is aligned too high. What can I change in the layout that will get them to overlap better?
Align overlapping text in TextViews
CC BY-SA 3.0
null
2011-06-07T23:43:35.477
2011-06-07T23:59:15.633
null
null
302,945
[ "android", "textview" ]
6,272,854
1
6,545,400
null
1
566
My CI site will sometimes just hang - server seems to take forever to answer my request, i.e. when just loading the homepage, and other pages too. It's quite random and only does it sometimes. I turned on profiling and hit the homepage, this was the result: ![enter image description here](https://i.stack.imgur.com/cffZ7.jpg) Here's the ``` function index() { $this->output->enable_profiler(TRUE); $this->benchmark->mark('template_sets_start'); $this->template->title('Yay, welcome to my site'); $this->template->js('home.js,cycle.js'); $this->benchmark->mark('template_set_end'); $this->benchmark->mark('template_load_start'); $this->template->load('template/home'); $this->benchmark->mark('template_load_end'); } } ``` Since the time returned for the template stuff is low, I can assume the lag isn't happening anywhere in the views. An ideas or suggestions? ===EDIT=== One thing I found is the config is setting the base_url dynamically. Code below, could this potentially cause slow-dows? ``` $config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http"); $config['base_url'] .= "://".$_SERVER['HTTP_HOST']; $config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); ```
Simple Codeigniter Site hanging (8min+) - where to profile/benchmark?
CC BY-SA 3.0
0
2011-06-07T23:49:38.487
2011-07-01T08:23:07.927
2011-06-08T02:28:15.057
739,215
739,215
[ "codeigniter", "profiling", "benchmarking", "profiler" ]
6,273,023
1
6,273,096
null
1
207
I have such a query but it gives me wrong output. I have two data collections `abcdata` && `xyzdata`. each collection consists of an anonymous objects that have `Group`, `Name` properties. What I need to do is to get resulting collection with merged groups from `abcdata` and `xyzdata` respectively. ``` if(this.AbcDataGrid.ItemsSource != null && this.XyzDataGrid.ItemsSource != null) { var abcdata = ((IEnumerable<dynamic>)this.AbcDataGrid.ItemsSource).ToList().OrderByDescending(x => x.Id); var xyzdata = ((IEnumerable<dynamic>)this.XyzDataGrid.ItemsSource).ToList().OrderByDescending(x => x.Id); var result = from i1 in abcdata from i2 in xyzdata select new { Name = i1.Name, Group = i1.Group.ToString() + i2.Group.ToString() }; this.ResultGrid.ItemsSource = result.ToList(); } ``` While I was expecting to get DataGrid populated with list of new {Name, Group} objects I have very strange result:![enter image description here](https://i.stack.imgur.com/8xLJ8.png)
Data duplication in DataGrid. Problem with LINQ query
CC BY-SA 3.0
null
2011-06-08T00:23:50.570
2011-06-08T00:35:00.343
null
null
532,675
[ "c#", "wpf", "linq", "datagrid" ]
6,273,085
1
null
null
1
395
I'm going slightly mad. I'm having weird problems with `BindingUtils.bindSetter` and `bindProperty`. I thought that, if I'd bind two variables with `BindingUtils.bindProperty` I could be sure they would always be synchronized. But it's not so. I have this code in a creationCompleteHandler: ``` BindingUtils.bindProperty(this, "pendingHold", drhHold, "pending", false, true); ``` But when I debug, the two variables that should be bound together at some point have different values: ![enter image description here](https://i.stack.imgur.com/r22I1.png) What am I missing? Thanks in advance, Nuno
Weird behavior in BindingUtils.bindProperty: non deterministic
CC BY-SA 3.0
0
2011-06-08T00:34:17.927
2011-06-10T00:14:47.677
null
null
202,545
[ "apache-flex", "data-binding", "binding", "flex4" ]
6,273,150
1
6,273,160
null
1
4,074
Guys I asked a similar question like this earlier since I was unable to solve my problem I decided to ask a detailed question.Please referrer to my image ![Table, containing input fields](https://i.stack.imgur.com/6q8sf.png) As i mentioned on the image I need to identify the particular to enable the particular capacity,unit price,qty fields and to display the subtotal.I tried some javascript and jq table row detection codes and they do the job but they effect to the capacity selection field baldly since every time a click or a select occurs capacity field gets reset to blank. I tried this 2 full days but still unable to make a solution :( This is the complete code set - [http://jsfiddle.net/Ceylo/AE2Mb/](http://jsfiddle.net/Ceylo/AE2Mb/) Please help me to get through this.
How to find the row Id using jQuery?
CC BY-SA 3.0
0
2011-06-08T00:49:35.950
2011-06-08T06:37:31.323
2011-06-08T01:45:30.743
786,680
786,680
[ "javascript", "jquery", "ajax" ]
6,273,208
1
6,273,222
null
0
760
I have a table with contains multiple rows that define "amenities" for a particular resort. I need to return the resortID if there are rows containing whatever "amenOptionID" I define. My issue comes in where I'm looking to see if a resort has two or more amenities. For example: I want to return resortIDs that have BOTH amenOptionID 1 AND 4. I also do not want duplicate resortIDs. Refer to the image for the table structure. Thanks in advance for any help. ![Table Structure](https://i.stack.imgur.com/DIxOY.jpg)
MySQL single row with multiple records
CC BY-SA 3.0
null
2011-06-08T01:03:30.460
2011-06-08T01:07:32.527
2011-06-08T01:04:28.310
142,162
734,567
[ "mysql", "row", "records", "multiple-records" ]
6,273,244
1
6,273,264
null
4
1,108
I have a very simple .NET program. It's just to write a string to the textbox. There is a strange character appearing at the end of my string. ![enter image description here](https://i.stack.imgur.com/3g6IT.png) This happens only on my 32-bit XP box. The same program works fine on another 64bit Windows 2008 machine. The program is as simple as this. ``` private void Form1_Load(object sender, EventArgs e) { textBox1.Text = "Hello\n\0\0\0\0\0\0"; } ``` I know it's odd to add \0 at the end of the string and I can trim them before applying to the textbox. The textbox is set to allow multi-line. Just out of curiousity, does anybody know where the problem comes from? Both machines got .NET 3.5 SP1 installed. Both of them are set to have the same regional settings. I doubt if it is related to 32-bit or 64-bit. Thanks to @DBM and @Andrew. The strange character is coming from \n but nothing to do with \0. Now, it sounds like Windows 2008 can understand both \r\n and \n. Can anybody confirm that?
Unexpected character is displayed in the textbox
CC BY-SA 3.0
0
2011-06-08T01:09:19.870
2012-09-16T18:40:47.777
2011-07-04T06:47:24.100
621,188
452,199
[ "c#", ".net", "winforms" ]
6,273,354
1
null
null
8
473
For a question paper i'm doing I got a question on stack frames: Consider the following function in Nada (a made up language), the language used in the lectures: ``` function f(x,y) begin var z z := y - x; return z * z; end; ``` Such a function might be called like this: ``` n := f(a+2,b*3) ``` Using diagrams to illustrate your answer, explain the sequence of events when the function call above is executed, showing how the stack frame is built on entry to the function and destroyed on exit from it, and how the base pointer register is used when accessing the parameters x and y and the local variable z. I've answered this question and this is the stack frame I produced: ![sackframe I produced](https://i.stack.imgur.com/b37oo.jpg) I just want someone to correct this for me if parts of it are wrong...or produce a new stack frame (if anyone's got the time). I'll really appreciate the help.
Is this stack frame I produced right?
CC BY-SA 3.0
0
2011-06-08T01:34:47.600
2012-09-18T16:59:23.333
2012-09-18T16:59:23.333
1,288
612,872
[ "compiler-construction", "stack", "frame" ]
6,273,431
1
6,817,860
null
2
7,010
I need to animate an object along a path. I am doing so by creating an animation like:![enter image description here](https://i.stack.imgur.com/cpU0G.png). This works great but since my terrain is not flat it will be nice if I don't have to deal with the y component. In other words I want to move an object along the x-axis and z-axis and if there is a small slope increase then increase the object y position. same thing if there is a downward slope. Or maybe I have to create a script where it checks to see if the object is colliding with the terrain. if not then decrease its y position. I don't know if this will work meanwhile animating an object though.
animating object along a path in unity 3d
CC BY-SA 3.0
null
2011-06-08T01:54:50.250
2013-02-02T13:12:23.597
null
null
637,142
[ "unity3d" ]
6,273,847
1
6,274,296
null
16
17,977
How to set the background of TabItem? I tried the following code: ``` <TabControl> <TabItem Header="Test" Background="Blue" Foreground="Red" /> </TabControl> ``` `Foreground` works, but `Background` does not work. ![enter image description here](https://i.stack.imgur.com/rWOpt.png) Any ideas? Thanks
WPF: How to set background of TabItem?
CC BY-SA 3.0
0
2011-06-08T03:19:34.567
2011-06-08T04:51:07.747
null
null
null
[ "wpf", "wpf-controls", "tabitem" ]
6,273,848
1
6,274,072
null
2
1,216
I ran the 'Analyze' on my code and the result shows a potential memory leak on the following part of my code ``` NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]; //Potential memory leak in code below [[NSURLConnection alloc] initWithRequest:request delegate:self]; ``` I am not sure how to stop this leak. I tried to add a 'autorelease' to the back but that caused a crash. Any advise on this? EDIT: Screenshot of the leak message ![enter image description here](https://i.stack.imgur.com/5C9Zu.png)
Objective C: Potential Memory Leak in code
CC BY-SA 3.0
null
2011-06-08T03:19:36.570
2012-02-06T17:46:58.647
2011-06-08T03:54:44.820
683,898
683,898
[ "objective-c", "memory-leaks" ]
6,273,882
1
6,273,974
null
3
1,825
This is the first time I've used @font-face. The font pack is from myfonts.com and I'm currently testing in Safari and noticed through the web inspector that the css file, which loads the 2 fonts shows as a nearly-2mb-download ! the fonts appear to be there as base64 encoded. The pack didn't include the actual .otf files. ![enter image description here](https://i.stack.imgur.com/vni2p.jpg) ![enter image description here](https://i.stack.imgur.com/WbnPj.png) I've added Gzipping via a .htaccess file and this has cut down the size of that file by nearly half but at 1mb, it's still not acceptable and I can't understand why it's so big.
using @font-face for 2 fonts causing big slow-down
CC BY-SA 3.0
0
2011-06-08T03:25:18.287
2011-06-08T04:22:11.837
null
null
739,215
[ "css", "font-face", "embedded-fonts", "webfonts", "opentype" ]