Search Results

Search found 15376 results on 616 pages for 'once'.

Page 8/616 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Load a list of localized strings at once in IOS

    - by Victor Ronin
    I want to show a table with the list of strings which are localized. The straightforward method would be: a) Point data source to my ViewController b) Define an array c) Allocate the array in my ViewController and init (arrayWithObjects) it with the strings from localized resources (NSLocalizedString) d) Use this array in UITableViewDataSource delegated methods Mainly my concern is item b). The construction looks quite heavy and I wonder whether I can somehow specify and load whole list of localized string at once.

    Read the article

  • Jquery : Do a function only once in ajax load

    - by thundercat
    Hi! Im trying to do a simple fadeIn ONCE for the first div , but the problem is that this is a ajax load inside a everyTime(xxx sec), so it does the same thing everytime it loads again. anyone got any ideas on how i can prevent the first div to fadeIn over and over again, but still do this function on the new div? Not very familiar with Jquery.. so feed me with a spoon :)

    Read the article

  • make 2 thumbnails at once in codeigniter

    - by sonill
    hello everybody! can anyone tell me how to create 2 different thumbnails of same images with different sizes and location in codeigniter. I have created a upload function and another thumbnail generation function, it works fine but can't sort out how to create 2 different thumbnail at accordingly at once. any help will be appreciated.

    Read the article

  • Extend multiple classes at once

    - by Starkers
    I want to share a method amongst all Ruby's data object classes. That is to say the following classes: Hash String Number Array Firstly, any classes I've missed out? Secondly, how can I share my_method amongst all classes at once? class Hash def my_method "hi" end end class String def my_method "hi" end end class Number def my_method "hi" end end class Array def my_method "hi" end end

    Read the article

  • url.rewrite-once with Kohana and with urls

    - by mike clagg
    currently I have this setup in our simple-hosts.conf: url.rewrite-once = ( ".*.(js|ico|gif|jpg|png|css|php|htm)(?.*)?$" = "$0", "/slapi" = "/slapi/index.php" ) Works great, except the above fails when I have a dot in the query string: ?url=http://google.com My regexpy is not 1337

    Read the article

  • Can I declare the same value for two attributes at once

    - by graphicdivine
    For example, for accessibility reasons I want my onfocus and onmouseover to have identical values. For the sake of maintainability I want to declare this once only. What I'd like to be able to do is this: <a onmouseover,onfocus="assist('hello');">linktext</a> But, of course, that would be too easy, and doesn't work. What's the best way I can achieve this DRYing out of my tags?

    Read the article

  • call a Javascript function from controller more than once (in Rails)

    - by mm1
    hi. I have a multiple file upload form(html5) and want to update my view as soon one of the images is transfered to my image server. Currently I upload the files with ajax and use response_to_parent to update my upload view when all images are transfered to the image server. Is it possible to call a Javascript function from the controller more than once per action? def upload params[:images].each do |file| upload_to_image_server(file) #page << Update upload View end end Thanks, Michael

    Read the article

  • fire jquery .animate oninput only once

    - by luke
    http://jsfiddle.net/nFFuD/ I'm trying to animate the search field in this example using jquery, making it move to the top of it's containing div oninput. I was originally using scriptaculous effect.move to do this, but I couldn't make the event only fire once, so if someone kept typing after the first keystroke, the effect would stop and start again from it's current position in the animation for each additional keystroke, which is stupid. I'm new to new to using jquery so please, take it easy if I'm not making very much sense.

    Read the article

  • Make a target run once at the Solution level in MSBuild

    - by Chandam
    I need a set of tasks that need to be executed exactly once for the entire solution. This will run tasks that will modify each project to run a separate set of tasks for each project. We had done this earlier using a separate project to the solution which had the solution level tasks, but we want to move away from that. Has anyone done this or does anyone have any suggestions on how to implement this?

    Read the article

  • mysql_real_escape more than once

    - by Aran
    I was just wondering whether it makes a difference if I mysql_real_escape data more than once? So if I escaped data in one part of my website, and then again in another part of code. Would this be a problem? Or make a difference?

    Read the article

  • Making a python script only be able to run once at a time

    - by Richard
    I am looking to make a python script be unique in the sense that it can only run once at a time. For example if I run the script and open another session of the same script a second time and the first session is still running, then the second session will just exit and do nothing. Anyone knows how I could implement this?

    Read the article

  • SetPartialRenderingMode can only be called once?

    - by lucian.jp
    I have a asp.net web form full of ajax. Every time a postback is made, the server event execute correctly, but when the page is rendering I get this error : Error : Sys.WebForms.PageRequestManagerServerErrorException: SetPartialRenderingMode can only be called once. A search with SetPartialRenderingMode on google was unsuccessful. It seems it is related to AjaxControlToolkit. I have created a simple demo project that reproduce the problem. You can find it here (VS 2008 .NET 3.5). Note that you only see the error in IE7, it doesn't work in FF either but no error appear.

    Read the article

  • Android ProgressBar.setProgressDrawable only works once?

    - by Chuck
    In a color picker, I have 3 SeekBars for Hue, Saturation, and Value. Calling setProgressDrawable on these SeekBars only works once -- at initialization from onCreate. When the user updates the Hue SeekBar, I want to call setProgressDrawable for the Saturation and Value SeekBars, to show the user their color choices for the new Hue. But all calls to setProgressDrawable (after the initial ones from onCreate) cause the SeekBar to be blanked. How can I update the background gradient of my SeekBars based upon user input? Thanks! Chuck

    Read the article

  • Entity framework MappingException: The type 'XXX has been mapped more than once

    - by Michal
    Hi everyone, I'm using Entity framework in web application. ObjectContext is created per request (using HttpContext), hereby code: string ocKey = "ocm_" + HttpContext.Current.GetHashCode().ToString(); if (!HttpContext.Current.Items.Contains(ocKey)) { HttpContext.Current.Items.Add(ocKey, new ElevationEntityModel(EFConnectionString)); } _eem = HttpContext.Current.Items[ocKey] as ElevationEntityModel; Not every time, but sometimes I have this exception: System.Data.MappingException was unhandled by user code Message=The type 'XXX' has been mapped more than once. Source=System.Data.Entity I'm absolutely confused and I don't have any idea what can caused this problem. Can anybody help me? Thanks.

    Read the article

  • Webmail client that can open multiple email addresses at once like a desktop client

    - by Trent
    I've got 5 email domains with multiple email addresses on each domain. Traditional webmail clients only seem to allow you to browse a single account at a time (ie, you log into that account). With over 20 email addresses I need to monitor, this is obviously a major time sink. Is there a (preferably OSS, unix-based) webmail client that simulates a desktop email client, ie I log in once and can access all the email addresses from a central control panel? I've considered using a ticket system but that is overkill and not really used to my needs.

    Read the article

  • Problem with #ifndef and #pragma once

    - by Xaver
    I want write the program with next struct stdafx.h - contains some #define defenitions of program constants and #include of headers wich uses in all project. frmMain.h - contatins code of Form1 also can Show form2 and uses some code from BckHeadr.h and some functions call that headers included in stdafx.h. frmIniPrgs.h - contatins code of Form2 and uses some code from BckHeadr.h and some functions call that headers included in stdafx.h. BckHeadr.h - contatins some definitions of functions and some functions call that headers included in stdafx.h. I know what i must use #ifndef or #pragma once directives. But i can not decided this problem. I included in stdafx.h: frmIniPrgs.H, BckHeadr.h, frmMain.h. And use #ifndef in all modules. I uset it like this: #ifndef MYMODULE_H #define MYMODULE_H //module code #endif

    Read the article

  • OpenGL basics: calling glDrawElements once per object

    - by Bethor
    Hi all, continuing on from my explorations of the basics of OpenGL (see this question), I'm trying to figure out the basic principles of drawing a scene with OpenGL. I am trying to render a simple cube repeated n times in every direction. My method appears to yield terrible performance : 1000 cubes brings performance below 50fps (on a QuadroFX 1800, roughly a GeForce 9600GT). My method for drawing these cubes is as follows: done once: set up a vertex buffer and array buffer containing my cube vertices in model space set up an array buffer indexing the cube for drawing as 12 triangles done for each frame: update uniform values used by the vertex shader to move all cubes at once done for each cube, for each frame: update uniform values used by the vertex shader to move each cube to its position call glDrawElements to draw the positioned cube Is this a sane method ? If not, how does one go about something like this ? I'm guessing I need to minimize calls to glUniform, glDrawElements, or both, but I'm not sure how to do that. Full code for my little test : (depends on gletools and pyglet) I'm aware that my init code (at least) is really ugly; I'm concerned with the rendering code for each frame right now, I'll move to something a little less insane for the creation of the vertex buffers and such later on. import pyglet from pyglet.gl import * from pyglet.window import key from numpy import deg2rad, tan from gletools import ShaderProgram, FragmentShader, VertexShader, GeometryShader vertexData = [-0.5, -0.5, -0.5, 1.0, -0.5, 0.5, -0.5, 1.0, 0.5, -0.5, -0.5, 1.0, 0.5, 0.5, -0.5, 1.0, -0.5, -0.5, 0.5, 1.0, -0.5, 0.5, 0.5, 1.0, 0.5, -0.5, 0.5, 1.0, 0.5, 0.5, 0.5, 1.0] elementArray = [2, 1, 0, 1, 2, 3,## back face 4, 7, 6, 4, 5, 7,## front face 1, 3, 5, 3, 7, 5,## top face 2, 0, 4, 2, 4, 6,## bottom face 1, 5, 4, 0, 1, 4,## left face 6, 7, 3, 6, 3, 2]## right face def toGLArray(input): return (GLfloat*len(input))(*input) def toGLushortArray(input): return (GLushort*len(input))(*input) def initPerspectiveMatrix(aspectRatio = 1.0, fov = 45): frustumScale = 1.0 / tan(deg2rad(fov) / 2.0) fzNear = 0.5 fzFar = 300.0 perspectiveMatrix = [frustumScale*aspectRatio, 0.0 , 0.0 , 0.0 , 0.0 , frustumScale, 0.0 , 0.0 , 0.0 , 0.0 , (fzFar+fzNear)/(fzNear-fzFar) , -1.0, 0.0 , 0.0 , (2*fzFar*fzNear)/(fzNear-fzFar), 0.0 ] return perspectiveMatrix class ModelObject(object): vbo = GLuint() vao = GLuint() eao = GLuint() initDone = False verticesPool = [] indexPool = [] def __init__(self, vertices, indexing): super(ModelObject, self).__init__() if not ModelObject.initDone: glGenVertexArrays(1, ModelObject.vao) glGenBuffers(1, ModelObject.vbo) glGenBuffers(1, ModelObject.eao) glBindVertexArray(ModelObject.vao) initDone = True self.numIndices = len(indexing) self.offsetIntoVerticesPool = len(ModelObject.verticesPool) ModelObject.verticesPool.extend(vertices) self.offsetIntoElementArray = len(ModelObject.indexPool) ModelObject.indexPool.extend(indexing) glBindBuffer(GL_ARRAY_BUFFER, ModelObject.vbo) glEnableVertexAttribArray(0) #position glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ModelObject.eao) glBufferData(GL_ARRAY_BUFFER, len(ModelObject.verticesPool)*4, toGLArray(ModelObject.verticesPool), GL_STREAM_DRAW) glBufferData(GL_ELEMENT_ARRAY_BUFFER, len(ModelObject.indexPool)*2, toGLushortArray(ModelObject.indexPool), GL_STREAM_DRAW) def draw(self): glDrawElements(GL_TRIANGLES, self.numIndices, GL_UNSIGNED_SHORT, self.offsetIntoElementArray) class PositionedObject(object): def __init__(self, mesh, pos, objOffsetUf): super(PositionedObject, self).__init__() self.mesh = mesh self.pos = pos self.objOffsetUf = objOffsetUf def draw(self): glUniform3f(self.objOffsetUf, self.pos[0], self.pos[1], self.pos[2]) self.mesh.draw() w = 800 h = 600 AR = float(h)/float(w) window = pyglet.window.Window(width=w, height=h, vsync=False) window.set_exclusive_mouse(True) pyglet.clock.set_fps_limit(None) ## input forward = [False] left = [False] back = [False] right = [False] up = [False] down = [False] inputs = {key.Z: forward, key.Q: left, key.S: back, key.D: right, key.UP: forward, key.LEFT: left, key.DOWN: back, key.RIGHT: right, key.PAGEUP: up, key.PAGEDOWN: down} ## camera camX = 0.0 camY = 0.0 camZ = -1.0 def simulate(delta): global camZ, camX, camY scale = 10.0 move = scale*delta if forward[0]: camZ += move if back[0]: camZ += -move if left[0]: camX += move if right[0]: camX += -move if up[0]: camY += move if down[0]: camY += -move pyglet.clock.schedule(simulate) @window.event def on_key_press(symbol, modifiers): global forward, back, left, right, up, down if symbol in inputs.keys(): inputs[symbol][0] = True @window.event def on_key_release(symbol, modifiers): global forward, back, left, right, up, down if symbol in inputs.keys(): inputs[symbol][0] = False ## uniforms for shaders camOffsetUf = GLuint() objOffsetUf = GLuint() perspectiveMatrixUf = GLuint() camRotationUf = GLuint() program = ShaderProgram( VertexShader(''' #version 330 layout(location = 0) in vec4 objCoord; uniform vec3 objOffset; uniform vec3 cameraOffset; uniform mat4 perspMx; void main() { mat4 translateCamera = mat4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, cameraOffset.x, cameraOffset.y, cameraOffset.z, 1.0f); mat4 translateObject = mat4(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, objOffset.x, objOffset.y, objOffset.z, 1.0f); vec4 modelCoord = objCoord; vec4 positionedModel = translateObject*modelCoord; vec4 cameraPos = translateCamera*positionedModel; gl_Position = perspMx * cameraPos; }'''), FragmentShader(''' #version 330 out vec4 outputColor; const vec4 fillColor = vec4(1.0f, 1.0f, 1.0f, 1.0f); void main() { outputColor = fillColor; }''') ) shapes = [] def init(): global camOffsetUf, objOffsetUf with program: camOffsetUf = glGetUniformLocation(program.id, "cameraOffset") objOffsetUf = glGetUniformLocation(program.id, "objOffset") perspectiveMatrixUf = glGetUniformLocation(program.id, "perspMx") glUniformMatrix4fv(perspectiveMatrixUf, 1, GL_FALSE, toGLArray(initPerspectiveMatrix(AR))) obj = ModelObject(vertexData, elementArray) nb = 20 for i in range(nb): for j in range(nb): for k in range(nb): shapes.append(PositionedObject(obj, (float(i*2), float(j*2), float(k*2)), objOffsetUf)) glEnable(GL_CULL_FACE) glCullFace(GL_BACK) glFrontFace(GL_CW) glEnable(GL_DEPTH_TEST) glDepthMask(GL_TRUE) glDepthFunc(GL_LEQUAL) glDepthRange(0.0, 1.0) glClearDepth(1.0) def update(dt): print pyglet.clock.get_fps() pyglet.clock.schedule_interval(update, 1.0) @window.event def on_draw(): with program: pyglet.clock.tick() glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) glUniform3f(camOffsetUf, camX, camY, camZ) for shape in shapes: shape.draw() init() pyglet.app.run()

    Read the article

  • zoom_changed only triggers once in google maps api version 3 using MVC

    - by fredrik
    Hi, I'm trying to use the MVC objects in google maps version 3. What I can't seem to figure out is why my zoom_changed method is only invoked once. When I first load the map the zoom_changed method is invoked. But not when I zoom on the map. function MarkerWidget (options) { this.setValues(options); this.set('zoom', this.map.zoom); var marker = new google.maps.Marker({ icon : this.icon, mouseOverIcon : this.mouseOverIcon, orgIcon : this.orgIcon }); marker.bindTo('map', this); marker.bindTo('position', this); google.maps.event.addListener(marker, 'mouseover', this.onmouseover); google.maps.event.addListener(marker, 'mouseout', this.onmouseout); } MarkerWidget.prototype = new google.maps.MVCObject(); MarkerWidget.prototype.zoom_changed = function () { $.log(this, new Date()); } Shouldn't the map object fire the zoom event and notify all object's that has "this.set('zoom', this.map.zoom)" ? ..fredrik

    Read the article

  • Getting consecutive version numbers from Hibernate's @Version usage once per transaction

    - by Cheradenine
    We use Hibernate with the following version definition for optimistic locking et. al: <version name="version" access="field" column="VERSION" type="long" unsaved-value="negative"/> This is fine and dandy; however, there is one small problem, which is that the first version for some entities is '0', and for others, it is '1'. Why this is happening, is that for some object graphs, an entity will be subject to both onSave and flushDirty - this is reasonable, such as if two object are circular dependencies. However, the version number gets incremented on both occasions, leading to the above '0' / '1' discrepancy. I'd really like the version number only to ever increment once per transaction. However, I can't see a simple way to do this in the hibernate versioning implementation, without hacking about with an Interceptor (which was how I generated a column value for version before, but I wanted hibernate to do it itself)..

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >