{"QuestionId": 25185610, "AnswerCount": 2, "Tags": "", "CreationDate": "2014-08-07T14:51:07.993", "AcceptedAnswerId": "25185691", "Title": "Pass variable to Javascript file", "Body": "

I'm using Django and jqGrids, and I'm trying to automate the grid's contruction process. There is an issue, that I can't figure out the solution.

\n\n

I've a Javascript file that I include in the header of my html page, grid.locale-en.js, that contains all strings that appear on the jqGrid's boxes.

\n\n
<script src=\"{% static 'project/grid.locale-en.js' %}\"></script>\n
\n\n

I want to pass to this file one Django variable that has the name of the grid.

\n\n

This way, I can have has mutch grids as I want, and I only need one grid's code.\nThis will serve to change the following fields.

\n\n
edit: {\n        addCaption: \"Add Product\",\n        editCaption: \"Edit Product\",\n
\n\n

Thanks for the help!

\n", "Lable": "No"} {"QuestionId": 25191495, "AnswerCount": 2, "Tags": "", "CreationDate": "2014-08-07T20:20:58.353", "AcceptedAnswerId": null, "Title": "Changes to style.css not showing up", "Body": "

My website, pretendcity.org has a custom theme created by someone else. To edit content I use dreamweaver and go into the server to open up the individual files (ex: if I need to add something to the header, I will edit header.php).

\n\n

My issue is that when I edit/update the style.css file for the website it doesn't update right away. For example I changed the background color from #353535 to #000000 and there were no changes. So I left the background color as #000000 in style.css for weeks and no changes were found on the website. Then today, WordPress had an automatic update to 3.9.2 and I found the background color suddenly changed to #000000.

\n\n

Now I'm trying to change it back to #353535 and it will not make any changes.

\n\n

Here is the style.css for the website:

\n\n
@charset \"UTF-8\";\n/*\nTheme Name: Pretend City Children's Museum\nTheme URI: http://pretendcity.org\nDescription: Pretend City v2\nAuthor: Slava Popov\nAuthor URI: http://laydbak.com\n*/\n\n/* =================\n0081cd - Blue\n83bc34 - Green\n353535 - Text\ncbcbcb - Borders\n==================*/\n\n/* =========== */\n/* Page Styles */\n/* =========== */\n\nbody {\n    background: #f0f0f0;\n    color: #353535;\n    font: 12px Arial, Helvetica, sans-serif;\n    margin: 0;\n    padding: 0;\n    text-align: center;\n    width: 100%;\n    }\nimg {border: 0;}\ntable {margin: 0 0 10px 0; padding: 0; line-height: 19px; vertical-align: top !important; border-spacing:0; border-collapse:collapse;}\ntd {vertical-align: top !important;}\np {line-height: 19px; padding-bottom: 10px;}\nh2, h3, h4, h5, h6 {color: #353535; margin-bottom: 10px;}\nh1 {color: #0081cd; font-size: 24px; margin: 0 0 10px 0;}\nh2 {color: #353535; font-size: 18px;}\nh3 {color: #83bc34; font-size: 16px;}\nh3 a {color: #83bc34;}\nh4 {font-size: 14px;}\nh5 {font-size: 14px;}\nh6 {color: red; font-size: 11px;}\nhr {\n    border: none 0;\n    border-top: 1px dashed #ccc;\n    height: 1px;\n    margin: 20px 0;\n    width: 100%;\n    }\na {color: #0081cd; text-decoration: underline;}\na:hover {text-decoration: none;}\nul {\n    line-height: 19px;\n    list-style-type: disc;\n    padding: 0 0 20px 20px;}\n.wrap {\n    background: #FFF;\n    border-left: #cbcbcb 1px solid;\n    border-bottom: #cbcbcb 1px solid;\n    border-right: #cbcbcb 1px solid;\n    margin: 0 auto;\n    position: relative;\n    width: 958px;\n    }\n
\n\n

here is the header.php code:

\n\n
<!DOCTYPE html>\n<html <?php language_attributes(); ?>>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>\"/>\n<meta property=\"twitter:pretendcity\" content=\"42741399\" />\n<title><?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?></title>\n<link rel=\"shortcut icon\" href=\"<?php bloginfo( 'template_directory' ); ?>/favicon.ico\" />\n<link href=\"<?php bloginfo( 'template_directory' ); ?>/reset.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen\" />\n<link href=\"<?php echo get_stylesheet_uri(); ?>\" rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection\" />\n<link href=\"<?php bloginfo( 'template_directory' ); ?>/shortcode.css\" rel=\"stylesheet\" type=\"text/css\" media=\"screen, projection\" />\n<link href=\"<?php bloginfo( 'template_directory' ); ?>/print.css\" rel=\"stylesheet\" type=\"text/css\" media=\"print\" />\n<!--[if IE]><link rel=\"stylesheet\" type=\"text/css\" href=\"<?php bloginfo( 'template_directory' ); ?>/all-ie-only.css\" /><![endif]-->\n<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>\n<!--[if lt IE 9]>\n<script src=\"<?php echo get_template_directory_uri(); ?>/js/html5.js\" type=\"text/javascript\"></script>\n<![endif]-->\n<?php wp_head(); ?>\n\n<!-- BEGIN GOOGLE ANALYTICS -->\n <script>\n  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n  ga('create', 'UA-38311913-1', 'pretendcity.org');\n  ga('send', 'pageview');\n\n</script>\n<!-- END GOOGLE ANALYTICS -->\n</head>\n\n<!--[if IE 7]>  <body class=\"lt-ie8\">   <![endif]-->\n\n<body <?php body_class(); ?>>\n\n<!-- Top Info Bar -->\n<div id=\"infobar\">\n    <div>\n        <span><strong>Address:</strong> 29 Hubble, Irvine, CA 92618 (<a href=\"https://www.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Pretend+City+Children's+Museum,+29+Hubble,+Irvine,+CA&amp;aq=0&amp;oq=Pretend&amp;sll=33.835232,-117.8461&amp;sspn=0.246678,0.528374&amp;vpsrc=0&amp;ie=UTF8&amp;hq=Pretend+City+Children's+Museum,+29+Hubble,+Irvine,+CA&amp;t=m&amp;z=15&amp;iwloc=A&amp;cid=12592966360647214510\" target=\"_blank\" class=\"map\">Get Directions</a>)</span>\n        <span><strong>Phone:</strong> 949.428.3900</span>\n        <span><strong>Hours:</strong> Tues. - Sun.. 10a.m. - 5p.m.</span>\n        <span>Monday 10a.m. - 1p.m.</span>\n        <strong>Ages:</strong> Infants to 8 years old\n    </div>\n</div>\n<!-- Header & Logo -->\n<header>\n\n\n    <a href=\"/\">\n        <div class=\"logo\" title=\"Pretend City Children's Museum\"></div>\n    </a>\n\n    <!-- <a href=\"https://tickets.pretendcity.org/public/loader.asp?target=donation.asp?code=0013\" target=\"_blank\"> -->\n    <a href=\"https://16116.blackbaudhosting.com/16116/General-Contributions\" target=\"_blank\">\n        <div class=\"donate\" title=\"Donate Today!\"></div>\n    </a>\n<!-- Paypal Donate Button -->\n      <div class=\"paypalicon\" style=\"margin-top:55px; margin-left: 600px\"><form title=\"Donate Today!\" action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_top\"><input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\" />\n<input type=\"hidden\" name=\"hosted_button_id\" value=\"228Z5CXX3WVT8\" />\n<input type=\"image\" alt=\"PayPal - The safer, easier way to pay online!\" name=\"submit\" src=\"http://pretendcity.org/images_home/donate-with-paypal-button-54.png\" />\n<img alt=\"\" src=\"https://www.paypalobjects.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\" border=\"0\" /></form></div>\n\n\n\n</header>\n<!-- Main Body Wrapper -->\n<div class=\"wrap\">\n    <!-- Navigation Start -->\n    <nav id=\"menu\">\n        <?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'main-navigation', 'menu_class' => 'nav-menu' ) ); ?>\n    </nav>\n
\n", "Lable": "No"} {"QuestionId": 25234894, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-08-11T01:58:45.593", "AcceptedAnswerId": null, "Title": "c# express built solution with firebird database has an error when run", "Body": "

\"enter\nI've been I'm trying to create an exe file of my application in c# express. My problem is when I run the application.exe after I build from release it shows me an error

\n\n
System.ArgumentException: An invalid connection string argument has been supplied or a required connection string argument has not been supplied.\nat FirebirdSql.Data.FirebirdClient.FbConnectionString.Validate()\nat FirebirdSql.Data.FirebirdClient.FbConnection.set_ConnectionString(String value)\nat FirebirdSql.Data.FirebirdClient.FbConnection..ctor(String connectionString)\nat Mis_Service.Loginfrm.btnLogin_Click(Object sender, EventArgs e) in d:\\c sharp projects\\samples\\Mis-Service\\Mis-Service\\Loginfrm.cs:line 31\nat System.Windows.Forms.Control.OnClick(EventArgs e)\nat System.Windows.Forms.Button.OnClick(EventArgs e)\nat System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)\nat System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\nat System.Windows.Forms.Control.WndProc(Message& m)\nat System.Windows.Forms.ButtonBase.WndProc(Message& m)\nat System.Windows.Forms.Button.WndProc(Message& m)\nat System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\nat System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\nat System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\n
\n\n

I think the error only occurs when I connect to the database firebird. I am using the reference as follows.

\n\n
using FirebirdSql.Data.FirebirdClient;\n
\n\n

When I try to run the program using the start button of c# express the code works fine. Is there something that i missed? I want to make the my application in exe so that i can create an installer using 3rd party software

\n\n

here is my code in app.config

\n\n
<configuration>\n<startup> \n    <supportedRuntime version=\"v4.0\" sku=\".NETFramework,Version=v4.5\" />\n</startup>\n<appSettings>\n  <add key=\"ProviderName\" value=\"MSDASQL.1\"/>\n  <add key=\"SecurityInfo\" value=\"False\"/>\n  <add key=\"Driver\" value=\"Firebird/InterBase(r) driver\"/>\n  <add key=\"UserID\" value=\"sysdba\"/>\n  <add key=\"Password\" value=\"masterkey\"/>\n  <add key=\"Database\" value=\"D:\\\\database\\\\DB_GENERAL.FDB\"/>\n  <add key=\"DataSource\" value=\"localhost\"/>\n    </appSettings>  \n</configuration>\n
\n\n

in my class

\n\n
conProvider = ConfigurationManager.AppSettings[\"ProviderName\"]; // sample on how i call app.config to string\nconString = \"Provider=\" + conProvider + \";\" +\n            \"Persist Security Info=\" + conSecurityInfo + \";\" +\n            \"Driver=\" + conDriver + \";\" +\n            \"User ID=\" + conUserID + \";\" +\n            \"Password=\" + conPassword + \";\" +\n            \"Database=\" + conDatabase + \";\" +\n            \"DataSource=\" + conDataSource + \";\" +\n            \"Charset=NONE;\";\n
\n", "Lable": "No"} {"QuestionId": 25268077, "AnswerCount": 2, "Tags": "", "CreationDate": "2014-08-12T15:17:59.883", "AcceptedAnswerId": null, "Title": "need help to pass string value from try catch", "Body": "

i am trying to read all texts from url text file to string but i am having these errors:

\n\n
Description Resource    Path    Location    Type\ncurrentUrl cannot be resolved to a variable MainActivity.java   /Copy of ImageDownloadSample/src/com/example/imagedownloadsample    line 51 Java Problem\ncurrentUrl cannot be resolved   MainActivity.java   /Copy of ImageDownloadSample/src/com/example/imagedownloadsample    line 62 Java Problem\ncurrentUrl cannot be resolved   MainActivity.java   /Copy of ImageDownloadSample/src/com/example/imagedownloadsample    line 64 Java Problem\ncurrentUrl cannot be resolved   MainActivity.java   /Copy of ImageDownloadSample/src/com/example/imagedownloadsample    line 63 Java Problem\n
\n\n

this is my code:

\n\n
package com.example.imagedownloadsample;\n\nimport java.io.BufferedReader;\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.net.MalformedURLException;\nimport java.net.URL;\n\nimport android.graphics.Bitmap;\nimport android.graphics.Bitmap.CompressFormat;\nimport android.graphics.drawable.Drawable;\nimport android.os.Bundle;\nimport android.os.Environment;\nimport android.support.v7.app.ActionBarActivity;\n\nimport com.squareup.picasso.Picasso;\nimport com.squareup.picasso.Target;\n\npublic class MainActivity extends ActionBarActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.image_download);\n\n        //\n        try {\n\n            URL url = new URL(\n                    \"https://www.dropbox.com/s/s70xckuxjh5sbtw/pop.txt\");\n\n            // read text returned by server\n            BufferedReader in = new BufferedReader(new InputStreamReader(\n                    url.openStream()));\n\n            String currentUrl;\n            while ((currentUrl = in.readLine()) != null) {\n                System.out.println(currentUrl);\n            }\n            in.close();\n\n        } catch (MalformedURLException e) {\n            System.out.println(\"Malformed URL: \" + e.getMessage());\n        } catch (IOException e) {\n            System.out.println(\"I/O Error: \" + e.getMessage());\n        }\n        //\n\n        Picasso.with(this).load(currentUrl).into(target);\n\n    }\n\n    private Target target = new Target() {\n        @Override\n        public void onBitmapLoaded(final Bitmap bitmap, Picasso.LoadedFrom from) {\n            new Thread(new Runnable() {\n                @Override\n                public void run() {\n\n                    String fileName = currentUrl.substring(\n                            currentUrl.lastIndexOf('/') + 1,\n                            currentUrl.length());\n\n                    String fname = \"/image-\" + fileName + \".jpg\";\n\n                    File file = new File(Environment\n                            .getExternalStorageDirectory().getPath() + fname);\n                    if (file.exists())\n                        file.delete();\n                    try {\n                        file.createNewFile();\n                        FileOutputStream ostream = new FileOutputStream(file);\n                        bitmap.compress(CompressFormat.JPEG, 100, ostream);\n                        ostream.close();\n                    } catch (Exception e) {\n                        e.printStackTrace();\n                    }\n\n                }\n            }).start();\n        }\n\n        @Override\n        public void onBitmapFailed(Drawable errorDrawable) {\n        }\n\n        @Override\n        public void onPrepareLoad(Drawable placeHolderDrawable) {\n            if (placeHolderDrawable != null) {\n            }\n        }\n    };\n\n}\n
\n\n

.....................................................................................................................................................................

\n", "Lable": "No"} {"QuestionId": 25289775, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-08-13T15:08:11.353", "AcceptedAnswerId": null, "Title": "How to disallow rotation on MKMapView but show heading?", "Body": "

For my project, I would like to put on a MKMapView the heading of the user without rotating the map (with the blue cone).

\n\n

\"enter

\n\n

Here's a gist

\n\n

Furthermore, with mapView.setUserTrackingMode(MKUserTrackingMode.FollowWithHeading, animated: true) enable, I can't navigate trough my map.

\n\n

I tried to set the trackingMode on the mapView:didChangeUserTrackingMode but It's not working.

\n\n

Any idea ?

\n", "Lable": "No"} {"QuestionId": 25411092, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-08-20T17:36:02.487", "AcceptedAnswerId": null, "Title": "default parameter for collection", "Body": "

I created a parameter whose type is \"Collection\" and it is a multi select parameter. I want to choose one value as default but I am unable to do so. I have tried all the options mentioned in this forum like

\n\n

the default values as \" new ArrayList(Arrays.asList(new String[] {\"WhatValueUWant\"})) \"and \" [\" \"] \" but still didn't work. Can any one please help me here ?

\n", "Lable": "No"} {"QuestionId": 25460870, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-08-23T10:18:46.100", "AcceptedAnswerId": "25475680", "Title": "is it appropriate to implement auto update for a c# application just by passing download url to msiexec", "Body": "

I have a project in c# which requires auto update functionality, since it has quite a lot of dependencies and runs a Windows service, ClickOnce installer is not suitable for this work. So I created a setup project for this application. Now I want to include an auto update feature.

\n\n

My auto-update strategy is:

\n\n
    \n
  1. From the main application, check for updates every morning.

  2. \n
  3. If an update is found, get the msi link

  4. \n
  5. Application passes control to the msiexec and quits

  6. \n
\n\n

Ex.

\n\n
msiexec /i http://www.example.com/share/package.msi /L*V \"C:\\log\\example.log\"\n
\n\n

Since my application is running on administrator account UAC prompt will not occur.

\n\n

Are there any pitfalls that I haven't seen? Or there any superior way to do auto update gracefully?

\n\n

Note: The setup project of the application is marked with the property RemoveAllPreviousVersion = True so it will take care of the uninstallation of previous versions.

\n", "Lable": "No"} {"QuestionId": 25463269, "AnswerCount": 3, "Tags": "", "CreationDate": "2014-08-23T15:01:41.390", "AcceptedAnswerId": null, "Title": "Running a Complex MySQL QUERY using PHP", "Body": "

I have tried to fetch the data from a table named 'gainfinal' using a complex query given below :

\n\n
    SELECT  g.countrycode,\n        sum(case when `year` = '1995' then g.values else 0 end) AS \"1995\",\n        sum(case when `year` = '1996' then g.values else 0 end) AS \"1996\",\n        sum(case when `year` = '1997' then g.values else 0 end) AS \"1997\",\n        sum(case when `year` = '1998' then g.values else 0 end) AS \"1998\", \n        sum(case when `year` = '1999' then g.values else 0 end) AS \"1999\",\n        sum(case when `year` = '2000' then g.values else 0 end) AS \"2000\",\n        sum(case when `year` = '2001' then g.values else 0 end) AS \"2001\",\n        sum(case when `year` = '2002' then g.values else 0 end) AS \"2002\",\n         sum(case when `year` = '2003' then g.values else 0 end) AS \"2003\", \n         sum(case when `year` = '2004' then g.values else 0 end) AS \"2004\", \n         sum(case when `year` = '2005' then g.values else 0 end) AS \"2005\",\n        sum(case when `year` = '2006' then g.values else 0 end) AS \"2006\",\n        sum(case when `year` = '2007' then g.values else 0 end) AS \"2007\",\n        sum(case when `year` = '2008' then g.values else 0 end) AS \"2008\",\n        sum(case when `year` = '2009' then g.values else 0 end) AS \"2009\", \n         sum(case when `year` = '2010' then g.values else 0 end) AS \"2010\", \n         sum(case when `year` = '2011' then g.values else 0 end) AS \"2011\",\n        sum(case when `year` = '2012' then g.values else 0 end) AS \"2012\"\n\n\nFROM    `gainfinal` g\nWHERE   `year` between '1995' and '2012'\nGROUP BY `countrycode`\n
\n\n

I am sure the Query has been running well because it returned right data while running in Xampp.

\n\n

My PHP code is like this :

\n\n
    ini_set('display_errors', 1); \n    $username = \"root\"; \n    $password = \"\";   \n    $host = \"localhost\";\n    $database=\"climate\";\n     //$country = 'NPL';\n    // $indices = 'foodfinal';\n   // $country=$_GET[\"country\"];\n\n    // $indices=$_GET[\"indices\"];\n\n\n    $server = mysql_connect($host, $username, $password);\n    $connection = mysql_select_db($database, $server);\n\n    $myquery = \"SELECT  g.countrycode,sum(case when `year` = '1995' then `g.values` else 0 end) AS \"1995\",\n        sum(case when `year` = '1996' then g.values else 0 end) AS \"1996\",\n        sum(case when `year` = '1997' then g.values else 0 end) AS \"1997\",\n        sum(case when `year` = '1998' then g.values else 0 end) AS \"1998\", \n        sum(case when `year` = '1999' then g.values else 0 end) AS \"1999\",\n        sum(case when `year` = '2000' then g.values else 0 end) AS \"2000\",\n        sum(case when `year` = '2001' then g.values else 0 end) AS \"2001\",\n        sum(case when `year` = '2002' then g.values else 0 end) AS \"2002\",\n         sum(case when `year` = '2003' then g.values else 0 end) AS \"2003\", \n\n         sum(case when `year` = '2004' then g.values else 0 end) AS \"2004\", \n         sum(case when `year` = '2005' then g.values else 0 end) AS \"2005\",\n        sum(case when `year` = '2006' then g.values else 0 end) AS \"2006\",\n        sum(case when `year` = '2007' then g.values else 0 end) AS \"2007\",\n        sum(case when `year` = '2008' then g.values else 0 end) AS \"2008\",\n        sum(case when `year` = '2009' then g.values else 0 end) AS \"2009\", \n         sum(case when `year` = '2010' then g.values else 0 end) AS \"2010\", \n         sum(case when `year` = '2011' then g.values else 0 end) AS \"2011\",\n        sum(case when `year` = '2012' then g.values else 0 end) AS \"2012\"\n\n\nFROM    `gainfinal` g\nWHERE   `year` between '1995' and '2012'\nGROUP BY `countrycode`\";\n    $query = mysql_query($myquery);\n\n    if ( ! $query ) {\n        echo mysql_error();\n        die;\n    }\n\n    $data = array();\n\n    for ($x = 0; $x < mysql_num_rows($query); $x++) {\n        $data[] = mysql_fetch_assoc($query);\n    }\n\n    echo json_encode($data);  \n     mysql_close($server);\n      //header('Location: linegraph.html');\n     // include( \"linegraph.html\");\n\n?>\n
\n\n

This PHP file had been returning right data for other queries. It only didn't work for this query onl. While running the PHP file, it says \n: Parse error: syntax error, unexpected T_LNUMBER in C:\\xampp\\htdocs\\climateapp\\data\\chloroplath\\data.php on line 17. How can I run the Query using PHP.

\n", "Lable": "No"} {"QuestionId": 25496537, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-08-26T01:06:37.027", "AcceptedAnswerId": "25509890", "Title": "Reliability of returned value of Future method cancel(false)", "Body": "

Suppose I schedule a task with a ScheduledThreadPoolExecutor and get a Future back.

\n\n

I later decide I want to cancel that Future, and rely on the returned value of the cancel to trigger some cleanup operation. I don't want the task to be interrupted if it's already running (so I pass false as argument).

\n\n

Is the return of the cancel reliable? That is, is it impossible that, if cancel returned \"true\", the task is actually being run?

\n\n

Looking at the code in the OpenJDK 8 it looks like there could be a race condition, whereby the \"cancel\" sets the state of the task to CANCELLED and returns true, but the runner can already have passed the \"check\" to start execution.

\n\n

As far as I can see, the computation will be performed but the result not set (which is good). However, in my case, the \"computation\" has side effects so I want to know if I cancelled it for real or not.

\n", "Lable": "No"} {"QuestionId": 25530019, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-08-27T14:34:49.683", "AcceptedAnswerId": "25530196", "Title": "PendingIntent sending the wrong intent / putExtra", "Body": "

I am working on an appWidget and I got my first big problem.
\nI need to send to my app (CoreActivity) that the user click on image X or image Y (etc).
\nAnd what is exactly this image (in this exemple : Restaurant or Taxi).

\n\n

My problem is : when the user click on an image, it always send the last putExtra (in this exemple Taxi). When I click on logo_1 or image1_1 it always send \"Taxi\" to my CoreActivity.

\n\n

Do you know why ? Because I can't find anywhere what is wrong here...

\n\n

Thanks for all the help you can bring me and thanks for the time you took (even for reading this question ^^).
\nHave a nice day.

\n\n
final RemoteViews views = new RemoteViews(context.getPackageName(),R.layout.widget_demo_4l_4c);\n\nIntent logo_1Intent = new Intent(context, CoreActivity.class);\nIntent image1_1Intent = new Intent(context, CoreActivity.class);\nIntent image2_1Intent = new Intent(context, CoreActivity.class);\n\nimage1_1Intent.putExtra(CoreActivity.EXTRA_WIDGET_KEY, \"Restaurant\");\nimage2_1Intent.putExtra(CoreActivity.EXTRA_WIDGET_KEY, \"Taxi\");\n\n\nPendingIntent logo_1PendingIntent = PendingIntent.getActivity(context, 0, logo_1Intent, PendingIntent.FLAG_UPDATE_CURRENT);\nPendingIntent image1_1PendingIntent = PendingIntent.getActivity(context, 0, image1_1Intent, PendingIntent.FLAG_UPDATE_CURRENT);\nPendingIntent image2_1PendingIntent = PendingIntent.getActivity(context, 0, image2_1Intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\nviews.setOnClickPendingIntent(R.id.logo_1, logo_1PendingIntent);\nviews.setOnClickPendingIntent(R.id.image1_1, image1_1PendingIntent);\nviews.setOnClickPendingIntent(R.id.image2_1, image2_1PendingIntent);\n\nappWidgetManager.updateAppWidget(appWidgetId, views);\n
\n", "Lable": "No"} {"QuestionId": 25541977, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-08-28T06:18:25.057", "AcceptedAnswerId": null, "Title": "how to show Loading image on binding dropdownlist data with fancy tree", "Body": "

On dropdownlist value change, im calling ajzx action to get the DB values and building DB values as Html (in controller) and onSuccess of Ajax the Html is appended to the an div. Till this the process is speed and i can get the data in few seconds. the appended Div element is converted to fancytree (plugin) which takes long time to load, so the requirement is to show the 'Loading...' icon still the binding completes. I googled a lot and tired many sort but nothing working, the image is not loading during converting the div to fancy Tree. Shown below the code which i tired.

\n\n

CSS:

\n\n
#dvLoading {\n   background:#000 url(images/animated-overlay.gif) no-repeat center center;\n   height: 100px;\n   width: 100px;\n   position: fixed;\n   z-index: 1000;\n   left: 50%;\n   top: 50%;\n   margin: -25px 0 0 -25px;\n}\n
\n\n

in View :

\n\n
<div id=\"dvLoading\"></div>\n
\n\n

in JS

\n\n
drawOrganiTree: function (result) {\n    \"use strict\";\n    var ns = SocietaEStruttureHome.index;\n    var res = \"<div id='divOrgTree' >\" + result + \"</div>\";\n    $(\"#divOrgStructure\").append(res); //append the HTML data \n\n    //$(window).load(function () { $(\"#dvLoading\").fadeOut(20000); });\n    $(\"#dvLoading\").show(); // Here to show the Loading image\n\n    $(\"#divOrgTree\").fancytree();\n\n    $(\"#dvLoading\").show(); //Here to hide the Loading image\n    //Expand all the node of the tree on load\n    $(\"#divOrgTree\").fancytree(\"getRootNode\").visit(function (node) {\n        //node.setExpanded(true);\n    });\n\n    $(\"#btnModify\").show();\n},\n
\n\n

Am i doing anything wrong here. please help.

\n", "Lable": "No"} {"QuestionId": 25687323, "AnswerCount": 0, "Tags": "", "CreationDate": "2014-09-05T13:42:54.593", "AcceptedAnswerId": null, "Title": "Links aren't clickable, when they're placed over playing YouTube video embed on iPad", "Body": "

I've got menu on tablet resolution with fixed position. Also there is in the content of this page YouTube video embed (iframe).

\n\n

Now on iPad when you play the YouTube video and than you open a menu item, it shows new element (submenu) which is also position: fixed, but you can't click on any link in this submenu. I've tried to fix it with changing wmode at the begining of url GET parameters like this:

\n\n
wmode=opaque, wmode=transparent\n
\n\n

But it didn't work. I've also tried to fixed it with changing the YT iframe to object, but it didn't help either.

\n\n

Basicly if you have any links over playing YouTube video on iPad, you can't click on them. If the video isn't playing, these links work. Is there any solution to fix it, it works well on all desktop browsers.

\n", "Lable": "No"}