Search Results

Search found 4489 results on 180 pages for 'black cobra'.

Page 158/180 | < Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >

  • How to make this jQuery snippet work in Internet Explorer?

    - by George Edison
    If there was ever a time to hate IE, this is it. This code begins with a box with content. When the button is clicked, the box is supposed to drop down and fade-in. <html> <script type="text/javascript" src="jquery.js"></script> <script type='text/javascript'> function Test() { var item_height = $('#test').height(); $('#test').height(0); $('#test').css('opacity','0'); $('#test').animate({ height: item_height, opacity: '1' },400); } </script> <body> <!-- The div below holds the sample content --> <div id="test" style='border: 1px solid black;'> Content<br> Content<br> Content<br> Content<br> Content </div> <!-- The button to test the animation --> <br><br> <div style='position: absolute; top: 150px; left: 10px;'> <button onclick='Test();'>Test</button> </div> </body> </html> This very simple example works on Chrome, Safari, and Opera. But Internet Explorer? No. How can I (if it's even possible) fix this so that it works in IE?

    Read the article

  • Basic CSS trouble

    - by user310108
    I guess this is fairly simple for you but i cant wrap my head around it. I ripped out the important part. I got text inside #content so i cant change it and i dont want to use !important tag. The css is presented in the order it is placed in my css file. How come the "#content h2 a, #content h2 a:visited" overrides the .post-header h2 a? <html> <head> ..... </head> <div id="content"> ..... <div class="post-header"> <a href="#">my text</a> </div> </div> </html> #content h2 a, #content h2 a:visited { font-family:"arial black","lucida console",sans-serif; } .post-header h2 a { font-family:Arial,sans-serif; } /Joel

    Read the article

  • Modifying Django's pre_save/post_save Data

    - by Rodrogo
    Hi, I'm having a hard time to grasp this post_save/pre_save signals from django. What happens is that my model has a field called status and when a entry to this model is added/saved, it's status must be changed accordingly with some condition. My model looks like this: class Ticket(models.Model): (...) status = models.CharField(max_length=1,choices=OFFERT_STATUS, default='O') And my signal handler, configured for pre_save: def ticket_handler(sender, **kwargs): ticket = kwargs['instance'] (...) if someOtherCondition: ticket.status = 'C' Now, what happens if I put aticket.save() just bellow this last line if statement is a huge iteration black hole, since this action calls the signal itself. And this problem happens in both pre_save and post_save. Well... I guess that the capability of altering a entry before (or even after) saving it is pretty common in django's universe. So, what I'm doing wrong here? Is the Signals the wrong approach or I'm missing something else here? Also, would it be possible to, once this pre_save/post_save function is triggered, to access another model's instance and change a specific row entry on that? Thanks

    Read the article

  • Android onFling not responding

    - by Kevin Moore
    I am new to android first of all so think of any newbie mistakes first I am trying to add a fling function in my code. public class MainGamePanel extends SurfaceView implements SurfaceHolder.Callback, OnGestureListener { private MainThread thread; private Droid droid; private Droid droid2; private static final String TAG = gameView.class.getSimpleName(); private GestureDetector gestureScanner; public MainGamePanel(Context context){ super(context); getHolder().addCallback(this); droid = new Droid(BitmapFactory.decodeResource(getResources(), R.drawable.playerbox2), 270, 300); droid2 = new Droid(BitmapFactory.decodeResource(getResources(), R.drawable.playerbox2), 50, 300); thread = new MainThread(getHolder(), this); setFocusable(true); gestureScanner = new GestureDetector(this); } public boolean onTouchEvent(MotionEvent event){ return gestureScanner.onTouchEvent(event); } @Override protected void onDraw(Canvas canvas){ canvas.drawColor(Color.BLACK); droid.draw(canvas); droid2.draw(canvas); } @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { droid.setX(50); droid.setY(50); Log.d(TAG, "Coords: x=" + e1.getX() + ",y=" + e2.getY()); return true; } @Override public boolean onDown(MotionEvent e) { droid2.setX((int)e.getX()); droid2.setY((int)e.getY()); Log.d(TAG, "Coords: x=" + e.getX() + ",y=" + e.getY()); return false; } I got the gestureListener to work with: onDown, onLongPress, and onShowPress. But i can't get any response with onFling, onSingleTapUp, and onScroll. What mistake am I making? does it have to do with views? I don't know what code would be useful to see.... so any suggestions would be much appreciated. Thank You!

    Read the article

  • Overriding CSS style 'display:none' in javascript

    - by jsarma
    I'm trying to add a checkbox toggle that hides and shows list elements by changing their style display attribute from "none" to "inline", but it's not working. I'm setting the attribute's style to "display:none" in the CSS file. Then I set it to "display:inline" in javascript when someone checks a box. The javascript is successfully changing the element's property to inline, but for some reason the element remains invisible. If I do the opposite, by setting the display to inline in the CSS and overriding it to none in the javascript, it works fine. I don't see why this would work one way but not the other. I'm using chrome. Here is the code. Any feedback is appreciated. CSS file: #tabmenu li[status='disabled'] a, a.active, #disabled { color: #777777; background: #DDDDDD; font: normal 1em Arial; border: 1px solid black; border-radius: inherit; padding: 0px 5px 0px 5px; margin: 0px; text-decoration: none; cursor:hand; display:none; } HTML: <ul id="tabmenu"> <li name='tab' id='tab1' selected='no' status='disabled'></li> </ul> JAVASCRIPT (from command line, or onchange of a checkbox) tab = document.getElementById('tab1'); tab.style.display = 'inline';

    Read the article

  • How can I be a Guru? Is it possible? [closed]

    - by Kev
    Before 1999, I heard about computer. But, I don't know what it look like. TV? Maybe! Before 2001, I only saw it in book. It looks like a TV. Before 2005, I touched it in reality. It still looks like a TV + Black Box. In 2005, I entered university. I had a cource about Mathematica.I loved programming since then. In 2006, I owned a computer. I was coding C every day. if...else..., for..., while..., switch... entered my life. Since 2007, I have learned Data Structures, Algorithms...Then, C#, Java, Python, HTML/CSS/JavaScript, F#... A lot of languages. I'm still learning new lang. Unfortunately, I only know syntax! I'm always a novice(??)! I know some guru start programming at age of 8 or 12. I admire these gurus who are compiler writers, language designers, architecture designers, Linux hackers... Is it possible to become a guru like me. If possible, how? what should I do now? Any advice? Thank you very much.

    Read the article

  • Basic CSS question regarding background images for divs

    - by Mike
    I'm a programmer trying to learn some css and I've already run into a stumbling block. I have the following HTML: <div class="container"> <div class="span-24 last"> Header </div> <div class="span-4"> Left sidebar </div> <div class="span-16"> <div class="span-8"> Box1 </div> <div class="span-4"> Box2 </div> <div class="span-4 last"> Box3 </div> <div class="span-16 last"> Main content </div> </div> <div class="span-4 last"> Right sidebar </div> <div class="span-24 last"> Footer </div> </div> In my css I have the following: body { background-color:#FFFFFF; } div.container { background:url(/images/bck.jpg); } I just want to display an image for the background area for the container div but nothing shows up. If I remove the background section from the css and add background-color:#000000; then I see a black background for the container div. What am I overlooking?

    Read the article

  • jquery animate boxshadow

    - by mstef
    http://jsfiddle.net/mstefanko/w5aAn/877/ Below, i'm achieving the effect I wanted, but with a pending issue. Since i'm using a separate span and positioning it absolute over-top of a box with relative position. I can not access the inputs until after the animation is finished. I'm guessing the only way to alleviate this would be do something similar with just animating the border of the outer box? But nothing I was doing to animate box-shadow:inset was working. HTML <div id="wow"> <span id="pulse"></span> <input id="form-input"/> <input id="form-input"/> </div>? CSS #wow { width: 500px; height: 200px; display: inline-block; position: relative; border: 1px solid black; } #pulse { width: 100%; height: 100%; box-shadow:inset 0 0 20px #6c95c3; -moz-box-shadow:inset 0 0 10px #6c95c3; position: absolute; z-index: 20000; } JS $('#pulse').stop().animate({"opacity": 0}, "fast"); $('#pulse').effect("pulsate", { times:4 }, 500, function() { $(this).remove(); });

    Read the article

  • DynamicContent.html: Write a JavaScript in an HTML document that can change the content of an HTML e

    - by A sw A
    ShowHide.html: Write a JavaScript in an HTML document that displays an image and allows the user to toggle the image between appearing and not appearing in the document. Place your image in a (division) tag that has a style attribute. “style.visibility” can take two values: “visible” and “hidden”. The document has a button called “Toggle Image”, which calls the toggle function upon the event “onclick”. DynamicColors.html: Write a JavaScript in an HTML document that changes the background and foreground colors of the body of a document according to the user input. The document has two input texts: background color and foreground color. The colors change when the event “onchange” occurs as you type in the text input and the event handler is called. Your event handler takes two parameters: “where”, and “newColor”. To change the document color and background color you need to change the elements document.body.style.color and document.body.style.backgroundColor. Available colors are: black, silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, and aqua. DynamicContent.html: Write a JavaScript in an HTML document that can change the content of an HTML element (a help box). The content of an element is accessed through its “value” property. The content of a help box can change depending on the placement of the mouse cursor. When the cursor is placed over a particular input field (“onmouseover” event), the help box can display advice on how the field is to be filled. When the cursor is moved away from the input field (“onmouseout” event), the help box content changes to simply indicate that assistance is available. Your messages are stored in an array of strings.

    Read the article

  • php png image transparency

    - by user1334130
    I have been working with some code to draw a circle but I am having problems with removing the black background from the shape. I am using imagecopyresampled for its AA features in order to draw a smooth circle, so I can't use a different drawing function. Thanks. <?php $img_2 = imagecreatetruecolor(200, 200); $red = imagecolorallocate($img_2, 255, 0, 0); imagefill($img_2, 0, 0, $red); //set circle values $xPos = 50; $yPos = 80; $diameter = 40; $img_1 = imagecreatetruecolor(($diameter + 2) * 2, ($diameter + 2) * 2); $green = imagecolorallocate($img_1, 0, 255, 0); //draw the circle imagefilledarc($img_1, $diameter+1, $diameter+1, ($diameter + 2) * 2, ($diameter + 2) * 2, 0, 360, $green, IMG_ARC_PIE); imagecopyresampled($img_2, $img_1, $xPos, $yPos, 0, 0, $diameter+2, $diameter+2, ($diameter + 2) * 2, ($diameter + 2) * 2); header("Content-type: image/png"); imagepng($img_2); imagedestroy($img_1); imagedestroy($img_2); ?>

    Read the article

  • Center <div> vertically within another <div>

    - by sab
    I am trying to setup something that looks like this with the arrow that is centered vertically: CSS: #arrowdiv { width:282px; height:61px; background-image:url('http://i.imgur.com/RV80I.png'); margin: 0 auto; } #optin { height:110px; width:960px; background-color:#FFFFBF; border:1px solid black; -moz-border-radius: 15px; border-radius: 15px; -moz-box-shadow: 3px 3px 4px #000; -webkit-box-shadow: 3px 3px 4px #000; box-shadow: 3px 3px 4px #000; /* For IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')"; /* For IE 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000'); margin: 0 auto; } #leftdiv { width:340px; height:108px; } ? HTML: <div id="optin"> <div id="leftdiv"> <div id="arrowdiv"></div> </div> </div>? http://jsfiddle.net/NzMLd/1/ Right now, it is only centered horizontally, as you can see in my jsFiddle.

    Read the article

  • Return HTML from a user selection

    - by Cruinh
    I have the following, very simple html page... <html> <head> <script type="text/javascript"> function alertSelection() { var selection = window.getSelection(); var txt = selection.toString(); alert(txt); } </script> </head> <body> This is <span style="background-color:black;color:white">the</span> text. <div style="background-color:green;width:30px;height:30px;margin:30px" onmouseover="alertSelection()"> </body> </html> When I select the entire first line and mouseover the square, I get an alert with "This is the text.". How would I fix this so the the span tag or any other selected HTML isn't stripped out of the alert message?

    Read the article

  • How to delete Drawn Line in java?

    - by Jeyjey
    Hello Folks, well this is my code: import javax.swing.; import javax.; import java.awt.; import java.awt.Color; import java.awt.Graphics.; import java.awt.event.*; import javax.swing.UIManager; public class SimpleGUI extends JFrame{ public SimpleGUI(){ this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) ; } public void go(){ Drawpanel = new Mypanel(); JFrame frame = new JFrame("Chasing Line"); frame.getContentPane().add(BorderLayout.CENTER, Drawpanel); frame.setSize(300,300); frame.setVisible(true); Drawpanel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { DrawpanelMouseMoved(evt); } }); } public void DrawpanelMouseMoved(java.awt.event.MouseEvent evt) { xpos=evt.getX(); ypos=evt.getY(); System.out.println("Coordinates : X :"+ xpos+"Y: "+ypos); Drawpanel.paintImage(xpos,ypos); } class Mypanel extends JPanel{ public void paintImage(int xpost,int ypost){ Graphics d = getGraphics(); d.setColor(Color.black); d.drawLine(xpost, 0, xpost, this.getHeight()); d.setColor(Color.red); d.drawLine(0, ypost, this.getWidth(),ypost); this.validate(); } } // end the inner class public static void main(String[] args){ try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch(Exception e) { System.err.println("Look and feel not set"); } SimpleGUI win = new SimpleGUI(); win.go(); } Mypanel Drawpanel; private int xpos=0; private int ypos=0; } // close SimpleGUI class The problem is how can i delete the old lines?, i mea,make only the current x and y lines appear on the screen, make the intersection between both lines "follow" the mouse pointer. thanks for any reply.

    Read the article

  • Vertically And Horizonatally center main wrap div

    - by Hello you all men
    Now i try <html> <head> <title>?????????????????</title> <style type="text/css"> body { margin-left: auto; margin-right:auto; } #wrap { background: black; margin-left: auto; margin-right:auto; height:450px; width:450px; position:absolute; top:50%; right:50%; left:50%; margin-top:-225px; } </style> </head> <body> <div id="wrap"> Hello </div> </body> </html> ?????

    Read the article

  • Need help on HttpWebrequest

    - by ASPUSER
    HI Guys I have the same issue and I am looking to solve it. Here is detail I have two web sites WebsiteA and WebSiteB (WebsiteB is not in my control, A type of black box for me.). Both websites have seprate login page I have alist of users,password of websiteB which I stored in database. I want a kind of common login page. If user is login to websiteA and he want to go to websiteB, he dont have to enter the login and password information again. I can not touch the code of websiteB. it's alredy deployed and runing. In websiteB in login form they have a Userid textbox and Password textbox and and a login Button. This butoon is not a submit button. It has a click event which calls a function to validate the user. it's not a simple post. WebsiteB has one webpage which has different frames. After login sucessfull. The pages doesnt go to any other page it remain on the same page but load the different frame. According to my knowledge. I can use httpwebrequest class. But faceing the following problem. Can not click the button. Response.Redirect does not work. It seems that WebsiteB is not storing any thing in cookies as cookies always return me a empty string I really appriciate if anyone can help me on it. How Can I use response.Redirect . As when I redirect it shows me the same login page.

    Read the article

  • Add Custom Control to DataGridViewCell

    - by Kovscer
    Hello, I create a custom control inherited from Windows.System.Forms.Controls. This is my code of this control: public partial class MonthEventComponent : Control { private Color couleur; private Label labelEvenement; public MonthEventComponent(Color couleur_c, String labelEvenement_c ) { InitializeComponent(); this.couleur = couleur_c; this.labelEvenement.Text = labelEvenement_c; this.labelEvenement.ForeColor = couleur; this.labelEvenement.BackColor = Color.White; this.labelEvenement.TextAlign = ContentAlignment.MiddleLeft; this.labelEvenement.Dock = DockStyle.Fill; this.Controls.Add(labelEvenement); } public MonthEventComponent() { InitializeComponent(); this.couleur = Color.Black; this.labelEvenement = new Label(); this.labelEvenement.ForeColor = couleur; this.labelEvenement.BackColor = Color.White; this.labelEvenement.Text = "Evénement Initialiser"; this.labelEvenement.TextAlign = ContentAlignment.MiddleLeft; this.labelEvenement.Dock = DockStyle.Fill; this.Controls.Add(labelEvenement); } protected override void OnClick(EventArgs e) { base.OnClick(e); MessageBox.Show("Click"); } } I would like to insert this control or multiple of this control on a DataGridViewCell but i don't know how to do this. Thank you in advance for your answer, Best Regards, PS: I'm french, i'm apologize for any can of language errors.

    Read the article

  • Color difference between vista and Win7

    - by MSGrimpeur
    Have an indicator in the form of an image which is displayed in a graphics viewport. The indicator can be any colour the user selects so we created a single image with a pallette and change a specific color in the pallette to the one the user picks using the following code. /// <summary> /// Copies the image and sets transparency and fill colour of the copy. The image is intended to be a simple filled shape such as a square /// with the inside all in one colour. /// </summary> /// <remarks>Assumes the fill colour to be changed is Red, /// black is the boundary colour and off white (RGB 233,233,233) is the colour to be made transparent</remarks> /// <param name="image"></param> /// <param name="fillColour"></param> /// <returns></returns> protected Bitmap CopyWithStyle(Bitmap image, Color fillColour) { ColorPalette selectionIndicatorPalette = image.Palette; int fillColourIndex = selectionIndicatorPalette.IndexOf(Color.Red); selectionIndicatorPalette.Entries[fillColourIndex] = fillColour; image.Palette = selectionIndicatorPalette; Bitmap tempImage = image; tempImage.MakeTransparent(transparentColour); return tempImage; } To be honest I'm not sure if this is a bit cludgy and there is some smarter approach or not, so any thoughts there would help. However the main issue is that this appears to work fine on Win7 but in vista and XP the color does not change. Has any one seen this before. I've found one or two articles that suggest there are some differences in ARGB between them but nothing particularly concrete. Any help greatfully accepted.

    Read the article

  • Admob in xml not showing in Linear

    - by NoobMe
    i am implementing admob on my app it appears when the parent is in relative layout but i must not use the alignparentbottom so i am changing it to linear but it doesnt show when i change it to linear.. any tips? help? thanks in advance here it is in xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <RelativeLayout android:id="@+id/banner_holder" android:layout_width="match_parent" android:layout_height="wrap_content" > <ImageView android:id="@+id/offline_banner" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerInParent="true" android:background="@color/black" android:src="@drawable/offline_banner" /> <com.google.ads.AdView xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" android:id="@+id/adView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" ads:adSize="SMART_BANNER" ads:adUnitId="@string/unit_id" ads:loadAdOnCreate="true" /> </RelativeLayout> <FrameLayout android:id="@+id/fragmentContainer" android:layout_width="match_parent" android:layout_height="wrap_content" /> </LinearLayout> i want the admob to be at the bottom part of the screen without using the alignparentbottom of relative layout thanks~

    Read the article

  • Editing XML file content with Python.

    - by Hooloovoo
    Hi, I am trying to use Python to read in an XML file containing some parameter names and values, e.g. ... <parameter name='par1'> <value>24</value> </parameter> <parameter name='par2'> <value>Blue/Red/Green</value> </parameter> ... and then pass it a dictionary with the parameter names {'par1':'53','par2':'Yellow/Pink/Black',...} and corresponding new values to replace the old ones in the XML file. The output should then overwrite the original XML file. At the moment I am converting the XML to a python dictionary and after some element comparison and regular expression handling, writing the output again in XML format. I am not too happy with this and was wondering whether anyone can recommend a more efficient way of doing it? Thanks.

    Read the article

  • Using Color.rgb() doesnt work for full 0...255 range

    - by superflyninja
    I'm writing an android game using opengl. I'm using: colour = Color.rgb(theR,theG,theB); (all ints) to store the color of a rectangle. Then I parse out the RGB to render the rectangle: colorR = Color.red(color); colorG = Color.green(color); colorB = Color.blue(color); For example for color 53,130,255 this should result in a blue but on my app it results in a white. If i use 1,1,1 i get white. If i use 0,0,0 i get black. If i use 0,1,0 I get green etc. So it looks like any value over one is treated as 1 and so i am not getting the full 0...255 range. I tried using Color.argb and color = Color.parseColor(theColor) where the Color is a string. I'm using this in an opengles app. I have a class to display a rectangle of color. This definitely works fine as the correct size rectangle is rendered, just not a color using values above 1. I also use textures and everything displays fine. any ideas? thanks a million

    Read the article

  • Make div expand only horizontally when more floating divs are added to it

    - by Wesam
    I am trying to make a div that contains other floating divs to adjust its width such that adding more floating divs (dynamically using jQuery) will only expand the div in its width, not allowing the floating divs to create a new line. Therefore, I want to fix this issue such that each div with class grid-row only expands in width, and so I will be able to scroll using the overflow: scroll for the parent grid div. I have searched a lot for answers, and it seems that it is a famous issue. However, non of the answer solved my problem. I am currently doing this: <div id="grid_container"> <div id="grid"> <div class="grid_row"> <div class="module" id="experience"> Experience </div> <div class="header"> Google </div> <div class="header"> Microsoft </div> </div> <div class="grid_row"> </div> </div> </div> CSS: body { } #grid_container { margin: 50px auto; width: 500px; height: 500px; padding: 10px; border: black solid 1px; } #grid { overflow:scroll; height: 100%; } .grid_row { clear: both; height: 50px; } .module, .header{ padding: 10px; float: left; border: gray solid 1px; }

    Read the article

  • Drawing straight lines in JavaScript

    - by Shawn31313
    I'm just trying to draw a line with JavaScript. I would like it to be like this: http://deepliquid.com/projects/blog/arrows2.html My version: http://jsfiddle.net/shawn31313/qsWML/5/show Doesn't work too well and I don't know how to get it too work. It must be an issue in my JavaScript. This my code: $(document).ready(function() { var dragStatus = 2, getPos, giveRandomID; $(document).mousedown(function(event) { dragStatus = 0; getPos = { top: event.clientY, left: event.clientX }; giveRandomID = Math.floor(Math.random() * 99999); }); $(document).mousemove(function() { var line = $('#line' + giveRandomID); if (dragStatus == 0) { $('body').append("<div id='line" + giveRandomID + "' style='position:absolute;top:" + getPos.top + "px;left:" + getPos.left + "px;background:black;width:2px;height:5px'></div>"); dragStatus = 1; } if (dragStatus == 1) { if (event.clientX > getPos.left) { line.css({ left: getPos.left, width: event.clientX - getPos.left }); } else { line.css({ left: event.clientX, width: getPos.left - event.clientX }); } if (event.clientY > getPos.top) { line.css({ top: getPos.top - Math.abs((event.clientY - getPos.top) * 2), '-webkit-transform': 'rotate(' + (event.clientY - getPos.top) + 'deg)' }); } else { line.css({ top: getPos.top + Math.abs((getPos.top - event.clientY) * 2), '-webkit-transform': 'rotate(' + (getPos.top - event.clientY) + 'deg)' }); } //for DEG "-" Top-Math.abs(DEG*2) for Deg "+" Top+(DEG*2) } }); $(document).mouseup(function() { dragStatus = 2; }); });? Thanks for any help fixing this. Mainly an issue with the math, just don't know how I can fix this.

    Read the article

  • Rendering ListBox takes too long on Windows Phone

    - by Bhawk1990
    I am working on a Windows Phone 7 Application using Local SQLite Database and I'm having an issue with the rendering time of pages that use DataBinding. Currently it takes 60-70ms to retrieve the data from the database. Then it takes about 3100ms to render the data retrieved using a ListBox with DataBinding. Here you can see the DataTemplate of the ListBox: <DataTemplate x:Key="ListBoxItemTemplate"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="68" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <TextBlock x:Name="TimeColumn" Text="{Binding TimeSpan}" Grid.Column="0" Grid.Row="0" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" /> <TextBlock Text="{Binding Stop.StopName}" Grid.Column="1" Grid.Row="0" Margin="15,0,0,0" TextWrapping="NoWrap" Foreground="Black" HorizontalAlignment="Left" VerticalAlignment="Center" /> </Grid> </DataTemplate> Comment: I have tried it using Canvas instead of Grid too, same result. Then, the database loads data into a CSList (using ViciCoolStorage) and that gets Binded to the ListBox: StationList.ItemsSource = App.RouteViewModel.RouteStops; Comment: I have tried to add the elements of the CSList to an ObservableCollection and bind that to the interface but didn't seem to change anything. Question: Am I doing something wrong that results in a huge load time - even if just loading 10 elements -, or this is normal? Do you have any recommendations to get a better performance with DataBinding? Thank you for your answers in advance!

    Read the article

  • How to find "y" values of the already estimated monotone function of the non-monotone regression curve corresponding to the original "x" points?

    - by parenthesis
    The title sounds complicated but that is what I am looking for. Focus on the picture. ## data x <- c(1.009648,1.017896,1.021773,1.043659,1.060277,1.074578,1.075495,1.097086,1.106268,1.110550,1.117795,1.143573,1.166305,1.177850,1.188795,1.198032,1.200526,1.223329,1.235814,1.239068,1.243189,1.260003,1.262732,1.266907,1.269932,1.284472,1.307483,1.323714,1.326705,1.328625,1.372419,1.398703,1.404474,1.414360,1.415909,1.418254,1.430865,1.431476,1.437642,1.438682,1.447056,1.456152,1.457934,1.457993,1.465968,1.478041,1.478076,1.485995,1.486357,1.490379,1.490719) y <- c(0.5102649,0.0000000,0.6360097,0.0000000,0.8692671,0.0000000,1.0000000,0.0000000,0.4183691,0.8953987,0.3442624,0.0000000,0.7513169,0.0000000,0.0000000,0.0000000,0.0000000,0.1291901,0.4936121,0.7565551,1.0085108,0.0000000,0.0000000,0.1655482,0.0000000,0.1473168,0.0000000,0.0000000,0.0000000,0.1875293,0.4918018,0.0000000,0.0000000,0.8101771,0.6853480,0.0000000,0.0000000,0.0000000,0.0000000,0.4068802,1.1061434,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.0000000,0.6391678) fit1 <- c(0.5102649100,0.5153380934,0.5177234836,0.5255544980,0.5307668662,0.5068087080,0.5071001179,0.4825657520,0.4832969250,0.4836378194,0.4842147729,0.5004039310,0.4987301366,0.4978800742,0.4978042478,0.4969807064,0.5086987191,0.4989497612,0.4936121200,0.4922210302,0.4904593166,0.4775197108,0.4757040857,0.4729265271,0.4709141776,0.4612406896,0.4459316517,0.4351338346,0.4331439717,0.4318664278,0.3235179189,0.2907908968,0.1665721429,0.1474035158,0.1443999345,0.1398517097,0.1153991839,0.1142140393,0.1022584672,0.1002410843,0.0840033244,0.0663669309,0.0629119398,0.0627979240,0.0473336492,0.0239237481,0.0238556876,0.0084990298,0.0077970954,0.0000000000,-0.0006598571) fit2 <- c(-0.0006598571,0.0153328298,0.0228511733,0.0652889427,0.0975108758,0.1252414661,0.1270195143,0.1922510501,0.2965234797,0.3018551305,0.3108761043,0.3621749370,0.4184150225,0.4359301495,0.4432114081,0.4493565757,0.4510158144,0.4661865431,0.4744926045,0.4766574718,0.4796937554,0.4834718810,0.4836125426,0.4839450098,0.4841092849,0.4877317306,0.4930561638,0.4964939389,0.4970089201,0.4971376528,0.4990394601,0.5005881678,0.5023814257,0.5052125977,0.5056691690,0.5064254338,0.5115481820,0.5117259449,0.5146054557,0.5149729419,0.5184178197,0.5211542908,0.5216215426,0.5216426533,0.5239797875,0.5273573222,0.5273683002,0.5293994824,0.5295130266,0.5306236672,0.5307303109) ## picture plot(x, y) ## red regression curve points(x, fit1, col=2); lines(x, fit1, col=2) ## blue monotonic curve to the regression points(min(x) + cumsum(c(0, rev(diff(x)))), rev(fit2), col="blue"); lines(min(x) + cumsum(c(0, rev(diff(x)))), rev(fit2), col="blue") ## "x" original point matches with the regression estimated point ## but not with the estimated (fit2=estimate) monotonic curve abline(v=1.223329, lty=2, col="grey") Focus on the dashed grey line. The idea is to get y value of the monotonic blue curve corresponding to x original value. The grey line should cross three points (the original one "black", the regression estimate "red", the adjusted regression estimate "blue"). Can we do this? Methodology: The object "fit2" is the output of the function rearrangement(). It is always monotonically increasing. library(Rearrangement) fit2 <- rearrangement(x=as.data.frame(x), y=fit1)

    Read the article

  • Zoom in on a point (using scale and translate)

    - by csiz
    I want to be able to zoom in on the point under the mouse in canvas with the mouse whell, like when zooming on maps.google. I'd like straight code as I've been working on this for 5h+ Something to start with: <canvas id="canvas" width="800" height="600"></canvas> <script type="text/javascript"> var canvas = document.getElementById("canvas"); var context = canvas.getContext("2d"); var scale = 1; var originx = 0; var originy = 0; function draw(){ context.fillStyle = "white"; context.fillRect(originx,originy,800/scale,600/scale); context.fillStyle = "black"; context.fillRect(50,50,100,100); } setInterval(draw,100); canvas.onmousewheel = function (event){ var mousex = event.clientX - canvas.offsetLeft; var mousey = event.clientY - canvas.offsetTop; var wheel = event.wheelDelta/120;//n or -n var zoom = 1 + wheel/2; scale *= zoom; originx += 0;//??? originy += 0;//??? context.scale(zoom,zoom); context.translate(0,0);//??? } </script>

    Read the article

< Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >