Daily Archives

Articles indexed Friday March 30 2012

Page 12/18 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Bullet physics in python and pygame

    - by Pomg
    I am programming a 2D sidescroller in python and pygame and am having trouble making a bullet go farther than just farther than the player. The bullet travels straight to the ground after i fire it. How, in python code using pygame do I make the bullet go farther. If you need code, here is the method that handles the bullet firing: self.xv += math.sin(math.radians(self.angle)) * self.attrs['speed'] self.yv += math.cos(math.radians(self.angle)) * self.attrs['speed'] self.rect.left += self.xv self.rect.top += self.yv

    Read the article

  • Matrix rotation of a rectangle to "face" a given point in 2d

    - by justin.m.chase
    Suppose you have a rectangle centered at point (0, 0) and now I want to rotate it such that it is facing the point (100, 100), how would I do this purely with matrix math? To give some more specifics I am using javascript and canvas and I may have something like this: var position = {x : 0, y: 0 }; var destination = { x : 100, y: 100 }; var transform = Matrix.identity(); this.update = function(state) { // update transform to rotate to face destination }; this.draw = function(ctx) { ctx.save(); ctx.transform(transform); // a helper that just calls setTransform() ctx.beginPath(); ctx.rect(-5, -5, 10, 10); ctx.fillStyle = 'Blue'; ctx.fill(); ctx.lineWidth = 2; ctx.stroke(); ctx.restore(); } Feel free to assume any matrix function you need is available.

    Read the article

  • How do I repeatedly move an image by 1 pixel?

    - by Will
    I have a method that is moving a UIImageView called shootImg across the screen: -(IBAction)shoot{ if (appDelegate.shootInt > 0) { if (direction == 1) { shootImg.center = CGPointMake(shootImg.center.x+1, shootImg.center.y); appDelegate.shootInt = appDelegate.shootInt - 1; shootLabel.text = [NSString stringWithFormat:@"%d", appDelegate.shootInt]; } This does seem to work. But it only moves shootImage 1 pixel. What I want to do is make it repeatedly move 1 pixel. I tried a while loop but that didn't seem to work. I'm not using cocos2d or anything like that and if you need to see more code just ask. Thanks :)

    Read the article

  • Can I get enough experience to get an industry job just by reading books?

    - by MahanGM
    I've been recently working with DirectX and getting familiar with game engines, sub-systems and have done game development for the last 5 years. I have a real question for those whom have worked in larger game making companies before. How is it possible to get to into these big game creators such as Ubisoft, Infinity Ward or EA. I'm not a beginner in my field and I'm going to produce a real nice 2D platform with my team this year, which is the result of 5 years 2D game creation experience. I'm working with prepared engines such as Unity3D or Game Maker software and using .Net with C# to write many tools for our production and proceeding in my way but never had a real engine programming experience 'till now. I'm now reading good books around this topic but I wanted to know: Is it possible to become an employee in big game company by just reading books? I mean beside having an active mind and new ideas and being a solution solver.

    Read the article

  • How do I draw a 2d plane and rotate camara (To be a board) in a 3d XNA game?

    - by Mech0z
    I am trying to create a simple board game, but the 3d part of this is really killing me. From what I can gather I have created a plane, but it never moves even though I turn the camara, but that partially makes sense as I only turn the camara with a 3d model, but in my head that makes 0 sense, in my head if I turn the camara it should affect ALL my models? But with this code the camara only "cares" about the 3d cylinder, the plane is just completely still private void OnDraw(object sender, GameTimerEventArgs e) { SharedGraphicsDeviceManager.Current.GraphicsDevice.Clear(Color.CornflowerBlue); foreach (ModelMesh mesh in cylinderModel.Meshes) { foreach (BasicEffect effect in mesh.Effects) { //effect.World = Matrix.CreateRotationX((float)e.TotalTime.TotalSeconds * 2); effect.View = Matrix.CreateLookAt(cameraPosition, Vector3.Zero, Vector3.Up); effect.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 10000.0f); effect.EnableDefaultLighting(); } mesh.Draw(); } //cameraPosition.Z -= 5.0f; _effect.World = Matrix.CreateRotationZ((MathHelper.ToRadians(((float)e.TotalTime.Milliseconds / 2) % 360))); foreach (EffectPass pass in _effect.CurrentTechnique.Passes) { pass.Apply(); SharedGraphicsDeviceManager.Current.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleStrip, _vertices, 0, 1, VertexPositionColor.VertexDeclaration); } } Is there a way to get the camara to affect all models?

    Read the article

  • New way of integrating Openfeint in Cocos2d-x 0.12.0

    - by Ef Es
    I am trying to implement OpenFeint for Android in my cocos2d-x project. My approach so far has been creating a button that calls a static java method in class Bridge using jnihelper functions (jnihelper only accepts statics). Bridge has one singleton attribute of type OFAndroid, that is the class dynamically calling the Openfeint Api methods, and every method in the bridge just forwards it to the OFAndroid object. What I am trying to do now is to initialize the openfeint libraries in the main java class that is the one calling the static C++ libraries. My problem right now is that the initializing function void com.openfeint.api.OpenFeint.initialize(Context ctx, OpenFeintSettings settings, OpenFeintDelegate delegate) is not accepting the context parameter that I am giving him, which is a "this" reference to the main class. Main class extends from Cocos2dxActivity but I don't have any other that extends from Application. Any suggestions on fixing it or how to improve the architecture? EDIT: I am trying a new solution. Make the bridge class into an Application child, is called from Main object, initializes OpenFeint when created and it can call the OpenFeint functions instead of needing an additional class. The problem is I still get the error. 03-30 14:39:22.661: E/AndroidRuntime(9029): Caused by: java.lang.NullPointerException 03-30 14:39:22.661: E/AndroidRuntime(9029): at android.content.ContextWrapper.getPackageManager(ContextWrapper.java:85) 03-30 14:39:22.661: E/AndroidRuntime(9029): at com.openfeint.internal.OpenFeintInternal.validateManifest(OpenFeintInternal.java:885) 03-30 14:39:22.661: E/AndroidRuntime(9029): at com.openfeint.internal.OpenFeintInternal.initializeWithoutLoggingIn(OpenFeintInternal.java:829) 03-30 14:39:22.661: E/AndroidRuntime(9029): at com.openfeint.internal.OpenFeintInternal.initialize(OpenFeintInternal.java:852) 03-30 14:39:22.661: E/AndroidRuntime(9029): at com.openfeint.api.OpenFeint.initialize(OpenFeint.java:47) 03-30 14:39:22.661: E/AndroidRuntime(9029): at nurogames.fastfish.NuroFeint.onCreate(NuroFeint.java:23) 03-30 14:39:22.661: E/AndroidRuntime(9029): at nurogames.fastfish.FastFish.onCreate(FastFish.java:47) 03-30 14:39:22.661: E/AndroidRuntime(9029): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069) 03-30 14:39:22.661: E/AndroidRuntime(9029): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2751)

    Read the article

  • jQuery ajax post of jpg image to .net webservice. Image results corrupted

    - by sosergio
    I have a phonegap jquery app that opens the camera and take a picture. I then POST this picture to a .net webservice, wich I've coded. I can't use phonegap FileTransfer because such isn't supported by Bada os, wich is a requirement. I believe I've successfully loaded the image from phonegap FileSystem API, I've attached it into an .ajax type:post, I've even received it from .net side, but when .net save the image into the server, the image results corrupted. It seems to me that two sides of the communication have different data type. Has anyone experience in this? Any help will be appreciated. This is my code: //PHONEGAP CAMERA ACCESS (summed up) navigator.camera.getPicture(onGetPictureSuccess, onGetPictureFail, { quality: 50, destinationType:Camera.DestinationType.FILE_URI }); window.resolveLocalFileSystemURI(imageURI, onResolveFileSystemURISuccess, onResolveFileSystemURIError); fileEntry.file(gotFileSuccess, gotFileError); new FileReader().readAsDataURL(file); //UPLOAD FILE function onDataReadSuccess(evt) { var image_data = evt.target.result; var filename = unique_id(); var filext = "jpg"; $.ajax({ type : 'POST', url : SERVICE_BASE_URL+"/fotos/"+filename+"?ext="+filext, cache: false, timeout: 100000, processData: false, data: image_data, contentType: 'image/jpeg', success : function(data) { console.log("Data Uploaded with success. Message: "+ data); $.mobile.hidePageLoadingMsg(); $.mobile.changePage("ok.html"); } }); } On my .net Web Service this is the method that gets invoked: public string FotoSave(string filename, string extension, Stream fileContent) { string filePath = HttpContext.Current.Server.MapPath("~/foto_data/") + "\\" + filename; FileStream writeStream = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write); int Length = 256; Byte[] buffer = new Byte[Length]; int bytesRead = readStream.Read(buffer, 0, Length); // write the required bytes while (bytesRead > 0) { writeStream.Write(buffer, 0, bytesRead); bytesRead = readStream.Read(buffer, 0, Length); } readStream.Close(); writeStream.Close(); }

    Read the article

  • IE7/IE8 javascript drop down menu used to redirect not working

    - by Robbiegod
    The error I see from IE7/IE8 in Jquery v1.7.2 and v.1.7.1 - i tried both: SCRIPT438: Object doesn't support property or method 'apply' My Code: <form> <select id="stateD" OnChange="showState()"> <option value="none" selected="selected">==========</option> <option value="http://www.google.com">google</option> <option value="http://www.yahoo.com">Yahoo</option> </select> </form> My Javascript - I have this pasted just below the webform: <script type="text/javascript"> function showState(){ oStates = document.getElementById("stateD"); var jLink = $("#stateD :selected").val(); if (jLink == undefined || jLink == "none" ){ alert("Please Select a State"); } else{ document.location.href=jLink}; } </script> I'm not using 2 libraries so i don't get why its having a problem. All that is supposed to happen is you select a url from the drop down menu and it auto sends you to that url that is in the value of the option tag. Works everywhere else, not sure why IE has to be such a jerk today. I'd post a url but i can't at the moment. its private. has anyone encountered this issue before?

    Read the article

  • why number 9 in kill -9 command in unix?

    - by Alby
    I understand it's off topic, I couldn't find anywhere online and I was thinking maybe programming gurus in the community might know this. I usually use kill -9 pid to kill the job. I always wondered the origin of 9. I looked it up online, and it says "9 Means KILL signal that is not catchable or ignorable. In other words it would signal process (some running application) to quit immediately" (source: http://wiki.answers.com/Q/What_does_kill_-9_do_in_unix_in_its_entirety) But, why 9? and what about the other numbers? is there any historical significance or because of the architecture of Unix? Thanks!

    Read the article

  • How to catch any exception (System.Exception) without a warning in F#?

    - by LLS
    I tried to catch an Exception but the compiler gives warning: This type test or downcast will always hold let testFail () = try printfn "Ready for failing..." failwith "Fails" with | :? System.ArgumentException -> () | :? System.Exception -> () The question is: how to I do it without the warning? (I believe there must be a way to do this, otherwise there should be no warning) Like C# try { Console.WriteLine("Ready for failing..."); throw new Exception("Fails"); } catch (Exception) { }

    Read the article

  • java.lang.ClassNotFoundException in Netbeans. 5 hours to fix

    - by user1304281
    Hi I've got to submit an interpreter assignment tonight and all of a sudden it stopped working! It was working yesterday but now when I try to create a class instance at runtime I get classnotfoundexception. My project has no libraries or dependencies, I've written everything myself. I've googled around and it seems to be an issue with classpath but I've had no luck fooling with the project properties on netbeans. Here's some code: package interpreter; import interpreter.bytecode.ByteCode; import java.io.*; import java.lang.reflect.*; class ByteCodeLoader { //.... String codeClass = CodeTable.CodeTable.get(args[0]); ByteCode bytecode = (ByteCode)(Class.forName("interpreter.bytecode."+codeClass).newInstance()); //this throws exception } all of my ByteCodes are contained within a subpackage of interpreter called interpreter.bytecode. I'll be watching this thread so I can answer/clarify any questions immediately. Thanks for your time!

    Read the article

  • jQuery - Display the value of a textbox and input the value to another

    - by user1128694
    Basically I want to get the value of a textbox which is to select a date and output the value that is selected to another textbox. These textboxes are on the same page (different steps of the same page) and the document is loaded when the page is ready on click of the next step, I've tried using: $('#TextBox1').val($('#TextBox2').val()); But this doesn't seem to be working. What is it I am doing wrong?

    Read the article

  • Database advantages? Access, MySQL, msSQL, or any others?

    - by JimZ
    Dear all Stackoverflowers, I just started to learn programming and now I'm putting this question online based on a quote: no question is silly My work needs to develop a order system based on web, which wants a database system. Since using Excel for years as a general office user, I naturally turn this to Access. However, most people say Access is very limited comparing to MySQL or MSSQL, or any other more professional database system. But after developing some functions for my company's order system, I really find Access can fulfill my request. And I also tried MSSQL to develop, which I found it not quite convenient to use. I have searched in stackoverflow and find no general answer about my doubt. Now I am sincerely hoping some experienced and professional developers could clear my doubts. Now I'm listing some Access advantages, which I don't think other database system have. I hope you could help me also find these advantages in others. 1. Access is portable, I can just copy a xxx.accdb file to my company and continue with development. 2. Access is easy to generate helpful table, for example, it will automatically generate a field that can automatically count, could be used as primary key value. 3. it is more compatable with Excel, to display and filter data. 4. importantly, it nerely needs no environment to setup, just needs MS Office to be installed. ............others However, I also find some points that MSSQL is advantaged: 1. security reasons 2. easy to backup, ( just use BACKUP..... sql statement to do it) 3. can edit stored procedure to save some functions to database ...............others specifically, I wish some friends could tell me how to make other database portable? since I usually work both at home and in office. It's a headache to move MSSQL work to my office, since the version of MSSQL is not the same. Thank you all and best regards, :)

    Read the article

  • How to fetch populated associated models in CakePHP when calling read()

    - by Code Commander
    I have the following Models: class Site extends AppModel { public $name = "Site"; public $useTable = "site"; public $primaryKey = "id"; public $displayField = 'name'; public $hasMany = array('Item' => array('foreignKey' => 'siteId')); public function canView($userId, $isAdmin = false) { if($isAdmin) { return true; } return array_key_exists($this->id, $allowedSites); } } and class Item extends AppModel { public $name = "Item"; public $useTable = "item"; public $primaryKey = "id"; public $displayField = 'name'; public $belongsTo = array('Site' => array('foreignKey' => 'siteId')); public function canView($userId, $isAdmin = false) { // My problem appears to be the next line: return $this->Site->canView($userId, $isAdmin); } } In my controller I am doing something like this: $result = $this->Item->read(null, $this->request->id); // Verify permissions if(!$this->Item->canView($this->Session->read('userId'), $this->Session->read('isAdmin'))) { $this->httpCodes(403); die('Permission denied.'); } I notice that in Item->canView() $this->data['Site'] is populated with the column data from the site table. But it merely an array and not an object. On the other hand $this->Site is a Site object, but it has not been populated with the column data from the site table like $this->data. What is the proper way to have CakePHP get the associated model as the object and containing the data? Or am I going about this all wrong? Thanks!

    Read the article

  • EntityFramwork System.OutOfMemoryException on 100MB upload

    - by Win
    Upload works fine for 62MB file. However, it throws exception if it is 100MB. I found few questions in stackoverflow, but none is very specific about datatype. Appreciate your help! ASP.Net 4, IIS7, EntityFramework 4.1, Visual Studio 2010 SP1, SQL 2008 DataType is varbinary(max) applicationHost.config <section name="requestFiltering" overrideModeDefault="Allow" /> web.config <httpRuntime maxRequestLength="1148576" executionTimeout="3600"/> <security > <requestFiltering> <requestLimits maxAllowedContentLength="112400000" /> </requestFiltering> </security>

    Read the article

  • Sound Complete Not Firing (AS3)

    - by JasonMc92
    I have a bit of a quandary. I need to call a function inside a MovieClip once a particular sound has finished playing. The sound is played via a sound channel in an external class which I have imported. Playback is working perfectly. Here is the relevent code from my external class, Sonus. public var SFXPRChannel:SoundChannel = new SoundChannel; var SFXPRfishbeg:Sound = new sfxpr_fishbeg(); var SFXPRfishmid:Sound = new sfxpr_fishmid(); var SFXPRfishend3:Sound = new sfxpr_fishend3(); var SFXPRfishend4:Sound = new sfxpr_fishend4() public function PlayPrompt(promptname:String):void { var sound:String = "SFXPR" + promptname; SFXPRChannel = this[sound].play(); } This is called via an import in the document class "osr", thus I access it in my project via "osr.Sonus.---" In my project, I have the following line of code. osr.Sonus.SFXPRChannel.addEventListener(Event.SOUND_COMPLETE, promptIsFinished); function prompt():void { var level = osr.Gradua.Fetch("fish", "arr_con_level"); Wait(true); switch(level) { case 1: osr.Sonus.PlayPrompt("fishbeg"); break; case 2: osr.Sonus.PlayPrompt("fishmid"); break; case 3: osr.Sonus.PlayPrompt("fishend3"); break; case 4: osr.Sonus.PlayPrompt("fishend4"); break; } } function Wait(yesno):void { gui.Wait(yesno); } function promptIsFinished(evt:Event):void { Wait(false); } osr.Sonus.PlayPrompt(...) and gui.Wait(...) both work perfectly, as I use them in other contexts in this part of the project without error. Basically, after the sound finishes playing, I need Wait(false); to be called, but the event listener does not appear to be "hearing" the SOUND_COMPLETE event. Did I make a mistake somewhere? For the record, due to my project structure, I cannot call the appropriate Wait(...) function from within Sonus. Help?

    Read the article

  • How to insert into data base using multi threading programming [closed]

    - by user1196650
    I am having a method and that method needs to do the following thing: It has to insert records into a database. No insert is done for the same table again. All inserts are into different tables. I need a multi threading logic which inserts the details into db using different threads. I am using oracle db and driver configuration and remaining stuff are perfect. Please help me with an efficient answer. Can anyone could provide me with a skeleton logic of the program.

    Read the article

  • Error in header function

    - by user1178695
    I'm using the php header function for the redirection but it is not working.I'm using the following code. $sql=mysql_query("select * from password where username='$email' and password1 = '$pwd'"); //echo "selct * from password where username='$email' and password = '$pwd'"; $row=mysql_fetch_row($sql); $fieldset=mysql_num_rows($sql); $host=$_SERVER['HTTP_HOST']."/beta/"; if($fieldset>0 && $conEmail !="") { $_SESSION['email']=$email; $_SESSION['Email']=$email; $_SESSION['memberID']=$id; $_SESSION['status']='Admin'; header("location:http://".$host."member.php"); }

    Read the article

  • Apache attack on compromised server, iframe injected by string replace

    - by Quang-Tuan Luong
    My server has been compromised recently. This morning, I have discovered that the intruder is injecting an iframe into each of my HTML pages. After testing, I have found out that the way he does that is by getting Apache (?) to replace every instance of <body> by <iframe link to malware></iframe></body> For example if I browse a file residing on the server consisting of: </body> </body> Then my browser sees a file consisting of: <iframe link to malware></iframe></body> <iframe link to malware></iframe></body> I have immediately stopped Apache to protect my visitors, but so far I have not been able to find what the intruder has changed on the server to perform the attack. I presume he has modified an Apache config file, but I have no idea which one. In particular, I have looked for recently modified files by time-stamp, but did not find anything noteworthy. Thanks for any help. Tuan. PS: I am in the process of rebuilding a new server from scratch, but in the while, I would like to keep the old one running, since this is a business site.

    Read the article

  • Checkboxes in ADF are initially null, where I want them to be 0

    - by Mark Tielemans
    I am using ADF in JDeveloper and don´t have any experience with either of the two. Now I´ve run into quite some trouble yet, but for this particular thing I decided to consult the wisom of stackoverflow. The thing is, I have an edit form for an object that contains 3 checkboxes. The checked values are set to 1, unchecked to 0. In my database, the values are NOT NULL, and I want to keep it that way. The thing is, in the edit form, if the user submits the form leaving any boxes unchecked, it will result in an error, because the unchecked box values apparently remain null. Only after checking and then unchecking the boxes again, their values will be '0' rather than null. I've tried some things, including making the attributes mandatory in the domain BCD, but that just gives a bit more neat error message.. Any help would be greatly appreciated!! EDIT I made a little progress thanks to the guide provided by Joe, but still run into problems. I changed the values that should be checkboxes in my model, making them BOOLEANs where the table columns are NUMBERs (All are also mandatory and have a default value of 0). This automatically changed the corresponding View Object too. In the Application module, this now works great. It shows checkboxes, a checked one will return 1, an untouched one will return 0. However, I deleted the old form, and inserted a new one using the corresponding Data Control. I gave these values the checkbox type. I still had to edit the bindings (which I think reflects the problem, as this is not the case with, say, a model-level defined LOV) and gave them 1 for checked and 0 for unchecked. However, now apart from the original problem still occurring, also the checkboxes cannot be unchecked after checking, and return 0 when checked (and null when left untouched). Even though this has created new problems, it works correctly in my AM. Does someone know what I'm doing wrong in my Swing form?

    Read the article

  • PHP checking/refreashing functions

    - by user1284360
    ok i have a main document that displays a chatbox, what i want is for the chatbox to refreash on everyone who is logged in's screen whenever someone posts a new message... ive tried many methods including sleep timers and new functions that call then sleep and get recalled but this just generates an endless line of the same or little diffrent data making the form unusable until error... this is my code <?php // set error reporting level if (version_compare(phpversion(), "5.3.0", ">=") == 1) error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); else error_reporting(E_ALL & ~E_NOTICE); require_once('inc/login.inc.php'); require_once('inc/chat.inc.php'); // initialization of login system and generation code $oSimpleLoginSystem = new SimpleLoginSystem(); $oSimpleChat = new SimpleChat(); // draw login box echo $oSimpleLoginSystem->getLoginBox(); // draw chat application $sChatResult = '<font color="0x99000"> <a href="Register_form.html">New Account</a><br> login to send a message<br> or register for a new account</font>'; if ($_COOKIE['member_name'] && $_COOKIE['member_pass']) { if ($oSimpleLoginSystem->check_login($_COOKIE['member_name'], $_COOKIE['member_pass'])) { $sChatResult = ""; if($oSimpleLoginSystem->check_privledges($_COOKIE['member_name']) >= 2) { $sChatResult .= "<br>privledge check Working<br>"; } $sChatResult .= "<form action=$_SERVER[PHP_SELF] method='post'> <input type='hidden' name='foo' value='<?= $foo ?>' /> <input type='submit' name='submit' value='Refresh Messages' /> </form>"; $sChatResult .= $oSimpleChat->acceptMessages(); $sChatResult .= "<br><br>"; $sChatResult .= $oSimpleChat->getMessages(); } } echo $sChatResult; ?>

    Read the article

  • Target a link if that link links to the current page?

    - by Des
    this may be a stupid question as I can't seem to find an answer :P Is there a way with javascript/jQuery to Target all links on a page ONLY if they link to the current page? Say i've got a static sidebar on ALL pages, for intents and purposes: <ul id="sidebar"> <li><a href="/one">One</a></li> <li><a href="/two">Two</a></li> <li><a href="/three">Three</a></li> </ul> Notice the code for ALL of them is the same. Let's say I'm on "www.domain.com/two" - Is there a way to target <li><a href="#">Two</a></li> because it's linking to the current page? ***ANSWERED***** The guy deleted his answer - but I used it to create this - var linksToCurrentPage = $('a[href="' + window.location.href + '"]'); if (linksToCurrentPage) { $('a').addClass('currently-active'); }; which worked :)

    Read the article

  • Escape Quote - javascript, struts 2

    - by Ahmed Salah
    I read some struts2 variable in javascript as follows: <javascript type="text/javascript"> var data='<s:property value="simulationInfos"/>'; <javascript> If my simulationInfos contains single quote ', I get the error : unexpected identifier. therefore, I tried to escape the quote as follows: var data='<s:property value="simInfos" escapeJavaScript="true"/>'; and var data='<s:property value="simInfos" escapeHTML="true"/>'; I get the error: Attribute escapeJavaScript (or escapeHTML) invalid for tag property according to TLD. Any Idea?

    Read the article

  • Is it better to store user text (such as a blog entry or private messages) in the database or as flat files?

    - by Fredashay
    I'm building a social networking type site that will be storing large chunks of text that's entered by users, such as blog entries and private messages. As such, these will be entered once, with minimal revisions, but many reads by multiple users over time. I'm using MySQL, by the way. My concerns are: Storing large blocks of text on the database will fill the database to capacity eventually. I read somewhere that storing user text in flat files is a security risk? (The filenames will be generated dynamically by the PHP, not by the user.) Storing them as text files may cause them to become out of sync if I ever have to reinitialize the database and restore it from backups. What are all your thoughts and advice, pros and cons?

    Read the article

  • What is wrong with this Asynchronus task?

    - by bluebrain
    the method onPostExecute simply was not executed, I have seen 16 at LogCat but I can not see 16 in LogCAT. I tried to debug it, it seemed that it goes to the first line of the class (package line) after return statement. private class Client extends AsyncTask<Integer, Void, Integer> { protected Integer doInBackground(Integer... params) { Log.e(TAG,10+""); try { socket = new Socket(target, port); Log.e(TAG,11+""); oos = new ObjectOutputStream(socket.getOutputStream()); Log.e(TAG,14+""); ois = new ObjectInputStream(socket.getInputStream()); Log.e(TAG,15+""); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } Log.e(TAG,16+""); return 1; } protected void onPostExecute(Integer result) { Log.e(TAG,13+""); try { Log.e(TAG,12+""); oos.writeUTF(key); Log.e(TAG,13+""); if (ois.readInt() == OKAY) { isConnected = true; Log.e(TAG,14+""); }else{ Log.e(TAG,15+""); isConnected = false; } } catch (IOException e) { e.printStackTrace(); isClosed = true; } } }

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18  | Next Page >