Daily Archives

Articles indexed Monday December 3 2012

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

  • 301 re-direct all external links to new domain

    - by Dean Legg
    I have changed the main domain to a sub-domain & would like to re-direct all external links to the new sub domain. Have read a few articles but having no luck editing the .htaccess as it might be interfering with all the rules in there. Old: www.example.co.uk New: https://secure.example.co.uk The current rules are quite handy because it seems to have sorted out the structure for all internal links. It has even updated the file path for images (or this could just be wordpress as the url was updated under general settings). This is the current .htaccess <files wp-config.php> order allow,deny deny from all </files> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress

    Read the article

  • How to choose, set and use keywords while structuring a website?

    - by mechdeveloper
    I have been working on my personal website for sometime, I think I have been doing a good technical job, but, unfortunately I did a terrible job while structuring the website because I didn't care about the keywords I was going to use. Although it is my personal website, I'd like to mention the main objective is the blog of the website, so I'd like that the keywords were related to the content that it is in the blog, at present google webmaster tools is displaying a lot of keywords that has nothing to do with the content of the website, and some SEO reporting websites such as woorank says that the keyword optimization of the website is awful, So I have 3 questions: How to choose, set and use keywords while structuring a website? OPTIONAL: which are all the methods and sources used by search engines to collect the keywords of a website? there are some high profile websites that aren't optimized on this as well, should I concerned about this anyway?, is there anything more important that I should be concerned about? (if you want to see the website please check my profile)

    Read the article

  • Image SEO - always repeat main keyword in alt text?

    - by Marcus Edensky
    I'm working on an Easter Island website and I'm currently redesigning my image system. Virtually all my photos are of Easter Island. My question is, should I always include the keywords "Easter Island" for Google to easier understand that my photos are from Easter Island, or is it sufficient that the "Easter Island" keywords are in the domain, as well as in all other pages of the site? For example, Alt text 1: "Moai statues at volcano Rano Raraku at Easter Island (Rapa Nui)" or Alt text 2: "Moai statues at volcano Rano Raraku" Would example 1 be considered keyword stuffing by Google

    Read the article

  • No Obvious Answer - Query-Strings and Javascript

    - by nchaud
    Say I have this main page /my-site/all-my-bath-soaps which lists all my products. It has a search filter text box that uses javascript to filter the products they want to see on that page (the URL doesn't change as they filter). Now from many other parts of the site I want to navigate to this products-page and see specific products. E.g. <a href="/my-site/all-my-bath-soaps?filter='Nivea-Soap'"> will go to /all-my-bath-soaps and apply javascript filtering to see just that product and hide all dom nodes for the other products. The problem is if the user changes the text in the filter from 'Nivea-Soap' to 'Lynx' the javascript will work fine and show the new products but the URL stays at ?filter='Nivea-Soap'. Is there anything I can do about this? Of course, I don't want to reload the page with a new query string every time they change the search criteria. Somehow it'd be great to move the ?filter=... criteria into POST data instead - but how can I do this with a link I don't know...

    Read the article

  • property rental / availability & booking component for asp.net website [closed]

    - by Karl Cassar
    We have a website which contains various listings of properties. Some of these properties can be rented, and we would like to add a 'booking engine' to it, to manage availability and bookings. However, I don't think it would be feasible to custom-code one for just this website. Is there any component / module which one can integrate with, to provide such functionality? Website is developed in C#/ASP.Net.

    Read the article

  • Blending textures together, texture fade over / fade in

    - by Deukalion
    What is the best way to render a texture overlapping effect? Like in this example: I want either the grass to fade in to the snow texture, or the other way around. No rough edges. Somehow make them blend over. So the grass has a bit of snow or the snow has a bit of grass How is this possible during runtime? If that's possible. I don't render this by using the SpriteBatch, since the ground isn't rectangles (they can be moved). This is the way I render each shape (each one of those squares): // LoadTexture // Apply EffectPass device.DrawUserIndexedPrimitives<VertexPositionNormalTexture> ( PrimitiveType.TriangleList, render.Item.Points, // Array of VertexPositionNormalTexture 0, render.Item.Points.Length, render.Item.Indexes, // Array of int indexes (triangulation) 0, render.Item.Indexes.Length / 3, VertexPositionNormalTexture.VertexDeclaration );

    Read the article

  • Toon/cel shading with variable line width?

    - by Nick Wiggill
    I see a few broad approaches out there to doing cel shading: Duplication & enlargement of model with flipped normals (not an option for me) Sobel filter / fragment shader approaches to edge detection Stencil buffer approaches to edge detection Geometry (or vertex) shader approaches that calculate face and edge normals Am I correct in assuming the geometry-centric approach gives the greatest amount of control over lighting and line thickness, as well eg. for terrain where you might see the silhouette line of a hill merging gradually into a plain? What if I didn't need pixel lighting on my terrain surfaces? (And I probably won't as I plan to use cell-based vertex- or texturemap-based lighting/shadowing.) Would I then be better off sticking with the geometry-type approach, or go for a screen space / fragment approach instead to keep things simpler? If so, how would I get the "inking" of hills within the mesh silhouette, rather than only the outline of the entire mesh (with no "ink" details inside that outline? Lastly, is it possible to cheaply emulate the flipped-normals approach, using a geometry shader? Is that exactly what the GS approaches do? What I want - varying line thickness with intrusive lines inside the silhouette... What I don't want...

    Read the article

  • How can I create a flexible system for tiling a 2D RPG map?

    - by CptSupermrkt
    Using libgdx here. I've just finished learning some of the basics of creating a 2D environment and using an OrthographicCamera to view it. The tutorials I went through, however, hardcoded their tiled map in, and none made mention of how to do it any other way. By tiled map, I mean like Final Fantasy 1, where the world map is a grid of squares, each with a different texture. So for example, I've got a 6 tile x 6 tile map, using the following code: Array<Tile> tiles = new Array<Tile>(); tiles.add(new Tile(new Vector2(0,5), TileType.FOREST)); tiles.add(new Tile(new Vector2(1,5), TileType.FOREST)); tiles.add(new Tile(new Vector2(2,5), TileType.FOREST)); tiles.add(new Tile(new Vector2(3,5), TileType.GRASS)); tiles.add(new Tile(new Vector2(4,5), TileType.STONE)); tiles.add(new Tile(new Vector2(5,5), TileType.STONE)); //... x5 more times. Given the random nature of the environment, for loops don't really help as I have to start and finish a loop before I was able to do enough to make it worth setting up the loop. I can see how a loop might be helpful for like tiling an ocean or something, but not in the above case. The above code DOES get me my final desired output, however, if I were to decide I wanted to move a piece or swap two pieces out, oh boy, what a nightmare, even with just a 6x6 test piece, much less a 1000x1000 world map. There must be a better way of doing this. Someone on some post somewhere (can't find it now, of course) said to check out MapEditor. Looks legit. The question is, if that is the answer, how can I make something in MapEditor and have the output map plug in to a variable in my code? I need the tiles as objects in my code, because for example, I determine whether or not a tile is can be passed through or collided with based on my TileTyle enum variable. Are there alternative/language "native" (i.e. not using an outside tool) methods to doing this?

    Read the article

  • java-eclipse-jsf -404 error

    - by ognistysztorm
    I am trying to create my first project in JSF (Eclipse Juno). I have only one jsp file witch contain: <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Insert title here</title> </head> <body> <f:view> <ui:component>Hello World</ui:component> </f:view> </body> </html> ...but when I try run it on server I receiving 404 error. I add jsf.jar and jstl.jar to my bulid path. this is web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>inwert</display-name> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> <context-param> <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> <context-param> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> <param-value>resources.application</param-value> </context-param> <listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener> </web-app> After 3 Hours I give up :( Could anyone help me?

    Read the article

  • how to bind the same vector multiple times using R?

    - by hendrik
    question: how can i bind the same vector, lets say o=c(1,2,3,4) mutiple times to get a matrix like o=array(c(1,2,3,4,1,2,3,4,1,2,3,4), dim(c(4,3)) o [,1] [,2] [,3] [1,] 1 1 1 [2,] 2 2 2 [3,] 3 3 3 [4,] 4 4 4 in a nicer way then: o=cbind(o,o,o) and maybe more generalized (dublicate()?? I need this to specifiy colors for elements in textplot() thx a lot

    Read the article

  • due at midnight - program compiles but has logic error(s)

    - by Leslie Laraia
    not sure why this program isn't working. it compiles, but doesn't provide the expected output. the input file is basically just this: Smith 80000 Jones 100000 Scott 75000 Washington 110000 Duffy 125000 Jacobs 67000 Here is the program: import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; /** * * @author Leslie */ public class Election { /** * @param args the command line arguments */ public static void main(String[] args) throws FileNotFoundException { // TODO code application logic here File inputFile = new File("C:\\Users\\Leslie\\Desktop\\votes.txt"); Scanner in = new Scanner(inputFile); int x = 0; String line = ""; Scanner lineScanner = new Scanner(line); line = in.nextLine(); while (in.hasNextLine()) { line = in.nextLine(); x++; } String[] senatorName = new String[x]; int[] votenumber = new int[x]; double[] votepercent = new double[x]; System.out.printf("%44s", "Election Results for State Senator"); System.out.println(); System.out.printf("%-22s", "Candidate"); //Prints the column headings to the screen System.out.printf("%22s", "Votes Received"); System.out.printf("%22s", "%of Total Votes"); int i; for(i=0; i<x; i++) { while(in.hasNextLine()) { line = in.nextLine(); String candidateName = lineScanner.next(); String candidate = candidateName.trim(); senatorName[i] = candidate; int votevalue = lineScanner.nextInt(); votenumber[i] = votevalue; } } votepercent = percentages(votenumber, x); for (i = 0; i < x; i++) { System.out.println(); System.out.printf("%-22s", senatorName[i]); System.out.printf("%22d", votenumber[i]); System.out.printf("%22.2f", votepercent[i]); System.out.println(); } } public static double [] percentages(int[] votenumber, int z) { double [] percentage = new double [z]; double total = 0; for (double element : votenumber) { total = total + element; } for(int i=0; i < votenumber.length; i++) { int y = votenumber[i]; percentage[i] = (y/total) * 100; } return percentage; } }

    Read the article

  • NoClassDefFoundError with new eclipse bundle

    - by djmedic
    I am informed by a customer that they are receiving an error. On the report they filed it is continuosly coming up with NoClassDefFoundError. It appears none of my other customers are having this issue. I'm not having this issue running the app on my Motorola Droid Maxx. The customer is running the app on a rooted Droid Bionic. Everything was working fine on my version at 2.3 but when I updated it to 2.4, this issue arose. I also replaced my computer with a new and now I am running windows 8 and installed the adt bundle. The only change I made to the file in question in changing a -90 to -85. Below is the code...I have also included below the code the error report. This is only happening on phone. import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.telephony.PhoneStateListener; import android.telephony.SignalStrength; import android.telephony.TelephonyManager; public class ConnectivityCheck extends Activity { TelephonyManager Tel; MyPhoneStateListener MyListener; boolean isGsm; boolean cellAvailable; int strengthAmplitudeGSM; int strengthAmplitudeCDMA; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); ConnectivityManager connec = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE); if (connec.getNetworkInfo(0) != null) { cellAvailable = true; } if (cellAvailable) { /* Update the listener, and start it */ MyListener = new MyPhoneStateListener(); Tel = ( TelephonyManager )getSystemService(Context.TELEPHONY_SERVICE); Tel.listen(MyListener ,PhoneStateListener.LISTEN_SIGNAL_STRENGTHS); } if (connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED) { startActivity(new Intent(ConnectivityCheck.this, LicenseCheck.class)); if (cellAvailable) { Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); } finish(); } else if (cellAvailable) { if (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED && strengthAmplitudeCDMA >= -90) { startActivity(new Intent(ConnectivityCheck.this, LicenseCheck.class)); Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); finish(); } else if (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED && isGsm && strengthAmplitudeGSM >= 10 && strengthAmplitudeGSM <= 31) { startActivity(new Intent(ConnectivityCheck.this, LicenseCheck.class)); Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); finish(); } else { startActivity(new Intent(ConnectivityCheck.this, ProtocolsMMenuActivity.class)); Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); finish(); } } else { startActivity(new Intent(ConnectivityCheck.this, ProtocolsMMenuActivity.class)); if (cellAvailable) { Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); } finish(); } } /* Called when the application is minimized */ @Override protected void onPause() { super.onPause(); if (cellAvailable) { Tel.listen(MyListener, PhoneStateListener.LISTEN_NONE); } } /* Called when the application resumes */ @Override protected void onResume() { super.onResume(); if (cellAvailable) { Tel.listen(MyListener, PhoneStateListener.LISTEN_SIGNAL_STRENGTHS); } } /* Start the PhoneState listener */ private class MyPhoneStateListener extends PhoneStateListener { /* Get the Signal strength from the provider, each tiome there is an update */ @Override public void onSignalStrengthsChanged(SignalStrength signalStrength) { isGsm = signalStrength.isGsm(); strengthAmplitudeGSM = signalStrength.getGsmSignalStrength(); strengthAmplitudeCDMA = signalStrength.getCdmaDbm(); super.onSignalStrengthsChanged(signalStrength); } };/* End of private Class */ } Here is the error report java.lang.NoClassDefFoundError: com.emsprotocols.njalsprotocolspaidac.ConnectivityCheck at com.emsprotocols.njalsprotocolspaidac.ProtocolsSplashActivity$1.onAnimationEnd (ProtocolsSplashActivity.java:144) at android.view.animation.AnimationSet.getTransformation(AnimationSet.java:411) at android.view.animation.Animation.getTransformation(Animation.java:920) at android.view.ViewGroup.drawChild(ViewGroup.java:2657) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489) at android.view.ViewGroup.drawChild(ViewGroup.java:2885) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489) at android.view.ViewGroup.drawChild(ViewGroup.java:2885) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489) at android.view.View.draw(View.java:11009) at android.widget.FrameLayout.draw(FrameLayout.java:450) at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:2154) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2096) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1679) at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2558) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4722) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554) at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Dropbox links in a Phonegap app (Android)

    - by genericatz
    I try to create downloadable links to files which can be downloaded directly after clicking the link. I added "dl" instead of "www" and "?dl=1" in the end of the dropbox link (dropbox api: directly download files). The direct download works perfectly in the chrome browser but if I package the app which phonegap and click on the same link whithin the resulting app the file will not be downloaded. Is this not possible whithin the adroid browser or do I have to modify some android browser preferences?

    Read the article

  • Reading in a file - Warning Message in R

    - by Sheila
    I have a file that has 22268 rows BY 2521 columns. When I try to read in the file using this line of code: file <- read.table(textfile, skip=2, header=TRUE, sep="\t", fill=TRUE, blank.lines.skip=FALSE) I get the following error: Warning message: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : number of items read is not a multiple of the number of columns I also used this command to see what rows had an incorrect number of columns: x <-count.fields("train.gct", sep="\t", skip=2) which(x != 2521) and got back a list of about 20 rows that were incorrect. Is there a way to fill these rows with NA values? I thought that is what the "fill" parameter does in the read.table function, but it doesn't appear so. Any help would be greatly appreciated. Thank you.

    Read the article

  • AS or not to AS, queries

    - by zeMinimalist
    I'm fairly new to PHP/MySql and using queries in general. I was just wondering if there's any benefit to using "AS" in a query other than trying to make it look cleaner? Does it speed up the query at all? I probably could have figured this out by a google search but I wanted to ask my first question and see how this works. I WILL select an answer (unlike some people...) with: SELECT news.id as id news.name as name FROM news without: SELECT news.id news.name FROM news A more complex example from a many-to-many relationship tutorial I found: SELECT c.name, cf.title FROM celebrities AS c JOIN ( SELECT icf.c_id, icf.f_id, f.title FROM int_cf AS icf JOIN films AS f ON icf.f_id = f.f_id ) AS cf ON c.c_id = cf.c_id ORDER BY c.c_id ASC

    Read the article

  • OpenJPA + Tomcat JDBC Connection Pooling = stale data

    - by Julie MacNaught
    I am using the Tomcat JDBC Connection Pool with OpenJPA in a web application. The application does not see updated data. Specifically, another java application adds or removes records from the database, but the web application never sees these updates. This is quite a serious issue. I must be missing something basic. If I remove the Connection Pool from the implementation, the web application sees the updates. It's as if the web application's commits are never called on the Connection. Version info: Tomcat JDBC Connection Pool: org.apache.tomcat tomcat-jdbc 7.0.21 OpenJPA: org.apache.openjpa openjpa 2.0.1 Here is the code fragment that creates the DataSource (DataSourceHelper.findOrCreateDataSource method): PoolConfiguration props = new PoolProperties(); props.setUrl(URL); props.setDefaultAutoCommit(false); props.setDriverClassName(dd.getClass().getName()); props.setUsername(username); props.setPassword(pw); props.setJdbcInterceptors("org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;"+ "org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer;"+ "org.apache.tomcat.jdbc.pool.interceptor.SlowQueryReportJmx;"+ "org.apache.tomcat.jdbc.pool.interceptor.ResetAbandonedTimer"); props.setLogAbandoned(true); props.setSuspectTimeout(120); props.setJmxEnabled(true); props.setInitialSize(2); props.setMaxActive(100); props.setTestOnBorrow(true); if (URL.toUpperCase().contains(DB2)) { props.setValidationQuery("VALUES (1)"); } else if (URL.toUpperCase().contains(MYSQL)) { props.setValidationQuery("SELECT 1"); props.setConnectionProperties("relaxAutoCommit=true"); } else if (URL.toUpperCase().contains(ORACLE)) { props.setValidationQuery("select 1 from dual"); } props.setValidationInterval(3000); dataSource = new DataSource(); dataSource.setPoolProperties(props); Here is the code that creates the EntityManagerFactory using the DataSource: //props contains the connection url, user name, and password DataSource dataSource = DataSourceHelper.findOrCreateDataSource("DATAMGT", URL, username, password); props.put("openjpa.ConnectionFactory", dataSource); emFactory = (OpenJPAEntityManagerFactory) Persistence.createEntityManagerFactory("DATAMGT", props); If I comment out the DataSource like so, then it works. Note that OpenJPA has enough information in the props to configure the connection without using the DataSource. //props contains the connection url, user name, and password //DataSource dataSource = DataSourceHelper.findOrCreateDataSource("DATAMGT", URL, username, password); //props.put("openjpa.ConnectionFactory", dataSource); emFactory = (OpenJPAEntityManagerFactory) Persistence.createEntityManagerFactory("DATAMGT", props); So somehow, the combination of OpenJPA and the Connection Pool is not working correctly.

    Read the article

  • How to send files along with parameters over http

    - by achie
    I am trying to send a zipfile from my android application to our server and I keep getting a 411 length required error. Here is the code that I am using to do that. HttpPost post = new HttpPost("http://www.xyz.org/upload.json"); post.setHeader(C.constants.HTTP_CONTENT_TYPE, "application/octet-stream"); try { FileInputStream fis = new FileInputStream("/data/data/org.myapp.appname/app_content.zip"); InputStreamEntity reqEntity = new InputStreamEntity(fis, -1); post.setEntity(reqEntity); String response = doPost(post); Log.v(tag, "response from server " + response); } catch (FileNotFoundException e) { e.printStackTrace(); } What am I doing wrong here and may I also know how I can add more parameters with this post to send them to the server.

    Read the article

  • array multiplication task

    - by toby
    I am tying to get around how you will multiply the values in 2 arrays (as an input) to get an output. The problem I have is the how to increment the loops to achieve the task shown below #include <iostream> using namespace std; main () { int* filter1, *signal,fsize1=0,fsize2=0,i=0; cout<<" enter size of filter and signal"<<endl; cin>> fsize1 >> fsize2; filter1= new int [fsize1]; signal= new int [fsize2]; cout<<" enter filter values"<<endl; for (i=0;i<fsize1;i++) cin>>filter1[i]; cout<<" enter signal values"<<endl; for (i=0;i<fsize2;i++) cin>>signal[i]; /* the two arrays should be filled by users but use the arrays below for test int array1[6]={2,4,6,7,8,9}; int array2[3]={1,2,3}; The output array should be array3[9]={1*2,(1*4+2*2),(1*6+2*4+3*2),........,(1*9+2*8+3*7),(2*9+3*8),3*9} */ return 0; } This is part of a bigger task concerning filter of a sampled signal but it is this multiplication that i cant get done.

    Read the article

  • How to connect these together?

    - by Biertago
    I've got a mysql database created by phpMyAdmin and I want to use it in my Qt project. I tried it on Visual Studio 2010 with an qt addon but it didn't work neither. In Qt Creator, I add: QT += sql in a .pro file and include: #include <QSqlDatabase> in the main file but there's a driver error. I don't know even where to start and each google page shows something different. I tried to look for some guide but there is nothing which concerns everything in []s.

    Read the article

  • Stop PHP from creating arrays in $_POST superglobal

    - by cdmckay
    PHP will automatically convert <input type="text" name="foo[0]" value="x" /> <input type="text" name="foo[1]" value="y" /> into $_POST['foo'] = array( 0 => 'x', 1 => 'y' ); Which is what you want most of the time. However, in this case I would like this not to happen. Is there anyway to tell PHP to not do this? I realize I could parse php://input myself, but I'd rather not do that if I can avoid it. I also don't have the option of renaming the input names.

    Read the article

  • Temperature anomaly calculation of time series data

    - by neel
    I have a time series like following: Data <- structure(list(Year = c(1991L, 1991L, 1991L, 1991L, 1991L, 1991L, 1991L, 1991L, 1991L, 1991L, 1991L, 1991L, 1991L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L, 1992L), Month = c(8L, 9L, 9L, 9L, 10L, 10L, 10L, 11L, 11L, 11L, 12L, 12L, 12L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 7L, 8L, 8L, 8L, 9L, 9L, 9L, 10L, 10L, 10L, 11L, 11L, 11L, 12L, 12L, 12L), Day = c(30L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 28L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 30L, 10L, 20L, 30L), Hour = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L), temperature = c(72.5, 64, 62.5, 64, 64, 53, 52, 52, 45.5, 49, 50, 50, 59, 63.5, 69.5, 61, 61, NaN, NaN, 39.5, 37, 45.5, 45, 39, 43.5, 52, 53, 56, 64, 66, 66.5, 73.5, 81, 85, 89.5, 87.5, 88.5, 83, 84.5, 74, 60.5, 59, 53, 60.5, 62.5, 64.5, 63, 62, 65.5)), .Names = c("Year", "Month", "Day", "Hour", "temperature"), class = "data.frame", row.names = c(NA, -49L)) and I have to calculate standardized anomaly. The steps to calculate the anomalies are following: Monthly premature departures from the long-term (1991-2007) average are obtained. Then standardized by dividing by the standard deviation of monthly temperature. The standardized monthly anomalies are then weighted by multiplying by the fraction of the average temperature for the given month. These weighted anomalies are then summed over 3 month time period. Can you please help me?

    Read the article

  • C++ Multithreading with pthread is blocking (including sockets)

    - by Sebastian Büttner
    I am trying to implement a multi threaded application with pthread. I did implement a thread class which looks like the following and I call it later twice (or even more), but it seems to block instead of execute the threads parallel. Here is what I got until now: The Thread Class is an abstract class which has the abstract method "exec" which should contain the thread code in a derive class (I did a sample of this, named DerivedThread) Thread.hpp #ifndef THREAD_H_ #define THREAD_H_ #include <pthread.h> class Thread { public: Thread(); void start(); void join(); virtual int exec() = 0; int exit_code(); private: static void* thread_router(void* arg); void exec_thread(); pthread_t pth_; int code_; }; #endif /* THREAD_H_ */ And Thread.cpp #include <iostream> #include "Thread.hpp" /*****************************/ using namespace std; Thread::Thread(): code_(0) { cout << "[Thread] Init" << endl; } void Thread::start() { cout << "[Thread] Created Thread" << endl; pthread_create( &pth_, NULL, Thread::thread_router, reinterpret_cast<void*>(this)); } void Thread::join() { cout << "[Thread] Join Thread" << endl; pthread_join(pth_, NULL); } int Thread::exit_code() { return code_; } void Thread::exec_thread() { cout << "[Thread] Execute" << endl; code_ = exec(); } void* Thread::thread_router(void* arg) { cout << "[Thread] exec_thread function in thread" << endl; reinterpret_cast<Thread*>(arg)->exec_thread(); return NULL; } DerivedThread.hpp #include "Thread.hpp" class DerivedThread : public Thread { public: DerivedThread(); virtual ~DerivedThread(); int exec(); void Close() = 0; DerivedThread.cpp [...] #include "DerivedThread.cpp" [...] int DerivedThread::exec() { //code to be executed do { cout << "Thread executed" << endl; usleep(1000000); } while (true); //dummy, just to let it run for a while } [...] Basically, I am calling this like the here: DerivedThread *thread; cout << "Creating Thread" << endl; thread = new DerivedThread(); cout << "Created thread, starting..." << endl; thread->start(); cout << "Started thread" << endl; cout << "Creating 2nd Thread" << endl; thread = new DerivedThread(); cout << "Created 2nd thread, starting..." << endl; thread->start(); cout << "Started 2nd thread" << endl; What is working great if I am only starting one of these Threads , but if I start multiple which should run together (not synced, only parallel) . But I discovered, that the thread is created, then as it tries to execute it (via start) the problem seems to block until the thread has closed. After that the next Thread is processed. I thought that pthread would do it unblocked for me, so what did I wrong? A sample output might be: Creating Thread [Thread] Thread Init Created thread, starting... [Thread] Created thread [Thread] exec_thread function in thread [Thread] Execute Thread executed Thread executed Thread executed Thread executed Thread executed Thread executed Thread executed .... Until Thread 1 is not terminated, a Thread 2 won't be created not executed. The process above is executed in an other class. Just for the information: I am trying to create a multi threaded server. The concept is like this: MultiThreadedServer Class has a main loop, like this one: ::inet::ServerSock *sock; //just a simple self made wrapper class for sockets DerivedThread *thread; for (;;) { sock = new ::inet::ServerSock(); this->Socket->accept( *sock ); cout << "Creating Thread" << endl; //Threads (according to code sample above) thread = new DerivedThread(sock); //I did not mentoine the parameter before as it was not neccesary, in fact, I pass the socket handle with the connected socket to the thread cout << "Created thread, starting..." << endl; thread->start(); cout << "Started thread" << endl; } So I thought that this would loop over and over and wait for new connections to accept. and when a new client arrives, I am creating a new thread and give the thread the connected socket as a parameter. In the DerivedThread::exec I am doing the handling for the connected client. Like: [...] do { [...] if (this-sock_-read( Buffer, sizeof(PacketStruc) ) 0) { cout << "[Handler_Base] Recv Packet" << endl; //handle the packet } else { Connected = false; } delete Buffer; } while ( Connected ); So I loop in the created thread as long as the client keeps the connection. I think, that the socket may cause the blocking behaviour. Edit: I figured out, that it is not the read() loop in the DerivedThread Class as I simply replaced it with a loop over a simple cout-usleep part. It did also only execute the first one and after first thread finished, the 2nd one was executed. Many thanks and best regards, Sebastian

    Read the article

  • Titanium Appcelerator - After enabling cloud services I get UnicodeDecodeError when compiling for Android

    - by Shahar Zrihen
    I've got an app that has a UTF8 name (hebrew). I use the platform/android/AndroidManifest.xml file for this. I've managed to narrow it down to the Ti.cloudpush module. only when I enable this module I get the error. I used to be able to compile it to android without any issues but as soon as I enable cloud services I get this error - [ERROR] Exception occured while building Android project: [ERROR] Traceback (most recent call last): [ERROR] File "/Users/Shahar/Library/Application Support/Titanium/mobilesdk/osx/2.1.0.GA/android/builder.py", line 2218, in <module> [ERROR] s.build_and_run(True, None, key, password, alias, output_dir) [ERROR] File "/Users/Shahar/Library/Application Support/Titanium/mobilesdk/osx/2.1.0.GA/android/builder.py", line 1970, in build_and_run [ERROR] self.manifest_changed = self.generate_android_manifest(compiler) [ERROR] File "/Users/Shahar/Library/Application Support/Titanium/mobilesdk/osx/2.1.0.GA/android/builder.py", line 1195, in generate_android_manifest [ERROR] custom_manifest_contents = fill_manifest(custom_manifest_contents) [ERROR] File "/Users/Shahar/Library/Application Support/Titanium/mobilesdk/osx/2.1.0.GA/android/builder.py", line 1122, in fill_manifest [ERROR] manifest_source = manifest_source.replace(ti_permissions,permissions_required_xml) [ERROR] UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 501: ordinal not in range(128) and this is my manifest file with the part that causes the issues. If I remove the hebrew name, it compiles without any issues <application android:icon="@drawable/appicon" android:label="??????" android:name="QuestionnaireApplication" android:debuggable="false" > <activity android:name=".QuestionnaireActivity" android:label="??????" android:theme="@style/Theme.Titanium" android:screenOrientation="portrait" android:configChanges="keyboardHidden" > Any suggestions?

    Read the article

  • Robotium Uniting Testing on an application having multiple processes

    - by warenix
    I have written an application running activities in multiple processes. I tried Robotium by creating a new test project set target package to my application. When I executed it, the test stopped with the following error message: Error in testDisplayBlackBox: java.lang.RuntimeException: Intent in process com.abc.def resolved to different process com.abc.def:mail: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.abc.def/com.abc.def.email.activity.Welcome } at android.app.Instrumentation.startActivitySync(Instrumentation.java:377) at android.test.InstrumentationTestCase.launchActivityWithIntent(InstrumentationTestCase.java:119) at android.test.InstrumentationTestCase.launchActivity(InstrumentationTestCase.java:97) at android.test.ActivityInstrumentationTestCase2.getActivity(ActivityInstrumentationTestCase2.java:104) at com.abc.def.test.TestApk.setUp(TestApk.java:31) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1584) Test results for InstrumentationTestRunner=.E Time: 0.027 FAILURES!!! Tests run: 1, Failures: 0, Errors: 1 Is it possible to have any workaround provided that I have source code in hand?

    Read the article

  • Designing a table to store EXIF data

    - by rafale
    I'm looking to get the best performance out of querying a table containing EXIF data. The queries in question will only search the EXIF data for the specified strings and return the row index on a match. With that said, would it better to store the EXIF data in a table with separate columns for each of the tags, or would storing all of the tags in a single column as one long delimited string suit me just as well? There are around 115 EXIF tags I'll be storing, and each record would be around 1500 to 2000 chars in length if concatenated into a single string.

    Read the article

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