Search Results

Search found 4763 results on 191 pages for 'adams john'.

Page 125/191 | < Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >

  • Preloading images in HTML, is there a more modern way?

    - by John
    I have an image loaded by JS on a mouse event. It's a fairly big image so I want to make sure it gets pre-loaded. I reemmber some old techniques from years ago and found this example: <SCRIPT LANGUAGE = JAVASCRIPT> if (document.images) { img1 = new Image(); img2 = new Image(); img1.src = "imageName1.gif"; img2.src = "imageName2.gif" } </SCRIPT> I wondered if this is still good/relevant, or maybe browsers automatically detect unused images and preload them anyway? Note my page has to support IE6, so I might still need older techniques anyway, but I'm still interested if more modern browsers have a better way?

    Read the article

  • comparing multidimensional array

    - by John K
    Hello everyone, I have the following array: Array ( [0] => Array ( [0] => 87 [1] => 55 [2] => 85 [3] => 86 ) [1] => Array ( [0] => 58 [1] => 84 ) [2] => Array ( [0] => 58 ) ) This array above is an example. The actual array is of variable size, but structured like this. Basically, I'd like to run array_intersect on each second level array and grab the value (number) that is common between them. In this case, it would be 58. I'm not quite sure where to start on this. Any advice?

    Read the article

  • Can you use Win32 GUI in a browser plugin?

    - by John
    Of course it would mean you're plugin is not cross-platform but let's focus on the technical side... Is a browser plugin (like done in NPAPI) restricted in what it can do? Or do you get fairly free reign to access the PC and the render-window you're given? For instance can you create Win32/MFC controls in your browser this way? A side question - is your browser plugin conceptually akin to a .DLL, which is therefore just arbitrary compiled code implementing a specific interface for browser control/communication?

    Read the article

  • short-cutting equality checking in F#?

    - by John Clements
    In F#, the equality operator (=) is generally extensional, rather than intensional. That's great! Unfortunately, it appears to me that F# does not use pointer equality to short-cut these extensional comparisons. For instance, this code: type Z = MT | NMT of Z ref // create a Z: let a = ref MT // make it point to itself: a := NMT a // check to see whether it's equal to itself: printf "a = a: %A\n" (a = a) ... gives me a big fat segmentation fault[*], despite the fact that 'a' and 'a' both evaluate to the same reference. That's not so great. Other functional languages (e.g. PLT Scheme) get this right, using pointer comparisons conservatively, to return 'true' when it can be determined using a pointer comparison. So: I'll accept the fact that F#'s equality operator doesn't use short-cutting; is there some way to perform an intensional (pointer-based) equality check? The (==) operator is not defined on my types, and I'd love it if someone could tell me that it's available somehow. Or tell me that I'm wrong in my analysis of the situation: I'd love that, too... [*] That would probably be a stack overflow on Windows; there are things about Mono that I'm not that fond of...

    Read the article

  • Does HTML5 only replace the video aspects of Flash/Silverlight?

    - by John
    I see a lot of talk how HTML5 video tag will kill Flash. But while video is the most widely used part of Flash/SL, it's only a small part of their technical abilities. For instance you can write a game using full 3D graphics and socket connections in Flex, and serious business applications, etc. Is the thinking that Javascript will kill those parts of Flash/Flex/SL? Because while that seems feasible now for even quite rich web-apps, what about any kind of high-performance app like real-time graphics?

    Read the article

  • django filefield return filename only in template

    - by John
    I've got a field in my model of type FileField. This gives me an object of type type File, which has the following method: File.name: The name of the file including the relative path from MEDIA_ROOT. What I want is something like .filename that will only give me the filename and not the path as well something like: {% for download in downloads %} <div class="download"> <div class="title">{{download.file.filename}}</div> </div> {% endfor %} which would give something like myfile.jpg thanks

    Read the article

  • Django admin - remove field if editing an object

    - by John McCollum
    I have a model which is accessible through the Django admin area, something like the following: # model class Foo(models.Model): field_a = models.CharField(max_length=100) field_b = models.CharField(max_length=100) # admin.py class FooAdmin(admin.ModelAdmin): pass Let's say that I want to show field_a and field_b if the user is adding an object, but only field_a if the user is editing an object. Is there a simple way to do this, perhaps using the fields attribute? If if comes to it, I could hack a JavaScript solution, but it doesn't feel right to do that at all!

    Read the article

  • Does window.open not work inside an AIR html component?

    - by John Isaacks
    I have a component in AIR like so: <mx:HTML id="html" width="100%" height="100%" location="https://example.com" locationChange="dispatchLocationChange(event)" /> The page it loads contains this: <a onclick="alert('onclick')">Alert</a> <a href="javascript:alert('js')">Alert</a> <a onclick="window.open('http://www.google.com','_blank')">new window</a> The 2 alerts both work. however nothing happens when you click the new window link. all 3 links works when in a real browser so I know its ok. Is there just no support for window.open in the AIR HTML component? or is this a bug? Is there a work around?

    Read the article

  • adding org.springframework.test package to spring-2.5.6-SEC01.jar in netbeans

    - by John
    This is probably very simple, however I can't get this to work. I want to use AbstractDependencyInjectionSpringContextTest class which is in org.springframework.test package. This package is not included in Netbeans' spring library, so I want to add it. So what I have tried so far is: copy and paste "test" directory (downloaded from spring) into the Netbeans' spring-2.5.6-SEC01.jar file (copy it to org.springframework directory in that jar so I can use org.springframework.test to import it). If I go to project/libraries in Netbeans it is there, but when I try to import org.springframework.test.*; the autocomplition doesn't give me the option to choose test directory from org.soringframework package. create a new library which points to "test" directory and add it to the project- as there is no any jar file in "test" I'm not sure what path should I use to import it. I'm pretty sure this is something very simple but I'm still a novice and can't figure this out.

    Read the article

  • c++: use a #define in printf?

    - by John
    I was wanting to use a constant of some kind for the application ID (so I can use it in printf). I had this: #define _APPID_ "Hello World!" And then the simple printf, calling it into %s (string). It put this out: simple.cpp:32: error: cannot convert ‘_IO_FILE*’ to ‘const char*’ for argument ‘1’ to ‘int printf(const char*, ...)’ What would I use to define the application ID to use in printf? I tried: static const char _APPID_[] = "Hello World"` but it didn't work, same error I think.

    Read the article

  • Better code for accessing fields in a matlab structure array?

    - by John
    I have a matlab structure array Modles1 of size (1x180) that has fields a, b, c, ..., z. I want to understand how many distinct values there are in each of the fields. i.e. max(grp2idx([foo(:).a])) The above works if the field a is a double. {foo(:).a} needs to be used in the case where the field a is a string/char. Here's my current code for doing this. I hate having to use the eval, and what is essentially a switch statement. Is there a better way? names = fieldnames(Models1); for ix = 1 : numel(names) className = eval(['class(Models1(1).',names{ix},')']); if strcmp('double', className) || strcmp('logical',className) eval([' values = [Models1(:).',names{ix},'];']); elseif strcmp('char', className) eval([' values = {Models1(:).',names{ix},'};']); else disp(['Unrecognized class: ', className]); end % this line requires the statistics toolbox. [g, gn, gl] = grp2idx(values); fprintf('%30s : %4d\n',names{ix},max(g)); end

    Read the article

  • Converting c++ string to int

    - by skazhy
    Hi! I have the following data in a c++ string John Doe 01.01.1970 I need to extract the date and time from it into int variables. I tried it like this: int last_space = text_string.find_last_of(' '); int day = int(text_string.substr(last_space + 1, 2)); But I got invalid cast from type ‘std::basic_string’ to type ‘int’. When I extract the "John Doe" part in another string variable, all works fine. What's wrong? I am trying to compile it with g++ -Wall -Werror.

    Read the article

  • Sorting issues in flexigrid with "json" data

    - by John Sieber
    I'm currently using flexigrid to display data in a current project, but am running into issues with its ability to properly sort certain columns that contain dates or numbers. The data is being sent from a ColdFusion CFC that selects the appropriate data and then delivers it in the proper "json" format. As the date/time stamps and other fields containing numbers are sent as "strings" they do not sort properly in the data grid. Is this a limitation of Flexigrid or am I sending the data improperly to Flexigrid? I can provide examples of my code if that is helpful.

    Read the article

  • Is it possible to open a context menu from a map overlay item in android?

    - by John Nicholson
    This below code works fine opening an alert dialog. I was wondering if it's possible to open a context menu from within a map overlay class? @Override protected boolean onTap(int index) { OverlayItem item = mOverlays.get(index); AlertDialog.Builder dialog = new AlertDialog.Builder(mContext); dialog.setTitle(item.getTitle()); dialog.setMessage(item.getSnippet()); dialog.show(); return true; }

    Read the article

  • Where do I control the behavior of the "X" close button in the upper right of a winform?

    - by John at CashCommons
    I'm venturing into making my VB.NET application a little better to use by making some of the forms modeless. I think I've figured out how to use dlg.Show() and dlg.Hide() instead of calling dlg.ShowDialog(). I have an instance of my modeless dialog in my main application form: Public theModelessDialog As New dlgModeless To fire up the modeless dialog I call theModelessDialog.Show() and within the OK and Cancel button handlers in dlgModeless I have Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click Me.DialogResult = System.Windows.Forms.DialogResult.OK Me.Hide() End Sub Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click Me.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.Hide() End Sub and that seems to work fine. The "X" button in the upper right is getting me, though. When I close the form with that button, then try to reopen the form, I get ObjectDisposedException was unhandled. Cannot access a disposed object. I feel like I'm most of the way there but I can't figure out how to do either of the following: Hide that "X" button Catch the event so I don't dispose of the object (just treat it like I hit Cancel) Any ideas? The class of this dialog is System.Windows.Forms.Form. Thanks as always!

    Read the article

  • Using my custom colormap in Java for images

    - by John
    Hi everyone! I've got a question concering a colormapping via index. I tried this code found on http://www.podgoretsky.pri.ee/ftp/Docs/Java/Tricks%20of%20the%20Java%20Programming%20Gurus/ch12.htm // Gradient.java // Imports import java.applet.Applet; import java.awt.; import java.awt.image.; public class Gradient extends Applet { final int colors = 32; final int width = 200; final int height = 200; Image img; public void init() { // Create the color map byte[] rbmap = new byte[colors]; byte[] gmap = new byte[colors]; for (int i = 0; i < colors; i++) gmap[i] = (byte)((i * 255) / (colors - 1)); // Create the color model int bits = (int)Math.ceil(Math.log(colors) / Math.log(2)); IndexColorModel model = new IndexColorModel(bits, colors, rbmap, gmap, rbmap); // Create the pixels int pixels[] = new int[width * height]; int index = 0; for (int y = 0; y < height; y++) for (int x = 0; x < width; x++) pixels[index++] = (x * colors) / width; // Create the image img = createImage(new MemoryImageSource(width, height, model, pixels, 0, width)); } public void paint(Graphics g) { g.drawImage(img, 0, 0, this); } } It worked great but I tried to load a custom image jpeg mapped on my own colormap but it didnt work right. I saw only a bunch of green and blue pixels drawn on a white background. My custom color map method here: public void inintByteArrays() { double[][] c = // basic color map { { 0.0000, 0.0000, 0.5625 }, { 0.0000, 0.0000, 0.6250 }, { 0.0000, 0.0000, 0.6875 }, { 0.0000, 0.0000, 0.6875 }, { 0.0000, 0.0000, 0.7500 }, { 0.0000, 0.0000, 0.8125 }, { 0.0000, 0.0000, 0.8750 }, { 0.0000, 0.0000, 0.9375 }, { 0.0000, 0.0000, 1.0000 }, { 0.0000, 0.0625, 1.0000 }, { 0.0000, 0.1250, 1.0000 }, { 0.0000, 0.1875, 1.0000 }, { 0.0000, 0.2500, 1.0000 }, { 0.0000, 0.3125, 1.0000 }, { 0.0000, 0.3750, 1.0000 }, { 0.0000, 0.4375, 1.0000 }, { 0.0000, 0.5000, 1.0000 }, { 0.0000, 0.5625, 1.0000 }, { 0.0000, 0.6250, 1.0000 }, { 0.0000, 0.6875, 1.0000 }, { 0.0000, 0.7500, 1.0000 }, { 0.0000, 0.8125, 1.0000 }, { 0.0000, 0.8750, 1.0000 }, { 0.0000, 0.9375, 1.0000 }, { 0.0000, 1.0000, 1.0000 }, { 0.0625, 1.0000, 0.9375 }, { 0.1250, 1.0000, 0.8750 }, { 0.1875, 1.0000, 0.8125 }, { 0.2500, 1.0000, 0.7500 }, { 0.3125, 1.0000, 0.6875 }, { 0.3750, 1.0000, 0.6250 }, { 0.4375, 1.0000, 0.5625 }, { 0.5000, 1.0000, 0.5000 }, { 0.5625, 1.0000, 0.4375 }, { 0.6250, 1.0000, 0.3750 }, { 0.6875, 1.0000, 0.3125 }, { 0.7500, 1.0000, 0.2500 }, { 0.8125, 1.0000, 0.1875 }, { 0.8750, 1.0000, 0.1250 }, { 0.9375, 1.0000, 0.0625 }, { 1.0000, 1.0000, 0.0000 }, { 1.0000, 0.9375, 0.0000 }, { 1.0000, 0.8750, 0.0000 }, { 1.0000, 0.8125, 0.0000 }, { 1.0000, 0.7500, 0.0000 }, { 1.0000, 0.6875, 0.0000 }, { 1.0000, 0.6250, 0.0000 }, { 1.0000, 0.5625, 0.0000 }, { 1.0000, 0.5000, 0.0000 }, { 1.0000, 0.4375, 0.0000 }, { 1.0000, 0.3750, 0.0000 }, { 1.0000, 0.3125, 0.0000 }, { 1.0000, 0.2500, 0.0000 }, { 1.0000, 0.1875, 0.0000 }, { 1.0000, 0.1250, 0.0000 }, { 1.0000, 0.0625, 0.0000 }, { 1.0000, 0.0000, 0.0000 }, { 0.9375, 0.0000, 0.0000 }, { 0.8750, 0.0000, 0.0000 }, { 0.8125, 0.0000, 0.0000 }, { 0.7500, 0.0000, 0.0000 }, { 0.6875, 0.0000, 0.0000 }, { 0.6250, 0.0000, 0.0000 }, { 0.5625, 0.0000, 0.0000 }, { 0.5000, 0.0000, 0.0000 } }; for (int i = 0; i < c.length; i++) { for (int j = 0; j < c[i].length; j++) { if (j == 0) r[i] = (byte) ((byte) c[i][j]*255); if (j == 1) g[i] = (byte) ((byte) c[i][j]*255); if (j == 2) b[i] = (byte) ((byte) c[i][j]*255); } } My question is how I can use my colormap for any image I want to load and map in the right way. Thank you very much! Greetings, protein1.

    Read the article

  • Templating Word Documents in C#

    - by NullGeo
    I was wondering if there is a library out there such that it could give me the ability to fill in word templates with custom values. For example: Following could be the content of the Word Document {Address} {PhoneNumber} Hello {Name}, How are you doing? In C# I would like to do something like this to replace all the placeholders in the Word document: using(WordDocument doc = WordDocument.Load("Mail.docx")){ var person = new {Name = "John Smith", Address="42 Wallaby Way, Sydney", PhoneNumber="555-555-5555"}; doc.Template(person); doc.Print(); } The resulting document would look like this: 42 Wallaby Way, Sydney 555-555-5555 Hello John Smith, How are you doing? Any libraries out there (preferably free) that let's me do this? Edit: I am not asking you to find anything that let's me do this. If that was the case, I would do a Google search by myself. Honestly, all I am asking is "has anybody used a library in the past to do this exact thing."

    Read the article

  • VisualStudio: Toggle Archive Attribute When Saving File?

    - by John Dibling
    We use Tortoise CVS in out shop, but in my last job we used Visual SourceSafe. VSS is generally a pile, but it did have one nice feature. You could right-click on a branch and ask it for a list of all the files you had checked-out. As far as I can tell there is no similar feature in CVS. So what I'm looking for is some kind of VS plusgin that will automatically reset (turn off) the archive attribute when saving a file. Then I can recursively dir to find the files I have checked-out. Does anyone know of a VS plugin or something I can do to get this behavior? Or is there something else I can do in CVS to get my ultimately desired result?

    Read the article

  • Alert team members of SVN commit?

    - by John
    I'm hosting my own svn repository on ubuntu 8.04. Is there a way for svn to send emails to team members whenever a commit has happened? If coding is required, the only language I'm able to use on a linux server is PHP. So I could write a php script to be triggered by svn. Can anyone tell me how to hook up my php script to an svn commit? Or is there another way to do this?

    Read the article

  • PHP - How to determine if request is coming from a specific file.

    - by John
    I have fileA.php on SERVER_A and fileB.php on SERVER_B fileB.php makes a curl request to fileA.php for it's contents How can fileA.php determine that the request is coming specifically from fileB.php? -- I was thinking about sending the $_SERVER['SCRIPT_NAME'] in fileB.php to fileA.php but since someone can go into fileB.php or any file in general and just do $_SERVER['SCRIPT_NAME'] = 'fileB.php'; it's not really that secure. So how can I determine, for security reasons, that the request is coming from a specific file on a different server?

    Read the article

  • Subsonic : Same column name different tables

    - by John Transformer
    Hi, I have a query where I need to do a "Where" clause for two different columns in two different tables but subsonic creates the same parametrized parameter name for both which is causing an issue. How can I fix this? string _RawSql = new Select() .From(Tables.Table1) .InnerJoin(Tables.Table2) .InnerJoin(Table3.SidColumn, Table2.Table3SidColumn) .Where(Table1.SidColumn).IsEqualTo(2) .And(Table3.SidColumn).IsEqualTo(1) .BuildSqlStatement(); The query this is creating is SELECT .... FROM [dbo].[Table1] INNER JOIN [dbo].[Table2] ON [dbo].[Table1].[Table2Sid] = [dbo].[Table2].[Sid] INNER JOIN [dbo].[Table3] ON [dbo].[Table2].[Table3Sid] = [dbo].[Table3].[Sid] WHERE [dbo].[Table1].[Sid] = @Sid AND [dbo].[Table3].[Sid] = @Sid Note that in the last two lines its using @Sid for both Table1 and Table3. How go I do it so it uses @Sid0 and @Sid1? Any help would be appreciated. Thanks

    Read the article

< Previous Page | 121 122 123 124 125 126 127 128 129 130 131 132  | Next Page >