Daily Archives

Articles indexed Wednesday March 28 2012

Page 3/17 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • installing ubuntu 10.04 over top 11.04

    - by Alex
    im looking to install 10.04 over top the 11.04 partition, it wouldnt let. keeps giving me a "root file system not found" error ever time i manually select partition. (i have a win7 partition) 11.04 popped up after upgrade that my hardware isnt supported for unity. and i cant boot into it, hangs up on purple screen right after boot menu. if anyone can post a link to a how to guide or put it on here, would be great? im trying to take advantage of my nvidia geforce gt 120m (its a laptop) to play around with cuda/c++ programming!

    Read the article

  • How to speed up file transfer to/from Ubuntu Server 11.10 (wifi)

    - by Alexander
    I've been searching AU & elsewhere for the last day and a half. Haven't found an answer so I joined AU to ask for help. I'm hoping someone can point me in the right direction. Ubuntu Server 11.10 Samba VSFTPD Windows 7 PC 2 MacBook Pro - Snow Leopard/Lion 1 iMac - Lion Wireless LAN using DLink DIR-655 Link Speed: 195 Mbit/s on Mac - 54Mbps on Windows ISP Connection: Cable - 20 down/3 up No Domain Controller. All machines are members of the same workgroup. No matter how I connect I can't get better than about 700K transfer rate up/down. Mac/PC, SMB/ftp, Domain Name/Local IP I've tried different user accounts and using different folders, different volumes on the server. Nothing seems to make a difference. 700K up/down. Period. Any suggestions would be greatly appreciated. Thanks, Alexander EDIT: Using sftp now and uploading seems to peak at 980k. After about 5 minutes into a 650MB file, downloading is at 1072k and climbing about 500b/s every ten seconds. If any of that matters... I was expecting a lot faster than 1Mb tx rate. Am I off base here? EDIT: From all I've read so far, perhaps the speed isn't that bad. I only installed Ubuntu out of boredom this past weekend. The trouble is, I like it. Guess it's time to ditch the wifi and run some Cat 5.

    Read the article

  • How to downgrade from PHP 5.4 to 5.3

    - by Burning the Codeigniter
    Recently I upgraded PHP to 5.4, but it seems to be failing on me because APC isn't working with it, however this gave me no choice but to downgrade to 5.3, how can I do this? I executed apt-get remove php5 and apt-get purge php5 then I removed the 5.4 repo from apt-get then executed apt-get install php5, it says it was installing 5.3, and I restarted php-fastcgi and php5-fpm but when I run php -v it says 5.4. How can I downgrade from 5.4 to 5.3? My server is running Ubuntu 11.04.

    Read the article

  • How can I merge the different keyboard indicators?

    - by Agmenor
    Presently I use two application indicators showing a keyboard: input methods (iBus) keyboard layout Is there a way to make them merge into one single indicator icon ? What I have in mind is the equivalent of the messaging menu (gathering all that is related to communications) or the sound menu (gathering all the controls for sound). If it is too complicated to merge the indicators, is the merge planned for an upcoming Ubuntu release? I am on Ubuntu 11.10 with Unity as my environment.

    Read the article

  • Agile social media analysis and implementation

    - by blunders
    Are there any books/platforms for social media campaign planning and implementation that define a completely agile approach to engaging audiences on platforms such as Facebook, Linkedin, Twitter, etc? UPDATE: Posted a bounty on the question since the current answer is really not about agile approaches to social media campaign planning and implementation. UPDATE 2: The question is asking for an agile social media approach, or a social media platform that has agile social media approach baked-in. If the question was about an agile approach to software development, SCRUM would be the most likely answer (70% percent of agile software developers say they practice some from of SCRUM), and Pivotal Tracker might be one of many agile platforms suggested; as a generalization Pivotal Tracker might be called a project management platform. On the flip-side, suggesting just a social media platform might be the equivalent of suggesting a project management platform, and suggesting I see if SCRUM works on it. Problem is that if you haven't suggested an agile social media approach to try on this social media platform, then you haven't provided an answer to the question.

    Read the article

  • Multiple fonts in a website

    - by Akito
    I have been creating a blog and now its almost done. I am thinking of adding fonts to it. I am curious if having more than 1 font in a website makes it look unprofessional? I understand that it is a personal opinion of a person how the site should look but my site is a blog so I want to consider how visitors might feel seeing multiple fonts on a website. Does it look standard? In short: How many fonts should one use so that readability does not get affected? Thanks in advance.

    Read the article

  • How can I imitate interaction and movement in Diablo II?

    - by user422318
    I'm prototyping a simple browser-based game. It's played from a top down perspective on a 2d canvas. You left-click on a point on the map, and your character will begin walking to it. If you click on a different point on the map, then your character will begin walking to the new point. It's similar to Diablo II: http://www.youtube.com/watch?v=EvDKt-To6K0&feature=related How can I best imitate this movement system for a player? Ideas... Track current coords and target coords If target coords are exactly up, left, right, or down, then increment appropriate direction until you get there Implied else: target coords are in a quadrant. To make this movement look natural, character will have to move diagonally. For example, pretend the target is to the northeast. For each game frame, alternate incrementing current coordinates in the north and then east directions.

    Read the article

  • C++ problem with assimp 3D model loader

    - by Brendan Webster
    In my game I have model loading functions for Assimp model loading library. I can load the model and render it, but the model displays incorrectly. The models load in as if they were using a seperate projection matrix. I have looked over my code over and over again, but I probably keep on missing the obvious reason why this is happening. Here is an image of my game: It's simply a 6 sided cube, but it's off big time! Here are my code snippets for rendering the cube to the screen: void C_MediaLoader::display(void) { float tmp; glTranslatef(0,0,0); // rotate it around the y axis glRotatef(angle,0.f,0.f,1.f); glColor4f(1,1,1,1); // scale the whole asset to fit into our view frustum tmp = scene_max.x-scene_min.x; tmp = aisgl_max(scene_max.y - scene_min.y,tmp); tmp = aisgl_max(scene_max.z - scene_min.z,tmp); tmp = (1.f / tmp); glScalef(tmp/5, tmp/5, tmp/5); // center the model //glTranslatef( -scene_center.x, -scene_center.y, -scene_center.z ); // if the display list has not been made yet, create a new one and // fill it with scene contents if(scene_list == 0) { scene_list = glGenLists(1); glNewList(scene_list, GL_COMPILE); // now begin at the root node of the imported data and traverse // the scenegraph by multiplying subsequent local transforms // together on GL's matrix stack. recursive_render(scene, scene->mRootNode); glEndList(); } glCallList(scene_list); } void C_MediaLoader::recursive_render (const struct aiScene *sc, const struct aiNode* nd) { unsigned int i; unsigned int n = 0, t; struct aiMatrix4x4 m = nd->mTransformation; // update transform aiTransposeMatrix4(&m); glPushMatrix(); glMultMatrixf((float*)&m); // draw all meshes assigned to this node for (; n < nd->mNumMeshes; ++n) { const struct aiMesh* mesh = scene->mMeshes[nd->mMeshes[n]]; apply_material(sc->mMaterials[mesh->mMaterialIndex]); if(mesh->mNormals == NULL) { glDisable(GL_LIGHTING); } else { glEnable(GL_LIGHTING); } for (t = 0; t < mesh->mNumFaces; ++t) { const struct aiFace* face = &mesh->mFaces[t]; GLenum face_mode; switch(face->mNumIndices) { case 1: face_mode = GL_POINTS; break; case 2: face_mode = GL_LINES; break; case 3: face_mode = GL_TRIANGLES; break; default: face_mode = GL_POLYGON; break; } glBegin(face_mode); for(i = 0; i < face->mNumIndices; i++) { int index = face->mIndices[i]; if(mesh->mColors[0] != NULL) glColor4fv((GLfloat*)&mesh->mColors[0][index]); if(mesh->mNormals != NULL) glNormal3fv(&mesh->mNormals[index].x); glVertex3fv(&mesh->mVertices[index].x); } glEnd(); } } // draw all children for (n = 0; n < nd->mNumChildren; ++n) { recursive_render(sc, nd->mChildren[n]); } glPopMatrix(); } Sorry there is so much code to look through, but I really cannot find the problem, and I would love to have help.

    Read the article

  • How to pause and resume a game in XNA using the same key?

    - by user13095
    I'm attempting to implement a really simple game state system, this is my first game - trying to make a Tetris clone. I'd consider myself a novice programmer at best. I've been testing it out by drawing different textures to the screen depending on the current state. The 'Not Playing' state seems to work fine, I press Space and it changes to 'Playing', but when I press 'P' to pause or resume the game nothing happens. I tried checking current and previous keyboard states thinking it was happening to fast for me to see, but again nothing seemed to happen. If I change either the pause or resume, so they're both different, it works as intended. I'm clearly missing something obvious, or completely lacking some know-how in regards to how update and/or the keyboard states work. Here's what I have in my Update method at the moment: protected override void Update(GameTime gameTime) { KeyboardState CurrentKeyboardState = Keyboard.GetState(); // Allows the game to exit if (CurrentKeyboardState.IsKeyDown(Keys.Escape)) this.Exit(); // TODO: Add your update logic here if (CurrentGameState == GameStates.NotPlaying) { if (CurrentKeyboardState.IsKeyDown(Keys.Space)) CurrentGameState = GameStates.Playing; } if (CurrentGameState == GameStates.Playing) { if (CurrentKeyboardState.IsKeyDown(Keys.P)) CurrentGameState = GameStates.Paused; } if (CurrentGameState == GameStates.Paused) { if (CurrentKeyboardState.IsKeyDown(Keys.P)) CurrentGameState = GameStates.Playing; } base.Update(gameTime); }

    Read the article

  • OpenGLES 2.0 gluunProject

    - by secheung
    I've spent more time than i should trying to get my ray picking program working. I'm pretty convinced my math is solid with respect to line plane intersection, but I believe the problem lies with the changing of the mouse screen touch into 3D world space. Heres my code public void passTouchEvents(MotionEvent e){ int[] viewport = {0,0,viewportWidth,viewportHeight}; float x = e.getX(), y = viewportHeight - e.getY(); float[] pos1 = new float[4]; float[] pos2 = new float[4]; GLU.gluUnProject( x, y, 0.0f, mViewMatrix, 0, mProjectionMatrix, 0, viewport, 0, pos1, 0); GLU.gluUnProject( x, y, 1.0f, mViewMatrix, 0, mProjectionMatrix, 0, viewport, 0, pos2, 0); } Just as a reference I've tried transforming the coordinates 0,0,0 and got an offset. It would be appreciated if you would answer using opengl es 2.0 code. Thanks

    Read the article

  • C++ and SDL resource management for 2D game

    - by KuruptedMagi
    My first question is about stateManagers. I do not use the singleton pattern (read many random posts with various reasons not to use it), I have gameStateManager which runs the pointer cCurrentGameState-render(), etc. I want to make a transitioning game, this engine should ideally cover both a platformer and a bird's eye RPG (with some recoding, I just mean the base engine), both of which will load different levels and events, such as world map, dungeon, shops, etc. So I then thought, rather then having to store all this data within all the states, I would break the engine into gameStates, and playStates... when gameState reaches gameStatePlay(), gameStatePlay simply runs the usual handleInput, logic, and render for the playStates, just as the low level gameStateManager does. This lets me store all the player data within the base playstate class without storing useless data in the gameStates. Now I have added a seperate mapEditor, which uses editorStates from gameStateEditor. Is this too much usage of the gameState concept? It seems to work pretty well for me, so I was wondering if I am too far off a common implementation of this. My second question is on image resources. I have my sprite class with nothing but static members, mainly loadImage, applySurface, and my screen pointer. I also have a map pairing imageName enums with actual SDL_Surface pointers, and one pairing clipNumber enums with a wrapper class for a vector of clips, so that each reference in the map can have different amounts of clips with different sizes. I thought it would be better to store all these images, and screen within one static body, since 20 different goblins all use the same sprite sheet, and all need to print to the same screen, and of course, this way I do not need to pass my screen reference to every little entity. The imageMap seems to work very well, I can even add the ability to search through the map at creation of entity type to see if a particular image at creation, creating if it doesnt exist, and destroying the image if the last entity that needs it was just destroyed. The vectored clip map however, seems to take too long to initialize, so if i run past the state that initializes them to fast, the game crashes <. Plus, the clip map call is half of this line =P SPRITE::applySurface( cEditorMap.cTiles[x][y].iX, cEditorMap.cTiles[x][y].iY, SPRITE::mImages[ IMAGE_TILEMAP ], SPRITE::screen, SPRITE::mImageClips[IMAGE_TILEMAP]->clips.at( cEditorMap.cTiles[x][y].iTileType ) ); Again, do I have the right idea? I like the imageMap, but am I better off with each entity storing its own clips? My last question is about collision detection. I only grasp the basics, will look at per-pixel and circular soon, but how can I determine which side the collision comes from with just the basic square collision detection, I tried breaking each entity into 4 collision zones, but that just gave me problems with walking through walls and the like <. Also, is per-pixel color collision a good way to decide what collision just occured, or is checking multiple colors for multiple entities too taxing each cycle?

    Read the article

  • XNA 2D Board game - trouble with the cursor

    - by Adorjan
    I just have started making a simple 2D board game using XNA, but I got stuck at the movement of the cursor. This is my problem: I have a 10x10 table on with I should use a cursor to navigate. I simply made that table with the spriteBatch.Draw() function because I couldn't do it on another way. So here is what I did with the cursor: public override void LoadContent() { ... mutato.Position = new Vector2(X, Y); //X=103, Y=107; mutato.Sebesseg = 45; ... mutato.Initialize(content.Load<Texture2D>("cursor"),mutato.Position,mutato.Sebesseg); ... } public override void HandleInput(InputState input) { if (input == null) throw new ArgumentNullException("input"); // Look up inputs for the active player profile. int playerIndex = (int)ControllingPlayer.Value; KeyboardState keyboardState = input.CurrentKeyboardStates[playerIndex]; if (input.IsPauseGame(ControllingPlayer) || gamePadDisconnected) { ScreenManager.AddScreen(new PauseMenuScreen(), ControllingPlayer); } else { // Otherwise move the player position. if (keyboardState.IsKeyDown(Keys.Down)) { Y = (int)mutato.Position.Y + mutato.Move; } if (keyboardState.IsKeyDown(Keys.Up)) { Y = (int)mutato.Position.Y - mutato.Move; } if (keyboardState.IsKeyDown(Keys.Left)) { X = (int)mutato.Position.X - mutato.Move; } if (keyboardState.IsKeyDown(Keys.Right)) { X = (int)mutato.Position.X + mutato.Move; } } } public override void Draw(GameTime gameTime) { mutato.Draw(spriteBatch); } Here's the cursor's (mutato) class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace Battleship.Components { class Cursor { public Texture2D Cursortexture; public Vector2 Position; public int Move; public void Initialize(Texture2D texture, Vector2 position,int move) { Cursortexture = texture; Position = position; Move = move; } public void Update() { } public void Draw(SpriteBatch spriteBatch) { spriteBatch.Draw(Cursortexture, Position, Color.White); } } } And here is a part of the InputState class where I think I should change something: public bool IsNewKeyPress(Keys key, PlayerIndex? controllingPlayer, out PlayerIndex playerIndex) { if (controllingPlayer.HasValue) { // Read input from the specified player. playerIndex = controllingPlayer.Value; int i = (int)playerIndex; return (CurrentKeyboardStates[i].IsKeyDown(key) && LastKeyboardStates[i].IsKeyUp(key)); } } If I leave the movement operation like this it doesn't have any sense: X = (int)mutato.Position.X - mutato.Move; However if I modify it to this: X = (int)mutato.Position.X--; it moves smoothly. Instead of this I need to move the cursor by fields (45 pixels), but I don't have any idea how to manage it.

    Read the article

  • Ideas for extending tic-tac-toe game?

    - by pimvdb
    I'm building a 3D tic-tac-toe game and this is what I've implemented so far: 3D renderer with texture mapping Playing against the computer Playing online (multiplayer) Now I'm a little lost what I could add. Obviously, tic-tac-toe isn't that exciting or advanced, but I just miss something to salt it a little bit. Therefore, could anyone please suggest some ideas that would be worth implementing? Thanks!

    Read the article

  • How can I make an prototype ajax request with an array of values as a parameter?

    - by andresbravog
    i'm trying to make a ajax update in prototype with some values from a multirecordselect that sends a requests like. Parameters: {"action"=>"use_campaign", "campaigns"=> ["27929","27932"] , "advertiser_id"=>"", "controller"=>"admin/reporting", "ad_id"=>""} as you can see the request sends the "campaigns" elements as an array of values, i'm trying to do the same with this js code over prototype 7. // get the campaigns var campaign_ids = {}; var campaigns = $('filter_form').getInputs("hidden","report[campaigns][]"); campaigns.each( function(field) { campaign_ids.push(field.value); }); new Ajax.Updater('ad_filter', '/admin/reporting/use_campaign', { method : 'get', asynchronous : true, evalScripts : true, parameters : { 'advertiser_id' : $('filter_form')['report[advertiser_id]'].value, 'ad_id' : $('filter_form')['report[ad_id]'].value, 'campaigns' : campaign_ids } }); the campaigns_ids is getting the correct info as an array like: [ "27929", "27932" ] but seems that prototype ajax update is sending a request like: http://my_domain/admin/reporting/use_campaign?ad_id=&advertiser_id=&campaigns=27929&campaigns=27932 what sends parameters like: Parameters: {"action"=>"use_campaign", "campaigns"=> "27929" , "advertiser_id"=>"", "controller"=>"admin/reporting", "ad_id"=>""} I also tryed with Object.toJSON(campaign_ids) but i only get an escaped string like Parameters: {"action"=>"use_campaign", "campaigns"=>"[\"27929\",\"27932\"]" , "advertiser_id"=>"", "controller"=>"admin/reporting", "ad_id"=>""} There is anyway to do this as I wish? Thanks for all.

    Read the article

  • how to fetch meaningful

    - by user1298017
    Hi Every body, I have connected my device to serial port. I am using Javax.comm API to fetch the data from my device. On tapping of card i am reading data as below: newData = inputStream.read(); and able to fetch data : 0 128 161 132 132 132 132 132 132 132 101 65 2 226 99 98 132 132 132 132 132 132 132 132 131 134 164 132 132 132 165 134 132 196 230 167 132 132 132 132 132 132 132 197 196 132 133 132 132 164 197 132 132 198 103 255 How can deciper meaning ful text from it. My code is as below: import java.io.*; import java.util.*; import javax.comm.*; import javax.comm.SerialPort; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetEncoder; public class NFCReader3 implements Runnable, SerialPortEventListener { static CommPortIdentifier portId; static Enumeration portList; InputStream inputStream; SerialPort serialPort; Thread readThread; int i=0; public static void main(String[] args) { boolean portFound = false; String defaultPort = "COM9"; portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { if (portId.getName().equals(defaultPort)) { System.out.println("Found port: "+defaultPort); portFound = true; NFCReader3 reader = new NFCReader3(); } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } } public NFCReader3() { try { serialPort = (SerialPort) portId.open("SimpleReadApp2S", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) {} readThread = new Thread(this); readThread.start(); } public void run() { try { Thread.sleep(20000); } catch (InterruptedException e) {} } public void serialEvent(SerialPortEvent event) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (event.getEventType()) { case SerialPortEvent.BI: case SerialPortEvent.OE: case SerialPortEvent.FE: case SerialPortEvent.PE: case SerialPortEvent.CD: case SerialPortEvent.CTS: case SerialPortEvent.DSR: case SerialPortEvent.RI: case SerialPortEvent.OUTPUT_BUFFER_EMPTY: break; case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = inputStream.read(); System.out.print(newData); System.out.print(" "); if (newData == -1) { break; } if ('\r' == (char)newData) { inputBuffer.append('\n'); } else { inputBuffer.append((char)newData); } } catch (IOException ex) { System.out.println("exception"); System.err.println(ex); return; } } break;

    Read the article

  • Core dump utility for .NET

    - by Dave
    In my past life as a COBOL mainframe developer I made extensive use of a tool called Abendaid which, in the event of an exception, would give me a complete memory dump including a formatted list of every variable in memory as well as a complete stack trace of the program with the offending statement highlighted. This made pinpointing the cause of an error much simpler and saved a lot of step-through debugging and/or trace statements. Now I've made the transition to C# and .NET web development I find that the information provided by ASP.NET only tells half the story, giving me a stack trace, but not any of the variable or class information. This makes debugging more difficult as you then have to run the process again with the debugger to try and reproduce the error, not easy with intermittent errors or with assemblies that run under the likes of SQL Server or CRM. I've looked around quite a lot for something that does this but I can't find anything obvious. Does anyone have any idea if there is one, or if not, what I'd need to start with in order to write one?

    Read the article

  • Thin & Sinatra not taking port

    - by NekoNova
    I'm having problems settig up my application using Thin and Sinatra. I have created a development-config.ru file that contains the following settings: # This is a rack configuration file to fire up the Sinatra application. # This allows better control and configuration as we are using the modular # approach here for controlling our application. # # Extend the Ruby load path with the root of the API and the lib folder # so that we can automatically include all our own custom classes. This makes # the requiring of files a bit cleaner and easier to maintain. # This is basically what rails does as well. # We also store the root of the API in the ENV settings to ensure we have # always access to the root of the API when building paths. ENV['API_ROOT'] = File.dirname(__FILE__) $:.unshift ENV['API_ROOT'] $:.unshift File.expand_path(File.join(ENV['API_ROOT'], 'lib')) $:.unshift File.expand_path(File.join(ENV['API_ROOT'], 'db')) # Now we can require all the gems used for the entire API by simpling requiring # them here. We can also include the classes that we have defined inside the lib # folder. require 'rubygems' require 'bundler' # Run Bundler to setup our gems properly. This will install all the missing gems on # the system and ensure that the deployment environment is ready to run. Bundler.require # To make the loading easier for the application, we will now automatically load all # models that have been defined inside the lib folder. This ensures that we do not need # to load them anymore anywhere else in our application, as the models will be known to # ruby everywhere. Dir.glob(File.join(ENV['API_ROOT'], 'lib', '**', '*.rb')).each{|file| require file} # Now we will configure the Sinatra application so that we can fire up the entire API. # This requires some detailed settings like whether logging is allowed, the port to be # used and some folder locations. require 'sinatra' require 'app' set :logging, true set :dump_errors, true set :port, 3001 set :views, "#{ENV['API_ROOT']}/views" set :public_folder, "#{ENV['API_ROOT']}/public" set :environment, :test # Start up the Sinatra application with all the settings that we have defined. run App.new This is based upon the information I found on the Sinatra website. However, the problem is that I cannot get the application running on port 3001. If I use thin start -R development-config.ru it runs on port 3000. If I use rackup config-development.ru it runs on port 9696. However I never see Sinatra kick in or run over port 3000. My application looks like this: # Author : Arne De Herdt # Email : # This is the actuall application that will be running under Sinatra # to serve the requests for the billing middleware API. # We use the modular approach here to allow control when deploying # the application using Capistrano. require 'sinatra/base' require 'logger' require 'savon' require 'billcrux' class App < Sinatra::Base # This action responds to POST requests on the URI '/billcrux/register' # and is responsible for handeling registration requests with the # BillCrux payment system. # The post "/billcrux/register" do # do stuff end end Can someone tell me what I am doing wrong?

    Read the article

  • Django - Specifying default attr for Custom widget

    - by Pierre de LESPINAY
    I have created this widget class DateTimeWidget(forms.TextInput): attr = {'class': 'datetimepicker'} class Media: js = ('js/jquery-ui-timepicker-addon.js',) Then I use it on my form class SessionForm(forms.ModelForm): class Meta: model = Session def __init__(self, *args, **kwargs): super(SessionForm, self).__init__(*args, **kwargs) self.fields['start_time'].widget = DateTimeWidget() self.fields['end_time'].widget = DateTimeWidget() No css class is applied to my fields (I'm expecting datetimepicker applied to both start_time & end_time). I imagine I have put attr at a wrong location. Where am I supposed to specify it ?

    Read the article

  • How to delete a "Recurly" account completely from ruby api

    - by Subrahmanyam Konduri
    Can anyone please tell me how to delete a recurly account. As, I have tried with the following commands, r = Recurly::Account.find(account_code) r.delete And also, I have tried with "r.destroy". But, it only changing the state of recurly account from "active" to "closed" and not deleting the account completely. I am using rails 2.3.11 for this application. Thanks in advance. K. Subrahmanyam.

    Read the article

  • Apache DS fails to list users

    - by CuriousMind
    Apache ds fails to list the users INFO | jvm 1 | 2012/03/28 15:54:04 | java.lang.Error: ERR_546 CRITICAL: page header magic for block 59 not OK 0 INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.recman.PageHeader.(PageHeader.java:95) INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.recman.PageHeader.getView(PageHeader.java:124) INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.recman.PageManager.getNext(PageManager.java:234) INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.recman.PageCursor.next(PageCursor.java:104) INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.recman.PhysicalRowIdManager.fetch(PhysicalRowIdManager.java:158) INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.recman.BaseRecordManager.fetch(BaseRecordManager.java:324) INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.recman.CacheRecordManager.fetch(CacheRecordManager.java:262) INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.btree.BPage.loadBPage(BPage.java:899) INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.btree.BPage.childBPage(BPage.java:890) INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.btree.BPage.find(BPage.java:284) INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.btree.BPage.find(BPage.java:285) INFO | jvm 1 | 2012/03/28 15:54:04 | at jdbm.btree.BTree.find(BTree.java:408) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmTable.get(JdbmTable.java:395) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmMasterTable.get(JdbmMasterTable.java:155) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmStore.lookup(JdbmStore.java:1332) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmStore.lookup(JdbmStore.java:70) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.xdbm.search.impl.EqualityEvaluator.evaluate(EqualityEvaluator.java:126) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.xdbm.search.impl.AndCursor.matches(AndCursor.java:234) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.xdbm.search.impl.AndCursor.next(AndCursor.java:143) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.xdbm.search.impl.AndCursor.next(AndCursor.java:139) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.core.partition.impl.btree.ServerEntryCursorAdaptor.next(ServerEntryCursorAdaptor.java:178) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.core.filtering.BaseEntryFilteringCursor.next(BaseEntryFilteringCursor.java:499) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.ldap.handlers.SearchHandler.readResults(SearchHandler.java:314) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.ldap.handlers.SearchHandler.doSimpleSearch(SearchHandler.java:749) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.ldap.handlers.SearchHandler.handleIgnoringReferrals(SearchHandler.java:978) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.ldap.handlers.SearchHandler.handleIgnoringReferrals(SearchHandler.java:78) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler.handle(ReferralAwareRequestHandler.java:83) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.ldap.handlers.ReferralAwareRequestHandler.handle(ReferralAwareRequestHandler.java:57) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:208) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.ldap.handlers.LdapRequestHandler.handleMessage(LdapRequestHandler.java:58) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.mina.handler.demux.DemuxingIoHandler.messageReceived(DemuxingIoHandler.java:232) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.directory.server.ldap.LdapProtocolHandler.messageReceived(LdapProtocolHandler.java:193) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:71) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.runTask(UnorderedThreadPoolExecutor.java:480) INFO | jvm 1 | 2012/03/28 15:54:04 | at org.apache.mina.filter.executor.UnorderedThreadPoolExecutor$Worker.run(UnorderedThreadPoolExecutor.java:434) INFO | jvm 1 | 2012/03/28 15:54:04 | at java.lang.Thread.run(Thread.java:619) INFO | jvm 1 | 2012/03/28 15:54:04 | [15:54:04] WARN [org.apache.directory.server.ldap.LdapProtocolHandler] - Null LdapSession given to cleanUpSession. INFO | jvm 1 | 2012/03/28 15:55:20 | [15:55:20] WARN [org.apache.directory.server.ldap.LdapProtocolHandler] - Unexpected exception forcing session to close: sending disconnect notice to client.

    Read the article

  • Check if iOS app is live in app store

    - by MSK
    Is it possible somehow to code like below in iOS app ? if(app is live in app store) { //Do something } else { //Do other thing } I wanted to avoid cases where our QE/Dev team is using app for testing. Is there a way I can detect how app code is signed (Developer/Adhoc/Distribution) to check ? Even if it is possible, it will not eliminate cases when Apple is using our app for testing as part of review. We recorded many downloads of our content by Apple before our app goes live in App store.

    Read the article

  • Invoking brill tagger through C#

    - by Toshal Mokadam
    We want to use brill tagger such that on a button click, it will tag the Input.txt into output.txt. So we have created a new visual studio project and put a button. On button click event we wrote the following code. There are no errors and we can see the command prompt getting invoked. But the output file is not getting created. The code is as follows. could you pls guide us?? private void button1_Click(object sender, EventArgs e) { ProcessStartInfo brillStartInfo = new ProcessStartInfo(@"C:\Users\toshal\Documents\Visual Studio 2008\Projects\brill tagger\bin\brill.exe"); brillStartInfo.Arguments = "/C brill.exe LEXICON.BROWN Input.txt BIGRAMS LEXICALRULEFILE.BROWN CONTEXTUALRULEFILE.BROWN > output.txt"; brillStartInfo.UseShellExecute = false; brillStartInfo.RedirectStandardOutput = true; brillStartInfo.RedirectStandardError = true; brillStartInfo.CreateNoWindow = false; Process brill = new Process(); brill.StartInfo = brillStartInfo; brill.Start(); string output = brill.StandardOutput.ReadToEnd(); brill.WaitForExit(); }

    Read the article

  • How solve consumer/producer task using semaphores

    - by user1074896
    I have SimpleProducerConsumer class that illustrate consumer/producer problem (I am not sure that it's correct). public class SimpleProducerConsumer { private Stack<Object> stack = new Stack<Object>(); private static final int STACK_MAX_SIZE = 10; public static void main(String[] args) { SimpleProducerConsumer pc = new SimpleProducerConsumer(); new Thread(pc.new Producer(), "p1").start(); new Thread(pc.new Producer(), "p2").start(); new Thread(pc.new Consumer(), "c1").start(); new Thread(pc.new Consumer(), "c2").start(); new Thread(pc.new Consumer(), "c3").start(); } public synchronized void push(Object d) { while (stack.size() >= STACK_MAX_SIZE) try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } stack.push(new Object()); System.out.println("push " + Thread.currentThread().getName() + " " + stack.size()); notify(); } public synchronized Object pop() { while (stack.size() == 0) try { wait(); } catch (InterruptedException e) { e.printStackTrace(); } try { Thread.sleep(50); } catch (InterruptedException e) { e.printStackTrace(); } stack.pop(); System.out.println("pop " + Thread.currentThread().getName() + " " + stack.size()); notify(); return null; } class Consumer implements Runnable { @Override public void run() { while (true) { pop(); } } } class Producer implements Runnable { @Override public void run() { while (true) { push(new Object()); } } } } I found simple realization of semaphore(here:http://docs.oracle.com/javase/tutorial/essential/concurrency/guardmeth.html I know that there is concurrency package) How I need to change code to exchange java objects monitors to my custom semaphore. (To illustrate C/P problem using semaphores) Semaphore: class Semaphore { private int counter; public Semaphore() { this(0); } public Semaphore(int i) { if (i < 0) throw new IllegalArgumentException(i + " < 0"); counter = i; } public synchronized void release() { if (counter == 0) { notify(); } counter++; } public synchronized void acquire() throws InterruptedException { while (counter == 0) { wait(); } counter--; } }

    Read the article

  • Hide / Show menu code not working after postback

    - by WraithNath
    I have a button on my web page that toggles the menu, After a postback the menu comes back despite me updating a hidden field value to store its state. Am I doing something wrong here? If there is a better way of doing it, let me know! Markup: <asp:Button ID="btnMenu" runat="server" Text="Hide Menu" UseSubmitBehavior="False" OnClientClick="return toggleMenu(this);" /> <asp:Panel runat="server" ID="pnlMenuToggle"> //Main Menu </asp:Panel> <asp:Panel runat="server" ID="pnlSubMenuToggle"> //Sub Menu </asp:Panel> <asp:HiddenField ID="hfMenuState" runat="server" Value="true" /> <script> //Toggles menu visibility function toggleMenu(menuButton) { var menuVisible = $('#<%=hfMenuState.ClientID%>').val() == 'true' ? true : false; $('#<%=pnlMenuToggle.ClientID%>').slideToggleWidth(); $('#<%=pnlSubMenuToggle.ClientID%>').slideToggle('slow'); //Update whether the menu is visible menuVisible = !menuVisible; //Update menu button text $(menuButton).val(menuVisible ? 'Hide Menu' : 'Show Menu'); $('#<%=hfMenuState.ClientID%>').val(menuVisible) return false; } </script> Code Behind: (Page Load) bool menu = Convert.ToBoolean( hfMenuState.Value ); pnlMenuToggle.Visible = menu; pnlSubMenuToggle.Visible = menu; The javascripts updates the hidden field value but it looks like this is never posted back to the server. What can I do to make sure the menu stays hidden after postbacks. I have also tried putting the hidden field in an Update Panel with Update Mode set to Always

    Read the article

  • trigger script on postfix delivery errors

    - by edovino
    I'm trying to get postfix to run a script on soft (4xx) and hard (5xx) delivery errors, but I'm not sure where to start. If I understand things correctly, I could insert (pipe-based) filters in the master.cf file, there's a whole 'milter' infrastructure available, an finally I suppose I could simply grep through the mail.info logs. So - any advice? Should I go the 'handle it via master.cf' route, and if so, what daemon should I intercept? 'bounce'? The grep-the-logs route is probably simplest, but I can't help but feel that there is a better way. Any advice appreciated!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >