Daily Archives

Articles indexed Monday June 11 2012

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

  • Cannot start tor with vidalia, failed to bind listening port because of tor-socks running

    - by ganjan
    I get these errors trying to run tor with vidalia Apr 19 21:55:15.371 [Notice] Tor v0.2.1.30. This is experimental software. Do not rely on it for strong anonymity. (Running on Linux i686) Apr 19 21:55:15.372 [Notice] Initialized libevent version 1.4.13-stable using method epoll. Good. Apr 19 21:55:15.373 [Notice] Opening Socks listener on 127.0.0.1:9050 Apr 19 21:55:15.373 [Warning] Could not bind to 127.0.0.1:9050: Address already in use. Is Tor already running? Apr 19 21:55:15.373 [Warning] Failed to parse/validate config: Failed to bind one of the listener ports. Apr 19 21:55:15.373 [Error] Reading config failed--see warnings above. I don't think tor is running. Here is a nmap scan of my localhost Starting Nmap 5.21 ( http://nmap.org ) at 2011-04-19 21:59 CEST Nmap scan report for localhost (127.0.0.1) Host is up (0.0000050s latency). Hostname localhost resolves to 2 IPs. Only scanned 127.0.0.1 rDNS record for 127.0.0.1: localhost.localdomain Not shown: 989 closed ports PORT STATE SERVICE 22/tcp open ssh 53/tcp open domain 80/tcp open http 139/tcp open netbios-ssn 445/tcp open microsoft-ds 631/tcp open ipp 3128/tcp open squid-http 3306/tcp open mysql 9000/tcp open cslistener 9050/tcp open tor-socks 10000/tcp open snet-sensor-mgmt I see tor-socks is running here, probably be the cause of the problem. How do I stop this from starting up? I want to use vidalia so I can monitor whats going on.

    Read the article

  • redirect subdomain(weblog) to new domain that can't access .htccss 301

    - by fafa
    I've a problem that I can't find the solution of it in web. I have a blog that has PR 1 and it's subdomain "aaaa.domain.com" that "domain.com" is a blog server. and now i buy a domain "newdomain.com" i want tell google webmaster to redirect old subdomain to this new domain and load trafic to my new domane. but i can't access .htccss to redirect 301. all thing that i can do is put html code in the html . now how can i do this. when i use "Change of Address" in goole webmaster it say:"Restricted to root level domains only" . sorry for bad English.

    Read the article

  • Permissions & File Structure w/ nginx & multiple sites

    - by Michael
    I am using nginx for the first time as a long time Apache user. I setup a Linode to test everything and to eventually port over my websites. Previously I had /home/user/www (wwwroot) I am looking at doing something similar with /srv/www/domain/www (wwwroot) Rather than using /srv/domain (wwwroot), the reason is many of the sites are WordPress and one of the things I do for security is to move the config file one level above wwwroot and can't have multiple configuration files from multiple domains in the same top level folder. Since I own all the sites, I wasn't going to create a user for each domain. My user is a member of www-data and was going to use 2770 for www and have domain/www for each new domain. www would be owned by group www-data. Is this the best way to handle this?

    Read the article

  • Apache log analyzer which manages time spent to serve the request

    - by antispam
    I need to monitor performance in my web server (there's an application server in the back) and create reports for senior management. I've enabled %T/%D in my Apache logs and I would like to know if there's an Apache log analyzer or some other tool which parses these values and manages them showing charts or reports. I am looking mostly for an integrated solution and not in the line of awk+gnuplot scripts.

    Read the article

  • Including Specific Characters with Google Web Fonts

    - by S.K.
    I'm using the Open Sans web font from Google Web Fonts on my website. I only need the basic latin subset, but I do use the Psi (?) character quite often as well and I would like to use the Open Sans version of that character, without having to include the entire greek subset. I looked at this help page which shows how to embed specific characters only using the text parameter, but there's no mention of including specific characters. I tried doing the following to try to combine both font requests into one, but it didn't end up working. <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700&subset=latin' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700&text=%CE%A8' rel='stylesheet' type='text/css'> Is there anyway to accomplish this?

    Read the article

  • Getting the front buffer into a gfx mem surface (Dx9)

    - by lapin
    I'm using DirectX 9 to acquire the frontbuffer. There are a couple of ways I know of to get at the front buffer: GetRenderTargetData() GetFrontBufferData() The MSDN page on both of these API calls state that the data is copied from device memory to system memory. I'd like to copy the front buffer surface directly to another graphics memory surface, as I have other manipulations to perform on the acquired surface before returning it to system memory. I'm creating a D3DUSAGE_DYNAMIC texture (gfx mem texture) and calling GetFrontBufferData() to write the front buffer to my textures surface0. Is this valid? Will the operation remain in gfx memory, or will it need to move to system memory and then back to graphics memory? If this is the case, is what I'm trying to achieve possible?

    Read the article

  • How to detect GLSL warnings?

    - by msell
    After compiling a shader with glCompileShader, I can call glGetShaderiv with GL_COMPILE_STATUS to check if the shader compiled successfully. I can also call glGetShaderInfoLog to get information about possible errors, warnings or other info. The information log returned by this function is unspecified. In a tool where users can write their own shaders, I would like to print all errors and warnings from the compilation, but nothing if no warnings or errors were found. The problem is that the GL_COMPILE_STATUS returns only false if the compilation failed and true otherwise. If no problems were found, some drivers return empty info log from glGetShaderInfoLog, but some drivers can return something else such as "No errors.", which I do not want to print to the user. How is this problem generally solved?

    Read the article

  • Legality of similar games

    - by Jamie Taylor
    This is my first question on GD.SE, and I hope it's in the right place. A little background: I'm an amateur (read: not explicitly employed to develop games, but am employed as a software developer) game developer and took a ComSci with Games Development degree. My Question: What is the legal situation/standpoint of creating a copycat title? I know that there are only N number of ways of solving a problem, and N number of ways to design a piece of software. Say that an independent developer designed a copycat game (a Tetris clone in this example) for instance, and decided to use that game to generate income for themselves as well as interest for their other products. Say the developer adds a disclaimer into the software along the lines of "based on , originally released c. by ." Are there any legal problems/grey areas with the developer in this example releasing this game, commercially? Would they run into legal problems? Should the developer in this example expect cease and desist orders or law suit claims from original publishers? Have original publishers been known to, effectively, kill independent projects because they are a little too close to older titles? I know that there was, at least, one attempt by a group of independent developers to remake Sonic the Hedgehog 2 and Sega shut them down. I also know of Sega shutting down development of the independent Streets of Rage Remake. I know that "but it's an old game, your honour," isn't a great legal standpoint when it comes to defending yourself. But, could an independent developer have a law suit filed against them for re-implementing an older title in a new way? I know that there are a lot of copycat versions of the older titles like Tetris available on app stores (and similar services), and that it would be very difficult for a major publisher to shut them all down. Regardless of this, is making a Tetris (or other game) copycat/clone illegal? We were taught lots of different things at University, but we never covered copyright law. I'm presuming that their thought behind it was "IF these students get jobs in games development, they wont need to know anything about the legal side of it, because their employers will have legal departments... presumably" tl;dr Is it illegal to create a clone or copycat of an old title, and make money from it?

    Read the article

  • What are the advantages to use vector-based fonts over bitmap fonts in (2d) games?

    - by jmp97
    I know that many games are using bitmap fonts. Which are the advantages for vector-based font rendering / manipulation when compared to bitmap fonts and in which scenarios would they matter the most? Prefer a focus on 2d games when answering this question. If relevant, please include examples for games using either approach. Some factors you might consider: amount of text used in the game scaling of text overlaying glyphs and anti-aliasing general rendering quality font colors and styling user interface requirements localisation / unicode text wrapping and formatting cross-platform deployment 2d vs 3d Background: I am developing a simple falling blocks game in 2d, targeted for pc. I would like to add text labels for level, score, and menu buttons. I am using SFML which uses FreeType internally, so vector-based features are easily available for my project. In my view, font sizes in simple games often don't vary, and bitmap fonts should be easier for cross-platform concerns (font-formats and font rendering quality). But I am unsure if I am missing some important points here, especially since I want to polish the looks of the final game.

    Read the article

  • How to achieve best performance in DirectX 9.0 while rendering on multiple monitors

    - by Vibhore Tanwer
    I am new to DirectX, and trying to learn best practice. Please suggest what are the best practices for rendering on multiple monitors different things at the same time? how can I boost performance of application? I have gone through this article http://msdn.microsoft.com/en-us/library/windows/desktop/bb147263%28v=vs.85%29.aspx . I am making use of some pixel shaders to achieve some effects. At most 4 effect(4 shader effects) can be applied at same time. What are the best practices to achieve best performance with DirectX 9.0. I read somewhere that DirectX 11 provides support for parallel rendering, but I am not able to get any working sample for DirectX 11.0. Please help me with this, Any help would be of great value. Thanks

    Read the article

  • Store and create game objects at positions along terrain

    - by Alex
    I have a circular character that rolls down terrain like that shown in the picture below. The terrain is created from an array holding 1000 points. The ground is drawn one screen width infront and one screen width behind. So as the character moves, edges are created infront and edges are removed behind. My problem is, I want to create box2d bodies at certain locations along the path and need a way to store these creator methods or objects. I need some way to store a position at which they are created and some pointer to a function to create them, once the character is in range. I guess this would be an array of some sort that is checked each time the ground is updated and then if in range, the function is executed and removed from the array. But I'm not sure if its even possible to store pointers to functions with parameters included... any help is much appreciated!

    Read the article

  • dirtyFields with itemview

    - by user1449437
    I have a master/detail application that I'm building with backbone marionette. as the user clicks the master rows, the detail will show the row details. users need to be able to edit the row. I'd like the notify them if they try to 'leave' the row before saving. I was thinking that I'd use the dirtyFields plugin for this functionality. Has anyone else used these together? when I swap out my itemview, how do I initialize the plugin? when I close the view, is there anything I should think about to clean up the view? any thoughts would be appreciated. thx

    Read the article

  • Multiple selection datagrid before click on datagrid

    - by Jakub Cermoch
    I have wpf datagrid with multiple selection (model has properties IsSelected...) and it works fine, but when I start program, I have to click on the table first and after that work multiple selection. When I first click on the table it select item under cursor (if i have pressed shift, it select the item too, not do multiple selection). I supposed it can be because of datagrid hasnt focus, but when I do datagrid.Focus() on loaded window, it doesnt helped. Thanks a lot

    Read the article

  • Replacing mysql user authentication with openid

    - by David
    So, I'm working with a really old system which uses a person's mysql database credentials to authenticate to a web site (the database was originally only accessed from the command line, but is now accessed from a php frontend). Because of some internal reasons (and to preserve the user's history), I have to leave the old authentication intact. I've been charged with adding openid authentication to this system. Somehow I need to be able to retrieve a users mysql username and password upon logging into the site through openid (using the Zend framework, by the way). I've thought of simply requiring registration at the first login, where the user must provide their mysql credentials, but I'd rather not store the password plain text. I've also considered blanking everyone's mysql passwords, and just setting the user's mysql username manually (rather than having the user provide this, since they could provide any username). This is turning into a security nightmare. Does anyone have any suggestions for alternatives? This is running on a Linux server, by the way. Also, I can't use mysql pluggable authentication because the mysql version is 5.0 (pluggable authentication requires mysql 5.5), and no, I can't update it.

    Read the article

  • FMOD surround sound openframeworks

    - by user1449425
    Ok, I hope I don't mess this up, I have had a look for some answers but can't find anything. I am trying to make a simple sampler in openframeworks using the FMOD sound player in 3D mode. I can make a single instance work fine (recording a new file using libsndfilerecorder and then playing it back and moving it in surround. However I want to have 8 layers of looping audio that I can record and replace one layer at a time in a live show. I get a lot of problems as soon as I have more than 1 layer. The first part of my question relates to the FMOD 3D modes, it is listener relative, so I have to define the position of my listener for every sound (I would prefer to have head relative mode but I cannot make this work at all. Again this works fine when I am using a single player but with multiple players only the last listener I update actually works. The main problem I have is that when I use multiple players I get distortion, and often a mix of other currently playing sounds (even when the microphone cannot hear them) in my new recordings. Is there an incompatability with libsndfilerecorder and FMOD? Here I initialise the players for (int i=0; i<CHANNEL_COUNT; i++) { lvelocity[i].set(1, 1, 1); lup[i].set(0, 1, 0); lforward[i].set(0, 0, 1); lposition[i].set(0, 0, 0); sposition[i].set(3, 3, 2); svelocity[i].set(1, 1, 1); //player[1].initializeFmod(); //player[i].loadSound( "1.wav" ); player[i].setVolume(0.75); player[i].setMultiPlay(true); player[i].play(); setupHold[i]==false; recording[i]=false; channelHasFile[i]=false; settingOsc[i]=false; } When I am recording I unload the file and make sure the positions of the player that is not loaded are not updating. void fmodApp::recordingStart( int recordingId ){ if (recording[recordingId]==false) { setupHold[recordingId]=true; //this stops the position updating cout<<"Start recording Channel " + ofToString(recordingId+1)+" setup hold is true \n"; pt=getDateName() +".wav"; player[recordingId].stop(); player[recordingId].unloadSound(); audioRecorder.setup(pt); audioRecorder.setFormat(SF_FORMAT_WAV | SF_FORMAT_PCM_16); recording[recordingId]=true; //this starts the libSndFIleRecorder } else { cout<<"Channel" + ofToString(recordingId+1)+" is already recording \n"; } } And I stop the recording like this. void fmodApp::recordingEnd( int recordingId ){ if (recording[recordingId]=true) { recording[recordingId]=false; cout<<"Stop recording" + ofToString(recordingId+1)+" \n"; audioRecorder.finalize(); audioRecorder.close(); player[recordingId].loadSound(pt); setupHold[recordingId]=false; channelHasFile[recordingId]=true; cout<< "File recorded channel " + ofToString(recordingId+1) + " file is called " + pt + "\n"; } else { cout << "Sorry track" + ofToString(recordingId+1) + "is not recording"; } } I am careful not to interrupt the updating process but I cannot see where I am going wrong. Many Thanks

    Read the article

  • Getting jsonString via Jquery coming up empty

    - by NoobCoder
    I'm using asp mvc and I'm getting data in one part of my program like this public List<IncidentPerAreaCount> getIncident() { int RondeboschCounter = 0; int ClaremontCounter = 0; int AthloneCounter = 0; List<IncidentPerAreaCount> IncidentAreaCount = new List<IncidentPerAreaCount>(); IncidentPerAreaCount Rondebosch = new IncidentPerAreaCount(); IncidentPerAreaCount Claremont = new IncidentPerAreaCount(); IncidentPerAreaCount Athlone = new IncidentPerAreaCount(); List<Report> Reports = GetReports(); for (int i = 0; i < Reports.Count(); i++) { if (Reports.AsEnumerable().ElementAt(i).Area == "Rondebosch") { RondeboschCounter++; } else if (Reports.AsEnumerable().ElementAt(i).Area == "Claremont") { ClaremontCounter++; } else if (Reports.AsEnumerable().ElementAt(i).Area == "Athlone") { AthloneCounter++; } } Rondebosch.AreaName = "Rondebosch"; Rondebosch.NumberOfIncidents = RondeboschCounter; Claremont.AreaName = "Claremont"; Claremont.NumberOfIncidents = ClaremontCounter; Athlone.AreaName = "Athlone"; Athlone.NumberOfIncidents = AthloneCounter; IncidentAreaCount.Add(Rondebosch); IncidentAreaCount.Add(Claremont); IncidentAreaCount.Add(Athlone); return IncidentAreaCount; } Then I'm trying to get this string via Jquery var Reports = []; $.ajax({ url: "Home/getIncident", async: false, dataType: 'json', success: function (json) { Reports = json.whatever; } }); alert(Reports); However the alert function keeps coming up empty (ie empty textbox) instead of having a json formatted string with data. Please help...

    Read the article

  • Return numerical array in python

    - by khan
    Okay..this is kind of an interesting question. I have a php form through which user enters values for x and y like this: X: [1,3,4] Y: [2,4,5] These values are stored into database as varchars. From there, these are called by a python program which is supposed to use them as numerical (numpy) arrays. However, these are called as plain strings, which means that calculation can not be performed over them. Is there a way to convert them into numerical arrays before processing or is there something else which is wrong? Helpp!!

    Read the article

  • change JPanel after clicking on a button

    - by Fixus
    I'm building simple GUI for my app. I have couple of JPanels. I want to display them depending on action that was performed by clicking on a JButton. How can I disable one JPanel and enable another one ? Couple of details. I have a class with JFrame where I'm building starting gui. Where I have buttons and some text. Clicking on one of the buttons should change the view in this JFrame my button definition JButton btnStart = new JButton("Start"); btnStart.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } }); btnStart.setBounds(10, 11, 110, 23); contentPane.add(btnStart);

    Read the article

  • C#: Parallel forms, multithreading and "applications in application"

    - by Harry
    First, what I need is - n WebBrowser-s, each in its own window doing its own job. The user should be able to see them all, or just one of them (or none), and to execute commands on each one. There is a main form, without a browser, this one contains control panel for my application. The key feautre is, each browser logs on to secured web page and it needs to stay logged in as long as possible. Well, I've done it, but I'm afraid something is wrong with my approach. The question is: Is code below valid, or rather a nasty hack which can cause problems: internal class SessionList : List<Session> { public SessionList(Server main) { MyRecords.ForEach(record => { var st = new System.Threading.Thread((data) => { var s = new Session(main, data as MyRecord); this.Add(s); Application.Run(s); Application.ExitThread(); }); st.SetApartmentState(System.Threading.ApartmentState.STA); st.Start(record); }); } // some other uninteresting methods here... } What's going on here? Session inherits from Form, so it creates a form, puts WebBrowser into it, and has methods to operate on websites. WebBrowser requires to be run in STA thread, so we provide one for each browser. The most interesting part of it is Application.Run(s). It makes the newly created forms alive and interactive. The next Application.ExitThread() is called after browser window is closed and its controls disposed. Main application stays alive to perform the rest of the cleanup job. When user select "Exit" or "Shutdown" option - first the browser threads are ended, so Application.ExitThread() is called. It all works, but everywhere I can read about "main GUI thread" - and here - I've created many GUI threads. I handle communication between main form and my new forms (sessions) with thread-safe methods using Invoke(). It all works, so is it right or is it wrong? Is everything right with using Application.Run() more than once in one application? :) An ugly hack or a normal practice? This code dies if I start a WebBrowser from the session form thread. It beats me why. It works however if I start WebBrowser (by changing its Url property) from any other thread. I'd like to know more what is really happening in such application. But most of all - I'd like to know if my idea of "applications in application" is OK. I'm not sure what exactly does Application.Run() do. Without it forms created in new threads were dead unresponsive. How is it possible I can call Application.Run() many times? It seems to do exactly what it should, but it seems a little undocumented feature to me. I'm almost sure, that the crashes are caused by WebBrowser component itself (since it's not completely "managed" and "native"). But maybe it's something else.

    Read the article

  • HttpRequestValidationexception on Asp.Net MVC

    - by elranu
    I’m getting an HttpRequestValidationexception with this error message: “A potentially dangerous Request.Form value was detected from the client”. But I have AllowHtml on the property that I’m getting the error. The problem is that later in my code I’m getting the following property to know in witch format I will show my view ControllerContext.HttpContext.Request.Params.AllKeys.Contains("format"). And on this “Param Getter” I’m getting the error. Let’s say my code is similar to the following: public class House { [AllowHtml] public string Text { get; set; } public string Name { get; set; } } [HttpPost, ValidateAntiForgeryToken] public ActionResult CreateTopic(House h) { //business code if(ControllerContext.HttpContext.Request.Params.AllKeys.Contains("format")) { Return view; } } How can I solve this? I already try with the ValidateInput(false) attribute on the controller action method. Any idea?

    Read the article

  • Nested asynchronous calls do not seem to execute as expected

    - by Kristof Van Landschoot
    While trying out jQuery, I have a question that is probably a newbie mistake, but I cannot seem to find the solution. This is the code: $.get("index.html", function() { var i = 0; for (; i < 3; i++) { var lDiv = document.createElement('div'); lDiv.id = 'body-' + i; document.getElementById('body').appendChild(lDiv); $.get('index.html', function(data) { lDiv.innerHTML = "<p>Hello World " + i + "</p>"; }); } }); The output seems to be <div id='body-0'></div> <div id='body-1'></div> <div id='body-2'> <p>Hello World 3</p> </div> I expected the lDiv.innerHTML= code to be executed for each i, but apparently it is only executed for the last i? What am I overlooking?

    Read the article

  • Fabric "TypeError: not all arguments converted during string formatting"

    - by Brian Carpio
    I have the following fabric task: @task def deploy_west_ec2_ami(name, puppetClass, size='m1.small', region='us-west-1', basedn='joe', ldap='arch-ldap-01', secret='secret', subnet='subnet-d43b8ab d', sgroup='sg-926578fe'): execute(deploy_ec2_ami, name='%s',puppetClass='%s',size='%s',region='%s',basedn='%s',ldap='%s',secret='%s',subnet='%s',sgroup='%s' %(name, puppetClass , size, region, basedn, ldap, secret, subnet, sgroup)) However when I run the command: fab deploy_west_ec2_ami:test,java I get the following Traceback: Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/fabric/main.py", line 710, in main *args, **kwargs File "/usr/local/lib/python2.6/dist-packages/fabric/tasks.py", line 321, in execute results['<local-only>'] = task.run(*args, **new_kwargs) File "/usr/local/lib/python2.6/dist-packages/fabric/tasks.py", line 113, in run return self.wrapped(*args, **kwargs) File "/home/bcarpio/Projects/githubenterprise/awsdeploy/fabfile.py", line 35, in deploy_west_ec2_ami execute(deploy_ec2_ami, name='%s',puppetClass='%s',size='%s',region='%s',basedn='%s',ldap='%s',secret='%s',subnet='%s',sgroup='%s' %(name, puppetClass, size, region, basedn, ldap, secret, subnet, sgroup)) TypeError: not all arguments converted during string formatting I am not sure I understand why. I am pretty sure I have all the values defined here just fine. Also when I run the execute task deploy_ec2_ami as so: deploy_ec2_ami:test,java,m1.small,us-west-1,'dc\=test\,dc\=net',ldap-01,secret,subnet-d43b8abd,sg-926578fe It works just fine

    Read the article

  • replaceAll() method using parameter from text file

    - by Herman Plani Ginting
    i have a collection of raw text in a table in database, i need to replace some words in this collection using a set of words. i put all the term to be replace and its substitutes in a text file as below min=admin lelet=lambat lemot=lambat nii=nih ntu=itu and so on. i have successfully initiate a variabel of File and Scanner to read the collection of the term and its substitutes. i loop all the dataset and save the raw text in a string in the same loop i loop all the term collection and save its row to a string name 'pattern', and split the pattern into two string named 'term' and 'replacer' in this loop i initiate a new string which its value is the string from the dataset modified by replaceAll(term,replacer) end loop for term collection then i insert the new string to another table in database end loop for dataset i do it manualy as below replaceAll("min","admin") and its works but its really something to code it manually for almost 2000 terms to be replace it. anyone ever face this kind of really something.. i really need a help now desperate :( package sentimenrepo; import javax.swing.*; import java.sql.*; import java.io.*; //import java.util.HashMap; import java.util.Scanner; //import java.util.Map; /** * * @author herman */ public class synonimReplaceV2 extends SwingWorker { protected Object doInBackground() throws Exception { new skripsisentimen.sentimenttwitter().setVisible(true); Integer row = 0; File synonimV2 = new File("synV2/catatan_kata_sinonim.txt"); String newTweet = ""; DB db = new DB(); Connection conn = db.dbConnect("jdbc:mysql://localhost:3306/tweet", "root", ""); try{ Statement select = conn.createStatement(); select.executeQuery("select * from synonimtweet"); ResultSet RS = select.getResultSet(); Scanner scSynV2 = new Scanner(synonimV2); while(RS.next()){ row++; String no = RS.getString("no"); String tweet = " "+ RS.getString("tweet"); String published = RS.getString("published"); String label = RS.getString("label"); clean2 cleanv2 = new clean2(); newTweet = cleanv2.cleanTweet(tweet); try{ Statement insert = conn.createStatement(); insert.executeUpdate("INSERT INTO synonimtweet_v2(no,tweet,published,label) values('" +no+"','"+newTweet+"','"+published+"','"+label+"')"); String current = skripsisentimen.sentimenttwitter.txtAreaResult.getText(); skripsisentimen.sentimenttwitter.txtAreaResult.setText(current+"\n"+row+"original : "+tweet+"\n"+newTweet+"\n______________________\n"); skripsisentimen.sentimenttwitter.lblStat.setText(row+" tweet read"); skripsisentimen.sentimenttwitter.txtAreaResult.setCaretPosition(skripsisentimen.sentimenttwitter.txtAreaResult.getText().length() - 1); }catch(Exception e){ skripsisentimen.sentimenttwitter.lblStat.setText(e.getMessage()); } skripsisentimen.sentimenttwitter.lblStat.setText(e.getMessage()); } }catch(Exception e){ skripsisentimen.sentimenttwitter.lblStat.setText(e.getMessage()); } return row; } class clean2{ public clean2(){} public String cleanTweet(String tweet){ File synonimV2 = new File("synV2/catatan_kata_sinonim.txt"); String pattern = ""; String term = ""; String replacer = ""; String newTweet=""; try{ Scanner scSynV2 = new Scanner(synonimV2); while(scSynV2.hasNext()){ pattern = scSynV2.next(); term = pattern.split("=")[0]; replacer = pattern.split("=")[1]; newTweet = tweet.replace(term, replacer); } }catch(Exception e){ e.printStackTrace(); } System.out.println(newTweet+"\n"+tweet); return newTweet; } } }

    Read the article

  • Do word boundaries work on symbol characters?

    - by Shawn31313
    I'm trying to implement word boundaries in my emoticons feature for a chat. But for some reason I can't seem to get the word boundaries to work. I am new to regex. So when I do: var reg = /\b\Hi\b/gi; var str = 'HiHiHi Hi HiHiHi Hi'; alert(str.replace(reg, '')); This happens: Jsfiddle It actually works fine, and does remove those 2 Hi's that are standing alone. But when I change the reg to an escaped smiley and then change the string: var reg = /\b\:\)\b/gi; var str = 'HiHi:) :) HiHiHi :)'; alert(str.replace(reg, '')); This happens: Jsfiddle It just doesn't work. The string stays the same. Is it that word boundaries can't be used on symbols? If so, how does Facebook do it on their chats?

    Read the article

  • Distance from a point to a polygon

    - by clwen
    I am trying to determine the distance from a point to a polygon in 2D space. The point can be inside or outside the polygon; The polygon can be convex or concave. If the point is within the polygon or outside the polygon with a distance smaller than a user-defined constant d, the procedure should return True; False otherwise. I have found a similar question: Distance from a point to a polyhedron or to a polygon. However, the space is 2D in my case and the polygon can be concave, so it's somehow different from that one. I suppose there should be a method simpler than offsetting the polygon by d and determining it's inside or outside the polygon. Any algorithm, code, or hints for me to google around would be appreciated.

    Read the article

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