Posts

javascript - open FileSelect dialog programmatically -

I am trying to open a file select dialog box without contacting the user, but it does not work and I Do not understand why In this example, I am trying to open it from the window. Ollod function, but it does nothing. The console output shows that the "simulateclick ()" function is executed, but I do not see the dialog box. When I use the 'Test' button instead, it works fine. To make a call besides "document.getElementById ('files'). Click ()" There is no effect from the console. Can anyone explain? & lt; Html & gt; & Lt; Body & gt; & Lt; Input type = "file" id = "file" name = "files []" multiple & gt; & Lt; Input type = "button" id = "test" value = "test" & gt; & Lt; Script & gt; Function simulatorclick () {console.log ("first"); Var elem = document.getElementById ('file'); Console.log (ELEM); Elem.click (); Console.log...

sdl - SDL2 texture repeat / wrapping property -

I want to use texture repeats with SDL2 (SDL_RenderCopy), and how I can not find it by repeating the texture That texture coars have to be given twice in the shape of the texture and it is tiled twice on the surface like this: How do anyone know how to do this in the SDL? Do I Need To Use Open GL Functions? Thank you, This is not the ideal solution, but if you are using OpenGL functions Do not want to go down the route to use: glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); GlTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); GlTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, DEFAULT_TEXTURE_WRAP); GlTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, DEFAULT_TEXTURE_WRAP); Then you can calculate the source and destination sequences on the fly as you attract. For example, think that you have a texture that is 100x100 and a screen drawing area is 150x150. When starting from the top you will see that you can fit the full text in the first ...

Rails: Setting tag owner with acts-as-taggable-on and tag_list direct assignment -

I need to set the ownership of tags using the Ilist Direct Assignment method by using . This is what I am doing: @ blog.tag_list = "red, blue, green" @ blog. Save And I have the user set as a tagger class user & lt; ActiveRecord :: Base acts_s_tagger end Tagged tagged tag tags according to tag how to set tag ownership, but how to set ownership through tag_list, any of it There is no discussion. Is this possible? Or do I need to set up ownership to avoid direct work? see # in a tagable model (blog): First_Save: set_tag_owner def set_tag_owner # Set some tag owner based on the existing tag_list_set_owner_tag_list_on (self.user ,: tags, self.tag_list) # Clear the list so that we do not get duplicate tagging self.tag_list = zero End # in this view: & lt;% = f.text_field: tag_list ,: value = & gt; @ Blog.all_tags_list%>

java - Reference to Self in Static Initializer -

I have a problem with the three classes in the Java program, I am using public static last I have a constant type of reference in the same class type, but in these sections, the public static final is itself a reference, and ultimately indicates back in the undefined class (leading to a null). . I am using a strategy that uses static references as constants, but it is a strange chaining behavior, if this problem can not be fixed, then what are the options, and what exactly is the problem Can also be fixed? code: public square fu {public static final fu UNKNOWN_FOO = new fu (bar. UNNNIBAR); Private last time; Public fu (repeatedly) {this.bar = bar; }} Public Class Bar {Public Static Final Bar UNKNOWN_BAR = New Bar (Falcon. UNNAABAZ); Private finals falcon falcon; Public bar (falcon falcon) {this.baz = baz; }} Public Sector Buzz {Public Stable Last Falcon UNKNOWN_BAZ = New Falcon (Foo.UNKNOWN_FOO); Private Final Fu Fu; Public falcon (Fu Fu) {this.foo = foo; }} As Aaron...

how to use OsmDroid for navigation in android -

OSMDODO and navigation are completely new in the world. I just want to know, if a user enters the place's name or post code (the place where he wants to go), how do I find it in the map? And secondly, if I already got the geopoint of the destination, how would I do the actual search algorithm from my place to destination? A sample code has been provided, so it will be really useful. Thanks for your time and help I recommend that Take a look at> OSMBonusPack . This library is exactly what you want. You can either choose to use it or understand the sources to see how to do such things here:

php - dropdown option select in register form -

I am creating a register form with a dropdown selection option: Name: Email: Password: School: (dropdown option list) I have set up two tables, which are called "users", others are "schools". In my "Users" table, the columns are "id" (int (11)) , "email" (varchar (255) , "name" (my In the "School" table, the column "id" (int (11)), "user_id" (int (11)), varna (64) , and "school" (kirtava (64) and "school_id" Int (11)) "I'm not sure if the setup of this table is correct, please let me know if there is a better way to set it up. I made" school_id "as I have a search system later on where the user In specific schools So far my farm form of register.html: form action = "register e-mail: & lt ; / Label & gt; & lt; php "method =" post "& gt; div class =" field "& gt; & lt; label =" email "f...

haskell - zipWith-ing List of Integers with List of Functions -

How do I make [integer] with a [integer - & Gt; Integer - & gt; Integer] to get the [integer - & gt; Integer] ? Example: I tried: prelude & gt; With desired result of [1,2,3] (3 (*)) with zip: [(* 1), ( * 2), (* 3)] But I got an error: & lt; Interactive>: 25: 9: Could not match the expected type `(A0 - & gt; a0 - & gt; a0) - & gt; B - 0 - & gt; In the first argument of 'zip with' with the actual type '[T]', in the expression '[1, 2, 3]', in the expression: zip [1, 2, 3] (repeat 3 (*)) In the equation for an 'this': it = zip [1, 2, 3] (repeat 3 (*)) edit me right - thanks . It seems that I can do it with applicants: prelude control. Epicclic & gt; F f = [(*)] But, can I do this with the zipWith ? You were close to an operator for the application, $ , which exactly Useful in such cases. & gt; : T ZIP ($) [(*), (*), (*)] [1..3] ZIP ($) [(*), (*), (*)] [1..3]: ...