Search Results

Search found 349 results on 14 pages for 'fred weston'.

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

  • Javascript callback with AJAX + jQuery

    - by Fred
    Hey! I have this jQuery code (function () { function load_page (pagename) { $.ajax({ url: "/backend/index.php/frontend/pull_page/", type: "POST", data: {page: pagename}, success: function (json) { var parsed = $.parseJSON(json); console.log(parsed); return parsed; }, error: function (error) { $('#content').html('Sorry, there was an error: <br>' + error); return false; } }); } ... var json = load_page(page); console.log(json); if (json == false) { $('body').fadeIn(); } else { document.title = json.pagename + ' | The Other Half | freddum.com'; $("#content").html(json.content); $('#header-navigation-ul a:Contains('+page+')').addClass('nav-selected'); $('body').fadeIn(); } })(); and, guessed it, it doesn't work. The AJAX fires fine, the server returns valid JSON but the console.log(json); returns undefined and the js crashes when it gets to json.pagename. The first console.log(parsed) also returns good data so it's just a problem with the return (I think). I knew I was clutching at straws and would be extremely if this worked, but it doesn't. To be honest, I don't know how to program callback functions for this situation. Any help is greatly appreciated!

    Read the article

  • Open Source 2D Game Engine that supports Hexagon Maps for .NET

    - by Fred F.
    Hello, I cannot find a 2D game engine to create hexagon maps for .net. The best I can find is Xconq (http://sourceforge.net/projects/xconq/) and pygame. Does anybody where I can find any? preferrably one like xconq. Thank you for your time and effort. I really apprecate it. Edit: I would like to have feature of a strategic nature. Like adding custom AIs, path finding, etc. Xcong is an engine for turn-based strategy games.

    Read the article

  • Is it faster to do the pages first and CSS second, or should I do them at the same time?

    - by Fred Haslam
    I have been tasked with building a new web project from scratch, with the exception of reusing CSS files (the look and feel) from an existing project. In the past I have always completed development of the functionality and the web-ui before considering the appearance. This is mostly due to CSS development overlapping with the tail end of the project. I now have the opportunity to integrate a static set of CSS as I build the application. I have no experience with this circumstance. Would it be faster to develop the project and web-pages first, then integrate the CSS; or would it be faster to integrate the CSS as part of page development?

    Read the article

  • Why do I get a nullpointerexception at line ds.getPort in class L1?

    - by Fred
    import java.awt.; import java.awt.event.; import javax.swing.; import java.io.; import java.net.; import java.util.; public class Draw extends JFrame { /* * Socket stuff */ static String host; static int port; static int localport; DatagramSocket ds; Socket socket; Draw d; Paper p = new Paper(ds); public Draw(int localport, String host, int port) { d = this; this.localport = localport; this.host = host; this.port = port; try { ds = new DatagramSocket(localport); InetAddress ia = InetAddress.getByName(host); System.out.println("Attempting to connect DatagramSocket. Local port " + localport + " , foreign host " + host + ", foreign port " + port + "..."); ds.connect(ia, port); System.out.println("Success, ds.localport: " + ds.getLocalPort() + ", ds.port: " + ds.getPort() + ", address: " + ds.getInetAddress()); Reciever r = new Reciever(ds); r.start(); } catch (Exception e) { e.printStackTrace(); } setDefaultCloseOperation(EXIT_ON_CLOSE); getContentPane().add(p, BorderLayout.CENTER); setSize(640, 480); setVisible(true); } public static void main(String[] args) { int x = 0; for (String s : args){ if (x==0){ localport = Integer.parseInt(s); x++; } else if (x==1){ host = s; x++; } else if (x==2){ port = Integer.parseInt(s); } } Draw d = new Draw(localport, host, port); } } class Paper extends JPanel { DatagramSocket ds; private HashSet hs = new HashSet(); public Paper(DatagramSocket ds) { this.ds=ds; setBackground(Color.white); addMouseListener(new L1(ds)); addMouseMotionListener(new L2()); } public void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.black); Iterator i = hs.iterator(); while(i.hasNext()) { Point p = (Point)i.next(); g.fillOval(p.x, p.y, 2, 2); } } private void addPoint(Point p) { hs.add(p); repaint(); } class L1 extends MouseAdapter { DatagramSocket ds; public L1(DatagramSocket ds){ this.ds=ds; } public void mousePressed(MouseEvent me) { addPoint(me.getPoint()); Point p = me.getPoint(); String message = Integer.toString(p.x) + " " + Integer.toString(p.y); System.out.println(message); try{ byte[] data = message.getBytes("UTF-8"); //InetAddress ia = InetAddress.getByName(ds.host); String convertedMessage = new String(data, "UTF-8"); System.out.println("The converted string is " + convertedMessage); DatagramPacket dp = new DatagramPacket(data, data.length); System.out.println(ds.getPort()); //System.out.println(message); //System.out.println(ds.toString()); //ds.send(dp); /*System.out.println("2Sending a packet containing data: " +data +" to " + ia + ":" + d.port + "...");*/ } catch (Exception e){ e.printStackTrace(); } } } class L2 extends MouseMotionAdapter { public void mouseDragged(MouseEvent me) { addPoint(me.getPoint()); Point p = me.getPoint(); String message = Integer.toString(p.x) + " " + Integer.toString(p.y); //System.out.println(message); } } } class Reciever extends Thread{ DatagramSocket ds; byte[] buffer; Reciever(DatagramSocket ds){ this.ds = ds; buffer = new byte[65507]; } public void run(){ try { DatagramPacket packet = new DatagramPacket(buffer, buffer.length); while(true){ try { ds.receive(packet); String s = new String(packet.getData()); System.out.println(s); } catch (Exception e) { e.printStackTrace(); } } } catch (Exception e) { e.printStackTrace(); } } }

    Read the article

  • entity framework vNext wish list

    - by Fred Yang
    I have been intensively studying and use ef4 in my project. I do feel the improvement that it has over version 1. But I found that I have something I cannot get around easily. Here is a list I want it to be better in ef vNext. the model designer should allow multiple view of the same model, so that I don't need cram all my entity into a single view. respect user's manual edit of edmx. Currently, the some database view object simply can not be imported to the model because the designer "smartly" think that the view does not have a primary key, so that I have to manually edit the edmx to correct designer's behavior. But in the next "update from database" task, designer will revert my customization. For now, I simply fallback to manually edit the edmx file at all, or I have to use compare tool to keep the new update, and rollback and put the new update into my old edmx file manually. Designer should be improved to allow default behavior and user's manual control. I want control not to let the designer refresh the change of imported object. support user defined table function. linq is about Composability, stored proc dos not support composability. I wish I could use user defined table function which support this. What are you wishes for EF vNext?

    Read the article

  • how come we need not close the handle returned by ShellExecute ?

    - by fred-hh
    On success, ShellExecute returns a handle. Do we need to close this handle, and if so, how ? According to examples published my Microsoft, we need not close this handle. But the doc of ShellExecute itself is mute on the subject. Can you confirm we indeed do not need to close this handle ? But then, how can a handle be valid and in no need of being closed ??? Which of the following statements is/are true: the handle is invalid and we can't do anything with it; the handle is never freed and there is a (Microsoft-sponsored) memory leak (until the caller program ends); the handle is automatically freed by the system at some time and never reused afterwards (- another kind of resource leak). Only on trying to use it can we know whether it still points to something. what else ?

    Read the article

  • Animating UIImageView iPhone

    - by Fred Dpn
    Hi, i'm having trouble about animating an Image in a UIImageView. I've created an image view in interface builder and linked it to its iboutlet. Here is my code. @interface Game : UIViewController <UIAccelerometerDelegate>{ IBOutlet UIImageView *diying; } @property (nonatomic, retain) UIImageView *diying; In the viewDidLoad method i've written this code NSArray * imageArray = [[NSArray alloc] initWithObjects: [UIImage imageNamed:@"Die1.gif"], [UIImage imageNamed:@"Die2.gif"], [UIImage imageNamed:@"Die3.gif"], [UIImage imageNamed:@"Die4.gif"], nil]; diying.animationImages = imageArray; diying.animationDuration = 1.1; diying.contentMode = UIViewContentModeBottomLeft; [diying startAnimating]; [super viewDidLoad]; which is a adaptation of what i've found here : http://icodeblog.com/2009/07/24/iphone-programming-tutorial-animating-a-game-sprite/ NB : those .gif files are simple images and are not animated. I did the tutorial and it worked fine but i can't figure out why it my adaptation doesn't work !

    Read the article

  • Calling app_code folder from web application project

    - by Fred
    I am developing a module for DotNetNuke and have used a DotNetNuke Compiled Module template to create the module in the DesktopModule folder. I then get a Web Application Project under the DNN website in my Visual Studio 2008. Now I want to use DAL and BLL which are created in DNN app_code folder. But when I add them in code behind it can't find them. How do I tell my Web Application Project to access the app_code folder in the website "projcet"? Thanks in advance!

    Read the article

  • Group partial class shortcut

    - by Fred Yang
    I have to cs file for one partial class. I know that I can modify project file to group them together like way that vs.net group *.aspx and *.aspx.cs, but is there a way to do that in vs.net IDE directly?

    Read the article

  • PLEASE HELP JAVA/SQL question

    - by fred-ghosn
    Hello everyone, well I'm new here and I really need some help.. I want to create a table and this table's name will be inserted from a textfield. However when I run the query it's giving me an error, any help on this one? Ill paste the code here: public boolean CreateTable() { TableNumber=jTextField4.getText(); try { String password = null; String s = "CREATE TABLE '"+TableNumber+'" (Item char(50),Price char(50))"; ConnectionForOrders(); stmt = conn.createStatement(); stmt.executeUpdate(s); boolean f=false; ConnectionForOrdersclose();

    Read the article

  • Problem with SQLite executemany

    - by Strider1066
    I can't find my error in the following code. When it is run a type error is given for line: cur.executemany(sql % itr.next()) = 'function takes exactly 2 arguments (1 given), import sqlite3 con = sqlite3.connect('test.sqlite') cur = con.cursor() cur.execute("create table IF NOT EXISTS fred (dat)") def newSave(className, fields, objData): sets = [] itr = iter(objData) if len(fields) == 1: sets.append( ':' + fields[0]) else: for name in fields: sets.append( ':' + name) if len(sets)== 1: colNames = sets[0] else: colNames = ', '.join(sets) sql = " '''insert into %s (%s) values(%%s)'''," % (className, colNames) print itr.next() cur.executemany(sql % itr.next()) con.commit() if __name__=='__main__': newSave('fred', ['dat'], [{'dat':1}, {'dat':2}, { 'dat':3}, {'dat':4}]) I would appreciate your thoughts.

    Read the article

  • Can a user be a member of multiple Organization Units (OU) in Active Directory ?

    - by Stormshadow
    Can a user be a member of multiple Organization Units (OU) in Active Directory ? Also, is there a standard format mentioned by Microsoft on how an OU should be created and what its attributes are ? I found this in Wikipedia "However, Organizational Units are just an abstraction for the administrator, and do not function as true containers; the underlying domain operates as if objects were all created in a simple flat-file structure, without any OUs. It is not possible for example to create two user accounts with an identical username in two separate OUs, such as "fred.staff-ou.domain" and "fred.student-ou.domain"."

    Read the article

  • What problem did MS solve by creating PowerShell? [closed]

    - by Fred
    I'm asking because PowerShell confuses me. I've been trying to write some deployment scripts using PowerShell and I've been less than enthused by the result. I have a co-worker who loves PowerShell and defends it at every turn. Said co-worker claims PowerShell was never written to be a strong shell, but instead was written to: a) Allow you to peek and poke at .NET assemblies on the command-line (why is this a reason for PowerShell to exist?) b) To be hosted in .NET applications for automation, similar to DCOP in KDE and how Gnome is using CORBA. c) to be treated as ".NET script" rather than as an actual shell (related to b). I've always felt like Windows was missing a decent way to bang out automation scripts. cmd is too simplistic in many cases, and WSH is too obtuse (although the combination can be used successfully, I'm not a fan). When I first heard about PowerShell I felt like Windows was finally getting a decent shell that would be able to help with automation of many tasks, but recent experiences, and my co-worker, tell me otherwise. To be clear, I don't take issue with the fact that it's built on .NET, or that it passes objects around rather than text (despite my Unix background :]), and I'm not arguing that PowerShell is useless, but from what I can see, it doesn't solve the problem I was hoping it would solve very well. As soon as you step outside of the .NET/Powershell world, things quit being nice and cozy for you. So with all that out of the way, what problem did MS solve by creating PowerShell, or is it some political bastard child as I suspect? I've googled and haven't hit upon anything that sufficiently answered that for me, but the more citations the better.

    Read the article

  • Homemade fstat to get file size, always return 0 length.

    - by Fred
    Hello, I am trying to use my own function to get the file size from a file. I'll use this to allocate memory for a data structure to hold the information on the file. The file size function looks like this: long fileSize(FILE *fp){ long start; fflush(fp); rewind(fp); start = ftell(fp); return (fseek(fp, 0L, SEEK_END) - start); } Any ideas what I'm doing wrong here?

    Read the article

  • Migrating Data to MSSQL 2008

    - by Fred Clown
    I am trying to migrate data from an Informix database to MSSQL 2008. I've got quite a lot of data to move. I've been try multiple methods to get the data over, and so far SQLBulkCopy in multiple chunks seems to be the fastest that I can find. Does anyone know of a faster means of getting the data over? I'm trying to cut down on the transfer time so that on my cut-over date I don't run out of time to do the full cut-over. Thanks.

    Read the article

  • Loop with pointer arithmetic refuse to stay within boundary in C. Gives me segfault.

    - by Fred
    Hi have made this function which is made to replicate an error that I can't get past. It looks like this: void enumerate(double *c, int size){ while(c < &c[size]){ printf("%lf\n", *c); c++; } } I have added some printf's in there and it gives me: Adressof c: 0x100100080, Adressof c + size: 0x1001000a8 I then also print the address of c for each iteration of the loop, it reaches 0x1001000a8 but continues past this point even though the condition should be false as far as I can tell until I get a segfault. If anyone can spot the problem, please tell me, I have been staring at this for a while now. Thanks.

    Read the article

  • CGAffineTransformMakeRotation goes the other way after 180 degrees (-3.14)

    - by TheKillerDev
    So, i am trying to do a very simple disc rotation (2d), according to the user touch on it, just like a DJ or something. It is working, but there is a problem, after certain amount of rotation, it starts going backwards, this amount is after 180 degrees or as i saw in while logging the angle, -3.14 (pi). I was wondering, how can i achieve a infinite loop, i mean, the user can keep rotating and rotating to any side, just sliding his finger? Also a second question is, is there any way to speed up the rotation? Here is my code right now: #import <UIKit/UIKit.h> @interface Draggable : UIImageView { CGPoint firstLoc; UILabel * fred; double angle; } @property (assign) CGPoint firstLoc; @property (retain) UILabel * fred; @end @implementation Draggable @synthesize fred, firstLoc; - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; angle = 0; if (self) { // Initialization code } return self; } -(void)handleObject:(NSSet *)touches withEvent:(UIEvent *)event isLast:(BOOL)lst { UITouch *touch =[[[event allTouches] allObjects] lastObject]; CGPoint curLoc = [touch locationInView:self]; float fromAngle = atan2( firstLoc.y-self.center.y, firstLoc.x-self.center.x ); float toAngle = atan2( curLoc.y-(self.center.y+10), curLoc.x-(self.center.x+10)); float newAngle = angle + (toAngle - fromAngle); NSLog(@"%f",newAngle); CGAffineTransform cgaRotate = CGAffineTransformMakeRotation(newAngle); self.transform = cgaRotate; if (lst) angle = newAngle; } -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch =[[[event allTouches] allObjects] lastObject]; firstLoc = [touch locationInView:self]; }; -(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { [self handleObject:touches withEvent:event isLast:NO]; }; -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [self handleObject:touches withEvent:event isLast:YES]; } @end And in the ViewController: UIImage *tmpImage = [UIImage imageNamed:@"theDisc.png"]; CGRect cellRectangle; cellRectangle = CGRectMake(-1,self.view.frame.size.height,tmpImage.size.width ,tmpImage.size.height ); dragger = [[Draggable alloc] initWithFrame:cellRectangle]; [dragger setImage:tmpImage]; [dragger setUserInteractionEnabled:YES]; dragger.layer.anchorPoint = CGPointMake(.5,.5); [self.view addSubview:dragger]; I am open to new/cleaner/more correct ways of doing this too. Thanks in advance.

    Read the article

  • How to separate sets of numbers onto separate lines

    - by Fred
    About the script: The script below will create 300 sets of random characters. What is presently happening, is that it creates them but shows them all on one line, in one big chunk. With all the searching and testing I've done to try and achieve this, I have had no success. I would like to know which code and where to put it, so that each SET (300) of 15 characters long, will show and be saved to file. Here is my script: <?php function GetID($x){ $characters = array_merge(range('A','Z'),range('a','z'),range(2,9)); shuffle($characters); for($x=0;$x<=299;$x++){ } for (; strlen($ReqID)<$x;){ $ReqID .= $characters[mt_rand(0, count($characters))]; } return $ReqID; } $ReqID .= GetID(5); $ReqID .= "-"; $ReqID .= GetID(5); $ReqID .= "-"; $ReqID .= GetID(5); echo $ReqID; $fh = fopen("file.txt","a+"); fwrite($fh, ("$ReqID")."\n"); fclose($fh); ?>

    Read the article

  • How do I implement a DataGrid with an MVVM approach.

    - by Fred
    Hi, I'd like to implement a sort of Addressbook/Contactbook using a Datagrid (or a List) and the MVVM pattern. Something like in Outlook/Thunderbird, where you've a list of your contacts displayed with a 2-3 main fields (name surname for example), and when you double-click a contact, then you get a new modal box that displays all the details of this specific contact. Since a couple of weeks/months, I'm reading a lot of stuff about MVVM pattern on the net, but somehow, I get confused. Until now, I could find any sample like this. (perhaps, I searched wrong?) How could I organize such an application? Thx in advance for your help.

    Read the article

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