Search Results

Search found 31491 results on 1260 pages for 'simple talk'.

Page 96/1260 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • Is there a way to do simple calculations in a xaml element binding statement other than using a conv

    - by Jonathan Websdale
    In XAML I want to bind the height of one element to be half the height of another element. Is there a way to do this that doesn't involve writing a converter in the code-behind? Example:- What I've got... <Button Name="RemoveButton" Content="Remove Stage" Width="100" Height="{Binding ElementName=AddButton, Path=Height, Converter={StaticResource MyHalfHeightConverter}}"/> What I'd like... <Button Name="RemoveButton" Content="Remove Stage" Width="100" Height="{Binding ElementName=AddButton, Path=(Height / 2.0)}"/>

    Read the article

  • Segmentation fault when enabling optimization in a simple GTK+ application?

    - by gatopeich
    Might be that it is too late, but I find it at least curious that the following few lines seem to be causing a segmentation fault if and only when compiled with gcc's optimization, even "-O1"! settings_dialog = gtk_dialog_new_with_buttons("gatotray Settings" , NULL, 0, GTK_STOCK_CANCEL, FALSE, GTK_STOCK_SAVE, TRUE, 0); g_signal_connect(G_OBJECT(settings_dialog), "response", G_CALLBACK(gtk_widget_destroy), NULL); g_signal_connect(G_OBJECT(settings_dialog), "destroy", G_CALLBACK(settings_destroyed), NULL); GtkWidget *vb = gtk_dialog_get_content_area(GTK_DIALOG(settings_dialog)); GtkWidget *hb = gtk_hbox_new(FALSE, 3); gtk_container_add(GTK_CONTAINER(hb), gtk_label_new("Background:")); GtkWidget *cb = gtk_color_button_new(); gtk_container_add(GTK_CONTAINER(hb), cb); gtk_container_add(GTK_CONTAINER(vb), hb); This is the backtrace: (gdb) backtrace #0 0x00007ffff4d88052 in ?? () from /lib/libc.so.6 #1 0x00007ffff5304112 in g_strdup () from /lib/libglib-2.0.so.0 #2 0x00007ffff5bc799d in ?? () from /usr/lib/libgobject-2.0.so.0 #3 0x00007ffff5ba826c in g_object_new_valist () from /usr/lib/libgobject-2.0.so.0 #4 0x00007ffff5ba84f1 in g_object_new () from /usr/lib/libgobject-2.0.so.0 #5 0x00007ffff78502d5 in gtk_button_new_from_stock () from /usr/lib/libgtk-x11-2.0.so.0 #6 0x00007ffff787cc95 in gtk_dialog_add_button () from /usr/lib/libgtk-x11-2.0.so.0 #7 0x00007ffff787cd60 in ?? () from /usr/lib/libgtk-x11-2.0.so.0 #8 0x00007ffff787cf60 in gtk_dialog_new_with_buttons () from /usr/lib/libgtk-x11-2.0.so.0 #9 0x0000000000402bb9 in show_settings_dialog () at settings.c:24 #10 0x0000000000403328 in main (argc=1, argv=0x7fffffffe2b8) at gatotray.c:286 ... settings.c:24 is exactly the first line listed above, seems like "gtk_dialog_new_with_buttons" is the culprit... Versions: gcc: 4.4.3 GTK+: 2.20.1 BTW, forgot to mention that commenting out certain lines after the conflictive call prevents it from happening. Particularly the line with "gtk_container_add(GTK_CONTAINER(hb), cb);" I tried almost all suitable combinations of GtkTypes/GTK_MACROS, it makes no difference.

    Read the article

  • simple jquery callback works on .net3.5 but nothing fires on .net 2.0?

    - by CliffC
    hi i have the following jquery postback method on the client <%@ Page Language="C#" AutoEventWireup="true" CodeFile="CallServerWithParameters.aspx.cs" Inherits="CallServerWithParameters" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="jquery-1.2.6.js" type="text/javascript"></script> <script language="javascript"> $(document).ready(function() { $("#txtNoOfMales").change(function() { var ticketRequired = this.value; var options = { type: "POST", url: "CallServerWithParameters.aspx/GetAvailableTicketsForMales", data: "{no:'" + ticketRequired + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(response) { if (response.d != "") { alert(response.d); $("#txtNoOfMales").focus(); } } }; //Call the PageMethods $.ajax(options); }); }); </script> </head> <body> <form id="form1" runat="server"> <div> No of Male Tickets:<asp:TextBox ID="txtNoOfMales" runat="server"></asp:TextBox> </div> </form> </body> </html> and the following web method on the server side using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Services; public partial class CallServerWithParameters : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } [WebMethod] public static string GetAvailableTicketsForMales(int no) { string result = ""; int NoOfTicketsAvailable = 5; if (no > NoOfTicketsAvailable) { result = "Only " + NoOfTicketsAvailable.ToString() + " Male ticket(s) avaialable. Please eneter a lower number!"; } return result; } } problem is everything works fine on .net 3.5 but if i use the same code on .net 2.0 the webmethod event does not get call at all, anybody have any idea what i did wrong? thanks updated with full source code

    Read the article

  • I need a simple Example of JNA which can map char * of c dll.

    - by Vikas Sharma
    I have one dll of cpp and i need to call its function which returns char*. Im using String in native Declaration but getting out put like ???? or some crap thing. I just want to knw that do i have to decode the String.i have already set my system property like System.setProperty("jna.encoding","UTF-8"); Im in big mess. Hope to get Some Positive replies from u guys. Thanks in Advance.. Cheers...!

    Read the article

  • Simple NLP: How to use ngram to do word similarity?

    - by sadawd
    Dear Everyone, I Hear that google uses up to 7-grams for their own data. I am interested in finding words that are similar in context (i.e. cat and dog) and I was wondering how do I compute the similarity of two words on a n-gram model given that n 2. Given a sample set like this forexample: (I, love cats), (cats, loves, dogs), (dogs, hate, human) What is a good way to compare the similarity of this pair (I, cats)? Also does anyone know of anyway to do levels for NLP? like: Army-Military-Solider ?

    Read the article

  • Simple way to use Foreign Key values for sorting?

    - by Brian Rizzo
    Disclaimer: I jumped to C# 2008 recently and SubSonic 3 (3.0.0.4) at the same time. I haven't used Linq for much of anything in the past. Is there an easy way to use the foreign key display value for sorting, rather than the FK Id (which is numeric)? I've added a new Find method in my ActiveRecord.tt to help with sorting based on a string field name but after doing some testing I realized that even though its working as it should be, I am not handling foreign key fields at all (they are just sorting by their value). Even if I need to change how I am accessing the data it is early enough in the project to do that. Just looking for suggestions.

    Read the article

  • How do I make a simple image-based button with visual states in Silverlight 3?

    - by Jacob
    At my previous company, we created our RIAs using Flex with graphical assets created in Flash. In Flash, you could simply lay out your graphics for different states, i.e. rollover, disabled. Now, I'm working on a Silverlight 3 project. I've been given a bunch of images that need to serve as the graphics for buttons that have a rollover, pressed, and normal state. I cannot figure out how to simply create buttons with different images for different visual states in Visual Studio 2008 or Expression Blend 3. Here's where I am currently. My button is defined like this in the XAML: <Button Style="{StaticResource MyButton}"/> The MyButton style appears as follows: <Style x:Key="MyButton" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Image Source="/Assets/Graphics/mybtn_up.png" Width="54" Height="24"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused"/> <VisualState x:Name="Unfocused"/> </VisualStateGroup> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"/> <VisualState x:Name="MouseOver"/> <VisualState x:Name="Pressed"/> <VisualState x:Name="Disabled"/> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Image> </ControlTemplate> </Setter.Value> </Setter> </Style> I cannot figure out how to assign a different template to different states, nor how to change the image's source based on which state I'm in. How do I do this? Also, if you know of any good documentation that describes how styles work in Silverlight, that would be great. All of the search results I can come up with are frustratingly unhelpful. Edit: I found a way to change the image via storyboards like this: <Style x:Key="MyButton" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Image Source="/Assets/Graphics/mybtn_up.png" Width="54" Height="24" x:Name="Image"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="FocusStates"> <VisualState x:Name="Focused"/> <VisualState x:Name="Unfocused"/> </VisualStateGroup> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal"/> <VisualState x:Name="MouseOver"> <Storyboard Storyboard.TargetName="Image" Storyboard.TargetProperty="Source"> <ObjectAnimationUsingKeyFrames> <DiscreteObjectKeyFrame KeyTime="0" Value="/Assets/Graphics/mybtn_over.png"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Pressed"> <Storyboard Storyboard.TargetName="Image" Storyboard.TargetProperty="Source"> <ObjectAnimationUsingKeyFrames> <DiscreteObjectKeyFrame KeyTime="0" Value="/Assets/Graphics/mybtn_active.png"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <VisualState x:Name="Disabled"/> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Image> </ControlTemplate> </Setter.Value> </Setter> </Style> However, this seems like a strange way of doing things to me. Is there a more standard way of accomplishing this?

    Read the article

  • Very simple jquery ui drag and drop does not work. Why not?

    - by Catfish
    WHy doesn't this work? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> #content { background:#CCCCCC; width:500px; height:500px; } #drop { height:200px; width:200px; background:#00FFFF; float:right; } #drag { background:#009966; width:100px; height:100px; float:left; } .active { background:#FFCC33; } </style> <script type="text/ecmascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#drag').draggable({ containment: '#content', scrollSensitivity: 60, revert: true, cursor: 'move' }); $('#drop').droppable({ accept: '#drag', drop: function(event, ui) { $(this).addClass('.active'); } }); }); </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div id="content"> <div id="drag"> </div> <div id="drop"> </div> </div> </body> </html>

    Read the article

  • Design Help! How can design Extended properties for Entity with simple and complex data in extended

    - by mmtemporary
    I have design question. I have entity such as "Person". Person has properties such as: FirstName, LastName, Gender, BirthDate, .... End user when create a person in application may be need to define another property that is not defined in database table schema (or class person). for example: end user nead to define "property1" that its a string property. or nead define "proerty2" that its a image, or need define "property3" that its complex type. please separate your design solution in tow level: 1-database table design 2-class design thank u.

    Read the article

  • How do I do this simple 301 redirect from index.htm to root?

    - by elliot100
    I've read various reference sites on redirection, and to be honest I understand very little. I currently have standard WordPress mod_rewrite redirect rules in my .htaccess: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress (1) Quite a few of my referrers go to a old URL http://www.example.com/index.htm, which gives them an error, and I want them to be redirected to http://www.example.com/ What do I need to do?

    Read the article

  • Is there a way to increase performance on my simple textfilter?

    - by djerry
    Hey guys, I'm writing a filter that will pick out items. I have a list of Objects. The objects contain a number, name and some other irrelevant items. At the moment, the list contains 200 items. When typing in a textbox, i'm looking if the string matches a part of the number/name of the objects in the list. If so, add them to the listbox. Here's the code for my textbox textchanged event : private void txtTelnumber_TextChanged(object sender, TextChangedEventArgs e) { lstOverview.Items.Clear(); string data = ""; foreach (ucTelListItem telList in _allUsers) { data = telList.User.H323 + telList.user.E164; if (data.Contains(txtTelnumber.Text)) lstOverview.Items.Add(telList); } } I sometimes see a little delay when entering a character, especially when i go from 4 records to 200 records (so when i had a filter and 4 records matched, and i backspace and the whole list appears again). My list is a list of usercontrols, cause i found it takes less time to load the usercontrols from a list, then to have to initialize a new usercontrol each time. Can i do something about the code, or is it just adding the usercontrol the listbox that causes the small delay (small delay = <1 sec)? Thanks in advance.

    Read the article

  • Is marshaling/ serialization in PHP as simple as serialize($var) ?

    - by Ygam
    here's a definition of marshaling from Wikipedia: In computer science, marshalling (similar to serialization) is the process of transforming the memory representation of an object to a data format suitable for storage or transmission. It is typically used when data must be moved between different parts of a computer program or from one program to another. I have always done data serialization in php via its serialize function, usually on objects or arrays. But how is wikipedia's definition of marshaling/serialization takes place in this serizalize() function?

    Read the article

  • Any simple Java way to pass parts of a hashmap to another hashmap?

    - by Arvanem
    Hi folks, For my trading program, a Merchant object has a qualities HashMap of enumerated Qualities with Boolean values. public class Merchants { private Map<Qualities, Boolean> qualities = new HashMap<Qualities, Boolean>(); I would like to give each Merchant object a further ratedQualities HashMap of True Qualities with Byte or Integer values representing the Rating of those Qualities. For example, a given Merchant could have a "1" Rating associated with their True Stockbroking Quality. The problem is Java does not let me do this easily. The following code demonstrates my intentions but doesn't compile: private Map<qualities-TRUE, Byte> ratedQualities = new HashMap<qualities-TRUE, Byte>(); According to this link text one solution is to create a Wrapper for the qualities HashMap. Is this the only solution or is there a better way? Thanks in advance for your help.

    Read the article

  • Castor: how to map a simple list of strings?

    - by Dmitriy
    I have the following field in my class: private List<String> messages; Here's the mapping I have: <field name="messages" collection="arraylist" type="string" container="false> <bind-xml name="errors" node="element"/> </field> This is what I get as a result of marshalling: <errors><string>message1</string><string>message2</string></errors> And this is what I want to achieve: <errors><error>message1</error><error>message2</error></errors> Any help is appreciated!

    Read the article

  • For programming content, what simple-to-use-and-setup PHP based blog are the preferred ones?

    - by Johann Gerell
    I've since long wanted a place I can toss my programming related nuggets at. Every day I feel I solve something that I'll surely hit again in a not so distant future, but by then I most certainly will have forgotten about the previous solution I came up with. So I need to blog it down, quick and dirty, for my own documentation and memory's sake. Must be easy to set up and use. Must handle code syntax and highlighting gracefully for a number of languages, but mainly C# and C++. Must be PHP-based, because that's what my host supplies. I know and have used WordPress (not for code, though), but is it really what I want or need?

    Read the article

  • Can a simple web form like this get hacked?

    - by Haskella
    Hi I have a web form that sends a string to one php file which redirects them to a corresponding URL. I've searched about web form hacking and I've only received information about PHP and SQL... my site only uses a single PHP file, very basic etc. Would it be open to any exploits? I'm obviously not going to post the URL, but here is some code I was working on for the php file: http://stackoverflow.com/questions/2888077/newbie-php-coding-problem-header-function-maybe-i-need-someone-to-check-my-cod Thanks

    Read the article

  • how do I get foreign_key to work in this simple has_many, belongs_to relationship?

    - by rpflo
    I'm pulling data from Harvest. Here are my two models and schema: # schema create_table "clients", :force => true do |t| t.string "name" t.integer "harvest_id" end create_table "projects", :force => true do |t| t.string "name" t.integer "client_id" t.integer "harvest_id" end # Client.rb has_many :projects, :foreign_key => 'client_id' # not needed, I know # Project.rb belongs_to :client, :foreign_key => 'harvest_id' I'm trying to get the Projects to find their client by matching Project.client_id to a Client.harvest_id. Here is what I'm getting instead. > Project.first.client_id => 187259 Project.first.client => nil Client.find(187259).projects => [] Is this possible? Thanks!

    Read the article

  • Suggested (simple) approach for drawing large numbers of visual elements in WPF?

    - by Ender
    I'm writing an interface that features a large (~50000px width) "canvas"-type area that is used to display a lot of data in a fairly novel way. This involves lots of lines, rectangles, and text. The user can scroll around to explore the entire canvas. At the moment I'm just using a standard Canvas panel with various Shapes placed on it. This is nice and easy to do: construct a shape, assign some coordinates, and attach it to the Canvas. Unfortunately, it's pretty slow (to construct the children, not to do the actual rendering). I've looked into some alternatives, it's a bit intimidating. I don't need anything fancy - just the ability to efficiently construct and place objects in a coordinate plane. If all I get are lines, colored rectangles, and text, I'll be happy. Do I need Geometry instances inside of Geometry Groups inside of GeometryDrawings inside of some Panel container? Note: I'd like to include text and graphics (i.e. colored rectangles) in the same space, if possible.

    Read the article

  • How To use Simple Html Video Player Also Have Rewind Forward Capability For The Next Video ?? PHP HTML

    - by Syed Raza
    i am trying to use this code for video in html but fistle it is for flash videos and second thing is that it do not have rewind forward capability for the next video clip my code is, <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="250" height="250" align="middle"> <param name="allowScriptAccess" value="sameDomain"/> <param name="movie" value="Pro Tools Tutorials.swf"/> <param name="quality" value="high"/> <param name="bgcolor" value="#000000"/> <param name="allowFullScreen" value="true"/> <embed src="/unknittingmouse1.swf" quality="high" align="middle" bgcolor="#ffffff" width="250" height="230" allowFullScreen="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed> </object> we have to also be carefull that that video code will run on internet explorer Hopes to listen from you soon, thanks in advance

    Read the article

  • Get the "source network address" in Event ID 529 audit entries on Windows XP

    - by Make it useful Keep it simple
    In windows server 2003 when an Event 529 (logon failure) occures with a logon type of 10 (remote logon), the source network IP address is recorded in the event log. On a windows XP machine, this (and some other details) are omitted. If a bot is trying a brute force over RDP (some of my XP machines are (and need to be) exposed with a public IP address), i cannot see the originating IP address so i don't know what to block (with a script i run every few minutes). The DC does not log this detail either when the logon attempt is to the client xp machine and the DC is only asked to authenticate the credentials. Any help getting this detail in the log would be appreciated.

    Read the article

  • Is any simple way to create method and set its body dynamically in C#?

    - by greatromul
    I hold body of method in string. I want to create method dynamically. But I don't know, how to set its body. I saw very tedious way using CodeDom. And I saw using Emit with OpCodes. Is any way to use ready code from string variable? string method_body = "return \"Hello, world!\";"; //there is method body DynamicMethod dm = new System.Reflection.Emit.DynamicMethod("My_method", typeof(string), new Type[] { }); //any way to create method dynamically //any way to set body string result = (string)dm.Invoke(...); //I need write result in variable

    Read the article

  • How can I get a file's upload size using simple Javascript?

    - by Pankaj Khurana
    I have upload file functionality on one of the page. I check for the extension of the file using JavaScript. Now i want to restrict the user from uploading file greater than 1 MB. Is there any way i can check the file upload size using JavaScript. My code currently look like this: <script language="JavaScript"> function validate() { var filename = document.getElementById("txtChooseFile").value; var ext = getExt(filename); if(ext == "txt" || ext == "csv") return true; alert("Please upload Text files only."); return false; } function getExt(filename) { var dot_pos = filename.lastIndexOf("."); if(dot_pos == -1) return ""; return filename.substr(dot_pos+1).toLowerCase(); } </script>

    Read the article

  • Why doesn't this simple regex match what I think it should?

    - by Kevin Stargel
    I have a data file that looks like the following example. I've added '%' in lieu of \t, the tab control character. 1234:56% Alice Worthington alicew% Jan 1, 2010 10:20:30 AM% Closed% Development Digg: Reddit: Update%% file-one.txt% 1.1% c:/foo/bar/quux Add%% file-two.txt% 2.5.2% c:/foo/bar/quux Remove%% file-three.txt% 3.4% c:/bar/quux Update%% file-four.txt% 4.6.5.3% c:/zzz ... many more records of the above form The records I'm interested in are the lines beginning with "Update", "Add", "Remove", and so on. I won't know what the lines begin with ahead of time, or how many lines precede them. I do know that they always begin with a string of letters followed by two tabs. So I wrote this regex: generate-report-for 1234:56 | egrep "^[[:alpha:]]+\t\t.+" But this matches zero lines. Where did I go wrong? Edit: I get the same results whether I use '...' or "..." for the egrep expression, so I'm not sure it's a shell thing.

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >