Search Results

Search found 2767 results on 111 pages for 'alex king'.

Page 74/111 | < Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >

  • Java convert JSONObject to URL parameter

    - by Alex Ivasyuv
    What is the elegant way to convert JSONObject to URL parameters. For example, JSONObject: {stat: {123456: {x: 1, y: 2}, 123457: {z: 5, y: 2}}}} this should be like: stat[123456][x]=1&stat[123456][y]=2&stat[123457][z]=5&stat[123457][y]=2 of course with escaped symbols, and of course JSON object could be more complicated.. Maybe there already exist some mechanisms for that? Thanks,

    Read the article

  • Log information inside a JUnit Suite

    - by Alex Marinescu
    I'm currently trying to write inside a log file the total number of failed tests from a JUnite Suite. My testsuite is defined as follows: @RunWith(Suite.class) @SuiteClasses({Class1.class, Class2.class etc.}) public class SimpleTestSuite {} I tried to define a rule which would increase the total number of errors when a test fails, but apparently my rule is never called. @Rule public MethodRule logWatchRule = new TestWatchman() { public void failed(Throwable e, FrameworkMethod method) { errors += 1; } public void succeeded(FrameworkMethod method) { } }; Any ideas on what I should to do to achieve this behaviour?

    Read the article

  • Using Time datatype in MySQL without seconds

    - by Alex
    I'm trying to store a 12/24hr (ie; 00:00) clock time in a MySQL database. At the moment I am using the time datatype. This works ok but it insists on adding the seconds to the column. So you enter 09:20 and it is stored as 09:20:00. Is there any way I can limit it in MySQL to just 00:00?

    Read the article

  • Simple Scala syntax - trying to define "==" operator - what am I missing?

    - by Alex R
    While experimenting with some stuff on the REPL, I got to a point where I needed something like this: scala class A(x:Int) { println(x); def ==(a:A) : Boolean = { this.x == a.x; } } Just a simple class with an "==" operator. Why doesn't it work??? Here's the result: :10: error: type mismatch; found : A required: ?{val x: ?} Note that implicit conversions are not applicable because they are ambiguous: both method any2ArrowAssoc in object Predef of type [A](x: A)ArrowAssoc[A] and method any2Ensuring in object Predef of type [A](x: A)Ensuring[A] are possible conversion functions from A to ?{val x: ?} class A(x:Int) { println(x); def ==(a:A) : Boolean = { this.x == a.x; } } ^ This is scala 2.8 RC1. Thanks

    Read the article

  • Multiple Input From Keyboard C# WPF

    - by Alex
    I am writing a Tetris clone in WPF. If I hold down the right arrow key, the current piece shifts right. For playability, I want to allow the user to press another key (i.e. F-key) and rotate the moving piece without having to let go of the right arrow key first. Currently when I do this, the piece stops shifting. My first basic attempt at this was hooking into Window_PreviewKeyDown(object sender, KeyEventArgs e) and then sending a message to the controller layer. How do I structure my input-listening code to allow this? My current code Here

    Read the article

  • C# Get Keys from a Dictionary<string, Stream>

    - by alex
    Suppose I have a Dictionary like so: Dictionary<string, Stream> How can I get a list (or IEnumerable or whatever) of JUST the Keys from this dictionary? Is this possible? I could enumerate the dictionary, and extract the keys one by one, but I was hoping to avoid this. In my instance, the Dictionary contains a list of filenames (file1.doc, filex.bmp etc...) and the stream content of the file from another part of the application.

    Read the article

  • How to cancel a touch sequence

    - by Alex
    I have an UIImage view that responds to touch events. I want to cancel the touch sequence if the touch goes outside of certain bounds. How can I do that? I know that I can inspect the coordinates of the touch object, what I don't know is how to cancel the sequence. I don't see any event in the API that allows for that.

    Read the article

  • Incremental Compilation in Eclipse. ASTNode-s and SVN versioning

    - by Alex
    Hi there, I am building up some statistics after analyzing the source code in eclipse. But the overall process is too slow because i rebuild my model every time from scratch after each compilation. I am looking for a way to get only the changed parts of the code (as ASTNodes) and to rebuild just that part of my model. I suppose that even the changed compilation units and not the exact code elements would be enough after the user compiles and still would be a nice optimization. I am sure eclipse is capable of knowing what code elements are changed (and even to know their semantics), because when I use the subclipse plugin my changes are ordered by a code element (an import, a method, a variable declaration, etc). Well.. at least that plugin is capable of knowing that info. Thanks in advance

    Read the article

  • How to learn Ruby on Rails as a complete Programming Beginner?

    - by Alex
    I want to build a scalable dynamic Web Application. I have never programmed an Object Oriented language before. Or, let's just say I am completely new to programming, because the previous experiences aren't worth talking about. I know I have a really big task ahead of me ^^ but I wanted to get into coding for the last 10 years and now that I'm finally doing it, I would like to know how to get there in the most efficient way. Any good books/tutorials you could recommend? Would it really make sense to learn other, better documented languages before learning RoR? Or would it be better for a beginner to learn C# with ASP.NET first? Thank you for your help in advance ;-)

    Read the article

  • ASP.NET MVC Route based on Web Browser/Device (e.g. iPhone)

    - by Alex
    Is it possible, from within ASP.NET MVC, to route to different controllers or actions based on the accessing device/browser? I'm thinking of setting up alternative actions and views for some parts of my website in case it is accessed from the iPhone, to optimize display and functionality of it. I don't want to create a completely separate project for the iPhone though as the majority of the site is fine on any device. Any idea on how to do this?

    Read the article

  • Save phone calls data in a DB?

    - by Alex
    How would you save this data on a database: An user can make phone calls (id, date, hour, duration, outcome). The "outcome" can be, for example, to recall the client on another day (so I have to save the date, the hour, etc of this "future" call). How would you manage this data on a db? At the moment i have only a "Call" table.

    Read the article

  • Imploding nested arrays

    - by Alex Zylman
    Hey guys, If I have an array structured like this: $array[index]['first_name'] $array[index]['last_name'] Is there an easy way to implode it into something like first_name last_name,first_name last_name, etc. for all the indices? Implode didn't seem to do what I wanted for something like this. Currently I'm just looping over the whole thing, but it's a SIGNIFICANT bottleneck.

    Read the article

  • Is there an easier way to do Classic ASP "relative path"?

    - by Alex.Piechowski
    Right now, I'm having trouble. First of all I have a page, let's call it "http://blah.com/login". That obviously goes strait to "index.asp" A line of Main.asp: <!--#include file="resource/menu.asp"--> Page top includes all of what I need for my menu... so: Part of resource/menu.htm: <div id="colortab" class="ddcolortabs"> <ul> <li><a href="main.asp" title="Main" rel="dropmain"><span>Main</span></a></li> ... </ul> </div> <!--Main drop down menu --> <div id="dropmain" class="dropmenudiv_a"> <a href="main/announcements.asp">Announcements</a> <a href="main/contacts.asp">Contact Information</a> <a href="main/MeetingPlans.asp">Meeting Plan</a> <a href="main/photos.asp">Photo Gallery</a> <a href="main/events.asp">Upcoming Events</a> </div> Let's say I click on the "announcements" (http://blah.com/login/main/announcements.asp) link... Now I'm at the announcements page! But wait, I include the same menu file. Guess what happens: I get sent to "http://blah.com/login/main/main/announcements.asp Which doesn't exist... My solution: Make a menu_sub.asp include for any subpages. But wait a second... this WORKS, but it gets REALLY REALLY messy... What can I do to use just one main "menu.asp" instead of "menu_sub.asp"? using "/main/announcements.asp" WON'T be an option because this is a web application that will be on different directories per server. Any ideas? PLEASE

    Read the article

  • Deployment of SQL Server: installing a second instance?

    - by Workshop Alex
    Simple problem. I'm working on a Delphi 2007/WIN32 application which now uses MS Access as simple data store. I have to modify it to support SQL Server Express, which is easy. These modifications are working so the application can be deployed using either SQL Server or MS Access. (Whatever the user prefers.) I did consider deploying the whole application together with the SQL Compact but this is not practicak. Using SQL Server Express 2008 instead of 2005 is an option, but also has a few nasty side-effects which we don't want to resolve for now. The problem is deploying the whole project. The installation with SQL Server would need a quiet installation so the user won't notice it. SQL Server is mentioned in the documentation so they know it's there. We just don't want to bother them with technical issues. In most cases, such an installation will go just fine. But what if the user already has an SQL Server (2005) installation which is used for something else? Personally, I would prefer to just install a second instance of SQL Server on their system so it won't conflict with the other installation. (Thus, if they uninstall the other app, the SQL instance will just stay installed.) While SQL Server 2005 and 2008 can be installed on the same system simply by using two different names for the instance, I wonder if it's also possible to install SQL Server 2005 twice on a single system to get two instances. And if possible, how?

    Read the article

  • Visual Studio: Collapse Methods, but not Comments (Summary etc.)

    - by Alex
    Hello, is there a way (settings? "macro"? extension?) that I can simply toggle outlining so that only the using section and my methods collapse to their signature line, but my comments (summary and double slash comments) and classes stay expanded? Examples: 1) Uncollapsed using System; using MachineGun; namespace Animals { /// <summary> /// Angry animal /// Pretty Fast, too /// </summary> public partial class Lion { // // Dead or Alive public Boolean Alive; /// <summary> /// Bad bite /// </summary> public PieceOfAnimal Bite(Animal animalToBite) { return animalToBite.Shoulder; } /// <summary> /// Fatal bite /// </summary> public PieceOfAnimal Kill(Animal animalToKill) { return animalToKill.Head; } } } 2) Collapsed (the following is my desired result): using[...] namespace Animals { /// <summary> /// Angry animal /// Pretty Fast, too /// </summary> public partial class Lion { // // Dead or Alive public Boolean Alive; /// <summary> /// Bad bite /// </summary> public PieceOfAnimal Bite(Animal animalToBite)[...] /// <summary> /// Fatal bite /// </summary> public PieceOfAnimal Kill(Animal animalToKill)[...] } } This is how I prefer seeing my class files (the collapsed form). I've been doing the collapsing by hand a million times by now and I think there should be a way to automate/customize/extend VS to do it the way I want? Every time I debug/hit a breakpoint, it uncollapses and messes up things. If I collapse via the context menu's collapse to outline etc. it also collapses my comments which isn't desired. Appreciate your help!

    Read the article

  • Using multiple databases within one application

    - by Alex
    I have a web application made for several groups of people not connected with each other. Instead of using one database for all of them, I'm thinking about making separate databases. This will improve the speed of the queries and make me free from checking to what group the user belongs. But since I'm working with LINQ to SQL, my classes are explicitly connected with the databases, so I will have to make separate DataContexts for all of the databases. So how can I solve this problem? Or should I just not bother and use one database only?

    Read the article

  • WPF: Change padding depending of container ?

    - by Alex Ilyin
    I have UserControl named MyUserControl, and another UserControl named MyContainer. I want MyUserControl to have padding 10 if it is placed inside MyContainer and 15 otherwise. Shortly, I want <MyContainer> <MyUserControl> Hello </MyUserControl> </MyContainer> to look like <MyContainer> <UserControl Padding="10"> Hello </UserControl> <MyContainer> and <MyUserControl> Hello </MyUserControl> to look like <UserControl Padding="15"> Hello </UserControl>

    Read the article

  • Dump to CSV/Postgres memory

    - by alex
    I have a large table (300 million lines) that I would like to dump to a csv - I need to do some processing that cannot be done with SQL. Right now I am using Squirrel as a client, and it does not apparently deal very well with large datasets - at least as far as I can tell from my own (limited) experience. If I run the query on the actual host, will it use less memory? Thanks for any help.

    Read the article

  • What is a practical use for a closure in JavaScript?

    - by alex
    I'm trying my hardest to wrap my head around JavaScript's closures. I get that by returning an inner function, it will have access to any variable defined in it's immediate parent. Where would this be useful to me? Perhaps I haven't quite got my head around it yet. Most of the examples I have seen online don't provide any real world code, just vague examples. Can someone show me a real world use of a closure? Is this one, for example? var warnUser = function (msg) { var calledCount = 0; return function() { calledCount++; alert(msg + '\nYou have been warned ' + calledCount + ' times.'); }; }; var warnForTamper = warnUser('You can not tamper with our HTML.'); warnForTamper(); warnForTamper(); Thanks

    Read the article

  • Not sure why I'm getting a NullPointerException when creating a Swing component

    - by Alex
    The error occurs when creating the Box object. public void drawBoard(Board board){ for(int row = 0; row < 8; row++){ for(int col = 0; col < 8; col++){ Box box = new Box(board.getSquare(col, row).getColour(), col, row); squarePanel[col][row].add(box); } } Board is given from the Game constructor here (another class): public Game() throws Throwable{ View graphics = new View(); board = new Board(); board.setDefault(); graphics.drawBoard(board); } The Board constructor looks like this: public Board(){ grid = new Square[COLUMNS][ROWS]; for(int row = 0; row < 8; row++){ for(int col = 0; col < 8; col++){ grid[col][row] = new Square(this); } } for(int row = 0; row < 8; row++){ for(int col = 0; col < 4; col++){ int odd = 2*col + 1; int even = 2*col; getSquare(odd, row).setColour(Color.BLACK); getSquare(even, row).setColour(Color.WHITE); } } } And finally the Box class: class Box extends JComponent{ Color boxColour; int col, row; public Box(Color boxColour, int col, int row){ this.boxColour = boxColour; this.col = col; this.row = row; repaint(); } public void paint(Graphics drawBox){ drawBox.setColor(boxColour); drawBox.drawRect(50*col, 50*row, 50, 50); drawBox.fillRect(50*col, 50*row, 50, 50); } } So while looping through the array, it uses the two integers as coordinates to create the Box. The coordinates are referenced and then repaint() is run. The box also gets the colour, using the two integers, from the Square in the Board class. Since the colour is already set, before the drawBoard(board) method is run, that shouldn't be a problem, right? Exception in thread "main" java.lang.NullPointerException at View.drawBoard(View.java:38) at Game.<init>(Game.java:21) at Game.main(Game.java:14) The relevant part of Square import java.awt.Color; public class Square { private Piece piece; private Board board; private Color squareColour; public Square(Board board){ this.board = board; } public void setColour(Color squareColour){ this.squareColour = squareColour; } public Color getColour(){ return squareColour; }

    Read the article

< Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >