Skip to content

Instantly share code, notes, and snippets.

@wesslen
Last active March 2, 2023 18:53
Show Gist options
  • Save wesslen/1bb5a860723e74fdb85295c6c913783c to your computer and use it in GitHub Desktop.
Save wesslen/1bb5a860723e74fdb85295c6c913783c to your computer and use it in GitHub Desktop.
stack-overflow-query
import bq_helper
from bq_helper import BigQueryHelper
# https://www.kaggle.com/sohier/introduction-to-the-bq-helper-package
stackOverflow = bq_helper.BigQueryHelper(active_project="bigquery-public-data",
dataset_name="stackoverflow")
bq_assistant = BigQueryHelper("bigquery-public-data", "stackoverflow")
bq_assistant.list_tables()
# ['badges',
# 'comments',
# 'post_history',
# 'post_links',
# 'posts_answers',
# 'posts_moderator_nomination',
# 'posts_orphaned_tag_wiki',
# 'posts_privilege_wiki',
# 'posts_questions',
# 'posts_tag_wiki',
# 'posts_tag_wiki_excerpt',
# 'posts_wiki_placeholder',
# 'stackoverflow_posts',
# 'tags',
# 'users',
# 'votes']
# view schema
bq_assistant.table_schema('posts_questions')
# get sample of 1000 rows
post_df = bq_assistant.head("posts_questions", num_rows=10000)
def isNaN(num):
return num != num
t = tuple([int(_) for _ in post_df['accepted_answer_id'] if not isNaN(_)])
query = "select * from bigquery-public-data.stackoverflow.posts_answers where id IN {}".format(t)
answers_df = bq_assistant.query_to_pandas(query)
answers_df.head()
import pandas as pd
answers_df.reset_index().to_json("answers.json", orient='records')
post_df.reset_index().to_json("posts.json", orient='records')
[{"index":0,"id":29341732,"title":null,"body":"<p>I am not professional in JS, but I am also playing with parse Cloude Code. So I suppose that you enumerate roomMates incorrectly.<\/p>\n\n<p>You should enumerate array and get object like:<\/p>\n\n<pre><code>for (var i=0; i&lt;roomMates.length; i++) {\n roomMate = roomMates[i];\n}\n<\/code><\/pre>\n\n<p>The <code>key in<\/code> enumerator works in key-value dictionaries to enumerate keys.<\/p>\n\n<pre><code>var dictionary = {key1 : \"Hi\", key2: \"Bye\"};\nfor (var key in dictionary) {\n obj = dictionary[key];\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1427704827043,"favorite_count":null,"last_activity_date":1427704827043,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2514012.0,"parent_id":27591589,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":1,"id":29566654,"title":null,"body":"<p>write this command \" sudo chown www-data. . \" in db file directory.<\/p>\n\n<p>other solution check the file exists or not ?<\/p>\n\n<p>ex :<\/p>\n\n<p>var fs = require(\"fs\");<\/p>\n\n<p>var exists = fs.existsSync(dbfilepath);<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1428684338310,"favorite_count":null,"last_activity_date":1428685292917,"last_edit_date":1428685292917,"last_editor_display_name":null,"last_editor_user_id":4498516.0,"owner_display_name":null,"owner_user_id":4498516.0,"parent_id":27504465,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":2,"id":31013617,"title":null,"body":"<p>There's a few things that are needed.\nThis will work for saving cell changes to the db.\nI'm not sure how to get a list of selected rows.<\/p>\n\n<p>In $scope.gridOptions include:<\/p>\n\n<pre><code> onRegisterApi: function(gridApi){\n \/\/set gridApi on scope\n $scope.gridApi = gridApi;\n gridApi.rowEdit.on.saveRow($scope, $scope.saveRow);\n },\n<\/code><\/pre>\n\n<p>Next in your controller include both saveRow and saveRowFunction:<\/p>\n\n<pre><code>$scope.saveRow = function( rowEntity ) {\n\nvar promise = $scope.saveRowFunction(rowEntity);\n $scope.gridApi.rowEdit.setSavePromise(rowEntity, promise);\n };\n\n $scope.saveRowFunction = function(row) {\n var deferred = $q.defer();\n if (row.id == undefined){\n $http.post('http:\/\/your\/api\/address\/', row).success(deferred.resolve).error(deferred.reject);\n\n }else{\n \/\/console.log(\"10 put ID: \" + row.id);\n $http.put('http:\/\/your\/api\/address\/' + row.id, row).success(deferred.resolve).error(deferred.reject);\n }\n return deferred.promise;\n };\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1435093927843,"favorite_count":null,"last_activity_date":1435093927843,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4942349.0,"parent_id":27646560,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":3,"id":30768553,"title":null,"body":"<p>Per the OASIS XML Catalog specification [1] your example should work as follows:<\/p>\n\n<p><a href=\"http:\/\/www.mycompany.com\/schemas\/foo.xsd\" rel=\"nofollow\">http:\/\/www.mycompany.com\/schemas\/foo.xsd<\/a><\/p>\n\n<p>rewrites to:<\/p>\n\n<p>file:\/\/\/c:\/Projects\/MyProject\/schemas\/foo.xsd<\/p>\n\n<p>Have you tried using a 'rewriteURI' [2] instead of a 'rewriteSystem' [1] ?<\/p>\n\n<p>Here is an example that we've been using extensively for several years at JPL. At least, I know this works reliably on linux &amp; macosx; however, I don't make any claims about windows.<\/p>\n\n<pre><code>&lt;?xml version='1.0'?&gt;\n&lt;catalog xmlns=\"urn:oasis:names:tc:entity:xmlns:xml:catalog\"\n prefer=\"public\"&gt;\n\n &lt;rewriteURI \n rewritePrefix=\"file:.\/www.omg.org\/\" \n uriStartString=\"http:\/\/www.omg.org\/\"\/&gt;\n\n&lt;\/catalog&gt;\n<\/code><\/pre>\n\n<p>With the Apache XML Resolver 1.2 library implementation [3], the above rewrites the following URI:<\/p>\n\n<p><a href=\"http:\/\/www.omg.org\/spec\/UML\/20110701\/UML.xmi\" rel=\"nofollow\">http:\/\/www.omg.org\/spec\/UML\/20110701\/UML.xmi<\/a><\/p>\n\n<p>to:<\/p>\n\n<p>file:.\/www.omg.org\/spec\/UML\/20110701\/UML.xmi<\/p>\n\n<p>However, IntelliJ 14.1.3 says that the above is ill-formed; specifically, IntelliJ claims the attribute 'uriStartString' is not allowed and that 'rewriteURI' is missing the 'uriIdStartString' Attribute. That is, IntelliJ expects this:<\/p>\n\n<pre><code>&lt;?xml version='1.0'?&gt;\n&lt;catalog xmlns=\"urn:oasis:names:tc:entity:xmlns:xml:catalog\"\n prefer=\"public\"&gt;\n\n &lt;rewriteURI \n rewritePrefix=\"file:.\/www.omg.org\/\" \n uriIdStartString=\"http:\/\/www.omg.org\/\"\/&gt;\n\n&lt;\/catalog&gt;\n<\/code><\/pre>\n\n<p>The Apache XML Resolver 1.2 library does not handle this form. <\/p>\n\n<p>Who to trust: IntelliJ? OASIS? Apache XML Resolver?<\/p>\n\n<p>It does not help that the OASIS XML Catalog spec 1.0 uses 'uriStartString' in [2] and Appendix B (non-normative) but 'uriIdStartString' in Appendix A (non-normative).<\/p>\n\n<p>It would be great if Norm Welch could comment on this; after all he wrote the OASIS XML Catalog spec and has been involved in the Apache XML Resolver implementation. <\/p>\n\n<p>[1] <a href=\"https:\/\/www.oasis-open.org\/committees\/entity\/spec-2001-08-06.html#s.rewritesystem\" rel=\"nofollow\">https:\/\/www.oasis-open.org\/committees\/entity\/spec-2001-08-06.html#s.rewritesystem<\/a><\/p>\n\n<p>[2] <a href=\"https:\/\/xerces.apache.org\/xml-commons\/components\/resolver\/resolver-article.html\" rel=\"nofollow\">https:\/\/xerces.apache.org\/xml-commons\/components\/resolver\/resolver-article.html<\/a><\/p>\n\n<p>[3] <a href=\"https:\/\/www.oasis-open.org\/committees\/entity\/spec-2001-08-06.html#element-rewriteURI\" rel=\"nofollow\">https:\/\/www.oasis-open.org\/committees\/entity\/spec-2001-08-06.html#element-rewriteURI<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1433976145433,"favorite_count":null,"last_activity_date":1433976145433,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1009693.0,"parent_id":27448570,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":4,"id":38412642,"title":null,"body":"<p>This is how to get the purple and orange colors in the image below. <\/p>\n\n<p>Create a custom theme for your DatePicker in your styles.xml file: <\/p>\n\n<pre><code> &lt;style name=\"MyDatePickerTheme\" parent=\"Theme.AppCompat.Light.Dialog.Alert\"&gt;\n &lt;item name=\"colorAccent\"&gt;@android:color\/holo_purple&lt;\/item&gt;\n &lt;item name=\"android:windowBackground\"&gt;@drawable\/date_picker_background&lt;\/item&gt;\n &lt;\/style&gt;\n<\/code><\/pre>\n\n<p>Note that this theme references a custom background for the date picker in the drawable resource folder. So create a drawable resource named date_picker_background.xml and put this in it:<\/p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;inset xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n android:insetLeft=\"16dp\"\n android:insetTop=\"16dp\"\n android:insetRight=\"16dp\"\n android:insetBottom=\"16dp\"&gt;\n &lt;shape android:shape=\"rectangle\"&gt;\n &lt;corners android:radius=\"2dp\" \/&gt;\n &lt;solid android:color=\"@android:color\/holo_orange_dark\" \/&gt;\n &lt;\/shape&gt;\n&lt;\/inset&gt;\n<\/code><\/pre>\n\n<p>Finally, you must reference this theme when you instantiate the DatePickerDialog: <\/p>\n\n<pre><code>DatePickerDialog datePickerDialog = new DatePickerDialog(getActivity(),\n R.style.MyDatePickerTheme, this, year, month, day);\n<\/code><\/pre>\n\n<p>My explanation here was adapted from <a href=\"http:\/\/www.materialdoc.com\/date-picker\/\" rel=\"nofollow noreferrer\">this better, more complete explanation of DatePicker styling.<\/a> <\/p>\n\n<p><a href=\"https:\/\/i.stack.imgur.com\/oSA8W.png\" rel=\"nofollow noreferrer\"><img src=\"https:\/\/i.stack.imgur.com\/oSA8W.png\" alt=\"enter image description here\"><\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1468683147017,"favorite_count":null,"last_activity_date":1468683147017,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3482621.0,"parent_id":27744921,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":5,"id":34258218,"title":null,"body":"<p>Here's what my Nix Haskell dev environment looks like<\/p>\n\n<p>in <code>~\/.nixpkgs\/config.nix<\/code>:<\/p>\n\n<h2>The environment helper function<\/h2>\n\n<p>First off, define a haskellEnvFun function for building Haskell environments:<\/p>\n\n<pre><code>packageOverrides = super: rec {\n\nhaskellEnvFun = { withHoogle ? false, compiler ? null, name }:\n let hp = if compiler != null\n then super.haskell.packages.${compiler}\n else haskellPackages;\n\n ghcWith = if withHoogle\n then hp.ghcWithHoogle\n else hp.ghcWithPackages;\n\n in super.buildEnv {\n name = name;\n paths = [(ghcWith myHaskellPackages)];\n };\n<\/code><\/pre>\n\n<h2>Defining some environments<\/h2>\n\n<p>Call this function to define two environments: one for running the Hoogle builder on changes, and one without:<\/p>\n\n<pre><code>haskellEnvHoogle = haskellEnvFun {\n name = \"haskellEnvHoogle\";\n withHoogle = true;\n};\n\nhaskellEnv = haskellEnvFun {\n name = \"haskellEnv\";\n withHoogle = false;\n};\n<\/code><\/pre>\n\n<h2>Packages<\/h2>\n\n<p>Define all the packages you want to use in your local Haskell dev environment:<\/p>\n\n<pre><code>myHaskellPackages = hp: with hp; [\n Boolean\n HTTP\n HUnit\n MissingH\n QuickCheck\n SafeSemaphore\n Spock\n aeson\n async\n attoparsec\n bifunctors\n blaze-builder\n blaze-builder-conduit\n blaze-builder-enumerator\n blaze-html\n blaze-markup\n blaze-textual\n cased\n cassava\n cereal\n comonad\n comonad-transformers\n directory_1_2_4_0\n dlist\n dlist-instances\n doctest\n exceptions\n fingertree\n foldl\n free\n hamlet\n hashable\n hspec\n hspec-expectations\n html\n http-client\n http-date\n http-types\n io-memoize\n keys\n language-c\n language-javascript\n language-bash\n lens\n lens-action\n lens-aeson\n lens-datetime\n lens-family\n lens-family-core\n lifted-async\n lifted-base\n linear\n list-extras\n list-t\n logict\n mime-mail\n mime-types\n mmorph\n monad-control\n monad-coroutine\n monad-loops\n monad-par\n monad-par-extras\n monad-stm\n monadloc\n mongoDB\n monoid-extras\n network\n newtype\n numbers\n optparse-applicative\n parsec\n parsers\n pcg-random\n persistent\n persistent-mongoDB\n persistent-template\n pipes\n pipes-async\n pipes-attoparsec\n pipes-binary\n pipes-bytestring\n pipes-concurrency\n pipes-csv\n pipes-extras\n pipes-group\n pipes-http\n pipes-mongodb\n pipes-network\n pipes-parse\n pipes-safe\n pipes-shell\n pipes-text\n posix-paths\n postgresql-simple\n pretty-show\n profunctors\n random\n reducers\n reflection\n regex-applicative\n regex-base\n regex-compat\n regex-posix\n regular\n relational-record\n resourcet\n retry\n rex\n safe\n sbv\n scotty\n semigroupoids\n semigroups\n shake\n shakespeare\n shelly\n simple-reflect\n speculation\n split\n spoon\n stm\n stm-chans\n stm-stats\n streaming\n streaming-bytestring\n streaming-wai\n strict\n stringsearch\n strptime\n syb\n system-fileio\n system-filepath\n tagged\n taggy\n taggy-lens\n tar\n tardis\n tasty\n tasty-hspec\n tasty-hunit\n tasty-quickcheck\n tasty-smallcheck\n temporary\n test-framework\n test-framework-hunit\n text\n text-format\n time\n tinytemplate\n transformers\n transformers-base\n turtle\n uniplate\n unix-compat\n unordered-containers\n uuid\n vector\n void\n wai\n wai-conduit\n warp\n wreq\n xhtml\n yaml\n zippers\n zlib\n];\n<\/code><\/pre>\n\n<h2>Shell helpers<\/h2>\n\n<p>In your <code>~\/.profile<\/code> define a couple bash functions to load those environments for convenience:<\/p>\n\n<pre>\nenv-type () {\n envtype=\"$1\"\n shift\n nix-shell -Q -p $envtype \"$@\"\n}\n\nhaskell-env () {\n env-type \"haskellEnv\" \"$@\"\n}\n\nhaskell-env-hoogle () {\n env-type \"haskellEnvHoogle\" \"$@\"\n}\n<\/pre>\n\n<h2>Hoogle<\/h2>\n\n<p>Call <code>haskell-env-hoogle<\/code> in your shell. This will build all of your packages + docs and load you into an environment with <code>hoogle<\/code> in scope. At this point I usually type:<\/p>\n\n<pre><code>hoogle server --local -p 8080 &amp;&gt; \/tmp\/hoogle.log &amp; disown\n<\/code><\/pre>\n\n<p>to launch a hoogle server the the background. Eventually I want to have a systemd service for this so that I can just nixos-rebuild to regen docs and launch the server automatically.<\/p>\n\n<h2>Emacs<\/h2>\n\n<p>For emacs I've set the <code>haskell-hoogle-url<\/code> to <code>http:\/\/localhost:8080\/?hoogle=%s<\/code>, so that I can get local hoogle docs for keywords under my cursor. I use spacemacs so I just type <code>, h h<\/code> for this functionality.<\/p>\n\n<p>You can see my full nixpkgs config here: <a href=\"https:\/\/github.com\/jb55\/nix-files\/blob\/659798f2ca81fb7ad0cb5a29de576024ee16eef8\/nixpkgs\/config.nix#L20\" rel=\"noreferrer\">https:\/\/github.com\/jb55\/nix-files\/blob\/659798f2ca81fb7ad0cb5a29de576024ee16eef8\/nixpkgs\/config.nix#L20<\/a><\/p>\n\n<p>Hope that helps.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1450053901830,"favorite_count":null,"last_activity_date":1450080318063,"last_edit_date":1450080318063,"last_editor_display_name":null,"last_editor_user_id":10486.0,"owner_display_name":null,"owner_user_id":10486.0,"parent_id":27728838,"post_type_id":2,"score":13,"tags":null,"view_count":null},{"index":6,"id":30040164,"title":null,"body":"<p>The error messages indicate that the compiler wants an opening bracket. <\/p>\n\n<p>Did you copy your code exactly as it is in your app? On the Objective-C side, it looks like a few things are missing, namely the assignment operator \"=\", \"nil\" to indicate end of options for otherButtonTitles, and\n\";\" at the end of the method call.<\/p>\n\n<p>To the compiler, everything from \"UIAlertView*\" up to \"[show alertview];\" looks like a single statement. <\/p>\n\n<p>BTW You can also use [NSString stringWithUTF8String:] instead of alloc\/init'ing all the strings. Same effect, less code:<\/p>\n\n<pre><code> UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:[NSString stringWithUTF8String:title]\n message:[NSString stringWithUTF8String:message]\n delegate:NULL\n cancelButtonTitle:[NSString stringWithUTF8String:ok]\n otherButtonTitles:[NSString stringWithUTF8String:cancel], nil];\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1430774333740,"favorite_count":null,"last_activity_date":1430774974660,"last_edit_date":1430774974660,"last_editor_display_name":null,"last_editor_user_id":887619.0,"owner_display_name":null,"owner_user_id":887619.0,"parent_id":27305898,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":7,"id":30033554,"title":null,"body":"<p>The deployment target isn't presented to the end user, but there is an Info.plist key <a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/General\/Reference\/InfoPlistKeyReference\/Articles\/LaunchServicesKeys.html\" rel=\"nofollow\"><code>LSMinimumSystemVersion<\/code><\/a> that tells users when their OS is too old.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1430752182533,"favorite_count":null,"last_activity_date":1430752182533,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":309425.0,"parent_id":27402404,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":8,"id":28268520,"title":null,"body":"<p>Finally I found the solution. You can use the following:<\/p>\n\n<pre><code>Launcher.LaunchUriAsync(new Uri(\"podcast:www.example.com\/podcast.rss\"));\n<\/code><\/pre>\n\n<p>Which opens the poadcast app and directly shows the podcast. It's like the user searched itself for it. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1422828630357,"favorite_count":null,"last_activity_date":1422828630357,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1028957.0,"parent_id":27457917,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":9,"id":28381988,"title":null,"body":"<p>In numpy all objects contained in the same array have a common data type. This data type is specified in the attribute <code>dtype<\/code> of the array. (<a href=\"http:\/\/docs.scipy.org\/doc\/numpy\/reference\/generated\/numpy.array.html\" rel=\"nofollow\">numpy.array doc<\/a>, <a href=\"http:\/\/docs.scipy.org\/doc\/numpy\/user\/basics.types.html\" rel=\"nofollow\">numpy datatypes<\/a>) <\/p>\n\n<p>Data in your array <code>a_h<\/code> is of data type <code>float64<\/code> (64bit float). As your kernel is expecting 32bit floats (<code>float32<\/code>) it is interpreting the data of <code>a_h<\/code> like this. So it would see 8 32bit floats instead of 4 64bit floats.<\/p>\n\n<p>To make it work store the objects in <code>a_h<\/code> as <code>float32<\/code>. Therefore define it like this:<\/p>\n\n<pre><code>a_h = np.array([[1.0, 2.0, 3.0, 4.0], dtype=np.float32)\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1423311288917,"favorite_count":null,"last_activity_date":1423311288917,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4540373.0,"parent_id":27692883,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":10,"id":28043840,"title":null,"body":"<p>I got the solution of my question.As there is no answer provided i thought my answer may be helpful.At first my main problem is to create a table with the Australian postcodes, suburb and state. For that i googled a lot and after all i got the csv file of all these information. I filtered it according to my requirement.<\/p>\n\n<p>Here is the link to the csv file that consist of Australian postcodes, suburb and state. <a href=\"https:\/\/drive.google.com\/file\/d\/0B68AKIPHfh1JSVJYUHQ2YWtuaEE\/view?usp=sharing\" rel=\"nofollow\">here<\/a>.<\/p>\n\n<p>Now you can use this csv to create a table in a database which further is used in autocomplete.<\/p>\n\n<p>All the codes that i have used may not be usable in your case so i didn't care to put it.<\/p>\n\n<p>But i think this will help a lot.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1421752146110,"favorite_count":null,"last_activity_date":1421752146110,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1912562.0,"parent_id":27334056,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":11,"id":28059963,"title":null,"body":"<p>MySQL Workbench make entity-relation schema of your database.<\/p>\n\n<p><a href=\"http:\/\/blog.infoadvisors.com\/index.php\/articles\/what-are-conceptual-logical-and-physical-data-models\/\" rel=\"nofollow\">Here you can find some good info<\/a> and <a href=\"http:\/\/en.wikipedia.org\/wiki\/Database_design#Logically_structuring_data\" rel=\"nofollow\">here in wikipedia<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1421816540017,"favorite_count":null,"last_activity_date":1421816540017,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1378364.0,"parent_id":27554451,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":12,"id":28234811,"title":null,"body":"<p>Seems like the carrousel isn't rendender correctly<\/p>\n\n<p>Try to put it on a <a href=\"http:\/\/docs.meteor.com\/#\/full\/meteor_settimeout\" rel=\"nofollow\">Meteor.setTimeout<\/a><\/p>\n\n<p>Sometimes query plugins should be placed on a rendered but also on a timer<\/p>\n\n<pre><code>Template.main.rendered = function (){\nMeteor.setTimeout(function(){\n $(\"#owl-demo\").owlCarousel();\n }, 0) \n});\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1422616891213,"favorite_count":null,"last_activity_date":1441653772220,"last_edit_date":1441653772220,"last_editor_display_name":null,"last_editor_user_id":3961546.0,"owner_display_name":null,"owner_user_id":3961546.0,"parent_id":27413710,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":13,"id":28276993,"title":null,"body":"<p>The best I could find is to set up a \"convention\": my repositories declare that they expect a persistence unit named <code>myConventionalPU<\/code> to be made available. The application layer then assigns that alias to the entity manager factory that it sets up and injects into Spring Data, so my custom implementations can receive the correct EMF with autowiring by using that alias. Here's an excerpt of my application context:<\/p>\n\n<pre><code>&lt;bean id=\"myEntityManagerFactory\" name=\"myConventionalPU\" \n class=\"org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean\"&gt;\n [...]\n&lt;\/bean&gt;\n\n&lt;jpa:repositories base-package=\"com.example\"\n entity-manager-factory-ref=\"myEntityManagerFactory\"\n transaction-manager-ref=\"transactionManager\" \/&gt;\n<\/code><\/pre>\n\n<p>And within my custom implementation:<\/p>\n\n<pre><code>@PersistenceContext(unitName = \"myConventionalPU\")\nprivate EntityManager em;\n<\/code><\/pre>\n\n<p>I opened <a href=\"https:\/\/jira.spring.io\/browse\/DATAJPA-669\" rel=\"noreferrer\">DATAJPA-669<\/a> with this requirement.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1422877307527,"favorite_count":null,"last_activity_date":1422877307527,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1465635.0,"parent_id":27606905,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":14,"id":28138011,"title":null,"body":"<p>By default android takes the package name as the process name. But if you define process property in application tag in manifest file <code>android:process=\"com.example.newprocessname\"<\/code> then the application will run with this name \"com.example.newprocessname\".<\/p>\n\n<p>As for your questions, <\/p>\n\n<ul>\n<li><p>1-> In this case your application name is same as the default package name, that's why it is working. Try changing the process name. It'll not work.<\/p><\/li>\n<li><p>2-> That's true. It is by default. Refer to \"android:process\" in the following link: <a href=\"https:\/\/developer.android.com\/guide\/topics\/manifest\/application-element.html\">https:\/\/developer.android.com\/guide\/topics\/manifest\/application-element.html<\/a><\/p><\/li>\n<\/ul>\n\n<p>Hope this answers your question!<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1422199369287,"favorite_count":null,"last_activity_date":1422199369287,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3845476.0,"parent_id":27571889,"post_type_id":2,"score":10,"tags":null,"view_count":null},{"index":15,"id":28336183,"title":null,"body":"<p>Property files are loaded through <code>org.springframework.boot.context.config.ConfigFileApplicationListener<\/code>, this happens before application context is really loaded.<\/p>\n\n<p>I made a custom <code>GroovyPropertySource<\/code> to load <code>application.groovy<\/code> on classpath, so it will be available to application context through the same <code>Environment.getProperty()<\/code> when it needs to configure.<\/p>\n\n<p>Check out <a href=\"https:\/\/github.com\/davidiamyou\/spring-groovy-config\" rel=\"nofollow\">https:\/\/github.com\/davidiamyou\/spring-groovy-config<\/a><\/p>\n\n<p>You should be able to do something like<\/p>\n\n<pre><code>beans {\n anotherBean(AnotherBean) { \n commonShinyProperty = '${common.shiny}'\n }\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1423110182927,"favorite_count":null,"last_activity_date":1423110182927,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2012567.0,"parent_id":27332502,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":16,"id":28452979,"title":null,"body":"<p>It seems that rebooting the tcpip server on the device fixes this. Steps to do this:<\/p>\n\n<ul>\n<li>Plug the device in to a computer via USB<\/li>\n<li>Run 'adb usb' to connect to the device via USB<\/li>\n<li>Run 'adb tcpip 4321' to restart the tcpip server on port 4321<\/li>\n<li>Unplug the device<\/li>\n<li>Run 'adb connect 192.168.1.x:4321' and it should now connect successfully.<\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1423653421833,"favorite_count":null,"last_activity_date":1423653421833,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4554504.0,"parent_id":27691376,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":17,"id":28540634,"title":null,"body":"<p>Added arraybuffer as a responsetype of the GET request, now the browser interprets the files correctly. <\/p>\n\n<pre><code> \/******** FILE DOWNLOAD **********\/\n$scope.downloadFiles = function (file) {\n $http({\n method: 'GET',\n cache: false,\n url: host + 'api\/Files\/GetFile',\n responseType:'arraybuffer',\n headers: {\n 'Content-Type': 'application\/json; charset=utf-8',\n 'fileID': file.id\n }\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1424086884907,"favorite_count":null,"last_activity_date":1507621628313,"last_edit_date":1507621628313,"last_editor_display_name":null,"last_editor_user_id":1720170.0,"owner_display_name":null,"owner_user_id":1720170.0,"parent_id":27289157,"post_type_id":2,"score":13,"tags":null,"view_count":null},{"index":18,"id":29077867,"title":null,"body":"<p><a href=\"https:\/\/github.com\/CocoaLumberjack\/CocoaLumberjack\/pull\/420#issuecomment-67561238\" rel=\"nofollow\">Seems<\/a> like older CocoaPods was redefining <code>OS_OBJECT_USE_OBJC<\/code> breaking <code>OS_OBJECT_HAVE_OBJC_SUPPORT<\/code>.<\/p>\n\n<p>We got this <a href=\"https:\/\/github.com\/CocoaLumberjack\/CocoaLumberjack\/blob\/master\/Classes\/DDLog.h#L26\" rel=\"nofollow\">fixed<\/a> by checking <code>OS_OBJECT_USE_OBJC<\/code> and using a newer CocoaPods.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1426512013983,"favorite_count":null,"last_activity_date":1426512013983,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1049134.0,"parent_id":27267865,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":19,"id":29255274,"title":null,"body":"<ul>\n<li>OS X: <strong><code>~\/Library\/Application Support\/Sublime Text 3\/Packages\/<\/code><\/strong><\/li>\n<li>Windows: <strong><code>%APPDATA%\/Roaming\/Sublime Text 3\/Packages\/<\/code><\/strong><\/li>\n<li>Linux: <strong><code>~\/.config\/sublime-text-3\/Packages\/<\/code><\/strong><\/li>\n<\/ul>\n\n<p>You can edit it by additional plugin like <strong><a href=\"https:\/\/packagecontrol.io\/packages\/PackageResourceViewer\" rel=\"nofollow noreferrer\">PackageResourceViewer<\/a><\/strong><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1427285361980,"favorite_count":null,"last_activity_date":1571122979337,"last_edit_date":1571122979337,"last_editor_display_name":null,"last_editor_user_id":1896134.0,"owner_display_name":null,"owner_user_id":2708895.0,"parent_id":27338255,"post_type_id":2,"score":14,"tags":null,"view_count":null},{"index":20,"id":28996658,"title":null,"body":"<p>SAP HANA does not come with a <code>ISNUMERIC()<\/code> function.\nHowever, this question had been asked and answered multiple times on SCN:\nE.g. <a href=\"http:\/\/scn.sap.com\/thread\/3449615\" rel=\"nofollow\">http:\/\/scn.sap.com\/thread\/3449615<\/a><\/p>\n\n<p>or my approach from back in the days:\n<a href=\"http:\/\/scn.sap.com\/thread\/3638673\" rel=\"nofollow\">http:\/\/scn.sap.com\/thread\/3638673<\/a><\/p>\n\n<pre><code>drop function isnumeric;\ncreate function isNumeric( IN checkString NVARCHAR(64))\nreturns isNumeric integer\nlanguage SQLSCRIPT as\nbegin\ndeclare tmp_string nvarchar(64) := :checkString;\ndeclare empty_string nvarchar(1) :='';\n\n\/* replace all numbers with the empty string *\/\ntmp_string := replace (:tmp_string, '1', :empty_string);\ntmp_string := replace (:tmp_string, '2', :empty_string);\ntmp_string := replace (:tmp_string, '3', :empty_string);\ntmp_string := replace (:tmp_string, '4', :empty_string);\ntmp_string := replace (:tmp_string, '5', :empty_string);\ntmp_string := replace (:tmp_string, '6', :empty_string);\ntmp_string := replace (:tmp_string, '7', :empty_string);\ntmp_string := replace (:tmp_string, '8', :empty_string);\ntmp_string := replace (:tmp_string, '9', :empty_string);\ntmp_string := replace (:tmp_string, '0', :empty_string);\n\n\/*if the remaining string is not empty, it must contain non-number characters *\/\nif length(:tmp_string)&gt;0 then\n isNumeric := 0;\nelse \n isNumeric := 1;\nend if;\n\nend;\n<\/code><\/pre>\n\n<p>Testing this shows:\n with data as( select '1blablupp' as VAL from dummy\n union all select '1234' as VAL from dummy\n union all select 'bla123' as val from dummy)<\/p>\n\n<pre><code>select val, isNumeric(val) from data \n\nVAL ISNUMERIC(VAL)\n1blablupp 0 \n1234 1 \nbla123 0 \n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1426105634957,"favorite_count":null,"last_activity_date":1426105634957,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4191767.0,"parent_id":27703567,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":21,"id":29258912,"title":null,"body":"<p>View cshtml<\/p>\n\n<pre><code>$(document).ready(function () {\n $.ajax({\n url: \"\/home\/ChartData\",\n type: 'POST',\n dataType: 'json'\n }).success(function (dataChart) {\n var Xaxis = [];\/\/skapa tre olika array\n var dataseries = [];\n for (var i = 0; i &lt; dataChart.length; i++) {\n var items = dataChart[i];\n var XcategoreisItem = items.id;\n var seriesData = items;\n\n Xaxis.push(XcategoreisItem); \n dataseries.push(seriesData); \n console.log(dataseries);\n }\n getchart(Xaxis, dataseries);\n\n }).error(function (er, xhr, e) {\n console.log(\"Error: \", er, xhr, e);\n })\n\n});\nfunction getchart(Xaxis, dataseries) {\n $('#container').highcharts({\n chart: {\n type: 'line',\n zoomType: 'xy',\n panning: true,\n panKey: 'shift'\n },\n\n title: {\n text: 'Zooming and panning'\n },\n\n subtitle: {\n text: 'Click and drag to zoom in. Hold down shift key to pan.'\n },\n plotOptions: {\n series: {\n dataLabels: {\n enabled: true,\n format: '{y}%', \n\n }\n }\n },\n xAxis: {\n categories: Xaxis\n },\n yAxis: {\n title: {\n text: 'Y axis text'\n },\n\n series: [{\n name: 'Id',\n data: dataseries\n }]\n });\n};\n<\/code><\/pre>\n\n<p><\/p>\n\n\n\n\n\n<p>HomeController<\/p>\n\n<pre><code> public ActionResult ChartData()\n {\n TbChart db = new TbChart();\n\n var TbChartData = db.getYaxis();\n\n return this.Json(TbChartData, JsonRequestBehavior.AllowGet);\n }\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1427294782743,"favorite_count":null,"last_activity_date":1427294782743,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4578317.0,"parent_id":27741908,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":22,"id":31203943,"title":null,"body":"<p>equivalent of previous page path is not available in app analytics because calculating previous page is considerably easier on web with \"http referer\" in app there is nothing equivalent of that.<\/p>\n\n<p>I have tried an alternate solution I tried to create a custom dimension called previous screen and tried to populate it with by storing screen names in local storage. But I ran in to trouble with max length of custom dimension which is 150 bytes. Best way to get this is i guess by using Google Big query.<\/p>\n\n<p>Hope this helps<\/p>\n\n<p>Regards\nNik<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1435917571940,"favorite_count":null,"last_activity_date":1435917571940,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":996438.0,"parent_id":27278964,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":23,"id":27270042,"title":null,"body":"<p>I got help and have a solution now:<\/p>\n\n<pre><code>insitu &lt;- read.table(\"insitu.txt\",header=TRUE,colClasses=c(\"Date\",\"numeric\"))\nest &lt;- read.table(\"estimated.txt\",header=TRUE,colClasses=c(\"Date\",\"numeric\"))\n\n\ninsitu.plot &lt;- xyplot(insitu~date_fname,data=insitu,type=\"l\",\n panel=function(x,y,...){panel.grid(); panel.xyplot(x,y,...)},xlab=list(label=\"Date\",cex=2))\nest.plot &lt;- xyplot(estimated~date,data=est,panel=panel.bwplot,horizontal=FALSE)\nboth &lt;- insitu.plot+est.plot\n\nupdate(both,xlim=range(c(est$date,insitu$date_fname))+c(-1,1),ylim=range(c(est$estimated,insitu$insitu)))\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417604596090,"favorite_count":null,"last_activity_date":1417607160233,"last_edit_date":1417607160233,"last_editor_display_name":null,"last_editor_user_id":3202715.0,"owner_display_name":null,"owner_user_id":3202715.0,"parent_id":27268542,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":24,"id":27279195,"title":null,"body":"<p>You have your <code>GroupDocs<\/code> array, that's most of the way there already. You can then get the <code>scoreDocs<\/code> from each GroupDocs, and lookup the document with the doc id, from <code>ScoreDoc.doc<\/code>, like:<\/p>\n\n<pre><code>for (GroupDocs&lt;BytesRef&gt; group : d) {\n for (ScoreDoc scoredoc : group.scoreDocs) {\n Document doc = is.doc(scoredoc.doc);\n \/\/Do stuff\n }\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417631930390,"favorite_count":null,"last_activity_date":1417631930390,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1628375.0,"parent_id":27277265,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":25,"id":27307685,"title":null,"body":"<p>1 trick you can use is to add a child div with a really large width to contain all your images horizontally, then cap the width of the outer most div.<\/p>\n\n<p><a href=\"http:\/\/jsfiddle.net\/biz79\/6jnc78z6\/1\/\" rel=\"nofollow\">http:\/\/jsfiddle.net\/biz79\/6jnc78z6\/1\/<\/a><\/p>\n\n<p>HTML: <\/p>\n\n<pre><code>&lt;div class=\"headmenu\"&gt;\n &lt;div class=\"container\"&gt;\n &lt;a class=\"ui circular image border1px margin33 foodicon heightwidth\"&gt;\n &lt;img src=\"https:\/\/dl.dropboxusercontent.com\/u\/2542034\/colorPicks\/a400.png\" class=\"heightwidth\"&gt;\n &lt;\/a&gt;\n...\n &lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n\n<p>CSS:<\/p>\n\n<pre><code>.headmenu {\n width:100%;\n height:100px;\n overflow-x: scroll;\n overflow-y: hidden;\n}\n\n.container {\n width:2500px;\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417745659513,"favorite_count":null,"last_activity_date":1417745659513,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3799191.0,"parent_id":27306981,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":26,"id":27307977,"title":null,"body":"<p>it looks like an issue of swift accelerate.framework<\/p>\n\n<p>it works when I using the method on Objective-C class, then call it by bridging-header<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417748003950,"favorite_count":null,"last_activity_date":1417748003950,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1822879.0,"parent_id":27290664,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":27,"id":27317377,"title":null,"body":"<p>I found a way. It was related with build configuration. When i add to js folder into exclude path, then problem solved. Thx to this link => <a href=\"https:\/\/stackoverflow.com\/questions\/7102299\/eclipse-javascript-validation-disabled-but-still-generating-errors\">js-validation-disabled<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417787375953,"favorite_count":null,"last_activity_date":1417789728907,"last_edit_date":1495542134813,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1841447.0,"parent_id":27291544,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":28,"id":27320632,"title":null,"body":"<p>If you are new to Python I recommend <a href=\"https:\/\/store.continuum.io\/cshop\/anaconda\/\" rel=\"nofollow noreferrer\">Anaconda<\/a>, a Python distribution that comes with many useful pacakges (including Gensim, IIRC) ready to use. <\/p>\n\n<p>Alternatively try <\/p>\n\n<pre><code>pip install Gensim\n<\/code><\/pre>\n\n<p>If you don't have pip installed yet look at <a href=\"https:\/\/stackoverflow.com\/questions\/4750806\/how-to-install-pip-on-windows\">this<\/a> answer.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417797586857,"favorite_count":null,"last_activity_date":1417797586857,"last_edit_date":1495540255830,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":268195.0,"parent_id":27291145,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":29,"id":27322984,"title":null,"body":"<p>Try this,<\/p>\n\n<p>Add Rolemanger class property and add in <code>AccountController<\/code>. <\/p>\n\n<pre><code> public AccountController(ApplicationUserManager userManager, ApplicationSignInManager signInManager, ApplicationRoleManager roleManager)\n {\n UserManager = userManager;\n SignInManager = signInManager;\n RoleManager =roleManager;\n }\n\n private ApplicationRoleManager _roleManager;\n public ApplicationRoleManager RoleManager\n {\n get\n {\n return _roleManager ?? HttpContext.GetOwinContext().Get&lt;ApplicationRoleManager&gt;();\n }\n private set\n {\n _roleManager = value;\n }\n }\n<\/code><\/pre>\n\n<p>After add this in your page. user this assign role to user. pass your user's id <code>userId<\/code> and <code>rolename<\/code> which role you want to assign to user.<\/p>\n\n<pre><code>var result = UserManager.AddToRole(userId, \"RoleName\");\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417806511057,"favorite_count":null,"last_activity_date":1417806511057,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2423840.0,"parent_id":27274802,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":30,"id":27325889,"title":null,"body":"<p>Is the following efficient enough?<\/p>\n\n<pre><code>echo -n `pesq +8000 $f1 $f2 | grep Prediction | rev | cut -b1-5 | rev` | sed 's\/,$\/\/'\n<\/code><\/pre>\n\n<p>It is using <a href=\"http:\/\/www.grymoire.com\/Unix\/Sed.html\" rel=\"nofollow\">sed<\/a> to remove the last <code>,<\/code> before the end of the line <code>$<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417819553463,"favorite_count":null,"last_activity_date":1417819553463,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":57095.0,"parent_id":27325802,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":31,"id":27333218,"title":null,"body":"<p><a href=\"https:\/\/social.msdn.microsoft.com\/profile\/magnus%20(mm8)\/?ws=usercard-mini\" rel=\"nofollow noreferrer\">Magnus<\/a> answered my question. I wanted to post it here incase it helps anyone in the future.\n<a href=\"https:\/\/social.msdn.microsoft.com\/Forums\/en-US\/3c5611fe-781d-4053-9faf-013fb47a54ea\/sql-server-query-view-convert-string-to-datetime?forum=csharpgeneral\" rel=\"nofollow noreferrer\">Here is the link to the answer.<\/a><\/p>\n\n<p>There is no output format identifier (like for example 120) that lets you convert a char(12) into a datetime in SQL Server. But you could use the Substring function:<\/p>\n\n<pre><code>Select Cast(Substring(dbo.KWH.mr_dtm,1,8) + ' ' + Substring(dbo.KWH.mr_dtm,9,2)+':'+ Substring(dbo.KWH.mr_dtm,11,2) as DateTime)\n<\/code><\/pre>\n\n<p>Thank you to everyone! It is very much appreciated.<br>\nOh, and this post help me solve my timezone setup.<\/p>\n\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/8038744\/convert-datetime-column-from-utc-to-local-time-in-select-statement\">Convert Datetime column from UTC to local time in select statement<\/a><\/p>\n\n<p>Many thanks to <a href=\"https:\/\/stackoverflow.com\/users\/473798\/michael-goldshteyn\">Michael Goldshteyn<\/a> for the timezone convert.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417879861573,"favorite_count":null,"last_activity_date":1417879861573,"last_edit_date":1495542087423,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":4329996.0,"parent_id":27322933,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":32,"id":27333254,"title":null,"body":"<p>If you just want to duplicate the data for another company, you can do a simple <code>INSERT\/SELECT<\/code>, something like this... :<\/p>\n\n<pre><code>INSERT INTO YourTable ( CompanyId, some_data, other_data )\nSELECT **Enter your company id here** , some_data, other_data FROM YourTable\n<\/code><\/pre>\n\n<p>Just omit your id column, it'll be auto-generated by sql-server.<\/p>\n\n<p>If you want your ids to be the same, you'll have to include the CompanyId to the Primary key because the PK should, by definition, be unique.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417880127713,"favorite_count":null,"last_activity_date":1417880127713,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1144104.0,"parent_id":27332809,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":33,"id":27348700,"title":null,"body":"<pre><code>void MainWindow::on_btnCalculate_clicked()\n{\n QString s; \n int intNum1 = ui-&gt;leNum1-&gt;text().toInt();\n int intNum2 = ui-&gt;leNum2-&gt;text().toInt();\n qreal result = qExp((qreal)intNum1* intNum2);\n\n s = QStrimg::number(result);\n\n ui-&gt;lblCalculate-&gt;setText(s);\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417991754527,"favorite_count":null,"last_activity_date":1418029505213,"last_edit_date":1418029505213,"last_editor_display_name":null,"last_editor_user_id":1387438.0,"owner_display_name":null,"owner_user_id":1387438.0,"parent_id":27348622,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":34,"id":27368566,"title":null,"body":"<pre><code>listVisitas.setOnItemClickListener(new OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {\n }\n});\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418079436050,"favorite_count":null,"last_activity_date":1418079436050,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1062587.0,"parent_id":27368530,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":35,"id":27270865,"title":null,"body":"<p>You've defined <code>i<\/code> with global scope so each time you hit a recursive call to the parent it gets incremented and you jump out of the loop in the caller. In both of your for loops change:<\/p>\n\n<pre><code>for(i=0...\n<\/code><\/pre>\n\n<p>to<\/p>\n\n<pre><code>for(var i=0...\n<\/code><\/pre>\n\n<p>That way each loop has its own instance of i and there will be no confusion. With that change both of your examples work.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417606809397,"favorite_count":null,"last_activity_date":1417606809397,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":821473.0,"parent_id":27270264,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":36,"id":27282916,"title":null,"body":"<p>I'm guessing your C# code's running on Windows?\nIf that's the case, you'll need to use the remote server's IP as the server name.\nAlternatively you can do start, run, cmd, nslookup <em>server's ip<\/em> - to translate the IP to a hostname, then use that as the server name.<\/p>\n\n<p>NB: MySQL also needs to allow remote access. See <a href=\"https:\/\/stackoverflow.com\/questions\/14779104\/how-to-allow-remote-connection-to-mysql\">How to allow remote connection to mysql<\/a> for more info.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417645916267,"favorite_count":null,"last_activity_date":1417645916267,"last_edit_date":1495542087423,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":361842.0,"parent_id":27282669,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":37,"id":27284714,"title":null,"body":"<p>After some research, I realized what was causing this problem:<\/p>\n\n<p>My project has a SVN Property, called <code>svn:global-ignores<\/code> set as bellow:<\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/kWvzB.png\" alt=\"enter image description here\"><\/p>\n\n<p>After removing the 'asterisk', everything worked fine!<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417656289353,"favorite_count":null,"last_activity_date":1417656289353,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1015482.0,"parent_id":27284532,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":38,"id":27287671,"title":null,"body":"<p>Assuming that reflection is done only once per application, I do not see a problem inspecting first the database only to get columns for the required tables. In fact, you can have a routine to create an updated dictionary from your original <code>TABLE_DEFAULTS<\/code> and the rest of your code would work without changes.<\/p>\n\n<p>An alternative would be to listen to <a href=\"http:\/\/docs.sqlalchemy.org\/en\/rel_0_9\/core\/events.html#sqlalchemy.events.DDLEvents.column_reflect\" rel=\"nofollow\"><code>column_reflect<\/code><\/a> event and modify the column as required there. But at that stage the <code>Column<\/code> instances are not created yet, and instead the <code>column_info<\/code> parameter to that listener is simply a dictionary of attributes, which you can overwrite from your original columns:<\/p>\n\n<pre><code>{'primary_key': 0, \n 'nullable': False, \n 'default': None, \n 'autoincrement': False,\n 'type': VARCHAR(), \n 'name': u'third_column'}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417674564203,"favorite_count":null,"last_activity_date":1417716229073,"last_edit_date":1417716229073,"last_editor_display_name":null,"last_editor_user_id":99594.0,"owner_display_name":null,"owner_user_id":99594.0,"parent_id":27285102,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":39,"id":27291753,"title":null,"body":"<p>To achieve the final result, I think you should count for each <strong>subject<\/strong> firstly. Below for your reference: <\/p>\n\n<pre><code>db.collection.aggregate([{\n $group : {\n _id : {\n src : \"$src\",\n dst : \"$dst\",\n subject : \"$subject\"\n },\n count : {\n $sum : 1\n }\n }\n}, {\n $group : {\n _id : {\n src : \"$_id.src\",\n dst : \"$_id.dst\"\n },\n subjects : {\n $push : {\n subject : \"$_id.subject\",\n count : \"$count\"\n }\n }\n }\n}, {\n $project : {\n _id : 0,\n src : \"$_id.src\",\n dst : \"$_id.dst\",\n subjects : \"$subjects\"\n }\n}]);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417689233220,"favorite_count":null,"last_activity_date":1417689233220,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3943271.0,"parent_id":27290986,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":40,"id":27300555,"title":null,"body":"<p>Try this:<\/p>\n\n<p>1 - Encapsulate data into array of objects...<\/p>\n\n<pre><code>vm.possible = [{id:1, label:'PHP'},{id:2, label:'JAVA'}];\n<\/code><\/pre>\n\n<p>2 - Iterate array with objects properties<\/p>\n\n<pre><code> &lt;select \n ng-model=\"main.current.parent_id\" \n ng-options=\"item.id as item.label for item in main.possible\"\n &gt;\n<\/code><\/pre>\n\n<p><a href=\"http:\/\/plnkr.co\/edit\/8TRPHPJCkpoReY91SUZD\" rel=\"nofollow\">Plunker<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417715094180,"favorite_count":null,"last_activity_date":1417717046737,"last_edit_date":1417717046737,"last_editor_display_name":null,"last_editor_user_id":2711244.0,"owner_display_name":null,"owner_user_id":2711244.0,"parent_id":27300360,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":41,"id":27324547,"title":null,"body":"<p>Yes, it is impossible. In any event it is good practice to explicitly name the columns you are <code>INSERT<\/code>ing into anyway -- leaving the columns out leads to more fragile code and more \"silent failure\" possibilities in which you're not inserting data into the column you think you are inserting it into.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417813035560,"favorite_count":null,"last_activity_date":1417813035560,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":180368.0,"parent_id":27323959,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":42,"id":27333430,"title":null,"body":"<pre><code>FOR %%A IN (\"Drawings\\*.txt\") DO draw.exe \/f \"%%A\" \/d \"%%~nA\"\n<\/code><\/pre>\n\n<p>?<\/p>\n\n<p>Here's an excerpt from FOR help:<\/p>\n\n<pre><code>In addition, substitution of FOR variable references has been enhanced\nYou can now use the following optional syntax:\n\n%~I - expands %I removing any surrounding quotes (\")\n%~fI - expands %I to a fully qualified path name\n%~dI - expands %I to a drive letter only\n%~pI - expands %I to a path only\n%~nI - expands %I to a file name only\n%~xI - expands %I to a file extension only\n%~sI - expanded path contains short names only\n%~aI - expands %I to file attributes of file\n%~tI - expands %I to date\/time of file\n%~zI - expands %I to size of file\n%~$PATH:I - searches the directories listed in the PATH\n environment variable and expands %I to the\n fully qualified name of the first one found.\n If the environment variable name is not\n defined or the file is not found by the\n search, then this modifier expands to the\n empty string\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417881303697,"favorite_count":null,"last_activity_date":1417881303697,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":388389.0,"parent_id":27333197,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":43,"id":27336786,"title":null,"body":"<p>You can use <\/p>\n\n<pre><code>$(\".someGenericClass:contains('Another Item')\" ).&lt;any action you want to do in this element&gt;\n<\/code><\/pre>\n\n<p>To get the object in a variable:<\/p>\n\n<pre><code>var variable = $(\".someGenericClass:contains('Another Item')\" );\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417901525710,"favorite_count":null,"last_activity_date":1417901525710,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4187417.0,"parent_id":27336751,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":44,"id":27341948,"title":null,"body":"<p>I decided to configure the app in<code>server.js<\/code> and then pass the <code>client<\/code> object to each route that requires it. This appears to work well and has tidied my code up considerably.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417950099633,"favorite_count":null,"last_activity_date":1417950099633,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1003632.0,"parent_id":27335044,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":45,"id":27347660,"title":null,"body":"<p>You must treat every <code>if - else<\/code> expression as a standalone expression. That means that the interpreter will not understand this line:<\/p>\n\n<pre><code>else if (hour &gt;= 12 &amp;&amp; &lt; 18) {\n<\/code><\/pre>\n\n<p>It will see it as \"variable named <em>hour<\/em> is more or equal to 12 and variable named <em>um... wait what?<\/em> less than 18\". You <em>are required<\/em> to treat both expressions as if they were alone or in different statements. So the right code for you is<\/p>\n\n<pre><code>else if (hour &gt;= 12 &amp;&amp; hour &lt; 18) {\n<\/code><\/pre>\n\n<p>Which means \"variable named <em>hour<\/em> is more or equal to 12 and variable named <em>hour<\/em> less than 18\"<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417985405963,"favorite_count":null,"last_activity_date":1417985405963,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3324556.0,"parent_id":27347568,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":46,"id":27366012,"title":null,"body":"<p>OK, I've done some experimentation, and can confirm that both <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms682431%28v=vs.85%29.aspx\" rel=\"nofollow\">CreateProcessWithLogonW()<\/a> and <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms682434%28v=vs.85%29.aspx\" rel=\"nofollow\">CreateProcessWithTokenW()<\/a> put the newly created process into a job object.<\/p>\n\n<p>However, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms682429%28v=vs.85%29.aspx\" rel=\"nofollow\">CreateProcessAsUser()<\/a> does not. So this is probably the best workaround, though it does require the \"Replace a process level token\" privilege. You can either run the code from a context that already has this privilege (i.e., a service configured to run as local service or network service) or you can grant the privilege to the user account that will be used to run the code.<\/p>\n\n<p>See also <a href=\"http:\/\/theinvisiblethings.blogspot.co.nz\/2014\/01\/shattering-myths-of-windows-security.html\" rel=\"nofollow\">Shattering the myths of Windows security<\/a> at the Invisible Things Lab's blog (and in particular the linked whitepaper) which describes various issues with running potentially malicious code in a limited user account.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418069361123,"favorite_count":null,"last_activity_date":1418069361123,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":886887.0,"parent_id":27339341,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":47,"id":27382738,"title":null,"body":"<p>Check out <a href=\"https:\/\/github.com\/thoughtbot\/paperclip\/blob\/master\/lib\/paperclip\/attachment.rb#L348\" rel=\"nofollow\"><code>Paperclip::Attachment#file?<\/code><\/a> (for which <a href=\"https:\/\/github.com\/thoughtbot\/paperclip\/blob\/master\/lib\/paperclip\/attachment.rb#L352\" rel=\"nofollow\"><code>Paperclip::Attachment#present?<\/code><\/a> is an alias), as well as <a href=\"https:\/\/github.com\/thoughtbot\/paperclip\/blob\/master\/lib\/paperclip\/url_generator.rb#L31\" rel=\"nofollow\"><code>Paperclip::UrlGenerator#most_appropriate_url<\/code><\/a><\/p>\n\n<p>The avatar isn't present until the user submits their own file, but the <code>#url<\/code> method will return the default URL when the avatar isn't present. If you remove the <code>@user.avatar.present?<\/code> check and the \"Missing Pic\" header so that your view code is just:<\/p>\n\n<pre><code>&lt;%= image_tag @user.avatar.url(:thumb) %&gt;\n<\/code><\/pre>\n\n<p>the default image will render when the user hasn't uploaded an avatar.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418139110910,"favorite_count":null,"last_activity_date":1418139110910,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1106267.0,"parent_id":27382471,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":48,"id":27279008,"title":null,"body":"<p>You can download required version from <a href=\"http:\/\/www.scala-lang.org\/download\/2.11.4.html\" rel=\"nofollow\">Scala site<\/a>. In extracted archive find <\/p>\n\n<p>scala\/scala-2.11.4\/lib\/scala-xml_2.11-1.0.2.jar<\/p>\n\n<p>Just add this jar to your Eclipse project Build Path.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417631261117,"favorite_count":null,"last_activity_date":1417631261117,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4305754.0,"parent_id":27278010,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":49,"id":27287275,"title":null,"body":"<p>Use the following select to get the table(s) with mixed-cases in name<\/p>\n\n<pre><code> SELECT table_name ucase,lower(table_name) lcase\n FROM information_schema.tables \n where table_type = 'BASE TABLE' and \n table_schema = 'public' and \n table_name ~ E'^[[:upper:]][^[:upper:]]'\n<\/code><\/pre>\n\n<p>PostgreSQL string function <a href=\"http:\/\/www.postgresql.org\/docs\/9.2\/static\/functions-string.html\" rel=\"nofollow\"><strong>lower<\/strong><\/a> and <a href=\"http:\/\/www.postgresql.org\/docs\/9.2\/static\/infoschema-tables.html\" rel=\"nofollow\"><strong>information_schema.tables<\/strong><\/a><\/p>\n\n<p>and use PL\/PGSQL <a href=\"http:\/\/www.postgresql.org\/docs\/9.2\/static\/sql-do.html\" rel=\"nofollow\"><strong>SQL - DO<\/strong><\/a> to rename all tables that have mixed-case <\/p>\n\n<pre><code>do\n$$\ndeclare \nrw record;\nbegin\nfor rw in \nSELECT 'ALTER TABLE \"'||t.ucase||'\" RENAME to '||t.lcase||';' execme from (\nSELECT table_name ucase, lower(table_name) lcase\nFROM information_schema.tables \nwhere table_type = 'BASE TABLE' and \n table_schema = 'public' and \n table_name ~ E'^[[:upper:]][^[:upper:]]')t\nloop\nexecute rw.execme ;\nend loop;\nend;\n$$\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417672571267,"favorite_count":null,"last_activity_date":1417866676660,"last_edit_date":1417866676660,"last_editor_display_name":null,"last_editor_user_id":3682599.0,"owner_display_name":null,"owner_user_id":3682599.0,"parent_id":27287026,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":50,"id":27301359,"title":null,"body":"<p>This is currently not possible. However, there's a <a href=\"https:\/\/github.com\/futuretap\/InAppSettingsKit\/pull\/238\" rel=\"nofollow\">pull request<\/a> to get titles and values from the delegate.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417717938177,"favorite_count":null,"last_activity_date":1417717938177,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":235297.0,"parent_id":27292615,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":51,"id":27326688,"title":null,"body":"<p>You just need to change the order of those lines of code:<\/p>\n\n<pre><code>[[ASHCoreDataStack defaultStack].managedObjectContext deleteObject:self.mainUserStatementModel.levelupStatement];\nself.mainUserStatementModel.levelupStatement = nil;\nself.mainUserStatementModel.levelupTerm = nil;\n<\/code><\/pre>\n\n<p>In fact, if your <code>parentStatement<\/code> relationship is set to 'Nullify' then you do not need the second of these lines: CoreData will automatically nil out the <code>levelUpStatement<\/code>. Check the relationship in the Data Model Inspector:<\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/arvOm.png\" alt=\"enter image description here\"><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417824501110,"favorite_count":null,"last_activity_date":1417824501110,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3985749.0,"parent_id":27326511,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":52,"id":27330382,"title":null,"body":"<p>You can for example:<\/p>\n\n<ul>\n<li><p>subscribe in <em>Page.Loaded<\/em> event:<\/p>\n\n<pre><code>this.Loaded += (sender, e) =&gt; myChBox.Checked += myChBox_Checked;\n<\/code><\/pre><\/li>\n<li><p>or maybe better just check in your event for <code>null<\/code>:<\/p>\n\n<pre><code>private void myChBox_Checked(object sender, RoutedEventArgs e)\n{\n if (something == null) return;\n myComboBox ... \/\/ NullReferenceException\n}\n<\/code><\/pre><\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417859514917,"favorite_count":null,"last_activity_date":1417859514917,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2681948.0,"parent_id":27330335,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":53,"id":27334109,"title":null,"body":"<p>So the issue I was having, and I still can't explain why it happened all of a sudden, was that I had added the field <code>'SITEURL'<\/code> to my pyconfig. This made everything relative to the SITEURL and so it did this on local host and of course didn't work.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417885248337,"favorite_count":null,"last_activity_date":1417885248337,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1403991.0,"parent_id":27333981,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":54,"id":27335328,"title":null,"body":"<p>No need for a flag or session param, <code>withErrors<\/code> fills the variable <code>$errors<\/code> and thus is detectable:<\/p>\n\n<pre><code>@if($errors-&gt;any())\n \/\/ do something\n@endif\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417892832700,"favorite_count":null,"last_activity_date":1417892832700,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1902010.0,"parent_id":27335257,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":55,"id":27352006,"title":null,"body":"<p>Hmm.. not totally sure, but I would recommend doing it this way<\/p>\n\n<p><a href=\"http:\/\/jsfiddle.net\/03vc88r7\/5\/\" rel=\"nofollow\">http:\/\/jsfiddle.net\/03vc88r7\/5\/<\/a><\/p>\n\n<p><strong>CSS<\/strong><\/p>\n\n<pre><code>.chooser {\n display: inline-block;\n list-style: none;\n position: relative;\n}\n.container {\n}\n.options {\n position: absolute;\n opacity: 0;\n visibility: hidden;\n transition: all 2s;\n}\n.visible {\n opacity:1;\n visibility: visible;\n}\na {\n cursor: pointer;\n}\n<\/code><\/pre>\n\n<p><strong>JS<\/strong><\/p>\n\n<pre><code>$('.chooser .options &gt; li').on('click', function (e) {\n alert(e.target.innerHTML)\n});\n\n$('.chooser .toggle').on('click', function (e) {\n\n if($('.options').hasClass('visible')){\n $('.options').removeClass('visible');\n }else{\n $('.options').addClass('visible'); \n }\n});\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418016946653,"favorite_count":null,"last_activity_date":1418016946653,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1416438.0,"parent_id":27351876,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":56,"id":27363629,"title":null,"body":"<p>Turns out I need >4GB of ram for the unit test. Starting with <code>env JAVA_OPTS=\"-Xmx5G\" sbt test<\/code> solved it. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418060186620,"favorite_count":null,"last_activity_date":1418060186620,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2576092.0,"parent_id":27349691,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":57,"id":27373798,"title":null,"body":"<p>You can \"curry\" that argument via <code>Function#bind<\/code>:<\/p>\n\n<pre><code>add_link:function(e){\n \/\/ Get the source and target nodes\n var sourceNode = this.graph.nodes.filter(this.is_source_node.bind(this, e))[0];\n \/\/ Change is here ------------------------------------------^^^^^^^^^^^^^\n}\n<\/code><\/pre>\n\n<p>then:<\/p>\n\n<pre><code>\/\/ Change --------------vvv\nis_source_node:function(e, n){\n return n.node.id === e.source.node.id;\n}\n<\/code><\/pre>\n\n<p><code>Function#bind<\/code> returns a function that, when called, will call the original function with a specific <code>this<\/code> value (which doesn't matter here) and any further arguments you give <code>bind<\/code>, followed by the arguments that it was actually called with.<\/p>\n\n<p>A simpler example may be clearer:<\/p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>function foo(a, b) {\n snippet.log(\"a is \" + a + \", b is \" + b);\n}\nfoo(1, 2); \/\/ \"a is 1, b is 2\" as you'd expect\n\n\/\/ Create a function that will call foo with 'first'\nvar f= foo.bind(null, 'first');\n\n\/\/ Call it, passing in an argument\nf('second'); \/\/ \"a is first, b is second\"<\/code><\/pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;!-- Script provides the `snippet` object, see http:\/\/meta.stackexchange.com\/a\/242144\/134069 --&gt;\n&lt;script src=\"http:\/\/tjcrowder.github.io\/simple-snippets-console\/snippet.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418111279140,"favorite_count":null,"last_activity_date":1418111279140,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":157247.0,"parent_id":27373771,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":58,"id":27274520,"title":null,"body":"<p>You can use the <code>nametowidget<\/code> method of <code>Tk<\/code>. This finds the widget based on its name. So use:<\/p>\n\n<pre><code>self.change_bg(self.root.nametowidget(W), 1)\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417617859647,"favorite_count":null,"last_activity_date":1417617859647,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3714930.0,"parent_id":27274172,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":59,"id":27281838,"title":null,"body":"<p>You can use the <code>LogCommand<\/code> to obtain the number of commits like so:<\/p>\n\n<pre class=\"lang-java prettyprint-override\"><code>Iterable&lt;RevCommit&gt; commits = git.log().call();\nint count = 0;\nfor( RevCommit commit : commits ) {\n count++;\n}\n<\/code><\/pre>\n\n<p>If not specified otherwise the command starts at HEAD. With <code>add()<\/code> multiple commit-ids can be added to start the graph traversal from or <code>all()<\/code> can be called to start from all known branches.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417641549453,"favorite_count":null,"last_activity_date":1417641549453,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2986905.0,"parent_id":27278328,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":60,"id":27314785,"title":null,"body":"<p>jQuery has no helper functions for handling SQL.<\/p>\n\n<p>It has <a href=\"http:\/\/api.jquery.com\/jquery.ajax\/\" rel=\"nofollow noreferrer\">Ajax<\/a> functions which can be used to talk to a web service that runs SQL on the server.<\/p>\n\n<p>Client side JavaScript doesn't have the ability to access <a href=\"https:\/\/stackoverflow.com\/a\/7408372\/19068\">raw sockets<\/a>, so you can't connect directly to a remote database.<\/p>\n\n<p>There are various client side databases, including <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Storage\" rel=\"nofollow noreferrer\">storage<\/a>, which can be accessed directly with JavaScript (but jQuery doesn't have anything to interact with them).<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417778486360,"favorite_count":null,"last_activity_date":1417778486360,"last_edit_date":1495542087423,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":19068.0,"parent_id":27314739,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":61,"id":27355415,"title":null,"body":"<p>You'd be best to check whether the values are empty as well... After that, concatenate them using a comma <code>,<\/code>, like so:<\/p>\n\n<pre><code>$addressFields = array(\n $_POST['addressline1'],\n $_POST['addressline2'],\n $_POST['addressline1'],\n $_POST['city'],\n $_POST['state'],\n $_POST['country'], \n);\n\n$addressData = implode(', ', array_filter($addressFields));\n<\/code><\/pre>\n\n<p>In this snippet, <a href=\"http:\/\/php.net\/array_filter\" rel=\"nofollow\"><code>array_filter()<\/code><\/a> is used to filter all empty strings from the array. <a href=\"http:\/\/php.net\/implode\" rel=\"nofollow\"><code>implode()<\/code><\/a> joins the array-items together in a string using a comma <code>,<\/code> as the 'glue'.<br>\nAfterwards, use the <code>geocode()<\/code> method as in your example:<\/p>\n\n<pre><code>$data_arr = geocode($addressData);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418032688720,"favorite_count":null,"last_activity_date":1418032688720,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1857053.0,"parent_id":27355220,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":62,"id":27383608,"title":null,"body":"<p>TempData is used to pass data from current request to subsequent request (means redirecting from one page to another).<\/p>\n\n<p>So in your case Tempdata[\u201cName\u201d] only available in current action and Index action of the EmployeeHome Controller.<\/p>\n\n<p>So you need Session[\u201cName\u201d] in place of Tempdata[\u201cName\u201d]<\/p>\n\n<p><strong>Like :<\/strong><\/p>\n\n<pre><code>var Result = from a in db.login where a.userName == login.userName &amp;&amp; \n a.Password == login.Password select a.login_id;\nSession[\"Name\"] = Result.Single();\nreturn RedirectToAction(\"Index\", \"EmployeeHome\");\n<\/code><\/pre>\n\n<p><strong>and another action<\/strong><\/p>\n\n<pre><code>[HttpPost]\n public ActionResult Create(EmployeeEntry employeeentry)\n {\n \u2026\n employeesales.employeeid = (int)Session[\"Name\"];\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418141562720,"favorite_count":null,"last_activity_date":1418141562720,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2456646.0,"parent_id":27383373,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":63,"id":27329212,"title":null,"body":"<p>We know from grade school that<\/p>\n\n<pre><code>a = b - c = b + (-c)\n<\/code><\/pre>\n\n<p>and from elementary programming classes that to negate a number in twos complement we invert a number and add one so <\/p>\n\n<pre><code>a = b + (~c) + 1\n<\/code><\/pre>\n\n<p>And that works out perfectly because when we feed the adder logic our values we invert the second operand and invert the carry in. (there is no subtract logic you use an adder to do subtraction)<\/p>\n\n<p>So some processor implementations choose to invert the carry out. You are already inverting stuff to do a subtract, and the raw carry out of the msbit on a normal subtract (without borrow) is a 1, when there is a borrow the carry out is a 0, so inverting the carry out you can then call it a \"borrow\" instead of a carry (or instead of a \/borrow or !borrow or borrow_n)<\/p>\n\n<p>Which ever way you do it, if you have a subtract with borrow, then you need to either invert or not invert the carry in depending your design choices for the carry out on a subtract (normal without borrow).<\/p>\n\n<p>So subtraction is<\/p>\n\n<pre><code>a = b + (~c) + 1\n<\/code><\/pre>\n\n<p>And when you cascade that subtraction (sbc) then if there was no borrow then <\/p>\n\n<pre><code>a = b + (~c) + 1\n<\/code><\/pre>\n\n<p>But if there was a borrow then that next level needs to have a 1 removed so the sbc becomes<\/p>\n\n<pre><code>a = b + (~c) \n<\/code><\/pre>\n\n<p>The carry in is a zero in that case. So from the adder logic perspective when you do a subtract with borrow you naturally have to invert the second operand, but you carry in a 0 if you have to borrow and carry in a 1 if you dont.<\/p>\n\n<p>The arm docs on a SBC say<\/p>\n\n<blockquote>\n <p>Rd = Rd - Rm - NOT(C Flag)<\/p>\n<\/blockquote>\n\n<p>So if we need to take one away due to a prior borrow then C needed to be a 0 else C is a 1 going in.<\/p>\n\n<p>The subtractions all basically say<\/p>\n\n<blockquote>\n <p>C Flag = NOT BorrowFrom(operation)<\/p>\n<\/blockquote>\n\n<p>So if we need to borrow then borrow from is true so C flag is not true or a 0. If we dont need to borrow, then borrow from is false a 0, and not borrow from is a 1. So that all matches up, if we needed to borrow then going into SBC C needs to be 0. <\/p>\n\n<p>So basically ARM does not appear to modify the carry out from the adder. And so it does not need to invert the carry in on an SBC.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417849196750,"favorite_count":null,"last_activity_date":1417849196750,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":16007.0,"parent_id":27327778,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":64,"id":27327366,"title":null,"body":"<p>The first is a normal C++ structure. <\/p>\n\n<p>Using <code>value struct<\/code> creates a C++\/CLI value type (a .NET structure). You typically will want to copy from one to the other manually, though if the memory layout is the same, you can often use things like <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/4ca6d5z7(v=vs.110).aspx\" rel=\"noreferrer\"><code>Marshal::PtrToStructure<\/code><\/a> to copy the data directly. Note that this returns a boxed <code>value struct<\/code>, however, so manual copying is often more efficient.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417830072867,"favorite_count":null,"last_activity_date":1417830072867,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":65358.0,"parent_id":27327330,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":65,"id":27321896,"title":null,"body":"<p>Right now, the REST APIs don't support contact photos or user profile photos. We're working on adding that soon. Keep an eye on our <a href=\"http:\/\/blogs.msdn.com\/b\/exchangedev\/\" rel=\"nofollow\">blog<\/a> or follow me on @JasonJohMSFT) for announcements regarding new features.<\/p>\n\n<p>UPDATE: The User Photo API is now in preview: <a href=\"https:\/\/msdn.microsoft.com\/office\/office365\/APi\/photo-rest-operations\" rel=\"nofollow\">https:\/\/msdn.microsoft.com\/office\/office365\/APi\/photo-rest-operations<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417802113800,"favorite_count":null,"last_activity_date":1438004861757,"last_edit_date":1438004861757,"last_editor_display_name":null,"last_editor_user_id":3307985.0,"owner_display_name":null,"owner_user_id":3307985.0,"parent_id":27314335,"post_type_id":2,"score":6,"tags":null,"view_count":null},{"index":66,"id":27283123,"title":null,"body":"<p>Try this:<\/p>\n\n<pre><code>for result in results as [XYZClass] {\n \/\/ Do stuff to result\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417646775830,"favorite_count":null,"last_activity_date":1417646775830,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":506441.0,"parent_id":27282913,"post_type_id":2,"score":7,"tags":null,"view_count":null},{"index":67,"id":27311432,"title":null,"body":"<p>See <a href=\"https:\/\/github.com\/tyrus-project\/tyrus\/blob\/e7d822d3aee4dcdcf2df0b0ed7c70123ad9023c5\/tests\/e2e\/standard-config\/src\/test\/java\/org\/glassfish\/tyrus\/test\/standard_config\/ModifyRequestResponseHeadersTest.java#L183\" rel=\"noreferrer\">ModifyRequestResponseHeadersTest.java:183<\/a><\/p>\n\n<pre><code>@ClientEndpoint(configurator = MyClientConfigurator.class)\npublic static class MyClientEndpoint {\n public static final CountDownLatch messageLatch = new CountDownLatch(1);\n public static volatile String receivedMessage;\n\n @OnOpen\n public void onOpen(Session session) throws IOException {\n session.getBasicRemote().sendText(SENT_MESSAGE);\n }\n\n @OnMessage\n public void onMessage(String message) {\n receivedMessage = message;\n messageLatch.countDown();\n }\n}\n<\/code><\/pre>\n\n<p>And MyClientConfigurator:<\/p>\n\n<pre><code>public static class MyClientConfigurator extends ClientEndpointConfig.Configurator {\n static volatile boolean called = false;\n\n @Override\n public void beforeRequest(Map&lt;String, List&lt;String&gt;&gt; headers) {\n called = true;\n headers.put(HEADER_NAME, Arrays.asList(HEADER_VALUE));\n headers.put(\"Origin\", Arrays.asList(\"myOrigin\"));\n }\n\n @Override\n public void afterResponse(HandshakeResponse handshakeResponse) {\n final Map&lt;String, List&lt;String&gt;&gt; headers = handshakeResponse.getHeaders();\n\n assertEquals(HEADER_VALUE[0], headers.get(HEADER_NAME).get(0));\n assertEquals(HEADER_VALUE[1], headers.get(HEADER_NAME).get(1));\n assertEquals(HEADER_VALUE[2], headers.get(HEADER_NAME).get(2));\n assertEquals(\"myOrigin\", headers.get(\"origin\").get(0));\n }\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417766828023,"favorite_count":null,"last_activity_date":1417766828023,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":945485.0,"parent_id":27293982,"post_type_id":2,"score":9,"tags":null,"view_count":null},{"index":68,"id":27278683,"title":null,"body":"<p>You can get the environment variables with <code>NSProcessInfo<\/code>:<\/p>\n\n<pre><code>let env = NSProcessInfo.processInfo().environment\nif let mode = env[\"exec_mode\"] as? String {\n print(mode)\n} else {\n \/\/ Environment variable not set\n}\n<\/code><\/pre>\n\n<p><strong>Swift 3:<\/strong><\/p>\n\n<pre><code>let env = ProcessInfo.processInfo.environment\nif let mode = env[\"exec_mode\"] {\n print(mode)\n} else {\n \/\/ Environment variable not set\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1417630187100,"favorite_count":null,"last_activity_date":1472583372770,"last_edit_date":1472583372770,"last_editor_display_name":null,"last_editor_user_id":1187415.0,"owner_display_name":null,"owner_user_id":1187415.0,"parent_id":27278303,"post_type_id":2,"score":17,"tags":null,"view_count":null},{"index":69,"id":27277099,"title":null,"body":"<p>The trouble started with table <code>page<\/code> whose field <code>lang_tag<\/code> is foreign key (FK) from table <code>lang<\/code> but it is also part of the primary key (PK) of the table. I know this because the PKs are depicted by DBDesigner using a yellow key and FKs have red keys (if they are not red then forgive my memories, I did not use DBDesigner since 2010 and I don't have a copy at hand).<\/p>\n\n<p>Because of the relationship between <code>page<\/code> and <code>module<\/code>, the PK of table <code>page<\/code> (i.e. both columns <code>id<\/code> and <code>lang_tag<\/code>) migrated as FK in table <code>module<\/code> where, again, they were needlessly added to the table's PK.<\/p>\n\n<p>I cannot tell if you added <code>lang_tag<\/code> to the PK of table <code>page<\/code> or DBDesigner automatically does this but this is not correct (you don't need it and you don't want it).<\/p>\n\n<p>Remove <code>lang_tag<\/code> from the PK of <code>page<\/code> and <code>page_lang_tag<\/code> will disappear from table <code>module<\/code>. Also, remove <code>page_id<\/code> from the PK of table <code>module<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417625073307,"favorite_count":null,"last_activity_date":1417625073307,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4265352.0,"parent_id":27276151,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":70,"id":27329548,"title":null,"body":"<p>You need to use a javascript library to get this custom behavior.<\/p>\n\n<p>JQuery UI has an implementation <a href=\"http:\/\/jqueryui.com\/tooltip\/\" rel=\"nofollow\">http:\/\/jqueryui.com\/tooltip\/<\/a><\/p>\n\n<h2>EDIT<\/h2>\n\n<p>You are looking for something that when clicked shows some UI. This would be more like a Popup or Popover. Bootstrap has a nice implementation:\n<a href=\"http:\/\/getbootstrap.com\/javascript\/#popovers\" rel=\"nofollow\">http:\/\/getbootstrap.com\/javascript\/#popovers<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417852131820,"favorite_count":null,"last_activity_date":1417852466057,"last_edit_date":1417852466057,"last_editor_display_name":null,"last_editor_user_id":101662.0,"owner_display_name":null,"owner_user_id":101662.0,"parent_id":27329318,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":71,"id":27279783,"title":null,"body":"<p>First, please try and ask targeted questions. What have you tried? What packages have you explored? Where are you getting stuck?<\/p>\n\n<p>Nonetheless, I would start by reading through this, <a href=\"http:\/\/cran.r-project.org\/web\/packages\/caret\/vignettes\/caret.pdf\" rel=\"nofollow\">A Short Introduction to the <strong>caret<\/strong> Package<\/a>. Then, do this:<\/p>\n\n<pre><code>install.packages(\"caret\")\nlibrary(caret)\n?confusionMatrix\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417634030717,"favorite_count":null,"last_activity_date":1417634030717,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2572423.0,"parent_id":27277275,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":72,"id":27302084,"title":null,"body":"<p>To access the oEmbed part, just do <code>As&lt;OEmbedPart&gt;()<\/code> on the media part. You can then access the URL for the video by using the Source property of the part. You can also access a number of properties that are provided by the oEmbed site (YouTube in your case). Those properties can be accessed using the indexer on the part.<\/p>\n\n<p>For example, <code>part[\"html\"]<\/code> will give you the html code to embed in your page to render the video player:<\/p>\n\n<pre><code>@Html.Raw(part[\"html\"])\n<\/code><\/pre>\n\n<p>There is also a \"thumbnail\" or a \"thumbnail_url\" property (depending on provider) that will give you the url of a thumbnail image. You can look at the whole blob of XML underlying that in the <code>Framework_ContentItemRecord<\/code> table's <code>Data<\/code> column. There is also a width and a height for example.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417720372280,"favorite_count":null,"last_activity_date":1418157088607,"last_edit_date":1418157088607,"last_editor_display_name":null,"last_editor_user_id":363821.0,"owner_display_name":null,"owner_user_id":363821.0,"parent_id":27297124,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":73,"id":27302815,"title":null,"body":"<p>Include a <a href=\"http:\/\/mongoosejs.com\/docs\/api.html#model_Model.findOneAndUpdate\" rel=\"nofollow\">select<\/a> parameter in your <code>options<\/code> param and list all the fields you would like to project.<\/p>\n\n<pre><code>{\n upsert : true,\n select:{\"projects\":1} \/\/ all the fields you would want to select\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417722706720,"favorite_count":null,"last_activity_date":1417722706720,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1617024.0,"parent_id":27302398,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":74,"id":27323726,"title":null,"body":"<p>The Github integration is part of the GitHub Mylyn Connector which can be installed from <a href=\"http:\/\/download.eclipse.org\/egit\/github\/updates\" rel=\"nofollow\">this<\/a> update site but is not part of EGit itself. See <a href=\"http:\/\/eclipse.org\/egit\/download\/\" rel=\"nofollow\">http:\/\/eclipse.org\/egit\/download\/<\/a> for a complete listing of all EGit related update sites.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417809507250,"favorite_count":null,"last_activity_date":1417809507250,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3567830.0,"parent_id":27323398,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":75,"id":27340634,"title":null,"body":"<p>\"M.I.A\" is seen as a filename \"M.I\" with an extension \".A'<\/p>\n\n<p>Try replacing <code>~nq<\/code> with <code>~nxq<\/code> and <code>~nx<\/code> with <code>~nxx<\/code> <\/p>\n\n<p><code>%%~nxq<\/code> means <code>name and extension of %%q<\/code> but <code>%%~nq<\/code> means <code>name only of %%q<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417937161703,"favorite_count":null,"last_activity_date":1417937161703,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2128947.0,"parent_id":27340491,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":76,"id":27340929,"title":null,"body":"<p>It\u2019s not possible, because the phenomenon depends on the design of the font. CSS has no access to font metrics. The way in which glyphs use the vertical space defined by the height of the font (and possibly extend beyond that space) is decided by the font designer. There is no single quantity that describes it.<\/p>\n\n<p>The only quantity related to font metrics that is even theoretically available is the x height, via the <code>em<\/code> unit and via the <code>font-size-adjust<\/code> property. The latter has very limited and buggy support. Besides, the x height is just the height of letter x and similar lowercase letters with no ascenders and descenders, so it would not help to get at the total heights of glyphs.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417940443743,"favorite_count":null,"last_activity_date":1417940443743,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1084437.0,"parent_id":27339367,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":77,"id":27359295,"title":null,"body":"<p>It is just because nested forms in not a valid HTML pattern. The browser simply ignore the inner <code>&lt;form&gt;&lt;\/form&gt;<\/code> tags and sees only one form. Reference : <a href=\"https:\/\/stackoverflow.com\/questions\/555928\/is-it-valid-to-have-a-html-form-inside-another-html-form\">Is it valid to have a html form inside another html form?<\/a><\/p>\n\n<p>It is not a JSP problem (nor a Java one !), but only a incorrect HTML problem. You must use successive forms instead of nested forms (or user javascript as other suggested)<\/p>\n\n<p>Example with successive forms :<\/p>\n\n<pre><code>&lt;s:url value=\"\/addStore\" var=\"urlAddStore\"\/&gt;\n &lt;table border=\"1\"&gt;\n &lt;tbody&gt;\n &lt;form:form id=\"addStoreFrom\" modelAttribute=\"newStore\" action=\"${urlAddStore}\" method=\"POST\"&gt;\n &lt;tr&gt;\n &lt;td&gt;&lt;form:label path=\"title\"&gt;Title*&lt;\/form:label&gt;&lt;\/td&gt;\n &lt;td&gt;&lt;form:input path=\"title\"\/&gt;&lt;\/td&gt;\n &lt;\/tr&gt;\n ...\n\n &lt;tr&gt;\n &lt;td&gt;&lt;input type=\"submit\" value=\"Save\"\/&gt;&lt;\/td&gt;\n &lt;td\/&gt;\n &lt;\/tr&gt;\n &lt;\/form:form&gt;\n &lt;tr&gt;\n &lt;s:url value=\"\/addPassForm\" var=\"addPassForm\"\/&gt;\n &lt;form:form id=\"addPassForm\" action=\"${addPassForm}\" method=\"post\"&gt;\n ...\n &lt;td&gt;\n &lt;input type=\"submit\" value=\"Add\"\/&gt;\n &lt;\/td&gt;\n &lt;\/form:form&gt;\n &lt;\/tr&gt;\n &lt;\/tbody&gt;\n &lt;\/table&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418045930600,"favorite_count":null,"last_activity_date":1418045930600,"last_edit_date":1495539837273,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":3545273.0,"parent_id":27358287,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":78,"id":27346260,"title":null,"body":"<p>This is probably a duplicate of <a href=\"https:\/\/stackoverflow.com\/questions\/11594104\">Spring Security - No visible WebSecurityExpressionHandler instance could be found in the application context<\/a>.<\/p>\n\n<p>As pointed out there, make sure to add an <code>use-expressions<\/code> attribute set to true for your configuration's <code>http<\/code> element, i.e. write <code>&lt;http use-expressions=\"true\"&gt;<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417977186607,"favorite_count":null,"last_activity_date":1417977186607,"last_edit_date":1495541865237,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":2300713.0,"parent_id":27344504,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":79,"id":27288235,"title":null,"body":"<p>Single substitution commands do not need the last separator (usually a slash, <code>\/<\/code>) as it can be assumed. When you execute multiple commands by using the <code>|<\/code> then you need to make sure you have the final separator.<\/p>\n\n<pre><code>:%s\/foo\/bar\n:%s\/hello\/world\n<\/code><\/pre>\n\n<p>Would become:<\/p>\n\n<pre><code>:%s\/foo\/bar\/e | %s\/hello\/world\/e\n<\/code><\/pre>\n\n<p>Note: I also added the <code>e<\/code> flag which suppresses errors if a substitution does not occur as this will stop the pipeline.<\/p>\n\n<p>So your final command looks like this:<\/p>\n\n<pre><code>%s\/request_snapshot\\zs\\s*=\\s*true\/ = false\/e | %s\/primary_dev\\zs\\s*=\\s*\"[^\"]*\"\/ = \"vnic\"\/e\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417677137197,"favorite_count":null,"last_activity_date":1417702998773,"last_edit_date":1417702998773,"last_editor_display_name":null,"last_editor_user_id":438329.0,"owner_display_name":null,"owner_user_id":438329.0,"parent_id":27284272,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":80,"id":27302047,"title":null,"body":"<p>You should use a ListView with a custom View and an Adapter, refer to this<\/p>\n\n<p><a href=\"http:\/\/developer.android.com\/reference\/android\/widget\/Adapter.html\" rel=\"nofollow\">http:\/\/developer.android.com\/reference\/android\/widget\/Adapter.html<\/a><\/p>\n\n<p>A Listview, because you can have 2 or 40 players.<\/p>\n\n<p>a Custom View (in XML) so you can customize the fields \/ imageView \/ others<\/p>\n\n<p>the Adapter \"fills\" the Custom View and put into the ListView<\/p>\n\n<p><a href=\"http:\/\/www.piwai.info\/android-adapter-good-practices\/\" rel=\"nofollow\">http:\/\/www.piwai.info\/android-adapter-good-practices\/<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417720239413,"favorite_count":null,"last_activity_date":1417720239413,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1632206.0,"parent_id":27301539,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":81,"id":27370427,"title":null,"body":"<p>I can think of two approaches. (But I realize, re-reading your question that I have no idea what your last paragraph means. So perhaps this is all irrelevant to your goals.)<\/p>\n\n<p>First: A disjoint union labels each member with a flag so you know which parent set it came from, and so that no element in the disjoint union is in both parent sets. If the point of the exercise is to ensure that you know what parent set each member of the disjoint union came from, and to ensure that no member of the disjoint union came from more than one parent set, then in this case, normal union seems to do what you need. In your example, signatures A and B are already disjoint, and it's always possible to tell whether a given atom is in A or in B. So the first approach is just to use the expression <code>A + B<\/code>.<\/p>\n\n<p>Second: If <code>A + B<\/code> won't do, for reasons not given in the question, and you really really want a set of pairs, then define that set of pairs. In each pair, either the first element is from A and the second element is 1 (or some other flag) or else the first element is from B and the second element is 2 (or some other flag). <\/p>\n\n<p>One way to write this would be:<\/p>\n\n<pre><code>{v : X + Y, n : Int | (v in X and n = 1) or (v in Y and n = 2) }\n<\/code><\/pre>\n\n<p>Another equivalent way would be:<\/p>\n\n<pre><code>{x : X, y : Int | y = 1}\n+\n{x : Y, y : Int | y = 2}\n<\/code><\/pre>\n\n<p>A third way is even simpler: <\/p>\n\n<pre><code>{v : X, n : 1} + {v : Y, n : 2}\n<\/code><\/pre>\n\n<p>And simpler yet:<\/p>\n\n<pre><code>(X -&gt; 1) + (Y -&gt; 2) \n<\/code><\/pre>\n\n<p>Like any expression, this can be packaged in a function:<\/p>\n\n<pre><code>fun du[Left, Right : set univ] : (Left + Right) -&gt; Int {\n (Left -&gt; 1) + (Right -&gt; 2)\n}\n<\/code><\/pre>\n\n<p>And then the disjoint union of A and B can be written <code>du[A, B]<\/code>.<\/p>\n\n<p>I repeat my advice to spend some time learning about comprehensions. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418091472167,"favorite_count":null,"last_activity_date":1418154230867,"last_edit_date":1418154230867,"last_editor_display_name":null,"last_editor_user_id":1477421.0,"owner_display_name":null,"owner_user_id":1477421.0,"parent_id":27365347,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":82,"id":27307594,"title":null,"body":"<p>You can simply delete the <code>.git<\/code> directory and re-initialize the repository.<\/p>\n\n<pre class=\"lang-bash prettyprint-override\"><code>rm -rf .git # Delete all git information\ngit init # Recreate an empty repo\ngit add --all # Re-add all the files to the index\ngit commit -m 'Initial fork from example.com\/repo.git'\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417744999843,"favorite_count":null,"last_activity_date":1417744999843,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4231110.0,"parent_id":27307091,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":83,"id":27336934,"title":null,"body":"<p>I am afraid there is no way from Javascript to know the HTTP status code of the negotiation.<\/p>\n\n<p>There are defined <a href=\"https:\/\/tools.ietf.org\/html\/rfc6455#section-7.4.1\" rel=\"nofollow\">closing codes<\/a>, and 1006 only means that the connection is closed abruptly, but the protocol even allows to close the connection without providing a reason. That, together with the <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/WebSocket#Constants\" rel=\"nofollow\">readyState<\/a> API, are the only tools you have to diagnosed the reason of the problem.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417902408460,"favorite_count":null,"last_activity_date":1417902408460,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":307976.0,"parent_id":27327266,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":84,"id":27357476,"title":null,"body":"<p>The short answer is that you almost certainly shouldn't be doing it.<\/p>\n\n<p>But if you really want to, then you can declare your variables as <code>static<\/code>. If you move this<\/p>\n\n<pre><code>int i = 0;\nint t = 0;\nint st = 0;\nint h = 0;\n<\/code><\/pre>\n\n<p>to the beginning, just after the <code>class<\/code> declaration, and change to<\/p>\n\n<pre><code>static int i = 0;\nstatic int t = 0;\nstatic int st = 0;\nstatic int h = 0;\n<\/code><\/pre>\n\n<p>then you'll find you can access them as globals, at least from inside this package. If you declare them <code>public<\/code> too, you'll be able to get to them from anywhere.<\/p>\n\n<p>But, really, you shouldn't do it like this at all. Have your <code>public static void main()<\/code> method create an instance of the class (<code>Main m = new Main()<\/code>) and then invoke some instance method on <code>m<\/code>. That instance method will be able to access non-static (instance) fields.<\/p>\n\n<p>Whenever you feel the need for a global, ask yourself whether it's an indication that your code isn't structured in the right way. Most of the time (not quite all of the time) when you think you want a global, you don't really. It will just make the structural problem worse.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418039775890,"favorite_count":null,"last_activity_date":1418040157497,"last_edit_date":1418040157497,"last_editor_display_name":null,"last_editor_user_id":3933089.0,"owner_display_name":null,"owner_user_id":3933089.0,"parent_id":27357423,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":85,"id":27284545,"title":null,"body":"<p>I believe this has to do with the contents of your war\/ear file. Do not package in the Oracle driver .jar file.<\/p>\n\n<p>Specifically, if you have <code>ojdbc6.jar<\/code> in your war file (or the equivalent) it will cause conflicts. It is fine to use that jar for compilation but you won't want it in your classpath as it is already in the Weblogic classpath by default.<\/p>\n\n<p>See these links for similar info: <a href=\"https:\/\/developer.jboss.org\/thread\/205507?tstart=0\" rel=\"noreferrer\">here<\/a> and <a href=\"http:\/\/ravivedala.blogspot.com\/2008\/03\/oracle-10g-passing-arrays-to-database.html\" rel=\"noreferrer\">here<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417655039753,"favorite_count":null,"last_activity_date":1417655039753,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2092358.0,"parent_id":27281407,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":86,"id":27320151,"title":null,"body":"<p>Add a function:<\/p>\n\n<pre><code>yaxis_format &lt;- function(x){\nlab &lt;- 400-x\n}\n<\/code><\/pre>\n\n<p>and then use <code>scale_y_continuous(label = yaxis_format)<\/code> to process the label:<\/p>\n\n<pre><code>ggplot(longdata) + p_aes + p_scale + p_geom + scale_y_continuous(label=yaxis_format)\n<\/code><\/pre>\n\n<p>The final code and graph should look like this:<\/p>\n\n<pre><code>library(ggplot2)\nlibrary(plyr)\n\nset.seed(201)\n\nbaseline = 400\nsteps &lt;- sample(0:10,50,replace=TRUE) - sample(0:10,50,replace=TRUE)\nvalue &lt;- cumsum(steps) + baseline\ntime = 1:50\ndata &lt;- data.frame(time,value)\n\nyaxis_format &lt;- function(x){\nlab &lt;- 400-x\n}\n\nlongdata &lt;- ddply( data, \"value\", transform, posneg=sign(value-baseline) )\nlongdata[longdata$posneg == 0,'posneg'] &lt;- 1\np_aes &lt;- aes( time, value-baseline, fill=factor(posneg))\np_scale &lt;- scale_fill_brewer( palette='Set1', guide=FALSE )\np_geom &lt;- geom_bar( stat='identity', position='identity' )\nggplot(longdata) + p_aes + p_scale + p_geom + scale_y_continuous(label=yaxis_format)\n + ylab(\"Value\")\n<\/code><\/pre>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/8j5KP.png\" alt=\"enter image description here\"><\/p>\n\n<p>Now, with that all set, notice that the scale is odd. Use <code>scale_y_reverse<\/code> instead to fix it:<\/p>\n\n<pre><code>ggplot(longdata) + p_aes + p_scale + p_geom + scale_y_reverse(label=yaxis_format)\n + ylab(\"Value\")\n<\/code><\/pre>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/bLTiv.png\" alt=\"enter image description here\"><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417701349450,"favorite_count":null,"last_activity_date":1417702192150,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":"Penguin_Knight","owner_user_id":1599277.0,"parent_id":27320150,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":87,"id":27352274,"title":null,"body":"<p>You can create a custom view contains subviews <code>UILabel<\/code> and <code>UIImageView<\/code> to show the token number and token image. Add it to right bar button item of the navigation controller.<\/p>\n\n<p>It will look like:<\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/vkJgz.png\" alt=\"enter image description here\"><\/p>\n\n<p>Below code will create the custom view. Here you can observe that it is a local variable. However, you can manage global variable for custom view or create a whole new class and manage it independently for real-time updates to show token number.<\/p>\n\n<pre><code>\/\/ Custom to hold token number and image\nlet tokenView = UIView(frame: CGRect(x:0, y:0, width:100, height:44))\ntokenView.backgroundColor = UIColor.yellow\n\n\/\/ Label to show token number\nlet tokenLabel = UILabel(frame: CGRect(x:0, y:0, width:60, height:44))\ntokenLabel.text = \"1234\"\ntokenLabel.textAlignment = NSTextAlignment.right\n\nlet imageHeight = CGFloat(30)\nlet marginY = CGFloat((tokenView.frame.size.height \/ 2) - (imageHeight \/ 2))\n\n\/\/ ImageView to display token image\nlet tokenImage = UIImageView(image: UIImage(named: \"coin\"))\ntokenImage.frame = CGRect(x:70, y:marginY, width:30, height:30)\n\ntokenView.addSubview(tokenLabel)\ntokenView.addSubview(tokenImage)\n\n\/\/ Add custom view as a right bar button item\nlet barButtonItem = UIBarButtonItem(customView: tokenView)\nself.navigationItem.rightBarButtonItem = barButtonItem\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418018619943,"favorite_count":null,"last_activity_date":1516625041960,"last_edit_date":1516625041960,"last_editor_display_name":null,"last_editor_user_id":3126646.0,"owner_display_name":null,"owner_user_id":3126646.0,"parent_id":27350347,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":88,"id":27318966,"title":null,"body":"<p>Make a custom middleware<\/p>\n\n<pre><code>function myCustomGoogleAuthenticator(req, res, next){\n passport.authenticate({\n scope: ...\n state: \/\/ now you have `req`\n })(req, res, next);\n \/\/^ call the middleware returned by passport.authenticate\n}\n<\/code><\/pre>\n\n<p>Add that to your route instead<\/p>\n\n<pre><code>app.get(\"\/auth\/google\", myCustomGoogleAuthenticator, function(req, res) {});\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417792386887,"favorite_count":null,"last_activity_date":1417792386887,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1266650.0,"parent_id":27308279,"post_type_id":2,"score":6,"tags":null,"view_count":null},{"index":89,"id":27351452,"title":null,"body":"<p>Everything looks alright. The likely gotcha would be that your \"constructor\" (which would more likely be called an \"instance creation message\" in Smalltalk) needs to be implemented on the class side, and you may have done so on the instance side. Conversely, your set... must be on the instance side. Which message is not understood (error details always help)? It should say in the debugger and that would help clarify.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418013078143,"favorite_count":null,"last_activity_date":1418097044883,"last_edit_date":1418097044883,"last_editor_display_name":null,"last_editor_user_id":424245.0,"owner_display_name":null,"owner_user_id":424245.0,"parent_id":27351064,"post_type_id":2,"score":7,"tags":null,"view_count":null},{"index":90,"id":27357716,"title":null,"body":"<p>This code works for me<\/p>\n\n<pre><code>from lxml.html import document_fromstring\ndoc = document_fromstring('&lt;a href=\"http:\/\/a.com\" rel=\"bookmark\"&gt;bla bla bla&lt;\/a&gt;')\nprint (doc.xpath(\"\/\/a\")[0].get(\"href\"))\nprint (doc.text_content())\n<\/code><\/pre>\n\n<p>Output:<\/p>\n\n<pre><code>http:\/\/a.com\nbla bla bla\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418040662827,"favorite_count":null,"last_activity_date":1418041183073,"last_edit_date":1418041183073,"last_editor_display_name":null,"last_editor_user_id":3108079.0,"owner_display_name":null,"owner_user_id":3108079.0,"parent_id":27345122,"post_type_id":2,"score":7,"tags":null,"view_count":null},{"index":91,"id":27312082,"title":null,"body":"<p>If your hover effects are small, like pointer on cursor, etc., I would use mostly CSS.\nIf you want to do bigger DOM manipulations I would use <code>React<\/code>. \nYou should not use the store to determine the state of a component, it should only distribute data around to the components after an action has occurred. \nThis means that it is the component that should know which state it currently is, and then determine what should happen. Here is a small example with a \"dumb\" component which does not have any kind of data updates, except its own state.<\/p>\n\n<pre><code>var SmallTooltip = React.createClass({\n\n getInitialState: function () {\n return {\n showTooltip: false\n };\n },\n\n onMouseEnter: function () {\n this.setState({\n showTooltip: true\n });\n },\n\n onMouseLeave: function () {\n this.setState({\n showTooltip: false\n });\n },\n\n render: function () {\n var toolTipClass = !this.state.showTooltip ? 'tooltip hidden' : 'tooltip';\n return (\n &lt;span onMouseEnter={this.onMouseEnter} onMouseLeave={this.onMouseLeave} className='someCoolWrapperClass'&gt;\n &lt;span className={toolTipClass}&gt;\n This is shown when you hover over the span\n &lt;\/span&gt;\n &lt;\/span&gt;\n );\n }\n});\n<\/code><\/pre>\n\n<p>You can easily send in data and do other data manipulations within this component to make it a smarter component.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417769619173,"favorite_count":null,"last_activity_date":1452770310247,"last_edit_date":1452770310247,"last_editor_display_name":null,"last_editor_user_id":1487766.0,"owner_display_name":null,"owner_user_id":1487766.0,"parent_id":27310390,"post_type_id":2,"score":8,"tags":null,"view_count":null},{"index":92,"id":27269282,"title":null,"body":"<p>Please, see the following article: <a href=\"http:\/\/www.nczonline.net\/blog\/2009\/07\/21\/introduction-to-sessionstorage\/\" rel=\"noreferrer\">http:\/\/www.nczonline.net\/blog\/2009\/07\/21\/introduction-to-sessionstorage\/<\/a><\/p>\n\n<p>If you want to remove specify key\/value pair from session storage, you need smth like this:<\/p>\n\n<pre><code>sessionStorage.removeItem(key)\n<\/code><\/pre>\n\n<p>For your case:<\/p>\n\n<pre><code>var retrieveArray= JSON.parse(sessionStorage.addedProductsList);\n\nfor (i=0; i&lt;retrieveArray.length; i++){\n if (retrieveArray[i].id == \"Your ProductId\") {\n retrieveArray.splice(i,1);\n }\n}\n\nsessionStorage.addedProductsList = retrieveArray;\n<\/code><\/pre>\n\n<p>Additionally, proper implementations allow you to read, write, and remove values from sessionStorage as if it were a regular object. For example:<\/p>\n\n<pre><code>\/\/save a value\nsessionStorage.name = \"Name\";\n\n\/\/retrieve item\nvar name = sessionStorage.name;\n\n\/\/remove the key\ndelete sessionStorage.name;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417602616110,"favorite_count":null,"last_activity_date":1417606619343,"last_edit_date":1417606619343,"last_editor_display_name":null,"last_editor_user_id":3006185.0,"owner_display_name":null,"owner_user_id":3006185.0,"parent_id":27269168,"post_type_id":2,"score":10,"tags":null,"view_count":null},{"index":93,"id":27273654,"title":null,"body":"<p>You might want to check out <a href=\"https:\/\/www.npmjs.org\/package\/which\" rel=\"noreferrer\">which module<\/a><\/p>\n\n<pre><code>var which = require('which');\nwhich('ls', function(err, result) {\n console.log(result); \/\/ prints '\/bin\/ls' on mac \n});\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1417615342757,"favorite_count":null,"last_activity_date":1417615737277,"last_edit_date":1417615737277,"last_editor_display_name":null,"last_editor_user_id":2999531.0,"owner_display_name":null,"owner_user_id":2999531.0,"parent_id":27273177,"post_type_id":2,"score":10,"tags":null,"view_count":null},{"index":94,"id":27276089,"title":null,"body":"<p>Notice that you specify <code>&lt;url-pattern&gt;\/*&lt;\/url-pattern&gt;<\/code>. You can use this pattern to apply the security constraint to only those URLs that you want to require authentication. Any URL that does not match this pattern will not have this security constraint applied.<\/p>\n\n<p>You can also add a second security-constraint with a url-pattern that matches the URLs that you don't want secured. In this case, leave out the auth-constraint tag entirely so everyone is allowed to access those URLs. Look at this <a href=\"https:\/\/stackoverflow.com\/questions\/20360377\/multiple-security-constraints-in-web-xml-not-working\">other question<\/a> for an example.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417622144313,"favorite_count":null,"last_activity_date":1417706547237,"last_edit_date":1495540255830,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1955871.0,"parent_id":27274840,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":95,"id":27292315,"title":null,"body":"<p>It heavily depends on how the page in question is constructed.<\/p>\n\n<p>If the page is static (HTTP response includes the data you need), then scraping the page via <a href=\"https:\/\/developer.chrome.com\/extensions\/xhr\" rel=\"nofollow\"><code>XMLHttpRequest<\/code><\/a> is the way to go.<\/p>\n\n<p>If the page is dynamic (no data initially, and JavaScript on the page then queries the server to fill it), then XHR route will not work. You can try to observe network requests made by that page and replicate them.<\/p>\n\n<p>Of note: while it's unlikely, check if the site has a public API. That will save you the reverse-engineering efforts and lets you avoid the grey area of automated data scraping.<\/p>\n\n<hr>\n\n<p>Also, see if you can somehow check from the page you're normally tracking if the item is favourited or not. It will be easier than scraping another page.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417690777077,"favorite_count":null,"last_activity_date":1417690777077,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":934239.0,"parent_id":27290161,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":96,"id":27344405,"title":null,"body":"<p>Java Persistence Api 2.0 (JPA 2) is a JAVA EE 6 feature. <\/p>\n\n<p><a href=\"http:\/\/tomcat.apache.org\/tomcat-7.0-doc\/index.html\" rel=\"nofollow noreferrer\">Apache Tomcat 7<\/a> is not a JAVA EE 6 Application Server, is just a lightweight Servlet(3.0)\/JSP(2.2) Container.<\/p>\n\n<p>In order to use (any of the) <a href=\"http:\/\/en.wikipedia.org\/wiki\/Java_Platform,_Enterprise_Edition#Web_profile\" rel=\"nofollow noreferrer\">JAVA EE features<\/a> (CDI, JPA2, EJB3.1, JSF, etc...), you need a JAVA EE Application Server.<\/p>\n\n<p>Sticking with Apache Tomcat, you could use <a href=\"http:\/\/tomee.apache.org\/apache-tomee.html\" rel=\"nofollow noreferrer\">Apache TomEE<\/a>, that is (guess what?) <a href=\"https:\/\/stackoverflow.com\/a\/11276137\/1654265\">a <strong>Tom<\/strong>cat JAVA <strong>EE<\/strong> compliant<\/a>.<\/p>\n\n<p>Otherwise use one of the other Application Servers out there (Glassfish, Jboss \/ Wildfly, etc...)<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417967342690,"favorite_count":null,"last_activity_date":1417967342690,"last_edit_date":1495542227070,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1654265.0,"parent_id":27343416,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":97,"id":27347997,"title":null,"body":"<p>I found the solution, I added the <code>@Transactional(readOnly = false)<\/code> annotation to my <code>addUser<\/code> method, and <code>@Primary<\/code> to my <code>hibTransMan<\/code> method in the <code>AppConfig<\/code> class. However, the warning about <code>@Autowired<\/code> is still there, anyone know why?<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417987399323,"favorite_count":null,"last_activity_date":1417987399323,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":633940.0,"parent_id":27347736,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":98,"id":27382879,"title":null,"body":"<p>Writing your own security implementation is a terribly bad idea. I suggest you take a look at how the Spring Security plugin does it for educational purposes, then just use that plugin - it is mature, flexible and easy to set up.<\/p>\n\n<p>For said educational purposes, let's see how we could mock above code using an approach that is loosely along the lines of how Spring Security does it: You would move the user lookup into a service\/bean as controllers aren't meant to contain any 'business' logic. Say something like this:<\/p>\n\n<pre><code>class UserProviderService {\n User findUser(String username) {\n User.findByUsername(username)\n }\n}\n<\/code><\/pre>\n\n<p>In the controller you would injected it as a dependency (<code>def userProviderService<\/code>) on which you would then call your own function, e.g. <code>userProviderService.findUser(username)<\/code>. During normal operation Grails would inject your <code>UserProviderService<\/code> into the controller while in unit tests you can mock it however you like (e.g. <code>controller.userProviderService = [ findByUsername: { -&gt; return null } ]<\/code> if you for example wanted to test the controller response for an unknown user.<\/p>\n\n<p>Similar for password comparison you would use a <code>passwordService<\/code> that would implement password hashing, comparison and so on and you could mock its response before every test. Note that this stuff is again not trivial if you care about security and very easy to mess up so again: don't do it yourself!<\/p>\n\n<p>The way you structure your code determines how easy or hard it will be to test it. Sure you could mess with <code>User.metaclass<\/code> and override methods left and right, but that approach usually proves very fragile. By splitting up your code you can make your life easier! How to structure your code so it is testable is definitely something you learn by experience so keep thinking about it!<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418139489503,"favorite_count":null,"last_activity_date":1418139489503,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":200841.0,"parent_id":27375606,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":99,"id":27269180,"title":null,"body":"<p>You can't change input's type dynamically so I would recommend to hardcode both types and use ng-switch or ng-if to show one or the other depending on the device.<\/p>\n\n<p>for example<\/p>\n\n<pre><code>&lt;input type=\"text\" ng-if=\"device.isAndroid\"&gt;\n&lt;input type=\"number\" ng-if=\"!device.isAndroid\"&gt;\n<\/code><\/pre>\n\n<p>or via a directive: <a href=\"http:\/\/plnkr.co\/edit\/0y8I6PIQqot9ZdN6OBnw?p=preview\" rel=\"nofollow\">http:\/\/plnkr.co\/edit\/0y8I6PIQqot9ZdN6OBnw?p=preview<\/a><\/p>\n\n<pre><code>app.directive('myDirective', [function() {\n\nreturn {\n restrict: 'A',\n scope: {\n isAndroid: '='\n },\n link: function(scope, element, attr, ctrl) {\n\n scope.$watch('isAndroid', function(newValue) {\n if (newValue === true) {\n element.attr('type', 'number')\n } else {\n element.attr('type', 'text')\n }\n })\n\n }\n};\n}]);\n<\/code><\/pre>\n\n<p>html:<\/p>\n\n<pre><code>&lt;input my-directive is-android=\"device.isAndroid\"&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417602298840,"favorite_count":null,"last_activity_date":1417605652193,"last_edit_date":1417605652193,"last_editor_display_name":null,"last_editor_user_id":2144711.0,"owner_display_name":null,"owner_user_id":2144711.0,"parent_id":27269095,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":100,"id":27271039,"title":null,"body":"<p>You are printing some HTML to browser, so, its not redirecting.<\/p>\n\n<p>Remove<\/p>\n\n<pre><code>echo(\"SUCCESS|Logging In as \" . $username);\n<\/code><\/pre>\n\n<p>Or, add<\/p>\n\n<p><code>ob_start()<\/code> in your file at the beginning.<\/p>\n\n<p>This will store all output values in a buffer and will cause redirection to occur.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417607337657,"favorite_count":null,"last_activity_date":1417607337657,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1841760.0,"parent_id":27270996,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":101,"id":27322352,"title":null,"body":"<p>You are not accounting for the case where there is no selection.<\/p>\n\n<pre><code>public void setDetails()\n{\n Customer selected = (Customer) customerCombo.getSelectedItem();\n if (selected != null)\n {\n \/\/ there is a selection so use it\n }\n else\n {\n \/\/ for example, clear the text boxes\n }\n}\n<\/code><\/pre>\n\n<p>We would also expect that changing the contents of the combo box might change its selection so we shouldn't ignore it.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417803961037,"favorite_count":null,"last_activity_date":1417803961037,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2891664.0,"parent_id":27322260,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":102,"id":27327035,"title":null,"body":"<p>You need <code>GROUP BY<\/code> and <code>HAVING<\/code> instead of just <code>WHERE<\/code> for filtering on an aggregate.<\/p>\n\n<pre><code>Session.query(Items).join(Items.categories).group_by(Items.id).having(functions.max(Categories.value)&lt;3.14).all()\n<\/code><\/pre>\n\n<p>Edit: To also include Items without any category, I believe you can do an outer join and put an <code>OR<\/code> in the <code>HAVING<\/code> clause:<\/p>\n\n<pre><code>Session.query(Items).outerjoin(Items.categories).group_by(Items.id)\\\n.having( (functions.max(Categories.value)&lt;3.14) | (functions.count(Categories.id)==0) )\\\n.all()\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417827132013,"favorite_count":null,"last_activity_date":1417889935650,"last_edit_date":1417889935650,"last_editor_display_name":null,"last_editor_user_id":1231717.0,"owner_display_name":null,"owner_user_id":1231717.0,"parent_id":27326403,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":103,"id":27346699,"title":null,"body":"<p>A lot of documentation you can find on <a href=\"http:\/\/developer.android.com\/training\/gestures\/index.html\" rel=\"nofollow\">http:\/\/developer.android.com\/training\/gestures\/index.html<\/a>.<\/p>\n\n<p>About scaling <a href=\"http:\/\/developer.android.com\/training\/gestures\/scale.html\" rel=\"nofollow\">http:\/\/developer.android.com\/training\/gestures\/scale.html<\/a><\/p>\n\n<p>Here exactly what you need <a href=\"http:\/\/developer.android.com\/training\/gestures\/scale.html#scale\" rel=\"nofollow\">http:\/\/developer.android.com\/training\/gestures\/scale.html#scale<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417979548423,"favorite_count":null,"last_activity_date":1417979548423,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1555366.0,"parent_id":27346662,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":104,"id":27356827,"title":null,"body":"<p>you need to set the columns you want to query as data_columns, see docs<\/p>\n\n<p>Further, the query itself should be a string (not a list):<\/p>\n\n<pre><code>In [1]: df = pd.DataFrame.from_dict({'A':[1,2],'B':[100,200], 'C':[42,11]})\n\nIn [2]: df_a = df.set_index('A')\n\nIn [3]: df_a\nOut[3]: \n B C\nA \n1 100 42\n2 200 11\n\nIn [4]: store = pd.HDFStore('foo.h5','w')\n\nIn [5]: store.put('bar', df_a, format='table', data_columns=True)\n<\/code><\/pre>\n\n<p>You are querying the index, so say that. The <em>name<\/em> of the index ('A') is not supported ATM.<\/p>\n\n<pre><code>In [7]: store.select('bar','index==1')\nOut[7]: \n B C\nA \n1 100 42\n<\/code><\/pre>\n\n<p>data_columns can be specified in the query<\/p>\n\n<pre><code>In [8]: store.select('bar','B==100')\nOut[8]: \n B C\nA \n1 100 42\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418037532953,"favorite_count":null,"last_activity_date":1418037532953,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":644898.0,"parent_id":27354281,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":105,"id":27303154,"title":null,"body":"<p>Neither. It's not a Swift bug, and you're not missing anything - because in fact you've solved the problem correctly!<\/p>\n\n<p>The issue is that, as a shortcut, if an anonymous function consists of <em>just one line<\/em>, Swift tries to use that as the return value. That return value, however, is invalid for a <code>(Bool) -&gt; Void<\/code>.<\/p>\n\n<p>In other words, when you say this:<\/p>\n\n<pre><code>UIView.animatePressed(messagesImage, complete: { _ in\n self.delegate.newSubViewControllerRequested(UIStoryboard.messageListViewController()!)\n})\n<\/code><\/pre>\n\n<p>It is exactly as if you had said this:<\/p>\n\n<pre><code>UIView.animatePressed(messagesImage, complete: { _ in\n return self.delegate.newSubViewControllerRequested(UIStoryboard.messageListViewController()!)\n})\n<\/code><\/pre>\n\n<p>But you can't say that, because your <code>newSubViewControllerRequested<\/code> returns an actual non-Void value. So now you've got a type mismatch; this anonymous function doesn't fit the required signature.<\/p>\n\n<p>So the workaround is just what you did - add more lines to the anonymous function (to suppress the shortcut), and\/or provide an explicit void return value. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417723964213,"favorite_count":null,"last_activity_date":1417725354403,"last_edit_date":1417725354403,"last_editor_display_name":null,"last_editor_user_id":341994.0,"owner_display_name":null,"owner_user_id":341994.0,"parent_id":27303094,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":106,"id":27307300,"title":null,"body":"<p>To add a relationship between user and permission on client side, Please use DataServiceContext.AddLink<\/p>\n\n<pre><code> dsc.AddLink(User, \"Permissions\", Permission)\n dsc.SaveChanges()\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417742655117,"favorite_count":null,"last_activity_date":1417742655117,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3056659.0,"parent_id":27297976,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":107,"id":27377202,"title":null,"body":"<p>Its becuase you havent specified a <code>100%<\/code> end point for the <code>x<\/code> transform, so it is reverting after being set at <code>50%<\/code><\/p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>(function(){\n var myBox = $(\".mybox\");\n $(\"#movebtn\").on(\"click\",function(){\n myBox.addClass(\"myanimation\");\n })\n})();<\/code><\/pre>\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>.mybox {\n width: 100px;\n height: 100px;\n background-color: lawngreen;\n}\n\n.myanimation{\n -webkit-animation: simple 3s forwards ease;\n}\n\n@-webkit-keyframes simple {\n 50% {\n -webkit-transform: translateX(300px);\n -moz-transform: translateX(300px);\n -ms-transform: translateX(300px);\n -o-transform: translateX(300px);\n transform: translateX(300px);\n }\n 100% {\n -webkit-transform: translateX(300px) translateY(300px);\n -moz-transform: translateX(300px) translateY(300px);\n -ms-transform: translateX(300px) translateY(300px);\n -o-transform: translateX(300px) translateY(300px);\n transform: translateX(300px) translateY(300px);\n \n }\n}<\/code><\/pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/2.1.1\/jquery.min.js\"&gt;&lt;\/script&gt;\n&lt;div class=\"mybox\"&gt;&lt;\/div&gt;\n &lt;br&gt;\n &lt;button id=\"movebtn\"&gt;Move&lt;\/button&gt;\n &lt;script data-require=\"[email protected]\" data-semver=\"2.1.1\" src=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/jquery\/2.1.1\/jquery.min.js\"&gt;&lt;\/script&gt;\n &lt;script src=\"script.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418122551040,"favorite_count":null,"last_activity_date":1418122551040,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":404335.0,"parent_id":27377163,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":108,"id":27344140,"title":null,"body":"<p>Exactly what it says on the tin. When you have<\/p>\n\n<pre><code>T at(T&amp;) const;\n<\/code><\/pre>\n\n<p>in a <code>myVector&lt;char&gt;<\/code>, that translates to<\/p>\n\n<pre><code>char at(char&amp;) const;\n<\/code><\/pre>\n\n<p>and an <code>int<\/code> cannot be bound to a reference to <code>char<\/code>. I think you meant to say <\/p>\n\n<pre><code>T at(int) const;\n<\/code><\/pre>\n\n<p>or, better,<\/p>\n\n<pre><code>T at(std::size_t) const;\n<\/code><\/pre>\n\n<p>because <code>std::size_t<\/code> is usually (by convention) used for this sort of thing. <code>int<\/code> is implicitly convertible to <code>std::size_t<\/code>, so that will also just work.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417965765387,"favorite_count":null,"last_activity_date":1417965765387,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4301306.0,"parent_id":27344091,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":109,"id":27345624,"title":null,"body":"<p>Short answer is that you can't. <\/p>\n\n<p>Essentially for you to display the image using <code>img<\/code> tag, your browser should access the resource anonymously. Currently all requests to file service resources must be authorized (using either <code>SharedKey<\/code> or <code>ShareKeyLite<\/code> authorization scheme) hence you can't access a resource in file service only by specifying a URL.<\/p>\n\n<p>Your best bet at this time would be to make use of <code>Azure Blob Storage<\/code> and save the file in a container with either <code>Blob<\/code> or <code>Public<\/code> ACL. If your blob container's ACL is private, then you would need a <code>Shared Access Signature (SAS)<\/code> with <code>Read<\/code> permission on the image (SAS Token needs to be included in the URL in that case) to be displayed directly in the browser.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417973851880,"favorite_count":null,"last_activity_date":1417973851880,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":188096.0,"parent_id":27345464,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":110,"id":27370908,"title":null,"body":"<p>If you're on your local box, you would need:<\/p>\n\n<ul>\n<li>The main <code>application.exe<\/code> (<a href=\"https:\/\/stackoverflow.com\/questions\/774187\/what-is-the-purpose-of-vshost-exe-file\">NOT vshost.exe<\/a> - These are for Visual Studio debugging only.)<\/li>\n<li><code>application.exe.config<\/code> if there are any settings associated with the app.<\/li>\n<li>Any DLLs the application references. Since you're using SQLite, you likely have a dependency on some SQLite library.<\/li>\n<\/ul>\n\n<p>If you're deploying to another computer, then you should also consider the following:<\/p>\n\n<ul>\n<li>Is the .NET Framework you're targeting installed on the target computer?<\/li>\n<li>You should also build in \"Release\" instead of \"Debug\", since debug DLLs may be missing.<\/li>\n<\/ul>\n\n<p>Generally, the following files are <em>NOT<\/em> necessary:<\/p>\n\n<ul>\n<li><code>.pdb<\/code> files<\/li>\n<li>Any <code>vshost<\/code> files<\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418095252470,"favorite_count":null,"last_activity_date":1418095252470,"last_edit_date":1495542668743,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":93306.0,"parent_id":27370813,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":111,"id":27305654,"title":null,"body":"<p>They're almost always the same. They're only different in cases where you have explicitly synced to a revision other than the one that you are currently \"working on\". This is so that if you revert, your workspace will be consistent with what you explicitly synced to.<\/p>\n\n<p>Example:<\/p>\n\n<pre><code>C:\\test\\999\\depot\\sam\\i\\rc\\a&gt;p4 edit foo\n\/\/depot\/sam\/i\/rc\/a\/foo#2 - opened for edit\n\nC:\\test\\999\\depot\\sam\\i\\rc\\a&gt;p4 -Ztag opened | grep -i rev\n... rev 2\n... haveRev 2\n\nC:\\test\\999\\depot\\sam\\i\\rc\\a&gt;p4 have foo\n\/\/depot\/sam\/i\/rc\/a\/foo#2 - c:\\test\\999\\depot\\sam\\i\\rc\\a\\foo\n\nC:\\test\\999\\depot\\sam\\i\\rc\\a&gt;p4 sync foo#1\n\/\/depot\/sam\/i\/rc\/a\/foo#2 - is opened at a later revision - not changed\n\nC:\\test\\999\\depot\\sam\\i\\rc\\a&gt;p4 -Ztag opened | grep -i rev\n... rev 2\n... haveRev 1\n\nC:\\test\\999\\depot\\sam\\i\\rc\\a&gt;p4 have foo\n\/\/depot\/sam\/i\/rc\/a\/foo#1 - c:\\test\\999\\depot\\sam\\i\\rc\\a\\foo\n\nC:\\test\\999\\depot\\sam\\i\\rc\\a&gt;p4 revert foo\n\/\/depot\/sam\/i\/rc\/a\/foo#1 - was edit, reverted\n<\/code><\/pre>\n\n<p>Another case where they're different (apart from explicitly syncing after you've opened the file) is if you open the file in such a way that the file is synced implicitly, e.g. with integrate (which implicitly syncs to head by default so that you don't have to do two resolves). The file will be opened at the head rev in that situation, but revert will bring you back to what you were at before you opened the file, rather than syncing you to head as a (possibly unexpected and unwanted) side effect of opening and reverting the file.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417733250377,"favorite_count":null,"last_activity_date":1417733250377,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3799759.0,"parent_id":27305020,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":112,"id":27364894,"title":null,"body":"<p>One has two brace characters around the name and the other doesn't; otherwise, in this context, there is no difference.<\/p>\n\n<p>However, if you had:<\/p>\n\n<pre><code>ONE_VAR=\"$TWO_VAR_$THREE_VAR\"\nUNO_VAR=\"${TWO_VAR}_${THREE_VAR}\"\n<\/code><\/pre>\n\n<p>then the values in <code>$ONE_VAR<\/code> and <code>$UNO_VAR<\/code> will be different unless both <code>$TWO_VAR<\/code> and <code>$TWO_VAR_<\/code> exist and <code>$TWO_VAR_<\/code> holds the value that is stored in <code>$TWO_VAR<\/code> plus a trailing underscore (where <code>$TWO_VAR<\/code> could be an empty string, or undefined, as long as <code>$TWO_VAR_<\/code> holds just an underscore).<\/p>\n\n<p><sup>Thanks to <a href=\"https:\/\/stackoverflow.com\/users\/140750\/william-pursell\">William Pursell<\/a> for <a href=\"https:\/\/stackoverflow.com\/questions\/27364826\/ksh-difference-between-and\/27364894?noredirect=1#comment43181810_27364894\">pointing out<\/a> a minor inaccuracy in the previous version.<\/sup><\/p>\n\n<p>There are many contexts where you must use the braces, such as:<\/p>\n\n<pre><code>UNE_VAR=${YET_ANOTHER_VAR:-\"default setting\"}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418064881680,"favorite_count":null,"last_activity_date":1418065707250,"last_edit_date":1495535120877,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":15168.0,"parent_id":27364826,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":113,"id":27383312,"title":null,"body":"<p>Try<\/p>\n\n<pre><code> mainPanel(\n # only the last output works\n h1(textOutput(\"txt\")),\n plotOutput(\"myplot\"),\n p(\"see what I mean?\")\n )\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418140697480,"favorite_count":null,"last_activity_date":1418140697480,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":229794.0,"parent_id":27382840,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":114,"id":27307246,"title":null,"body":"<p>You can get the exit status of the child via the first argument of <code>wait()<\/code>, or the second argument of <code>waitpid()<\/code>, and then using the macros <code>WIFEXITED<\/code> and <code>WEXITSTATUS<\/code> with it.<\/p>\n\n<p>For instance:<\/p>\n\n<pre><code>pid_t ret = c2b_popen4(\"myprog\", pin, pout, perr, 0);\n\nif ( ret &gt; 0 ) {\n int status;\n\n if ( waitpid(ret, &amp;status, 0) == -1 ) {\n perror(\"waitpid() failed\");\n exit(EXIT_FAILURE);\n }\n\n if ( WIFEXITED(status) ) {\n int es = WEXITSTATUS(status);\n printf(\"Exit status was %d\\n\", es);\n }\n}\n<\/code><\/pre>\n\n<p>A simplified working example:<\/p>\n\n<p><code>failprog.c<\/code>:<\/p>\n\n<pre><code>int main(void) {\n return 53;\n}\n<\/code><\/pre>\n\n<p><code>shellex.c<\/code>:<\/p>\n\n<pre><code>#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;unistd.h&gt;\n#include &lt;sys\/types.h&gt;\n#include &lt;sys\/wait.h&gt;\n\nint main(void)\n{\n pid_t p = fork();\n if ( p == -1 ) {\n perror(\"fork failed\");\n return EXIT_FAILURE;\n }\n else if ( p == 0 ) {\n execl(\"\/bin\/sh\", \"bin\/sh\", \"-c\", \".\/failprog\", \"NULL\");\n return EXIT_FAILURE;\n }\n\n int status;\n if ( waitpid(p, &amp;status, 0) == -1 ) {\n perror(\"waitpid failed\");\n return EXIT_FAILURE;\n }\n\n if ( WIFEXITED(status) ) {\n const int es = WEXITSTATUS(status);\n printf(\"exit status was %d\\n\", es);\n }\n\n return EXIT_SUCCESS;\n}\n<\/code><\/pre>\n\n<p>Output:<\/p>\n\n<pre><code>paul@thoth:~\/src\/sandbox$ .\/shellex\nexit status was 53\npaul@thoth:~\/src\/sandbox$ \n<\/code><\/pre>\n\n<p><code>waitpid()<\/code> will block until the process with the supplied process ID exits. Since you're calling your function with a <code>popen()<\/code> name and passing pipes to it, presumably your child process doesn't terminate quickly, so that probably wouldn't be the right place to check it, if the call succeeded. You can pass <code>WNOHANG<\/code> as the third parameter to <code>waitpid()<\/code> to check if the process has terminated, and to return <code>0<\/code> if the child has not yet exited, but you have to be careful about <em>when<\/em> you do this, since you get no guarantees about which process will run when. If you call <code>waitpid()<\/code> with <code>WNOHANG<\/code> immediately after returning from <code>c2b_popen4()<\/code>, it may return <code>0<\/code> before your child process has had a chance to execute and terminate with an error code, and make it look as if the execution was successful when it's just about to not be successful.<\/p>\n\n<p>If the process does die immediately, you'll have problems reading from and writing to your pipes, so one option would be to check <code>waitpid()<\/code> if you get an error from the first attempt to do that, to check if the <code>read()<\/code> or <code>write()<\/code> is failing because your child process died. If that turns out to be true, you can retrieve the exit status and exit your overall program then.<\/p>\n\n<p>There are other possible strategies, including catching the SIGCHLD signal, since that'll be raised whenever one of your child processes dies. It would be OK, for instance, to call <code>_exit()<\/code> right from your signal handler, after waiting for the child process (calling <code>waitpid()<\/code> in a signal handler is also safe) and getting its exit status. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417742256660,"favorite_count":null,"last_activity_date":1417766152480,"last_edit_date":1417766152480,"last_editor_display_name":null,"last_editor_user_id":2399879.0,"owner_display_name":null,"owner_user_id":2399879.0,"parent_id":27306764,"post_type_id":2,"score":20,"tags":null,"view_count":null},{"index":115,"id":27317945,"title":null,"body":"<p>You need to use these 3 function to calculate the left right and all child of any element.<\/p>\n\n<pre><code>function leftcount($id) \/\/Function to calculate all left children count\n{\n $sql = \"SELECT id,usr_name,rid,pid,l_mem,r_mem,position,joining_date FROM user WHERE id = '$id'\";\n $execsql = mysql_query($sql);\n $array = mysql_fetch_array($execsql);\n (array_count_values($array));\n $count = 0;\n if(!empty($array['l_mem']))\n {\n $count += allcount($array['l_mem']) +1;\n }\n return $count;\n}\nfunction rightcount($id) \/\/Function to calculate all right children count\n{\n $sql = \"SELECT id,usr_name,rid,pid,l_mem,r_mem,position,joining_date FROM user WHERE id = '$id'\";\n $execsql = mysql_query($sql);\n $array = mysql_fetch_array($execsql);\n (array_count_values($array));\n $count = 0;\n if(!empty($array['r_mem']))\n {\n $count += allcount($array['r_mem']) +1;\n }\n return $count;\n}\nfunction allcount($id) \/\/Function to calculate all children count\n{\n $sql = \"SELECT id,usr_name,rid,pid,l_mem,r_mem,position,joining_date FROM user WHERE id = '$id'\";\n $execsql = mysql_query($sql);\n $array = mysql_fetch_array($execsql);\n (array_count_values($array));\n $count = 0;\n if(!empty($array['l_mem']))\n {\n $count += allcount($array['l_mem']) +1;\n }\n if(!empty($array['r_mem']))\n {\n $count += allcount($array['r_mem']) +1;\n }\n return $count;\n}\n<\/code><\/pre>\n\n<p>If you pass 1 to these function. answer for these are as follows<\/p>\n\n<pre><code>echo leftcount(1); \/\/ 8\necho rightcount(1); \/\/ 5\necho allcount(1); \/\/ 13\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1417789268420,"favorite_count":null,"last_activity_date":1417789268420,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2113173.0,"parent_id":27314676,"post_type_id":2,"score":-1,"tags":null,"view_count":null},{"index":116,"id":27289025,"title":null,"body":"<p>Spring Session is a separate project: <a href=\"https:\/\/github.com\/spring-projects\/spring-session\" rel=\"nofollow\">https:\/\/github.com\/spring-projects\/spring-session<\/a>.<\/p>\n\n<p>You should use some dependency management tool (Gradle or Maven) to have a control over artifacts for your application.<\/p>\n\n<p>See WebScoket sample there: <a href=\"https:\/\/github.com\/spring-projects\/spring-session\/tree\/master\/samples\/websocket\" rel=\"nofollow\">https:\/\/github.com\/spring-projects\/spring-session\/tree\/master\/samples\/websocket<\/a> .<\/p>\n\n<p>A Spring Session artifact is:<\/p>\n\n<pre><code>compile \"org.springframework.session:spring-session:1.0.0.RC1\"\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1417680411660,"favorite_count":null,"last_activity_date":1417680411660,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2756547.0,"parent_id":27288426,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":117,"id":27348415,"title":null,"body":"<p>Try this:<\/p>\n\n<pre><code>&lt;RelativeLayout\n android:layout_width=\"fill_parent\"\n android:layout_height=\"wrap_content\"&gt;\n &lt;TextView\n android:id=\"@+id\/titleTextView\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentTop=\"true\"\n android:layout_centerHorizontal=\"true\"\n android:text=\"Title\"\/&gt;\n\n &lt;ImageView\n android:id=\"@+id\/imageView1\"\n android:layout_width=\"200dp\"\n android:layout_height=\"150dp\"\n android:layout_below=\"@id\/titleTextView\"\n android:layout_alignParentTop=\"true\"\n android:layout_centerHorizontal=\"true\"\n android:layout_margin=\"15dp\"\n android:contentDescription=\"Desc\" \n android:src=\"@drawable\/ic_launcher\" \/&gt;\n\n &lt;LinearLayout\n android:orientation=\"horizontal\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_below=\"@+id\/imageView1\"\n android:layout_centerHorizontal=\"true\"&gt;\n\n &lt;TextView\n android:id=\"@+id\/textView2\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:textSize=\"25sp\"\n android:text=\"Text 1\"\/&gt;\n\n &lt;TextView\n android:id=\"@+id\/numOfPlayersTextView\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Text 2\"\n android:textSize=\"25sp\"\n android:layout_marginStart=\"20dp\"\/&gt;\n &lt;\/LinearLayout&gt;\n\n&lt;\/RelativeLayout&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1417989969010,"favorite_count":null,"last_activity_date":1418065829440,"last_edit_date":1418065829440,"last_editor_display_name":null,"last_editor_user_id":4224337.0,"owner_display_name":null,"owner_user_id":4224337.0,"parent_id":27348251,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":118,"id":27333301,"title":null,"body":"<p>You are right. Parens might be omitted.<br>\nWhat pascal compiler do you use? Proper usage of <code>New<\/code> routine:<\/p>\n\n<pre><code> New(arrp[variable]) ;\n parrp^[variable]^ := variable;\n<\/code><\/pre>\n\n<p>P.S. Do you really need these pointer types here?<\/p>\n\n<p>P.P.S. Now I see an error:\nPIntegerArrayP = ^IntegerArray<strong>P<\/strong>;<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1417880515623,"favorite_count":null,"last_activity_date":1417881168117,"last_edit_date":1417881168117,"last_editor_display_name":null,"last_editor_user_id":844416.0,"owner_display_name":null,"owner_user_id":844416.0,"parent_id":27333233,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":119,"id":27338220,"title":null,"body":"<p>You create several tables and <strong>one<\/strong> of those tables has <code>FOREIGN KEYs<\/code> which means some registries depends on registries from other tables. <\/p>\n\n<p>In your case, you insert data on <code>friends<\/code> table that reference all other tables (from your create script). Try to populate those first then the friends table.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1417912318413,"favorite_count":null,"last_activity_date":1417913698720,"last_edit_date":1417913698720,"last_editor_display_name":null,"last_editor_user_id":460557.0,"owner_display_name":null,"owner_user_id":460557.0,"parent_id":27338178,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":120,"id":27346673,"title":null,"body":"<pre><code>book = @books.findWhere({rottenId: id})\[email protected](book)\n<\/code><\/pre>\n\n<p>does exactly what it says, it removes <code>book<\/code> from <code>@books<\/code>. However, removing a model from the collection has nothing to do with removing the model from the server. If you want to delete the <code>book<\/code> instance, you need to do<\/p>\n\n<pre><code>book = @books.findWhere({rottenId: id})\nbook.destroy();\n<\/code><\/pre>\n\n<p>which also has the side-effect of removing the model from the collection automatically.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1417979332897,"favorite_count":null,"last_activity_date":1417980694687,"last_edit_date":1417980694687,"last_editor_display_name":null,"last_editor_user_id":785065.0,"owner_display_name":null,"owner_user_id":785065.0,"parent_id":27346388,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":121,"id":27361162,"title":null,"body":"<p>It seems that you are looking for something like <strong><a href=\"http:\/\/alvarotrigo.com\/pagePiling\" rel=\"nofollow\">pagePiling.js<\/a><\/strong> plugin for jQuery.<\/p>\n\n<p>It will create those \"cards\" for you and show or hide them when scrolling up or down. <\/p>\n\n<ul>\n<li>Compatible with touch devices<\/li>\n<li>Compatible with old browsers (IE > 7)<\/li>\n<li>Configurable - lots of methods and options <\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418052162233,"favorite_count":null,"last_activity_date":1418052162233,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1081396.0,"parent_id":27360414,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":122,"id":27371354,"title":null,"body":"<p>Have you tried running the sample code you supplied? If you use 2 equal JSON strings but rearrange the order of the keys, you'll find your answer...<\/p>\n\n<p>Here is sample code :<\/p>\n\n<pre><code>String json1=\" { \\\"name\\\" :\\\"ABC\\\",\\\"city\\\":\\\"XYZ\\\"}\";\nString json2=\" { \\\"city\\\":\\\"XYZ\\\", \\\"name\\\" :\\\"ABC\\\"}\";\n\nJsonParser parser = new JsonParser();\nJsonElement t2 = parser.parse(json2);\nJsonElement t1 = parser.parse(json1); \/\/ returns true\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418098656853,"favorite_count":null,"last_activity_date":1418099181230,"last_edit_date":1418099181230,"last_editor_display_name":null,"last_editor_user_id":3218114.0,"owner_display_name":null,"owner_user_id":4104359.0,"parent_id":27371134,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":123,"id":27381950,"title":null,"body":"<p>In the if statement you detect new points:<\/p>\n\n<pre><code> if FrameCount==30 %If 30 frame have stepped though, find new feature points\n disp('help')\n points = detectMinEigenFeatures(rgb2gray(videoFrame),'MinQuality',0.04,'FilterSize',3);\n points = points.Location;\n FrameCount=0;\n end\n<\/code><\/pre>\n\n<p>Now, inside that same <code>if<\/code> you have to tell the point tracker about those new points:<\/p>\n\n<pre><code>setPoints(tracker, points);\n<\/code><\/pre>\n\n<p>Otherwise, your variable <code>points<\/code> gets overwritten by the next line:<\/p>\n\n<pre><code>[points, isFound] = step(pointTracker, videoFrame);\n<\/code><\/pre>\n\n<p>This is why you never see the newly detected points.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418137113573,"favorite_count":null,"last_activity_date":1418137113573,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":13313.0,"parent_id":27371781,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":124,"id":27314915,"title":null,"body":"<p>These are called intents, some application are listening for contents like images and plain text. when you call these intent, a dialog will open of those applications are listening for your content.<\/p>\n\n<p><strong>Share single Image<\/strong><\/p>\n\n<pre><code>Intent shareIntent = new Intent();\nshareIntent.setAction(Intent.ACTION_SEND);\nshareIntent.putExtra(Intent.EXTRA_STREAM, uriToImage);\nshareIntent.setType(\"image\/jpeg\");\nstartActivity(Intent.createChooser(shareIntent, getResources().getText(R.string.send_to)));\n<\/code><\/pre>\n\n<p><strong>Share multiple Image<\/strong><\/p>\n\n<pre><code>ArrayList&lt;Uri&gt; imageUris = new ArrayList&lt;Uri&gt;();\nimageUris.add(imageUri1); \/\/ Add your image URIs here\nimageUris.add(imageUri2);\n\nIntent shareIntent = new Intent();\nshareIntent.setAction(Intent.ACTION_SEND_MULTIPLE);\nshareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);\nshareIntent.setType(\"image\/*\");\nstartActivity(Intent.createChooser(shareIntent, \"Share images to..\"));\n<\/code><\/pre>\n\n<p><strong>Get ImageURI<\/strong><\/p>\n\n<pre><code>public Uri getImageUri(Context inContext, Bitmap inImage) {\n ByteArrayOutputStream bytes = new ByteArrayOutputStream();\n inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes);\n String path = Images.Media.insertImage(inContext.getContentResolver(), inImage, \"Title\", null);\n return Uri.parse(path);\n}\n<\/code><\/pre>\n\n<p><strong>OR<\/strong><\/p>\n\n<pre><code>Uri.parse(new File(\"\/sdcard\/yourImage.jpg\").toString())\n<\/code><\/pre>\n\n<p>More you can here on <a href=\"http:\/\/developer.android.com\/training\/sharing\/send.html\" rel=\"nofollow\">Android official website<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1417778895350,"favorite_count":null,"last_activity_date":1417779814673,"last_edit_date":1417779814673,"last_editor_display_name":null,"last_editor_user_id":1061944.0,"owner_display_name":null,"owner_user_id":1061944.0,"parent_id":27314877,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":125,"id":27341129,"title":null,"body":"<p>It is working for me, (VS 2010) as following:<br>\n-add file 'CoolPropLib.h' to your project, by right click on header files folder in solution explorer -> Add -> Existing Item -> choose 'CoolPropLib.h'. <br>\n-open file 'CoolPropLib.h' and comment line 22 as follow (\/\/#include \"PlatformDetermination.h\"). <br>\n- add these two lines (23, 24) : <br><\/p>\n\n<pre><code> #define CONVENTION __stdcall\n #define EXTERNC\n<\/code><\/pre>\n\n<p><br>-use library that is built with <em>__stcall<\/em> not that built with <em>__cdecel<\/em> :<br> <a href=\"http:\/\/sourceforge.net\/projects\/coolprop\/files\/CoolProp\/5.0.0\/shared_library\/Windows\/32bit__stdcall_calling_convention\/CoolProp.lib\/download\" rel=\"nofollow\">http:\/\/sourceforge.net\/projects\/coolprop\/files\/CoolProp\/5.0.0\/shared_library\/Windows\/32bit__stdcall_calling_convention\/CoolProp.lib\/download<\/a> \n<br>-you will need the dll (for __stdcall) from :<br> <a href=\"http:\/\/sourceforge.net\/projects\/coolprop\/files\/CoolProp\/5.0.0\/shared_library\/Windows\/32bit__stdcall_calling_convention\/CoolProp.dll\/download\" rel=\"nofollow\">http:\/\/sourceforge.net\/projects\/coolprop\/files\/CoolProp\/5.0.0\/shared_library\/Windows\/32bit__stdcall_calling_convention\/CoolProp.dll\/download<\/a>\n<br><br>\n-create folder named 'lib' in your project folder in windows explorer (not in VS) and put 'CoolProp.lib' in it. <br>\n<br>-in Properties->Linker->General-> Additional libraries Directories, add <em>$(ProjectDir)\\lib<\/em> \n<br>-the code I test is: <br> <\/p>\n\n<pre><code>#include \"stdafx.h\"\n#include &lt;iostream&gt;\n#include &lt;vector&gt;\n#include \"CoolPropLib.h\"\nusing namespace std;\n\n\nint _tmain(int argc, _TCHAR* argv[])\n{\n\n \/\/ First type (slowest, due to most string processing, exposed in DLL)\n std::cout &lt;&lt; PropsSI(\"Dmolar\",\"T\",298,\"P\",1e5,\"Propane[0.5]&amp;Ethane[0.5]\") &lt;&lt; std::endl; \/\/ Default backend is HEOS\n std::cout &lt;&lt; PropsSI(\"Dmolar\",\"T\",298,\"P\",1e5,\"HEOS::Propane[0.5]&amp;Ethane[0.5]\") &lt;&lt; std::endl;\n std::cout &lt;&lt; PropsSI(\"Dmolar\",\"T\",298,\"P\",1e5,\"REFPROP::Propane[0.5]&amp;Ethane[0.5]\") &lt;&lt; std::endl;\n\n return 0;\n}\n<\/code><\/pre>\n\n<p>-if you have problems, I can upload the project to you.<br><br><br>\n<strong>EDIT 1:<\/strong> <br><\/p>\n\n<ul>\n<li>I mean 'CoolPropLib.h' not 'CoolProp.h', I correct it; In your question, you named it as 'CoolProp.h'.<br><\/li>\n<li>As you mentioned in your comment; you can change calling convention as _stdcall in Properties->c\/c++ ->Advanced .<\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1417942515330,"favorite_count":null,"last_activity_date":1417951746563,"last_edit_date":1417951746563,"last_editor_display_name":null,"last_editor_user_id":992406.0,"owner_display_name":null,"owner_user_id":992406.0,"parent_id":27340520,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":126,"id":27343427,"title":null,"body":"<p>did you see <a href=\"https:\/\/docs.djangoproject.com\/en\/dev\/ref\/contrib\/admin\/#django.contrib.admin.ModelAdmin.raw_id_fields\" rel=\"nofollow noreferrer\">raw_id_fields<\/a> ? <\/p>\n\n<p>you would do in admin.py something like: <\/p>\n\n<pre><code>class ClientAdmin(admin.ModelAdmin):\n raw_id_fields = (\"country\",)\nadmin.site.register(Client, ClientAdmin)\n<\/code><\/pre>\n\n<p>then select widget will become something like: <\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/eYykG.png\" alt=\"enter image description here\"><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1417960937353,"favorite_count":null,"last_activity_date":1417960937353,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":903790.0,"parent_id":27342881,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":127,"id":27376704,"title":null,"body":"<p>MVC normally prevents any content files from being served from the Views folder (the Views folder is special). <\/p>\n\n<p>However, you can change this by tweaking your web.config.<\/p>\n\n<p>Change this:<\/p>\n\n<pre><code>&lt;add name=\"BlockViewHandler\" path=\"*\" verb=\"*\" preCondition=\"integratedMode\" type=\"System.Web.HttpNotFoundHandler\" \/&gt;\n<\/code><\/pre>\n\n<p>To this:<\/p>\n\n<pre><code>&lt;add name=\"BlockViewHandler\" path=\"*.cshtml\" verb=\"*\" preCondition=\"integratedMode\" type=\"System.Web.HttpNotFoundHandler\" \/&gt;\n<\/code><\/pre>\n\n<p>Example:<\/p>\n\n<pre><code>&lt;handlers&gt;\n &lt;add name=\"JavaScriptHandler\" path=\"*.js\" verb=\"*\"\n preCondition=\"integratedMode\" type=\"System.Web.StaticFileHandler\" \/&gt; \n &lt;add name=\"HtmlScriptHandler\" path=\"*.html\" verb=\"*\"\n preCondition=\"integratedMode\" type=\"System.Web.StaticFileHandler\" \/&gt;\n &lt;remove name=\"BlockViewHandler\"\/&gt;\n &lt;add name=\"BlockViewHandler\" path=\"*.cshtml\" verb=\"*\" preCondition=\"integratedMode\" type=\"System.Web.HttpNotFoundHandler\" \/&gt;\n&lt;\/handlers&gt;\n<\/code><\/pre>\n\n<p>That way, only cshtml files are blocked from being served directly (html files are left alone).<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418120953757,"favorite_count":null,"last_activity_date":1418120953757,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3661630.0,"parent_id":27376401,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":128,"id":27277984,"title":null,"body":"<p>Use the <a href=\"http:\/\/www.elasticsearch.org\/guide\/en\/elasticsearch\/reference\/current\/index-modules-mapper.html#_default_mapping\">_default_<\/a> mapping setting on the Index. When the type is created it will have the field mapping your looking for.<\/p>\n\n<pre><code>PUT \/my_index{\n\"mappings\": {\n \"_default_\": {\n \"properties\": {\n \"field1\": {\n \"type\": \"string\",\n \"index\": \"analyzed\"\n }\n }\n }\n}\n<\/code><\/pre>\n\n<p>You could also use an <a href=\"http:\/\/www.elasticsearch.org\/guide\/en\/elasticsearch\/guide\/current\/index-templates.html\">Index Template<\/a>, if you wanted all new indexes to have this default setting. I think it would be a good enhancement to have a <a href=\"http:\/\/www.elasticsearch.org\/guide\/en\/elasticsearch\/guide\/current\/custom-dynamic-mapping.html#dynamic-templates\">Dynamic Templates<\/a> be available at Index Level so they can be applied across types. This doesn't appear possible now.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1417627827810,"favorite_count":null,"last_activity_date":1417629847663,"last_edit_date":1417629847663,"last_editor_display_name":null,"last_editor_user_id":282538.0,"owner_display_name":null,"owner_user_id":282538.0,"parent_id":27277609,"post_type_id":2,"score":7,"tags":null,"view_count":null},{"index":129,"id":27375654,"title":null,"body":"<p>additionalProperties is your keyword:<\/p>\n\n<pre><code>{\n \"type\" : \"object\",\n \"additionalProperties\" : {\n \"type\" : \"object\",\n \"required\" : [\n \"age\",\n \"gender\"\n ],\n \"properties\" : {\n \"age\" : {\n \"type\" : \"string\"\n },\n \"gender\" : {\n \"type\" : \"string\"\n }\n }\n }\n}\n<\/code><\/pre>\n\n<p><code>additionalProperties<\/code> can have following values with different meanings:<\/p>\n\n<ul>\n<li><code>\"additionalProperties\": false<\/code> No more properties are allowed at all.<\/li>\n<li><code>\"additionalProperties\": true<\/code> Any more properties are allowed. This is the default behavior.<\/li>\n<li><code>\"additionalProperties\": {\"type\": \"string\"}<\/code> Additional properties (of arbitrary name) are allowed, if they have value of given type (\"string\" here).<\/li>\n<li><code>\"additionalProperties\": {*any schema*}<\/code> Additional properties must satisfy the provided schema, such as the example provided above.<\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418117951203,"favorite_count":null,"last_activity_date":1441287804403,"last_edit_date":1441287804403,"last_editor_display_name":null,"last_editor_user_id":2660176.0,"owner_display_name":null,"owner_user_id":2660176.0,"parent_id":27357861,"post_type_id":2,"score":50,"tags":null,"view_count":null},{"index":130,"id":27310275,"title":null,"body":"<p>At times like these, you'll be forced to tinker with the designer code. As long as you don't make drastic changes in the designer code, you shouldn't break anything. To play it safe, re-instantiate the object where the other controls are instantiated (near the top of the page). The designer should fill in the blanks for properties and such.<\/p>\n\n<p>This should also return the control to the toolbox.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1417761751913,"favorite_count":null,"last_activity_date":1417761751913,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2645669.0,"parent_id":27289366,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":131,"id":27304753,"title":null,"body":"<p>So <code>boost::chrono<\/code> should be fully supported in C++11's <code>std::chrono<\/code>.<\/p>\n\n<p>Which I believe is now fully supported by Visual Studio 2013 and gcc 4.8?<\/p>\n\n<p>Anyway you can print using: <a href=\"http:\/\/www.cplusplus.com\/reference\/iomanip\/put_time\/\" rel=\"nofollow\"><code>put_time<\/code><\/a><\/p>\n\n<p>There are a tremendous number of format specifiers in the link, you can use those to customize the output to your needs.<\/p>\n\n<p>It's important to note that <code>put_time<\/code> is just a stream manipulator. If you need to get your time in a <code>string<\/code> you'll need to use <code>put_time<\/code> with a <code>stringstream<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1417729736550,"favorite_count":null,"last_activity_date":1417729736550,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2642059.0,"parent_id":27304365,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":132,"id":27280959,"title":null,"body":"<p>If you are using the array \"<a href=\"http:\/\/php.net\/manual\/en\/language.types.callable.php\" rel=\"nofollow\">callable<\/a>\" syntax, then you need to use <a href=\"http:\/\/php.net\/call_user_func\" rel=\"nofollow\"><code>call_user_func<\/code><\/a>.<\/p>\n\n<pre><code>if (is_callable($method)) {\n return call_user_func($method);\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1417638338000,"favorite_count":null,"last_activity_date":1417638338000,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":206403.0,"parent_id":27280926,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":133,"id":27304481,"title":null,"body":"<p>The formula is the variable. So set the name of your function (UsedCells) = to your result:<\/p>\n\n<p><code>UsedCells = n * 10<\/code><\/p>\n\n<p>EDIT: Please note this will not recalculate if you use more cells in col A. To make it calculate dynamically use:<\/p>\n\n<pre><code>Function UsedCells(Col As String) As Long\nn = Worksheets(\"Marginal\").Range(Col &amp; \":\" &amp; Col).Cells.SpecialCells(xlCellTypeConstants).Count\nUsedCells = n * 10\nEnd Function\n<\/code><\/pre>\n\n<p>Then in any given cell in your sheet, place the forumla <code>=UsedCells(\"x\")<\/code> where x is the letter of the Column you want to check.<\/p>\n\n<p>Working solution:<\/p>\n\n<pre><code>Function UsedCells(Col As String) As Long\nUsedCells = Sheets(\"Marginal\").Range(Col &amp; Rows.Count).End(xlUp).Row * 10\nEnd Function\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1417728660787,"favorite_count":null,"last_activity_date":1417729921077,"last_edit_date":1417729921077,"last_editor_display_name":null,"last_editor_user_id":4241535.0,"owner_display_name":null,"owner_user_id":4241535.0,"parent_id":27304416,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":134,"id":27275420,"title":null,"body":"<p>Try passing in a SOAP_ENC_OBJECT<\/p>\n\n<pre><code>$struct = new stdClass();\n$struct-&gt;item1 = $item1; \n\n$response = $client-&gt;RetrieveUserGPSDataVisualization(new SoapVar($struct, SOAP_ENC_OBJECT));\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1417620304243,"favorite_count":null,"last_activity_date":1417791612333,"last_edit_date":1417791612333,"last_editor_display_name":null,"last_editor_user_id":953496.0,"owner_display_name":null,"owner_user_id":953496.0,"parent_id":27275017,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":135,"id":27331108,"title":null,"body":"<p>You can use the <a href=\"http:\/\/linux.die.net\/man\/3\/mktime\" rel=\"nofollow\">mktime()<\/a> like following <\/p>\n\n<pre><code>time_t t = time(NULL);\ntm* timePtr = localtime(&amp;t);\/\/Getting current time.\n\nstruct tm t = {0}; \/\/ Initalize to all 0's\nt.tm_year = timePtr-&gt;tm_year; \/\/ This is year- 114 (1900+114=2014)\nt.tm_mon = timePtr-&gt;tm_mon; \/\/Current Month\nt.tm_mday = timePtr-&gt;tm_mday; \/\/Today's date\nt.tm_hour = 10; \/\/Time you need (10)\nt.tm_min = 30; \/\/Minutes you need (30)\nt.tm_sec = timePtr-&gt;tm_sec; \/\/Current second\ntime_t timeSinceEpoch = mktime(&amp;t);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1417864916487,"favorite_count":null,"last_activity_date":1417866481217,"last_edit_date":1417866481217,"last_editor_display_name":null,"last_editor_user_id":4082108.0,"owner_display_name":null,"owner_user_id":4082108.0,"parent_id":27331020,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":136,"id":27325377,"title":null,"body":"<p>Unfortunately there is no support for links and other markup in HTML notifications. The only method to get a clickable link with a notification is to use onclick:<\/p>\n\n<pre><code>function makeNotification() {\n var notification = new Notification('This is a clickable notification', {body: 'Click Me'});\n\n notification.onclick = function () {\n window.open(\"http:\/\/stackoverflow.com\/\");\n };\n}\n\nfunction notifyMe() {\n \/\/ Let's check if the browser supports notifications\n if (!(\"Notification\" in window)) {\n alert(\"This browser does not support desktop notification\");\n }\n\n \/\/ Let's check if the user is okay to get some notification\n else if (Notification.permission === \"granted\") {\n \/\/ If it's okay let's create a notification\n makeNotification();\n }\n\n \/\/ Otherwise, we need to ask the user for permission\n \/\/ Note, Chrome does not implement the permission static property\n \/\/ So we have to check for NOT 'denied' instead of 'default'\n else if (Notification.permission !== 'denied') {\n Notification.requestPermission(function (permission) {\n \/\/ If the user is okay, let's create a notification\n if (permission === \"granted\") {\n makeNotification();\n }\n });\n }\n}\n<\/code><\/pre>\n\n<p>Mozilla has further documentation at <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/notification\" rel=\"noreferrer\">https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/notification<\/a><\/p>\n\n<p>Firefox has a short duration for notifications compared to Chrome. There is no way to control how long a notification is visible in Firefox.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1417816924713,"favorite_count":null,"last_activity_date":1417817512957,"last_edit_date":1417817512957,"last_editor_display_name":null,"last_editor_user_id":290887.0,"owner_display_name":null,"owner_user_id":290887.0,"parent_id":27324996,"post_type_id":2,"score":8,"tags":null,"view_count":null},{"index":137,"id":27273442,"title":null,"body":"<p>Try this:<\/p>\n\n<pre><code>...\nvarRBLSqlQuery := 'select count(*) from samples where samplecode= :1 and auditflag=0 and :2 ';\nexecute immediate varRBLSqlQuery into varResult using varSampleCode, varFilterString;\n...\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1417614721647,"favorite_count":null,"last_activity_date":1417614721647,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":296884.0,"parent_id":27273070,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":138,"id":27288516,"title":null,"body":"<p>My guess is that <code>p0<\/code> is <em>not<\/em> an integer, but rather a one-dimensional array.<\/p>\n\n<p>If that is correct, the macro would be calculating the \"sum\" of the <code>offset<\/code>th items in arrays <code>p0<\/code>, <code>p1<\/code>, <code>p2<\/code>, and <code>p3<\/code>, except that it's a strange sum because of all those <code>-<\/code> signs.<\/p>\n\n<p><strong>Edited: having now looked at the code in question<\/strong><\/p>\n\n<p>I find the code hard to follow, but let's try anyway:<\/p>\n\n<p>My conclusion is that <code>p0[offset]<\/code> is a pointer to a pixel in an image (an integer value). That pixel is one corner of a rectangle in the image. <code>p1[offset]<\/code>, <code>p2[offset]<\/code>, and <code>p3[offset]<\/code> are pointers to the pixels at the other corners of the same rectangle.<\/p>\n\n<p>In more detail...<\/p>\n\n<p><code>CALC_SUM_<\/code> is called by <code>CALC_SUM<\/code> which is called in a lot of places, such as in <code>HaarEvaluator::Feature :: calc<\/code>. <\/p>\n\n<p>In that <code>calc<\/code> function, <code>CALC_SUM<\/code> is called with <code>p[0]<\/code> as an argument. <code>p<\/code> is defined in <code>struct Feature<\/code> as <code>const int* p[RECT_NUM][4]<\/code>, so <code>p[0]<\/code> is an array of four pointers to <code>int<\/code>s.<\/p>\n\n<p>What might these four <code>int<\/code>s be? Well, they are undefined immediately after the <code>Feature<\/code> constructor is called, since the pointers are set to be NULL.<\/p>\n\n<p>But assuming <code>HaarEvaluator::Feature :: updatePtrs<\/code> has been called at some point, the pointers are updated by the <code>CV_TILTED_PTRS<\/code> or <code>CV_SUM_PTRS<\/code> macros. <\/p>\n\n<p>Both of those macros take a pointer to a <em>matrix<\/em> of values, which I assume is a matrix of pixels in an image (given the task at hand, which is finding a feature in an image). That pointer is called <code>titled<\/code> or <code>sum<\/code>. Let's work with <code>sum<\/code>. The four pointers in <code>p[0]<\/code> are set by <code>CV_SUM_PTRS<\/code> to point to four corners of a rectangle within <code>sum<\/code>.<\/p>\n\n<p>When the <code>calc<\/code> function is called, the four pointers (<code>p[0]<\/code> contains the four pointers to corners <code>p[0][0]<\/code>-<code>p[0][3]<\/code>) are passed in along with an offset. This offset is effectively added to each of the four pointers, using array notation, which shifts the rectangle around the image.<\/p>\n\n<p>The actual sum looks like it could be doing the fast computation described <a href=\"http:\/\/en.wikipedia.org\/wiki\/Haar-like_features#Fast_computation_of_Haar-like_features\" rel=\"nofollow\">here<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1417678318343,"favorite_count":null,"last_activity_date":1417844093850,"last_edit_date":1417844093850,"last_editor_display_name":null,"last_editor_user_id":4124887.0,"owner_display_name":null,"owner_user_id":4124887.0,"parent_id":27285068,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":139,"id":27325885,"title":null,"body":"<p>You can create a template specialization for <code>Foo&lt;0&gt;<\/code>.<\/p>\n\n<pre><code>template &lt;&gt;\nclass Foo&lt;0&gt; {\npublic:\n bool bar () { return true; }\n};\n<\/code><\/pre>\n\n<p>If you only want to address the issue with <code>bar<\/code> alone, and not touch any other part of <code>Foo<\/code>, you can create a companion method to avoid the issue:<\/p>\n\n<pre><code>template &lt;size_t N&gt;\nclass Foo\n{\n bool bar(int n) {\n if (n == 0) return true;\n return 5 \/ n == 1;\n }\npublic:\n bool bar() { return bar(N); }\n};\n<\/code><\/pre>\n\n<p>Or pull the implementation of that method out into its own class, and specialize that:<\/p>\n\n<pre><code>template &lt;size_t N&gt;\nclass Bar\n{\npublic:\n bool operator() const { return 5 \/ N == 1; }\n};\n\ntemplate &lt;&gt;\nclass Bar&lt;0&gt;\n{\npublic:\n bool operator() const { return true; }\n};\n\ntemplate &lt;size_t N&gt;\nclass Foo {\n bool bar() { return Bar&lt;N&gt;()(); }\n};\n<\/code><\/pre>\n\n<p>Alternatively, you can use Jarod42's suggestion, and specialize the method itself (answer reiterated here for completeness).<\/p>\n\n<pre><code>template &lt;size_t N&gt;\nclass Foo\n{\npublic:\n bool bar() { return 5 \/ N == 1; }\n};\n\ntemplate &lt;&gt; inline bool Foo&lt;0&gt;::bar() { return true; }\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1417819531123,"favorite_count":null,"last_activity_date":1418076191117,"last_edit_date":1418076191117,"last_editor_display_name":null,"last_editor_user_id":315052.0,"owner_display_name":null,"owner_user_id":315052.0,"parent_id":27325862,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":140,"id":27344323,"title":null,"body":"<p>It seems as if you come from another language and you insist in using loops when not strictly necessary. Stata does many things without explicit loops, precisely because commands already apply to all observations.<\/p>\n\n<p>One way is:<\/p>\n\n<pre><code>clear\nset more off\n\ninput \/\/\/\nID str15 AQ_ATC amountATC\n. \"A05\" 1\n123 \"A05AA02\" 2525\n234 \"A05AA02\" 2525\n991 \"A05AD39\" 190\n. \"C10\" 1\n441 \"C10AA11\" 4330\n229 \"C10AA22\" 3100\n. \"C05AA\" 1\n441 \"C05AA03\" 130\nend\n\n*----- what you want -----\n\nsort AQ_ATC ID\ngen grou = sum(missing(ID))\n\nbysort grou AQ_ATC: gen tosum = amountATC if _n == 1 &amp; !missing(ID)\nby grou: egen s = total(tosum)\n\nreplace amountATC = s if missing(ID)\n\nlist, sepby(grou)\n<\/code><\/pre>\n\n<h2>Edit<\/h2>\n\n<p>With your edit the same principles apply. Below code that adjusts to your change and slightly changes the code (one line less):<\/p>\n\n<pre><code>*----- what you want -----\n\nsort AQ_ATC\ngen grou = sum(missing(ID))\n\nbysort grou: gen s = sum(amountATC) if AQ_ATC != AQ_ATC[_n+1] &amp; !missing(ID)\nby grou: replace amountATC = s[_N] if missing(ID)\n<\/code><\/pre>\n\n<p>More efficient should be:<\/p>\n\n<pre><code>&lt;snip&gt;\n\nbysort grou: gen s = sum(amountATC) if AQ_ATC != AQ_ATC[_n+1]\nby grou: replace amountATC = s[_N] - 1 if missing(ID)\n<\/code><\/pre>\n\n<p>Some comments:<\/p>\n\n<ol>\n<li><p><code>sort<\/code> is a very handy command. If you sort the data by <code>AQ_ATC<\/code> they are arranged in such a way that the short (sub)strings are placed before corresponding long strings. <\/p><\/li>\n<li><p>The <code>by:<\/code> prefix is fundamental and very helpful, and I noticed you can use it after defining appropriate groups. I created the groups taking advantage of the fact that all short (sub)strings have a <code>missing(ID)<\/code>.<\/p><\/li>\n<li><p>Then (by the groups just defined) you only want to add up one value (observation) per <code>amountATC<\/code>. That's what the condition <code>if AQ_ATC != AQ_ATC[_n+1]<\/code> does.<\/p><\/li>\n<li><p>Finally, <code>replace<\/code> back into your original variable. I would usually <code>generate<\/code> a copy and work with that, so my original variable doesn't suffer.<\/p><\/li>\n<\/ol>\n\n<p>An excellent read for the <code>by:<\/code> prefix is <a href=\"http:\/\/www.stata-journal.com\/article.html?article=pr0004\" rel=\"nofollow\">Speaking Stata: How to move step by: step<\/a>, by Nick Cox.<\/p>\n\n<h2>Edit2<\/h2>\n\n<p>Yet another slightly different way:<\/p>\n\n<pre><code>*----- what you want -----\n\nsort AQ_ATC\ngen grou = sum(missing(ID))\n\negen t = tag(grou AQ_ATC)\nbysort grou: gen s = sum(amountATC * t)\n\nby grou: replace amountATC = s[_N] - 1 if missing(ID)\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1417966791600,"favorite_count":null,"last_activity_date":1417970369217,"last_edit_date":1417970369217,"last_editor_display_name":null,"last_editor_user_id":2077064.0,"owner_display_name":null,"owner_user_id":2077064.0,"parent_id":27344146,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":141,"id":27352631,"title":null,"body":"<p>Try this, don't forget to call:\ncreateContextMenu(viewer);<\/p>\n\n<pre><code>\/**\n * Creates the context menu\n *\n * @param viewer\n *\/\nprotected void createContextMenu(Viewer viewer) {\n MenuManager contextMenu = new MenuManager(\"#ViewerMenu\"); \/\/$NON-NLS-1$\n contextMenu.setRemoveAllWhenShown(true);\n contextMenu.addMenuListener(new IMenuListener() {\n @Override\n public void menuAboutToShow(IMenuManager mgr) {\n fillContextMenu(mgr);\n }\n });\n\n Menu menu = contextMenu.createContextMenu(viewer.getControl());\n viewer.getControl().setMenu(menu);\n}\n\n\/**\n * Fill dynamic context menu\n *\n * @param contextMenu\n *\/\nprotected void fillContextMenu(IMenuManager contextMenu) {\n contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));\n\n contextMenu.add(new Action(\"Do Something\") {\n @Override\n public void run() {\n \/\/ implement this\n }\n });\n contextMenu.add(new Action(\"Do Nothing\") {\n @Override\n public void run() {\n \/\/ don't do anything here\n }\n });\n contextMenu.add(new Action(\"Delete\") {\n @Override\n public void run() {\n \/\/ implement this\n }\n });\n}\n<\/code><\/pre>\n\n<p>To get the selected element of the treeviewer, do this:<\/p>\n\n<pre><code>IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();\nselection.getFirstElement();\nselection.toList(); \/\/ or if you handle multi selection\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1418020645530,"favorite_count":null,"last_activity_date":1418020645530,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2343011.0,"parent_id":27352206,"post_type_id":2,"score":8,"tags":null,"view_count":null},{"index":142,"id":27323536,"title":null,"body":"<p>It means the folder is defined as an Intellij Module.<\/p>\n\n<p>Complete list of Intellij icons: <a href=\"https:\/\/www.jetbrains.com\/idea\/help\/symbols.html\" rel=\"noreferrer\">https:\/\/www.jetbrains.com\/idea\/help\/symbols.html<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1417808797563,"favorite_count":null,"last_activity_date":1521120004990,"last_edit_date":1521120004990,"last_editor_display_name":null,"last_editor_user_id":3812888.0,"owner_display_name":null,"owner_user_id":3812888.0,"parent_id":27323450,"post_type_id":2,"score":20,"tags":null,"view_count":null},{"index":143,"id":27347686,"title":null,"body":"<p>You can do this by creating a list from the named vector of <code>var.labels<\/code> and assigning that to the <code>label<\/code> values. I've used <code>match<\/code> to ensure that values of <code>var.labels<\/code> are assigned to their corresponding column in <code>data<\/code> even if the order of <code>var.labels<\/code> is different from the order of the <code>data<\/code> columns.<\/p>\n\n<pre><code>library(Hmisc)\n\nvar.labels = c(age=\"Age in Years\", sex=\"Sex of the participant\")\n\nlabel(data) = as.list(var.labels[match(names(data), names(var.labels))])\n\nlabel(data)\n age sex \n \"Age in Years\" \"Sex of the participant\" \n<\/code><\/pre>\n\n<p><strong>Original Answer<\/strong><\/p>\n\n<p>My original answer used <code>lapply<\/code>, which isn't actually necessary. Here's the original answer for archival purposes:<\/p>\n\n<p>You can assign the labels using <code>lapply<\/code>:<\/p>\n\n<pre><code>label(data) = lapply(names(data), function(x) var.labels[match(x, names(var.labels))])\n<\/code><\/pre>\n\n<p><code>lapply<\/code> applies a function to each element of a list or vector. In this case the function is applied to each value of <code>names(data)<\/code> and it picks out the label value from <code>var.labels<\/code> that corresponds to the current value of <code>names(data)<\/code>. <\/p>\n\n<p>Reading through a few tutorials is a good way to get the general idea, but you'll really get the hang of it if you start using <code>lapply<\/code> in different situations and see how it behaves. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1417985598197,"favorite_count":null,"last_activity_date":1526078875767,"last_edit_date":1526078875767,"last_editor_display_name":null,"last_editor_user_id":496488.0,"owner_display_name":null,"owner_user_id":496488.0,"parent_id":27347548,"post_type_id":2,"score":24,"tags":null,"view_count":null},{"index":144,"id":27271432,"title":null,"body":"<p>Try looking at the following example: <a href=\"http:\/\/www.lornajane.net\/posts\/2011\/posting-json-data-with-php-curl\" rel=\"nofollow\">POSTing JSON Data With PHP cURL<\/a><\/p>\n\n<p>Useful excerpt:<\/p>\n\n<pre><code>$data = array(\"name\" =&gt; \"Hagrid\", \"age\" =&gt; \"36\"); \n$data_string = json_encode($data); \n\n$ch = curl_init('http:\/\/api.local\/rest\/users'); \ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\"); \ncurl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); \ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true); \ncurl_setopt($ch, CURLOPT_HTTPHEADER, array( \n 'Content-Type: application\/json', \n 'Content-Length: ' . strlen($data_string)) \n); \n\n$result = curl_exec($ch);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":6,"community_owned_date":null,"creation_date":1417608539647,"favorite_count":null,"last_activity_date":1417608539647,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1857053.0,"parent_id":27271314,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":145,"id":27362695,"title":null,"body":"<p>There might be a nicer way, but I usually do it like this:<\/p>\n\n<pre><code>from gi.repository import Gtk, Gdk, GLib\n\ndef run_dialog(_None):\n dialog = Gtk.FileChooserDialog(\"Please choose a folder\", None,\n Gtk.FileChooserAction.SELECT_FOLDER,\n (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,\n \"Select\", Gtk.ResponseType.OK))\n\n response = dialog.run()\n if response == Gtk.ResponseType.OK:\n print(\"Select clicked\")\n print(\"Folder selected: \" + dialog.get_filename())\n elif response == Gtk.ResponseType.CANCEL:\n print(\"Cancel clicked\")\n\n dialog.destroy()\n Gtk.main_quit()\n\n\nGdk.threads_add_idle(GLib.PRIORITY_DEFAULT, run_dialog, None)\nGtk.main()\n<\/code><\/pre>\n\n<p>This will call the <code>run_dialog<\/code> function as soon as the mainloop starts, which will display the dialog and then quit.<\/p>\n\n<p><strong>UPDATE:<\/strong> If you want to enclose that code in a function that returns the selected folder, you'll need to save the path to a non-local variable:<\/p>\n\n<pre><code>def run_folder_chooser_dialog():\n result= []\n\n def run_dialog(_None):\n dialog = Gtk.FileChooserDialog(\"Please choose a folder\", None,\n Gtk.FileChooserAction.SELECT_FOLDER,\n (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,\n \"Select\", Gtk.ResponseType.OK))\n\n response = dialog.run()\n if response == Gtk.ResponseType.OK:\n result.append(dialog.get_filename())\n else:\n result.append(None)\n\n dialog.destroy()\n Gtk.main_quit()\n\n\n Gdk.threads_add_idle(GLib.PRIORITY_DEFAULT, run_dialog, None)\n Gtk.main()\n return result[0]\n<\/code><\/pre>\n\n<p>In python 3, you can use <code>nonlocal result<\/code> and <code>result= dialog.get_filename()<\/code> instead of the ugly list reference.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":6,"community_owned_date":null,"creation_date":1418057112767,"favorite_count":null,"last_activity_date":1418130769637,"last_edit_date":1418130769637,"last_editor_display_name":null,"last_editor_user_id":1222951.0,"owner_display_name":null,"owner_user_id":1222951.0,"parent_id":27356890,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":146,"id":27331432,"title":null,"body":"<p>Ahh!!! What is so typical about it!<\/p>\n\n<p>In your inner loops,you have variables named i &amp; j,so you figured out easily the complexity.<\/p>\n\n<p>Just with an addition of <code>EDGE<\/code> variable which is not at all different from the other 2,you have got confused! Check the number of iterations!!!<\/p>\n\n<p>The outer-loop would run <code>VERTICES-1<\/code> iterations.<\/p>\n\n<p>Therefore, complexity = (VERTICES-1) * (VERTICES) *(VERTICES) = (VERTICES^3) - (VERTICES^2).<\/p>\n\n<p>Program's complexity would be O(Vertices^3) OR O(n^3) where n=vertices...<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":6,"community_owned_date":null,"creation_date":1417867091463,"favorite_count":null,"last_activity_date":1417867091463,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3482140.0,"parent_id":27331394,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":147,"id":27356573,"title":null,"body":"<p>When you want to use already existing resources in a CloudFormation template, you can use the previously created ids, instead of Ref or GetAtt.<\/p>\n\n<p>In your example, you can use:<\/p>\n\n<blockquote>\n <p>{ \"EC2SecurityGroupId\": \"sg-xxxNNN\" }<\/p>\n<\/blockquote>\n\n<p>where \"sg-xxxNNN\" is the id of your DB SecurityGroup (not sure of the DB SecurityGroup prefix, since we don't use EC2-classic but VPC).<\/p>\n\n<p>I would recommend using a parameter for your SecurityGroup in your template.<\/p>\n\n<p>*** update **<\/p>\n\n<p>For your specific setup, I would use a \"DBSecurityGroupIngress\" resource, to add a new sg to your RDS instance.<\/p>\n\n<p>In your first stack (RDS), you create an empty DBSecurityGroup like this:<\/p>\n\n<pre><code>\"DBSecurityGroup\": {\n \"Type\": \"AWS::RDS::DBSecurityGroup\",\n\n \"Properties\": {\n \"EC2VpcId\" : { \"Ref\" : \"VpcId\" },\n \"DBSecurityGroupIngress\": [],\n \"GroupDescription\" : \"Frontend Access\"\n }\n}\n<\/code><\/pre>\n\n<p>This DBSecurityGroup is refered to by the DBInstance. (I guess you have specific requisites for using DBSecurityGroup instead of VPCSecurityGroup).<\/p>\n\n<p>In your App stack, you create a DBSecurityGroupIngress resource, which is a child of the DBSecurityGroup your created in the first stack:<\/p>\n\n<pre><code>\"specialRDSRule\" : {\n \"Type\":\"AWS::RDS::DBSecurityGroupIngress\",\n \"Properties\" : {\n \"DBSecurityGroupName\": \"&lt;the arn of the DBSecurityGroup&gt;\", \n \"CIDRIP\": String,\n \"EC2SecurityGroupId\": String,\n \"EC2SecurityGroupName\": String,\n \"EC2SecurityGroupOwnerId\": String\n } \n}\n<\/code><\/pre>\n\n<p>You need the arn of the DBSecurityGroup, which is \"arn:aws:rds:::secgrp:\". The other parameters come from your App stack, not sure if you need everything (I don't do EC2-classic security groups, only VPC). <\/p>\n\n<p>Reference : <a href=\"http:\/\/docs.aws.amazon.com\/AWSCloudFormation\/latest\/UserGuide\/aws-resource-rds-security-group-ingress.html\" rel=\"nofollow\">http:\/\/docs.aws.amazon.com\/AWSCloudFormation\/latest\/UserGuide\/aws-resource-rds-security-group-ingress.html<\/a><\/p>\n\n<p>We use the same mechanism with VPC SecurityGroups, with Ingress &amp; Egress rules, so we can have two SG reference each-other.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":6,"community_owned_date":null,"creation_date":1418036643823,"favorite_count":null,"last_activity_date":1418046854320,"last_edit_date":1418046854320,"last_editor_display_name":null,"last_editor_user_id":579590.0,"owner_display_name":null,"owner_user_id":579590.0,"parent_id":27356427,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":148,"id":27350446,"title":null,"body":"<ul>\n<li>Set the \"main\" containers layout manager to <code>BorderLayout<\/code><\/li>\n<li>On to this, add the <code>GameInterface<\/code> in the <code>BorderLayout.CENTER<\/code> position<\/li>\n<li>Create another (\"interaction\") container and set it's layout manager to <code>BorderLayout<\/code>, add this to the \"main\" container's <code>BorderLayout.SOUTH<\/code> position<\/li>\n<li>Wrap the <code>JTextArea<\/code> in a <code>JScrollPane<\/code> and add it to the <code>BorderLayout.CENTER<\/code> position of your \"interaction\" container<\/li>\n<li>Create another container (\"message\"), this could use a <code>GridBagLayout<\/code>. On to this add the <code>JTextField<\/code> (with <code>GridBagConstraints#weightx<\/code> set to <code>0<\/code> and <code>GridBagConstraints#weightx<\/code> set to <code>1<\/code>) and add the button to the next cell (<code>GridBagConstraints#gridx<\/code> set to <code>1<\/code> and <code>GridBagConstraints#weightx<\/code> set to <code>0<\/code>)<\/li>\n<\/ul>\n\n<p>For more details, see:<\/p>\n\n<ul>\n<li><a href=\"http:\/\/docs.oracle.com\/javase\/tutorial\/uiswing\/layout\/index.html\" rel=\"nofollow noreferrer\">Laying Out Components Within a Container<\/a><\/li>\n<li><a href=\"http:\/\/docs.oracle.com\/javase\/tutorial\/uiswing\/components\/border.html\" rel=\"nofollow noreferrer\">How to Use Borders<\/a><\/li>\n<li><a href=\"http:\/\/docs.oracle.com\/javase\/tutorial\/uiswing\/layout\/gridbag.html\" rel=\"nofollow noreferrer\">How to Use GridBagLayout<\/a><\/li>\n<\/ul>\n\n<p><strong>Note:<\/strong><\/p>\n\n<p><code>Graphics g = getGraphics();<\/code> is NOT how custom painting should be done. Instead, override the <code>paintComponent<\/code> of a component like <code>JPanel<\/code> and perform your custom painting there!<\/p>\n\n<p>For more details see<\/p>\n\n<ul>\n<li><a href=\"http:\/\/www.oracle.com\/technetwork\/java\/painting-140037.html\" rel=\"nofollow noreferrer\">Painting in AWT and Swing<\/a><\/li>\n<li><a href=\"http:\/\/docs.oracle.com\/javase\/tutorial\/uiswing\/painting\/\" rel=\"nofollow noreferrer\">Performing Custom Painting<\/a><\/li>\n<\/ul>\n\n<p><strong>Example<\/strong><\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/MbLuU.png\" alt=\"Test layout\"><\/p>\n\n<pre><code>import java.awt.BorderLayout;\nimport java.awt.Color;\nimport java.awt.Dimension;\nimport java.awt.EventQueue;\nimport java.awt.Graphics;\nimport java.awt.Graphics2D;\nimport java.awt.GridBagConstraints;\nimport java.awt.GridBagLayout;\nimport javax.swing.JButton;\nimport javax.swing.JFrame;\nimport javax.swing.JPanel;\nimport javax.swing.JScrollPane;\nimport javax.swing.JTextArea;\nimport javax.swing.JTextField;\nimport javax.swing.UIManager;\nimport javax.swing.UnsupportedLookAndFeelException;\n\npublic class Test {\n\n public static void main(String[] args) {\n new Test();\n }\n\n public Test() {\n EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() {\n try {\n UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());\n } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {\n ex.printStackTrace();\n }\n\n JPanel master = new JPanel(new BorderLayout());\n master.setBackground(Color.BLUE);\n\n JPanel gameInterface = new JPanel() {\n @Override\n public Dimension getPreferredSize() {\n return new Dimension(400, 400);\n }\n };\n gameInterface.setBackground(Color.MAGENTA);\n\n master.add(gameInterface);\n\n JPanel interactions = new JPanel(new BorderLayout());\n interactions.add(new JScrollPane(new JTextArea(5, 20)));\n\n JTextField field = new JTextField(15);\n JButton btn = new JButton(\"Button\");\n\n JPanel message = new JPanel(new GridBagLayout());\n GridBagConstraints gbc = new GridBagConstraints();\n gbc.gridx = 0;\n gbc.weightx = 1;\n gbc.fill = GridBagConstraints.HORIZONTAL;\n message.add(field, gbc);\n gbc.gridx = 1;\n gbc.weightx = 0;\n message.add(btn, gbc);\n\n interactions.add(message, BorderLayout.SOUTH);\n\n master.add(interactions, BorderLayout.SOUTH);\n\n JFrame frame = new JFrame(\"Testing\");\n frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n frame.add(master);\n frame.pack();\n frame.setLocationRelativeTo(null);\n frame.setVisible(true);\n }\n });\n }\n\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":6,"community_owned_date":null,"creation_date":1418005296917,"favorite_count":null,"last_activity_date":1418006442707,"last_edit_date":1418006442707,"last_editor_display_name":null,"last_editor_user_id":992484.0,"owner_display_name":null,"owner_user_id":992484.0,"parent_id":27350393,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":149,"id":27291692,"title":null,"body":"<p>I would probably stream indexes here:<\/p>\n\n<pre><code>IntStream.range(0, text.size())\n .map(i -&gt; text.get(i) + password.get(i % password.size())\n .toArray();\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":6,"community_owned_date":null,"creation_date":1417689059880,"favorite_count":null,"last_activity_date":1417694173893,"last_edit_date":1417694173893,"last_editor_display_name":null,"last_editor_user_id":829571.0,"owner_display_name":null,"owner_user_id":829571.0,"parent_id":27291443,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":150,"id":27278484,"title":null,"body":"<p>You would need to do something like <code>dbAdapter = new DatabaseAdapter()<\/code> before calling <code>dbAdapter.open();<\/code><\/p>\n\n<p>Null pointer exceptions usually occur when you try to use a reference(<code>dbAdapter<\/code> in this case) that points to nothing in the memory, i.e. you haven't yet create anything for the reference to point to.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":7,"community_owned_date":null,"creation_date":1417629492050,"favorite_count":null,"last_activity_date":1417629492050,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":71724.0,"parent_id":27278394,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":151,"id":27337323,"title":null,"body":"<p>If you don't mind the vertical lines, it's really simple to just use the <code>stairs(x,t)<\/code> function. Otherwise you can create your own function that deals with pairs of points to generate lines and plot them all individually using <code>hold on<\/code>.<\/p>\n\n<pre><code>function stairs2(x,y)\n hold on;\n for i=1:length(x)-1\n plot(x(i:i+1),[y(i) y(i)]);\n end\n hold off;\nend\n<\/code><\/pre>\n\n<p>Then just call <code>stairs2(x,t)<\/code> as per your example above, and set appropriate zoom\/axes.<\/p>\n\n<p>Alternately, this is a different way that only uses ONE call to plot:<\/p>\n\n<pre><code>function stairs2(x,y)\n for i=1:length(x)-1\n A(:,i) = [x(i) x(i+1)];\n B(:,i) = [y(i) y(i)];\n end\n plot(A,B,'b');\nend\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":7,"community_owned_date":null,"creation_date":1417904965117,"favorite_count":null,"last_activity_date":1417916303510,"last_edit_date":1417916303510,"last_editor_display_name":null,"last_editor_user_id":2163727.0,"owner_display_name":null,"owner_user_id":2163727.0,"parent_id":27337070,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":152,"id":27350565,"title":null,"body":"<p>to create a query string, you should try using <code>$(this).serialize()<\/code> instead of serialize array.<\/p>\n\n<pre><code>$('#create-event form').submit(function(e) {\n var postData = $(this).serialize();\n var formURL = $(this).attr('action');\n $.ajax({\n url : formURL,\n type: 'POST',\n data : postData,\n contentType: 'text\/plain'\n });\n e.preventDefault();\n});\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":7,"community_owned_date":null,"creation_date":1418006238200,"favorite_count":null,"last_activity_date":1418006238200,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1708868.0,"parent_id":27350518,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":153,"id":27375905,"title":null,"body":"<p>There are several possible ways to do this. Really wide field for research.<\/p>\n\n<p><strong>Overwrite headers for each navigation<\/strong> <\/p>\n\n<p>Hook <code>Navigating<\/code> event, cancel it and call <code>Navigate<\/code> with required headers (and do not cancel this event:)<\/p>\n\n<p>You can even <a href=\"https:\/\/stackoverflow.com\/a\/9036593\/731115\">load data outside of WebBrowser control<\/a>.<\/p>\n\n<p><strong>Change headers before navigation<\/strong><\/p>\n\n<p>If you don't like the idea of cancelling requests and then reissuing them, then you can try to hook <code>Navigating<\/code> event and update headers.<\/p>\n\n<p>Here is the problem: IWebBrower2 control itself provides headers as an argument for <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa768280(v=vs.85).aspx\" rel=\"nofollow noreferrer\">BeforeNavigate event<\/a>. But when .NET code <a href=\"http:\/\/referencesource.microsoft.com\/#System.Windows.Forms\/winforms\/Managed\/System\/WinForms\/WebBrowser.cs,0560e02bd80c678b,references\" rel=\"nofollow noreferrer\">handles this event<\/a>, headers are not exposed in <code>WebBrowserNavigatingEventArgs<\/code> for a client code.<\/p>\n\n<p>Possible solution is that you create own version of WebBrowserEvent, subclass WebBrowser control, override CreateSink method to connect your version of WebBrowserEvent. This version should handle headers correctly. <\/p>\n\n<p>So you'd be able to change headers before navigation.<\/p>\n\n<p><strong>Adjust Javascript side<\/strong> - somewhat fuzzier.<\/p>\n\n<p>You can connect browser application with client-side via <code>WebBrowser.ObjectForScripting<\/code> property - it is available for Javascript objects as <code>window.external<\/code>.<\/p>\n\n<p>You can hook links click events, or build own approach about how to notify external object about navigation need. <\/p>\n\n<p>Then you'll be able to perform all navigations from .NET side, specifying headers as needed.<\/p>\n\n<p><strong>System Proxy<\/strong> <\/p>\n\n<p>Set up local proxy (you can experiment with Fiddler). You'll be able to make any headers manipulation you wish. The only issue that WebBrowser control would use proxy from IE configuration.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":8,"community_owned_date":null,"creation_date":1418118706420,"favorite_count":null,"last_activity_date":1418118706420,"last_edit_date":1495541603513,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":731115.0,"parent_id":27346137,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":154,"id":27314380,"title":null,"body":"<p>You are getting error because in <code>getJsonData<\/code> you pass required data as first argument to the callback. That is reserved for possible errors. <\/p>\n\n<p>In your case the callback isn't needed. Looking at <a href=\"https:\/\/github.com\/colynb\/gulp-data#usage\" rel=\"nofollow\">gulp-data usage example<\/a> this should work: <\/p>\n\n<pre><code>.pipe(data(function(file) {\n return require('.\/data\/' + path.basename(file.path) + '.json');\n}))\n<\/code><\/pre>\n\n<p>Full example:<\/p>\n\n<pre><code>var gulp = require('gulp');\nvar jade = require('gulp-jade');\nvar data = require('gulp-data');\nvar path = require('path');\nvar fs = require('fs');\n\ngulp.task('jade', function() {\n return gulp.src('*.jade')\n .pipe(data(function(file) {\n return require('.\/data\/' + path.basename(file.path) + '.json');\n }))\n .pipe(jade({ pretty: true }))\n .pipe(gulp.dest('build\/'));\n});\n<\/code><\/pre>\n\n<p>Use this if you're running the task on <code>gulp.watch<\/code>:<\/p>\n\n<pre><code>.pipe(data(function(file) {\n return JSON.parse(fs.readFileSync('.\/data\/' + path.basename(file.path) + '.json'));\n}))\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":8,"community_owned_date":null,"creation_date":1417777185120,"favorite_count":null,"last_activity_date":1417789370370,"last_edit_date":1417789370370,"last_editor_display_name":null,"last_editor_user_id":516256.0,"owner_display_name":null,"owner_user_id":516256.0,"parent_id":27313107,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":155,"id":27364138,"title":null,"body":"<p>Message acknowledgement is covered <a href=\"http:\/\/socket.io\/docs\/#sending-and-getting-data-(acknowledgements)\" rel=\"nofollow noreferrer\">here in the socket.io docs<\/a>. Here's the relevant part of that docs:<\/p>\n\n<blockquote>\n <p>Sometimes, you might want to get a callback when the client confirmed\n the message reception.<\/p>\n \n <p>To do this, simply pass a function as the last parameter of .send or\n .emit. What\u2019s more, when you use .emit, the acknowledgement is done by\n you, which means you can also pass data along:<\/p>\n \n <p>Server (app.js)<\/p>\n\n<pre><code>var io = require('socket.io').listen(80);\n\nio.sockets.on('connection', function (socket) {\n socket.on('ferret', function (name, fn) {\n fn('woot');\n });\n});\n<\/code><\/pre>\n \n <p>Client (index.html)<\/p>\n\n<pre><code>&lt;script&gt;\n var socket = io(); \/\/ TIP: io() with no args does auto-discovery\n socket.on('connect', function () { \/\/ TIP: you can avoid listening on `connect` and listen on events directly too!\n socket.emit('ferret', 'tobi', function (data) {\n console.log(data); \/\/ data will be 'woot'\n });\n });\n&lt;\/script&gt;\n<\/code><\/pre>\n<\/blockquote>\n\n<p>And, another example shown here: <a href=\"https:\/\/stackoverflow.com\/questions\/20417569\/acknowledgment-for-socket-io-custom-event\">Acknowledgment for socket.io custom event<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":11,"community_owned_date":null,"creation_date":1418062103327,"favorite_count":null,"last_activity_date":1418062103327,"last_edit_date":1495535609007,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":816620.0,"parent_id":27359868,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":156,"id":27402508,"title":null,"body":"<p>Found it here: <a href=\"http:\/\/ws.apache.org\/wss4j\/config.html\" rel=\"nofollow\">http:\/\/ws.apache.org\/wss4j\/config.html<\/a>\nLook under Configuration tags, there's a list with all of them.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418218921990,"favorite_count":null,"last_activity_date":1418218921990,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1524366.0,"parent_id":27273860,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":157,"id":27421845,"title":null,"body":"<p>The solution is to turn on the online mode or switch to the cached mode.<\/p>\n\n<blockquote>\n <p>Outlook caches the email address once an email is sent and shows suggestions the next time I try to enter in the TO field.<\/p>\n<\/blockquote>\n\n<p>Check out the associated content of the Inbox folder. I think there you will find the required entries. You may use any low-level (Extended MAPI) property viewer such as MFCMAPI or OutlookSpy for observing the hidden content.<\/p>\n\n<p>Also you may find the How to configure how the Offline Address Book is downloaded when you use Outlook in Cached Exchange Mode article helpful.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418297476387,"favorite_count":null,"last_activity_date":1418297476387,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1603351.0,"parent_id":27415957,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":158,"id":27430445,"title":null,"body":"<p>This bug was fixed in Reflexil v1.9. It was related to an improper corlib type import.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418324581367,"favorite_count":null,"last_activity_date":1418324581367,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":218551.0,"parent_id":27300592,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":159,"id":27449830,"title":null,"body":"<p>There is a problem in login manager. remember_me services aren't public in SF2.3. So this code doesn't work<\/p>\n\n<p><a href=\"https:\/\/github.com\/FriendsOfSymfony\/FOSUserBundle\/blob\/master\/Security\/LoginManager.php\" rel=\"nofollow\">https:\/\/github.com\/FriendsOfSymfony\/FOSUserBundle\/blob\/master\/Security\/LoginManager.php<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418408863823,"favorite_count":null,"last_activity_date":1418408863823,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3140396.0,"parent_id":27449110,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":160,"id":27454499,"title":null,"body":"<p>I ended up doing this it is more of a workaround but it works:<\/p>\n\n<pre><code>m = 0\ndef musica():\n global m\n if m == 0:\n music.play(loops=-1)\n m = 1\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418433223837,"favorite_count":null,"last_activity_date":1418433223837,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4126549.0,"parent_id":27450995,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":161,"id":27455538,"title":null,"body":"<p>The query that you want is a join of the tables:<\/p>\n\n<pre><code>select w.wsn, ssn.name, ssn.city\nfrom store_worker sw join\n worker_detail w\n on sw.wsn = w.wsn join\n store_name s\n on sw.ssn = s.ssn\nwhere w.name = $WORKERNAME;\n<\/code><\/pre>\n\n<p>The <code>where<\/code> clause compares the worker name to the input worker name.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418444739480,"favorite_count":null,"last_activity_date":1418444739480,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1144035.0,"parent_id":27455520,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":162,"id":27458725,"title":null,"body":"<p>Simplified Answer:<\/p>\n\n<p>I've omitted some database checking etc to keep it short.<\/p>\n\n<p><strong>Billing.php<\/strong><\/p>\n\n<pre><code> &lt;?php\n $con = mysqli_connect(\"MyWebsite.localdomain\",\"root\",\"shekhar123\",\"test_youtube\");\n $sql = \"select DISTINCT CompanyName from mobile_data\";\n $retval = mysqli_query($con,$sql);\n ?&gt;\n\n&lt;form method=\"POST\"&gt;\n &lt;select name=\"companyname\" onchange=\"companysortlist(this.value)\"&gt;\n &lt;option value=''&gt;Select a Mobile:&lt;\/option&gt;\n &lt;?php \n while($row = mysqli_fetch_array($retval)){\n echo \"&lt;option value='\".$row['CompanyName'].\"'&gt;\".$row['CompanyName'].\"&lt;\/option&gt;\";\n }\n ?&gt;\n &lt;\/select&gt;\n\n &lt;select name=\"modelname\" class=\"companymodelname\"&gt;\n &lt;!-- note the select is completely empty, it will be fill by ajax --&gt;\n &lt;\/select&gt;\n&lt;\/form&gt;\n\n&lt;script&gt;\nfunction companysortlist(data){\n $.ajax({\n type: 'POST',\n url: 'ajax.php',\n data: \"ajaxcompanyname=\" + data,\n success: function (data) {\n $('.companymodelname').html(data);\n }\n });\n}\n&lt;\/script&gt;\n<\/code><\/pre>\n\n<p><strong>ajax.php<\/strong><\/p>\n\n<pre><code>&lt;?php\n $con = mysqli_connect(\"MyWebsite.localdomain\",\"root\",\"shekhar123\",\"test_youtube\");\n $sql = \"select DISTINCT ModelName from mobile_data where CompanyName='\".$_POST['ajaxcompanyname'].\"'\";\n $retval = mysqli_query($con,$sql);\n\n\n while($row = mysqli_fetch_array($retval)){\n echo \"&lt;option value='\".$row['ModelName'].\"'&gt;\".$row['ModelName'].\"&lt;\/option&gt;\";\n }\n ?&gt;\n<\/code><\/pre>\n\n<p>Please note <\/p>\n\n<p>I still have not fixed any of the sql injection vulnerabilities in your code<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418473409767,"favorite_count":null,"last_activity_date":1418473409767,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2578037.0,"parent_id":27431494,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":163,"id":27470446,"title":null,"body":"<p>StudenciService in the constructor should be iStudenciService because you want to inject not the concrete implementation but the interface.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418568420533,"favorite_count":null,"last_activity_date":1418568420533,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3669613.0,"parent_id":27470387,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":164,"id":27484695,"title":null,"body":"<p>I figured it out. I used angularUpload to emulate the form and used a getter to generate blob url as I require. Thanks a lot<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418648455957,"favorite_count":null,"last_activity_date":1418648455957,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2128340.0,"parent_id":27419210,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":165,"id":27484750,"title":null,"body":"<p>According to the <code>Form Maker<\/code> extension the only possible solution to change the HTML markup of the form elements, it's only to rewriting the whole script for your needs. <\/p>\n\n<p>Wouldn't recommend to use this script, even Premium version.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418648616560,"favorite_count":null,"last_activity_date":1418648616560,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2843137.0,"parent_id":27357123,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":166,"id":27485414,"title":null,"body":"<p>After successful login you must store a flag in the HttpSession object. After you can implement a filter for control access. <\/p>\n\n<p>Here an example: <a href=\"http:\/\/www.journaldev.com\/1933\/java-servlet-filter-example-tutorial\" rel=\"nofollow\">http:\/\/www.journaldev.com\/1933\/java-servlet-filter-example-tutorial<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418650859607,"favorite_count":null,"last_activity_date":1418650859607,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":426812.0,"parent_id":27450163,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":167,"id":27492166,"title":null,"body":"<p>So this took me 2 days to figure out. Here is what I came up with:<\/p>\n\n<ul>\n<li>PHP 5.3.8 with FastCGI on IIS7.x can not handle PUT requests with chunked encoding data<\/li>\n<li>Apparently, IIS indicates a negative content size to PHP (-1), which then tries to read a large number of bytes (-1 casted to uint) from the HTTP request stream<\/li>\n<li>as the client does not send that many bytes, the read does not succeed<\/li>\n<li>as the client however does not close the HTTP request stream either, PHP waits endlessly for input never to come<\/li>\n<li>after a very long time (60 minutes on my machine), IIS terminates the PHP request execution<\/li>\n<\/ul>\n\n<p>To work around this issue (which should be fixed in PHP in my opinion), I created an HTTP request handler for IIS, coded in C#. Here it is:<\/p>\n\n<pre><code>using System.Web;\nusing System.IO;\nusing System.Text;\nusing System;\n\nnamespace handler\n{\n public class PutHandler : IHttpHandler\n {\n string path = \"C:\\\\inetpub\\\\wwwroot\\\\put\\\\log\\\\mylog.txt\";\n\n private void log(string line)\n {\n FileStream log;\n StreamWriter stream;\n log = File.Open(path, FileMode.Append);\n stream = new StreamWriter(log);\n stream.WriteLine(line);\n stream.Flush();\n stream.Close();\n }\n\n public static byte[] Combine(byte[] first, byte[] second)\n {\n byte[] ret = new byte[first.Length + second.Length];\n Buffer.BlockCopy(first, 0, ret, 0, first.Length);\n Buffer.BlockCopy(second, 0, ret, first.Length, second.Length);\n return ret;\n }\n\n public PutHandler()\n {\n log(\"PutHandler()\");\n }\n ~PutHandler()\n {\n log(\"~PutHandler()\");\n }\n\n \/\/ This handler is called whenever a file ending \n \/\/ in .put is requested. A file with that extension\n \/\/ does not need to exist.\n public void ProcessRequest(HttpContext context)\n {\n log(\"ProcessRequest()\");\n\n HttpRequest Request = context.Request;\n HttpResponse Response = context.Response;\n\n\n log(\"size \" + context.Request.ContentLength);\n log(\"size \" + context.Request.HttpMethod);\n byte[] allbytes = new byte[0];\n \/\/ context.Request.ContentLength is 0 for chunked encodings :-(\n while (true)\n {\n byte[] bytes = context.Request.BinaryRead(1024);\n if (bytes.Length &lt;= 0) break;\n allbytes = PutHandler.Combine(allbytes, bytes);\n }\n log(\"Total \" + allbytes.Length + \" bytes in request\");\n Response.StatusCode = 200;\n\n string uri = \"http:\/\/\" + Request.ServerVariables[\"SERVER_NAME\"] + Request.RawUrl.Replace(\".put\", \".php\");\n log(\"pushing back to \" + uri);\n\n \/\/ now pushback to original target URL\n var client = new System.Net.WebClient();\n Response.BinaryWrite(client.UploadData(uri, \"PUT\", allbytes));\n\n log(\"RequestHandler done\");\n }\n public bool IsReusable\n {\n \/\/ To enable pooling, return true here.\n \/\/ This keeps the handler in memory.\n get { return false; }\n }\n }\n}\n<\/code><\/pre>\n\n<p>The handler needs to be made known to IIS. To do this, you need to supply a web.config in the appropriate application directory as follows:<\/p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;configuration&gt;\n &lt;system.webServer&gt;\n &lt;modules&gt;\n &lt;remove name=\"WebDAVModule\" \/&gt;\n &lt;\/modules&gt;\n &lt;handlers&gt;\n &lt;remove name=\"WebDAV\" \/&gt;\n &lt;add name=\"PutHandler\" path=\"*.put\" verb=\"PUT\" type=\"handler.PutHandler, PutHandler\"\n requireAccess=\"Script\" \/&gt;\n &lt;\/handlers&gt;\n &lt;\/system.webServer&gt;\n&lt;\/configuration&gt;\n<\/code><\/pre>\n\n<p>This is removing the standard WebDav modules\/handlers, as we do not want them here. Then it adds a new handler (the binaries of which need to be installed in the web application's bin folder). This handler is called for all URIs with the .put suffix and only for PUT requests. For this to work, the applications application-pool must be in the \"integrated\" mode.<\/p>\n\n<p>What the handler does is to collect the chunked data (which works fine in C#) and then to re-send all the data (body and relative URI including all query args) to the same virtual server with the \".put\" suffix changed to \".php\". As this is now sent in a single step, no chunked encoding is used and the receiving PHP code works fine.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418673764890,"favorite_count":null,"last_activity_date":1418715585150,"last_edit_date":1418715585150,"last_editor_display_name":null,"last_editor_user_id":4355471.0,"owner_display_name":null,"owner_user_id":4355471.0,"parent_id":27451882,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":168,"id":27493766,"title":null,"body":"<p>Several scroll events are being triggered, causing these animations to queue, which could cause a long delay before the navbar changes height.\nTry clearing the timer each time it's triggered.<\/p>\n\n<pre><code>var scrollTimer = null;\n$(window).scroll(function() {\n var top = $(document).scrollTop(); \/\/ use document (suggested by seva.rubbo)\n \/\/ use local var (suggested by Sam Battat)\n\n clearTimeout(scrollTimer);\n scrollTimer = setTimeout(\n function() \n {\n if(top == 0)\n {\n $(\".navbar\").animate({height:'70px'});\n }\n else\n {\n $(\".navbar\").animate({height:'43px'});\n }\n }, 100);\n});\n<\/code><\/pre>\n\n<p>Fiddle: <a href=\"http:\/\/jsfiddle.net\/jzsxjw7o\/1\/\" rel=\"nofollow\">http:\/\/jsfiddle.net\/jzsxjw7o\/1\/<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418680070083,"favorite_count":null,"last_activity_date":1418680070083,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1208018.0,"parent_id":27493399,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":169,"id":27502885,"title":null,"body":"<p>Here is a workaround: I set a smaller border-radius for the inner rectangle (orange bar), to hide the blurry leaking part of the parents (black background) rounded border. I'll mark this question as solved as the workaround is good enough for my purpose. Sadly this issue remains a bug\/flaw in CSS.<\/p>\n\n<p>Edit: Alright, have to wait 2 days before I can actually close it. Please don't delete it again.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418726982200,"favorite_count":null,"last_activity_date":1418726982200,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3741162.0,"parent_id":27499511,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":170,"id":27503686,"title":null,"body":"<p>byte[] is not initialized. So we need to initialize before we use it . <\/p>\n\n<pre><code>byte[] b = new byte[a.length()];\n\ntry this\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418729612843,"favorite_count":null,"last_activity_date":1418731146100,"last_edit_date":1418731146100,"last_editor_display_name":null,"last_editor_user_id":1866426.0,"owner_display_name":null,"owner_user_id":1866426.0,"parent_id":27503637,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":171,"id":27510213,"title":null,"body":"<p>I've detected the problem. This is a caused by the new version of the library. Using the old version[stable] solved it.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418750154473,"favorite_count":null,"last_activity_date":1418750154473,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1179581.0,"parent_id":27501539,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":172,"id":27519714,"title":null,"body":"<p>I figured out the solution to the problem. In rails 4, when you load jquery, you have to add the gem \"jquery-turbolinks\" to your Gemfile. Then load:<\/p>\n\n<pre><code>\/\/= require jquery.turbolinks\n<\/code><\/pre>\n\n<p>in your application.js file. This line has to come AFTER \"\/\/= require jquery\" and BEFORE \"\/\/= require turbolinks\". After that, jquery-mobile works fine in rails 4<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418798484583,"favorite_count":null,"last_activity_date":1418798484583,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":573541.0,"parent_id":27517664,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":173,"id":27562141,"title":null,"body":"<p>Just figured out the solution. It seems the array \"yo\" had some null values in the latter indices. That was the reason a null pointer exception was being thrown. So what I did was<\/p>\n\n<pre><code> List&lt;String&gt; list = new ArrayList&lt;String&gt;(Arrays.asList(y));\n list.removeAll(Collections.singleton(null));\n String[]yo=list.toArray(new String[list.size()]);\n<\/code><\/pre>\n\n<p>And the dialog builder works perfectly :D<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418977318530,"favorite_count":null,"last_activity_date":1418977318530,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3309901.0,"parent_id":27561341,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":174,"id":27575813,"title":null,"body":"<p>ummm<\/p>\n\n<pre><code>class EditableListCtrl(wx.ListCtrl, listmix.TextEditMixin,listmix.CheckListCtrlMixin):\n ''' TextEditMixin allows any column to be edited. '''\n\n #----------------------------------------------------------------------\n def __init__(self, parent, ID=wx.ID_ANY, pos=wx.DefaultPosition,\n size=wx.DefaultSize, style=0):\n \"\"\"Constructor\"\"\"\n wx.ListCtrl.__init__(self, parent, ID, pos, size, style)\n listmix.TextEditMixin.__init__(self)\n listmix.CheckListCtrlMixin.__init__(self)\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419035589423,"favorite_count":null,"last_activity_date":1419035589423,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":541038.0,"parent_id":27575693,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":175,"id":27583372,"title":null,"body":"<p>I resolved the porblem by upgrading Symfony from 2.5 to 2.6 version.\nNow the annotation constraint @Assert\\Collection works perfectly.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419102051233,"favorite_count":null,"last_activity_date":1419102051233,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1957159.0,"parent_id":27556073,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":176,"id":27587980,"title":null,"body":"<p>You have to change your style, using a Theme.AppCompat theme (Light,DartActionBar, NoActionBar..)<\/p>\n\n<pre><code> &lt;!-- Base application theme. --&gt;\n&lt;style name=\"AppBaseTheme\" parent=\"Theme.AppCompat.Light\"&gt; \n\n &lt;!-- colorPrimary is used for the default action bar background --&gt;\n &lt;item name=\"colorPrimary\"&gt;@color\/primary&lt;\/item&gt;\n\n &lt;!-- colorPrimaryDark is used for the status bar --&gt;\n &lt;item name=\"colorPrimaryDark\"&gt;@color\/primary_dark&lt;\/item&gt;\n\n &lt;!-- colorAccent is used as the default value for colorControlActivated\n which is used to tint widgets --&gt;\n &lt;item name=\"colorAccent\"&gt;@color\/accent&lt;\/item&gt;\n&lt;\/style&gt;\n<\/code><\/pre>\n\n<p>Also, if you would like to customize the text and other ui elements inside the Toolbar you can use something like this in your layout:<\/p>\n\n<pre><code>&lt;android.support.v7.widget.Toolbar\n android:id=\"@+id\/toolbar\"\n android:layout_height=\"wrap_content\"\n android:layout_width=\"match_parent\"\n android:minHeight=\"?attr\/actionBarSize\"\n app:theme=\"@style\/ActionBarThemeOverlay\"\n android:background=\"?attr\/colorPrimary\" \/&gt;\n<\/code><\/pre>\n\n<p>define the theme for your toolbar:<\/p>\n\n<pre><code> &lt;style name=\"ActionBarThemeOverlay\" parent=\"\"&gt;\n &lt;item name=\"android:textColorPrimary\"&gt;#fff&lt;\/item&gt;\n &lt;item name=\"colorControlNormal\"&gt;#fff&lt;\/item&gt;\n &lt;item name=\"colorControlHighlight\"&gt;#3fff&lt;\/item&gt;\n &lt;\/style&gt;\n<\/code><\/pre>\n\n<p>and finally in your Activity:<\/p>\n\n<pre><code>Toolbar toolbar = (Toolbar) findViewByid(R.id.toolbar);\nsetSupportActionBar(mActionBarToolbar);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419152224287,"favorite_count":null,"last_activity_date":1419152224287,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2016562.0,"parent_id":27584661,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":177,"id":27599479,"title":null,"body":"<p>Finally, I fixed it.\nThe reason is<\/p>\n\n<p><strong>iframe not compeltly loaded when I trying to modify it.<\/strong><\/p>\n\n<p>By binding <strong>load<\/strong> to this iframe dom, it works in firefox.<\/p>\n\n<pre><code>jQuery(iframe_node.$).load('\/topic-page\/ajax\/ckedialogpopup\/' + selecttermfacet + '\/' + filter, function(){\n CKEDITOR.scriptLoader.load(\n [\n \"\/sites\/all\/themes\/pharosui_omega\/ckeditor\/jsrender.min.js\"\n ],\n function() {\n ...\n<\/code><\/pre>\n\n<p>when I am working on this, I meet another issue\n<strong>jQuery .load() not working in Chrome<\/strong>\nI fix it by updating data to a web server instead of getting from local,\ncause jquery load function not work for local (html\/text)data.<\/p>\n\n<p>Hope this helps others.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419238899747,"favorite_count":null,"last_activity_date":1419238899747,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4373235.0,"parent_id":27541631,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":178,"id":27600912,"title":null,"body":"<p>this is resolved as<\/p>\n\n<pre><code> foreach($students as $student){\n $options[] = array(\n 'id' =&gt; $student['Students']['class'],\n 'value'=&gt;$student['Students']['id'],\n 'name' =&gt; $student['Students']['name']\n );\n echo $this-&gt;Form-&gt;input('students', array('options' =&gt; $options));\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419244397897,"favorite_count":null,"last_activity_date":1419244397897,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3791853.0,"parent_id":27598495,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":179,"id":27603367,"title":null,"body":"<p>Thanks to @Aper\u00e7u for spotting the error of not putting <code>require<\/code> at the beginning of <code>('gulp-ruby-sass)<\/code>. Stupid mistake.<\/p>\n\n<p>So here is the answer that is working which I got from the new documentation for <a href=\"https:\/\/github.com\/sindresorhus\/gulp-ruby-sass\/tree\/rw\/1.0\" rel=\"nofollow\">Gulp-Ruby-Sass 1.0.0-alpha<\/a>. The new documentation notes that you have to get rid of <code>gulp src<\/code>. Here's the code I used to make everything work. <\/p>\n\n<p><strong>Old Code<\/strong><\/p>\n\n<pre><code>gulp.task('sass', function() {\n return gulp.src(paths.sass + '*.scss')\n .pipe(plumber())\n .pipe(sass({style: 'expanded'})) \/\/ HERE IS WHERE THE ERROR OCCURS\n .pipe(gulp.dest(paths.css + '*.css'))\n .pipe(livereload());\n });\n<\/code><\/pre>\n\n<p><strong>New Code<\/strong><\/p>\n\n<pre><code>gulp.task('sass', function() {\n return sass(paths.sass, {style: 'expanded'}) \n .pipe(plumber())\n .pipe(gulp.dest(paths.css))\n .pipe(livereload());\n});\n<\/code><\/pre>\n\n<p>Note: the new documentation does not support globs.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419253692010,"favorite_count":null,"last_activity_date":1419254084103,"last_edit_date":1419254084103,"last_editor_display_name":null,"last_editor_user_id":3757026.0,"owner_display_name":null,"owner_user_id":3757026.0,"parent_id":27599137,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":180,"id":27613355,"title":null,"body":"<p>The error is unrelated to the interceptor. Uncomment the line that sets the persistentUnitName property in the entityFactoryBean and verify that persistence.xml is present with the required properties. Here's an example - <a href=\"https:\/\/paste.ee\/p\/j8hkI\" rel=\"nofollow\">https:\/\/paste.ee\/p\/j8hkI<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419302495563,"favorite_count":null,"last_activity_date":1419302495563,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":537503.0,"parent_id":27607743,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":181,"id":27628924,"title":null,"body":"<p>You have to set the font, just like you did in working example, where you are using <code>DejaVuSans<\/code>, since the default font, <code>DroidSans<\/code>, apparently doesn't support your language. You can do this through list adapter:<\/p>\n\n<pre><code># -*- coding: utf-8 -*-\nimport kivy\nfrom kivy.app import App\nfrom kivy.uix.floatlayout import FloatLayout\nfrom kivy.lang import Builder\nfrom kivy.uix.label import Label\n\nBuilder.load_string(\n'''\n#:import la kivy.adapters.listadapter \n#:import lbl kivy.uix.label\n\n&lt;TI&gt;\n but: but\n ListView:\n id: but \n adapter: la.ListAdapter(data=[], cls=lbl.Label)\n\n&lt;MyLabel&gt;:\n font_name: 'data\/fonts\/DejaVuSans.ttf'\n''')\n\nclass MyLabel(Label):\n pass\n\nclass TI(FloatLayout):\n def __init__(self, **kwargs):\n super(TI, self).__init__(**kwargs)\n self.but.adapter.data = [u'\u0633\u0644\u0627\u0645 \u062f\u0646\u06cc\u0627']\n self.but.adapter.cls = MyLabel\n\nclass MyApp(App):\n def build(self):\n return TI()\n\n\nif __name__ == '__main__':\n MyApp().run()\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419373546830,"favorite_count":null,"last_activity_date":1419373546830,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1542900.0,"parent_id":27616652,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":182,"id":27631802,"title":null,"body":"<p>UrlEncode and Decode utility can be used to tweak this. <\/p>\n\n<p>While posting data we can use HttpUtility.UrlEncode in C# or encodeURI in javascript. for encoding base64 data. <\/p>\n\n<p>And within service we can use UrlDecode to get actual string. <\/p>\n\n<p>This is what I am using right now.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419397698093,"favorite_count":null,"last_activity_date":1419397698093,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1939542.0,"parent_id":27618146,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":183,"id":27641720,"title":null,"body":"<p>I am not sure if the input event will trigger after the $viewvalue property has been updated by angular (most possibly not), because angular updates viewvalue property by listening to input\/change etc.. events itself. <\/p>\n\n<p>However one more criteria is the priority of the directive (if you are angular 1.3 and less then provide your directive a priority greater than ngModels i.e ex:1, priority of ngModel has been revised to 1 starting 1.3) and which handler runs first. But if you really just need the value of the input element you could just try accessing it with value property inside the handler i.e <code>this.value<\/code><\/p>\n\n<p>However if you really need the current <code>$viewvalue<\/code> best bet would be to use <a href=\"https:\/\/docs.angularjs.org\/api\/ng\/type\/ngModel.NgModelController#$viewChangeListeners\" rel=\"nofollow\"><code>$viewChangeListeners<\/code><\/a> of the <code>ngModelController<\/code>. <\/p>\n\n<pre><code>.directive('myInput',function(){\n return {\n restrict:'A',\n require:'ngModel',\n priority: 1, \/\/if required\n link:function(scope,element,attrs,ngModelCtrl){\n\n ngModelCtrl.$viewChangeListeners.push(handleViewValueChange);\n\n function handleViewValueChange(){\n alert(ngModelCtrl.$viewValue);\n }\n\n \/\/element.on('input', handleViewValueChange); \/\/Or just use this.value in the handler\n }\n }\n});\n<\/code><\/pre>\n\n<blockquote>\n <p>Array of functions to execute whenever the view value has changed. It is called with no arguments, and its return value is ignored. This can be used in place of additional $watches against the model value.<\/p>\n<\/blockquote>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"true\">\n<div class=\"snippet-code snippet-currently-hidden\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>angular.module('app', []).controller('ctrl', function($scope) {\n\n}).directive('myInput', function() {\n return {\n restrict: 'A',\n require: 'ngModel',\n priority: 1, \/\/If needed\n link: function(scope, element, attrs, ngModelCtrl) {\n\n ngModelCtrl.$viewChangeListeners.push(handleViewValueChange);\n\n function handleViewValueChange() {\n var x = ngModelCtrl.$viewValue;\n alert(x);\n }\n\n element.on('input', function() {\n alert(ngModelCtrl.$viewValue); \/\/or hust this.value\n });\n }\n }\n});<\/code><\/pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/angularjs\/1.3.3\/angular.min.js\"&gt;&lt;\/script&gt;\n&lt;div ng-app=\"app\" ng-controller=\"ctrl\"&gt;\n &lt;input my-input ng-model=\"model\" \/&gt;{{model}}\n&lt;\/div&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419451488507,"favorite_count":null,"last_activity_date":1419455967857,"last_edit_date":1419455967857,"last_editor_display_name":null,"last_editor_user_id":1009603.0,"owner_display_name":null,"owner_user_id":1009603.0,"parent_id":27641615,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":184,"id":27658427,"title":null,"body":"<p>Your selector would select the all <code>td<\/code>s <em>within<\/em> a <code>td<\/code> that has an attribute named \"value\" with the value \"AAA\".<\/p>\n\n<p>Instead, you must match the content of td tags. There is a pseudo selector <code>matchesOwn<\/code> available for that purpose. (own means, only match the direct text of the element, not that of any children).<\/p>\n\n<p>Then, advance to the next sibling element (or, if there can be another element following before the td of interest, query again using \"td\" as the selector).<\/p>\n\n<p>Try<\/p>\n\n<pre><code>Element description = document.select(\"td:matchesOwn(\"AAA\")).first().nextElementSibling();\n<\/code><\/pre>\n\n<p>Beware, the parameter of the <code>matchesOwn<\/code> pseudo selector is interpreted as a regex.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419604615080,"favorite_count":null,"last_activity_date":1419604615080,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":392750.0,"parent_id":27658074,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":185,"id":27661280,"title":null,"body":"<p>Finally, I have used the following approach to address my need (looping over multiple overridable verification), if it can help others :<\/p>\n\n<p>1) My check function does not return boolean anymore. Instead in case of error, we just collect the error in a <code>List&lt;ValidationError&gt;<\/code>, <code>ValidationError<\/code> being a class containing the error message, the concerned <code>EditText<\/code> (or null if global error), and the boolean <code>overridable<\/code> (or not). Thus the verification code becomes :<\/p>\n\n<pre><code>if (check_1() == false) {\n \/\/ non-edittext specific error\n ValidationErrors.add(new ValidationError(MSG_1, null, false)); \n}\nif (check_2() == false) {\n \/\/ overridable error = warning\n ValidationErrors.add(new ValidationError(MSG_2, editText2, true)); \n}\nif (check_3() == false) {\n \/\/ edittext specific error\n ValidationErrors.add(new ValidationError(MSG_3, editText3, false)); \n}\n<\/code><\/pre>\n\n<p>2) Then a validation method allows to continue to the real work or warn\/stop the user :<\/p>\n\n<pre><code>void Validate() {\n\n ArrayList&lt;String&gt; warnings = new ArrayList&lt;String&gt;();\n\n for (ValidationError ve : ValidationErrors) {\n \/\/ global err : display &amp; return\n if (ve.editText == null &amp;&amp; !ve.overridable) {\n popup(ve.message);\n return;\n }\n \/\/ local err : mark the edittext &amp; return\n if (ve.editText != null &amp;&amp; !ve.overridable) {\n ve.editText.setError(ve.message);\n return;\n }\n \/\/ global warning : collect the message\n if (ve.editText == null &amp;&amp; ve.overridable) {\n warnings.add(ve.message);\n }\n \/\/ local warning : mark the edittext &amp; collect the message\n if (ve.editText != null &amp;&amp; ve.overridable) {\n ve.editText.setError(ve.message);\n warnings.add(ve.message);\n }\n }\n\n \/\/ Confirm (or not) the warnings\n ConfirmWarnings(warnings);\n}\n<\/code><\/pre>\n\n<p>3) Finally the <code>ConfirmWarnings<\/code> method is recursive so it can loop over all warnings if any :<\/p>\n\n<pre><code>void ConfirmWarnings(ArrayList&lt;String&gt; warns) {\n if (warns.size() &gt; 0) {\n new DialogCallback(this, warns.get(0) + \", continue ?\", tags) {\n @override\n public void run() {\n if (this.mWhich == DialogInterface.BUTTON_POSITIVE) {\n warns.remove(0); \/\/ consume the warnings as they are accepted\n ConfirmWarnings(warns);\n }\n }\n }\n }\n else \n RealWork();\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419623349797,"favorite_count":null,"last_activity_date":1419623349797,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3510400.0,"parent_id":27429236,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":186,"id":27664733,"title":null,"body":"<p>You need to persist every document on its own.<\/p>\n\n<p>So if A references B:<\/p>\n\n<ol>\n<li>Persist B<\/li>\n<li>Persist A, so you have B's <code>_id<\/code> for the reference<\/li>\n<\/ol>\n\n<p>Otherwise the operation will fail.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419659009283,"favorite_count":null,"last_activity_date":1419659009283,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":573153.0,"parent_id":27664278,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":187,"id":27683164,"title":null,"body":"<p>Using three separate transforms. One to move the canvas so that the click point is the origin. The second transform to scale and the third to put the click point back at the center again<\/p>\n\n<pre><code>&lt;Canvas.RenderTransform&gt;\n &lt;TransformGroup&gt;\n &lt;TranslateTransform X=\"0\" Y=\"0\" \/&gt;\n &lt;ScaleTransform ScaleX=\"1\" ScaleY=\"1\" \/&gt;\n &lt;TranslateTransform X=\"0\" Y=\"0\" \/&gt;\n &lt;\/TransformGroup&gt;\n&lt;\/Canvas.RenderTransform&gt;\n\n\nprivate void Image_MouseDown(object sender, MouseButtonEventArgs e)\n{\n Point p = e.GetPosition(this);\n\n var transformGroup = ImageCanvas.RenderTransform as TransformGroup;\n var moveToOriginTransform = transformGroup.Children[0] as TranslateTransform;\n var scaleTransform = transformGroup.Children[1] as ScaleTransform;\n var moveBackTransform = transformGroup.Children[2] as TranslateTransform;\n\n moveToOriginTransform.X = -p.X;\n moveToOriginTransform.Y = -p.Y;\n\n scaleTransform.ScaleX += 1;\n scaleTransform.ScaleY += 1;\n\n moveBackTransform.X = p.X;\n moveBackTransform.Y = p.Y;\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419825141897,"favorite_count":null,"last_activity_date":1419831271920,"last_edit_date":1419831271920,"last_editor_display_name":null,"last_editor_user_id":453365.0,"owner_display_name":null,"owner_user_id":453365.0,"parent_id":27682801,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":188,"id":27701137,"title":null,"body":"<p>Using the unique id in core data can be extremely beneficial. Then you can just do a quick query to see if the type with that id exists and return that type if it exists (so long as you create a Type entity). If it doesn't exist, you create it. <\/p>\n\n<pre><code>func fetchType(typeID: Int) -&gt; Type? {\n\n \/\/ Define fetch request\/predicate\n var fetchRequest = NSFetchRequest(entityName: \"Type\")\n let predicate = NSPredicate(format: \"id == %@\", typeID)\n\n \/\/ Assign fetch request properties\n fetchRequest.predicate = predicate\n fetchRequest.fetchBatchSize = 1\n fetchRequest.fetchLimit = 1\n\n \/\/ Handle results\n let fetchedResults = managedObjectContext?.executeFetchRequest(fetchRequest, error: nil)\n if fetchedResults?.count != 0 {\n if let fetchedEvent: Event = fetchedResults![0] as? Event {\n return fetchedEvent\n }\n }\n return nil\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419923614220,"favorite_count":null,"last_activity_date":1419923614220,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3810673.0,"parent_id":27698791,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":189,"id":27716017,"title":null,"body":"<p>Check these:<\/p>\n\n<ol>\n<li>Nothing is upon your <code>UICollectionView<\/code>.<\/li>\n<li>No subviews of <code>UICollectionView<\/code> receiving gesture before <code>UICollectionView<\/code>.<\/li>\n<li>Or there is no other gesture recognition active.<\/li>\n<\/ol>\n\n<p>Hope this helps.. :)<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419999087790,"favorite_count":null,"last_activity_date":1419999087790,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3085625.0,"parent_id":27715974,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":190,"id":27734859,"title":null,"body":"<h1>You need this<\/h1>\n<pre><code>-(CGRect) unobscuredBounds\n{\n CGRect bounds = [self.view bounds];\n return UIEdgeInsetsInsetRect(bounds, [self defaultContentInsets]);\n}\n\n-(UIEdgeInsets) defaultContentInsets\n{\n const CGFloat topOverlay = self.topLayoutGuide.length;\n const CGFloat bottomOverlay = self.bottomLayoutGuide.length;\n return UIEdgeInsetsMake(topOverlay, 0, bottomOverlay, 0);\n}\n<\/code><\/pre>\n<p>You could put this in a <a href=\"https:\/\/stackoverflow.com\/q\/16154202\/2547229\">category<\/a> for easy reusability.<\/p>\n<p>These methods correctly handle the changes that occur when the view resizes after a rotation \u2013 the change to the UINavigationBar size is correctly handled.<\/p>\n<h1>Centring Content<\/h1>\n<p>To use this to <a href=\"http:\/\/petersteinberger.com\/blog\/2013\/how-to-center-uiscrollview\/\" rel=\"nofollow noreferrer\">centre content by adjusting insets<\/a>, you'd do something like this:<\/p>\n<pre><code>-(void) scrollViewDidZoom:(UIScrollView *)scrollView\n{\n [self centerContent];\n}\n\n- (void)centerContent\n{\n const CGSize contentSize = self.scrollView.contentSize;\n const CGSize unobscuredBounds = [self unobscuredBounds].size;\n\n const CGFloat left = MAX(0, (unobscuredBounds.width - contentSize.width)) * 0.5f;\n const CGFloat top = MAX(0, (unobscuredBounds.height - contentSize.height)) * 0.5f;\n\n self.scrollView.contentInset = UIEdgeInsetsMake(top, left, top, left);\n}\n<\/code><\/pre>\n<p>Your content insets will now reflect the default insets that they need (to avoid being covered up) and will also have the insets they need to be nicely centred.<\/p>\n<h1>Handling Rotation &amp; Zoom<\/h1>\n<p>You probably also want to perform centring when animating between landscape and portrait. At the same time, you might want to adjust your minimum zoom scale so that your content will always fit. Try out something like this:<\/p>\n<pre><code>-(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration\n{\n [self centerContent];\n\n const bool zoomIsAtMinimum = self.scrollView.zoomScale == self.scrollView.minimumZoomScale;\n\n self.scrollView.minimumZoomScale = [self currentMinimumScale];\n \n if(zoomIsAtMinimum)\n {\n self.scrollView.zoomScale = self.scrollView.minimumZoomScale;\n }\n}\n\n-(CGFloat) currentMinimumScale\n{\n const CGFloat currentScale = self.scrollView.zoomScale;\n const CGSize scaledContentSize = self.scrollView.contentSize;\n const CGSize scrollViewSize = [self unobscuredBounds].size;\n\n CGFloat scaleToFitWidth = currentScale * scrollViewSize.width \/ scaledContentSize.width;\n CGFloat scaleToFitHeight = currentScale * scrollViewSize.height \/ scaledContentSize.height;\n\n return MIN(scaleToFitWidth, scaleToFitHeight);\n}\n<\/code><\/pre>\n<p>The <code>willAnimateRotationToInterfaceOrientation:\u2026<\/code> method is called within the view animation block, so the changes that it applies will lead to nice smooth animated changes as you switch from landscape to portrait.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420147758720,"favorite_count":null,"last_activity_date":1420410866247,"last_edit_date":1592644375060,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":2547229.0,"parent_id":27734657,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":191,"id":27740494,"title":null,"body":"<p>This login module problem caused by configuration file, i am sure you have set wrong path in your logs and temp directory. If above solution not work for you then try this one i am sure this will definitely work for you.\nafter running this file you`ll find Absoluthe path of your server just copy that path and paste in you log and temp path like<\/p>\n\n<pre><code> Your Absoluthe Path\/logs\n Your Absoluthe Path\/temp\n<\/code><\/pre>\n\n<p>And your login module work like a charm.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420193642840,"favorite_count":null,"last_activity_date":1420193642840,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4437135.0,"parent_id":27738122,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":192,"id":27750826,"title":null,"body":"<p>Chris and company is working on a PR for the <code>dependent destroy<\/code> ability. It seems to work on master branch of the gem currently. It seems to do the job a -ok!<\/p>\n\n<p><a href=\"https:\/\/github.com\/neo4jrb\/neo4j\/pull\/653\" rel=\"nofollow\">https:\/\/github.com\/neo4jrb\/neo4j\/pull\/653<\/a> <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420248487913,"favorite_count":null,"last_activity_date":1422489586693,"last_edit_date":1422489586693,"last_editor_display_name":null,"last_editor_user_id":2827338.0,"owner_display_name":null,"owner_user_id":2827338.0,"parent_id":27599675,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":193,"id":27768649,"title":null,"body":"<p>In general the concept would be that you would enable separation in the project and then train your classes with examples to be used for the layout or content classifiers.<\/p>\n\n<p>However, as I'm sure you've seen, the obstacle with invoices is that they are different enough between vendors that it would not reliably classify all to an Invoice class. Similarly with \"Supporting Documents\" which are likely to be very different from each other, so unfortunately there isn't a completely easy answer without separator sheets (or barcode stickers affixed to supporting docs).<\/p>\n\n<p>What you might want to do is write code in the one of the separation events like Document_AfterSeparate event. Despite the name, the document has not yet been split at this point, but the classifiers have run. See Scripting Help topic \"Server Script Events Sequence > Document Separation > Standard Document Separation\" for more detail. Setting the SplitPage property on the CDocPage (pXDoc.CDoc.Pages.ItemByIndex(lPage).SplitPage) will allow you to use your own logic to determine which pages to separate.<\/p>\n\n<p>For example if you know that you will always have single page invoices, you can split on the first page and classify accordingly. Or you can try to search for something that indicates the end of the invoice like \"Total\" or other characteristics. There is an example of how you can use locators to help separation in the Scripting Help topic \"Script Samples > Use Locator Results for Standard Document Separation\". The example uses a Barcode Locator, but the same concept works if you wanted to try it with a Format Locator or anything else. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420394772257,"favorite_count":null,"last_activity_date":1420394772257,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":221018.0,"parent_id":27705097,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":194,"id":27776965,"title":null,"body":"<p>Finally, I found this solution under this post:\n<a href=\"https:\/\/stackoverflow.com\/questions\/26340704\/twitter-image-upload-error-media-parameter-is-missing\">Twitter image upload error : media parameter is missing<\/a><\/p>\n\n<p>But one thing to note: make sure your image base64 is not contained full path. This driven me very crazy until I found it. Real example for me<\/p>\n\n<p>var imageBase64 = data:image\/jpeg;base64,4793748374837493749374937434b3b4398498343749374739479374739473947394347373479374334793748374837493749374937434b3b4398498343749374739479374739473947394347373479374334793748374837493749374937434b3b4398498343749374739479374739473947394347373479374334793748374837493749374937434b3b43984983437493747394793747394739473943473734793743...................................................................7979<\/p>\n\n<p>It is not working. So I have to split as below:<\/p>\n\n<p>var splitImageBase64 = imageBase64.split(\",\")[1];<\/p>\n\n<p>Then it works.<\/p>\n\n<p>I hope this may help someone else.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420451471390,"favorite_count":null,"last_activity_date":1420451471390,"last_edit_date":1495540256357,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1358082.0,"parent_id":27717597,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":195,"id":27864679,"title":null,"body":"<p>After a bit of discussion with a system architect, we came to the (embarrassingly simple) conclusion that the best answer for our architecture would be to create two Register functions in our DI container - one called RegisterCorporateWebSiteDependencies() and another RegisterStoreWebsiteDependencies().<\/p>\n\n<p>The natural extension of that is to also have 2 global filter configs called after dependency composition, (again) one for RegisterCorporateGlobalFilters() and one for RegisterStoreGlobalFilters().<\/p>\n\n<p>This results in one overall if statement running the registers ex:<\/p>\n\n<pre><code>if (Convert.ToBoolean(ConfigurationManager.AppSettings[\"IsCorporate\"]))\n{\n DependencyConfig.RegisterCorporateWebSiteDependencies(GlobalConfiguration.Configuration);\n}\nelse\n{\n DependencyConfig.RegisterStoreWebSiteDependencies(GlobalConfiguration.Configuration);\n}\n<\/code><\/pre>\n\n<p>Which is much more straightforward, and removes the logic from the other locations where it can be confusing.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420819904737,"favorite_count":null,"last_activity_date":1420819904737,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":82333.0,"parent_id":27706839,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":196,"id":27867954,"title":null,"body":"<p>Seems like <code>Caret.BringCaretToView()<\/code> only scrolls AvalonEdit itself, it doesn't send <code>BringIntoView<\/code> request up the visual tree.<\/p>\n\n<p>I think you'd need to change the AvalonEdit source code to fix this.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420832371073,"favorite_count":null,"last_activity_date":1420832371073,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":141502.0,"parent_id":27672643,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":197,"id":27922585,"title":null,"body":"<p>This is covered in the <a href=\"http:\/\/www.w3.org\/TR\/html401\/interact\/forms.html\" rel=\"nofollow\">W3C HTML 4 recommendation<\/a>:<\/p>\n\n<blockquote>\n <p>Checkboxes (and radio buttons) are on\/off switches that may be toggled\n by the user. A switch is \"on\" when the control element's checked\n attribute is set. When a form is submitted, only \"on\" checkbox\n controls can become successful.<\/p>\n<\/blockquote>\n\n<p>And if you are using symfony form component - please <a href=\"http:\/\/symfony.com\/doc\/current\/book\/forms.html#handling-form-submissions\" rel=\"nofollow\">use it properly<\/a>.<\/p>\n\n<pre><code>$form-&gt;handleRequest($form);\nif ($form-&gt;isValid()) {\n $data = $form-&gt;getData();\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1421153299587,"favorite_count":null,"last_activity_date":1421153299587,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1096551.0,"parent_id":27738247,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":198,"id":27413051,"title":null,"body":"<p>You're not selecting properly the children: move up by one level to their parents, and start from there, like <code>.someParentClass:nth-of-type(even) .child{}<\/code>: <a href=\"http:\/\/jsfiddle.net\/o5dv4qkc\/3\/\" rel=\"nofollow\">demo<\/a><\/p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>.About_Row {\n height: 2em;\n width: 500px;\n \/*float:left;*\/\n}\n.About_RowLabel {\n width: 98px;\n color: black;\n float: left;\n background-color: #71cd7b;\n}\n.About_RowData {\n width: 200px;\n float: left;\n margin-left: 20px;\n}\n.About_Row:nth-of-type(odd) .About_RowLabel {\n background-color: #DEF3CA;\n}\n.serv_resize {\n border: 1px solid #E2E2E2;\n color: #444;\n width: 425px;\n float: left;\n margin: 10px 10px 10px 0;\n padding: 5px;\n height: 239px;\n}<\/code><\/pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;div id=\"you\" class=\"serv_resize\"&gt;\n &lt;div class=\"About_Row\"&gt;\n &lt;div class=\"About_RowLabel\"&gt;\n BirthDate:\n &lt;\/div&gt;\n &lt;div class=\"About_RowData\"&gt;\n &lt;asp:Label ID=\"lblDoB\" runat=\"server\" Text=\"DoB\"&gt;&lt;\/asp:Label&gt;\n &lt;\/div&gt;\n &lt;\/div&gt;\n &lt;div class=\"About_Row\"&gt;\n &lt;div class=\"About_RowLabel\"&gt;\n As of:\n &lt;\/div&gt;\n &lt;div class=\"About_RowData\"&gt;\n &lt;asp:Label ID=\"lblAsOf\" runat=\"server\" Text=\"Dt\"&gt;&lt;\/asp:Label&gt;\n &lt;\/div&gt;\n &lt;\/div&gt;\n &lt;div class=\"About_Row\"&gt;\n &lt;div class=\"About_RowLabel\"&gt;\n Phone:\n &lt;\/div&gt;\n &lt;div class=\"About_RowData\"&gt;\n &lt;asp:Label ID=\"lblPhone\" runat=\"server\" Text=\"Ph\"&gt;&lt;\/asp:Label&gt;\n &lt;\/div&gt;\n &lt;\/div&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418255612420,"favorite_count":null,"last_activity_date":1418255612420,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2699411.0,"parent_id":27412947,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":199,"id":27431832,"title":null,"body":"<p>I could solve my problem by doing this:<\/p>\n\n<ol>\n<li><p>Using <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/f7dy01k1%28v=vs.110%29.aspx\" rel=\"nofollow\">ildasm<\/a>, decompile the assembly.<\/p>\n\n<blockquote>\n <p>ildasm MyFile.exe \/output:MyFile.il<\/p>\n<\/blockquote><\/li>\n<li><p>Open the extracted file \"MyFile.il\" with a text editor.<\/p><\/li>\n<li><p>You will see something like this:<\/p>\n\n<blockquote>\n <p>.custom instance void\n [mscorlib]System.Reflection.AssemblyCopyrightAttribute::.ctor(string) =<\/p>\n \n <p>( 01 00 2C 43 6F 70 79 72 69 67 68 74 20 C2 A9 20 \/\/ ..,Copyright ..<\/p>\n \n <p>45 78 61 6d 70 6c 65 00 00 ) \/\/ Example<\/p>\n<\/blockquote><\/li>\n<li><p>The hex code is your copyright string, you may change it, but take care about this notes:<\/p>\n\n<p>-The first two pairs 01 and 00 indicates the start of the string.<\/p>\n\n<p>-The last two pairs 00 and 00 indicates the end of the string.<\/p>\n\n<p>-You must NOT change the length of the hex code (I don't know why.. an exception is thrown when you are going to read it. I added empty spaces (20) in the end of the hex code to match the length).<\/p><\/li>\n<li><p>Now you just have to compile it again with <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/496e4ekx(v=vs.110).aspx\" rel=\"nofollow\">ilasm<\/a>.<\/p>\n\n<blockquote>\n <p>ilasm \/resource=MyFile.res \/exe \/output=MyFile.exe MyFile.il<\/p>\n<\/blockquote><\/li>\n<\/ol>\n\n<p>That's it.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418329797990,"favorite_count":null,"last_activity_date":1418330674757,"last_edit_date":1418330674757,"last_editor_display_name":null,"last_editor_user_id":3147001.0,"owner_display_name":null,"owner_user_id":3147001.0,"parent_id":27429612,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":200,"id":27431873,"title":null,"body":"<p><strong>Combining your canvases into a single \"print\" canvas is the way to go.<\/strong><\/p>\n\n<p>BTW, in case you didn't know...<\/p>\n\n<p><code>context.drawImage(imageSource...<\/code> will take another canvas as it's imageSource.<\/p>\n\n<p>Therefore, if you need all your canvases intact (uncombined), just create a new in-memory-only canvas and draw all canvases onto that new canvas in z-index order:<\/p>\n\n<pre><code>var printCanvas=document.createElement('canvas');\nvar printCtx=printCanvas.getContext('2d');\n\nprintCtx.drawImage(canvasZIndex0,0,0);\nprintCtx.drawImage(canvasZIndex1,0,0);\nprintCtx.drawImage(canvasZIndex2,0,0);\nprintCtx.drawImage(canvasZIndex3,0,0);\n\nvar img=new Image();\nimg.onload=function(){\n \/\/ print this snapshot image\n}\nimg.src=printCanvas.toDataURL();\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418329960973,"favorite_count":null,"last_activity_date":1418329960973,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":411591.0,"parent_id":27431563,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":201,"id":27433771,"title":null,"body":"<p>From now on you can use phonegap build with any cordova plugins. You should specify the source tag, for example:<\/p>\n\n<pre><code>&lt;gap:plugin name=\"com.admob.google\" source=\"plugins.cordova.io\" \/&gt;\n<\/code><\/pre>\n\n<p>In the case of the in app purchase plugin, I haven't tested it, but it should be:<\/p>\n\n<pre><code>&lt;gap:plugin name=\"cc.fovea.plugins.inapppurchase\" source=\"plugins.cordova.io\" \/&gt;\n<\/code><\/pre>\n\n<p><strong>EDIT<\/strong>\nTo stay updated with the plugin, remove version tag. Every time you compile the app again, the latest version will be used.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418337620407,"favorite_count":null,"last_activity_date":1418413148530,"last_edit_date":1418413148530,"last_editor_display_name":"user4165690","last_editor_user_id":null,"owner_display_name":"user4165690","owner_user_id":null,"parent_id":27412124,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":202,"id":27443236,"title":null,"body":"<p>The XMLRPC script can be anywhere, it doesn't need to be installed as an odoo module. <\/p>\n\n<p>It is just a python script that you can run in your machine and it uploads the data to your server using the remote service interface. For that you need to point the right server url, as running it pointing to localhost would expect you to run the script in the same place where odoo is installed.<\/p>\n\n<p>For building scripts or manage the data remotely without using the web interface, i recommend: <a href=\"http:\/\/erppeek.readthedocs.org\/en\/latest\/\" rel=\"nofollow\">http:\/\/erppeek.readthedocs.org\/en\/latest\/<\/a> <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418385681840,"favorite_count":null,"last_activity_date":1418385681840,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4334651.0,"parent_id":27396345,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":203,"id":27444106,"title":null,"body":"<p>Use a <code>Dictionary(Of String, String)<\/code> and in a loop <code>String.Replace<\/code>:<\/p>\n\n<pre><code>Dim replacementMapper As New Dictionary(Of String, String)\nreplacementMapper.Add(\"o\", \"0\")\nreplacementMapper.Add(\"T\", \"7\")\nreplacementMapper.Add(\"B\", \"8\")\nDim inputString = \"This is just an example which is completely pointless.\"\nFor Each kv In replacementMapper\n inputString = inputString.Replace(kv.Key, kv.Value)\nNext\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418388815760,"favorite_count":null,"last_activity_date":1418388815760,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":284240.0,"parent_id":27443937,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":204,"id":27459083,"title":null,"body":"<pre><code>switch.dpctl('mod-port', &lt;portName&gt;, 'up')\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418475757447,"favorite_count":null,"last_activity_date":1418475757447,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3564720.0,"parent_id":27450191,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":205,"id":27471588,"title":null,"body":"<p>There is nothing in the specification of KML that states that the <code>&lt;name&gt;<\/code> tag of a <code>&lt;Placemark&gt;<\/code> should be rendered along with a pushpin or icon -- Google just chose to implement it that way.<\/p>\n\n<p>If you look at the OpenLayers <a href=\"http:\/\/openlayers.org\/en\/v3.0.0\/examples\/kml.html?q=kml\" rel=\"nofollow\">Swiss hotels KML<\/a> example, you will probably agree that automatically showing the text labels would make the screen too busy. However, it is fairly straightforward to add labels on mouseover, using the <code>map.forEachFeatureAtPixel<\/code> function, as is done in this <a href=\"http:\/\/openlayers.org\/en\/v3.0.0\/examples\/kml-earthquakes.html?q=kml\" rel=\"nofollow\">kml earthquake<\/a> exmaple, which pushes the name attribute of the KML tag into an info div, as you can see in this code snippet:<\/p>\n\n<pre><code>var feature = map.forEachFeatureAtPixel(pixel, function(feature, layer) {\n return feature;\n});\nif (feature) {\n info.tooltip('hide')\n .attr('data-original-title', feature.get('name'))\n .tooltip('fixTitle')\n .tooltip('show');\n} else {\n info.tooltip('hide');\n}\n<\/code><\/pre>\n\n<p>So, the <code>&lt;name&gt;<\/code> tag of <code>&lt;Placemark&gt;<\/code> is parsed, but the display is left up to you in OpenLayers, by design, not by defect.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418575752350,"favorite_count":null,"last_activity_date":1418583625593,"last_edit_date":1418583625593,"last_editor_display_name":null,"last_editor_user_id":457052.0,"owner_display_name":null,"owner_user_id":457052.0,"parent_id":27423984,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":206,"id":27472716,"title":null,"body":"<p>Have you tried:<\/p>\n\n<pre><code>public static List&lt;Pattern&gt; loadPattern(){\n ArrayList&lt;Pattern&gt; patterns = new ArrayList&lt;&gt;();\n Gson gson = new Gson();\n JsonParser jsonParser = new JsonParser();\n try {\n BufferedReader br = new BufferedReader(new FileReader(\"JsonObjects\/objects.json\"));\n JsonElement jsonElement = jsonParser.parse(br);\n\n \/\/Create generic type\n Type type = new TypeToken&lt;List&lt;Pattern&gt;&gt;() {}.getType();\n return gson.fromJson(jsonElement, type);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n return patterns; \n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418582686003,"favorite_count":null,"last_activity_date":1418582686003,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1575291.0,"parent_id":27471861,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":207,"id":27476722,"title":null,"body":"<p>You can't. Force stop makes the app stop permanently. All alarms and receivers registered in the app will be turned off. That's the purpose of force stop- to turn the app completely off. If you want the app to continue in the background, don't force stop it.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418612218600,"favorite_count":null,"last_activity_date":1418612218600,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1631193.0,"parent_id":27476687,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":208,"id":27478767,"title":null,"body":"<p>My code has worked. The changes I made are:<\/p>\n\n<ol>\n<li>I changed the version of my javax-servlet-api from 2.3 to 3.1<\/li>\n<li><p>I changed the showHello method of my Controller Class to this:<\/p>\n\n<pre><code>@RequestMapping(value = \"\/student\", method = RequestMethod.GET)\npublic ModelAndView showHello(Model model) {\n System.out.println(\"This is showHello method.\");\n return new ModelAndView(\"student\", \"command\", new Student());\n}\n<\/code><\/pre><\/li>\n<\/ol>\n\n<p>Basically, what I did is, I changed the argument of the method from ModelAndView to Model.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418626403753,"favorite_count":null,"last_activity_date":1418626403753,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4344676.0,"parent_id":27469042,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":209,"id":27479837,"title":null,"body":"<p>You are likely running into problems with delimiters, try something like this:<\/p>\n\n<pre><code>COPY kjh (mknh, jkh) FROM stdin WITH DELIMITER ' ';\n1 1\n\\.\n<\/code><\/pre>\n\n<p>This should execute just fine.<\/p>\n\n<p>Also, note, that your pgsql file have inconsistent spaces count between values, so you may have to prepare this file replacing multiple spaces in values with single delimiter (two spaces with single space delimiter will result in error, since postgres will assume you providing empty column value).<\/p>\n\n<p>And I would suggest you to choose another delimiter instead of space, something like <code>;<\/code> or <code>^<\/code>.<\/p>\n\n<p>Not sure if <code>COPY ... FROM stdin<\/code> will work from pgadmin (well, it should), but if it fails, try to run this query from CLI using <code>psql<\/code> command.<\/p>\n\n<p>For more info on delimiters and copy syntax, refer to <a href=\"http:\/\/www.postgresql.org\/docs\/9.3\/static\/sql-copy.html\" rel=\"nofollow\">docs<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418631436623,"favorite_count":null,"last_activity_date":1418631436623,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1463595.0,"parent_id":27476608,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":210,"id":27509869,"title":null,"body":"<p>There was a <a href=\"https:\/\/github.com\/GoogleCloudPlatform\/kubernetes\/pull\/2933\" rel=\"nofollow\">pull request<\/a> filed yesterday to add this feature to Kubernetes. Once it has been added to Kubernetes you should be able to test it by building from head and deploying your cluster to GCE. <\/p>\n\n<p>This feature will show up in Google Container Engine shortly after the next release of Kubernetes. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418749020353,"favorite_count":null,"last_activity_date":1418749020353,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4215791.0,"parent_id":27507990,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":211,"id":27524713,"title":null,"body":"<p>Every web console run every JavaScript code. You want your script run when page is loaded. This event occurs when the page just finished to load. When you go to Web console, the page is already loaded. If you tell your page to run a function when the page is loaded, but your page is already loaded, the function will never be called.<\/p>\n\n<p>Insert your script in your page, or place the script-link, before end of <code>&lt;\/html&gt;<\/code>.<\/p>\n\n<p>Then in your script, call your function ( example <code>fn<\/code> ) :<\/p>\n\n<pre><code>window.addEventListener &amp;&amp; window.addEventListener( \"load\", fn ) ||\nwindow.attachEvent &amp;&amp; window.attachEvent( \"load\", fn );\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418816216540,"favorite_count":null,"last_activity_date":1418816216540,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4367301.0,"parent_id":27524561,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":212,"id":27530446,"title":null,"body":"<p>It is doing as you have specified. You would get better results using the center point for both the X and Y:<\/p>\n\n<pre><code>[dragView setCenter:CGPointMake(dragView.center.x, dragView.center.y + 20)];\n<\/code><\/pre>\n\n<p>Also, as noted below. iOS uses 0,0 as top left, so to move something \"up\" would require subtracting 20 from the dragView.center.y.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418834349467,"favorite_count":null,"last_activity_date":1418835669043,"last_edit_date":1418835669043,"last_editor_display_name":null,"last_editor_user_id":2265862.0,"owner_display_name":null,"owner_user_id":2265862.0,"parent_id":27530289,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":213,"id":27534137,"title":null,"body":"<p>I hope the below code will help.<\/p>\n\n<h2>somespider.py<\/h2>\n\n<pre><code># -*- coding: utf-8 -*-\nimport scrapy\nimport re\nfrom scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor\nfrom scrapy.selector import Selector\nfrom scrapy.spider import BaseSpider\nfrom demo.items import DemoItem\nfrom selenium import webdriver\n\ndef removeUnicodes(strData):\n if(strData):\n strData = strData.encode('utf-8').strip() \n strData = re.sub(r'[\\n\\r\\t]',r' ',strData.strip())\n return strData\n\nclass demoSpider(scrapy.Spider):\n name = \"domainurls\"\n allowed_domains = [\"domain.com\"]\n start_urls = ['http:\/\/www.domain.com\/used\/cars-in-trichy\/']\n\n def __init__(self):\n self.driver = webdriver.Remote(\"http:\/\/127.0.0.1:4444\/wd\/hub\", webdriver.DesiredCapabilities.HTMLUNITWITHJS)\n\n def parse(self, response):\n self.driver.get(response.url)\n self.driver.implicitly_wait(5)\n hxs = Selector(response)\n item = DemoItem()\n finalurls = []\n while True:\n next = self.driver.find_element_by_xpath('\/\/div[@class=\"showMoreCars hide\"]\/a')\n\n try:\n next.click()\n # get the data and write it to scrapy items\n item['pageurl'] = response.url\n item['title'] = removeUnicodes(hxs.xpath('.\/\/h1[@class=\"page-heading\"]\/text()').extract()[0])\n urls = self.driver.find_elements_by_xpath('.\/\/a[@id=\"linkToDetails\"]')\n\n for url in urls:\n url = url.get_attribute(\"href\")\n finalurls.append(removeUnicodes(url)) \n\n item['urls'] = finalurls\n\n except:\n break\n\n self.driver.close()\n return item\n<\/code><\/pre>\n\n<p><strong>items.py<\/strong><\/p>\n\n<pre><code>from scrapy.item import Item, Field\n\nclass DemoItem(Item):\n page = Field()\n urls = Field()\n pageurl = Field()\n title = Field()\n<\/code><\/pre>\n\n<p><strong>Note:<\/strong>\nYou need to have selenium rc server running because HTMLUNITWITHJS works with selenium rc only using Python.<\/p>\n\n<p><strong>Run your selenium rc server issuing the command<\/strong> : <\/p>\n\n<pre><code>java -jar selenium-server-standalone-2.44.0.jar\n<\/code><\/pre>\n\n<p><strong>Run your spider using command<\/strong>:<\/p>\n\n<pre><code>spider crawl domainurls -o someoutput.json\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418847616007,"favorite_count":null,"last_activity_date":1418986935900,"last_edit_date":1418986935900,"last_editor_display_name":null,"last_editor_user_id":4264078.0,"owner_display_name":null,"owner_user_id":4264078.0,"parent_id":27525142,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":214,"id":27537905,"title":null,"body":"<p>Problem solved!<\/p>\n\n<ol>\n<li>Download and Install the \"Light\" version of OpenSSL<\/li>\n<li>Follow the above procedure to Rebuild Qt with OpenSSL support + Install SIP + Install PyQt<\/li>\n<li>Copy <code>ssleay32.dll<\/code>, <code>libeay32.dll<\/code> and <code>libssl32.dll<\/code> to the Qt > mingw > bin folder (<code>C:\\Qt\\Qt5.3.2\\5.3\\mingw482_32\\bin<\/code> in my case)<\/li>\n<\/ol>\n\n<p>Now you can see a big <code>True<\/code> when you do a <code>QSslSocket.supportsSsl()<\/code> test.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418866848313,"favorite_count":null,"last_activity_date":1418866848313,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3420199.0,"parent_id":27392247,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":215,"id":27580702,"title":null,"body":"<p><code>19,12<\/code> is not a valid number. If you quote that as a string (e.g. <code>\"19,12\"<\/code>) does it work?<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419082142393,"favorite_count":null,"last_activity_date":1419082142393,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":57135.0,"parent_id":27580681,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":216,"id":27583127,"title":null,"body":"<p>I had some luck deleting nuget files out of AppData and restarting VS2015.<\/p>\n\n<p>How I did it:<\/p>\n\n<p>1) Go to c:\\Users\\yourname\\AppData\\ in File Explorer.<\/p>\n\n<p>2) Search for \"nuget\"<\/p>\n\n<p>3) Delete anything that looks like it's transient -- in particular there should be a couple .nuget folders, but I didn't mark the locations. Since I have ReSharper and Chocolately installed, I noticed that some hits that looked specific to those applications which I did not delete.<\/p>\n\n<p>4) Restart Visual Studio.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419100342150,"favorite_count":null,"last_activity_date":1419100342150,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":219072.0,"parent_id":27377094,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":217,"id":27584820,"title":null,"body":"<p>This is a <a href=\"https:\/\/youtrack.jetbrains.com\/issue\/IDEA-82969\" rel=\"nofollow\">known issue<\/a> with several possible workarounds. One option is to configure Android Studio to run under JDK 7 or JDK 8 by editing Info.plist and changing the JVMVersion, as described in the last comment to the issue.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419113825463,"favorite_count":null,"last_activity_date":1419113825463,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":147024.0,"parent_id":27584775,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":218,"id":27591659,"title":null,"body":"<p>It is possible for sure. You can use <code>Config::set('app.languages', array('en', 'ru', 'lv', 'de'\u2026..))<\/code> to set the config dynamically. Doing it directly in the config file won't work, since all the database classes aren't available at that time.<\/p>\n<h2>But<\/h2>\n<p>Why even bother using the config?! In my opinion, config files are for <em>static<\/em> config that get's set inside files. And I wouldn't mix it with config data loaded from the database. Instead I would create a model <code>Language<\/code><\/p>\n<pre><code>class Language extends Eloquent {\n \/\/ this assumes your table is called &quot;languages&quot;\n}\n<\/code><\/pre>\n<p>To get your array of languages, just do<\/p>\n<pre><code>Language::all()-&gt;lists('language');\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419181320460,"favorite_count":null,"last_activity_date":1419181320460,"last_edit_date":1592644375060,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1903366.0,"parent_id":27395404,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":219,"id":27602400,"title":null,"body":"<p>First,\nFind which display template that you use for search result. You can find this by following <\/p>\n\n<p>Site Settings -> Search Result Types (rootsite\/_layouts\/15\/manageresulttypes.aspx?level=sitecol).\nIn the \"Defined for this site collection title\" find the template that you use for people result.\nthen edit it. In the edit screen, you will find the path of display template at the bottom.<\/p>\n\n<p>Then, \nOpen Sharepoint designer find the template and edit it.<\/p>\n\n<p>I hope this will solve your problem.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419249884613,"favorite_count":null,"last_activity_date":1419249884613,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3859625.0,"parent_id":27320042,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":220,"id":27612530,"title":null,"body":"<p>Notice that sender is the button not myProgressView so the tag of the sender which is myButton is always zero.<\/p>\n\n<p>If you want to get the tag of myProgressView change your code as below:<\/p>\n\n<pre><code>func holding (sender:UIButton!) {\n print(myProgressView.tag)\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419294860100,"favorite_count":null,"last_activity_date":1419294860100,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":609130.0,"parent_id":27612511,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":221,"id":27623108,"title":null,"body":"<blockquote>\n <p>So when I am using the WinForms GUI the file is found, but when I am using the MVC website, the project can't find it.<\/p>\n<\/blockquote>\n\n<p>To answer the reason why you are observing the difference is called the <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.io.directory.getcurrentdirectory(v=vs.110).aspx\" rel=\"nofollow\">current working directory<\/a>. By default, when VS.NET launches Windows apps or consoles, the working directory is to the relevant bin directory.<\/p>\n\n<p>All relative file operations, such as <code>File.ReadAllLines(\"the.file\")<\/code>, will concatenate to an absolute file path as per below.<\/p>\n\n<pre><code>Path.Combine(Directory.GetCurrentDirectory(), \"the.file\");\n<\/code><\/pre>\n\n<p>ASP.NET's working directory would not correlate to the root of your web application.<\/p>\n\n<blockquote>\n <p>Where should I place the file in the MVC proejct?<\/p>\n<\/blockquote>\n\n<p>As suggested by @dariogriffo, it should be placed in the <code>~\/App_Data\/*<\/code> directory.<\/p>\n\n<blockquote>\n <p>I have a solution which has two presentation layers. One is using ASP.NET MVC, the other WinForms. Both projects depend on a third projecs which does some business logic and is a class library.<\/p>\n<\/blockquote>\n\n<p>So now you are in a little bit of a pickle over here with your current implementation and the way the current working directory is implemented. Without delving into too much detail, I suggest that the code figures out how to load the file indirectly such as passing in an interface with a contract such as the following.<\/p>\n\n<pre><code>public interface IDictionaryRepository {\n IEnumerable&lt;string&gt; LoadAllWords();\n}\n<\/code><\/pre>\n\n<p>With the above, you can change your business logic to the following<\/p>\n\n<pre><code>public static string[] Dictionary()\n{\n if (_dictionary == null)\n {\n _dictionary = _dictionaryRepository.LoadAllWords().ToArray();\n }\n\n return _dictionary;\n}\n<\/code><\/pre>\n\n<p>The benefit of the above abstraction is that you may then easily substitute the file finding logic as per the other suggestions easily, and maybe migrate your dictionary to be hosted in a database somewhere.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419347682343,"favorite_count":null,"last_activity_date":1419347682343,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":249748.0,"parent_id":27622711,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":222,"id":27626777,"title":null,"body":"<p>That's currently not possible using a Filter (as of Ninja 4.0.x). However, you can implement it yourself. That would work roughly the following way:<\/p>\n\n<ul>\n<li>Create the filter<\/li>\n<li><p>Get the contents of the incoming request via<br>\n<code>context.getParameterAs(\"parametername\", Pojo.class);<\/code><\/p><\/li>\n<li><p>Validate the class yourself using <code>javax.validation.Validation<\/code>. You can more or less copy and paste the approach from JSRValidator (<a href=\"https:\/\/github.com\/ninjaframework\/ninja\/blob\/develop\/ninja-core\/src\/main\/java\/ninja\/validation\/Validators.java\" rel=\"nofollow\">https:\/\/github.com\/ninjaframework\/ninja\/blob\/develop\/ninja-core\/src\/main\/java\/ninja\/validation\/Validators.java<\/a>).<\/p><\/li>\n<\/ul>\n\n<p>That's not too complicated. But it's not as automagic as annotating methods in the controllers.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419362920303,"favorite_count":null,"last_activity_date":1438869762397,"last_edit_date":1438869762397,"last_editor_display_name":null,"last_editor_user_id":682495.0,"owner_display_name":null,"owner_user_id":1991666.0,"parent_id":27625106,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":223,"id":27628788,"title":null,"body":"<p>I noticed two things on the code you sent through:<\/p>\n\n<ol>\n<li>the path you POST to is: localhost:xxxx\/joingroup\/1234 , this\nshould be localhost:xxxx\/api\/chat\/joingroup\/1234 <\/li>\n<li>because you have 2 parameters for the joingroup, you will need to pass both of them through, may be like this localhost:xxxx\/api\/chat\/joingroup\/1234?connectionID=value or you can pass it on the request body <\/li>\n<\/ol>\n\n<p>if the connectionID is optional you can modify the method to use option al parameters like this <\/p>\n\n<pre><code>public string JoinGroup(string id, string connectionID = \"\") \n<\/code><\/pre>\n\n<p>please let me know if this helps.\nThanks\nAshraf<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419372814683,"favorite_count":null,"last_activity_date":1419373425003,"last_edit_date":1419373425003,"last_editor_display_name":null,"last_editor_user_id":2163590.0,"owner_display_name":null,"owner_user_id":2163590.0,"parent_id":27628505,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":224,"id":27630158,"title":null,"body":"<p>Bear in mind that <code>#yt<\/code> is the ID of your <strong>target<\/strong> content (your hidden <code>div<\/code> that supposed to be in fancybox) therefore you cannot <em>bind<\/em> and <em>trigger<\/em> a <code>click<\/code> event to that selector but the one with <em>class<\/em> <code>fancybox<\/code> (the <strong>trigger<\/strong> element), which is actually pointing to the <code>#yt<\/code> selector :<\/p>\n\n<pre><code>&lt;a class=\"fancybox\" href=\"#yt\"&gt;test&lt;\/a&gt;\n<\/code><\/pre>\n\n<p>So, in your <code>openFancybox()<\/code> function you need to replace this line<\/p>\n\n<pre><code>$('#yt').trigger('click');\n<\/code><\/pre>\n\n<p>... by this one<\/p>\n\n<pre><code>$('.fancybox').trigger('click');\n<\/code><\/pre>\n\n<p>Then <em>bind<\/em> the <code>click<\/code> event to <code>.fancybox<\/code> replacing this line<\/p>\n\n<pre><code>$(\"#yt\").click(function () {\n<\/code><\/pre>\n\n<p>... by this one<\/p>\n\n<pre><code>$(\".fancybox\").click(function () {\n<\/code><\/pre>\n\n<p>See <strong><a href=\"http:\/\/jsfiddle.net\/3mo26zov\/\" rel=\"nofollow\">JSFIDDLE<\/a><\/strong><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419382822833,"favorite_count":null,"last_activity_date":1419382822833,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1055987.0,"parent_id":27627352,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":225,"id":27633747,"title":null,"body":"<p>As stated in the documentation <a href=\"http:\/\/docs.appgyver.com\/supersonic\/guides\/architecture\/app-config-files\/#structure-coffee\" rel=\"nofollow\">http:\/\/docs.appgyver.com\/supersonic\/guides\/architecture\/app-config-files\/#structure-coffee<\/a><\/p>\n\n<p><em>\"If you are not using tabs, you will need to define a root view\"<\/em><\/p>\n\n<p>By default in structure.coffee root view is commented out with # (hash tag). So now you can remove tabs array and define (uncomment) the root view setting with the correct view you want it to show by default.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419409199960,"favorite_count":null,"last_activity_date":1419409199960,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":507203.0,"parent_id":27633746,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":226,"id":27647325,"title":null,"body":"<p>OK, the problem seems to have been that I tried to convert it at the wrong time. If I loop through all Shapes and convert them before trying to do anything else it works fine.<\/p>\n\n<pre><code>int number = doc.InlineShapes.Count;\nMessageBox.Show(number.ToString()); \/\/ 0 to begin with\n\nforeach (Microsoft.Office.Interop.Word.Shape s in doc.Shapes) {\n MessageBox.Show(s.Type.ToString());\n if (s.Type.ToString() == \"msoTextBox\") {\n MessageBox.Show(s.TextFrame.TextRange.Text);\n } else if (s.Type.ToString() == \"msoPicture\") {\n s.ConvertToInlineShape();\n }\n}\n\nnumber = doc.InlineShapes.Count;\nMessageBox.Show(number.ToString()); \/\/ Now it's 1 as it should be\n\nInlineShape ils = doc.InlineShapes[1];\nils.Select();\napplication.Selection.Copy();\n\nIDataObject data = Clipboard.GetDataObject();\nif (data.GetDataPresent(DataFormats.Bitmap)) {\n Image image = (Image)data.GetData(DataFormats.Bitmap, true);\n image.Save(\"c:\\\\image.jpg\", System.Drawing.Imaging.ImageFormat.Jpeg);\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419511600897,"favorite_count":null,"last_activity_date":1419514838937,"last_edit_date":1419514838937,"last_editor_display_name":null,"last_editor_user_id":1967124.0,"owner_display_name":null,"owner_user_id":1967124.0,"parent_id":27643536,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":227,"id":27648583,"title":null,"body":"<p>Of all things... <\/p>\n\n<p>If the exact same process above is followed, however one uses the Centos 6.6 Netboot install and selects: X86_64, with minimal install and loading the installation from the URL (not from a DVD version) it works! The URL I used was: <\/p>\n\n<pre><code>http:\/\/mirror.centos.org\/centos\/6\/os\/x86_64\n<\/code><\/pre>\n\n<p>both 'xl list' and 'xm list' show the expected results.<\/p>\n\n<p>For clarity here are the new steps:<\/p>\n\n<pre><code>1) Download and install 'netboot' version of (CentOS 6.6) \n2) Install 'minimal' CentOS installation following all defaults with only the CentOS Repo, this required entering a URL for the location of the software: mirror.centos.org\/centos\/6\/x86_64\n3) Rebooted (no change to SE Linux)\n4) Reboot into CentOS 6.6 - 2.6 Kernel\n5) yum install centos-release-xen (accept 1 pkg install)\n6) yum install xen (accept 36 packages install)\n7) \/usr\/bin\/grub-bootxen.sh\n8) checked grub.conf file was present according to Xen4QuickStart under the \/boot\/grub\/, which it was exactly as they described\n9) reboot\n10) Login and run 'xl list', 'xm list' showing expected results, \n<\/code><\/pre>\n\n<p>Note: no changes to BIOS on the Intel NUC, no updates to BIOS required, no change to GRUB, nor to any configuration, simply an install from netboot. My thanks to another user who had this problem sometime back who suggested it may be related to EFI and that install from the site may resolve it.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419521789433,"favorite_count":null,"last_activity_date":1419522411180,"last_edit_date":1419522411180,"last_editor_display_name":null,"last_editor_user_id":2566578.0,"owner_display_name":null,"owner_user_id":2566578.0,"parent_id":27604480,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":228,"id":27650313,"title":null,"body":"<p>From my experience: you can freely create several contexts as long as you properly initialized OpenSSL library. I have used two different contexts in the same application with no problems after having set up threading locks as described in OpenSSL man page: <a href=\"http:\/\/www.openssl.org\/docs\/crypto\/threads.html\" rel=\"nofollow\">http:\/\/www.openssl.org\/docs\/crypto\/threads.html<\/a>. If your app doesn't use threads you won't need such setup at all. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419537522593,"favorite_count":null,"last_activity_date":1419537522593,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2277408.0,"parent_id":27649641,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":229,"id":27652635,"title":null,"body":"<p>I think you may have done it overkill by using the dialog to done the functionality of tool tip. IMHO, What you should do was add a tooltip to the cell that you want to have the \"excel comment\" functionality. So whenever, user hover to that cell, it will show the tooltip loaded with data from your comment. Take a look at the Basic Grid example at here: <a href=\"http:\/\/www.sencha.com\/examples\/#ExamplePlace:basicgrid\" rel=\"nofollow\">http:\/\/www.sencha.com\/examples\/#ExamplePlace:basicgrid<\/a>\nTry to hover your mouse to Change cell, it will pop you a tool tip. The key point was to create your own grid cell implementation, like this : <\/p>\n\n<pre><code>ColumnConfig&lt;Stock, Double&gt; changeCol = new ColumnConfig&lt;Stock, Double&gt;(props.change(), 100, \"Change\");\n changeCol.setCell(new AbstractCell&lt;Double&gt;() {\n\n @Override\n public void render(Context context, Double value, SafeHtmlBuilder sb) {\n String style = \"style='color: \" + (value &lt; 0 ? \"red\" : \"green\") + \"'\";\n String v = number.format(value);\n sb.appendHtmlConstant(\"&lt;span \" + style + \" qtitle='Change' qtip='\" + v + \"'&gt;\" + v + \"&lt;\/span&gt;\");\n }\n});\n<\/code><\/pre>\n\n<p>If you need to use different type of tooltip, take a look at the tooltips example at here: <a href=\"http:\/\/www.sencha.com\/examples\/#ExamplePlace:tooltips\" rel=\"nofollow\">http:\/\/www.sencha.com\/examples\/#ExamplePlace:tooltips<\/a><\/p>\n\n<p>Hope this could help you.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419565735623,"favorite_count":null,"last_activity_date":1419565735623,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1696191.0,"parent_id":27618638,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":230,"id":27664630,"title":null,"body":"<p>Googled a little more, if you wan't to watch an entire Object you must specify the third argument of <code>$watch<\/code>: objectEquality. <\/p>\n\n<p>From AngularJS Docs:<\/p>\n\n<blockquote>\n <p>Compare for object equality using angular.equals instead of comparing for reference equality.<\/p>\n<\/blockquote>\n\n<p>Watching an entire object:<\/p>\n\n<pre><code>$scope.$watch('App.preferences',function() {\n\n localStorage.preferences = JSON.stringify(vm.preferences);\n\n},true);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419657780683,"favorite_count":null,"last_activity_date":1419657780683,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2817739.0,"parent_id":27664536,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":231,"id":27664646,"title":null,"body":"<p>E.g.<\/p>\n\n<pre><code>Dim command As New SqlCeCommand(\"SELECT IMAGE FROM PRODUCT_CATEGORY WHERE (CATEGORY_NAME = @CATEGORY_NAME)\", cnn)\n\ncommand.Parameters.AddWithValue(\"@CATEGORY_NAME\", myTextBox.Text)\n<\/code><\/pre>\n\n<p>or:<\/p>\n\n<pre><code>Dim command As New SqlCeCommand(\"SELECT IMAGE FROM PRODUCT_CATEGORY WHERE (CATEGORY_NAME = @CATEGORY_NAME)\", cnn)\n\ncommand.Parameters.Add(\"@CATEGORY_NAME\", SqlDbType.VarChar, 50).Value = myTextBox.Text\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419658026637,"favorite_count":null,"last_activity_date":1419658026637,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":584183.0,"parent_id":27664607,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":232,"id":27686721,"title":null,"body":"<p>You chart is not default, so you need to customise it by using <a href=\"http:\/\/api.highcharts.com\/highcharts#Renderer\" rel=\"nofollow\">renderer<\/a> to add custom shapes. Each position can be calculated on xAxis tick positions (each of them keeps this value as pixels).<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419847283020,"favorite_count":null,"last_activity_date":1419847283020,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2021935.0,"parent_id":27669937,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":233,"id":27696259,"title":null,"body":"<p><code>__setitem__<\/code> is invoked by following syntax only:<\/p>\n\n<pre><code>obj[key] = value # this equals to obj.__setitem__(key, value)\n<\/code><\/pre>\n\n<p>In other cases, when you use <code>obj[key]<\/code> <code>__getitem__<\/code> is invoked.<\/p>\n\n<p>For example:<\/p>\n\n<pre><code>class MyClass(object):\n data = {}\n\n def __setitem__(self, key, value):\n self.data[key] = value\n print \"__setitem__ called\"\n\n def __getitem__(self, item):\n print \"__getitem__ called\"\n return self.data[item]\n\n\nc = MyClass()\nc['list'] = ['hello'] # __setitem__ called\nc['list'].append('world') # __getitem__ called\n<\/code><\/pre>\n\n<p>In other words, in the last line when you use c['list'], firstly <code>__getitem__<\/code> is invoked and it returns pointer to initialized above list ['hello']. After that, <code>append<\/code> method of this pointed is called.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419888381073,"favorite_count":null,"last_activity_date":1570713285227,"last_edit_date":1570713285227,"last_editor_display_name":null,"last_editor_user_id":3343.0,"owner_display_name":null,"owner_user_id":3467698.0,"parent_id":27680343,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":234,"id":27710357,"title":null,"body":"<p>As the error message indicates, you need a line number labeled 999 to which control is transferred when the end of the file is reached, as shown below.<\/p>\n\n<pre><code> subroutine readfiles\n\n implicit none\n\n\n integer :: N, l\n real, allocatable :: pos(:,:)\n\n N = 2 !Number of Lines\n\n allocate(orte(N,3))\n\n open (unit=99, file='positions.txt', status='old', action='read',)\n do l=1,N\n read (99,* ,END=999) pos(l,1), pos(l,2), pos(l,3)\n enddo\n 999 continue\n N = l-1\n do l=1,N\n print *, pos(l,1), pos(l,2), pos(l,3)\n enddo\n\nreturn\nEND subroutine readfiles\n<\/code><\/pre>\n\n<p>Btw I advise against using variables named \"l\", since \"l\" looks like 1.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419962918567,"favorite_count":null,"last_activity_date":1419967119160,"last_edit_date":1419967119160,"last_editor_display_name":null,"last_editor_user_id":528369.0,"owner_display_name":null,"owner_user_id":528369.0,"parent_id":27710248,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":235,"id":27715950,"title":null,"body":"<p><code>fixed<\/code> positioning removes the element from the flow of the document and can not be contained within a parent. Use <code>position: absolute<\/code> instead and set the parent <code>.screen-container<\/code> to <code>position: relative<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419998370803,"favorite_count":null,"last_activity_date":1419998370803,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3113558.0,"parent_id":27715924,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":236,"id":27728607,"title":null,"body":"<p>I tried using Jsoup and it worked, although the first few results include some undesired characters. Below is my code<\/p>\n\n<pre><code>package crawl_google;\nimport org.jsoup.Jsoup;\nimport org.jsoup.nodes.Document;\nimport org.jsoup.nodes.Element;\nimport org.jsoup.select.Elements;\npublic class googleResults {\npublic static void main(String[] args) throws Exception{\n\/\/pass the search query and the number of results as parameters\ngoogle_results(\"Natural Language Processing\", 10);\n}\npublic static void google_results(String keyword, int no_of_results) throws Exception\n{\n\/\/Replace space by + in the keyword as in the google search url\nkeyword = keyword.replace(\" \", \"+\");\nString url = \"https:\/\/www.google.com\/search?q=\" + keyword + \"&amp;num=\" + String.valueOf(no_of_results);\n\/\/Connect to the url and obain HTML response\nDocument doc = Jsoup\n.connect(url)\n.userAgent(\"Mozilla\")\n.timeout(5000).get();\n\/\/parsing HTML after examining DOM\nElements els = doc.select(\"li.g\");\nfor(Element el : els)\n{\n\/\/Print title, site and abstract\nSystem.out.println(\"Title : \" + el.getElementsByTag(\"h3\").text());\nSystem.out.println(\"Site : \" + el.getElementsByTag(\"cite\").text());\nSystem.out.println(\"Abstract : \" + el.getElementsByTag(\"span\").text() + \"\\n\");\n}\n}\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420091844427,"favorite_count":null,"last_activity_date":1420091844427,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3288346.0,"parent_id":27669122,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":237,"id":27736495,"title":null,"body":"<p>I got the answer. <\/p>\n\n<p>I just replace spring web-mvc 4.1.1 dependency with spring web-mvc 4.1.3 and it solved the build path problem. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420163323597,"favorite_count":null,"last_activity_date":1420163323597,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4066594.0,"parent_id":27732577,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":238,"id":27743143,"title":null,"body":"<p>I did a work around. I wrote a similar drag function for the connection maker and in that used the event.stopPropagation() and event.preventDefault() and the issue is resolved.Now we can make connections smoothly.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420206088753,"favorite_count":null,"last_activity_date":1420206088753,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4221852.0,"parent_id":27741963,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":239,"id":27743616,"title":null,"body":"<p>Since you are using Access 2010 you can have a Before Change <a href=\"http:\/\/office.microsoft.com\/en-ca\/access-help\/create-a-data-macro-HA010378170.aspx\" rel=\"nofollow noreferrer\">data macro<\/a> perform the validation. To do that, create a saved query named [TotalAllocatedCostByIDExpense] in Access<\/p>\n\n<pre class=\"lang-sql prettyprint-override\"><code>SELECT Allocations.IDExpense, Sum(Allocations.AllocatedCost) AS SumOfAllocatedCost\nFROM Allocations\nGROUP BY Allocations.IDExpense;\n<\/code><\/pre>\n\n<p>and then use the following Before Change data macro on the [Allocations] table<\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/NyffS.png\" alt=\"BeforeChange.png\"><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420208412977,"favorite_count":null,"last_activity_date":1420208412977,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2144390.0,"parent_id":27735139,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":240,"id":27748337,"title":null,"body":"<p>I solved the issue. <\/p>\n\n<p>The <code>NSURLDownload<\/code> object's <code>setDestination<\/code> method needs the not just the directory path (\/xx\/yy\/zz), but also the filename (\/xx\/yy\/zz\/abc.zip).<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420231607760,"favorite_count":null,"last_activity_date":1420232037620,"last_edit_date":1420232037620,"last_editor_display_name":null,"last_editor_user_id":3233503.0,"owner_display_name":null,"owner_user_id":3233503.0,"parent_id":27628527,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":241,"id":27748369,"title":null,"body":"<p>You need to declare which field is used for the object name, using the <a href=\"https:\/\/www.odoo.com\/documentation\/8.0\/reference\/orm.html#openerp.models.Model._rec_name\" rel=\"nofollow\"><code>_rec_name<\/code> attribute<\/a>. In your case:<\/p>\n\n<pre><code>class clicshopping_manufacturer(orm.Model):\n _name = 'clicshopping.manufacturer'\n _rec_name = 'clicshopping_manufacturers_name'\n\n # ...\n<\/code><\/pre>\n\n<p>Alternatively, you could just rename <code>clicshopping_manufacturers_name<\/code> to <code>name<\/code>, since <code>name<\/code> is the default value for <code>_rec_name<\/code>.<\/p>\n\n<p>I'd choose the second option, if I were you - I think all your field names are way too long, to be honest. I don't see any benefit to prefixing almost all your field names with \"clicshopping_manufacturers\". This will slow you down and make your code much less readable. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420231801570,"favorite_count":null,"last_activity_date":1420231801570,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":262618.0,"parent_id":27747607,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":242,"id":27753056,"title":null,"body":"<p>Check if you have references to <code>System.LINQ<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420273635327,"favorite_count":null,"last_activity_date":1420273635327,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4410999.0,"parent_id":27753043,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":243,"id":27760420,"title":null,"body":"<p>The <code>loadApp<\/code> function, called by your <code>on-tap<\/code>, is called before the component sets the <code>selection<\/code> attribute.<\/p>\n\n<p>The first time it's called, nothing is selected at the moment of the call.<\/p>\n\n<p>A way to do what you want if not using the <code>on-tap<\/code> but a listener to the change on <code>selection<\/code>:<\/p>\n\n<pre><code>&lt;polymer-element name=\"tdv-apps\" attributes=\"username\"&gt;\n &lt;template&gt;\n &lt;link rel=\"stylesheet\" href=\"tdv-apps.css\"&gt;\n &lt;div&gt;My Apps\n &lt;core-list id=\"appsList\" data=\"{{data}}\" scrollTarget=\"{{$.contentPanel.scroller}}\" \n height=\"100%\" selectionEnabled=\"true\" selection=\"{{selection}}\"&gt;\n Selected: {{selection.app_id}}\n &lt;template&gt;\n &lt;div id=\"current\" class=\"row {{ {selected: selected} | tokenList }}\" layout horizontal &gt;\n &lt;p class=\"app\"&gt;Name: {{model.name}} -- ID: {{model.app_id}} &lt;br\/&gt; Description: {{model.description}}&lt;\/p&gt;\n &lt;\/div&gt;\n &lt;\/template&gt;\n &lt;\/core-list&gt;\n &lt;\/div&gt;\n &lt;\/template&gt;\n &lt;script&gt;\n (function () {\n\n Polymer('tdv-apps', {\n ready: function() {\n \/\/apps_list will be pulled from the server via JS or a core-ajax element \n this.data = [\n {name: \"App 1\", app_id: 'tdvapp-001', description:\" App number 1.\"},\n {name: \"App 2\", app_id: 'tdvapp-002', description:\" App number 2.\"},\n {name: \"App 3\", app_id: 'tdvapp-003', description:\" App number 3.\"},\n {name: \"App 4\", app_id: 'tdvapp-004', description:\" App number 4.\"},\n {name: \"App 5\", app_id: 'tdvapp-005', description:\" App number 5.\"},\n {name: \"App 6\", app_id: 'tdvapp-006', description:\" App number 6.\"},\n {name: \"App 7\", app_id: 'tdvapp-007', description:\" App number 7.\"},\n {name: \"App 8\", app_id: 'tdvapp-008', description:\" App number 8.\"},\n {name: \"App 9\", app_id: 'tdvapp-009', description:\" App number 9.\"},\n {name: \"App 10\", app_id: 'tdvapp-010', description:\" App number 10.\"},\n {name: \"App 11\", app_id: 'tdvapp-011', description:\" App number 11.\"},\n {name: \"App 12\", app_id: 'tdvapp-012', description:\" App number 12.\"}\n ]; \n },\n\n selectionChanged: function(){\n console.log(this.$.appsList.selection.app_id)\n },\n\n }); \/\/ Polymer close\n\n })();\n &lt;\/script&gt;\n&lt;\/polymer-element&gt; \n<\/code><\/pre>\n\n<p>A Plunker is here: <a href=\"http:\/\/plnkr.co\/edit\/rOuNPu99D7ROX4ewbLnK?p=preview\" rel=\"nofollow\">http:\/\/plnkr.co\/edit\/rOuNPu99D7ROX4ewbLnK?p=preview<\/a><\/p>\n\n<p>I hope it helps :)<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420325682477,"favorite_count":null,"last_activity_date":1420325682477,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1491271.0,"parent_id":27741436,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":244,"id":27768654,"title":null,"body":"<p>Here's what finally worked for me if someone struggles with something similair in future:<\/p>\n\n<p><code>PYTHON=\/usr\/bin\/python jhbuild build gnome-weather<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420394797630,"favorite_count":null,"last_activity_date":1420394797630,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3552561.0,"parent_id":27733325,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":245,"id":27805596,"title":null,"body":"<p>I finally found my answer in a comment at <a href=\"https:\/\/stackoverflow.com\/questions\/26950969\/doxygen-how-to-create-hyperlinks-to-class-definitions-from-mainpage-dox#comment42492365_26950969\">doxygen: how to create hyperlinks to class definitions from Mainpage.dox?<\/a>.<\/p>\n\n<p>Essentially, the answer was to change my <code>mainpage.md<\/code> file into a <code>mainpage.dox<\/code> file, and surround my mainpage with a <code>namespace<\/code> declaration, like so: <\/p>\n\n<pre><code>namespace com.mycompany.myproject {\n\n\/**\n * {mainpage text here}\n *\/\n}\n<\/code><\/pre>\n\n<p>This makes the mainpage within the namespace, and instructed Doxygen to look in the right namespace for any class names mentioned in the mainpage body.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420571750167,"favorite_count":null,"last_activity_date":1420572353257,"last_edit_date":1495535621420,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1159805.0,"parent_id":27573608,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":246,"id":27982912,"title":null,"body":"<p>Altering the function has accomplished the multiple level drill down, updated function below:<\/p>\n\n<pre><code>function generateChartDataPie () {\n var chartDataPie = [];\n\n if (selected) {\n for (var x = 0; x &lt; selected.length; x++) {\n chartDataPie.push({\n response: selected[x].response,\n count: selected[x].count,\n pulled: true,\n subdata: selected[x].subdata\n });\n }\n }\n else {\n chartDataPie = piedata;\n }\n return chartDataPie;\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1421407401757,"favorite_count":null,"last_activity_date":1421407401757,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4362129.0,"parent_id":27483225,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":247,"id":27391937,"title":null,"body":"<p>I believe they are identical. They perform the same function anyway. They appear to be implemented separately, rather than having one call the other. I'm unsure why.<\/p>\n\n<p>The only difference I can see is that <code>toDateTime<\/code> <em>must<\/em> be implemented, because it is defined in <code>AbstractInstant<\/code>, and <code>DateTime<\/code> extends <code>AbstractInstant<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418174903243,"favorite_count":null,"last_activity_date":1418174903243,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":634824.0,"parent_id":27386753,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":248,"id":27409625,"title":null,"body":"<p>I think the answer might be in the <a href=\"http:\/\/docs.oracle.com\/javase\/8\/docs\/api\/java\/util\/RandomAccess.html\" rel=\"nofollow\">documentation<\/a> of <code>RandomAccess<\/code> (emphasis mine).<\/p>\n\n<blockquote>\n <p>Marker interface used by <code>List<\/code> implementations to indicate that they support fast (generally constant time) random access. <strong>The primary purpose of this interface is to allow generic algorithms to alter their behavior to provide good performance when applied to either random or sequential access lists.<\/strong><\/p>\n \n <p>The best algorithms for manipulating random access lists (such as <code>ArrayList<\/code>) can produce quadratic behavior when applied to sequential access lists (such as <code>LinkedList<\/code>). <strong>Generic list algorithms are encouraged to check whether the given list is an <code>instanceof<\/code> this interface<\/strong> before applying an algorithm that would provide poor performance if it were applied to a sequential access list, and to alter their behavior if necessary to guarantee acceptable performance.<\/p>\n<\/blockquote>\n\n<p>It seems that they did not intend to add additional complexity to the collections class hierarchy but only offer an optimization opportunity to algorithms.<\/p>\n\n<p>This does make some sense to me. The user of an algorithm generally does not need to be concerned with implementation details. Every algorithm that works on a <code>List<\/code> implementing <code>RandomAccess<\/code> will also work on a <code>List<\/code> that does not do so. The only difference is performance.<\/p>\n\n<p>Consider the following cases:<\/p>\n\n<ul>\n<li>There is no way to re-write an algorithm to be more efficient for <code>List<\/code>s that do not provide efficient random access. (Or nobody felt like doing so yet.) In this case, it will probably still be better to have a slow algorithm than none at all. If the user needs the algorithm frequently, it should switch to a different <code>List<\/code> implementation.<\/li>\n<li>The algorithm can be re-written in two slightly different ways that each yield best performance for <code>List<\/code>s that do and do not support efficient random access. Here, the user would generally prefer to simply put in the <code>List<\/code> and have the algorithm decide what version to use. If overload resolution were used instead of run-time type introspection, a user might accidentally miss the optimized version if dealing with an abstract <code>List<\/code> type. Having the caller check every time whether the <code>List<\/code> is an <code>instanceof<\/code> <code>RandomAccess<\/code> litters the code more than doing it once in the algorithm itself. Finally, if an algorithm is later improved to support two versions, we need not go and alter client code.<\/li>\n<\/ul>\n\n<p>Therefore, I think they did it they way they did it to actively <em>prevent<\/em> the interface being used as you wish to use it. Of course, there will probably be legitimate uses that are negatively affected by this choice but it seems like a reasonable trade-off.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418241034247,"favorite_count":null,"last_activity_date":1418241034247,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1392132.0,"parent_id":27409287,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":249,"id":27412592,"title":null,"body":"<p>You cannot do this in a general way. It is not possible to determine whether there is a server socket listening at the remote endpoint, not on your local machine, without actually trying to connect.<\/p>\n\n<p>Note that this is a variation on the \"file exists?\" problem, and has the same general answer: don't do that.<\/p>\n\n<p>Even if you could confirm the presence of a remote server prior to a connection attempt, it doesn't matter because the server could stop working between the time you check for it, and the time you actually try to connect.<\/p>\n\n<p>So you have to handle the scenario where you attempt to connect to a server and fail anyway. Finding out in advance doesn't make things easier on you, and it doesn't really help the user very much either.<\/p>\n\n<p>If you <em>really<\/em> want to validate the user's input, you can in fact go ahead and connect to the server, and then immediately disconnect (with graceful closure...i.e. call <code>Socket.Shutdown(SocketShutdown.Send)<\/code> and wait for a 0-byte receive to complete before you actually close\/dispose the <code>Socket<\/code> instance).<\/p>\n\n<p>But personally, I'd just accept the user's input and then if later it turns out to be invalid, let them know when you actually find out that it is.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418253137587,"favorite_count":null,"last_activity_date":1418253137587,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3538012.0,"parent_id":27412519,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":250,"id":27426312,"title":null,"body":"<p>You also need a mutex:<\/p>\n\n<pre><code>void work(QMutex* mutex, QWaitCondtion* cond, volatile bool* wake){\n \/\/do work\n {\n QMutexLocker locker(mutex);\n while(!*wake){\n cond-&gt;wait(mutex);\n }\n }\n \/\/do more work\n}\n<\/code><\/pre>\n\n<p>The loop is necessary to avoid spurious wakeups and let the thread fall through if <code>wake<\/code> is already set to <code>true<\/code>. Locking over the entire loop is needed to avoid various race conditions.<\/p>\n\n<p>You wake the thread with:<\/p>\n\n<pre><code>{\n QMutexLocker locker(mutex);\n *wake = true;\n cond-&gt;wakeOne();\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418311438953,"favorite_count":null,"last_activity_date":1418311438953,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":731620.0,"parent_id":27426058,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":251,"id":27432681,"title":null,"body":"<p>Well, I came up with a solution. You can make it work by importing the environment into your base template and acting on that.<\/p>\n\n<p>assets.py:<\/p>\n\n<pre><code>import os\nfrom flask.ext import assets\nfrom app import app\n\nenv = assets.Environment(app)\n\n# Tell flask-assets where to look for our coffeescript and sass files.\nenv.load_path = [\n os.path.join(os.path.dirname(__file__), 'js'),\n os.path.join(os.path.dirname(__file__), 'styles'),\n]\n\ncoffee = assets.Bundle('**\/*.coffee', filters='coffeescript', output=\"app.js\")\nenv.register('coffee', coffee)\n<\/code><\/pre>\n\n<p>Template:<\/p>\n\n<pre><code>&lt;%!\n from assets import env\n%&gt;\n\n&lt;!doctype html&gt;\n\n&lt;html&gt;\n &lt;head&gt;\n &lt;title&gt;Hello Flask&lt;\/title&gt;\n &lt;head&gt;\n &lt;body&gt;\n &lt;h1&gt;Hello Flask&lt;\/h1&gt;\n\n % for url in env['coffee'].urls():\n &lt;script src=\"${url}\"&gt;&lt;\/script&gt;\n % endfor\n\n &lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n\n<p>There might be way to avoid the import by using the MAKO_IMPORTS config parameter but I haven't played with it.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418333226273,"favorite_count":null,"last_activity_date":1418333226273,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2178164.0,"parent_id":27431664,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":252,"id":27433612,"title":null,"body":"<p>Your assumption about <code>WithId[T, R]<\/code> being of type <code>Table[R]<\/code> is wrong. The self-type annotation in <code>WithId[T, R]<\/code> just requires a <code>Table[R]<\/code> to be mixed in, but that doesn't mean that <code>WithId[T, R]<\/code> is a <code>Table[R]<\/code>.<\/p>\n\n<p>I think you confuse the declaration of <code>WithId<\/code> with instances of <code>WithId<\/code> which eventually need to be an instance of a <code>Table<\/code>.<\/p>\n\n<p>Your upper type bound constraint in the <code>GenericSlickDAO<\/code> trait also doesn't guarantee you the property of <code>WithId<\/code> to be an instance of <code>Table<\/code>, since any type is a subtype of itself.<\/p>\n\n<p>See <a href=\"https:\/\/stackoverflow.com\/questions\/1990948\/what-is-the-difference-between-scala-self-types-and-trait-subclasses\">this<\/a> question for a more elaborate explanation about the differences between self-types and subtypes.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418336884933,"favorite_count":null,"last_activity_date":1418371926467,"last_edit_date":1495542852413,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":3567830.0,"parent_id":27413340,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":253,"id":27450563,"title":null,"body":"<p>You should create separate implementations, one with the bound and the other without, like this:<\/p>\n\n<pre><code>impl&lt;T:Num&gt; Position&lt;T&gt;{\n fn add(&amp;self, other: &amp;Position&lt;T&gt;) -&gt; Box&lt;Position&lt;T&gt;&gt;{\n box Position{x:self.x + other.x, y:self.y + other.y}\n }\n}\n\nimpl&lt;T&gt; Position&lt;T&gt;{\n fn display(&amp;self) -&gt; String{\n \"WELCOME \".to_string()\n }\n}\n<\/code><\/pre>\n\n<p>You can see that it works <a href=\"http:\/\/is.gd\/3pRn30\" rel=\"nofollow\">here<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418411706407,"favorite_count":null,"last_activity_date":1418411706407,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":101090.0,"parent_id":27449082,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":254,"id":27451000,"title":null,"body":"<p>The Autodiscover service is providing a redirection. Try adding this <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dd635285(v=exchg.80).aspx\" rel=\"nofollow\">callback<\/a> as the second argument in the Autodiscover URL method:<\/p>\n\n<pre><code>static bool RedirectionCallback(string url)\n{\n \/\/ Return true if the URL is an HTTPS URL.\n return url.ToLower().StartsWith(\"https:\/\/\");\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418413529007,"favorite_count":null,"last_activity_date":1418413529007,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2917277.0,"parent_id":27439981,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":255,"id":27500562,"title":null,"body":"<p>Just do a SAVE AS for your read-only report file. And then open the resulting .odt document. It will be editable.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418719207110,"favorite_count":null,"last_activity_date":1418738719283,"last_edit_date":1418738719283,"last_editor_display_name":null,"last_editor_user_id":4000771.0,"owner_display_name":null,"owner_user_id":4000771.0,"parent_id":27500386,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":256,"id":27500698,"title":null,"body":"<p>Style.xml<\/p>\n\n<pre><code>&lt;resources&gt;\n &lt;style name=\"AppBaseTheme\" parent=\"Theme.AppCompat.Light\"&gt; &lt;\/style&gt;\n &lt;style name=\"AppTheme\" parent=\"AppBaseTheme\"&gt;\n&lt;\/style&gt;\n&lt;\/resources&gt;\n<\/code><\/pre>\n\n<p>In your manifest.xml<\/p>\n\n<pre><code> &lt;activity \n android:name=\"YourActivity\"\n android:theme=\"@android:style\/Theme.Light.NoTitleBar\"&gt;\n &lt;\/activity&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418719798353,"favorite_count":null,"last_activity_date":1418719798353,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2859265.0,"parent_id":27500501,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":257,"id":27524392,"title":null,"body":"<p>See my answers for these questions:<\/p>\n\n<ul>\n<li><strong><a href=\"https:\/\/stackoverflow.com\/a\/26940206\/359307\">ImageMagick Command-Line Option Order (and Categories of Command-Line Parameters)<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/stackoverflow.com\/a\/27194202\/359307\">ImageMagick \u201ccolor to alpha\u201d<\/a><\/strong><\/li>\n<\/ul>\n\n<p>Because <code>-brightness-contrast<\/code> is an <em>image operator<\/em> (not an <em>image setting<\/em>) it is applied immediately to all currently loaded images (and then forgotten):<\/p>\n\n<ol>\n<li><p>When you apply it the <em>first<\/em> time, only <code>thing1.jpg<\/code> is loaded. The operator is applied to this one image.<\/p><\/li>\n<li><p>When you apply it the <em>second<\/em> time, <code>thing2.jpg<\/code> is loaded, but also the (already modified!) <code>thing1.jpg<\/code> is still loaded. The operator is applied to both these images.<\/p><\/li>\n<\/ol>\n\n<p>To explain how your + my versions of the command works, be aware of this:<\/p>\n\n<ul>\n<li><strong>-loop 0<\/strong> : is an <em>image setting<\/em><\/li>\n<li><strong>-delay 10<\/strong> : is an <em>image setting<\/em><\/li>\n<li><strong>-brightness-contrast 5x5<\/strong> : is an <em>image operator<\/em><\/li>\n<li><strong>-layers optimize<\/strong> : is an <em>image sequence operator<\/em><\/li>\n<\/ul>\n\n<p>Therefor, you should try this:<\/p>\n\n<pre><code>convert -loop 0 \\\n -delay 10 \\\n thing1.jpg \\\n thing2.jpg \\\n thing3.jpg \\\n thing4.jpg \\\n -brightness-contrast 5x5 \\\n -layers optimize \\\n thing.gif\n<\/code><\/pre>\n\n<p>If you need to apply different values, but non-accumulatively, controlling each level of brightness-contrast separately, you should use the <code>\\(.....\\)<\/code> bracketing for <em>'aside'<\/em>-processing of images:<\/p>\n\n<pre><code>convert -loop 0 \\\n \\( thing1.jpg -delay 10 -brightness-contrast 5x5 \\) \\\n \\( thing2.jpg -delay 20 -brightness-contrast 10x20 \\) \\\n \\( thing3.jpg -delay 100 -brightness-contrast 10% \\) \\\n \\( thing4.jpg -delay 1 -brightness-contrast 0x50 \\) \\\n -layers optimize \\\n thing.gif\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418815057717,"favorite_count":null,"last_activity_date":1418838481210,"last_edit_date":1495539840343,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":359307.0,"parent_id":27519712,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":258,"id":27539235,"title":null,"body":"<p>Try this instead:<\/p>\n\n<pre><code>sqoop list-databases --connect jdbc:mysql:\/\/localhost \\\n --username root \\\n --password aaaaaaaa\n<\/code><\/pre>\n\n<p>Problem was there is not options <code>--user<\/code> for Sqoop instead you have to use <code>--username<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418876773413,"favorite_count":null,"last_activity_date":1418876773413,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1801327.0,"parent_id":27533947,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":259,"id":27550132,"title":null,"body":"<p>It should be on the <strong>service layer<\/strong>. If you have some sort of user service in your application (for instance an implementation of <code>UserDetailsService<\/code>), put the method for creating a new user there and set the default role in that method.<\/p>\n\n<p>DAO layer should be concerned with CRUD access to your database and as such it shouldn't deal with business logic such as assigning default roles when creating users.<\/p>\n\n<p>Controller is also not a suitable place for this kind of logic, because it is a presentation layer component and user creation\/role assignment is a core logic completely independent of the presentation layer.<\/p>\n\n<p>I'm not sure about using a database trigger for this purpose, but personally I like to keep my logic in my application not scattered between database and the application.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418916666273,"favorite_count":null,"last_activity_date":1418916666273,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1291150.0,"parent_id":27549562,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":260,"id":27566820,"title":null,"body":"<p>I just remove the Gemfile.lock by using the terminal.<\/p>\n\n<pre><code>rm Gemfile.lock\n<\/code><\/pre>\n\n<p>and then <code>bundle install<\/code><\/p>\n\n<p>It worked for me but I don't know why is works.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418994496460,"favorite_count":null,"last_activity_date":1454622609373,"last_edit_date":1454622609373,"last_editor_display_name":null,"last_editor_user_id":263858.0,"owner_display_name":null,"owner_user_id":4125037.0,"parent_id":27499689,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":261,"id":27579492,"title":null,"body":"<p>Just add \"HDR=No\" at the end of your connection string which means \"No header row that indicates column but it contains data\", then you will be able to fetch 1st row data also.<\/p>\n\n<p>So your complete connection string would be<\/p>\n\n<pre><code> conn = (\"Provider=Microsoft.ACE.OLEDB.12.0;\" +\n (\"Data Source=\" + _filename + \";\" +\n \"Extended Properties=\\\"Excel 12.0;\\\";HDR=No\"));\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419072917787,"favorite_count":null,"last_activity_date":1419072917787,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4380099.0,"parent_id":27579450,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":262,"id":27580482,"title":null,"body":"<p>Rather than having a Leading Space and Trailing Space constraint on the Example view, add a Horizontally Center In Container.<\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/KLOAh.png\" alt=\"enter image description here\"><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419080325980,"favorite_count":null,"last_activity_date":1419080892063,"last_edit_date":1419080892063,"last_editor_display_name":null,"last_editor_user_id":724514.0,"owner_display_name":null,"owner_user_id":724514.0,"parent_id":27580391,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":263,"id":27582222,"title":null,"body":"<p><code>GLSL ES 1.00<\/code> for <code>OpenGL ES 2.0<\/code> <a href=\"https:\/\/www.khronos.org\/registry\/gles\/specs\/2.0\/GLSL_ES_Specification_1.0.17.pdf\" rel=\"nofollow noreferrer\">spec<\/a> has this line:<\/p>\n<blockquote>\n<p><strong>Uniforms (excluding samplers)<\/strong><\/p>\n<p>In the vertex shader, support for all forms of array indexing is\nmandated. In the fragment shader, support for indexing is only\nmandated for constant-index-expressions.<\/p>\n<\/blockquote>\n<p>Most drivers implement this functionality in fragment shaders, but it's not required so Tegra 4 has all rights to refuse to accept your code.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419093594253,"favorite_count":null,"last_activity_date":1419093594253,"last_edit_date":1592644375060,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":2502409.0,"parent_id":27580458,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":264,"id":27582259,"title":null,"body":"<p>The way to do something like this would be to use an \"offset\". Unfortunately, the way offset it implemented, it doesn't \"skip\" looking at 1-50. It'll read them (costing you a read in your daily quotas\/budgets), and return the following results. It will do what you want, but it will still charge you, unfortunately,<\/p>\n\n<p>You'd have to write something like <\/p>\n\n<pre><code>List&lt;Entity&gt; getRandomEntities() {\n DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n\n Query queryForEntities = new Query(\"Entity\");\n\n PreparedQuery preppedEntityQuery = datastore.prepare(q);\n return preppedEntityQuery.asList(FetchOptions.Builder.withOffset([OFFSET_YOU_WANT]).withLimit([AMOUNT_YOU_WANT]));\n}\n<\/code><\/pre>\n\n<p>Look into <a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/datastore\/queries\" rel=\"nofollow\">this<\/a> if you need additional info :)<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419093944267,"favorite_count":null,"last_activity_date":1419093944267,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2417948.0,"parent_id":27575440,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":265,"id":27583501,"title":null,"body":"<p>The issue got resolved. I hope the below case is the specific reason for the issue.<\/p>\n\n<p>I gave date input in the format (<code>yyyy-MM-dd<\/code>), i.e. : <\/p>\n\n<pre><code>query.bindValue(\":dob\", client.dob.toString(yyyy-MM-dd));\n<\/code><\/pre>\n\n<p>I came to know that MSSQL takes date in the particular format only. I am not certain about this, however it works fine now.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419103198147,"favorite_count":null,"last_activity_date":1419103354100,"last_edit_date":1419103354100,"last_editor_display_name":null,"last_editor_user_id":3444240.0,"owner_display_name":null,"owner_user_id":2875826.0,"parent_id":27511529,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":266,"id":27586284,"title":null,"body":"<p>I am afraid you are out of luck.<\/p>\n\n<p>GitHub states that,<\/p>\n\n<blockquote>\n <p>Generic email addresses--such as [email protected] be added to GitHub accounts. If you use such an email for your commits, the commits will not be linked to your GitHub profile and will not show up in your contributions graph.<\/p>\n<\/blockquote>\n\n<p>So, if you are not willing to \/ can't rewrite your history, and GitHub is not willing to amend the above rule, there is no way to accomplish what you seek.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419130005487,"favorite_count":null,"last_activity_date":1419130005487,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":445438.0,"parent_id":27586203,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":267,"id":27626489,"title":null,"body":"<p>You should check out <a href=\"https:\/\/pypi.python.org\/pypi\/TxSNI\" rel=\"nofollow\">TxSNI<\/a>. It should do what you want with a very straightforward arrangement of multiple certificates in a directory.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419361573040,"favorite_count":null,"last_activity_date":1419361573040,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":13564.0,"parent_id":27620315,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":268,"id":27634565,"title":null,"body":"<p>You're creating async functions incorrectly, your chaining with <code>.then<\/code> should work but your setTimeout never waits for <code>r<\/code> to change. <\/p>\n\n<p>To create promises from arbitrary callbacks use the promise constructors:<\/p>\n\n<pre><code>function f1(p1){\n console.log(\"init value or f2 return:\"+p1);\n\n return new Promise(function(resolve){\n setTimeout(function(){\n resolve(\"aysnc result\");\n },1000)\n });\n}\n<\/code><\/pre>\n\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/22519784\/how-do-i-convert-an-existing-callback-api-to-promises\">Here is the generic question on how to do this.<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419413263113,"favorite_count":null,"last_activity_date":1419413263113,"last_edit_date":1495541663047,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1348195.0,"parent_id":27634502,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":269,"id":27695791,"title":null,"body":"<p>The problem in this case ended up being the \"Content Mode\" setting of the NSTableView, which is specified in the Attributes inspector.<\/p>\n\n<p>The default setting is apparently \"View based\" but needed to be \"Cell based\". After making this change and rebuilding, voila! it worked.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419886105927,"favorite_count":null,"last_activity_date":1419886105927,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":529322.0,"parent_id":27685229,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":270,"id":27705381,"title":null,"body":"<p>It is too soon to open the file dialog in the <code>initialize<\/code> method of a JavaFX controller. When this method is called, the FXML node tree is still in loading + initialization phase, so it has not been attached to the <code>Scene<\/code> yet.<\/p>\n\n<p>So <code>getScene()<\/code> returns <code>null<\/code>.<\/p>\n\n<p>You have to call <code>onStartup()<\/code> later, when the scene graph has been fully initialized. You can do that via <code>Platform.runLater()<\/code>:<\/p>\n\n<pre><code>@Override\npublic void initialize(URL location, ResourceBundle resources) {\n playView.setImage(new Image(getClass().getResource(\"Pause.png\").toExternalForm()));\n playView.setVisible(false);\n playView.setOnMouseClicked(event -&gt; onPlayView());\n Platform.runLater(this::onStartup);\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419942033990,"favorite_count":null,"last_activity_date":1419942033990,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":993742.0,"parent_id":27705244,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":271,"id":27721903,"title":null,"body":"<p>if you are using mocha it provides the \"done\" function that you can inject into your callback and it will tell mocha that test is async and should wait until that function is called<\/p>\n\n<pre><code>it('should do something',function(done){\n reuest.send(function(){\n expect(true).toEqual(true);\n done()\n })\n})\n<\/code><\/pre>\n\n<p>or something like that i don't remember is this is 100% the right syntax, but is pretty close\nthis is good for callbacks but if you are using promises on the other hand you should check chai and mocha's promises assertions, are pretty cool<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420032966477,"favorite_count":null,"last_activity_date":1420032966477,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2953420.0,"parent_id":27721082,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":272,"id":27739165,"title":null,"body":"<p>SwiftHTTP, like NSURLSession, is async by design. Meaning that you can not just return from the method. <\/p>\n\n<pre><code>import SwiftHTTP\n\nfunc splitSentenceIntoWordsUsingTextAnalysis (string: String, finished:((String) -&gt; Void)) {\n var request = HTTPTask()\n var params = [\"text\": \"\u8fd9\u662f\u4e2d\u6587\u6d4b\u8bd5\"] \/\/: Dictionary&lt;String,AnyObject&gt;\n \/\/request.requestSerializer = JSONRequestSerializer()\n request.requestSerializer.headers[\"X-Mashape-Key\"] = \"My-API-Key\"\n request.requestSerializer.headers[\"Content-Type\"] = \"application\/x-www-form-urlencoded\"\n request.responseSerializer = JSONResponseSerializer()\n request.POST(\"https:\/\/textanalysis.p.mashape.com\/segmenter\", parameters: params, success: {\n (response: HTTPResponse) in\n if let res: AnyObject = response.responseObject {\n \/\/ decode res as string.\n let resString = res as String\n finished(resString)\n }\n }, failure: {(error: NSError, response: HTTPResponse?) in\n println(\" error \\(error)\")\n })\n}\n<\/code><\/pre>\n\n<p>Then you would use it like this.<\/p>\n\n<pre><code>splitSentenceIntoWordsUsingTextAnalysis(\"textToSplit\", {(str:String) in\n println(str)\n \/\/ do stuff with str here.\n})\n<\/code><\/pre>\n\n<p>Also see this Github issue as well.<\/p>\n\n<p><a href=\"https:\/\/github.com\/daltoniam\/SwiftHTTP\/issues\/30\" rel=\"nofollow\">https:\/\/github.com\/daltoniam\/SwiftHTTP\/issues\/30<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420185741460,"favorite_count":null,"last_activity_date":1420185741460,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":839900.0,"parent_id":27723917,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":273,"id":27751862,"title":null,"body":"<p>Populate data in Listview using <code>AsyncTask<\/code> you should override <code>onPostExecute<\/code> method of <code>AsyncTask<\/code> to call populateListView() method.do it as:<\/p>\n\n<p>Override <code>onPostExecute<\/code> in <code>GetBlogPostsTask<\/code> class :<\/p>\n\n<pre><code>@Override\n protected void onPostExecute(Void result) {\n \/\/ call populateListView method here\n populateListView();\n super.onPostExecute(result);\n }\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420260873707,"favorite_count":null,"last_activity_date":1420260873707,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1202025.0,"parent_id":27751839,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":274,"id":27808443,"title":null,"body":"<p>try running <code>grails clean-all<\/code> command. It cleared the issue for me after upgrading to asset-pipeline:2.0.19.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420583740863,"favorite_count":null,"last_activity_date":1420583740863,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":688129.0,"parent_id":27562000,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":275,"id":27396893,"title":null,"body":"<p>That's not really how you do prototypical inheritance with constructor functions in JavaScript (it's not inheritance at all, just copying methods between instances). With any of the standard inheritance patterns, you'd be getting the right <code>test<\/code>.<\/p>\n\n<p>Here's an example:<\/p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>\/\/ On old browsers like IE8, we need to shim Object.create\nif (!Object.create) {\n Object.create = function(proto, props) {\n if (typeof props !== \"undefined\") {\n throw \"The second argument of Object.create cannot be polyfilled\";\n }\n function ctor() { }\n ctor.prototype = proto;\n return new ctor();\n };\n}\n\n\/\/ Define our Base constructor\nfunction Base() {\n}\n\n\/\/ Define Base#test\nBase.prototype.test = function() {\n snippet.log(\"Base#test\");\n};\n\n\/\/ Derive A from Base\nfunction A() {\n Base.call(this);\n}\nA.prototype = Object.create(Base.prototype);\nA.prototype.constructor = A;\n\n\/\/ Define A#test\nA.prototype.test = function() {\n snippet.log(\"A#test\");\n};\n\n\/\/ Derive ChildA from A\nfunction ChildA() {\n A.call(this);\n}\nChildA.prototype = Object.create(A.prototype);\nChildA.prototype.constructor = ChildA;\n\n\/\/ Define ChildA#test\nChildA.prototype.test = function() {\n snippet.log(\"ChildA#test\");\n};\n\n\/\/ Run\nvar b = new Base();\nb.test();\nvar a = new A();\na.test();\nvar ca = new ChildA();\nca.test();<\/code><\/pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;!-- Script provides the `snippet` object, see http:\/\/meta.stackexchange.com\/a\/242144\/134069 --&gt;\n&lt;script src=\"http:\/\/tjcrowder.github.io\/simple-snippets-console\/snippet.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/p>\n\n<p>If you're going to be doing a lot of inheritance like this with constructor functions, you might be interested in my helper script <a href=\"http:\/\/code.google.com\/p\/lineagejs\/\" rel=\"nofollow\"><code>Lineage<\/code><\/a>, which makes things more concise and well-contained, and simplifies \"supercalls\" (chaining to the parent's version of a method). But of course, that script will be outdated soon by ES6's <code>class<\/code> feature.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418202143350,"favorite_count":null,"last_activity_date":1418202143350,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":157247.0,"parent_id":27396787,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":276,"id":27397029,"title":null,"body":"<p>You can use the <a href=\"https:\/\/jersey.java.net\/nonav\/apidocs\/1.18\/jersey\/com\/sun\/jersey\/api\/client\/ClientResponse.html\" rel=\"nofollow\">ClientResponse<\/a> type in Jackson. For example, using a GET operation:<\/p>\n\n<pre><code>ClientResponse response = Client.create()\n .resource(url)\n .get(ClientResponse.class);\nString contentType = response.getHeaders()\n .getFirst(\"Content-Type\");\nSystem.out.println(contentType);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418202572643,"favorite_count":null,"last_activity_date":1418202572643,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":304.0,"parent_id":27395114,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":277,"id":27413079,"title":null,"body":"<p>What is confusing is that the browser does not show the parallel class-side hierarchy...<\/p>\n\n<p>You know that true is an instance of class True, so if you send a message to true, it must be understood by it's class True, or one of its superclasses. We can use a browser for browsing that set of messages:<\/p>\n\n<pre><code>True browseHierarchy.\n<\/code><\/pre>\n\n<p>If we inquire the inheritance by repeatedly sending superclass messages, that closely matches what the hierarchy browser shows, so far so good :<\/p>\n\n<pre><code>True superclass -&gt; Boolean.\nBoolean superclass -&gt; Object.\nObject superclass -&gt; ProtoObject.\nProtoObject superclass -&gt; nil.\n<\/code><\/pre>\n\n<p>Now what if you send a message to the class True itself? It will be understood by it's class, True class (which is a metaclass <code>True class class == Metaclass<\/code>).<\/p>\n\n<p>But let's inquire the hierarchy of the metaclass True class :<\/p>\n\n<pre><code>True class superclass -&gt; Boolean class.\nBoolean class superclass -&gt; Object class.\nObject class superclass -&gt; ProtoObject class.\nProtoObject class superclass -&gt; Class.\nClass superclass -&gt; ClassDescription.\nClassDescription superclass -&gt; Behavior.\nBehavior superclass -&gt; Object.\nObject superclass -&gt; ProtoObject.\nProtoObject superclass -&gt; nil.\n<\/code><\/pre>\n\n<p>Ah Ah! It's deeper than what the browser shows...<br>\nUnsurprisingly, you find Class in this hierarchy, so as to satisfy this:<\/p>\n\n<pre><code>\"True is a (kind of) class\" (True isKindOf: Class) -&gt; true.\n<\/code><\/pre>\n\n<p>Since True class inherits from Behavior, any method of Behavior is understood by all the instances of True class (normally, there is a single one, <code>True class soleInstance == True<\/code>).<\/p>\n\n<p>So, back to the problem, when you want to add an instance-side method to true, you ask to its class to compile a new method:<\/p>\n\n<pre><code>True compile: 'asInt ^1'.\n<\/code><\/pre>\n\n<p>Now, true responds to this #asInt message:<\/p>\n\n<pre><code>(true respondsTo: #asInt) -&gt; true.\n<\/code><\/pre>\n\n<p>You can then send to any instance of True (again, there should be a single one, <code>True initializedInstance == true<\/code>):<\/p>\n\n<pre><code>true asInt -&gt; 1.\n<\/code><\/pre>\n\n<p>If you want to install a method at class side, that the class True responds to, then you ask to the metaclass, True class, or one of it's superclass:<\/p>\n\n<pre><code>Boolean class compile: 'soleInstance ^self initializedInstance'.\n<\/code><\/pre>\n\n<p>Now you can ask:<\/p>\n\n<pre><code>True soleInstance -&gt; true.\n<\/code><\/pre>\n\n<p>The lesson is this one: if some tool (like the browser) is just showing a partial view of what an object is, responds to, inherits from, etc..., then try using another tool like:<\/p>\n\n<pre><code>True class explore.\n<\/code><\/pre>\n\n<p>And a more important lesson: you're in a live environment, so ultimately use the swiss knife tool - send a message, if it is not understood, some object will kindly tell you ;)<\/p>\n\n<p>Now since I've mostly solved your homework, here is a harder problem for you: if you wanted to intercept the compilation of a method compiled at class side, where would you override #compile:...?<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418255781717,"favorite_count":null,"last_activity_date":1418255781717,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1396822.0,"parent_id":27386061,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":278,"id":27467087,"title":null,"body":"<p>Simple, use positive lookbehind and lookahead assertions like below.<\/p>\n\n<pre><code>$ perl -pe 's\/(?&lt;=,)(?=,|$)\/NULL\/g' file\nItemA,5,4,3,2,1\nItemB,7,NULL,NULL,2,4\nItemC,NULL,NULL,NULL,2,NULL\nItemD,NULL,3,NULL,NULL,NULL\n<\/code><\/pre>\n\n<ul>\n<li><p><code>(?&lt;=,)<\/code> Just lookafter to all the commas. That is, it asserts that the match must be preceded by a comma.<\/p><\/li>\n<li><p><code>(?=,|$)<\/code> And the match was immediately followed by a comma or end of the line anchor. So it matches all the boundaries which exists inbetween all the commas and the one which are next to the comma which are at the last.<\/p><\/li>\n<li><p>Replacing the matched boundary with <code>NULL<\/code> string will give you the desired output.<\/p><\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418540289320,"favorite_count":null,"last_activity_date":1418540289320,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3297613.0,"parent_id":27466192,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":279,"id":27476285,"title":null,"body":"<p>What about using <code>WM_DELETE_WINDOW<\/code>. For example:<\/p>\n\n<pre><code>import tkinter\nimport sys\n\ndef close_window():\n root.destroy()\n sys.exit()\n\ndef win_deleted():\n print(\"closed\");\n close_window();\n\nroot = tkinter.Tk()\n\n#exit button\ndraw_button = tkinter.Button(root, text=\"Quit\", command = close_window)\ndraw_button.grid(row=1, column=1)\n\nroot.protocol(\"WM_DELETE_WINDOW\", win_deleted)\n\nroot.mainloop()\n<\/code><\/pre>\n\n<p>This will close app with ctr+F4.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418607820930,"favorite_count":null,"last_activity_date":1418607820930,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":248823.0,"parent_id":27476250,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":280,"id":27495164,"title":null,"body":"<blockquote>\n <p>What I'm looking to do is duplicate most of my controllers but for a\n REST api.<\/p>\n<\/blockquote>\n\n<p>Bad idea. IMHO. You're going to duplicate code very likely and scatter code everywhere. Keep it in one place. This sentence is an indicator that makes me think you have to much logic in your controllers. Move it to models, fat models.<\/p>\n\n<p>There are several better ways to do this.<\/p>\n\n<ul>\n<li>Use a prefix for routing to API methods inside your related controllers (api\/v1\/foo\/bar -> ControllerName::api_actionName())<\/li>\n<li>Implement a single API controller that dispatches model methods (api\/v1\/foo\/bar -> FooModel::barMethod($queryParam1, $queryparam2,...)<\/li>\n<li>Implement a service layer that sits between the model and the controllers and implement a dispatcher filter or the API controller from the 2nd suggestion to dispatch the service methods. You'll use services instead of models then. Controller &lt;-> Service &lt;-> Model. To implement this well some experience with the framework and design patterns is required. If its not well done it will probably cause more problems than benefit - IMHO.<\/li>\n<li>If it's a more or less simple API and the API logic is similar to your actions you can simple re-use the same controller actions you already have and just usethe <a href=\"http:\/\/book.cakephp.org\/2.0\/en\/views\/json-and-xml-views.html\" rel=\"nofollow\">built in REST and JSON\/XML view<\/a> serialization and could still use routing to create a fancy route (api\/v1\/...) for them. You can then do conditional checks as well if the controller is called as API.<\/li>\n<\/ul>\n\n<p>It's up to you which one you pick, I've seen and used them all in action, they all work the difference is mostly the implementation and level of abstraction you need. However, the key point is to write clean and DRY code and care about <a href=\"http:\/\/en.wikipedia.org\/wiki\/Separation_of_concerns\" rel=\"nofollow\">SoC<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418686718797,"favorite_count":null,"last_activity_date":1418687140867,"last_edit_date":1418687140867,"last_editor_display_name":null,"last_editor_user_id":171209.0,"owner_display_name":null,"owner_user_id":171209.0,"parent_id":27494530,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":281,"id":27512679,"title":null,"body":"<p>You would do this using a collection <a href=\"http:\/\/docs.datomic.com\/query.html#bindings\" rel=\"nofollow\">binding<\/a>. There are some simple illustrations of this <a href=\"https:\/\/github.com\/Datomic\/day-of-datomic\/blob\/master\/tutorial\/binding.clj#L16-L30\" rel=\"nofollow\">here<\/a>.<\/p>\n\n<p>There's a collection restructuring section in <a href=\"http:\/\/www.learndatalogtoday.org\/chapter\/3#collections\" rel=\"nofollow\">Learn Datalog Today!<\/a> (and problem 1 uses this, if you want to try to verify that the syntax of your solution is correct).<\/p>\n\n<p>A similar approach to your problem might read:<\/p>\n\n<pre><code>(d\/q '[:find ?pid ?collection\n :in $ [?collection ...]\n :where [?p :photo\/collections ?collection]\n [?p :photo\/id ?pid]]\n (d\/db conn)\n [\"A\" \"B\" \"C\"])\n<\/code><\/pre>\n\n<p>The results would be something like this (assuming simple integer photo ids - I'm not sure how you're actually identifying photos):<\/p>\n\n<pre><code>[1 \"A\"]\n[2 \"A\"]\n[3 \"B\"]\n<\/code><\/pre>\n\n<p>If you just want entity id's, you should be able to use the simpler query:<\/p>\n\n<pre><code>[:find ?p\n :in $ [?collection ...]\n :where\n [?p :photo\/collection ?collection]]\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418759193883,"favorite_count":null,"last_activity_date":1418759193883,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3801886.0,"parent_id":27497832,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":282,"id":27517364,"title":null,"body":"<p>It actually successfully sets the current time zone to \"Asia\/Kolkata\"<\/p>\n\n<p>You can verify by:<\/p>\n\n<pre><code>...\n&gt;&gt;&gt; timezone.get_current_timezone_name()\n'Asia\/Kolkata'\n<\/code><\/pre>\n\n<p>From the <a href=\"https:\/\/docs.djangoproject.com\/en\/1.7\/ref\/utils\/#django.utils.timezone.now\" rel=\"nofollow\">django documentation<\/a>:<\/p>\n\n<blockquote>\n <p>now():<\/p>\n \n <p>Returns a datetime that represents the current point in time. Exactly\n what\u2019s returned depends on the value of USE_TZ:<\/p>\n \n <ul>\n <li><p>If USE_TZ is False, this will be a naive datetime (i.e. a datetime\n without an associated timezone) that represents the current time in\n the system\u2019s local timezone. <\/p><\/li>\n <li><p>If USE_TZ is True, this will be an aware\n datetime representing the current time in UTC. Note that <strong>now() will\n always return times in UTC regardless of the value of TIME_ZONE<\/strong>; you\n can use localtime() to convert to a time in the current time zone.<\/p><\/li>\n <\/ul>\n<\/blockquote>\n\n<p>So, if your system's local timezone is 'Asia\/Kolkata', you can set <code>USE_TZ<\/code> to <code>False<\/code> in your <code>settings.py<\/code> and the <code>timezone.now()<\/code> will return what you want.<\/p>\n\n<p>Or, you'll have to use <a href=\"https:\/\/docs.djangoproject.com\/en\/1.7\/ref\/utils\/#django.utils.timezone.localtime\" rel=\"nofollow\"><code>localtime()<\/code><\/a> to convert the timezone to yours (continue from your shell results):<\/p>\n\n<pre><code>...\n&gt;&gt;&gt; import datetime\n&gt;&gt;&gt; utc_date = datetime.datetime.utcnow()\n&gt;&gt;&gt; aware_date = timezone.make_aware(utc_date, timezone.utc)\n&gt;&gt;&gt; timezone.localtime(aware_date, timezone.get_current_timezone())\ndatetime.datetime(2014, 12, 17, 8, 0, 36, 598113, tzinfo=&lt;DstTzInfo 'Asia\/Kolkata' IST+5:30:00 STD&gt;)\n<\/code><\/pre>\n\n<p>Lastly, <a href=\"https:\/\/docs.djangoproject.com\/en\/1.7\/ref\/utils\/#django.utils.timezone.make_aware\" rel=\"nofollow\">here<\/a>'s the documentation of the <code>make_aware()<\/code> function<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418782817177,"favorite_count":null,"last_activity_date":1418784415473,"last_edit_date":1418784415473,"last_editor_display_name":null,"last_editor_user_id":3204861.0,"owner_display_name":null,"owner_user_id":3204861.0,"parent_id":27517259,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":283,"id":27535252,"title":null,"body":"<p>I think you only have to add the url to your server in <code>d3.json(url, function(...)<\/code> and it should work for you. There is no need to do a separate callback, but you can do it with a separate callback if you like.<\/p>\n\n<p>In your callback I think you don't need to add the <code>data<\/code> parameter because the data are in root.<\/p>\n\n<p>(If you're requesting the data from a different site, the server needs to enable CORS to allow cross-origin requests.)<\/p>\n\n<p>Please find a working demo with data from mocky.io below. It's exactly the code from the treemap demo, just the data are from a different location and loaded after a button click with a callback.<\/p>\n\n<p>You can find the same also here at <a href=\"http:\/\/jsfiddle.net\/awolf2904\/ezxn7u4o\/\" rel=\"nofollow\">jsFiddle<\/a>.<\/p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>var margin = {\n top: 40,\n right: 10,\n bottom: 10,\n left: 10\n},\nwidth = 960 - margin.left - margin.right,\n height = 500 - margin.top - margin.bottom;\n\nvar color = d3.scale.category20c();\n\nvar treemap = d3.layout.treemap()\n .size([width, height])\n .sticky(true)\n .value(function (d) {\n return d.size;\n});\n\nvar div = d3.select(\"body\").append(\"div\")\n .style(\"position\", \"relative\")\n .style(\"width\", (width + margin.left + margin.right) + \"px\")\n .style(\"height\", (height + margin.top + margin.bottom) + \"px\")\n .style(\"left\", margin.left + \"px\")\n .style(\"top\", margin.top + \"px\");\n\nvar url = \"http:\/\/www.mocky.io\/v2\/5491ee0450e288460f8b77a5\";\n\nvar dispatcher = d3.dispatch('jsonLoad');\n\nd3.select('#loadData').on('click', function() {\n d3.json(url, callback);\n});\n\n\/\/ optional dispatcher\ndispatcher.on('jsonLoad', function(data) {\n \/\/ triggered afer json is loaded (just if you want to do additional stuff here.)\n console.log(data);\n});\n\nvar callback = function (error, root) {\n dispatcher.jsonLoad(root); \/\/ can trigger an event that new data are here\n var node = div.datum(root).selectAll(\".node\")\n .data(treemap.nodes)\n .enter().append(\"div\")\n .attr(\"class\", \"node\")\n .call(position)\n .style(\"background\", function (d) {\n return d.children ? color(d.name) : null;\n })\n .text(function (d) {\n return d.children ? null : d.name;\n });\n\n d3.selectAll(\"input\").on(\"change\", function change() {\n var value = this.value === \"count\" ? function () {\n return 1;\n } : function (d) {\n return d.size;\n };\n\n node.data(treemap.value(value).nodes)\n .transition()\n .duration(1500)\n .call(position);\n });\n };\n\nfunction position() {\n this.style(\"left\", function (d) {\n return d.x + \"px\";\n })\n .style(\"top\", function (d) {\n return d.y + \"px\";\n })\n .style(\"width\", function (d) {\n return Math.max(0, d.dx - 1) + \"px\";\n })\n .style(\"height\", function (d) {\n return Math.max(0, d.dy - 1) + \"px\";\n });\n}<\/code><\/pre>\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>body {\n font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n margin: auto;\n position: relative;\n width: 960px;\n}\n\nform {\n position: absolute;\n right: 10px;\n top: 10px;\n}\n\n.node {\n border: solid 1px white;\n font: 10px sans-serif;\n line-height: 12px;\n overflow: hidden;\n position: absolute;\n text-indent: 2px;\n}<\/code><\/pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/d3\/3.4.11\/d3.min.js\"&gt;&lt;\/script&gt;\n&lt;form&gt;\n &lt;label&gt;&lt;input type=\"radio\" name=\"mode\" value=\"size\" checked=\"true\" \/&gt; Size&lt;\/label&gt;\n &lt;label&gt;&lt;input type=\"radio\" name=\"mode\" value=\"count\"\/&gt; Count&lt;\/label&gt;\n&lt;\/form&gt;\n\n&lt;button id=\"loadData\"&gt;Load data&lt;\/button&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418852168580,"favorite_count":null,"last_activity_date":1418852168580,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1483981.0,"parent_id":27534116,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":284,"id":27548811,"title":null,"body":"<p>You can create big polygon with hole in it:\naccording to doc:\nA polygon can be convex or concave, it may span the 180 meridian and it can have holes that are not filled in.\nLink: <a href=\"http:\/\/developer.android.com\/reference\/com\/google\/android\/gms\/maps\/model\/Polygon.html\" rel=\"nofollow\">http:\/\/developer.android.com\/reference\/com\/google\/android\/gms\/maps\/model\/Polygon.html<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418912836390,"favorite_count":null,"last_activity_date":1418912836390,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2783841.0,"parent_id":27547823,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":285,"id":27550121,"title":null,"body":"<p>The \"notrunning\" condition will be TRUE when the status of the job on which it is dependent is anything except RUNNING.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418916641997,"favorite_count":null,"last_activity_date":1418916641997,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1961318.0,"parent_id":27445219,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":286,"id":27632741,"title":null,"body":"<p>Because standard CRM Workflow steps don't support the iteration of 1:N relationships, you need to build a custom workflow activity.<\/p>\n\n<p>Lucky for us there is already one available:<\/p>\n\n<p><a href=\"https:\/\/crm2011distributewf.codeplex.com\/\" rel=\"nofollow\">CRM 2011 Distribute Workflow Activity<\/a><\/p>\n\n<p>There is also a small tutorial (powerpoint format), the link is in the same page (last download link in the bottom)<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419403696837,"favorite_count":null,"last_activity_date":1419403696837,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2191473.0,"parent_id":27628660,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":287,"id":27653426,"title":null,"body":"<p>You don't need a for loop, and you certainly don't need an IIFE. You have an array of results, so just call the native <code>.forEach<\/code> function. It takes a callback that can is executed on all elements in the array. Benefits of this approach:<\/p>\n\n<ul>\n<li>Gives you closure by default. The callback has its own scope and in a way is self-contained and separate from other code. Each element will get its own marker<\/li>\n<li>Makes your code much easier to read. This is a much too often overlooked detail in coding. You want to strive to avoid any sort of technical debt\u2014one of the easiest ways to do this is use the native array methods. They clearly communicate your code's intentions &amp; makes debugging a lot easier (esp. necessary when asking for help, say on stack overflow, as it takes a lot of time and not many people want to help you if they can't make sense of your code)<\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419574035803,"favorite_count":null,"last_activity_date":1419574035803,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4379609.0,"parent_id":27653261,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":288,"id":27660334,"title":null,"body":"<p>There's no method to get response cookies after calling <code>perform()<\/code>. Headers sent by the server can be captured using a callback function passed to the PyCurl instance while configuring with <code>setopt()<\/code>:<\/p>\n\n<blockquote>\n <p>CURLOPT_HEADERFUNCTION<\/p>\n\n<pre><code> Callback for writing received headers. See CURLOPT_HEADERFUNCTION \n<\/code><\/pre>\n<\/blockquote>\n\n<p>Example code excerpt:<\/p>\n\n<pre><code> set_cookies = []\n\n # closure to capture Set-Cookie\n def _write_header(header):\n match = re.match(\"^Set-Cookie: (.*)$\", header)\n\n if match:\n set_cookies.append(match.group(1))\n\n # use closure to collect cookies sent from the server\n c.setopt(pycurl.HEADERFUNCTION, _write_header)\n<\/code><\/pre>\n\n<p>References:<\/p>\n\n<ul>\n<li><a href=\"http:\/\/pycurl.io\/docs\/latest\/quickstart.html#examining-response-headers\" rel=\"nofollow noreferrer\">http:\/\/pycurl.io\/docs\/latest\/quickstart.html#examining-response-headers<\/a><\/li>\n<li><a href=\"http:\/\/curl.haxx.se\/libcurl\/c\/curl_easy_setopt.html\" rel=\"nofollow noreferrer\">http:\/\/curl.haxx.se\/libcurl\/c\/curl_easy_setopt.html<\/a>\n\n<ul>\n<li><a href=\"http:\/\/curl.haxx.se\/libcurl\/c\/CURLOPT_HEADERFUNCTION.html\" rel=\"nofollow noreferrer\">http:\/\/curl.haxx.se\/libcurl\/c\/CURLOPT_HEADERFUNCTION.html<\/a><\/li>\n<\/ul><\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419616851937,"favorite_count":null,"last_activity_date":1500294119133,"last_edit_date":1500294119133,"last_editor_display_name":null,"last_editor_user_id":1078886.0,"owner_display_name":null,"owner_user_id":1078886.0,"parent_id":27650902,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":289,"id":27669912,"title":null,"body":"<p>If you only want to skip this message for man pages, this should do :<\/p>\n\n<pre><code>:nnoremap K K&lt;CR&gt;\n:vnoremap K K&lt;CR&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419702762827,"favorite_count":null,"last_activity_date":1419702762827,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2650437.0,"parent_id":27669724,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":290,"id":27670801,"title":null,"body":"<p><em>myClip<\/em> is the <code>linkage name<\/code> of your MovieClip in the library, and <em>Rabbit<\/em> its <code>instance name<\/code>:<\/p>\n\n<pre><code>this.attachMovie(\"myClip\", \"Rabbit\", this.getNextHighestDepth());\n\nvar myFrame:Number;\n\nRabbit.onEnterFrame = function():Void {\n myFrame = this._currentframe;\n}\n<\/code><\/pre>\n\n<p>So you directly test your instance's enterFrame, and your <code>global variable<\/code> <em>myframe<\/em> is accessible from everywhere.<\/p>\n\n<p><strong>With your clipName variable<\/strong><\/p>\n\n<p>You can call your <em>clipName<\/em> variable instead of <em>Rabbit<\/em>. I've renamed it <em>myInstance<\/em>:<\/p>\n\n<pre><code>this.attachMovie(\"myClip\", \"Rabbit\", this.getNextHighestDepth());\n\nvar myFrame:Number;\nvar myInstance:MovieClip = Rabbit;\n\nmyInstance.onEnterFrame = function():Void {\n myFrame = this._currentframe;\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419709080307,"favorite_count":null,"last_activity_date":1419710673330,"last_edit_date":1419710673330,"last_editor_display_name":null,"last_editor_user_id":3854307.0,"owner_display_name":null,"owner_user_id":3854307.0,"parent_id":27670538,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":291,"id":27706568,"title":null,"body":"<p>Use a pseudo-element, absolute positioning, and CSS3 background sizing:<\/p>\n\n<pre><code>.preview {\n position:relative;\n}\n.preview:after {\n content:'';\n background:url(https:\/\/mpmath.googlecode.com\/svn\/trunk\/doc\/build\/_static\/preview.png) 50% \/ contain no-repeat;\n position:absolute; \n top:0;\n left:0;\n right:0;\n bottom:0;\n}\n<\/code><\/pre>\n\n<p><a href=\"http:\/\/jsfiddle.net\/2zbrfqaq\/\" rel=\"nofollow\">Example fiddle<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419946933920,"favorite_count":null,"last_activity_date":1419946933920,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1729885.0,"parent_id":27706418,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":292,"id":27721655,"title":null,"body":"<p>The answer is to do this:<\/p>\n\n<pre><code> InputStream is = getContext().getClass().getResourceAsStream(\"\/whatever.properties\");\n<\/code><\/pre>\n\n<p>And GAE can read the stream without problems. <\/p>\n\n<p>Without the <code>getClassLoader()<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420031564207,"favorite_count":null,"last_activity_date":1420031564207,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":785349.0,"parent_id":27717056,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":293,"id":27727604,"title":null,"body":"<p>Took me a while to work this out, but basically, for practical purposes, yes this functionality was lost in this release.<\/p>\n\n<p>There are some kludgy work-arounds but they aren\u2019t reliable.<\/p>\n\n<p>Your best bet is to write an actual unit test that is run by uiautomator, and use the <a href=\"http:\/\/developer.android.com\/tools\/help\/uiautomator\/UiDevice.html#dumpWindowHierarchy(java.lang.String)\" rel=\"nofollow\">dumpWindowHierarchy<\/a> API to extract it yourself. If you are doing this it is important to ensure the WebView you wish to extract is created after uiautomator has started (but obviously before you make the call to dumpWindowHierarchy). The best way to achieve that will be depend on your exact circumstances.<\/p>\n\n<p>I wrote up more speculation on why this may have changed in Lollipop in a <a href=\"http:\/\/benno.id.au\/blog\/2015\/01\/01\/uiautomator-webview-lollipop\" rel=\"nofollow\">blog post<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420073823040,"favorite_count":null,"last_activity_date":1420073823040,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":10248.0,"parent_id":27428207,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":294,"id":27471217,"title":null,"body":"<p>When you have a standalone SVG file served as image\/svg+xml it must have the correct namespaces or it won't be displayed. html doesn't have namespaces which is why it works if you embed the SVG data directly in an html file.<\/p>\n\n<p>So your SVG file needs to look like this...<\/p>\n\n<pre><code>&lt;svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 1000 100\" preserveAspectRatio=\"none\"&gt;\n &lt;polygon points=\"0,0 1000,0 1000,50 0,50\" style=\"fill:#01b6ef;\" \/&gt;\n &lt;polygon points=\"0,0 500,0 0,100\" style=\"fill:#222c37;\" \/&gt;\n&lt;\/svg&gt;\n<\/code><\/pre>\n\n<p>If you had tried to display the standalone file directly, the UA should have given you some kind of helpful message.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418573626743,"favorite_count":null,"last_activity_date":1418573626743,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1038015.0,"parent_id":27470987,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":295,"id":27501803,"title":null,"body":"<p>You cannot restart a thread. That's a fundamental concept of multithreaded programming, a thread runs once and when it's been stopped it does not restart. Simply create a new object instead.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418723553270,"favorite_count":null,"last_activity_date":1418723553270,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1091402.0,"parent_id":27501732,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":296,"id":27581660,"title":null,"body":"<blockquote>\n <p>I am new to GATE (version 8.0)<\/p>\n<\/blockquote>\n\n<p>The <code>Stanford_CoreNLP<\/code> plugin was introduced in June 2014, <em>after<\/em> the release of GATE version 8.0, so you need to download a more recent <a href=\"http:\/\/jenkins.gate.ac.uk\/job\/GATE-Nightly\/lastSuccessfulBuild\/\" rel=\"nofollow\">nightly snapshot<\/a> build and install that instead. In version 8.0 the Stanford POS tagger and parser were available as separate plugins (as you show in your screenshot) but the NER tools were not included at that point.<\/p>\n\n<p>As a general rule, if you want to be sure you're looking at the correct version of the GATE user guide then you should access it via the \"help\" menu in GATE Developer. The <a href=\"https:\/\/gate.ac.uk\/userguide\/\" rel=\"nofollow\">user guide link<\/a> on the GATE website refers to the latest snapshot, not to a numbered release.<\/p>\n\n<hr>\n\n<p>Edit June 2015: GATE Developer version 8.1 has now been released, which includes the <code>Stanford_CoreNLP<\/code> plugin.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419089503723,"favorite_count":null,"last_activity_date":1434029826000,"last_edit_date":1434029826000,"last_editor_display_name":null,"last_editor_user_id":592139.0,"owner_display_name":null,"owner_user_id":592139.0,"parent_id":27573095,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":297,"id":27620776,"title":null,"body":"<p>The universal build error has nothing to do with the OS X version you're running, and everything with the version of clang\/Xcode. You can't use recent versions of clang to compile kexts for the i386 architecture. I think the last version of Xcode to support 32-bit kexts was 4.6.3. (available from the downloads section of Apple's developer site) Note that you can't codesign 32-bit or universal kexts either, so you'll need to provide 2 versions of your kext anyway if you're planning to support both OS X &lt;= 10.7 and >= 10.9. You can build a universal kext with Xcode 4.6.3, and the signed version with Xcode 6.x.<\/p>\n\n<p>The link\/load error is due to the OS X SDK version you're using. In general, don't expect I\/O kit based kexts built against OS X SDK 10.y to load on OS X 10.z if z &lt; y. So if you need to support 10.8, build with the 10.8 SDK (or older). If you want to support features only available in a newer SDK, you will need to create multiple kext versions (you'll need to do this anyway if you want to support 10.7 or lower) or have a base kext that works for all supported versions, and an enhanced kext that depends on the base kext and adds the relevant features, but only works for newer OS versions. You will of course need to go back to an Xcode version that still ships with your required SDK.<\/p>\n\n<p>Sensible OS X version groupings are:<\/p>\n\n<ul>\n<li>Kext 1: &lt;= 10.7 (unsigned, universal), kext 2 >= 10.8 (signed, 64-bit)<\/li>\n<li>Kext 1: &lt;= 10.8 (unsigned, universal), kext 2 >= 10.9 (signed, 64-bit)<\/li>\n<\/ul>\n\n<p>You can of course split into more than 2 versions of your kext if you need more feature granularity.<\/p>\n\n<p>Note that you <strong>can<\/strong> weakly link against pure C symbols, only the C++ linkage is problematic.<\/p>\n\n<p><strong>2018 Update, as this answer seems popular at the moment, >3 years on:<\/strong><\/p>\n\n<p>It's a little tricky to build 32-bit kexts on a modern system. The easiest is definitely to set up a VM with an old OS X version and use Xcode 4.6.3 there. However, that messes up the build for kexts and other project components targeting modern OS versions, so that prevents you from having a grand unified build that builds everything. It's fine for release builds if you're set up with a fancy CI system that can pull in the build artifacts from multiple build agents, but it's still a pain for the edit-build-debug cycle.<\/p>\n\n<p>Another solution I've found is to use the old compiler on modern macOS. Xcode 4 itself doesn't run on recent versions, but the compiler can be persuaded to do so, and produces correct 32-bit kexts.<\/p>\n\n<p>I have the following bash code in the preparation phase of one of our build scripts:<\/p>\n\n<pre><code>VERBOSE=1\nexport XCODE463APP=`mdfind 'kMDItemCFBundleIdentifier = \"com.apple.dt.Xcode\" &amp;&amp; kMDItemVersion = \"4.6.3\"' | head -n 1`\nDARWIN_MAJOR=`uname -r | sed -E 's\/^([0-9]+)\\..*$\/\\1\/'`\n\n\nif [ -e \".\/build-tools\/Developer\/Toolchains\/XcodeDefault.xctoolchain\/usr\/bin\/clang\" ] &amp;&amp; [ -e \".\/build-tools\/Developer\/usr\/llvm-gcc-4.2\/bin\/llvm-gcc-4.2\" ] ; then\n if (( $VERBOSE )); then\n echo 32-bit kext compiler appears to be in place\n fi\nelse\n echo \"Setting up 32-bit kext compiler toolchain\"\n mkdir -p \".\/build-tools\/Developer\/Toolchains\"\n mkdir -p \".\/build-tools\/Developer\/usr\/\"\n cp -r \"$XCODE463APP\/Contents\/Developer\/Toolchains\/XcodeDefault.xctoolchain\" \".\/build-tools\/Developer\/Toolchains\/\"\n cp -r \"$XCODE463APP\/Contents\/Developer\/usr\/llvm-gcc-4.2\" \".\/build-tools\/Developer\/usr\/\"\nfi\n\nif [ -h \".\/build-tools\/Developer\/usr\/llvm-gcc-4.2\/libexec\/gcc\/i686-apple-darwin${DARWIN_MAJOR}\" ] || [ -e \".\/build-tools\/Developer\/usr\/llvm-gcc-4.2\/libexec\/gcc\/i686-apple-darwin${DARWIN_MAJOR}\" ] ; then\n if (( $VERBOSE )); then\n echo \"32-bit kext compiler's Darwin-version-specific stuff appears to be set up\"\n fi\nelse\n echo \"Setting up 32-bit kext compiler's Darwin version specific symlink\"\n ln -s \"i686-apple-darwin11\" \".\/build-tools\/Developer\/usr\/llvm-gcc-4.2\/libexec\/gcc\/i686-apple-darwin${DARWIN_MAJOR}\"\nfi\n<\/code><\/pre>\n\n<p>This pulls out the 32-bit compiler from the Xcode 4.6.3 bundle and puts it in a local build directory, then adds a symlink with the macOS (Darwin) version in its name, which the compiler seems to look for. Xcode 4.6.3 itself only ships with those symlinks for up to 10.9 or 10.10 if I remember correctly, but adding them for newer versions seems to make it happy. I can confirm this works for building 32-bit kext slices with the 10.6 SDK on 10.11 and 10.12 systems.<\/p>\n\n<p>A cleaner solution would probably be to build llvm-gcc from source, but probably more time consuming to set up too.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419339132053,"favorite_count":null,"last_activity_date":1519752482943,"last_edit_date":1519752482943,"last_editor_display_name":null,"last_editor_user_id":48660.0,"owner_display_name":null,"owner_user_id":48660.0,"parent_id":27599342,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":298,"id":27640071,"title":null,"body":"<p>So, after some more digging into the matter, I found a solution which satisfies me for now. I want to share it, in case anyone else runs into the same problem. Actually it is quite simple, and with some helper class from <a href=\"https:\/\/gist.github.com\/daltonmatos\/3280885\" rel=\"nofollow\">https:\/\/gist.github.com\/daltonmatos\/3280885<\/a> I came up with the following testcode: <\/p>\n\n<pre><code>def test_update_status_running(bamboopickup, monkeypatch,\n mock_update_overall_data_positive,\n mock_update_builds_status_positive):\n monkeypatch.setattr('pickups.bamboo.bamboopickup.BambooPickup._update_overall_data', lambda x: mock_update_overall_data_positive)\n monkeypatch.setattr('pickups.bamboo.bamboopickup.BambooPickup._update_builds_status', lambda x: mock_update_builds_status_positive)\n\n with mock.patch.object(bamboopickup, '_is_a_build_running') as mockfoo:\n mockfoo.return_value = AlmostAlwaysTrue(2)\n bamboopickup.update_status()\n<\/code><\/pre>\n\n<p>and the helper class: <\/p>\n\n<pre><code>class AlmostAlwaysTrue(object):\n def __init__(self, total_iterations=1):\n self.total_iterations = total_iterations\n self.current_iteration = 0\n\n def __nonzero__(self):\n if self.current_iteration &lt; self.total_iterations:\n self.current_iteration += 1\n return bool(1)\n return bool(0)\n\n # Python &gt;= 3\n def __bool__(self):\n if self.current_iteration &lt; self.total_iterations:\n self.current_iteration += 1\n return bool(1)\n return bool(0)\n<\/code><\/pre>\n\n<p>One could also modify it to return a exception at some point and check agains that. I keep the question a bit longer open, in case anyone has a cleaner solution (which I am sure of). <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419440420107,"favorite_count":null,"last_activity_date":1420616834450,"last_edit_date":1420616834450,"last_editor_display_name":null,"last_editor_user_id":3713370.0,"owner_display_name":null,"owner_user_id":3713370.0,"parent_id":27637653,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":299,"id":27685079,"title":null,"body":"<p>I think you have to do either one of following thing .<\/p>\n\n<ol>\n<li><p>Move removeuser function to main view model and remove based on an index. If you want to do this way then<\/p>\n\n<p><a href=\"http:\/\/jsfiddle.net\/chLa93du\/2\/\" rel=\"nofollow\">http:\/\/jsfiddle.net\/chLa93du\/2\/<\/a><\/p><\/li>\n<\/ol>\n\n<p>In Html (View)<\/p>\n\n<pre><code>&lt;table border=\"1\"&gt;\n &lt;thead&gt;\n &lt;th&gt;Full Name&lt;\/th&gt;\n &lt;th&gt;Address&lt;\/th&gt;\n &lt;th&gt;Graduate ?&lt;\/th&gt;\n &lt;th&gt;Subject&lt;\/th&gt;\n &lt;th&gt;Remove User&lt;\/th&gt;\n &lt;\/thead&gt;\n &lt;tbody data-bind=\"foreach:friends\"&gt;\n &lt;tr&gt;\n &lt;td data-bind=\"text:fullName\"&gt;&lt;\/td&gt;\n &lt;td data-bind=\"text:address\"&gt;&lt;\/td&gt;\n &lt;td&gt;&lt;input type =\"checkbox\" data-bind=\"checked:graduate\"&gt;&lt;\/input&gt;&lt;\/td&gt;\n &lt;td&gt;&lt;input type =\"text\" data-bind=\"value:subjects, visible:graduate\"&gt;&lt;\/input&gt;&lt;\/td&gt;\n &lt;td&gt;&lt;input type= \"button\" data-bind=\"click:$parent.removeUser\" value=\"X\"&gt;&lt;\/input&gt;&lt;\/td&gt;\n &lt;\/tr&gt;\n &lt;\/tbody&gt;\n&lt;\/table&gt;\n&lt;button data-bind=\"click:addUser\"&gt;Add User&lt;\/button&gt;\n<\/code><\/pre>\n\n<p>Your Script : <\/p>\n\n<pre><code> function Friend(a, b){ \n this.fullName=a;\n this.address=b;\n this.graduate=ko.observable(false);\n this.subjects=ko.observable('');\n }\n\n function functionViewModel(){\n var fn={friends:ko.observableArray([new Friend(\"Sofia Smith\", \"London\"), new Friend(\"Liam Taylor\",\"New York\")])};\n fn.addUser=function(){fn.friends.push(new Friend(\"Thomas Miller\", \"California\"));};\n fn.removeUser = function(item){\n fn.friends.remove(item);\n };\n return fn;\n };\n ko.applyBindings(functionViewModel());\n<\/code><\/pre>\n\n<ol start=\"2\">\n<li><p>You can store main view model in global variable then access.\n<a href=\"http:\/\/jsfiddle.net\/chLa93du\/\" rel=\"nofollow\">http:\/\/jsfiddle.net\/chLa93du\/<\/a><\/p>\n\n<pre><code> var viewModel;\n\nfunction Friend(a, b){ \nthis.fullName=a;\nthis.address=b;\nthis.graduate=ko.observable(false);\nthis.subjects=ko.observable('');\nthis.deleteRow=function(){\n viewModel.friends.remove(this);\n};\n}\n\nfunction functionViewModel(){\nvar fn={friends:ko.observableArray([new Friend(\"Sofia Smith\", \"London\"), new Friend(\"Liam Taylor\",\"New York\")])};\nfn.addUser=function(){fn.friends.push(new Friend(\"Thomas Miller\", \"California\"));};\nreturn fn;\n};\nviewModel = new functionViewModel();ko.applyBindings(viewModel);\n<\/code><\/pre><\/li>\n<\/ol>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419838329423,"favorite_count":null,"last_activity_date":1434708340073,"last_edit_date":1434708340073,"last_editor_display_name":null,"last_editor_user_id":4340128.0,"owner_display_name":null,"owner_user_id":385326.0,"parent_id":27684868,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":300,"id":27688239,"title":null,"body":"<p>You can use the <a href=\"http:\/\/json.codeplex.com\/\" rel=\"nofollow\">Json.NET<\/a> framework.\nThen you can use the following code in your case<\/p>\n\n<pre><code>var table = JsonConvert.DeserializeObject&lt;DataTable&gt;(json);\nreturn table;\n<\/code><\/pre>\n\n<p>For vb.net<\/p>\n\n<pre><code>Dim dt as DataTable = Json.JsonConvert.DeserializeObject(Of DataTable)(data)\n<\/code><\/pre>\n\n<p>So your complete function would be<\/p>\n\n<pre><code>Public Function DerializeDataTable(ByVal data As String) As DataTable \n Dim j As DataTable = Json.JsonConvert.DeserializeObject(Of DataTable)(data)\n Return j\nEnd Function\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419853500037,"favorite_count":null,"last_activity_date":1419854486857,"last_edit_date":1419854486857,"last_editor_display_name":null,"last_editor_user_id":480139.0,"owner_display_name":null,"owner_user_id":480139.0,"parent_id":27688179,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":301,"id":27721905,"title":null,"body":"<p>Try this:<\/p>\n\n<pre><code>function ($message) use ($email) {\n \/\/...\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420032976840,"favorite_count":null,"last_activity_date":1420032976840,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1561655.0,"parent_id":27721889,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":302,"id":27492088,"title":null,"body":"<p>You are doing nothing wrong. I don't really think it's appropriate that the angular docs show that code with this line hidden right above it:<\/p>\n\n<blockquote>\n <p>While the constructor-style use is supported, not all of the\n supporting methods from ES6 Harmony promises are available yet.<\/p>\n<\/blockquote>\n\n<p>It causes much confusion, as you an see.<\/p>\n\n<p>Use the constructor method (like Zipper posted)<\/p>\n\n<pre><code>var dfd = $q.defer();\n<\/code><\/pre>\n\n<p>and then you can do the following:<\/p>\n\n<pre><code>dfd.reject('some value');\ndfd.resolve('some value');\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418673502890,"favorite_count":null,"last_activity_date":1418673502890,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":954940.0,"parent_id":27490089,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":303,"id":27570390,"title":null,"body":"<p>Try this:<\/p>\n\n<pre><code>{\n \"query\": {\n \"bool\": {\n \"must\": [\n {\"match\": {\"title\": \"louvre\"}}\n ],\n \"should\": [\n {\"term\": {\"isActive\": {\"value\": true}}}\n ]\n }\n }\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419007748617,"favorite_count":null,"last_activity_date":1419007748617,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3498062.0,"parent_id":27569686,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":304,"id":27588614,"title":null,"body":"<p>After searching for many days I found that currently google has not provided any API\/ methods to enable non-market application in managed profile.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419158589127,"favorite_count":null,"last_activity_date":1419158589127,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1232569.0,"parent_id":27375736,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":305,"id":27600498,"title":null,"body":"<p>For single tree it will be like next<\/p>\n\n<pre><code>webix.ui({\n view:\"tree\",\n type:{\n folder:function(obj){\n if (obj.$count)\n return \"&lt;span class='webix_icon fa-folder'&gt;&lt;\/span&gt;\";\n return \"&lt;span class='webix_icon fa-file'&gt;&lt;\/span&gt;\";\n }\n },\n data:tree_data\n})\n<\/code><\/pre>\n\n<p>You can check the sample here - <a href=\"http:\/\/webix.com\/snippet\/0f3d85c3\" rel=\"noreferrer\">http:\/\/webix.com\/snippet\/0f3d85c3<\/a><\/p>\n\n<p>If you want to share this behavior among multiple tree controls, you can define the custom type once <\/p>\n\n<pre><code>webix.type(webix.ui.tree, {\n name:\"awesome\",\n folder:function(obj){\n if (obj.$count)\n return \"&lt;span class='webix_icon fa-folder'&gt;&lt;\/span&gt;\";\n return \"&lt;span class='webix_icon fa-file'&gt;&lt;\/span&gt;\";\n }\n});\n<\/code><\/pre>\n\n<p>and later use type:\"awesome\" to apply the styling<\/p>\n\n<pre><code>webix.ui({\n view:\"tree\",\n type:\"awesome\",\n data:tree_data\n})\n<\/code><\/pre>\n\n<p>Example - <a href=\"http:\/\/webix.com\/snippet\/79dbe741\" rel=\"noreferrer\">http:\/\/webix.com\/snippet\/79dbe741<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419242947670,"favorite_count":null,"last_activity_date":1419242947670,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2080.0,"parent_id":27577178,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":306,"id":27669109,"title":null,"body":"<p>The problem is resolved by using git over ssh, instead of over https.\nhttps transport is unsupported on the legacy bamboo stack. Here's\nthe heroku article:<\/p>\n\n<p><a href=\"https:\/\/devcenter.heroku.com\/articles\/git#ssh-git-transport\" rel=\"nofollow noreferrer\">https:\/\/devcenter.heroku.com\/articles\/git#ssh-git-transport<\/a><\/p>\n\n<p>For ssh transport, you have to jump through a few hoops to bring up\nyour connection. I found <a href=\"https:\/\/stackoverflow.com\/questions\/12206779\/git-push-heroku-master-permission-denied-publickey-fatal-the-remote-end-hung\">this article very helpful<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419697088843,"favorite_count":null,"last_activity_date":1434121217000,"last_edit_date":1495540703367,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1378268.0,"parent_id":27664921,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":307,"id":27669176,"title":null,"body":"<p>Download link<\/p>\n\n<pre><code>&lt;a href=\"magic.php?file=&lt;?php echo urlencode($row['name']); ?&gt;\"&gt;Download&lt;\/a&gt;\n<\/code><\/pre>\n\n<p>magic.php page<\/p>\n\n<pre><code>&lt;?php\n$file = 'C:\/xampp\/htdocs\/myfile\/uploads\/'.urldecode($_GET['file']);\n\nif (file_exists($file)) {\n header('Content-Description: File Transfer');\n header('Content-Type: application\/octet-stream');\n header('Content-Disposition: attachment; filename='.basename($file));\n header('Expires: 0');\n header('Cache-Control: must-revalidate');\n header('Pragma: public');\n header('Content-Length: ' . filesize($file));\n readfile($file);\n exit;\n}\n?&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419697561510,"favorite_count":null,"last_activity_date":1419697561510,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3043248.0,"parent_id":27668971,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":308,"id":27405833,"title":null,"body":"<p>Using a third-party service like Amazon (S3 or Cloud Front) is best because it will reduce the load on your application. A package like this will help in this process immensely: <a href=\"https:\/\/atmospherejs.com\/edgee\/slingshot\">https:\/\/atmospherejs.com\/edgee\/slingshot<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418228220283,"favorite_count":null,"last_activity_date":1418228220283,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4233633.0,"parent_id":27405145,"post_type_id":2,"score":6,"tags":null,"view_count":null},{"index":309,"id":27526757,"title":null,"body":"<p>If you use the <code>dill<\/code> package, you should be able to pickle the session where <code>pickle<\/code> itself fails.<\/p>\n\n<pre><code>&gt;&gt;&gt; import dill as pickle\n&gt;&gt;&gt; pickled = pickle.dumps(session)\n&gt;&gt;&gt; restored = pickle.loads(pickled)\n<\/code><\/pre>\n\n<p>Get <code>dill<\/code> here: <a href=\"https:\/\/github.com\/uqfoundation\/dill\" rel=\"noreferrer\">https:\/\/github.com\/uqfoundation\/dill<\/a><\/p>\n\n<p>Actually, <code>dill<\/code> also makes it easy to store your python session across restarts, so you\ncould <code>pickle<\/code> your entire python session like this:<\/p>\n\n<pre><code>&gt;&gt;&gt; pickle.dump_session('session.pkl')\n<\/code><\/pre>\n\n<p>Then restart python, and pick up where you left off.<\/p>\n\n<pre><code>Python 2.7.8 (default, Jul 13 2014, 02:29:54) \n[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags\/Apple\/clang-421.11.66))] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n&gt;&gt;&gt; import dill as pickle\n&gt;&gt;&gt; pickle.load_session('session.pkl')\n&gt;&gt;&gt; restored\n&lt;requests.sessions.Session object at 0x10c012690&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418823098677,"favorite_count":null,"last_activity_date":1418823098677,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2379433.0,"parent_id":27526353,"post_type_id":2,"score":6,"tags":null,"view_count":null},{"index":310,"id":27564886,"title":null,"body":"<p>Ups, sorry i didn't noticed the iPad tab which also containes checkboxes with checked landscape <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418987654960,"favorite_count":null,"last_activity_date":1418987654960,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3992237.0,"parent_id":27564828,"post_type_id":2,"score":6,"tags":null,"view_count":null},{"index":311,"id":27535247,"title":null,"body":"<p>No, given an rdd of type <code>RDD[(K,V)]<\/code>, <code>reduceByKey<\/code> will take an associative function of type <code>(V,V) =&gt; V<\/code>. <\/p>\n\n<p>If we want to apply a reduction that changes the type of the values to another arbitrary type, then we can use <code>aggregateByKey<\/code>:<\/p>\n\n<pre><code>def aggregateByKey[U](zeroValue: U)(seqOp: (U, V) \u21d2 U, combOp: (U, U) \u21d2 U)\n<\/code><\/pre>\n\n<p>Using the <code>zeroValue<\/code> and the <code>seqOp<\/code> function, it provides a fold-like operation at the map side while the associate function <code>combOp<\/code> combines the results of the <code>seqOp<\/code> to the final result, much like reduceByKey would do. \nAs we can appreciate from the signature, while the collection values are of type <code>V<\/code> the result of <code>aggregateByKey<\/code> will be of an arbitrary type <code>U<\/code><\/p>\n\n<p>Applied to the example above, <code>aggregateByKey<\/code> would look like this:<\/p>\n\n<pre><code>rdd.aggregateByKey(\"\")({case (aggr , value) =&gt; aggr + String.valueOf(value)}, (aggr1, aggr2) =&gt; aggr1 + aggr2)\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418852153703,"favorite_count":null,"last_activity_date":1418853225363,"last_edit_date":1418853225363,"last_editor_display_name":null,"last_editor_user_id":764040.0,"owner_display_name":null,"owner_user_id":764040.0,"parent_id":27535060,"post_type_id":2,"score":7,"tags":null,"view_count":null},{"index":312,"id":27677394,"title":null,"body":"<p>As you can <a href=\"http:\/\/symfony.com\/doc\/current\/components\/http_kernel\/introduction.html#component-http-kernel-event-table\">read here<\/a>, <code>kernel.response<\/code> event object, that passed to your listener is <code>FilterResponseEvent<\/code>. This object has both <code>getRequest<\/code> and <code>getResponse<\/code> methods. So your code should look like:<\/p>\n\n<pre><code>public function onKernelResponse(FilterResponseEvent $event)\n{\n $request = $event-&gt;getRequest();\n $response = $event-&gt;getResponse();\n\n $log = new ServerRequestsLog();\n $log-&gt;setRequest($request);\n $log-&gt;setRequest($response);\n \/\/....Save it with document manager, etc.\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419777551530,"favorite_count":null,"last_activity_date":1419777551530,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1478372.0,"parent_id":27677244,"post_type_id":2,"score":7,"tags":null,"view_count":null},{"index":313,"id":27689923,"title":null,"body":"<p>That's because you exceeded the maximum number of fields for a single tuple (18), here is what the <a href=\"https:\/\/www.playframework.com\/documentation\/2.3.x\/ScalaForms\">Play doc<\/a> says:<\/p>\n\n<blockquote>\n <p>Note: Maximum number of fields for a single tuple or mapping is 18 due\n to the way form handling is implemented. If you have more than 18\n fields in your form, you should break down your forms using lists or\n nested values.<\/p>\n<\/blockquote>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419860045353,"favorite_count":null,"last_activity_date":1419860045353,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":908853.0,"parent_id":27689809,"post_type_id":2,"score":7,"tags":null,"view_count":null},{"index":314,"id":27695702,"title":null,"body":"<p>I would prefer to put methods in case class. Putting it in companion object sounds like Anemic Domain Model anti-pattern <a href=\"http:\/\/www.martinfowler.com\/bliki\/AnemicDomainModel.html\">AnemicDomainModel<\/a>.<\/p>\n\n<p>Moreover you can override case class methods later or extend and mix some traits.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419885736697,"favorite_count":null,"last_activity_date":1419885736697,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1981559.0,"parent_id":27695325,"post_type_id":2,"score":7,"tags":null,"view_count":null},{"index":315,"id":27517267,"title":null,"body":"<p>To generate an update event, you must create an <code>ObservableList<\/code> with an <a href=\"https:\/\/docs.oracle.com\/javase\/8\/javafx\/api\/javafx\/collections\/FXCollections.html#observableArrayList-javafx.util.Callback-\" rel=\"noreferrer\">extractor<\/a>.<\/p>\n\n<p>The extractor is a function mapping each element in the list to an array of <code>Observable<\/code>s. If any of those <code>Observable<\/code>s change (while the element is still in the list), then the list will receive an update event.<\/p>\n\n<p>For example, given a <code>Person<\/code> class:<\/p>\n\n<pre><code>public class Person {\n private final StringProperty name = new SimpleStringProperty();\n\n public Person(String name) {\n nameProperty().set(name);\n }\n\n public StringProperty nameProperty() {\n return name ;\n }\n public final String getName() {\n return nameProperty().get();\n }\n public final void setName(String name) {\n nameProperty().set(name);\n }\n}\n<\/code><\/pre>\n\n<p>if you create an observable list as<\/p>\n\n<pre><code>ObservableList&lt;Person&gt; people = FXCollections.observableArrayList(person -&gt; \n new Observable[] {person.nameProperty()} );\n<\/code><\/pre>\n\n<p>and register a listener<\/p>\n\n<pre><code>people.addListener((Change&lt;? extends Person&gt; change) -&gt; {\n while (change.next()) {\n if (change.wasAdded()) {\n System.out.println(\"Add\");\n }\n if (change.wasUpdated()) {\n System.out.println(\"Update\");\n }\n }\n});\n<\/code><\/pre>\n\n<p>Then the following will show an update event:<\/p>\n\n<pre><code>Person person = new Person(\"Jacob Smith\");\npeople.add(person);\nperson.setName(\"Isabella Johnson\");\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418782027043,"favorite_count":null,"last_activity_date":1418785822353,"last_edit_date":1418785822353,"last_editor_display_name":null,"last_editor_user_id":2189127.0,"owner_display_name":null,"owner_user_id":2189127.0,"parent_id":27517082,"post_type_id":2,"score":8,"tags":null,"view_count":null},{"index":316,"id":27543405,"title":null,"body":"<p>You don't need to do anything.<\/p>\n\n<p>Spring Boot's default Undertow configuration uses Undertow's <a href=\"https:\/\/github.com\/undertow-io\/undertow\/blob\/1.1.1.Final\/servlet\/src\/main\/java\/io\/undertow\/servlet\/handlers\/ServletInitialHandler.java\" rel=\"noreferrer\"><code>ServletInitialHandler<\/code><\/a> in front of Spring MVC's <code>DispatcherServlet<\/code>. This handler <a href=\"https:\/\/github.com\/undertow-io\/undertow\/blob\/1.1.1.Final\/servlet\/src\/main\/java\/io\/undertow\/servlet\/handlers\/ServletInitialHandler.java#L160-L162\" rel=\"noreferrer\">performs the <code>exchange.isInIoThread()<\/code> check and calls <code>dispatch()<\/code> if necessary<\/a>.<\/p>\n\n<p>If you place a breakpoint in your <code>@Controller<\/code>, you'll see that it's called on a thread named <code>XNIO-1 task-n<\/code> which is a worker thread (the IO threads are named <code>XNIO-1 I\/O-n<\/code>).<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418895637143,"favorite_count":null,"last_activity_date":1418895637143,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1384297.0,"parent_id":27536751,"post_type_id":2,"score":8,"tags":null,"view_count":null},{"index":317,"id":27593565,"title":null,"body":"<p>The <code>queryForObject<\/code> method looks like this:<\/p>\n\n<pre><code>public &lt;T&gt; T queryForObject(String sql, RowMapper&lt;T&gt; rowMapper, Object... args) throws DataAccessException {\n List&lt;T&gt; results = query(sql, args, new RowMapperResultSetExtractor&lt;T&gt;(rowMapper, 1));\n return DataAccessUtils.requiredSingleResult(results);\n}\n<\/code><\/pre>\n\n<p>The <code>queryForObject<\/code>-method internally invokes the method <code>query<\/code> on the <code>JdbcTemplate<\/code> object. The <code>query<\/code>-method is defined as:<\/p>\n\n<pre><code>public &lt;T&gt; T query(\n PreparedStatementCreator psc, final PreparedStatementSetter pss, final ResultSetExtractor&lt;T&gt; rse)\n throws DataAccessException;\n<\/code><\/pre>\n\n<p>As you can see, a <code>ResultSetExtractor&lt;T&gt;<\/code> is passed to the <code>query<\/code>-method and Spring conveniently converts your <code>RowMapper&lt;T&gt;<\/code> to an object of type <code>new RowMapperResultSetExtractor&lt;T&gt;(rowMapper, 1)<\/code>. The <code>RowMapperResultSetExtractor<\/code> is the object that holds the key to the magic. When the object is invoked it iterates all rows as per this snippet:<\/p>\n\n<pre><code>public List&lt;T&gt; extractData(ResultSet rs) throws SQLException {\n List&lt;T&gt; results = (this.rowsExpected &gt; 0 ? new ArrayList&lt;T&gt;(this.rowsExpected) : new ArrayList&lt;T&gt;());\n int rowNum = 0;\n while (rs.next()) {\n results.add(this.rowMapper.mapRow(rs, rowNum++));\n }\n return results;\n}\n<\/code><\/pre>\n\n<p>So, your original <code>RowMapper<\/code> is the callback that is called for each row. Furthermore, as you can see here your <code>RowMapper<\/code> is invoked for all matching results and the <code>Restaurant<\/code>-object that you created is added to the result list. However, since you query for only <strong>one<\/strong> object the following statement is finally used to return your single <code>Restaurant<\/code> object.<\/p>\n\n<pre><code> return DataAccessUtils.requiredSingleResult(results);\n<\/code><\/pre>\n\n<p>So, to sum up: <code>JdbcTempalte<\/code> implementes the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Strategy_pattern\" rel=\"noreferrer\">Strategy Pattern<\/a> (which is similar to the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Template_method_pattern\" rel=\"noreferrer\">Template method pattern<\/a>). And by providing a <em>Strategy interface<\/em> (the <code>RowMapper<\/code>) you can let <code>JdbcTemplate<\/code> do the heavy lifting for you (handling exceptions, connections etc). The <code>RowMapper<\/code> maps each hit as a POJO (the <code>Restaurant<\/code>) and all hits are collected to a <code>List<\/code>. The method <code>queryForObject<\/code> then takes the first row from that <code>List<\/code> and returns it to the caller. The return value is based on the generic type of the <code>RowMapper<\/code> which in your case is <code>Restaurant<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419194272930,"favorite_count":null,"last_activity_date":1419194693933,"last_edit_date":1419194693933,"last_editor_display_name":null,"last_editor_user_id":2138993.0,"owner_display_name":null,"owner_user_id":2138993.0,"parent_id":27591847,"post_type_id":2,"score":8,"tags":null,"view_count":null},{"index":318,"id":27642433,"title":null,"body":"<p>From <a href=\"https:\/\/docs.djangoproject.com\/en\/1.7\/ref\/utils\/#django.utils.timezone.now\" rel=\"noreferrer\">the documentation<\/a>:<\/p>\n\n<blockquote>\n <p>Note that <code>now()<\/code> will always return times in UTC regardless of the value of <code>TIME_ZONE<\/code>; you can use <code>localtime()<\/code> to convert to a time in the current time zone.<\/p>\n<\/blockquote>\n\n<p>But note that Django always stores datetimes in UTC, so even if you convert it using <code>localtime()<\/code> it won't affect how the value is stored. So <code>q.pub_date<\/code> will either be in UTC or in a time zone defined in the database (not Django) settings.<\/p>\n\n<p>But what matters is how the datetimes are presented to the user, and the way to control that is described in the <a href=\"https:\/\/docs.djangoproject.com\/en\/dev\/topics\/i18n\/timezones\/\" rel=\"noreferrer\">timezone documentation<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419457614973,"favorite_count":null,"last_activity_date":1419458033950,"last_edit_date":1419458033950,"last_editor_display_name":null,"last_editor_user_id":2395796.0,"owner_display_name":null,"owner_user_id":2395796.0,"parent_id":27642356,"post_type_id":2,"score":8,"tags":null,"view_count":null},{"index":319,"id":27507955,"title":null,"body":"<p><code>MONGO_URL<\/code> is the URL your app uses to communicate with your mongo instance. It is required for all production applications. Oplog transactions are <strong>not<\/strong> communicated through this URL.<\/p>\n\n<p><code>MONGO_OPLOG_URL<\/code> is the URL your app uses to <a href=\"https:\/\/github.com\/meteor\/meteor\/wiki\/Oplog-Observe-Driver\" rel=\"noreferrer\">listen for changes<\/a> to the binary oplog for your database. It is not required, but highly recommended.<\/p>\n\n<p>Summary: add both.<\/p>\n\n<p>For more information see <a href=\"https:\/\/blog.compose.io\/meteor-and-compose-a-beginners-guide-to-using-them-together\/\" rel=\"noreferrer\">this article<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418743420660,"favorite_count":null,"last_activity_date":1418743420660,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":635981.0,"parent_id":27507260,"post_type_id":2,"score":9,"tags":null,"view_count":null},{"index":320,"id":27585782,"title":null,"body":"<p>A <code>PersistentQueue<\/code> is another persistent data structure with different behavior and performance characteristics when compared to list, vector, map, and set. If you look at the docstrings for <code>pop<\/code> and <code>peek<\/code>, for example, you will see this datatype being referred to as \"queue\".<\/p>\n\n<p>Since it has no literal syntax, you have to start off by creating an empty one using <code>cljs.core.PersistentQueue\/EMPTY<\/code>. <\/p>\n\n<p>This post provides a good high-level summary of the Clojure equivalent <a href=\"https:\/\/stackoverflow.com\/a\/2495105\">https:\/\/stackoverflow.com\/a\/2495105<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419122959977,"favorite_count":null,"last_activity_date":1419348688250,"last_edit_date":1495542621617,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":4284484.0,"parent_id":27486966,"post_type_id":2,"score":9,"tags":null,"view_count":null},{"index":321,"id":27489722,"title":null,"body":"<p>You don't import fonts into Android Studio. Install them into your OS using the normal font installation procedures and they will be accessible to Android Studio the next time you launch it.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418664792933,"favorite_count":null,"last_activity_date":1418664792933,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2985303.0,"parent_id":27474574,"post_type_id":2,"score":10,"tags":null,"view_count":null},{"index":322,"id":27636142,"title":null,"body":"<p>Maybe you create the sentences in the wrong way.<br>\nTry this, it works for me.<\/p>\n\n<pre><code>import gensim\nimport logging\nfrom nltk.corpus import brown \n\nlogging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)\nsentences = brown.sents()\nmodel = gensim.models.Word2Vec(sentences, min_count=1)\nmodel.save('\/tmp\/brown_model')\n<\/code><\/pre>\n\n<p>The logging part is not necessary, and you can change the params in <code>Word2Vec()<\/code> as you own need.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419420238123,"favorite_count":null,"last_activity_date":1419420238123,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2305655.0,"parent_id":27632404,"post_type_id":2,"score":10,"tags":null,"view_count":null},{"index":323,"id":27643664,"title":null,"body":"<p>You should use some multipart format. It basically consists of a single message of type <code>multipart\/xxx<\/code> (where <code>xxx<\/code> can be something like <code>form-data<\/code>), and that message consists of other \"complete\" messages with their own content-type and other meta data.<\/p>\n\n<p>You haven't specified which Jersey version, but starting with Jersey 2.x.x, there is multipart support available, in the form of a separate artifact:<\/p>\n\n<pre><code>&lt;dependency&gt;\n &lt;groupId&gt;org.glassfish.jersey.media&lt;\/groupId&gt;\n &lt;artifactId&gt;jersey-media-multipart&lt;\/artifactId&gt;\n &lt;version&gt;${jersey.version}&lt;\/version&gt;\n&lt;\/dependency&gt;\n<\/code><\/pre>\n\n<p>Then you just need to register the feature, as seen <a href=\"https:\/\/jersey.github.io\/documentation\/latest\/media.html#d0e8934\" rel=\"nofollow noreferrer\">here in Registration<\/a>.<\/p>\n\n<p>Then you can just use <code>@FormDataParam<\/code><\/p>\n\n<pre><code>@POST\n@Consumes(MediaType.MULTIPART_FORM_DATA)\n@Produces({MediaType.APPLICATION_JSON})\npublic CreateTaskVO provideService(\n @FormDataParam(\"meta\") String jsonMeta,\n @FormDataParam(\"data\") InputStream file,\n @FormDataParam(\"data\") FormDataContentDisposition fileDetail) {\n<\/code><\/pre>\n\n<p>You can see <a href=\"https:\/\/stackoverflow.com\/a\/27614403\/2587435\">here an example<\/a> of how the data can be sent from the client, and also the internal message body format of a multipart<\/p>\n\n<p><strong>Other rreading:<\/strong><\/p>\n\n<ul>\n<li><a href=\"https:\/\/jersey.github.io\/documentation\/latest\/media.html#multipart\" rel=\"nofollow noreferrer\">General Information on Jersey Multipart support<\/a><\/li>\n<li><a href=\"http:\/\/www.w3.org\/TR\/html401\/interact\/forms.html#h-17.13.4.2\" rel=\"nofollow noreferrer\">General information on <code>multipart\/form-data<\/code><\/a><\/li>\n<li><a href=\"https:\/\/stackoverflow.com\/a\/29307655\/2587435\">JAX-RS Post multiple objects<\/a><\/li>\n<\/ul>\n\n<hr>\n\n<p><strong>UPDATE<\/strong><\/p>\n\n<p>There is also support for multipart in Jersey 1.x.x, in the form of <em>this<\/em> artifact<\/p>\n\n<pre><code>&lt;dependency&gt;\n &lt;groupId&gt;com.sun.jersey.contribs&lt;\/groupId&gt;\n &lt;artifactId&gt;jersey-multipart&lt;\/artifactId&gt;\n &lt;version&gt;${jersey.version}&lt;\/version&gt;\n&lt;\/dependency&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419472691547,"favorite_count":null,"last_activity_date":1519987562727,"last_edit_date":1519987562727,"last_editor_display_name":null,"last_editor_user_id":2991106.0,"owner_display_name":null,"owner_user_id":2587435.0,"parent_id":27643558,"post_type_id":2,"score":10,"tags":null,"view_count":null},{"index":324,"id":27730120,"title":null,"body":"<p>Most likely you inserted this line in the wrong section (<code>components<\/code>):<\/p>\n\n<pre><code>'components' =&gt; [\n 'user' =&gt; [\n 'identityClass' =&gt; 'app\\models\\User',\n 'enableAutoLogin' =&gt; true,\n \/\/ You inserted it here\n ],\n],\n<\/code><\/pre>\n\n<p>But <code>yii2-user<\/code> is not component, it's module. Therefore you should include this in <code>modules<\/code> section of <code>config<\/code>. It also mentioned in documentation:<\/p>\n\n<pre><code>'modules' =&gt; [\n 'user' =&gt; [\n 'class' =&gt; 'dektrium\\user\\Module',\n ],\n],\n<\/code><\/pre>\n\n<p>Right after installation basic application does not have any modules so in that case you should create this section by yourself.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1420109650940,"favorite_count":null,"last_activity_date":1420109650940,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4323648.0,"parent_id":27729764,"post_type_id":2,"score":24,"tags":null,"view_count":null},{"index":325,"id":27558738,"title":null,"body":"<p>The behavior of live regions depends on the browser and screen reader being used, but you're on the right track.<\/p>\n\n<p>According to the <a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#aria-live\" rel=\"noreferrer\">WAI-ARIA spec<\/a>:<\/p>\n\n<blockquote>\n <p>The values of this attribute are expressed in degrees of importance. When regions are specified as polite, assistive technologies will notify users of updates but generally do not interrupt the current task, and updates take low priority. When regions are specified as assertive, assistive technologies will immediately notify the user, and could potentially clear the speech queue of previous updates.<\/p>\n<\/blockquote>\n\n<p>Usage notes from the <a href=\"https:\/\/www.w3.org\/TR\/2016\/WD-wai-aria-practices-1.1-20160317\/#liveprops\" rel=\"noreferrer\">WAI-ARIA authoring practices 1.1<\/a>:<\/p>\n\n<blockquote>\n <p><code>aria-live=\"polite\"<\/code>\n Any updates made to this region should only be announced if the user is not currently doing anything. live=\"polite\" should be used in most situations involving live regions that present new information to users, such as updating news headlines. -<\/p>\n \n <p><code>aria-live=\"assertive\"<\/code>\n Any updates made to this region are important enough to be announced to the user as soon as possible, but it is not necessary to immediately interrupt the user. live=\"assertive\" must be used if there is information that a user must know about right away, for example, warning messages in a form that does validation on the fly.<\/p>\n<\/blockquote>\n\n<p>Regarding clearing the queue (also from the <a href=\"https:\/\/www.w3.org\/TR\/wai-aria\/#aria-live\" rel=\"noreferrer\">spec<\/a>):<\/p>\n\n<blockquote>\n <p>User agents or assistive technologies <strong>MAY<\/strong> choose to clear queued changes when an assertive change occurs.<\/p>\n<\/blockquote>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418954490237,"favorite_count":null,"last_activity_date":1557762606080,"last_edit_date":1557762606080,"last_editor_display_name":null,"last_editor_user_id":1497.0,"owner_display_name":null,"owner_user_id":1162838.0,"parent_id":27546070,"post_type_id":2,"score":52,"tags":null,"view_count":null},{"index":326,"id":27491426,"title":null,"body":"<p><code>default<\/code> takes a callable, so you just need to write a function to do what you want and then provide that as the argument:<\/p>\n\n<pre><code>def one_day_hence():\n return timezone.now() + timezone.timedelta(days=1)\n\nclass MyModel(models.Model):\n ...\n key_expires = models.DateTimeField(default=one_day_hence)\n<\/code><\/pre>\n\n<p>(As discussed <a href=\"https:\/\/stackoverflow.com\/a\/27074816\/2395796\">here<\/a>, resist the temptation to make this a <code>lambda<\/code>.)<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418670993733,"favorite_count":null,"last_activity_date":1555110235483,"last_edit_date":1555110235483,"last_editor_display_name":null,"last_editor_user_id":2395796.0,"owner_display_name":null,"owner_user_id":2395796.0,"parent_id":27491248,"post_type_id":2,"score":56,"tags":null,"view_count":null},{"index":327,"id":27628410,"title":null,"body":"<p>This is the best solution. The back() and forward() methods aren't guaranteed to work.<\/p>\n\n<pre><code> driver.execute_script(\"window.history.go(-1)\")\n<\/code><\/pre>\n\n<p>The JavaScript passed in accesses the pages Dom to navigate to the previous url. I hope that this solves your problem. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419370831403,"favorite_count":null,"last_activity_date":1419383307587,"last_edit_date":1419383307587,"last_editor_display_name":null,"last_editor_user_id":4389968.0,"owner_display_name":null,"owner_user_id":4389968.0,"parent_id":27626783,"post_type_id":2,"score":83,"tags":null,"view_count":null},{"index":328,"id":27429765,"title":null,"body":"<p>I've made the following changes and it seems to work.<\/p>\n\n<pre><code>views.py\n\ncontext = {'data': data, 'location': location}\n...\nreturn render (request, 'nameform\/success.html', context)\n\n\nsuccess.html\n\n{% for name in data %}\n&lt;p&gt;{{ name.first_name }} {{ name.last_name }} {{ location }}\n{% endfor %}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1418322007070,"favorite_count":null,"last_activity_date":1418322007070,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4047444.0,"parent_id":27413253,"post_type_id":2,"score":-1,"tags":null,"view_count":null},{"index":329,"id":27662324,"title":null,"body":"<p>Try with:<\/p>\n\n<pre><code>String path = getServletConfig().getServletContext().getRealPath(\"\/file\/title.txt\");\nBufferedReader reader = new BufferedReader(new FileReader(path));\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":0,"community_owned_date":null,"creation_date":1419630595313,"favorite_count":null,"last_activity_date":1419630595313,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":870248.0,"parent_id":27662206,"post_type_id":2,"score":-1,"tags":null,"view_count":null},{"index":330,"id":27409457,"title":null,"body":"<p><code>p:commandButton<\/code> has built in ajax capabilities, so no need to use <code>p:ajax<\/code>. I believe your problem is that <code>p:ajax<\/code> defaults to <code>process=\"@this\"<\/code> (which in this case only means the <code>commandButton<\/code>), so the <code>p:inputText<\/code>'s won't be submitted. But <code>p:commandButton<\/code> defaults to <code>process=\"@form\"<\/code>, which is what you need:<\/p>\n\n<pre><code>&lt;p:commandButton id=\"btn-save_query-client\" \n value=\"Save to current client\" \n action=\"#{dashboardDetailedMB.saveQueryClient}\" \n update=\"msg\" \/&gt;\n<\/code><\/pre>\n\n<p>Also it seems your form is around your dialog, I find it safest to put a form inside the dialog and put the dialog below the main form in the page, but if it works as is no need to change it.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418240347207,"favorite_count":null,"last_activity_date":1418240347207,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3087130.0,"parent_id":27406353,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":331,"id":27421220,"title":null,"body":"<p>Insert this rule as your very first rule just below <code>RewriteBase<\/code> line:<\/p>\n\n<pre><code>RewriteRule ^siteimage\/scale\/480\/800\/ \/wp-content\/themes\/mytheme\/img\/placeholder.png [L,NC,R=302]\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418295487420,"favorite_count":null,"last_activity_date":1418295487420,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":548225.0,"parent_id":27421159,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":332,"id":27480441,"title":null,"body":"<p>I tried the sample project and work with simple function<\/p>\n\n<pre><code>@property (strong, nonatomic) IBOutlet UISlider *slider; \/\/ make the getter and setter for Slider\n@property (strong, nonatomic) IBOutlet UILabel *lblText; \/\/ make the getter and setter for label\n\n\n\n- (void)viewDidLoad {\n[super viewDidLoad];\n\n\/\/ set verticical of UIslider\n\nCGAffineTransform trans = CGAffineTransformMakeRotation(M_PI * 0.5);\nself.slider.transform = trans;\n\n\/\/ get the events of UISlider \n[self.slider addTarget:self\n action:@selector(sliderDidEndSliding:)\n forControlEvents:(UIControlEventTouchUpInside | UIControlEventTouchUpOutside)];\n\n}\n\/\/ this method used for hide the label after changed the value\n- (void)sliderDidEndSliding:(NSNotification *)notification {\n NSLog(@\"Slider did end sliding...\");\n [self.lblText removeFromSuperview];\n}\n\n\n\n\n\/\/ the slider value change method\n- (IBAction)slider:(UISlider*)sender\n{\n\/\/ add the subview the lable to slider\n[self.slider addSubview:self.lblText];\nself.lblText.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@\"sliderlabel.png\"]];\nself.lblText.text = [NSString stringWithFormat:@\"%4.2f\",sender.value];\n\n\/\/ change the label position depend upon slider move\nself.lblText.center = CGPointMake(self.slider.value*self.slider.bounds.size.width,80);\n[self.lblText setTransform:CGAffineTransformMakeRotation(-M_PI \/ 2)];\n\n}\n<\/code><\/pre>\n\n<p>here I attached the sample project for <code>UISlider<\/code> the download <a href=\"https:\/\/www.sendspace.com\/file\/fn4lo0\" rel=\"nofollow\">link<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418634050390,"favorite_count":null,"last_activity_date":1418634050390,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2783370.0,"parent_id":27289695,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":333,"id":27496854,"title":null,"body":"<p><code>setTimeOut<\/code> is executed only once. Try using <code>setInterval<\/code>.<\/p>\n\n<p>Here is a simple fiddle - <a href=\"http:\/\/jsfiddle.net\/hmomeqmm\/1\/\" rel=\"nofollow noreferrer\">Fiddle<\/a><\/p>\n\n<p>There is one more thing: You need to check if user is not scrolling then run your code:<\/p>\n\n<pre><code>var lastScroll = 0;\nvar isScrolling = false;\n\n$(document).ready(function($) {\n $('#kittysprite').addClass('stillkitty');\n\n \/\/run every 3000ms and see if user is not scrolling then reset\n setInterval(function() {\n if(!isScrolling){\n $('#kittysprite').removeClass().addClass('stillkitty');\n }\n }, 3000);\n\n $(window).scroll(function(){\n \/\/User is scrolling\n isScrolling = true;\n\n \/\/Reset the timeout\n clearTimeout($.data(this, 'scrollTimer'));\n $.data(this, 'scrollTimer', setTimeout(function() {\n \/\/ User is not scrolling\n isScrolling = false;\n }, 250));\n\n var scroll = $(window).scrollTop();\n if (scroll &gt; lastScroll) {\n $('#kittysprite').removeClass().addClass('walkingkitty');\n } \n else if (scroll &lt; lastScroll) {\n $('#kittysprite').removeClass('walkingkitty').addClass('backkitty');\n }\n\n lastScroll = scroll;\n });\n});\n<\/code><\/pre>\n\n<p>References: <a href=\"https:\/\/stackoverflow.com\/questions\/9144560\/jquery-scroll-detect-when-user-stops-scrolling\">Not Scrolling<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418699020407,"favorite_count":null,"last_activity_date":1418699876020,"last_edit_date":1495542032527,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":3952913.0,"parent_id":27496787,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":334,"id":27562775,"title":null,"body":"<p>Set linear damping to that body. Lets say 5<\/p>\n\n<p>body->setLinearDamping(5);<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418980377153,"favorite_count":null,"last_activity_date":1418980377153,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2028047.0,"parent_id":27545456,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":335,"id":27585544,"title":null,"body":"<p>You can add a new menu item to <strong><code>Tools -&gt; SublimeREPL -&gt; Python<\/code><\/strong>. First, open your <code>Packages\/User<\/code> directory by selecting <strong><code>Sublime Text 2 -&gt; Preferences -&gt; Browse Packages...<\/code><\/strong> and opening the <code>User<\/code> directory. Create a folder in <code>User<\/code> called <code>SublimeREPL<\/code>, inside that create a <code>config<\/code> directory, and inside that create a <code>Python<\/code> directory. Finally, make a new file in Sublime with JSON syntax and the following contents:<\/p>\n\n<pre class=\"lang-js prettyprint-override\"><code>[\n {\n \"id\": \"tools\",\n \"children\":\n [\n {\n \"caption\": \"SublimeREPL\",\n \"mnemonic\": \"r\",\n \"id\": \"SublimeREPL\",\n \"children\":\n [\n {\n \"caption\": \"Python\",\n \"id\": \"Python\",\n \"children\":\n [\n {\n \"command\": \"repl_open\",\n \"caption\": \"Python (Homebrew)\",\n \"id\": \"repl_python\",\n \"mnemonic\": \"p\",\n \"args\": \n {\n \"type\": \"subprocess\",\n \"encoding\": \"utf8\",\n \"cmd\": [\"\/usr\/local\/bin\/python\", \"-i\", \"-u\"],\n \"cwd\": \"\/Users\/williamrudisill\/Development\/python\",\n \"syntax\": \"Packages\/Python\/Python.tmLanguage\",\n \"external_id\": \"python\",\n \"extend_env\": {\"PYTHONIOENCODING\": \"utf-8\"}\n }\n }\n ]\n }\n ]\n }\n ]\n }\n]\n<\/code><\/pre>\n\n<p>Save this file as <code>Packages\/User\/SublimeREPL\/config\/Python\/Main.sublime-menu<\/code>. Make sure you edit the <code>\"cwd\"<\/code> parameter to set the folder you'd like the interpreter to open in.<\/p>\n\n<p>Now, if you open <strong><code>Tools -&gt; SublimeREPL -&gt; Python<\/code><\/strong> there will be an item called <strong><code>Python (Homebrew)<\/code><\/strong> that you can use to open an interpreter with <code>\/usr\/local\/bin\/python<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419120192730,"favorite_count":null,"last_activity_date":1419120192730,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1426065.0,"parent_id":27584917,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":336,"id":27652451,"title":null,"body":"<p>Firstly, I don't see you adding <code>bar1<\/code> to your scene at all, so make sure and do that.<\/p>\n\n<p>The reason you only see one bar is that they all start in the same position, and they're all moving at the same speed at the same time. They are covering one another. <\/p>\n\n<p>There's several ways to make them move in a sequence but one way is to use a completion block at the end of each action to call the next action.<\/p>\n\n<pre><code>addChild(bar1)\naddChild(bar2)\naddChild(bar3)\n\nbar1.runAction(sequence, completion: {\n bar2.runAction(sequence, completion: {\n bar3.runAction(sequence)\n }\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419563238940,"favorite_count":null,"last_activity_date":1419563238940,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1015571.0,"parent_id":27651750,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":337,"id":27667936,"title":null,"body":"<p>First of all, I edited your question and added four spaces at the beginning of each line of code. This way, you get a nice formatting.<\/p>\n\n<p>Now, I see several problems in the make file and in the gnuplot code:<\/p>\n\n<h2>gnuplot<\/h2>\n\n<p>Your code generates four plots on the screen, each overwriting the last one. Then, you open a file and do <code>replot<\/code> . This command repeats <em>the last plot command<\/em>, i.e. only result5.data will be written into a file.\nNext, simply setting an output file is not enough. You have to specify the terminal (file type) first. <\/p>\n\n<p>This will generate a 5-page PS file, one plot on each page:<\/p>\n\n<pre><code>set terminal postscript\nset output \"simulation.ps\"\nplot 'result1.data' using 2:3 title \"F\" w lines\nplot 'result2.data' using 2:3 title \"F\" w lines\nplot 'result3.data' using 2:3 title \"F\" w lines\nplot 'result4.data' using 2:3 title \"F\" w lines\nplot 'result5.data' using 2:3 title \"F\" w lines\nunset output\n<\/code><\/pre>\n\n<p>Or, if you want all data within a singe diagram, use this:<\/p>\n\n<pre><code>set terminal postscript\nset output \"simulation.ps\"\nplot 'result1.data' using 2:3 title \"F\" w lines,\\\n 'result2.data' using 2:3 title \"F\" w lines,\\\n 'result3.data' using 2:3 title \"F\" w lines,\\\n 'result4.data' using 2:3 title \"F\" w lines,\\\n 'result5.data' using 2:3 title \"F\" w lines\nunset output\n<\/code><\/pre>\n\n<p>Note: The five plot objects are separated by a comma. And the backslash <code>\\<\/code> allows to proceed in the next line (so, there is in fact only a single line with a large plot command)<\/p>\n\n<p>However, it is not necessary to generate a postscript file with gnuplot and later convert it to PDF. gnuplot can directly generate PDF:<\/p>\n\n<pre><code>set terminal pdfcairo mono dashed size 8in, 11in\nset output \"foo.pdf\"\nplot sin(x), cos(x)\nunset output\n<\/code><\/pre>\n\n<p>Here, I added options to generate a plot of DIN A4 paper size, in black\/white instead of color, and with dashed lines. There are plenty of options, check it in gnuplot with <code>help pdfcairo<\/code><\/p>\n\n<h2>makefile<\/h2>\n\n<p>The list of prerequisites has to be given in a single line. But like in gnuplot, you can use <code>\\<\/code> to span it over multible lines:<\/p>\n\n<pre><code>plot: result1.data \\\n result2.data \\\n result3.data \\\n result4.data \\\n result5.data\n gnuplot simulation.gplt\n ps2pdf simulation.ps\n rm -f simulation.ps\n evince simulation.pdf \n<\/code><\/pre>\n\n<p>This is exactly what the error message tells you: It wants to process the rule \"plot\". the results1.data is already there, and then, it tries to run the command in the second line, which is <code>results2.data<\/code>. As this isn't a command, you get the error.<\/p>\n\n<p>Another problem is that make definitively needs a tabulator in front of each command line, not just spaces. Make sure your editor does insert tabs, many like to insert four spaces instead! (This error can not be checked here, as tabs are not visible here.)<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419688823590,"favorite_count":null,"last_activity_date":1419688823590,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4099181.0,"parent_id":27662706,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":338,"id":27680317,"title":null,"body":"<p>You can't. Microsoft Office Access isn't supported as database on the WP platform.<\/p>\n\n<p>I would suggest to take a look at the article <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/apps\/hh202860%28v=vs.105%29.aspx\" rel=\"nofollow\">Local database for Windows Phone 8<\/a> to see the viable options.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419798512833,"favorite_count":null,"last_activity_date":1419798512833,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":993547.0,"parent_id":27680255,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":339,"id":27693657,"title":null,"body":"<p>I would not recommend that many different colours (if only because each colour after the first needs a separate rule!) and don't really see the point of D2 for the CF - unless you plan to have a separate set of 12 colours for each year? However, I think what you request is a plethora of formulae like: <\/p>\n\n<pre><code>=and(year(A1)=D$2,month(A1)=1) \n<\/code><\/pre>\n\n<p>to be repeated with the last <code>1<\/code> changed in integer steps all the way to <code>12<\/code>, with a different colour for each such value. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419875490923,"favorite_count":null,"last_activity_date":1419875886327,"last_edit_date":1419875886327,"last_editor_display_name":null,"last_editor_user_id":1505120.0,"owner_display_name":null,"owner_user_id":1505120.0,"parent_id":27692452,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":340,"id":27697047,"title":null,"body":"<p>Way to achieve this is to set wait for particular response .\nand set outcome to wait for rejected. So that Workflow will automatically send mail to user who have not responded yet and also removes task items.<\/p>\n\n<p>Hope this helps some one.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419892654567,"favorite_count":null,"last_activity_date":1419892654567,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":812824.0,"parent_id":27656290,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":341,"id":27715718,"title":null,"body":"<p>All <code>DevExpress<\/code> editors have the <code>SomeEditor.Properties<\/code> property which contains settings specific to the editors. So, you can get <code>Items<\/code> collection from <code>comboBox.Properties.Items<\/code> property:<\/p>\n\n<pre><code>If combobox1.SelectectItem.ToString = \"Item1\" Then \n Combobox2.Properties.Items.Add(\"Added Item String\")\nEnd If\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419996133347,"favorite_count":null,"last_activity_date":1419996133347,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1805640.0,"parent_id":27715531,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":342,"id":27747779,"title":null,"body":"<p>Currently, that fork of tablesorter does not support sorting the contents of the child rows; but <a href=\"https:\/\/github.com\/keyboardDrummer\/tablesorter\" rel=\"nofollow\">this branch<\/a> does support hierarchical sorting. See <a href=\"https:\/\/github.com\/Mottie\/tablesorter\/pull\/410\" rel=\"nofollow\">this pull request<\/a> for more information.<\/p>\n\n<p><a href=\"http:\/\/keyboarddrummer.github.io\/tablesorter\/docs\/example-tree-table.html\" rel=\"nofollow\">Here is a demo<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420228439677,"favorite_count":null,"last_activity_date":1420228439677,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":145346.0,"parent_id":27724961,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":343,"id":27753499,"title":null,"body":"<p>Embedding of subfields (of dicts) is not currently supported. From the <strong>Limitations<\/strong> paragraph in <a href=\"http:\/\/python-eve.org\/features#embedded-resource-serialization\" rel=\"nofollow\">Document Embedding<\/a>:<\/p>\n\n<blockquote>\n <p>Currently we support embedding of documents by references located in any subdocuments (nested dicts and lists). For example, a query \/invoices?\/embedded={\"user.friends\":1} will return a document with user and all his friends embedded, <strong>but only if user is a subdocument and friends is a list of reference<\/strong> (it could be a list of dicts, nested dict, ect.). We do not support multiple layers embeddings.<\/p>\n<\/blockquote>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420278199397,"favorite_count":null,"last_activity_date":1420278199397,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":323269.0,"parent_id":27741950,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":344,"id":27385494,"title":null,"body":"<blockquote>\n <p>But it overwrites the StudentID attribute that already exists.<\/p>\n<\/blockquote>\n\n<p>No, it doesn't. The problem is you're not copying it. You should start your template with:<\/p>\n\n<pre><code>&lt;xsl:template match=\"r:student\"&gt;\n &lt;xsl:copy&gt;\n &lt;xsl:copy-of select=\"@StudentID\"\/&gt; \n<\/code><\/pre>\n\n<p>or, if you prefer:<\/p>\n\n<pre><code>&lt;xsl:template match=\"r:student\"&gt;\n &lt;xsl:copy&gt;\n &lt;xsl:copy-of select=\"@*\"\/&gt; \n<\/code><\/pre>\n\n<p>to copy any and all attributes the Student has.<\/p>\n\n<p>Regarding the problem with<code>&lt;year_Collection&gt;<\/code>, you should try to turn only leaf nodes into attributes, for example:<\/p>\n\n<pre><code>&lt;xsl:template match=\"r:student\"&gt;\n &lt;xsl:copy&gt;\n &lt;xsl:copy-of select=\"@*\"\/&gt; \n &lt;xsl:copy-of select=\"*\/@*\"\/&gt; \n &lt;xsl:copy-of select=\"*\/*[@*]\"\/&gt;\n &lt;\/xsl:copy&gt;\n &lt;\/xsl:template&gt;\n&lt;\/xsl:stylesheet&gt; \n<\/code><\/pre>\n\n<p>Of course, if your structure is known, naming the required nodes explicitly would be much better, e.g;<\/p>\n\n<pre><code>&lt;xsl:template match=\"r:student\"&gt;\n &lt;xsl:copy&gt;\n &lt;xsl:copy-of select=\"@StudentID | r:firstName\/@firstName | r:lastName\/@lastName | r:gender\/@gender\"\/&gt; \n &lt;xsl:copy-of select=\"r:year_Collection\/r:year\"\/&gt;\n &lt;\/xsl:copy&gt;\n&lt;\/xsl:template&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418147470350,"favorite_count":null,"last_activity_date":1418149293180,"last_edit_date":1418149293180,"last_editor_display_name":null,"last_editor_user_id":3016153.0,"owner_display_name":null,"owner_user_id":3016153.0,"parent_id":27385216,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":345,"id":27388228,"title":null,"body":"<p>Bower gets the list of a package versions from Git tags (they also need to be valid semver).<br>\nIn the case of <em>backbone.iobind<\/em> the latest version is 0.4.8.<br>\nYou can see that when resolving <em>backbone.iobind<\/em> Bower will checkout the <a href=\"https:\/\/github.com\/Soniflow\/backbone.iobind\/tree\/0.4.8\" rel=\"nofollow\">0.4.8 tag<\/a>:<\/p>\n\n<pre><code>bower resolved git:\/\/github.com\/Soniflow\/backbone.iobind.git#0.4.8\n<\/code><\/pre>\n\n<p>However this tag <strong>does not<\/strong> contain any bower.json file (unlike the master branch).<br>\nThe .bower.json file is an internal file used by Bower and should not be confused with bower.json.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418156962080,"favorite_count":null,"last_activity_date":1418156962080,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1097634.0,"parent_id":27384690,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":346,"id":27399380,"title":null,"body":"<p>Actually you can look at the sources of <a href=\"http:\/\/grepcode.com\/file\/repo1.maven.org\/maven2\/org.springframework\/spring-jdbc\/3.0.1.RELEASE\/org\/springframework\/jdbc\/core\/JdbcTemplate.java\" rel=\"nofollow noreferrer\">JdbcTemplate<\/a>.<\/p>\n\n<p>You can see there that it doesn't get connections directly from datasource but does <code>Connection con = DataSourceUtils.getConnection(getDataSource());<\/code> instead.<\/p>\n\n<p>These <a href=\"http:\/\/grepcode.com\/file\/repo1.maven.org\/maven2\/org.springframework\/spring-jdbc\/3.0.1.RELEASE\/org\/springframework\/jdbc\/datasource\/DataSourceUtils.java#DataSourceUtils\" rel=\"nofollow noreferrer\">DataSourceUtils<\/a> are responsible for getting current transaction connection from Spring thread-local <a href=\"http:\/\/grepcode.com\/file\/repo1.maven.org\/maven2\/org.springframework\/spring-jdbc\/3.0.1.RELEASE\/org\/springframework\/jdbc\/datasource\/ConnectionHolder.java#ConnectionHolder\" rel=\"nofollow noreferrer\">connection holder<\/a> or instantiation of new Connection from DataSource and registering it in the holder if it was first request in transaction for example.<\/p>\n\n<p>P.S. And you <a href=\"https:\/\/stackoverflow.com\/questions\/10407301\/how-to-use-spring-transaction-in-multithread\">can't<\/a> get single transaction running across multiple threads with Spring transaction mechanism in any easy way.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418209392960,"favorite_count":null,"last_activity_date":1418209858380,"last_edit_date":1495540235730,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1385087.0,"parent_id":27397911,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":347,"id":27448558,"title":null,"body":"<p>Well, really simple mistake, you just forgot to add a <code>,<\/code> after <code>animation<\/code> :<\/p>\n\n<pre><code> var options = {\n title: \"Crash counts for \",\n pointSize: 6,\n hAxis: {showTextEvery: 2, slantedText: true, slantedTextAngle: 30},\n animation: {\n duration: 1000,\n easing: 'out'\n }, \/\/ here is the change\n vAxis:{viewWindow: {min: 0}}\n };\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418403910177,"favorite_count":null,"last_activity_date":1418403910177,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3308055.0,"parent_id":27430306,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":348,"id":27455975,"title":null,"body":"<p>You have to set the date format within the concatenation. The concatenation is retrieving the value behind the cell.<\/p>\n\n<p>Instead, you can easily specify the date format using <code>TEXT(cell, format)<\/code>:<\/p>\n\n<pre><code>=CONCATENATE(TEXT(A1,\"YYYY-M-D\"),A2)\n<\/code><\/pre>\n\n<p>The <code>YYYY<\/code>, <code>M<\/code>, and <code>D<\/code> represent four digit year (2013), month (11), and day (4) respectively.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418449672787,"favorite_count":null,"last_activity_date":1418449672787,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3190758.0,"parent_id":27455933,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":349,"id":27459020,"title":null,"body":"<p>the reason why you get \"SQL logic error or missing database\\r\\nnear \\\"constraint\\\": syntax error\" is because you have set the wrong dialect.<\/p>\n\n<p>You are using the MsSql2012 dialect so NHibernate will create SQL statements thinking that database supports certain features, but because it is different database, it doesn't support them. <\/p>\n\n<p>There is no pragma, because MsSQL doesn't have pragma, so use SQLiteDialect instead:<\/p>\n\n<pre><code>cfg.DataBaseIntegration(x =&gt;\n{\n x.ConnectionString = \"data source=:memory:\";\n x.Driver&lt;SQLite20Driver&gt;();\n x.Dialect&lt;SQLiteDialect&gt;();\n x.ConnectionReleaseMode = ConnectionReleaseMode.OnClose;\n});\n<\/code><\/pre>\n\n<p><a href=\"http:\/\/www.nhforge.org\/doc\/nh\/en\/index.html#configuration-optional-dialects\" rel=\"nofollow\">Documentation<\/a>:<\/p>\n\n<blockquote>\n <p>You should always set the dialect property to the correct\n NHibernate.Dialect.Dialect subclass for your database. <\/p>\n \n <p>SQLite<br>\n NHibernate.Dialect.SQLiteDialect<br>\n Set driver_class to NHibernate.Driver.SQLite20Driver for System.Data.SQLite provider for .NET 2.0.<\/p>\n<\/blockquote>\n\n<p>SchemaExport SQL Commands for MsSQLDialect:<\/p>\n\n<pre><code>if exists (select 1 from sys.objects where object_id = OBJECT_ID(N'[FK20E4895FB0DFE40D]') AND parent_object_id = OBJECT_ID('Employee')) alter table Employee drop constraint FK20E4895FB0DFE40D\nif exists (select * from dbo.sysobjects where id = object_id(N'Employee') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table Employee\nif exists (select * from dbo.sysobjects where id = object_id(N'Department') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table Department\n\ncreate table Employee (\n Id INT not null,\n FirstName NVARCHAR(255) null,\n LastName NVARCHAR(255) null,\n Email NVARCHAR(255) null,\n DepartmentId INT null,\n primary key (Id)\n)\n\ncreate table Department (\n Id INT not null,\n Name NVARCHAR(255) null,\n primary key (Id)\n)\n\nalter table Employee\n add constraint FK20E4895FB0DFE40D\n foreign key (DepartmentId)\n references Department\n<\/code><\/pre>\n\n<p>It will fail here, because SQLite doesn't support alter table add constraint syntax (=here is the syntax error message).<\/p>\n\n<p>SchemaExport SQL Commands for SQLiteDialect:<\/p>\n\n<pre><code>PRAGMA foreign_keys = OFF\n\ndrop table if exists Employee\n\ndrop table if exists Department\n\nPRAGMA foreign_keys = ON\n\ncreate table Employee (\n Id INT not null,\n FirstName TEXT,\n LastName TEXT,\n Email TEXT,\n DepartmentId INT,\n primary key (Id),\n constraint FK20E4895FB0DFE40D foreign key (DepartmentId) references Department\n)\n\ncreate table Department (\n Id INT not null,\n Name TEXT,\n primary key (Id)\n)\n<\/code><\/pre>\n\n<p>The pragma is turned off while deleting and then reenabled again.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418475327247,"favorite_count":null,"last_activity_date":1418475327247,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2622707.0,"parent_id":27449059,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":350,"id":27467838,"title":null,"body":"<p>I found the problem with the code...<\/p>\n\n<p>I should be targeting the XenForo_Application method not XenForo_Autoloader...<\/p>\n\n<pre><code>require( $fileDir . '\/library\/XenForo\/Autoloader.php');\nXenForo_Autoloader::getInstance()-&gt;setupAutoloader($fileDir . '\/library'); \n\nXenForo_Application::initialize($fileDir . '\/library', $fileDir);\nXenForo_Application::set('page_start_time', $startTime);\nXenForo_Application::setDebugMode(true);\nXenForo_Application::disablePhpErrorHandler();\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418548014550,"favorite_count":null,"last_activity_date":1418548014550,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1608967.0,"parent_id":27466438,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":351,"id":27472092,"title":null,"body":"<p>It seems that you are using this code inside a JSP scriptlet. This is very bad style. Especially for code without any relation to the view representation.<\/p>\n\n<p>So the first thing you should do, is to create an ordinary Java class and put that code inside. Then you will remark that <code>Class.forName()<\/code> throws a checked exception (ClassNotFoundException) and some other parts like <code>DriverManager.getConnection()<\/code>, <code>connection.createStatement()<\/code> and <code>statement.executeUpdate()<\/code> throw <code>SQLException<\/code>. You shouldn't let the servlet container catch these exceptions.<\/p>\n\n<p>Then write a simple <code>main()<\/code> method to check if your code is working or even better a JUnit test.<\/p>\n\n<p>You declared a <code>PreparedStatement<\/code> variable but never used it. Instead later you used a simple <code>Statement<\/code>. The first one fits better here. So use something like that:<\/p>\n\n<pre><code>ps = connection.prepareStatement(\"INSERT INTO \"\n + \"report(reportid, coursename, tardies, absences, totalgrade, teachername, schoolname) \"\n + \"values(?, ?, ?, ?, ?, ?, ?)\");\n<\/code><\/pre>\n\n<p>Use the <code>?<\/code> as a placeholder for the actual values.<\/p>\n\n<p>Then later you set the values. Beware that the prepared statement index begins at 1. After the execution of all SQL inserts, you should commit the transaction. In case of an exception use <code>abort()<\/code>.<\/p>\n\n<pre><code>while(inputStream.hasNext()){\/\/reads from the file until there are no items left\n \/\/ ...\n ps.setString(1, reportidString);\n ps.setString(2, coursenameString);\n \/\/ ...\n ps.executeUpdate();\n}\nconnection.commit();\n<\/code><\/pre>\n\n<p>Afterwards you should clean up and free the ressources. The best place is in a <code>finally<\/code> of a <code>try<\/code> block:<\/p>\n\n<pre><code>} finally {\n try {\n ps.close();\n } catch(SQLException e) {\n e.printStackTrace();\n }\n try {\n connection.close();\n } catch(SQLException e) {\n e.printStackTrace();\n }\n}\n<\/code><\/pre>\n\n<p><strong>Some further considerations:<\/strong><\/p>\n\n<p>If you really want to use plain JSP, then make use of the <a href=\"http:\/\/www.oracle.com\/technetwork\/java\/frontcontroller-135648.html\" rel=\"nofollow\">Front Controller pattern<\/a>. So every request goes to the front controller servlet. There you decide what kind of action to execute and collect the data for the view. In the end forward to a JSP to create the view. Inside the JSP you should not use any scriptlets.<\/p>\n\n<p>Consider to use a MVC framework like <a href=\"http:\/\/struts.apache.org\/\" rel=\"nofollow\">Struts<\/a> or <a href=\"http:\/\/docs.spring.io\/spring\/docs\/current\/spring-framework-reference\/html\/mvc.html\" rel=\"nofollow\">Spring MVC<\/a>. But the current standard is <a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javaee\/javaserverfaces-139869.html\" rel=\"nofollow\">Java Server Faces<\/a> which is more component based.<\/p>\n\n<p>Use a <a href=\"http:\/\/docs.oracle.com\/javaee\/6\/tutorial\/doc\/bncjj.html\" rel=\"nofollow\">connection pool<\/a> for the database connection.<\/p>\n\n<p>Use <a href=\"http:\/\/www.vogella.com\/tutorials\/Logging\/article.html\" rel=\"nofollow\">logging<\/a> instead of <code>System.out.println()<\/code> or <code>e.printStackTrace()<\/code><\/p>\n\n<p>To efficiently insert larger files into the database use <a href=\"http:\/\/viralpatel.net\/blogs\/batch-insert-in-java-jdbc\/\" rel=\"nofollow\">batch inserts<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418578954740,"favorite_count":null,"last_activity_date":1418578954740,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":459557.0,"parent_id":27466361,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":352,"id":27474716,"title":null,"body":"<p><code>HttpPostedFileBase<\/code>'s <code>InputStream<\/code> does not always return all the bytes in a single call to <code>Read<\/code>. Most likely you are getting the file only partially.<\/p>\n\n<p>Use<\/p>\n\n<pre><code>var file = Request.Files[0];\n\nif (file != null)\n{\n MemoryStream memoryStream = file.InputStream as MemoryStream;\n if (memoryStream == null)\n {\n memoryStream = new MemoryStream();\n file.InputStream.CopyTo(memoryStream);\n }\n byte[] bytImg = memoryStream.ToArray();\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418594964380,"favorite_count":null,"last_activity_date":1418594964380,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4304188.0,"parent_id":27474519,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":353,"id":27480415,"title":null,"body":"<p>Both functions work for all containers that support indexed accesses, be they dict, list, tuple, string, bytes, and so on.<\/p>\n\n<p>I'm not sure why PyCXX has that comment; it may be due to the fact that Python's dynamic typing does not always mesh well with languages with static typing.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418633918900,"favorite_count":null,"last_activity_date":1418633918900,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":20862.0,"parent_id":27480284,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":354,"id":27529401,"title":null,"body":"<p>If I understand your problem correctly, to speed up the things, you can get all the bars, and put them in the memory, in a hash that maps each (bar.name) to an array of bars.<\/p>\n\n<p>for example:<\/p>\n\n<pre><code>bars_hash = Bar.all.group_by(&amp;:name)\n<\/code><\/pre>\n\n<p>Then,<\/p>\n\n<pre><code>bars_hash[name]\n<\/code><\/pre>\n\n<p>will return all the bars that match the name, or <code>nil<\/code> if none.\nWith this, you will avoid doing a sequential search for each <code>Foo<\/code>.<\/p>\n\n<p>But if you have I hope your memory won't fill up if you have too many <code>Bar<\/code>s<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418831139163,"favorite_count":null,"last_activity_date":1418831139163,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2306885.0,"parent_id":27528935,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":355,"id":27529999,"title":null,"body":"<p>The following set of command-line options to <code>mpiexec<\/code> should do the trick with versions of Open MPI before 1.7:<\/p>\n\n\n\n<pre class=\"lang-none prettyprint-override\"><code>--by-core --bind-to-core --report-bindings\n<\/code><\/pre>\n\n<p>The last option will pretty-print the actual binding for each rank. Binding also activates some NUMA-awareness in the shared-memory BTL module.<\/p>\n\n<p>Starting with Open MPI 1.7, processes are distributed round-robin over the available sockets and bound to a single core by default. To replicate the above command line, one should use:<\/p>\n\n<pre class=\"lang-none prettyprint-override\"><code>--map-by core --bind-to core --report-bindings\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418832975633,"favorite_count":null,"last_activity_date":1418832975633,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1374437.0,"parent_id":27527046,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":356,"id":27543914,"title":null,"body":"<p>It means that BGRA8888 is not supported by your opengl. Use RGBA8888 if it suitable for you.\nAnd you have typo:<\/p>\n\n<pre><code>RenderTexture* pRenderTexture; = RenderTexture::create\n_____________________________^\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418897054207,"favorite_count":null,"last_activity_date":1418897054207,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1569260.0,"parent_id":27543654,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":357,"id":27572938,"title":null,"body":"<p>The short answer is not directly, but you can make it work. <\/p>\n\n<p>MS Project does not support fixed costs based on resource. You can have fixed costs on tasks, but they won't be dependent on which resource is assigned (aka which contractor). That said, you can work around this limitation as follows:<\/p>\n\n<p><strong>For labor-driven tasks<\/strong>, create a resource called \"Contractor 1 maintenance\" with a rate of $150\/hour and assign this to your task with <strong><em>one hour of work<\/em><\/strong>. The key is to always make sure the work on the task is just one hour (1h). Likewise, create another resource called \"Contractor 2 maintenance\" with a rate of $160\/hour.<\/p>\n\n<p><strong>For material-driven tasks<\/strong>, create a resource called \"Contractor 1 sheathing\" with a rate equal to the sheet\/sqft cost and assign this to your task with the work (e.g. hours) as the number of sheets required.<\/p>\n\n<p>For both of these scenarios, make sure the task is set to \"Fixed Duration\" so that adding resource work does not affect the duration of the task.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419018467070,"favorite_count":null,"last_activity_date":1419018467070,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1056632.0,"parent_id":27566475,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":358,"id":27576106,"title":null,"body":"<p>This turned out be because I was using an old version of the Maven PMD plugin. The Maven plugin pulls in PMD by itself, which is convenient, but doesn't give you any control over what version it pulls in.<\/p>\n\n<p>The version I was using, 2.7.1, pulled in PMD version 4.3, which did not have the rule I was trying to include. Therefore, it (correctly) stated that it couldn't find that rule.<\/p>\n\n<p>The current version of the Maven PMD plugin, 3.3, pulls in PMD version 5.2.1, which does include the <code>NoUnsanitizedJSPExpression<\/code> JSP-checking rule. <\/p>\n\n<p>Once I updated the maven PMD plugin to version 3.3, everything worked:<\/p>\n\n<pre><code> &lt;plugin&gt;\n &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\n &lt;artifactId&gt;maven-pmd-plugin&lt;\/artifactId&gt;\n &lt;version&gt;3.3&lt;\/version&gt;\n &lt;configuration&gt;\n &lt;rulesets&gt;\n &lt;ruleset&gt;${project.basedir}\/src\/main\/resources\/properties\/pmd_workspace.xml&lt;\/ruleset&gt;\n &lt;\/rulesets&gt;\n &lt;\/configuration&gt;\n &lt;\/plugin&gt; \n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419038844160,"favorite_count":null,"last_activity_date":1419038844160,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3120173.0,"parent_id":27571148,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":359,"id":27581120,"title":null,"body":"<p>Are you targeting Windows Installer or InstallScript as your technology? The former sounds like a poor fit for randomly generated names if you care about traditional upgrades.<\/p>\n\n<p>Setting upgrades aside, for the needs you mentioned, I would consider using a <a href=\"http:\/\/helpnet.flexerasoftware.com\/installshield21helplib\/helplibrary\/IHelpDynamicFileLinking.htm\" rel=\"nofollow\">Dynamic File Link<\/a>, especially in an InstallScript project. Or you can consider writing an <a href=\"http:\/\/helpnet.flexerasoftware.com\/installshield21helplib\/helplibrary\/IHelpAutoISWiProject.htm\" rel=\"nofollow\">automation script<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419085529170,"favorite_count":null,"last_activity_date":1419085529170,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":89999.0,"parent_id":27577915,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":360,"id":27585914,"title":null,"body":"<p>When you type <code>pig<\/code> in console, by default it will go to <code>MAPREDUCE<\/code> mode, for that you need access to a <code>Hadoop cluster and HDFS installation<\/code>. Mapreduce mode is the default mode in pig.<br>\nIt looks like your hadoop cluster is not configured properly that is the reason you are getting the connection refunded error. Please follow up this link to solve this connect-refused problem.<a href=\"http:\/\/wiki.apache.org\/hadoop\/ConnectionRefused\" rel=\"nofollow\">http:\/\/wiki.apache.org\/hadoop\/ConnectionRefused<\/a>.<\/p>\n\n<p>As a workaround use <code>LOCAL<\/code> mode, this doesn't need hadoop installation.<br>\nIn the console type <code>pig -x local<\/code> this will bring the grunt shell and type <code>ls<\/code> command.<\/p>\n\n<p><strong>Local mode<\/strong><\/p>\n\n<pre><code>$ pig -x local\n<\/code><\/pre>\n\n<p><strong>Mapreduce mode<\/strong><\/p>\n\n<pre><code>$ pig \n(or) \/\/try to connect HDFS\n$ pig -x mapreduce \n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419124701813,"favorite_count":null,"last_activity_date":1419124701813,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3027162.0,"parent_id":27583287,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":361,"id":27587047,"title":null,"body":"<p>silly mistake I was doing , I have implemented Java function with no parameters but I am calling function with void parameter. <\/p>\n\n<pre><code>The code here\n(V)Ljava\/lang\/String;\" \n\nshould be ()Ljava\/lang\/String;\"\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419140635770,"favorite_count":null,"last_activity_date":1419140635770,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1169079.0,"parent_id":27581720,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":362,"id":27594088,"title":null,"body":"<pre><code>$html = '&lt;script&gt;\nvar images= new Array();\n lstImages.push(\"one\");\n lstImages.push(\"two\");\n lstImages.push(\"three\");\n&lt;\/script&gt;';\n\n$matches = array();\nif(preg_match_all('#lstImages.push\\(\"(.*)\"\\);#', $html, $matches))\n{\n var_dump($matches[1]);\n}\n<\/code><\/pre>\n\n<p>This will return this : <\/p>\n\n<pre><code>array (size=3)\n 0 =&gt; string 'one' (length=3)\n 1 =&gt; string 'two' (length=3)\n 2 =&gt; string 'three' (length=5)\n<\/code><\/pre>\n\n<p>So, there we are basicaly searching for the string <code>lstImages.push(\"something here\");<\/code><\/p>\n\n<p>Then you just have to exploit this like that : <code>$items = $matches[1];<\/code><\/p>\n\n<p>Then all your items are in <code>$items<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419197738427,"favorite_count":null,"last_activity_date":1419197738427,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3799829.0,"parent_id":27593872,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":363,"id":27671494,"title":null,"body":"<p>Turns out I was setting the attributed string's color to white somewhere else in the code.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419714624873,"favorite_count":null,"last_activity_date":1419714624873,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":352967.0,"parent_id":27437960,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":364,"id":27684143,"title":null,"body":"<p>You can do it with using jQuery library.\nThis can be done with few lines of code.<\/p>\n<p>Here below is a code.<\/p>\n<h2><a href=\"http:\/\/jsbin.com\/ladapupane\/1\/edit?js,output\" rel=\"nofollow noreferrer\">live demo link<\/a><\/h2>\n<pre><code>$('#rearrange_button').on('click', function(){\n var text = $(this).text();\n \/\/console.log(text); \n \n if (text == 'Re-Arrange') {\n $(this).text('Save');\n }\n else if(text == 'Save') {\n $(this).text('Re-Arrange');\n }\n \n \n});\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419833199823,"favorite_count":null,"last_activity_date":1419833199823,"last_edit_date":1592644375060,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":2219158.0,"parent_id":27684081,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":365,"id":27684497,"title":null,"body":"<p>If I understand you correctly you want to ensure that the sums of the full matrix is equal to 1. <\/p>\n\n<p>Then you can use an ArrayList (\"all\") to collect all the IntegerVariables into one list and then add a constraint to \"all\". Your example is not complete, e.g. the number of columns, so I assume that there are n columns and that it is a 0\/1 matrix. Here's an example:<\/p>\n\n<pre><code>\/\/ ...\nArrayList&lt;IntegerVariable&gt; all = new ArrayList&lt;IntegerVariable&gt;();\nint n = 5; \/\/ number of rows and columns\nIntegerVariable[][] rows = new IntegerVariable[n][n];\nfor(int i = 0; i &lt; n; i++) {\n for(int j = 0; j &lt; n; j++) {\n rows[i][j] = makeIntVar(\"rows[\"+i+\",\"+j+\"]\", 0, 1);\n all.add(rows[i][j]);\n }\n}\n\/\/ convert ArrayList all to an array\nmodel.addConstraint(eq(sum(all.toArray(new IntegerVariable[1])),1));\n\/\/ ...\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419835233337,"favorite_count":null,"last_activity_date":1419835233337,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":195636.0,"parent_id":27675942,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":366,"id":27685245,"title":null,"body":"<p>Try <code>enable<\/code> and <code>disable<\/code> methods on <code>window.dd<\/code> object:<\/p>\n\n<pre><code>w.dd.disable(); \/\/ disables d&amp;d\nw.dd.enable(); \/\/ enables d&amp;d\n<\/code><\/pre>\n\n<p>Sample: <a href=\"http:\/\/jsfiddle.net\/cb7rtcya\/1\/\" rel=\"nofollow\">http:\/\/jsfiddle.net\/cb7rtcya\/1\/<\/a> (It's written in Ext JS 5, but should work also on 4)<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419839268940,"favorite_count":null,"last_activity_date":1419839268940,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":360374.0,"parent_id":27684013,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":367,"id":27713089,"title":null,"body":"<p>you can use group by to get only 1 row per doctor and max to select latest date:<\/p>\n\n<pre><code>select `Doctor`, DATEDIFF(CURDATE(),max(`Date`))\nfrom `Report`\ngroup by `Doctor`\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419976294993,"favorite_count":null,"last_activity_date":1419976294993,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2864275.0,"parent_id":27713056,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":368,"id":27726458,"title":null,"body":"<p>SteeringAcceleration is just a class that holds the linear and angular acceleration that the seek behavior has calculated.<\/p>\n\n<pre><code>SteeringAcceleration&lt;Vector2&gt; steerAcc = new SteeringAcceleration&lt;Vector2&gt;();\ns.calculateSteering(steerAcc);\n<\/code><\/pre>\n\n<p>Then in your update method you apply the acceleration values that is in SteeringAcceleration to the box2d body.<\/p>\n\n<pre><code>body.applyLinearImpulse(steerAcc.linear.scl(deltaTime), pos, true);\nbody.applyAngularImpulse(steerAcc.angular * deltaTime, true);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420061298170,"favorite_count":null,"last_activity_date":1420061298170,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3068350.0,"parent_id":27715372,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":369,"id":27744816,"title":null,"body":"<p>Why don't you use the same function for both:<\/p>\n\n<pre><code>$(\"#sp, #fp\").on(\"click\",function(e){\n var pos = $(\"#movable-container\").position().top;\n $('#movable-container').animate({\n 'top': $(this).position().top\n }, 1000);\n});\n<\/code><\/pre>\n\n<p><strong><a href=\"http:\/\/www.bootply.com\/L9PDyLwBs5\" rel=\"nofollow\">BootplyDemo<\/a><\/strong><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420214282327,"favorite_count":null,"last_activity_date":1420214282327,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2887133.0,"parent_id":27744737,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":370,"id":27821429,"title":null,"body":"<p>what you can do is reading the xef file using the Kinect Studio, then going to Play (or Playback) tab and hit play, your program will start streaming. I think it's the only way to do that, doing like it's coming from the kinect.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420640209660,"favorite_count":null,"last_activity_date":1420640209660,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2144375.0,"parent_id":27280689,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":371,"id":27432912,"title":null,"body":"<p>Missed a <code>;<\/code> after <code>-o-transition<\/code> there <strong><a href=\"http:\/\/jsfiddle.net\/eter5cLv\/\" rel=\"nofollow\">FIDDLE<\/a><\/strong><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418334076627,"favorite_count":null,"last_activity_date":1418334076627,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2173853.0,"parent_id":27432836,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":372,"id":27455074,"title":null,"body":"<p>Emacs uses the directories listed in the <code>exec-path<\/code> variable to look for programs. You can add to it like so:<\/p>\n\n<pre><code>(add-to-list 'exec-path \"\/usr\/local\/bin\")\n<\/code><\/pre>\n\n<p>The following shell command should give you the correct value to use:<\/p>\n\n<pre><code>dirname `which mysql`\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418439372630,"favorite_count":null,"last_activity_date":1418439372630,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":324105.0,"parent_id":27454508,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":373,"id":27456236,"title":null,"body":"<p><code>CFLAGS<\/code> holds compiler flags, like <code>-g -O2<\/code>. You should not add linker flags to it. <code>CPPFLAGS<\/code> holds preprocessor flags like <code>-Isrc -DNDEBUG<\/code>. <code>LDFLAGS<\/code> holds linker flags, which would include things like <code>-L<\/code> (capital L) if you need it to find libraries, and <code>-rdynamic<\/code>. And the <code>LDLIBS<\/code> variable holds libraries, so you should do this:<\/p>\n\n<pre><code>CPPFLAGS = -Isrc -DNDEBUG\nCFLAGS = -g -O2 -Wall -Wextra\nLDFLAGS = -rdynamic\nLDLIBS = -lmylib\n<\/code><\/pre>\n\n<p>Now you can use the built-in rules for GNU make to build your program. You can see a list of the build-in rules by running <code>make -p -f\/dev\/null<\/code>.<\/p>\n\n<p>Of course the above are just the default variables make defines and uses with its default rules. You don't have to use them, but in general it's better to follow conventions rather than flaunt them.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418452484113,"favorite_count":null,"last_activity_date":1418452484113,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":939557.0,"parent_id":27456099,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":374,"id":27467466,"title":null,"body":"<p>I believe the advantage of a geofence as opposed to what you describe, is that geofences are objects that come with a lot of extra support in Google Play Services. Using geofences allows multiple different Activities or even Applications to get notifications\/callbacks from a single (or set of) geofence objects created elsewhere. These callbacks will happen automatically even if you are in another application because Google Play Services can monitor location in the background without you writing additional code in your Activity, and they can expire on their own. Doing this would be more difficult if you were to roll your own distance calculations as you would have to set it up your own Service framework.<\/p>\n\n<p>From <a href=\"https:\/\/stackoverflow.com\/questions\/16630926\/android-why-use-pending-intents-for-geofences\/16630963#16630963\">this answer<\/a> by CommonsWare:<\/p>\n\n<blockquote>\n <p>Geofences are designed to work even without your application running.<\/p>\n<\/blockquote>\n\n<p>However, if your goal is only to check whether you are a certain distance from a geographical point (without caring about what happens when the user goes to check their email or puts their phone back in their pocket), then what you describe might be easier.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418544122463,"favorite_count":null,"last_activity_date":1418544846920,"last_edit_date":1418544846920,"last_editor_display_name":null,"last_editor_user_id":4179277.0,"owner_display_name":null,"owner_user_id":4179277.0,"parent_id":27467392,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":375,"id":27474056,"title":null,"body":"<p>What's happening here?<\/p>\n\n<ol>\n<li><code>set.Remove(blog);<\/code> - this calls the previously configured lambda.<\/li>\n<li><code>data.Remove(entity);<\/code> - The item is removed from the list.<\/li>\n<li><code>dbset.SetupData(data, find);<\/code> - We call SetupData again, to reconfigure the Substitute with the new list.<\/li>\n<li><code>SetupData<\/code> runs...<\/li>\n<li>In there, <code>dbSetup.Remove<\/code> is being called, in order to reconfigure what happens when Remove is called next time.<\/li>\n<\/ol>\n\n<p>Okay, we have a problem here. <code>dtSetup.Remove(Arg.Do&lt;T....<\/code> doesn't <em>reconfigure<\/em> anything, it rather <em>adds<\/em> a behavior to the Substitute's internal list of things that should happen when you call Remove. So we're currently running the previously configured Remove action (1) and at the same time, down the stack, we're adding an action to the list (5). When the stack returns and the iterator looks for the next action to call, the underlying list of mocked actions has changed. Iterators don't like changes.<\/p>\n\n<p>This leads to the conclusion: We can't modify what a Substitute does while one of its mocked actions is running. If you think about it, nobody who reads your test would assume this to happen, so you shouldn't do this at all.<\/p>\n\n<p>How can we fix it?<\/p>\n\n<pre><code>public static DbSet&lt;TEntity&gt; SetupData&lt;TEntity&gt;(\n this DbSet&lt;TEntity&gt; dbset,\n ICollection&lt;TEntity&gt; data = null,\n Func&lt;object[], TEntity&gt; find = null) where TEntity : class\n{\n data = data ?? new List&lt;TEntity&gt;();\n find = find ?? (o =&gt; null);\n\n Func&lt;IQueryable&lt;TEntity&gt;&gt; getQuery = () =&gt; new InMemoryAsyncQueryable&lt;TEntity&gt;(data.AsQueryable());\n\n ((IQueryable&lt;TEntity&gt;) dbset).Provider.Returns(info =&gt; getQuery().Provider);\n ((IQueryable&lt;TEntity&gt;) dbset).Expression.Returns(info =&gt; getQuery().Expression);\n ((IQueryable&lt;TEntity&gt;) dbset).ElementType.Returns(info =&gt; getQuery().ElementType);\n ((IQueryable&lt;TEntity&gt;) dbset).GetEnumerator().Returns(info =&gt; getQuery().GetEnumerator());\n\n#if !NET40\n ((IDbAsyncEnumerable&lt;TEntity&gt;) dbset).GetAsyncEnumerator()\n .Returns(info =&gt; new InMemoryDbAsyncEnumerator&lt;TEntity&gt;(getQuery().GetEnumerator()));\n ((IQueryable&lt;TEntity&gt;) dbset).Provider.Returns(info =&gt; getQuery().Provider);\n#endif\n\n dbset.Remove(Arg.Do&lt;TEntity&gt;(entity =&gt; data.Remove(entity)));\n dbset.Add(Arg.Do&lt;TEntity&gt;(entity =&gt; data.Add(entity)));\n\n return dbset;\n}\n<\/code><\/pre>\n\n<ol>\n<li>The <code>getQuery<\/code> lambda creates a new query. It always uses the captured list <code>data<\/code>.<\/li>\n<li>All <code>.Returns<\/code> configuration calls use a lambda. In there, we create a new query instance and delegate our call there.<\/li>\n<li><code>Remove<\/code> and <code>Add<\/code> only modify our captured list. We don't have to reconfigure our Substitute, because every call reevaluates the query using the lambda expressions.<\/li>\n<\/ol>\n\n<p>While I really like NSubstitute, I would strongly recommend looking into <strong><a href=\"https:\/\/effort.codeplex.com\" rel=\"nofollow\">Effort, the Entity Framework Unit Testing Tool<\/a>.<\/strong><\/p>\n\n<p>You would use it like this:<\/p>\n\n<pre><code>\/\/ DbContext needs additional constructor:\npublic class MyDbContext : DbContext\n{\n public MyDbContext(DbConnection connection) \n : base(connection, true)\n {\n }\n}\n\n\/\/ Usage:\nDbConnection connection = Effort.DbConnectionFactory.CreateTransient(); \nMyDbContext context = new MyDbContext(connection);\n<\/code><\/pre>\n\n<p>And there you have an actual DbContext that you can use with everything that Entity Framework gives you, including migrations, using a fast in-memory-database.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418590947200,"favorite_count":null,"last_activity_date":1418590947200,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4317569.0,"parent_id":27308190,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":376,"id":27484713,"title":null,"body":"<p>OpenNI doesn't support Kinect (v1 or v2) directly. But you may install a driver for that. I have used successfully the Kinect v1 with OpenNI in windows and Linux... In windows it is easier, you only need to install the Kinect SDK 1.8 for v1... I haven't test it for v2 though, but I am almost sure it doesn't work... most probably you will need to wait for an open driver...<\/p>\n\n<p>In summary: <\/p>\n\n<blockquote>\n <p>Does Openni 2.2 support Kinect v2?<\/p>\n<\/blockquote>\n\n<p>No<\/p>\n\n<blockquote>\n <p>So what should I do to make it run?<\/p>\n<\/blockquote>\n\n<p>Wait for an open driver of kinect that works with openni<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418648522033,"favorite_count":null,"last_activity_date":1418648522033,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":888688.0,"parent_id":27465516,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":377,"id":27513750,"title":null,"body":"<p>The <code>OrderBy<\/code> operation introduces \"order preservation\" into all subsequent operations in a query. That means the order will be preserved even though it's parallel.<\/p>\n\n<p>However, <code>ForAll<\/code> will \"Execute nondeterministically in parallel\", so ordering the sequence first and then <em>only<\/em> using a <code>ForAll<\/code> that does not care does indeed not make much sense.<\/p>\n\n<p>Read more on Order Preservation in PLINQ <a href=\"http:\/\/msdn.microsoft.com\/en-US\/library\/vstudio\/dd460677(v=vs.110).aspx\" rel=\"nofollow\">here<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418763206500,"favorite_count":null,"last_activity_date":1418888586030,"last_edit_date":1418888586030,"last_editor_display_name":null,"last_editor_user_id":2060725.0,"owner_display_name":null,"owner_user_id":2060725.0,"parent_id":27513557,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":378,"id":27522277,"title":null,"body":"<p>If you are running a program which needs external jar files, from command prompt then only adding the files to your class path is not enough, you need to explicitly mention while compiling and executing the program that which jar files you want to include.<\/p>\n\n<p>For the same you can use the following<\/p>\n\n<p><strong>To compile<\/strong><\/p>\n\n<pre><code>javac -g -cp YOUR_JAR.jar YOUR_FILE_NAME.java\n<\/code><\/pre>\n\n<p><strong>To run<\/strong><\/p>\n\n<pre><code>java -cp YOUR_JAR.jar; YOUR_MAIN_CLASS\n<\/code><\/pre>\n\n<p>Here <code>-cp<\/code> flag is for <code>class path<\/code> and after this you need to write write the name of the jar file you need to include.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418808667560,"favorite_count":null,"last_activity_date":1418808667560,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1055241.0,"parent_id":27522225,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":379,"id":27535684,"title":null,"body":"<p>The debug output you see is telling you precisely what is going on, and why it's not working. In particular, the things you are comparing with the equality expression is not the values returned by the expressions, but rather the expressions themselves.<\/p>\n\n<p>One big clue is that both expressions require input, but even in the debug output you can see that that input is only being used in one side of the equality comparison, and there only as input parameter for the second expression.<\/p>\n\n<p>Compiling both expressions separately is IMHO not a bad solution, actually. You can even cache the compilation result:<\/p>\n\n<pre><code>Func&lt;TimeSlot, Guid&gt; d1 = left.Compile(), d2 = right.Compile();\nFunc&lt;TimeSlot, bool&gt; d2 = x =&gt; d1(x) == d2(x);\n<\/code><\/pre>\n\n<p>But if you really want to compose the operation as a single expression, then you can do it like this:<\/p>\n\n<pre><code>ParameterExpression param1 = Expression.Parameter(typeof(TimeSlot));\nExpression&lt;Func&lt;TimeSlot, bool&gt;&gt; expression = Expression.Lambda&lt;Func&lt;TimeSlot, bool&gt;&gt;(\n Expression.Equal(\n Expression.Invoke(left, param1),\n Expression.Invoke(right, param1)),\n param1);\n<\/code><\/pre>\n\n<p>Here's a complete code example that demonstrates the technique:<\/p>\n\n<pre><code>class Program\n{\n class A\n {\n public Guid Guid { get; private set; }\n\n public A()\n {\n Guid = Guid.NewGuid();\n }\n }\n\n static void Main(string[] args)\n {\n \/\/ Set up data values\n A a = new A();\n Guid guid = a.Guid;\n\n \/\/ Create expressions to be composed\n Expression&lt;Func&lt;A, Guid&gt;&gt; e1 = arg =&gt; arg.Guid, e2 = arg =&gt; guid;\n\n \/\/ Create lambda expression: invoke both expressions, compare the result\n ParameterExpression param1 = Expression.Parameter(typeof(A));\n Expression&lt;Func&lt;A, bool&gt;&gt; e3 = Expression.Lambda&lt;Func&lt;A, bool&gt;&gt;(\n Expression.Equal(\n Expression.Invoke(e1, param1),\n Expression.Invoke(e2, param1)),\n param1);\n\n \/\/ Compile to an actual delegate instance\n Func&lt;A, bool&gt; d1 = e3.Compile();\n\n \/\/ Check the result\n Console.WriteLine(d1(a));\n }\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418853767633,"favorite_count":null,"last_activity_date":1418853767633,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3538012.0,"parent_id":27530340,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":380,"id":27576295,"title":null,"body":"<p>You have your carry and your digit reversed (when there is a carry).<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419041217157,"favorite_count":null,"last_activity_date":1419041217157,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":535275.0,"parent_id":27576267,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":381,"id":27582769,"title":null,"body":"<p>There are a few ways to implement what you're trying to do, but the it looks like your\ncallback has wrong method signature...to get something \"basic\" running, the following should work\n(I added wait simply for testing):<\/p>\n\n<pre><code> EventWaitHandle resetEvent = new AutoResetEvent(false);\n client.ExecuteAsync(request, response =&gt;\n {\n callback(response.Content);\n\n resetEvent.Set();\n return;\n });\n\n resetEvent.WaitOne();\n\n }\n\n private static void callback(string content)\n {\n System.Console.WriteLine(content);\n }\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419097767110,"favorite_count":null,"last_activity_date":1419097767110,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4351860.0,"parent_id":27574947,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":382,"id":27585361,"title":null,"body":"<p>You can use <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Window.location\" rel=\"nofollow\"><code>window.location.pathname<\/code><\/a>.\nExample:<\/p>\n\n<pre><code>&lt;div class=\"AW-Form-627359006\"&gt;&lt;\/div&gt;\n&lt;script type=\"text\/javascript\"&gt;\n if(window.location.pathname.split('\/')[1] != 'directoryName') {\n (function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"http:\/\/forms.aweber.com\/form\/06\/627359006.js\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, \"script\", \"aweber-wjs-zf6rn7szi\"));\n }\n&lt;\/script&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419118461493,"favorite_count":null,"last_activity_date":1419122520393,"last_edit_date":1419122520393,"last_editor_display_name":null,"last_editor_user_id":4356683.0,"owner_display_name":null,"owner_user_id":4356683.0,"parent_id":27585314,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":383,"id":27594468,"title":null,"body":"<p>Make sure you're editing the correct file. NetBeans will create it's own copy of the configuration files, so you may have two or more tomcat-users.xml files. In my case on my windows machine, the Tomcat launched by NB uses\nC:\\Users\\DevServer\\AppData\\Roaming\\NetBeans\\8.0\\apache-tomcat-8.0.3.0_base\\conf<\/p>\n\n<p>Also, try simplifying and create a user with just the manager-script role. Then tell NB about that user and pw in the Services\/Servers\/Connection credentials. Example:<\/p>\n\n<p>&lt;user username=\"tomcat_m_script\" password=\"pwhere\" roles=\"manager-script\"\/&gt;<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419201162373,"favorite_count":null,"last_activity_date":1419201162373,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4221049.0,"parent_id":27591134,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":384,"id":27600832,"title":null,"body":"<p>Give a specific value for each animation you set to each <code>CAShapeLayer<\/code> as you loop through your layers array, like so:<\/p>\n\n<pre><code>[myAnim setValue:@\"layer_1\" forKey:@\"animation_id\"];\n[myAnim setValue:@\"layer_2\" forKey:@\"animation_id\"]; \n...\n<\/code><\/pre>\n\n<p>In your 'animationDidStop' method, check the value of the animation parameter for the value, like so:<\/p>\n\n<pre><code>-(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{\n if([[anim valueForKey:@\"animation_id\"] isEqual:@\"layer_1\"]) {\n \/\/ do something\n }\n else if([[anim valueForKey:@\"animation_id\"] isEqual:@\"layer_2\"]) {\n \/\/ do something\n }\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419244143863,"favorite_count":null,"last_activity_date":1419244444137,"last_edit_date":1419244444137,"last_editor_display_name":null,"last_editor_user_id":1014164.0,"owner_display_name":null,"owner_user_id":1014164.0,"parent_id":27600547,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":385,"id":27612038,"title":null,"body":"<p>You seam to returning a 2 dimensional array which will send 2 messages to the first output of the function node.<\/p>\n\n<p>Assuming you want to send just one message to only one output then the following should do what I think you want.<\/p>\n\n<pre><code>var payload = msg.payload;\nif(payload &amp;&amp; payload.length &gt; 10) {\n var data = payload.match(\/\\d+\/ig);\n var string = \"vcc:\"+data[1]+\",temp:\"+data[2]\/100+\",hum:\"+data[3]\/100;\n return {payload: string, nodegroup: data[0]};\n} else {\n return null;\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419291083203,"favorite_count":null,"last_activity_date":1419326533270,"last_edit_date":1419326533270,"last_editor_display_name":null,"last_editor_user_id":504554.0,"owner_display_name":null,"owner_user_id":504554.0,"parent_id":27611588,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":386,"id":27628715,"title":null,"body":"<p>COULD be made into a one liner. But multi-line is cleaner.<\/p>\n\n<pre><code>fruit.select do |hash| # or use select!\n filter.all? do |key, value|\n value == hash[key]\n end\nend\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419372436673,"favorite_count":null,"last_activity_date":1419380597857,"last_edit_date":1419380597857,"last_editor_display_name":null,"last_editor_user_id":2493089.0,"owner_display_name":null,"owner_user_id":2493089.0,"parent_id":27628686,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":387,"id":27662845,"title":null,"body":"<p>Well after the 26th try I found out that these lines gave me the problems:<\/p>\n\n<pre><code>dependencies {\n compile fileTree(dir: 'libs', include: '*.jar')\n compile fileTree(dir: \"$buildDir\/native-libs\", include: 'native-libs.jar')\n}\n<\/code><\/pre>\n\n<p>I had to remove these, and clean the project. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419634875827,"favorite_count":null,"last_activity_date":1419634875827,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4314870.0,"parent_id":27662743,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":388,"id":27663620,"title":null,"body":"<p>You can't declare two parameter lists for a view like that.<\/p>\n\n<pre><code>@(message: String)\n@(myForm: Form[User]) \/\/ &lt;-- this doesn't make sense\n<\/code><\/pre>\n\n<p>You need to either collapse them into one list:<\/p>\n\n<pre><code>@(message: String, myForm: Form[User])\n<\/code><\/pre>\n\n<p>Or group them like this:<\/p>\n\n<pre><code>@(message: String)(myForm: Form[User])\n<\/code><\/pre>\n\n<p>The templates compiler is only seeing the first list as the parameters, which is why it's getting confused when it sees <code>@(myForm: Form[User])<\/code> on the next line.<\/p>\n\n<p>If you're going to use this <code>Form<\/code> within the view (which you aren't quite right now, but I assume you will), you'll need to pass the <code>Form<\/code> object to the view in your <code>index<\/code> controller function:<\/p>\n\n<pre><code>def index = Action {\n Ok(views.html.login(\"ok\", loginForm))\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419643877760,"favorite_count":null,"last_activity_date":1419643877760,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2292812.0,"parent_id":27661910,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":389,"id":27673849,"title":null,"body":"<p>Try this <\/p>\n\n<p>In View<\/p>\n\n<pre><code> &lt;%= link_to \"Welcome Text\", welcome_clients_path(@client), method: :post, class: 'btn btn-info', \n data: { confirm: 'Are you sure you want to send a welcome text?' } %&gt;\n<\/code><\/pre>\n\n<p>In routes<\/p>\n\n<pre><code> resources :clients do\n collection do\n post :welcome\n end\n end\n<\/code><\/pre>\n\n<p>Hope it will work<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419743754613,"favorite_count":null,"last_activity_date":1419743754613,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2463570.0,"parent_id":27673597,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":390,"id":27714913,"title":null,"body":"<p>One can pass options to SSH on command line, like this:<\/p>\n\n<p><code>ssh -o UserKnownHostsFile=\/tmp\/known_host_file -p 21098 -i $OPENSHIFT_DATA_DIR\/.ssh\/host_key [email protected]<\/code><\/p>\n\n<p>Here is related answer: <a href=\"https:\/\/stackoverflow.com\/questions\/10765946\/ssh-use-known-hosts-other-than-home-ssh-known-hosts\">ssh use known_hosts other than $HOME\/.ssh\/known_hosts<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419988463290,"favorite_count":null,"last_activity_date":1419988463290,"last_edit_date":1495539996333,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1269551.0,"parent_id":27714857,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":391,"id":27718182,"title":null,"body":"<p>You can use CSS3 rotation<\/p>\n\n<pre><code>transform: rotate(90deg);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420013591580,"favorite_count":null,"last_activity_date":1420013591580,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3661707.0,"parent_id":27718150,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":392,"id":27727283,"title":null,"body":"<p>Read \"JavaScript the Good Parts\" by Douglas Crockford <a href=\"https:\/\/rads.stackoverflow.com\/amzn\/click\/com\/0596517742\" rel=\"nofollow noreferrer\" rel=\"nofollow noreferrer\">http:\/\/www.amazon.com\/JavaScript-Good-Parts-Douglas-Crockford\/dp\/0596517742\/ref=sr_1_1?ie=UTF8&amp;qid=1419857713&amp;sr=8-1&amp;keywords=javascript+the+good+parts<\/a><\/p>\n\n<p>This will give you what you need for JavaScript. I don't know \"the best\" source for jQuery, but start here: <a href=\"http:\/\/learn.jquery.com\/\" rel=\"nofollow noreferrer\">http:\/\/learn.jquery.com\/<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420069144510,"favorite_count":null,"last_activity_date":1420069144510,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3810940.0,"parent_id":27726902,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":393,"id":27727927,"title":null,"body":"<p>You need to install <a href=\"https:\/\/packages.debian.org\/search?keywords=libbz2-dev\" rel=\"nofollow\"><code>libbz2-dev<\/code> package<\/a> before install Python to build <a href=\"https:\/\/docs.python.org\/2\/library\/bz2.html\" rel=\"nofollow\"><code>bz2<\/code> module<\/a>.<\/p>\n\n<pre><code>apt-get install libbz2-dev\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420079878470,"favorite_count":null,"last_activity_date":1420079878470,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2225682.0,"parent_id":27727919,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":394,"id":27730351,"title":null,"body":"<p>Here's a regex, just because:<\/p>\n\n<pre><code>^(?=(?:.*?[aeiou]){3})(?!.*u.*[aeio])(?!.*o.*[aei])(?!.*i.*[ae])(?!.*e.*a).*[^aeiou]$\n<\/code><\/pre>\n\n<p><a href=\"https:\/\/regex101.com\/r\/qF8fV9\/1\" rel=\"nofollow\">regex101 demo.<\/a><\/p>\n\n<hr>\n\n<p>Explanation:<\/p>\n\n<pre><code>^ # start of string anchor\n(?= # make sure there are (at least) 3 vowels:\n (?:\n .*? # match any text,...\n [aeiou] #... and a vowel\n ){3} # 3 times\n)\n(?! # make sure there is NO occurence of\n .*u # a \"u\" character\n .*[aeio] # followed by an \"a\", \"e\", \"i\" or \"o\" character\n)\n(?!.*o.*[aei]) # similarly, make sure there's no \"a\", \"e\" or \"i\" after an \"o\"\n(?!.*i.*[ae]) #... no \"a\" or \"e\" after an \"i\"...\n(?!.*e.*a) #... and no \"a\" after an \"e\"\n.*[^aeiou]$ # finally, make sure the last character is not a vowel.\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420111705727,"favorite_count":null,"last_activity_date":1420114444157,"last_edit_date":1420114444157,"last_editor_display_name":null,"last_editor_user_id":1222951.0,"owner_display_name":null,"owner_user_id":1222951.0,"parent_id":27729742,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":395,"id":27741532,"title":null,"body":"<p>I did a workaround by replacing the div's id by a class and reference this class in the style sheet.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420198517910,"favorite_count":null,"last_activity_date":1420198517910,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":790535.0,"parent_id":27696948,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":396,"id":27749146,"title":null,"body":"<p><code>JPanel<\/code> uses <code>FlowLayout<\/code> by default. You need to set the layout to <code>BorderLayout<\/code> to use its constraints<\/p>\n\n<pre><code>JPanel panel = new JPanel(new BorderLayout());\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420236241810,"favorite_count":null,"last_activity_date":1420236241810,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":871026.0,"parent_id":27749116,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":397,"id":27403393,"title":null,"body":"<p>The error message can mean that the \"xmlns:*\" attribute for the namespace is missing in the XML or that the namespace prefix was not registered on the XPath object.<\/p>\n\n<h2>XML Document<\/h2>\n\n<p>Namespaces need to be defined on both sides. The first is the XML itself.<\/p>\n\n<pre><code>&lt;foo xmlns=\"urn:foo\"\/&gt;\n<\/code><\/pre>\n\n<p>or <\/p>\n\n<pre><code>&lt;f:foo xmlns:f=\"urn:foo\"\/&gt;\n<\/code><\/pre>\n\n<p>Are both resolved by the parser to the same namespace and local name. You can read the element name as <code>{urn:foo}:foo<\/code>.<\/p>\n\n<p>Here are several *NS methods on the DOM that allow you to work with a namespace. The namespace is always the URN. The prefix is not relevant for matching.<\/p>\n\n<pre><code>$node-&gt;getElementsByTagNameNS('urn:foo', 'foo')\n<\/code><\/pre>\n\n<p>The prefix is only provided if it is needed as a value. For example to create an element node that uses it.<\/p>\n\n<pre><code>$document-&gt;createElementNS('urn:foo', 'foo'); \/\/ no prefix \n$document-&gt;createElementNS('urn:foo', 'f:foo'); \/\/ with prefix \"f\"\n<\/code><\/pre>\n\n<h2>XPath<\/h2>\n\n<p>XPath uses the prefixes in the expressions, too. But it should not read them from the document. Use <code>DOMXpath::registerNamespace()<\/code> to register an own prefixes for a specific namespace.<\/p>\n\n<h2>Example<\/h2>\n\n<p>Your question is missing the full XML so I will add a small Atom example. You can see that the namespace is the same in the XML and in the PHP, but the prefix is different:<\/p>\n\n<pre><code>$xml = &lt;&lt;&lt;'XML'\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;atom:feed xmlns:atom=\"http:\/\/www.w3.org\/2005\/Atom\"&gt;\n &lt;atom:title&gt;Example Feed&lt;\/atom:title&gt;\n &lt;atom:entry&gt;\n &lt;atom:title&gt;Atom-Powered Robots Run Amok&lt;\/atom:title&gt;\n &lt;atom:id&gt;urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a&lt;\/atom:id&gt;\n &lt;\/atom:entry&gt;\n&lt;\/atom:feed&gt;\nXML;\n\n$dom = new DOMDocument();\n$dom-&gt;loadXml($xml);\n$xpath = new DOMXPath($dom);\n$xpath-&gt;registerNamespace('a', 'http:\/\/www.w3.org\/2005\/Atom');\n\nvar_dump($xpath-&gt;evaluate('string(\/\/a:entry\/a:title)'));\n<\/code><\/pre>\n\n<p>Output:<\/p>\n\n<pre><code>string(28) \"Atom-Powered Robots Run Amok\"\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418221377123,"favorite_count":null,"last_activity_date":1418221377123,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":497139.0,"parent_id":27402727,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":398,"id":27429595,"title":null,"body":"<p>If you support 32-bit and 64-bit machines you need two separate MSI setups:<\/p>\n\n<p><a href=\"http:\/\/blogs.msdn.com\/b\/heaths\/archive\/2008\/01\/15\/different-packages-are-required-for-different-processor-architectures.aspx\" rel=\"nofollow\">http:\/\/blogs.msdn.com\/b\/heaths\/archive\/2008\/01\/15\/different-packages-are-required-for-different-processor-architectures.aspx<\/a><\/p>\n\n<p>So your 32-bit install creates any COM entries for any 32-bit Clients and the 64-bit setup has 32-bit and 64-bit components that write to the registry. <\/p>\n\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa367451(v=vs.85).aspx\" rel=\"nofollow\">http:\/\/msdn.microsoft.com\/en-us\/library\/aa367451(v=vs.85).aspx<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418321410753,"favorite_count":null,"last_activity_date":1418321410753,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3261150.0,"parent_id":27428755,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":399,"id":27479783,"title":null,"body":"<p>try this:<\/p>\n\n<pre><code>use strict;\n use warnings;\n my $day = 11;\n for (my $i=1; $i&lt;=$day ; $i++) {\n if( $i &lt; 10 ) {\n $i = sprintf(\"%02d\",$i);\n }\n print \"Number of day: $i\\n\";\n }\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418631185340,"favorite_count":null,"last_activity_date":1418631185340,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3636601.0,"parent_id":27479747,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":400,"id":27494223,"title":null,"body":"<p>Try this XSLT:<\/p>\n\n<pre><code>&lt;xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http:\/\/www.w3.org\/1999\/XSL\/Transform\"&gt;\n &lt;xsl:output method=\"xml\" indent=\"yes\"\/&gt;\n\n &lt;xsl:template match=\"\/\"&gt;\n &lt;ul&gt;\n &lt;xsl:apply-templates select=\"\/\/Row[@Parent = '']\"\/&gt;\n &lt;\/ul&gt;\n &lt;\/xsl:template&gt;\n\n &lt;xsl:template match=\"Row\"&gt;\n &lt;li&gt;\n &lt;xsl:value-of select=\"@Title\"\/&gt;\n\n &lt;xsl:if test=\"..\/Row[@Parent = current()\/@Title]\"&gt;\n &lt;ul&gt;\n &lt;xsl:apply-templates select=\"..\/Row[@Parent = current()\/@Title]\"\/&gt;\n &lt;\/ul&gt;\n &lt;\/xsl:if&gt;\n &lt;\/li&gt;\n &lt;\/xsl:template&gt;\n&lt;\/xsl:stylesheet&gt;\n<\/code><\/pre>\n\n<p>Output:<\/p>\n\n<pre><code>&lt;ul&gt;\n &lt;li&gt;\n Animal&lt;ul&gt;\n &lt;li&gt;\n Mammal&lt;ul&gt;\n &lt;li&gt;Lion&lt;\/li&gt;\n &lt;li&gt;Elephant&lt;\/li&gt;\n &lt;\/ul&gt;\n &lt;\/li&gt;\n &lt;\/ul&gt;\n &lt;\/li&gt;\n &lt;li&gt;Plant&lt;\/li&gt;\n&lt;\/ul&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418681995317,"favorite_count":null,"last_activity_date":1418681995317,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":787016.0,"parent_id":27493665,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":401,"id":27564680,"title":null,"body":"<p>It sounds like users and agents are each subclasses of a superclass that I'll call \"persons\". You could have one more table for persons, with person_id as the PK. You could then replace user_id with person_id in the users table. Likewise, replace agent_id with person_id in the agents table. <\/p>\n\n<p>notice that in the two subclass tables, users and agents, person_id does double duty. It's the PK for its own table, and also an FK to the persons table. This enforces the one-to-one nature of the IS-A relationships between users and persons and between agents and persons.<\/p>\n\n<p>Now, all you have to do is set up a relationship between messages and persons, and hey presto! There is a relationship between the message and a user or an agent as the case may be.<\/p>\n\n<p>This is one instance of a design pattern called \"Class Table Inheritance\" and one called \"Shared Primary Key\". You can get more info on these by visiting the tags with the same name here in Stackoverflow, or by searching the web for Martin Fowler's treatment of the topic.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418986964603,"favorite_count":null,"last_activity_date":1418986964603,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":19937.0,"parent_id":27558970,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":402,"id":27580115,"title":null,"body":"<p><strong>1)<\/strong> Change the parentheses in the regular expression as shown and make the corresponding change to the replacement string as follows:<\/p>\n\n<pre><code>gsub(\"([^%])y\", \"\\\\1\", \"%x%xxxx_y_%y%y\")\n## [1] \"%x%xxxx__%y%y\"\n<\/code><\/pre>\n\n<p>Here is a visualization of the regular expression:<\/p>\n\n<pre><code>([^%])y\n<\/code><\/pre>\n\n<p><img src=\"https:\/\/www.debuggex.com\/i\/AQUDSLEHSzZdGgo4.png\" alt=\"Regular expression visualization\"><\/p>\n\n<p><a href=\"https:\/\/www.debuggex.com\/r\/AQUDSLEHSzZdGgo4\" rel=\"nofollow\">Debuggex Demo<\/a><\/p>\n\n<p><strong>2)<\/strong> It could be done with exactly your regular expression using gsubfn:<\/p>\n\n<pre><code>library(gsubfn)\ngsubfn(\"([^%]y)\", ~ substr(x, 1, 1), \"%x%xxxx_y_%y%y\")\n## [1] \"%x%xxxx__%y%y\"\n<\/code><\/pre>\n\n<p>Here is a visualizatino of the regular expression:<\/p>\n\n<pre><code>([^%]y)\n<\/code><\/pre>\n\n<p><img src=\"https:\/\/www.debuggex.com\/i\/QJeUIstYi0kisYGh.png\" alt=\"Regular expression visualization\"><\/p>\n\n<p><a href=\"https:\/\/www.debuggex.com\/r\/QJeUIstYi0kisYGh\" rel=\"nofollow\">Debuggex Demo<\/a><\/p>\n\n<p><strong>Update:<\/strong> Added visualizations.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419077547333,"favorite_count":null,"last_activity_date":1419080537873,"last_edit_date":1419080537873,"last_editor_display_name":null,"last_editor_user_id":516548.0,"owner_display_name":null,"owner_user_id":516548.0,"parent_id":27579979,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":403,"id":27646075,"title":null,"body":"<p>Try this:-<\/p>\n\n<pre><code> data: JSON.stringify({ 'lat': point.lat() })\n<\/code><\/pre>\n\n<p>Use <code>JSON.Stringfy<\/code> function while passing your json data.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419500837930,"favorite_count":null,"last_activity_date":1419500837930,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1529657.0,"parent_id":27646049,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":404,"id":27664322,"title":null,"body":"<p>the obvious answer is to use the same rotation code that rotates your point of view to rotate the radar coordinates, but I guess you rejected that for some reason.<\/p>\n\n<p>all that example code is wrong <code>x<\/code> is being overwritten and then used to find the new value for <code>y<\/code>. <em>That's never going to work.<\/em> <\/p>\n\n<p>The basic basic rotation formula looks like this:<\/p>\n\n<pre><code>x2 = (int)(x * Math.Cos(Math.PI * angle \/ 180) - y * Math.Sin(Math.PI * angle \/ 180));\ny2 = (int)(x * Math.Sin(Math.PI * angle \/ 180) + y * Math.Cos(Math.PI * angle \/ 180));\n<\/code><\/pre>\n\n<p>but if the payer moves away from 0,0 you'll want<\/p>\n\n<pre><code>x2 = (int)((x - player_x) * Math.Cos(Math.PI * angle \/ 180) - (y - player_y) * Math.Sin(Math.PI * angle \/ 180));\ny2 = (int)((x - player_x) * Math.Sin(Math.PI * angle \/ 180) + (y - player_y) * Math.Cos(Math.PI * angle \/ 180));\n<\/code><\/pre>\n\n<p>that will keep 0,0 on the radar centred on the player<\/p>\n\n<p>dpending on how your game measures angles you might need to swap the sign on the Sin terms .<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419654476100,"favorite_count":null,"last_activity_date":1419654476100,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":471930.0,"parent_id":27664171,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":405,"id":27674873,"title":null,"body":"<p>Progressive download requires that <code>moov<\/code> box goes before <code>mdat<\/code> box in the MPEG-4 file, which typically requires additional effort when the file is generated, and which is not the default behavior with Media Foundation. <\/p>\n\n<p>Media Foundation introduced <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/hh870256%28v=vs.85%29.aspx\" rel=\"nofollow noreferrer\"><code>MF_MPEG4SINK_MOOV_BEFORE_MDAT<\/code> attribute<\/a> to handle this:<\/p>\n\n<blockquote>\n <p>The default behavior of the mpeg4 media sink is to write 'moov' after\n 'mdat' box. Setting this attribute causes the generated file to write\n 'moov' before 'mdat' box.<\/p>\n \n <p>In order for the mpeg4 sink to use this attribute, the byte stream\n passed in must not be slow seek or remote for .<\/p>\n \n <p>This feature involves an additional file copying\/remuxing.<\/p>\n<\/blockquote>\n\n<p>Note minimal requirements. Or, you need to post-process the file to move the <code>moov<\/code> box to the beginning.<\/p>\n\n<p>See also:<\/p>\n\n<ul>\n<li><a href=\"https:\/\/stackoverflow.com\/questions\/24085362\/how-to-generate-moov-before-mdat-mp4-video-files-with-media-foundation\">How to generate &quot;moov before mdat&quot; MP4 video files with Media Foundation<\/a><\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419755836677,"favorite_count":null,"last_activity_date":1419755836677,"last_edit_date":1495542661727,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":868014.0,"parent_id":27668755,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":406,"id":27691406,"title":null,"body":"<p>Alright, so after some more exploration, and having read <a href=\"https:\/\/stackoverflow.com\/users\/463052\/david-bullock\">David Bullock's<\/a> answer on <a href=\"https:\/\/stackoverflow.com\/questions\/12796368\/getting-error-in-retrieving-data-from-google-spreadsheet-api-using-structure-que\">this SO thread<\/a>, I headed over to <a href=\"https:\/\/developers.google.com\/gdata\/docs\/2.0\/reference\" rel=\"nofollow noreferrer\">Google's old Protocol Reference documentation<\/a>--for API vesion 2.0. I took a read through <a href=\"https:\/\/developers.google.com\/gdata\/docs\/2.0\/reference#Queries\" rel=\"nofollow noreferrer\">the Queries section<\/a> and am happy to report that the <code>start-index<\/code> and <code>max-results<\/code> parameters still work for the list-based feed URLs even for the newest API version.<\/p>\n\n<p>So, assuming you have an href to a specific worksheet that has 100 rows, for example, you can use something like this to retrieve row 50 through 67:<\/p>\n\n<p><code>https:\/\/spreadsheets.google.com\/feeds\/list\/{key}\/od6\/private\/full?start-index=50&amp;max-results=17<\/code><\/p>\n\n<p>And while that is satisfactory for now, it <em>would<\/em> be good to know from Google if those params will ever be deprecated. I assume they will be deprecated since there is no reference to them from the current API documentation. Would be great to hear directly from Google, but for now I'll just use these classic params.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419866098890,"favorite_count":null,"last_activity_date":1419866098890,"last_edit_date":1495535434273,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1081763.0,"parent_id":27678331,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":407,"id":27720766,"title":null,"body":"<p>Make sure you don't mix WildFly with JBoss AS, and don't start the sample twice (from Eclipse and from Maven).<\/p>\n\n<p>The WildFly quickstarts are <a href=\"https:\/\/github.com\/wildfly\/quickstart\" rel=\"nofollow\">here<\/a>, don't use an older version targeting JBoss AS.<\/p>\n\n<p>The <code>kitchensink<\/code> sample can be deployed via <code>mvn wildfly:deploy<\/code>, not <code>mvn jboss-as:deploy<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420026731780,"favorite_count":null,"last_activity_date":1420026731780,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":338614.0,"parent_id":27717365,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":408,"id":27438642,"title":null,"body":"<p>after building opencv via cmake, you should build the INSTALL project (this is not done automatically). <\/p>\n\n<p>this will copy everything nessecary to build\/install\/include<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418368374577,"favorite_count":null,"last_activity_date":1418369094657,"last_edit_date":1418369094657,"last_editor_display_name":null,"last_editor_user_id":2056772.0,"owner_display_name":null,"owner_user_id":2056772.0,"parent_id":27435949,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":409,"id":27502820,"title":null,"body":"<p>models.py :<\/p>\n\n<pre><code>from django.contrib.gis import models\n\nclass Example(models.Model):\n point = models.PointField()\n objects = models.GeoManager()\n<\/code><\/pre>\n\n<p>You build a multipolygon out of all those regions, and ask what example is inside that multipolygon<\/p>\n\n<pre><code>from django.contrib.gis.geos import MultiPolygon\n\nlist_poly = [reg.poly for reg in Region.objects.filter(criteria=criteria)]\nmultipolygon = MultiPolygon(list_poly)\nlist_examples = Example.objects.filter(point__within=multipolygon)\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418726817147,"favorite_count":null,"last_activity_date":1418726817147,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3264895.0,"parent_id":27391689,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":410,"id":27562068,"title":null,"body":"<p>This was introduced in 9.1<\/p>\n\n<p>Quote from <a href=\"http:\/\/www.postgresql.org\/docs\/current\/static\/release-9-1.html\" rel=\"nofollow\">the release notes<\/a>:<\/p>\n\n<blockquote>\n <p>Allow non-GROUP BY columns in the query target list when the primary key is specified in the GROUP BY clause (Peter Eisentraut)<br>\n The SQL standard allows this behavior, and because of the primary key, the result is unambiguous.<\/p>\n<\/blockquote>\n\n<p>It is also explained with examples <a href=\"http:\/\/www.postgresql.org\/docs\/current\/static\/queries-table-expressions.html#QUERIES-GROUP\" rel=\"nofollow\">in the chapter about <code>group by<\/code>:<\/a><\/p>\n\n<blockquote>\n <p>In this example, the columns product_id, p.name, and p.price must be in the GROUP BY clause since they are referenced in the query select list (but see below). The column s.units does not have to be in the GROUP BY list since it is only used in an aggregate expression (sum(...)), which represents the sales of a product. For each product, the query returns a summary row about all sales of the product.<\/p>\n<\/blockquote>\n\n<p>In a nutshell: if the <code>group by<\/code> clause contains a column that uniquely identifies the rows, it is sufficient to include that column only. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418976973400,"favorite_count":null,"last_activity_date":1418976973400,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":330315.0,"parent_id":27561914,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":411,"id":27574969,"title":null,"body":"<p>User id is way to bind certain user to the tracking data without being able to identify the user. So you basically count some kind of hash from user's username etc to pass for <em>window.analytics.setUserId<\/em> <strong>in case you wish to use that feature<\/strong>. You can read more about user id <a href=\"https:\/\/developers.google.com\/analytics\/devguides\/collection\/analyticsjs\/user-id?hl=fi\" rel=\"nofollow\">here<\/a>. <\/p>\n\n<p>However it is not necessary at all and just to get the analytics up and running, you need to simply call <em>analytics.startTrackerWithId<\/em> with your <em>UA-<\/em> starting id (your Google Analytics Mobile App property). After that when you navigate through your application, you can use <em>analytics.trackView<\/em> to inform Google Analytics about it for it to collect that information. <\/p>\n\n<p>So short answers to your key questions as a summary:<\/p>\n\n<p><strong>No<\/strong>, you don't need to add <em>window.analytics.setUserId<\/em>. If you decide that you need the analytics about how user moves on multiple times he\/she opens the app, you can count some hash from username (or etc) to use as parameter for that.<\/p>\n\n<p><strong>Yes<\/strong>, call <em>window.analytics.startTrackerWithId('UA-XXXX-YY')<\/em> every time your app starts (on <em>deviceready<\/em> event), and after that <em>window.analytics.trackView('Screen Title')<\/em> for each screen.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419029281707,"favorite_count":null,"last_activity_date":1419029281707,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1744702.0,"parent_id":27473787,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":412,"id":27593897,"title":null,"body":"<p>An object with a name is an lvalue. The declaration as <code>QImage&amp;&amp;<\/code> indicates that only an rvalue can be bound to this reference but the reference itself is always an lvalue: it has a name. If you want to forward the rvalueness of an entity, you have to do so explicitly using <code>std::move()<\/code>. In case the rvalueness is deduced (i.e., you use a deduced template argument of the form <code>T&amp;&amp;<\/code> where <code>T<\/code> a template parameter) you'll forward the rvalueness conditionally using <code>std::forward&lt;T&gt;(arg)<\/code>.<\/p>\n\n<p>The addresses of <code>image<\/code> and <code>_image<\/code> are, of course, different as they are different objects in the first place. If <code>QImage<\/code> contains an object with an address you could verify whether the object was moved using that address. For example if you used <code>std::vector&lt;T&gt;<\/code> instead of <code>QImage<\/code> you could use something like this to determine if the array was moved:<\/p>\n\n<pre><code>void f(std::vector&lt;T&gt;&amp;&amp; v) {\n std::cout &lt;&lt; (v.empty()? 0: v.data()) &lt;&lt; '\\n';\n std::vector&lt;T&gt; other;\n other = v; \/\/ will be copied\n std::cout &lt;&lt; (other.empty()? 0: v.data()) &lt;&lt; '\\n';\n other = std::move(v); \/\/ will be moved\n std::cout &lt;&lt; (other.empty()? 0: v.data()) &lt;&lt; '\\n';\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419196400630,"favorite_count":null,"last_activity_date":1419196711247,"last_edit_date":1419196711247,"last_editor_display_name":null,"last_editor_user_id":1120273.0,"owner_display_name":null,"owner_user_id":1120273.0,"parent_id":27593839,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":413,"id":27632587,"title":null,"body":"<p>It is exactly as the error states, <\/p>\n\n<p>so try<\/p>\n\n<pre><code>oliveModule.service('MongoRESTService2',['$scope','MongoRESTService',function($scope, MongoRESTService) {\n this.queryMongoData = function (){\n MongoRESTService.get('\/clients').then(function(data){\n $scope.clients = ...;\n });\n };\n}]);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419402798227,"favorite_count":null,"last_activity_date":1419402798227,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4197344.0,"parent_id":27632405,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":414,"id":27633114,"title":null,"body":"<p>Basically blaze meter is used for huge volume of load generation using cloud because such amount of load cannot be generated using single machine.<\/p>\n\n<p>If you don't want to use Blaze meter (paid) then you can try distributed load testing using JMeter.\nRefer this <a href=\"http:\/\/jmeter.apache.org\/usermanual\/jmeter_distributed_testing_step_by_step.pdf\" rel=\"nofollow\">Distributed Load Testing JMeter<\/a><\/p>\n\n<p>General idea in distributed load testing is you can create a cluster of some machine with a server(1-N) monitoring on client machines(N). Clients will generate load on target server (which can be anywhere i.e. cloud or private hw). Each client will run JMeter instance i.e. one instance or many instances.<\/p>\n\n<p>Before you go for distributed Jmeter setup, find out how much load you want to hit on target server. If it is not too high then single machine with powerful hw can do the task for you.<\/p>\n\n<p>Before running JMeter follow below guideline to utilize maximum resources and generate max load on a single machine.<\/p>\n\n<ol>\n<li>Avoid Reporters - OOM issue<\/li>\n<li>Avoid Assertions <\/li>\n<li>Avoid Listeners - OOM issue<\/li>\n<li>Run in non-gui mode <\/li>\n<li>Avoid Graph results(redirect results to file and analyze later)<\/li>\n<li>Use latest version of JMeter<\/li>\n<\/ol>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419405791707,"favorite_count":null,"last_activity_date":1419405791707,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3121703.0,"parent_id":27632785,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":415,"id":27475004,"title":null,"body":"<p>You've got a problem here:<\/p>\n\n<pre><code>cudaStatus = cudaMemcpy(particlePosBuffer, particleRenderData, particleContainer.size() * sizeof(GLfloat)* 4, cudaMemcpyDeviceToHost);\n<\/code><\/pre>\n\n<p>This is intended to be a transfer from the device to the host. Just like <code>memcpy<\/code>, the first parameter of <code>cudaMemcpy<\/code> is <em>always<\/em> the destination pointer. So you have your first 2 parameters reversed. It should be something like:<\/p>\n\n<pre><code>cudaStatus = cudaMemcpy(particleRenderData, particlePosBuffer, particleContainer.size() * sizeof(GLfloat)* 4, cudaMemcpyDeviceToHost);\n<\/code><\/pre>\n\n<p><code>particlePosBuffer<\/code> is a device pointer, and it is the <em>source<\/em> of this operation.<\/p>\n\n<p><code>particleRenderData<\/code> is a host pointer, and it is the <em>destination<\/em> of this operation.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418596996060,"favorite_count":null,"last_activity_date":1418596996060,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1695960.0,"parent_id":27474846,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":416,"id":27585330,"title":null,"body":"<blockquote>\n<pre><code>cc -o ex4 $(src)\n<\/code><\/pre>\n<\/blockquote>\n\n<p>You never actually use the variable <code>CFLAGS<\/code> that contains <code>-g<\/code>. Try:<\/p>\n\n<pre><code>cc $(CFLAGS) -o ex4 $(src)\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419118145003,"favorite_count":null,"last_activity_date":1419118145003,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":714501.0,"parent_id":27585305,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":417,"id":27598542,"title":null,"body":"<p>Going through your code, here's what I did to make it work. I've made comments inside to explain some of the changes:<\/p>\n\n<pre><code>&lt;cfif structKeyExists(form, \"Submit\")&gt;\n &lt;cfif isDefined(\"Form.b1b3formAttach\") &gt; \n &lt;cffile action = \"upload\" \n fileField = \"b1b3formAttach\" \n destination = \"#GetTempDirectory()#\"\n nameConflict = \"overwrite\"&gt; \n &lt;!---Used to show success of upload---&gt;\n &lt;cfdump var=\"#cffile#\"&gt;\n &lt;cfif isDefined(\"CFFILE.serverFile\")&gt;\n &lt;cfset session.slot = cffile.serverFile&gt;\n &lt;cfelse&gt;\n &lt;cfset form.storage = \"\"&gt;\n &lt;\/cfif&gt;\n &lt;\/cfif&gt;\n&lt;!---Missing closing CFIF tag---&gt;\n&lt;\/cfif&gt;\n\n&lt;body&gt;\n&lt;cfoutput&gt;\n&lt;!---Form fields not wrapped in FORM tags; form posts to itself (cgi.script_name) include \"enctype\" to attach files---&gt;\n&lt;form action=\"#cgi.script_name#\" method=\"post\" enctype=\"multipart\/form-data\"&gt;\n &lt;label class=\"control-label\" for=\"b1b3formAttach\"&gt;Attach the completed B1\/B3 Form*&lt;\/label&gt;&lt;\/br&gt;\n &lt;div class=\"controls\"&gt;\n &lt;input id=\"b1b3formAttach\" name=\"b1b3formAttach\" class=\"input-file\" type=\"file\"&gt;\n &lt;\/div&gt;\n &lt;div class=\"controls\"&gt;\n &lt;!---Changed SUBMIT BUTTON from BUTTON type to INPUT type ---&gt;\n &lt;input value=\"Submit\" type=\"submit\" id=\"Submit\" name=\"Submit\" class=\"btn btn-default\"&gt;\n &lt;\/div&gt;\n&lt;\/form&gt;\n&lt;\/cfoutput&gt;\n&lt;\/body&gt;\n<\/code><\/pre>\n\n<p>Hopefully this can help you get on the way.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419234325853,"favorite_count":null,"last_activity_date":1419275991503,"last_edit_date":1419275991503,"last_editor_display_name":null,"last_editor_user_id":104223.0,"owner_display_name":null,"owner_user_id":1601939.0,"parent_id":27597968,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":418,"id":27603304,"title":null,"body":"<p>You are missing the equals sign when setting the class on the div in your html. <code>class\"header\"<\/code> should be <code>class=\"header\"<\/code><\/p>\n\n<h2><a href=\"http:\/\/jsfiddle.net\/eLvnkf8a\/\" rel=\"noreferrer\">Demo Fiddle<\/a><\/h2>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419253458177,"favorite_count":null,"last_activity_date":1419253458177,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":404335.0,"parent_id":27603292,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":419,"id":27675387,"title":null,"body":"<p>I think you encountered an instance of <a href=\"https:\/\/bugzilla.redhat.com\/show_bug.cgi?id=1122003\" rel=\"noreferrer\">bug 1122003<\/a>. It seems to have been solved in gcc-arm-linux-gnu-4.9.1-1.1.fc22.x86_64, or you should be able to work around it with the <code>--with-ld<\/code> flag in the meanwhile.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419761035387,"favorite_count":null,"last_activity_date":1419761035387,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2422776.0,"parent_id":27675326,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":420,"id":27678266,"title":null,"body":"<p>Solved it. \nRemoved the framework \"aspnetcore50\" from the project.json<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419783726657,"favorite_count":null,"last_activity_date":1419783726657,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":565977.0,"parent_id":27678071,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":421,"id":27683657,"title":null,"body":"<p>CombineFns are restricted to a single output value because that allows the system to do additional parallelization: combining different subsets of the values separately, and then combining their intermediate results in an arbitrary tree reduction pattern, until a single result value is produced for each key.<\/p>\n\n<p>If your values per key don't fit in memory (so you can't use the GroupByKey-ParDo pattern that Jeremy suggests) but the computed statistics do fit in memory, you could also do something like this: \n(1) Use Combine.perKey() to calculate the stats per day\n(2) Use View.asIterable() to convert those into PCollectionViews.\n(3) Reprocess the original input with a ParDo that takes the statistics as side inputs\n(4) In that ParDo's DoFn, have startBundle() take the side inputs and build up an in-memory data structure mapping days to statistics that can be used to do lookups in processElement.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419829443520,"favorite_count":null,"last_activity_date":1419829443520,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4352961.0,"parent_id":27675423,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":422,"id":27715976,"title":null,"body":"<p>Here's a way to do it, hope this helps...<\/p>\n<pre><code>SystemUtil.Run &quot;Iexplore.exe&quot;,&quot;http:\/\/www.computerhope.com\/jargon\/d\/dropdm.htm&quot;\nstrPath=&quot;C:\\dropdown_screenshot.bmp&quot;\n\nSetting.WebPackage(&quot;ReplayType&quot;)=2\nBrowser(&quot;Browser&quot;).Page(&quot;What is dropdown menu?&quot;).WebList(&quot;s&quot;).Click\nBrowser(&quot;Browser&quot;).Page(&quot;What is dropdown menu?&quot;).CaptureBitmap(strPath)\nBrowser(&quot;Browser&quot;).Page(&quot;What is dropdown menu?&quot;).WebList(&quot;s&quot;).Select &quot;Choice 2&quot;\nSetting.WebPackage(&quot;ReplayType&quot;)=1\n<\/code><\/pre>\n<p>Dropdown list screenshot was captured successfully.<\/p>\n<p><img src=\"https:\/\/i.stack.imgur.com\/7uGNi.png\" alt=\"enter image description here\" \/><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419998676033,"favorite_count":null,"last_activity_date":1419998676033,"last_edit_date":1592644375060,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":975114.0,"parent_id":27708663,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":423,"id":27417710,"title":null,"body":"<p>You have a build.gradle file inside your app folder. In that file you can configure your project, \"dependencies\" and other options. It's very similar to maven. You have another build.gradle file in your root folder from your project. This conf file is more general and call the other build.gradle file.<\/p>\n\n<p>e.g I have in one of my projects <\/p>\n\n<pre><code>apply plugin: 'com.android.application'\n\nandroid {\n compileSdkVersion 20\n buildToolsVersion \"20.0.0\"\n\n defaultConfig {\n applicationId \"com.acostela.example\"\n minSdkVersion 17\n targetSdkVersion 20\n versionCode 1\n versionName \"1.0\"\n }\n buildTypes {\n release {\n runProguard false\n proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n }\n }\n}\n\ndependencies {\n compile fileTree(include: ['*.jar'], dir: 'libs')\n compile 'com.android.support:appcompat-v7:20.+'\n compile \"com.android.support:gridlayout-v7:18.0.+\"\n compile 'com.j256.ormlite:ormlite-core:4.48'\n compile 'com.j256.ormlite:ormlite-android:4.48'\n compile 'commons-net:commons-net:3.3'\n compile 'net.sf.opencsv:opencsv:2.3'\n}\n<\/code><\/pre>\n\n<p>Dependencies here are similar to maven and the use in that tool of \"\/\".<\/p>\n\n<p>Gradle take libs from repositories in the same way of maven. In fact you can use the maven repository. You have a tab with the gradle sentence to download libraries.<\/p>\n\n<p><a href=\"http:\/\/mvnrepository.com\/artifact\/com.squareup.assertj\/assertj-android\/1.0.0\" rel=\"nofollow\">http:\/\/mvnrepository.com\/artifact\/com.squareup.assertj\/assertj-android\/1.0.0<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418283938507,"favorite_count":null,"last_activity_date":1418285090543,"last_edit_date":1418285090543,"last_editor_display_name":null,"last_editor_user_id":3676005.0,"owner_display_name":null,"owner_user_id":3676005.0,"parent_id":27417617,"post_type_id":2,"score":6,"tags":null,"view_count":null},{"index":424,"id":27701065,"title":null,"body":"<p>As per man page:<\/p>\n\n<pre><code>-mtime n\n File\u2019s data was last modified n*24 hours ago. See the comments\n for -atime to understand how rounding affects the interpretation\n of file modification times.\n<\/code><\/pre>\n\n<p>The argument to <code>-mtime<\/code> is interpreted as the number of whole days in the age of the file. <code>-mtime +n<\/code> means strictly greater than, <code>-mtime -n<\/code> means strictly less than.<\/p>\n\n<p>So in your case, <\/p>\n\n<p><code>-4<\/code> meaning less than 4 days.<br>\n<code>+4<\/code> meaning more than 4 days i.e. 4*24 hours.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419923211680,"favorite_count":null,"last_activity_date":1505381146517,"last_edit_date":1505381146517,"last_editor_display_name":null,"last_editor_user_id":711006.0,"owner_display_name":null,"owner_user_id":315228.0,"parent_id":27700943,"post_type_id":2,"score":6,"tags":null,"view_count":null},{"index":425,"id":27734425,"title":null,"body":"<p>The error is in the usage of <a href=\"http:\/\/docs.unity3d.com\/ScriptReference\/Quaternion.LookRotation.html\" rel=\"noreferrer\">Quaternion.LookRotation<\/a>.<\/p>\n\n<p>The function takes two <code>Vector3<\/code> as input which are a forward direction in world space (and an optional up vector - default <code>Vector3.up<\/code>), and returns a <code>Quaternion<\/code> representing the orientation of such a reference frame.<\/p>\n\n<p>You are instead supply a world space position as input (<code>targetPosition<\/code>), which makes no sense. Accidentally a normalized position vector expressed in world space is the direction from origin to the given point, so it works correctly when the tower is placed on the origin.<\/p>\n\n<p>What you need to use as LookRotation parameter is the world space direction from the tower to the target:<\/p>\n\n<pre><code>Vector3 aimDir = (targetPosition - transform.position).normalized;\ndesiredRotation = Quaternion.LookRotation (aimDir );\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420144492087,"favorite_count":null,"last_activity_date":1420144492087,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":587884.0,"parent_id":27733177,"post_type_id":2,"score":6,"tags":null,"view_count":null},{"index":426,"id":27463507,"title":null,"body":"<p>It turns out the issue was the method did not exist in the gem.<\/p>\n\n<p>I re-installed the gem without success. Then I referenced the github master branch manually, re-installed and it worked.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1418503839357,"favorite_count":null,"last_activity_date":1418503839357,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2526618.0,"parent_id":27455338,"post_type_id":2,"score":7,"tags":null,"view_count":null},{"index":427,"id":27717967,"title":null,"body":"<p>Use the TIMERANGE option:<\/p>\n\n<pre><code>scan 't1', {COLUMNS =&gt; 'c1', TIMERANGE =&gt; [1303668804, 1303668904]}\n<\/code><\/pre>\n\n<p>Take a look at the scan command help for more options:<\/p>\n\n<pre><code>hbase(main):001:0&gt; scan\n\nHere is some help for this command:\nScan a table; pass table name and optionally a dictionary of scanner\nspecifications. Scanner specifications may include one or more of:\nTIMERANGE, FILTER, LIMIT, STARTROW, STOPROW, TIMESTAMP, MAXLENGTH,\nor COLUMNS, CACHE\n\nSome examples:\n\n hbase&gt; scan '.META.'\n hbase&gt; scan '.META.', {COLUMNS =&gt; 'info:regioninfo'}\n hbase&gt; scan 't1', {COLUMNS =&gt; ['c1', 'c2'], LIMIT =&gt; 10, STARTROW =&gt; 'xyz'}\n hbase&gt; scan 't1', {COLUMNS =&gt; 'c1', TIMERANGE =&gt; [1303668804, 1303668904]}\n hbase&gt; scan 't1', {FILTER =&gt; \"(PrefixFilter ('row2') AND (QualifierFilter (&gt;=, 'binary:xyz'))) AND (TimestampsFilter ( 123, 456))\"}\n hbase&gt; scan 't1', {FILTER =&gt; org.apache.hadoop.hbase.filter.ColumnPaginationFilter.new(1, 0)}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1420012231080,"favorite_count":null,"last_activity_date":1420012231080,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1468127.0,"parent_id":27281710,"post_type_id":2,"score":7,"tags":null,"view_count":null},{"index":428,"id":27592908,"title":null,"body":"<p>They already solved it: <a href=\"https:\/\/github.com\/josevalim\/inherited_resources\/commit\/6d034d913bfd9b53ea2e5b31c4056578a1b170a4\" rel=\"nofollow\">https:\/\/github.com\/josevalim\/inherited_resources\/commit\/6d034d913bfd9b53ea2e5b31c4056578a1b170a4<\/a>. I'm using the latest gem release with rails 4.2.1 and it's working ok.<\/p>\n\n<p>For anyone experiencing the problem, try <code>bundle update inherited_resources<\/code>.<\/p>\n\n<p><strong>Old answer:<\/strong><\/p>\n\n<p>You have to use the specific branch for rails 4.2:<\/p>\n\n<pre><code>gem 'inherited_resources', github: 'josevalim\/inherited_resources', branch: 'rails-4-2'\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419189975357,"favorite_count":null,"last_activity_date":1435278014523,"last_edit_date":1435278014523,"last_editor_display_name":null,"last_editor_user_id":1638681.0,"owner_display_name":null,"owner_user_id":1638681.0,"parent_id":27275301,"post_type_id":2,"score":8,"tags":null,"view_count":null},{"index":429,"id":27589911,"title":null,"body":"<p>I will answer my own question:\nIt possible with accessibility api &amp; carbon\na) register a wide event:<\/p>\n\n<pre><code>AXUIElementRef _systemWideElement = AXUIElementCreateSystemWide();\n<\/code><\/pre>\n\n<p>b)convert carbon to screen point<\/p>\n\n<pre><code>- (CGPoint)carbonScreenPointFromCocoaScreenPoint:(NSPoint)cocoaPoint {\n NSScreen *foundScreen = nil;\n CGPoint thePoint;\n\n for (NSScreen *screen in [NSScreen screens]) {\n if (NSPointInRect(cocoaPoint, [screen frame])) {\n foundScreen = screen;\n }\n }\n\n if (foundScreen) {\n CGFloat screenMaxY = NSMaxY([foundScreen frame]);\n\n thePoint = CGPointMake(cocoaPoint.x, screenMaxY - cocoaPoint.y - 1);\n } else {\n thePoint = CGPointMake(0.0, 0.0);\n }\n\n return thePoint;\n}\n<\/code><\/pre>\n\n<p>c) get process under mouse<\/p>\n\n<pre><code>NSPoint cocoaPoint = [NSEvent mouseLocation];\nif (!NSEqualPoints(cocoaPoint, _lastMousePoint)) {\n CGPoint pointAsCGPoint = [self carbonScreenPointFromCocoaScreenPoint:cocoaPoint];\n\n AXUIElementRef newElement = NULL;\n if (AXUIElementCopyElementAtPosition( _systemWideElement, pointAsCGPoint.x, pointAsCGPoint.y, &amp;newElement ) == kAXErrorSuccess) {\n\n NSLog(@\"%@\",newElement);\n\n }\n _lastMousePoint = cocoaPoint;\n}\n<\/code><\/pre>\n\n<p>Credits to <a href=\"https:\/\/developer.apple.com\/library\/mac\/samplecode\/UIElementInspector\/Introduction\/Intro.html\" rel=\"nofollow noreferrer\">https:\/\/developer.apple.com\/library\/mac\/samplecode\/UIElementInspector\/Introduction\/Intro.html<\/a><\/p>\n\n<p>nslog gives something like &lt;AXUIElement 0x6000000583c0&gt; {pid=39429}<\/p>\n\n<pre><code>ps aux | grep 39429\n\n:39429 0.2 5.5 5109480 916500 ?? U 1:57PM 3:34.67 \/Applications\/Xcode.app\/Contents\/MacOS\/Xcode\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419169335180,"favorite_count":null,"last_activity_date":1521075290857,"last_edit_date":1521075290857,"last_editor_display_name":null,"last_editor_user_id":1971301.0,"owner_display_name":null,"owner_user_id":1927161.0,"parent_id":27584963,"post_type_id":2,"score":9,"tags":null,"view_count":null},{"index":430,"id":27637635,"title":null,"body":"<p>There are a couple ways to go about this.<\/p>\n\n<p>1) In the <em>Gradle<\/em> window, under All Tasks, find the <code>:html<\/code> subproject, then run its <code>dist<\/code> task.<\/p>\n\n<p>2) In the <em>Terminal<\/em> window, type <code>gradlew html:dist<\/code> and press enter.<\/p>\n\n<p>Either of these methods will result in a <code>dist<\/code> directory within the <code>html\/build<\/code> directory, which will contain the files you will need to deploy.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419427548377,"favorite_count":null,"last_activity_date":1419427548377,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":416549.0,"parent_id":27609071,"post_type_id":2,"score":13,"tags":null,"view_count":null},{"index":431,"id":27622332,"title":null,"body":"<p>I was able to resolve the problem. It's similar to the solution of reneph.<\/p>\n\n<p>I found that one library had no minSDK specified neither in the build.gradle nor in the manifest file. After adding<\/p>\n\n<pre><code>defaultConfig {\n minSdkVersion 14\n targetSdkVersion 21\n}\n<\/code><\/pre>\n\n<p>the permission was gone. I don't know why it worked without the permission on my previous build (also no minSDK specified). Must have been either the Android Studio 1.0 or the Android SDK update.<\/p>\n\n<hr>\n\n<p>Android developer documentation for <a href=\"https:\/\/developer.android.com\/reference\/android\/Manifest.permission.html#READ_PHONE_STATE\" rel=\"noreferrer\"><code>READ_PHONE_STATE<\/code><\/a> permission:<\/p>\n\n<blockquote>\n <p><strong>Note<\/strong>: If both your <code>minSdkVersion<\/code> and <code>targetSdkVersion<\/code> values are set to 3 or lower, the system implicitly grants your app this permission. If you don't need this permission, be sure your <code>targetSdkVersion<\/code> is 4 or higher. <\/p>\n<\/blockquote>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419344840147,"favorite_count":null,"last_activity_date":1464100921857,"last_edit_date":1464100921857,"last_editor_display_name":null,"last_editor_user_id":308836.0,"owner_display_name":null,"owner_user_id":2059113.0,"parent_id":27490598,"post_type_id":2,"score":14,"tags":null,"view_count":null},{"index":432,"id":27674004,"title":null,"body":"<p>The methods <code>View#getMeasuredWidth()<\/code> and <code>View#getMeasuredHeight()<\/code> represents the dimensions the view wants to be, before all views in the layout are calculated and laid in the screen.<\/p>\n<p>After <code>View#onMeasure(int, int)<\/code> and <code>View#onLayout(boolean, int, int, int, int)<\/code>, views measurements could be change to accommodate everything. These (possible) new values are then accessible through <code>View#getWidth()<\/code> and <code>View#getHeight()<\/code>.<\/p>\n<p>From the <a href=\"http:\/\/developer.android.com\/reference\/android\/view\/View.html\" rel=\"noreferrer\">View class reference<\/a>:<\/p>\n<blockquote>\n<p>The size of a view is expressed with a width and a height. A view actually possess two pairs of width and height values.<\/p>\n<p>The first pair is known as measured width and measured height. These dimensions define how big a view wants to be within its parent (see Layout for more details.) The measured dimensions can be obtained by calling getMeasuredWidth() and getMeasuredHeight().<\/p>\n<p>The second pair is simply known as width and height, or sometimes drawing width and drawing height. These dimensions define the actual size of the view on screen, at drawing time and after layout. These values may, but do not have to, be different from the measured width and height. The width and height can be obtained by calling getWidth() and getHeight().<\/p>\n<\/blockquote>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419745943073,"favorite_count":null,"last_activity_date":1419745943073,"last_edit_date":1592644375060,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":3928187.0,"parent_id":27673970,"post_type_id":2,"score":14,"tags":null,"view_count":null},{"index":433,"id":27715191,"title":null,"body":"<p>In your project directory you will find a <code>Proguard<\/code> folder, in which you will see four text files:<\/p>\n\n<p><strong>dump.txt<\/strong><\/p>\n\n<blockquote>\n <p>Describes the internal structure of all the class files in the .apk file<\/p>\n<\/blockquote>\n\n<p><strong>mapping.txt<\/strong><\/p>\n\n<blockquote>\n <p>Lists the mapping between the original and obfuscated class, method, and field names. This file is important when you receive a bug report from\n a release build, because it translates the obfuscated stack trace back to the\n original class, method, and member names. See Decoding Obfuscated Stack Traces\n for more information.<\/p>\n<\/blockquote>\n\n<p><strong>seeds.txt<\/strong><\/p>\n\n<blockquote>\n <p>Lists the classes and members that are not obfuscated<\/p>\n<\/blockquote>\n\n<p><strong>usage.txt<\/strong><\/p>\n\n<blockquote>\n <p>Lists the code that was stripped from the .apk<\/p>\n<\/blockquote>\n\n<p><a href=\"http:\/\/developer.android.com\/tools\/help\/proguard.html\" rel=\"noreferrer\">Source: Proguard<\/a><\/p>\n\n<p>Hope this helps!<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419990810433,"favorite_count":null,"last_activity_date":1524968268203,"last_edit_date":1524968268203,"last_editor_display_name":null,"last_editor_user_id":1693475.0,"owner_display_name":null,"owner_user_id":3894351.0,"parent_id":27714914,"post_type_id":2,"score":47,"tags":null,"view_count":null},{"index":434,"id":27592508,"title":null,"body":"<p>You can use NumPy's built in methods to do this: <code>np.ceil(series)<\/code> or <code>np.floor(series)<\/code>.<\/p>\n\n<p>Both return a Series object (not an array) so the index information is preserved.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":1,"community_owned_date":null,"creation_date":1419187022213,"favorite_count":null,"last_activity_date":1419187022213,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3923281.0,"parent_id":27592456,"post_type_id":2,"score":80,"tags":null,"view_count":null},{"index":435,"id":27402453,"title":null,"body":"<p>You could try this:<\/p>\n\n<pre><code>MongoClient.connect('mongodb:\/\/127.0.0.1:27017\/gt-chat', function(err, db) {\n if(err) throw err;\n var collection = db.collection('gt-chat');\n console.log(\"******************************Printing docs from Cursor Each\")\n collection.find({}, {_id: 0}).sort({$natural: 1}).limit(20).each(function(err, doc) {\n console.log(doc);\n if(doc != null) {\n console.log(\"Doc from Each \");\n console.dir(doc);\n }\n });\n});\n<\/code><\/pre>\n\n<p><strong>EDIT<\/strong> <\/p>\n\n<p>To write to browser, use the <code>response<\/code> object as follows<\/p>\n\n<pre><code>require('http').createServer(function(req, res) {\n MongoClient.connect('mongodb:\/\/127.0.0.1:27017\/gt-chat', function(err, db) {\n if(err) throw err;\n var collection = db.collection('gt-chat');\n console.log(\"******************************Printing docs from Cursor Each\")\n collection.find({}, {_id: 0}).sort({$natural: 1}).limit(20).each(function(err, doc) {\n console.log(doc);\n if(doc) {\n res.writeHead(200, {\"Content-Type\": \"text\/plain\"});\n res.write(JSON.stringify(doc) + \"\\n\");\n }\n else {\n res.end();\n }\n });\n });\n}).listen(port, host);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418218760800,"favorite_count":null,"last_activity_date":1418227873257,"last_edit_date":1418227873257,"last_editor_display_name":null,"last_editor_user_id":122005.0,"owner_display_name":null,"owner_user_id":122005.0,"parent_id":27402282,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":436,"id":27445777,"title":null,"body":"<p>you should call Session.openActiveSession() before calling the Session.getSession() method<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418394518530,"favorite_count":null,"last_activity_date":1418394518530,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3697686.0,"parent_id":27442619,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":437,"id":27471096,"title":null,"body":"<p>I use something similar to this for these situations. You can change it as you see fit but it replaces all characters that are special in Windows files paths with underscores. <\/p>\n\n<pre><code>Function CreateFriendlyName(pText as string) as String\n\n Dim objRegex As Object\n\n ' Initiate regex search\n Set objRegex = CreateObject(\"VBScript.RegExp\")\n With objRegex\n .Pattern = \"(\\s|\\\\|\/|&lt;|&gt;|\\|\\|\\?|:)\"\n .Global = True\n .IgnoreCase = True\n End With\n\n CreateFriendlyName = objRegex.Replace(pText , \"_\")\n\n Set objRegex = Nothing\nEnd Function\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418572839377,"favorite_count":null,"last_activity_date":1418575395427,"last_edit_date":1418575395427,"last_editor_display_name":null,"last_editor_user_id":4120846.0,"owner_display_name":null,"owner_user_id":3829407.0,"parent_id":27470607,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":438,"id":27524689,"title":null,"body":"<p>you don't need slide animation, what you actually want is object animation<\/p>\n\n<p>Code<\/p>\n\n<pre><code> Button bt = (Button) findViewById (R.id.button);\n final LinearLayout linearLayout = (LinearLayout) findViewById (R.id.test);\n bt.setOnClickListener (new View.OnClickListener () {\n @Override\n public void onClick (View v) {\n\n ValueAnimator anim = ValueAnimator.ofInt(linearLayout.getMeasuredHeight (), 500);\n anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {\n @Override\n public void onAnimationUpdate(ValueAnimator valueAnimator) {\n int val = (Integer) valueAnimator.getAnimatedValue();\n ViewGroup.LayoutParams layoutParams = linearLayout.getLayoutParams();\n layoutParams.height = val;\n linearLayout.setLayoutParams(layoutParams);\n }\n });\n anim.setDuration(1000);\n anim.start(); \n }\n });\n<\/code><\/pre>\n\n<p>XML<\/p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n android:orientation=\"vertical\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"&gt;\n\n &lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"New Button\"\n android:id=\"@+id\/button\"\n android:layout_gravity=\"center_horizontal\" \/&gt;\n\n &lt;LinearLayout\n android:orientation=\"vertical\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"0dp\"\n android:id=\"@+id\/test\"\n\n android:background=\"#fff333\"\n android:layout_gravity=\"center_horizontal\"&gt;\n\n &lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"New Button\"\n android:id=\"@+id\/button2\" \/&gt;\n\n &lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"New Button\"\n android:id=\"@+id\/button3\" \/&gt;\n\n &lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"New Button\"\n android:id=\"@+id\/butt3\" \/&gt;\n\n &lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"New Button\"\n android:id=\"@+id\/bton3\" \/&gt;\n\n &lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"New Button\"\n android:id=\"@+id\/butn3\" \/&gt;\n\n &lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"New Button\"\n android:id=\"@+id\/cb\" \/&gt;\n\n &lt;\/LinearLayout&gt;\n&lt;\/LinearLayout&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418816155460,"favorite_count":null,"last_activity_date":1418818943147,"last_edit_date":1418818943147,"last_editor_display_name":null,"last_editor_user_id":1061944.0,"owner_display_name":null,"owner_user_id":1061944.0,"parent_id":27524049,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":439,"id":27528567,"title":null,"body":"<p>My mistake. Shame on me.<\/p>\n\n<p>Seems like when I committed\/pushed the fix, I accidentally undid some changes, which I only recognised after about half a day...<\/p>\n\n<p><strong>This was the problem (it could be helpful for beginners):<\/strong><\/p>\n\n\n\n<pre class=\"lang-js prettyprint-override\"><code>+ return new Promise(function(resolve, reject){\n+ resolve(self._config);\n- return new Promise(function () {\n- return self._config;\n });\n<\/code><\/pre>\n\n<p><strong>Update:<\/strong> Benjamin's solution is much better. The same but more compact and clear. Thanks!<\/p>\n\n<pre class=\"lang-js prettyprint-override\"><code>return Promise.resolve(self._config);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418828732647,"favorite_count":null,"last_activity_date":1418934135423,"last_edit_date":1418934135423,"last_editor_display_name":null,"last_editor_user_id":3881783.0,"owner_display_name":null,"owner_user_id":3881783.0,"parent_id":27527565,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":440,"id":27528792,"title":null,"body":"<p>An example of registry entry creation would be:<\/p>\n\n<pre><code>Const HKEY_CURRENT_USER = &amp;H80000001\nstrComputer = \".\"\nSet objRegistry = GetObject(\"winmgmts:\\\\\" &amp; strComputer &amp; \"\\root\\default:StdRegProv\")\nstrValueName = \"My DWORD Value\"\ndwValue = 13\nobjRegistry.SetDWORDValue HKEY_CURRENT_USER, strKeyPath, strValueName, dwValue\n<\/code><\/pre>\n\n<p>Source : <a href=\"http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2006\/11\/16\/how-can-i-create-a-new-registry-key.aspx\" rel=\"nofollow\">http:\/\/blogs.technet.com\/b\/heyscriptingguy\/archive\/2006\/11\/16\/how-can-i-create-a-new-registry-key.aspx<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418829349753,"favorite_count":null,"last_activity_date":1418829349753,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3545980.0,"parent_id":27528589,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":441,"id":27570305,"title":null,"body":"<p>It is more a problem of design here. Your function <code>getContacts<\/code> should not update the text field directly. It should return the contact string, and the view controller should call this method to get the string and update the text field.<\/p>\n\n<pre><code>class ContactData: NSObject { \n func getContacts() -&gt; String\n {\n return \"XXXXXX\"\n }\n}\n<\/code><\/pre>\n\n<p>In your UIViewController:<\/p>\n\n<pre><code>let myContact = ContactData()\ntextField1.text = myContact.getContacts()\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419007423640,"favorite_count":null,"last_activity_date":1419007423640,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2986116.0,"parent_id":27569376,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":442,"id":27646246,"title":null,"body":"<p>Move this statement outside of the <code>populateListView()<\/code> method and make it a member variable of the class:<\/p>\n\n<pre><code>SimpleCursorAdapter mycursor;\n<\/code><\/pre>\n\n<p>in <code>onPrepareOptionsMenu()<\/code> do this:<\/p>\n\n<pre><code>@Override\npublic boolean onPrepareOptionsMenu(Menu menu) {\n int count = myCursor.getCount();\n if (count == 0) {\n return false; \/\/Don't show options menu if list is empty\n }\n return true;\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419502414537,"favorite_count":null,"last_activity_date":1419502414537,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":769265.0,"parent_id":27640328,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":443,"id":27670059,"title":null,"body":"<p>It's certainly possible. There are basically two options if you are using Entity Framework for your existing database.<\/p>\n\n<ol>\n<li>Provide your own mapping to the built in classes, by using your own <code>OnModelCreating<\/code> override on the DB Context.<\/li>\n<li>Provide an own storage for ASP.NET Identity by implementing <code>IUserStore<\/code>, <code>IRoleStore<\/code> and <code>IUserRoleStore<\/code> in one storage class. This way you can map to existing classes in your data model.<\/li>\n<\/ol>\n\n<p>If you are using another DB access than EF Code First you have to use option 2<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419703738007,"favorite_count":null,"last_activity_date":1419703738007,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":280222.0,"parent_id":27669999,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":444,"id":27743739,"title":null,"body":"<p>Associate a controller with the module to access $scope value in the scope method.\nSample code is given below:<\/p>\n\n<h2>Html<\/h2>\n\n<pre><code>&lt;html&gt;\n &lt;head&gt;\n ...\n &lt;\/head&gt;\n &lt;body ng-app=\"AuthApp\"&gt;\n &lt;div ng-controller=\"MyCntrl\"&gt;\n userId: &lt;input type=\"text\" ng-model=\"userId\" ng-blur=\"userIdChanged()\"\/&gt;\n &lt;div&gt;{{addresss}}&lt;\/div&gt;\n ...\n &lt;\/div&gt;\n &lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n\n<h2>Js<\/h2>\n\n<pre><code>var module = angular.module(\"AuthApp\", []);\n\nmodule.controller(\"MyCntrl\", function($scope){\n\n$scope.userIdChanged = function () {\n \/\/ now access $scope.userId here\n };\n\n});\n<\/code><\/pre>\n\n<p>Try this, will help you.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1420209020423,"favorite_count":null,"last_activity_date":1420209020423,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3222971.0,"parent_id":27743456,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":445,"id":27746983,"title":null,"body":"<p>You can use <code>&lt;branch&gt;:&lt;file_path&gt;<\/code> notation with <code>git diff<\/code><\/p>\n\n<p><code>git diff remote_branch\/master:file3 HEAD:Dir1\/file3<\/code><\/p>\n\n<p><code>git diff remote_branch\/master:file4 HEAD:Dir1\/file4<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1420224327080,"favorite_count":null,"last_activity_date":1420224327080,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1310493.0,"parent_id":27745693,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":446,"id":27417963,"title":null,"body":"<p>With your current setup, your post request will have your regModel object in the content of your request. On the server side, you can get the body or content and then write it to file.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418284975807,"favorite_count":null,"last_activity_date":1418284975807,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1817106.0,"parent_id":27417705,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":447,"id":27453139,"title":null,"body":"<p>You need to use <code>Dispatcher.BeginInvoke<\/code> to perform the reversal of the user action.<\/p>\n\n<p>Basically, when the user selects the item on the combo box, any attempt to reject that value will be ignored by WPF. However, if you wait until all the code relating to data binding finishes, then you can basically start a new binding activity. This is what <code>Dispatcher.BeginInvoke<\/code> does. It allows your reset of the selected item to be postponed until the binding engine has finished its work.<\/p>\n\n<p>Example:<\/p>\n\n<pre><code>public class MainViewModel : ViewModelBase\n{\n private string _selectedItem;\n\n public List&lt;string&gt; Items { get; private set; }\n\n public string SelectedItem\n {\n get { return _selectedItem; }\n set\n {\n if (value == _selectedItem) return;\n var previousItem = _selectedItem;\n _selectedItem = value;\n var isInvalid = value == \"Bus\"; \/\/ replace w\/ your messenger code\n if (isInvalid)\n {\n Application.Current.Dispatcher.BeginInvoke(\n new Action(() =&gt; ResetSelectedItem(previousItem)),\n DispatcherPriority.ContextIdle,\n null);\n return;\n }\n RaisePropertyChanged();\n }\n }\n\n public MainViewModel()\n {\n Items = new[] { \"Car\", \"Bus\", \"Train\", \"Airplane\" }.ToList();\n _selectedItem = \"Airplane\";\n }\n\n private void ResetSelectedItem(string previousItem)\n {\n _selectedItem = previousItem;\n RaisePropertyChanged(() =&gt; SelectedItem);\n }\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418423480180,"favorite_count":null,"last_activity_date":1418423881903,"last_edit_date":1418423881903,"last_editor_display_name":null,"last_editor_user_id":129164.0,"owner_display_name":null,"owner_user_id":129164.0,"parent_id":27449797,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":448,"id":27455911,"title":null,"body":"<p>Your demo is lil weird but anyways, if you want to deduct <code>10em<\/code> from <code>100%<\/code> then use <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/CSS\/calc\" rel=\"nofollow\"><code>calc()<\/code><\/a> property like<\/p>\n\n<pre><code>#top {\n width: 100%; \/* You won't need this *\/\n height: calc(100% - 10em);\n background-color: red;\n}\n<\/code><\/pre>\n\n<p><a href=\"http:\/\/jsfiddle.net\/hoh0m85s\/\" rel=\"nofollow\"><strong>Demo<\/strong><\/a><\/p>\n\n<p>Note : I've removed <code>position: absolute;<\/code>, <code>margin-left<\/code> like properties from your demo because I have no idea why you were using them at first place but if you want you can still use them. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418448921467,"favorite_count":null,"last_activity_date":1418449353190,"last_edit_date":1418449353190,"last_editor_display_name":null,"last_editor_user_id":1542290.0,"owner_display_name":null,"owner_user_id":1542290.0,"parent_id":27455894,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":449,"id":27469248,"title":null,"body":"<p>Your transaction is not getting rollback because there is no exception thrown , in other words <code>saveUpdateDeleteTest<\/code> is catching the exception, thats why spring transactional proxy cannot detect any exception and Hence no rollback. Remove the catch block and you will see that transaction will rollback . PLease note that <a href=\"http:\/\/docs.spring.io\/spring\/docs\/2.5.x\/reference\/transaction.html#transaction-declarative\" rel=\"nofollow\">spring transaction<\/a> rollback follows EJB Conventation i.e.<\/p>\n\n<blockquote>\n <p>While the EJB default behavior is for the EJB container to\n automatically roll back the transaction on a system exception (usually\n a runtime exception), EJB CMT does not roll back the transaction\n automatically on an application exception (that is, a checked\n exception other than java.rmi.RemoteException). While the Spring\n default behavior for declarative transaction management follows EJB\n convention (roll back is automatic only on unchecked exceptions), it\n is often useful to customize this.<\/p>\n<\/blockquote>\n\n<p>So in your case you need to customize if you want the transaction to be rolled back on any exception, like this:<\/p>\n\n<pre><code>@Transactional(rollbackFor = Exception.class)\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418559782643,"favorite_count":null,"last_activity_date":1418563130477,"last_edit_date":1418563130477,"last_editor_display_name":null,"last_editor_user_id":1707520.0,"owner_display_name":null,"owner_user_id":1707520.0,"parent_id":27469104,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":450,"id":27471576,"title":null,"body":"<p>Try to see what <code>pix[0,0]<\/code> contains for example:<\/p>\n\n<pre><code>&gt;&gt;&gt; img = Image.open('.\/edgewalker-cat.png')\n&gt;&gt;&gt; pix = img.load()\n&gt;&gt;&gt; pix\n&lt;PixelAccess object at 0x7f1afac932f0&gt;\n&gt;&gt;&gt; pix[0,0]\n(0, 0, 0)\n<\/code><\/pre>\n\n<p>Its tuple, size of 3, so the <code>pixels<\/code> list, you are constructing one by one item, will be converted to the dimension of (width*height, 3).<\/p>\n\n<p><strong>UPD:<\/strong> On grayscaled images, you'll get a plain int value:<\/p>\n\n<pre><code>&gt;&gt;&gt; img = Image.open('.\/urban-dove-gray.jpg')\n&gt;&gt;&gt; pix = img.load()\n&gt;&gt;&gt; pix[0,0]\n31\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418575709020,"favorite_count":null,"last_activity_date":1418576548870,"last_edit_date":1418576548870,"last_editor_display_name":null,"last_editor_user_id":1102535.0,"owner_display_name":null,"owner_user_id":1102535.0,"parent_id":27471459,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":451,"id":27476869,"title":null,"body":"<p>You can use one more <code>with<\/code> here and construct the path with <a href=\"https:\/\/docs.djangoproject.com\/en\/dev\/ref\/templates\/builtins\/#add\" rel=\"nofollow\"><code>add<\/code><\/a>:<\/p>\n\n<pre><code>{% with \"\/\"|add:lang|add:\"\/\" as path %}\n &lt;li class=\"{% ifequal request.path path %} active {% endifequal%}\"&gt;\n{% endwith %}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418613443837,"favorite_count":null,"last_activity_date":1418613443837,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":771848.0,"parent_id":27476824,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":452,"id":27497359,"title":null,"body":"<p>Looks like you don't have a param named <code>json<\/code> so try<\/p>\n\n<pre><code>\/\/var obj = JSON.parse(result);\n\n$.ajax({\n url: 'json.php',\n data: {\n json: result\n },\n dataType: \"json\",\n type: \"POST\"\n});\n<\/code><\/pre>\n\n<p>Note: Don't create a json object using string concatenation. You can create an object then use <code>JSON.stringify()<\/code> to sent the value to server as a param value.<\/p>\n\n<pre><code>var obj = {};\n\n\/\/do some processing here which adds some properties to obj like\nobj.name = 'x';\nobj.id = 4\n\n$.ajax({\n url: 'json.php',\n data: {\n json: JSON.stringify(obj)\n },\n dataType: \"json\",\n type: \"POST\"\n});\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418702996977,"favorite_count":null,"last_activity_date":1418702996977,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":114251.0,"parent_id":27497317,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":453,"id":27542294,"title":null,"body":"<p>Both runmqsc and MQ Explorer (via PCF) display the same value that the queue manager gives to them. If both commands were issued at <strong>exactly<\/strong> the same time they would give the sme answer. Of course, CURDEPTH is something that can change rapidly, so please be sure that it isn't simply an actual change in the depth between issuing the command with one tool and the other tool.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418891957973,"favorite_count":null,"last_activity_date":1418891957973,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4042083.0,"parent_id":27518575,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":454,"id":27549242,"title":null,"body":"<p>I would recommend a PFRelation field. From the Parse documentation:<\/p>\n\n<blockquote>\n <p>This works similar to an NSArray of PFObjects, except that you don't need to download all the Objects in a relation at once. This allows PFRelation to scale to many more objects than the NSArray of PFObject approach.<\/p>\n<\/blockquote>\n\n<p>In other words, the PFRelation makes more sense as you scale, especially if you conceive of individuals having lists of 100s or 1000s of friends. PFRelation is flexible and allows you to more easily query for only the friends you are seeking at the moment; for example, if you wanted to find only friends who had logged in during the past 24 hours.<\/p>\n\n<p>Learn more here:\n<a href=\"https:\/\/www.parse.com\/docs\/ios_guide#objects-pointers\/iOS\" rel=\"nofollow\">https:\/\/www.parse.com\/docs\/ios_guide#objects-pointers\/iOS<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418914161980,"favorite_count":null,"last_activity_date":1418914161980,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3486310.0,"parent_id":27547789,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":455,"id":27550872,"title":null,"body":"<blockquote>\n <p>I think that I need to use something like this: [snip] but I really can't figure out how to use it.<\/p>\n<\/blockquote>\n\n<p>That's exactly what you need, but you also need <a href=\"http:\/\/www.albahari.com\/nutshell\/linqkit.aspx\" rel=\"nofollow\">LINQKit<\/a> to make the query work. With it, your code would look like this:<\/p>\n\n<pre><code>var toModel = ToModel();\n\nvar departments2 = db.departments\n .AsExpandable()\n .Include(p =&gt; p.employee)\n .Where(p =&gt; true)\n .Select(p =&gt; new CustomDepartmentModel()\n{\n ID = p.ID,\n Employees = toModel.Invoke(p.employee).ToList()\n});\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418918861693,"favorite_count":null,"last_activity_date":1418918861693,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":41071.0,"parent_id":27549027,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":456,"id":27584984,"title":null,"body":"<p>You can pass these in the onclick function when you make each element.<\/p>\n\n<pre><code>$(document).ready(function() {\n\n\n$.each(data, function() {\n artist = this.name;\n $('#artist-suggestions').append('&lt;li&gt;&lt;a href=\"http:\/\/.....\/100.php\" artist=\"'+ this.name +'\" subgenre=\"'+ this.subgenre +'\" onclick=\"artistGen(' + this.Blah1 + ',' + this.Blah2' + ')\"&gt;' + this.name + this.new + '&lt;\/a&gt;&lt;\/li&gt;');\n});\n\n})\n<\/code><\/pre>\n\n<p>;<\/p>\n\n<pre><code>function artistGen(Blah1, Blah2){\n saveData(Blah1, Blah2);\nalert('dfdsf');\n\n};\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419115059253,"favorite_count":null,"last_activity_date":1419115059253,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2367096.0,"parent_id":27584914,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":457,"id":27586548,"title":null,"body":"<p>You might want to append elements at the end, for the three dimensional list:<\/p>\n\n<pre><code>space = []\nspace.append([])\nspace[i].append([])\nspace[i][j].append(&lt;element&gt;)\n<\/code><\/pre>\n\n<p>Or you can use <code>numpy<\/code>:<\/p>\n\n<pre><code>import numpy as np\nspace = np.empty((len(self.xs), len(self.ys), len(self.zs)), dtype=object)\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419133547867,"favorite_count":null,"last_activity_date":1419134792387,"last_edit_date":1419134792387,"last_editor_display_name":null,"last_editor_user_id":1602049.0,"owner_display_name":null,"owner_user_id":1602049.0,"parent_id":27586536,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":458,"id":27674355,"title":null,"body":"<p>You can either use,<\/p>\n\n<pre><code>find -iname '*.php' -print0 | xargs -0 zip -r php.zip\n<\/code><\/pre>\n\n<p>or<\/p>\n\n<pre><code>zip -r php.zip . --include \\*.php\n<\/code><\/pre>\n\n<p>Both of the above commands will do the job.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419750253000,"favorite_count":null,"last_activity_date":1419778518120,"last_edit_date":1419778518120,"last_editor_display_name":null,"last_editor_user_id":4381432.0,"owner_display_name":null,"owner_user_id":4381432.0,"parent_id":27674241,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":459,"id":27679389,"title":null,"body":"<p>You can proceed the command with \"cmd \/c\" to start a new command prompt, and redirect the output of the command prompt:<\/p>\n\n<pre><code>cmd \/c for \/L %i IN (1,1,254) DO nslookup 192.168.1.%i &gt; nslookup.txt\n<\/code><\/pre>\n\n<p>Note that you only need to use a single greater than (>) since the output of cmd is going to nslookup.txt. Sadly, this misses the error output, so you are not seeing the ***Request to UnKnown timed-out for each failed address.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419791719077,"favorite_count":null,"last_activity_date":1419791719077,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4389697.0,"parent_id":27679273,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":460,"id":27687934,"title":null,"body":"<p>After quite a bit of a research I think I made it. The difficult part was to include the All-rows part in the drop-down menu. So, here it goes:<\/p>\n\n<p>First of all you need 2 libraries to do it: <code>dplyr<\/code> and <code>stringi<\/code>:<\/p>\n\n<pre><code>library(dplyr)\nlibrary(stringi)\n\nselector &lt;- c('Adwords', 'Campanas', 'Directo', 'Email', 'Others', 'Referencias', 'SEO', 'Social_Media', 'All' = 'Adwords_Campanas_Directo_Email_Others_Referencias_SEO_Social_Media' ) \n#the selector is a vector to include all your choices\n<\/code><\/pre>\n\n<p>And the actual code that does what you need:<\/p>\n\n<pre><code>Sesiones_Campanas1 %&gt;% #the table\n ggvis(~Campanas1, ~sessions, fill := \"red\") %&gt;% #the ggvis object\n filter(stri_detect_fixed(eval(input_select(choices=selector, label='Fuente' )) , Campanas1) ) %&gt;% #the difficult part. You need to use filter and stri_detect_fixed with the input select to get exactly what you need.\n layer_bars() #plot bars\n<\/code><\/pre>\n\n<p>I cannot upload the interactive graph (I think) so I ll upload the static <code>all<\/code> graph (But you can see the drop-down box and all of the choices there).<\/p>\n\n<p>P.S. If the x-axis labels won't appear correctly it is because you need to increase the graph size (works both on Rstudio and on the browser)<\/p>\n\n<p>P.S.2 A few words on how the <code>filter<\/code> line works: You need <code>eval<\/code> to evaluate the <code>input_select<\/code> outcome into a string so that it can then be matched with the <code>stri_detect_fixed<\/code> function. <code>filter<\/code> then decides which rows to be used.<\/p>\n\n<p>And that's it! <\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/LQMtv.png\" alt=\"enter image description here\"><\/p>\n\n<p><strong>UPDATE<\/strong><\/p>\n\n<p>In order to have the the 'all' sources selected at the beginning you need to specify the <code>selected<\/code> argument like this:<\/p>\n\n<pre><code>Sesiones_Campanas1 %&gt;% \n ggvis(~Campanas1, ~sessions, fill := \"red\") %&gt;%\n filter(stri_detect_fixed(eval(input_select(choices=selector, label='Fuente', selected='Adwords_Campanas_Directo_Email_Others_Referencias_SEO_Social_Media' )) , Campanas1) ) %&gt;% \n layer_bars() \n<\/code><\/pre>\n\n<p>Hope this helps!!<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419852323350,"favorite_count":null,"last_activity_date":1420081628850,"last_edit_date":1420081628850,"last_editor_display_name":null,"last_editor_user_id":4130044.0,"owner_display_name":null,"owner_user_id":4130044.0,"parent_id":27678846,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":461,"id":27712463,"title":null,"body":"<p>put <a href=\"https:\/\/docs.djangoproject.com\/en\/1.7\/ref\/models\/options\/#db-table\" rel=\"nofollow\"><code>db_table<\/code><\/a> to your model and move it wherever you want. it refers then always to that old db table and you dont need any migrations for your new app. <\/p>\n\n<pre><code>class Product(models.Model):\n class Meta: \n db_table = 'oldapp_tablename'\n<\/code><\/pre>\n\n<p>just be careful that imports should be adjusted according to new layout. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419973068087,"favorite_count":null,"last_activity_date":1419973068087,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":903790.0,"parent_id":27712137,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":462,"id":27713706,"title":null,"body":"<p>For Single Sign On Applications, you probably want to move all of the Security out into a Separate Service that works directly with your LDAP Provider. That way you are not tightly coupling Product Specific LDAP Code into your Web Application. Your Web App can then call the Security Service passing it the Login Credentials of the User who is signed into the OS. That way if you're needing to grant permissions to Groups of User or Users, you can just be returned a boolean from the Security Service of whether that Logged in User is Authorized. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419979773500,"favorite_count":null,"last_activity_date":1419979773500,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3366604.0,"parent_id":27630548,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":463,"id":27720158,"title":null,"body":"<p>You are using the wrong Model handler based on your config.xml.\nYou should call<\/p>\n\n<pre><code>Mage::getModel(\"sellerrequest\/sellerrequest\")-&gt;load()\n<\/code><\/pre>\n\n<p>And your _init() function in models may also be faulty\nThey should also stand <strong>sellerrequest\/sellerrequest<\/strong> instead of wallets\/sellerrequest<\/p>\n\n<p>And your <code>&lt;class&gt;<\/code> tag for the model sallerrequest may be wrong too.\nYou state : <\/p>\n\n<pre><code>&lt;sellerrequest&gt;\n &lt;class&gt;Adept_Sellerrequest_Model&lt;\/class&gt;\n &lt;resourceModel&gt;sellerrequest_mysql4&lt;\/resourceModel&gt;\n&lt;\/sellerrequest&gt;\n<\/code><\/pre>\n\n<p>Which means Magento is going to look at app\/code\/local\/Adept\/Sellerrequest\/Model\/...\nWhere your Model file state they are Adept_Wallets_Model_... thus must be located in app\/code\/local\/Adept\/Wallets\/Model\/...<\/p>\n\n<p>As a matter of fact this declaration is, in Magento way of doing things, totally wrong. Because with the line <code>&lt;class&gt;Adept_Sellerrequest_Model&lt;\/class&gt;<\/code> you are stating that the models of the Module Adept_Wallets are in another module : Adept_Sellerrequest, which can work, but that I can not at all recommend you to do.<\/p>\n\n<p><strong>BUT<\/strong> if you really want your module to be clear, here are how they would do it in Magento core files : changes in your xml file :<\/p>\n\n<pre><code>&lt;config&gt;\n &lt;modules&gt;\n &lt;Adept_Wallets&gt;\n &lt;version&gt;1.4.0&lt;\/version&gt;\n &lt;\/Adept_Wallets&gt;\n &lt;\/modules&gt;\n &lt;frontend&gt;\n &lt;routers&gt;\n &lt;wallets&gt;\n &lt;use&gt;standard&lt;\/use&gt;\n &lt;args&gt;\n &lt;module&gt;Adept_Wallets&lt;\/module&gt;\n &lt;frontName&gt;wallets&lt;\/frontName&gt;\n &lt;\/args&gt;\n &lt;\/wallets&gt;\n &lt;\/routers&gt;\n &lt;layout&gt;\n &lt;updates&gt;\n &lt;wallets&gt;\n &lt;file&gt;wallets.xml&lt;\/file&gt;\n &lt;\/wallets&gt;\n &lt;\/updates&gt;\n &lt;\/layout&gt;\n &lt;\/frontend&gt;\n &lt;admin&gt;\n &lt;routers&gt;\n &lt;wallets&gt;\n &lt;use&gt;admin&lt;\/use&gt;\n &lt;args&gt;\n &lt;module&gt;Adept_Wallets&lt;\/module&gt;\n &lt;frontName&gt;wallets&lt;\/frontName&gt;\n &lt;\/args&gt;\n &lt;\/wallets&gt;\n &lt;\/routers&gt;\n &lt;\/admin&gt; \n &lt;global&gt;\n &lt;models&gt;\n &lt;wallets&gt;\n &lt;class&gt;Adept_Wallets_Model&lt;\/class&gt;\n &lt;resourceModel&gt;wallets_mysql4&lt;\/resourceModel&gt;\n &lt;\/wallets&gt;\n &lt;wallets_mysql4&gt;\n &lt;class&gt;Adept_Wallets_Model_Mysql4&lt;\/class&gt;\n &lt;entities&gt;\n &lt;wallets&gt;\n &lt;table&gt;wallets&lt;\/table&gt;\n &lt;\/wallets&gt; \n &lt;!-- the table to connect to seller request is now here --&gt;\n &lt;sellerrequest&gt;\n &lt;table&gt;sellerrequest&lt;\/table&gt;\n &lt;\/sellerrequest&gt; \n &lt;\/entities&gt;\n &lt;\/wallets_mysql4&gt;\n\n &lt;!-- do not use two models definition --&gt;\n &lt;!-- sellerrequest&gt;\n &lt;class&gt;Adept_Sellerrequest_Model&lt;\/class&gt;\n &lt;resourceModel&gt;sellerrequest_mysql4&lt;\/resourceModel&gt;\n &lt;\/sellerrequest&gt;\n &lt;sellerrequest_mysql4&gt;\n &lt;class&gt;Adept_Sellerrequest_Model_Mysql4&lt;\/class&gt;\n &lt;entities&gt;\n &lt;sellerrequest&gt;\n &lt;table&gt;sellerrequest&lt;\/table&gt;\n &lt;\/sellerrequest&gt; \n &lt;\/entities&gt;\n &lt;\/sellerrequest_mysql4 --&gt;\n &lt;\/models&gt;\n &lt;resources&gt;\n &lt;wallets_setup&gt;\n &lt;setup&gt;\n &lt;module&gt;Adept_Wallets&lt;\/module&gt;\n &lt;\/setup&gt;\n &lt;connection&gt;\n &lt;use&gt;core_setup&lt;\/use&gt;\n &lt;\/connection&gt;\n &lt;\/wallets_setup&gt;\n &lt;wallets_write&gt;\n &lt;connection&gt;\n &lt;use&gt;core_write&lt;\/use&gt;\n &lt;\/connection&gt;\n &lt;\/wallets_write&gt;\n &lt;wallets_read&gt;\n &lt;connection&gt;\n &lt;use&gt;core_read&lt;\/use&gt;\n &lt;\/connection&gt;\n &lt;\/wallets_read&gt;\n &lt;\/resources&gt;\n &lt;blocks&gt;\n &lt;wallets&gt;\n &lt;class&gt;Adept_Wallets_Block&lt;\/class&gt;\n &lt;\/wallets&gt;\n &lt;\/blocks&gt;\n &lt;helpers&gt;\n &lt;wallets&gt;\n &lt;class&gt;Adept_Wallets_Helper&lt;\/class&gt;\n &lt;\/wallets&gt;\n &lt;\/helpers&gt;\n &lt;\/global&gt;\n&lt;\/config&gt;\n<\/code><\/pre>\n\n<p><strong>THEN<\/strong> you can use <code>Mage::getModel('wallets\/sellerrequest')<\/code> and <strong>then<\/strong> your class names in Adept_Wallets_Model_(...) for sellerrequest are right.<\/p>\n\n<p>Little explanation about the models in Magento <\/p>\n\n<pre><code>Mage::getModel(\"module_handler\/path_to_class\")\n<\/code><\/pre>\n\n<p>This is how Magento get his model, but that also works for blocks when using Mage::getBlockSingleton() or Mage::helper() or Mage::getSingleton(), ...<\/p>\n\n<p>So what is this module_handler and path_to_class correspond to and how does Magento get to the right class in the right folder you may ask ?<\/p>\n\n<p>Here it goes from 0 to end :<\/p>\n\n<p>First thinks come first you are here requesting a Model because you call Mage::getModel(), so Magento is going to parse all the config.xml of all the modules to find a module with the handler : module_handler.<\/p>\n\n<p>So in your config.xml there should be something looking like <\/p>\n\n<pre><code>&lt;config&gt;\n&lt;!-- this above line means we are going to add something to the global config --&gt;\n &lt;global&gt;\n &lt;!-- this above line means we are going to add something which can be accessed by both fronted and backend elements --&gt;\n &lt;models&gt;\n &lt;!-- this above line means we are going to add a model to the existing models --&gt;\n &lt;module_handler&gt;\n &lt;!-- this above line means our new model have the handler module_handler --&gt;\n &lt;class&gt;Company_Module_Model&lt;\/class&gt;\n &lt;!-- this above line states where are the files of this model --&gt;\n\n &lt;!-- some declaration should come here --&gt;\n &lt;\/module_handler&gt;\n &lt;models&gt;\n &lt;\/global&gt;\n&lt;\/config&gt; \n<\/code><\/pre>\n\n<p>Ok, now Magento can get to your class : it knows that calling <strong>module_handler<\/strong>\/path_to_class have to map to Company_Module_Model_Path_To_Class does to the file in Company\/Module\/Model\/Path\/To\/Class.php <\/p>\n\n<p>And for even further comprehension it knows, based on the file in app\/etc\/modules\/Company_Module.xml where this Module files are because you stated something like :<\/p>\n\n<pre><code>&lt;config&gt;\n &lt;modules&gt;\n &lt;Company_Module&gt;\n &lt;active&gt;true&lt;\/active&gt;\n &lt;codePool&gt;local&lt;\/codePool&gt;\n &lt;depends\/&gt;\n &lt;\/Company_Module&gt;\n &lt;\/modules&gt;\n&lt;\/config&gt;\n<\/code><\/pre>\n\n<p>So it knows it is a local module so it is going to look in the folder in app\/code\/<strong>local<\/strong>\nSo your file is in app\/code\/local\/Company\/Module\/Model\/Path\/To\/Class.php <\/p>\n\n<p>Same if you call a simpler Mage::getModel('module_handler\/class')\nit knows the file is in app\/code\/local\/Company\/Module\/Model\/Class.php<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1420023531420,"favorite_count":null,"last_activity_date":1495495345353,"last_edit_date":1495495345353,"last_editor_display_name":null,"last_editor_user_id":2123530.0,"owner_display_name":null,"owner_user_id":2123530.0,"parent_id":27719706,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":464,"id":27721773,"title":null,"body":"<p>You could add:<\/p>\n\n<pre><code>.ui-grid-pager-panel {\n top: 370px;\n}\n<\/code><\/pre>\n\n<p>to your css. Where the <code>top<\/code> value depends on the height of your grid.<\/p>\n\n<p>That's not very nice. But: Hey, it works!<\/p>\n\n<p>See a <a href=\"http:\/\/plnkr.co\/edit\/l3ksk0AGeCzvfSBvaZpw?p=preview\" rel=\"nofollow\">Plunker<\/a> here.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1420032178253,"favorite_count":null,"last_activity_date":1420032178253,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2819741.0,"parent_id":27689473,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":465,"id":27738390,"title":null,"body":"<p>Your first assertion is wrong: reading <code>leftMargin<\/code> from the layout parameters tells you the left margin of the view, not the X position on the screen. They will happen to be the same if the parent container is at the left edge of the screen (X of parent is 0) and it respects the left margin setting (not a given for custom layout containers).<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1420180930180,"favorite_count":null,"last_activity_date":1420180930180,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":535871.0,"parent_id":27738356,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":466,"id":27385083,"title":null,"body":"<p>This isn't too bad for the Install Execute stage:<\/p>\n\n<p><a href=\"http:\/\/www.advancedinstaller.com\/user-guide\/standard-actions.html\" rel=\"nofollow\">http:\/\/www.advancedinstaller.com\/user-guide\/standard-actions.html<\/a><\/p>\n\n<p>This:<\/p>\n\n<p><a href=\"http:\/\/blogs.technet.com\/b\/alexshev\/archive\/2008\/02\/21\/how-windows-installer-engine-installs-the-installation-package.aspx\" rel=\"nofollow\">http:\/\/blogs.technet.com\/b\/alexshev\/archive\/2008\/02\/21\/how-windows-installer-engine-installs-the-installation-package.aspx<\/a><\/p>\n\n<p>A typical order:\n<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa372038(v=vs.85).aspx\" rel=\"nofollow\">http:\/\/msdn.microsoft.com\/en-us\/library\/aa372038(v=vs.85).aspx<\/a><\/p>\n\n<p>but you could always get Orca from the Windows Kit and look at the install sequences in the MSI file to see what specific order they have in your MSI files.<\/p>\n\n<p>The big wrinkle is that the execute sequence has two phases that correspond to immediate ccustom actions (when nothing happens to the system) and deferred, when the changes actually happen. So to do something immediately before files are written to disk you'd have a deferred CA before InstallFiles.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418146150680,"favorite_count":null,"last_activity_date":1418146150680,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3261150.0,"parent_id":27382980,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":467,"id":27409112,"title":null,"body":"<p>You need to allocate memory for <code>WorkingDir<\/code> before you pass it in. You've told <code>IShellLinkW.GetWorkingDir<\/code> that you're allocating 250 chars of space for it to use, but not actually done so.<\/p>\n\n<pre><code>SetLength(WorkingDir, 250); \nOleCheck(SL.GetWorkingDir(WorkingDir, 250));\n<\/code><\/pre>\n\n<p>A better solution might be to actually populate the return buffer first, to remove the possibility of extra stuff after the end of the string. Prefill it with null (#0) characters first, and then <code>GetWorkingDir<\/code> will populate from the left side:<\/p>\n\n<pre><code>WorkingDir := StringOfChar(#0, 250);\nOleCheck(SL.GetWorkingDir(WorkingDir, 250);\nWorkingDir := Trim(WorkingDir); \n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418239117397,"favorite_count":null,"last_activity_date":1418242619957,"last_edit_date":1418242619957,"last_editor_display_name":null,"last_editor_user_id":62576.0,"owner_display_name":null,"owner_user_id":62576.0,"parent_id":27409027,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":468,"id":27442053,"title":null,"body":"<p>There is an open issue for this (not CentOS specific) <a href=\"https:\/\/code.google.com\/p\/dart\/issues\/detail?id=11880\" rel=\"nofollow noreferrer\">https:\/\/code.google.com\/p\/dart\/issues\/detail?id=11880<\/a>\nThe discussion contains some workarounds.<\/p>\n\n<p><a href=\"https:\/\/github.com\/sestegra\/patch-dartsdk-linux\" rel=\"nofollow noreferrer\">https:\/\/github.com\/sestegra\/patch-dartsdk-linux<\/a> contains a patch for the source.<\/p>\n\n<p><a href=\"https:\/\/askubuntu.com\/questions\/161284\">https:\/\/askubuntu.com\/questions\/161284<\/a> provides some generic background info.<br>\nSee also<br>\n- <a href=\"https:\/\/stackoverflow.com\/questions\/10863613\">How to upgrade glibc from version 2.13 to 2.15 on Debian?<\/a> (the workaround I used on Debian)<br>\n- <a href=\"http:\/\/japhr.blogspot.co.at\/2014\/09\/dart-content-shell-on-debian.html\" rel=\"nofollow noreferrer\">http:\/\/japhr.blogspot.co.at\/2014\/09\/dart-content-shell-on-debian.html<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418381570407,"favorite_count":null,"last_activity_date":1418381948930,"last_edit_date":1495535455627,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":217408.0,"parent_id":27442019,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":469,"id":27463415,"title":null,"body":"<p>I would multiply by 85 rather than 64 so that 00 is mapped to 0 while 11 is mapped to 255.<\/p>\n\n<pre><code>Color.FromArgb(255, 85 * ((color &gt;&gt; 4) &amp; 3), 85 * ((color &gt;&gt; 2) &amp; 3), 85 * (color &amp; 3))\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418503216337,"favorite_count":null,"last_activity_date":1418503216337,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3973077.0,"parent_id":27463261,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":470,"id":27481598,"title":null,"body":"<p>Why not just go to the documentation? You clearly haven't in this case.<\/p>\n\n<p>If you had you would have found the method...<\/p>\n\n<pre><code>- (MKCoordinateRegion)convertRect:(CGRect)rect\n toRegionFromView:(UIView *)view\n<\/code><\/pre>\n\n<p>Which is the one after the method in the linked question.<\/p>\n\n<p>So just reverse the process from the linked question using this method.<\/p>\n\n<p><a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/MapKit\/Reference\/MKMapView_Class\/index.html#\/\/apple_ref\/occ\/instm\/MKMapView\/convertRegion:toRectToView:\" rel=\"nofollow\">Documentation for MKMapView<\/a><\/p>\n\n<p>BTW, to find the documentation for any class just put the class name into Google. The first link (most of the time) will be a link to the Apple documentation.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418638059870,"favorite_count":null,"last_activity_date":1418638059870,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":421018.0,"parent_id":27481494,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":471,"id":27506391,"title":null,"body":"<p>You should use <a href=\"https:\/\/docs.angularjs.org\/api\/ng\/directive\/ngStyle\" rel=\"nofollow\">ng-style<\/a><\/p>\n\n<p>on your controller:<\/p>\n\n<pre><code>$scope.style = { 'height': (storage.totalStorage * 100 \/ model.maxStorageCapacity) + '%' }\n<\/code><\/pre>\n\n<p>and on your div:<\/p>\n\n<pre><code>&lt;div ng-style=\"style\"&gt;&lt;\/div&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418738504993,"favorite_count":null,"last_activity_date":1418738504993,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1814331.0,"parent_id":27506203,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":472,"id":27519330,"title":null,"body":"<p>ExecutorService runs jobs in parallel, but does not automatically make it safe to concurrently access shared state across threads. So, \"yes\" to both parts of your question.<\/p>\n\n<ol>\n<li>The problem is caused, in part, by the two runnables sharing the same <code>FinTrans<\/code> state object.<\/li>\n<li>The other part of the problem is the lack of any synchronization or otherwise atomic guarantees around accesses to that shared state.<\/li>\n<\/ol>\n\n<p>The executors are good for submitting tasks asynchronously and being able to check on their status (e.g. have they finished) via the returned <code>Future<\/code> instances.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418796526820,"favorite_count":null,"last_activity_date":1418796856420,"last_edit_date":1418796856420,"last_editor_display_name":null,"last_editor_user_id":2390644.0,"owner_display_name":null,"owner_user_id":2390644.0,"parent_id":27519301,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":473,"id":27547534,"title":null,"body":"<p>Your database character set has to support unicode characters in order to be able to store non-ascii characters. This setting is defined by the DBA when creating the database which means your DBA most likely needs to recreate the database from scratch. This is not an easy option if the database is already in use by developers or even worse if this database is in production. The organisations generally take it on as a project. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418908700483,"favorite_count":null,"last_activity_date":1418908700483,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4333536.0,"parent_id":27534386,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":474,"id":27548630,"title":null,"body":"<p>Try to remove <code>@RequestParam(\"issueId\") final Long issueId<\/code> from method signature, I don't see that you send it when adding comment, and you're not using it in the method.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418912233137,"favorite_count":null,"last_activity_date":1418912233137,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4074715.0,"parent_id":27548562,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":475,"id":27589021,"title":null,"body":"<p>You should use the <code>ItemsSource<\/code> and an enumerable and don't specify a <code>DisplayMemberPath<\/code>.<\/p>\n\n<pre><code>&lt;controls:SplitButton HorizontalContentAlignment=\"Left\"\n HorizontalAlignment=\"Center\"\n VerticalContentAlignment=\"Center\"\n Width=\"120\"\n VerticalAlignment=\"Top\"&gt;\n &lt;controls:SplitButton.ItemsSource&gt;\n &lt;x:Array Type=\"system:String\"&gt;\n &lt;system:String&gt;Label 1&lt;\/system:String&gt;\n &lt;system:String&gt;Another one&lt;\/system:String&gt;\n &lt;system:String&gt;Works now&lt;\/system:String&gt;\n &lt;\/x:Array&gt;\n &lt;\/controls:SplitButton.ItemsSource&gt;\n&lt;\/controls:SplitButton&gt;\n<\/code><\/pre>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/fi1nd.png\" alt=\"enter image description here\"><\/p>\n\n<p>Hope that works.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419162153323,"favorite_count":null,"last_activity_date":1419162153323,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":920384.0,"parent_id":27581531,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":476,"id":27598893,"title":null,"body":"<p>You can: <a href=\"https:\/\/tomcat.apache.org\/tomcat-7.0-doc\/api\/org\/apache\/catalina\/filters\/ExpiresFilter.html\" rel=\"nofollow\">click here<\/a><\/p>\n\n<p>But tomcat is a java servlet container, why you use it to serve static resources? You should use nginx for static sources.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419236189473,"favorite_count":null,"last_activity_date":1419480156187,"last_edit_date":1419480156187,"last_editor_display_name":null,"last_editor_user_id":2507968.0,"owner_display_name":null,"owner_user_id":2507968.0,"parent_id":27598827,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":477,"id":27614835,"title":null,"body":"<p>This should work, add a <code>'\\0'<\/code> to terminate c-style string, and move <code>if(strcmp(tstr,sstr)==0)<\/code> in the <code>if(lstr[i]==sstr[0])<\/code> statement(otherwise you will continuing increment c when <code>lstr[i] != sstr[0]<\/code>):<\/p>\n\n<pre><code>#include&lt;iostream&gt;\n#include&lt;cstring&gt;\nusing namespace std;\nint main()\n{\n int i, j, k, c=0;\n char lstr[30],sstr[10],tstr[10];\n cout&lt;&lt;\"Enter large string:\"&lt;&lt;endl;\n cin&gt;&gt;lstr;\n cout&lt;&lt;\"Enter small string:\"&lt;&lt;endl;\n cin&gt;&gt;sstr;\n for(i=0;i&lt;strlen(lstr);i++)\n {\n if(lstr[i]==sstr[0])\n {\n j=i;\n for(k=0;k&lt;strlen(sstr) &amp;&amp; j&lt;strlen(lstr);k++,j++)\n {\n tstr[k]=lstr[j];\n }\n tstr[k] = 0;\n \/\/ ^^^^^^^^^^^^\n if(strcmp(tstr,sstr)==0)\n c++;\n }\n }\n cout&lt;&lt;c;\n return 0;\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419313994720,"favorite_count":null,"last_activity_date":1419315614933,"last_edit_date":1419315614933,"last_editor_display_name":null,"last_editor_user_id":1109339.0,"owner_display_name":null,"owner_user_id":1109339.0,"parent_id":27614742,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":478,"id":27625076,"title":null,"body":"<p>The <code>&lt;h:commandXxx&gt;<\/code> components submit the parent form via a POST request. Any request scoped backing beans referenced in the whole page will be reinitialized during restore view phase. And, when using Mojarra version older than 2.1.18, <a href=\"https:\/\/stackoverflow.com\/questions\/3342984\/jstl-in-jsf2-facelets-makes-sense\">due to a chicken-egg bug, any view scoped beans referenced in view build time tags\/attributes<\/a> will also be reinitialized during restore view phase.<\/p>\n<p>This is thus fully expected behavior.<\/p>\n<p>The concrete problem here is that those buttons are basically being abused for plain page-to-page navigation. You don't want to perform a postback at all. You merely want to navigate to a different page. For that, you should be using <code>&lt;h:button&gt;<\/code> instead. This basically acts like a GET link. Additional bonus, the URL in browser's address bar will be reflected to the right URL.<\/p>\n<pre><code>&lt;h:button value=&quot;Show batch&quot; outcome=&quot;\/BatchDetail.xhtml&quot; \/&gt;\n&lt;h:button value=&quot;Show messages&quot; outcome=&quot;\/BatchMessage.xhtml&quot; \/&gt;\n&lt;h:button value=&quot;Show both&quot; outcome=&quot;\/BatchAndBatchMessage.xhtml&quot; rendered=&quot;#{batchMessageDetailBean.batch.part}&quot; \/&gt;\n<\/code><\/pre>\n<p>Note that I took the opportunity to improve the conditional rendering by just using the <code>rendered<\/code> attribute instead of a view build time tag, which not only solves the problem in case you're using Mojarra version older than 2.1.18, but also contributes positively as to &quot;using the right tool for the job&quot;.<\/p>\n<h3>See also:<\/h3>\n<ul>\n<li><a href=\"https:\/\/stackoverflow.com\/questions\/13070537\/difference-between-hbutton-and-hcommandbutton\">Difference between h:button and h:commandButton<\/a><\/li>\n<li><a href=\"https:\/\/stackoverflow.com\/questions\/15521451\/how-to-make-url-reflect-the-current-page-and-not-the-previous-one\/15523045#15523045\">How to navigate in JSF? How to make URL reflect current page (and not previous one)<\/a><\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419355096863,"favorite_count":null,"last_activity_date":1419355096863,"last_edit_date":1592644375060,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":157882.0,"parent_id":27624623,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":479,"id":27641542,"title":null,"body":"<p>Once you've created the DB, you can't simply add new models. <\/p>\n\n<p>In order to update your schema, you'll have to use south (for migrations in Django &lt;= 1.6), or use the built-in migrations in Django 1.7<\/p>\n\n<p>Since you're using Django 1.6, you should read about it in <a href=\"http:\/\/south.readthedocs.org\/en\/latest\/tutorial\/part1.html\" rel=\"nofollow\">http:\/\/south.readthedocs.org\/en\/latest\/tutorial\/part1.html<\/a> and then use the package to migrate your schema.<\/p>\n\n<p>Just follow the tutorial and ask on Stack Overflow if further questions rise, it shouldn't be too complicated<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419450116783,"favorite_count":null,"last_activity_date":1419450450373,"last_edit_date":1419450450373,"last_editor_display_name":null,"last_editor_user_id":2773696.0,"owner_display_name":null,"owner_user_id":2773696.0,"parent_id":27641515,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":480,"id":27688163,"title":null,"body":"<p>Just add a submenu:<\/p>\n\n<pre><code>&lt;menu xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\" &gt;\n&lt;item\n android:id=\"@+id\/overflow\"\n android:orderInCategory=\"100\"\n android:icon=\"@drawable\/ic_action_overflow\"\n android:title=\"@string\/overflow\"\n android:showAsAction=\"always\"&gt;\n &lt;menu&gt;\n &lt;item\n android:id=\"@+id\/action_fill\"\n android:title=\"@string\/menu_auto_fill\" \/&gt;\n &lt;item\n android:id=\"@+id\/action_delete_all\"\n android:title=\"@string\/menu_remove_all\" \/&gt;\n &lt;\/menu&gt;\n\n&lt;item\n android:id=\"@+id\/action_next\"\n android:orderInCategory=\"101\"\n android:icon=\"@drawable\/ic_action_next_item\"\n android:title=\"@string\/menu_continue\" \n android:showAsAction=\"always\" \/&gt;\n&lt;\/menu&gt;\n<\/code><\/pre>\n\n<p>Note that this requires you to define the overflow item, with his own icon and so on. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419853205623,"favorite_count":null,"last_activity_date":1419853205623,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4288782.0,"parent_id":27688040,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":481,"id":27702926,"title":null,"body":"<p><strong><kbd><a href=\"http:\/\/jsfiddle.net\/wmtrLzbf\/\" rel=\"nofollow\">updated jsFiddle<\/a><\/kbd><\/strong><\/p>\n\n<p>Angular has an already defined behavior for handling radio inputs. You don't have to use any <code>radioChecked<\/code> function, just use combination of <code>ng-model<\/code> and <code>value<\/code> on your <code>input<\/code>s :<\/p>\n\n<pre><code>&lt;input type=\"radio\"\n ng-model=\"hasTeam\"\n value=\"true\"\/&gt; - Yes\n\n&lt;input type=\"radio\"\n ng-model=\"hasTeam\"\n value=\"false\"\/&gt; - No\n\n&lt;span ng-if=\"hasTeam\"&gt;\n I'm showing only if yes is selected.\n&lt;\/span&gt;\n<\/code><\/pre>\n\n<p>Maybe you should <a href=\"https:\/\/docs.angularjs.org\/api\/ng\/input\/input%5Bradio%5D\" rel=\"nofollow\">read the docs here<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419932315470,"favorite_count":null,"last_activity_date":1419932315470,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1845964.0,"parent_id":27702522,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":482,"id":27749882,"title":null,"body":"<p>One of the key defining properties of a <code>np.matrix<\/code> is that it will remain as a two-dimensional object through common transformations. (After all, that's almost the definition of a matrix.)<\/p>\n\n<p><code>np.random.rand<\/code> returns an <code>np.ndarray<\/code>, which does not share this property. (I like to think of an ndarray as very similar to a C array, in that you can change the 'dimensions' all you like, and so long as you're still looking at the same region of memory, and not overstepping bounds, all will be well.)<\/p>\n\n<p>If you want the matrix to behave as an array, you can <a href=\"https:\/\/stackoverflow.com\/questions\/3337301\/numpy-matrix-to-array\">convert it to one<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1420240735567,"favorite_count":null,"last_activity_date":1420240735567,"last_edit_date":1495541153673,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":1103045.0,"parent_id":27749827,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":483,"id":27753080,"title":null,"body":"<p>The allow_delete option is a children of you form field.<\/p>\n\n<pre><code>{% for widget in form.YOURFIELD.children %}\n {% if widget.get('allow_delete') %}\n \/\/Do your stuff\n {% endif %}\n{% endfor %}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1420273935253,"favorite_count":null,"last_activity_date":1420273935253,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3884935.0,"parent_id":27748097,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":484,"id":27870524,"title":null,"body":"<p><a href=\"http:\/\/gnuradio.org\" rel=\"nofollow\">GNU Radio<\/a> is a stream-oriented signal processing framework which comes with a large library of signal processing algorithms, most of the time encapsulated in blocks.<\/p>\n\n<p>Of course, we do a lot of unit testing, and we frequently find bugs, regressions or corner cases based on those, so this is crucial to the GNU Radio development process. I'm not absolutely convinced I'd call our approach TDD, but I don't think this is the point here.<\/p>\n\n<p>The point is that <em>of course<\/em> signal processing can be unit-tested. Why shouldn't it? You specify inputs, and there's expected output, especially if you're encapsulating your steps in signal processing blocks. Now, whilst this is not as easy as your first-lesson unit test of the kind <code>assert(square(2)==4)<\/code>, as a developer of a signal processing algorithm you have to be so well-aware of what you're supposed to do, and how you can mathematically verify it, that usually test cases can be written.<\/p>\n\n<p>Now, I can understand your point of \"my test case gets so complex, it might have bugs of its own\", but that is just an indication that you have not yet structured your problem to subproblems that are small enough. As you've noticed, I like to cite GNU Radio, so let's do it again: A good test-driven development process will try to yield as many reusable, well-tested modules as possible. <em>Well-tested<\/em> implies that their behaviour is so well-specified that you can test it. GNU Radio does this in the form of simple blocks like \"multiply\", or more complex one like \"schmidl&amp;cox OFDM sync\". You start of with verifying your simpler ones, and then verify the complete system, in that case \"do the info bits that I feed into my OFDM modulator come out of my OFDM modulator\". This works in signal processing as well as in any other genre -- it just demands a high level of understanding, which often is something that people with a pure computer science background have to acquire in the process of writing signal processing software (signal processing people, on the other hand, often struggle with finding good solutions to problems well-known and readily-solved to CS experts); I always hope this fact encourages people to write better tests (and read more books, too ;) ).<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1420843677107,"favorite_count":null,"last_activity_date":1420843677107,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4433386.0,"parent_id":27723062,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":485,"id":27451690,"title":null,"body":"<p>Consider a triangle like this:<\/p>\n\n<pre><code> 1\n 2 3\n99 4 5\n<\/code><\/pre>\n\n<p>Your algorithm will \"greedily\" follow the largest number it sees and end up finding <code>1+3+5<\/code>. Clearly this is not the biggest sum, as it ignores the obvious <code>99<\/code> in the triangle!<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418416465893,"favorite_count":null,"last_activity_date":1418416465893,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":257418.0,"parent_id":27451582,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":486,"id":27468278,"title":null,"body":"<p>Your type used to be <code>Copy<\/code>, but <a href=\"https:\/\/github.com\/rust-lang\/rust\/pull\/17864\" rel=\"nofollow\">this trait is now opt-in<\/a>.<\/p>\n\n<p>Add <code>#[deriving(Clone, Copy)]<\/code> (or add <code>Clone<\/code> and <code>Copy<\/code> to the list of traits in an existing <code>#[deriving]<\/code> attribute) to your type. You need to implement both <code>Clone<\/code> and <code>Copy<\/code>, because <a href=\"http:\/\/doc.rust-lang.org\/stable\/std\/marker\/trait.Copy.html\" rel=\"nofollow\"><code>Copy<\/code> is a subtrait of <code>Clone<\/code><\/a> (as any type that implements <code>Copy<\/code> can also trivially implement <code>Clone<\/code>).<\/p>\n\n<pre class=\"lang-rust prettyprint-override\"><code>pub trait Copy: Clone { }\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418551937240,"favorite_count":null,"last_activity_date":1443983980703,"last_edit_date":1443983980703,"last_editor_display_name":null,"last_editor_user_id":234590.0,"owner_display_name":null,"owner_user_id":234590.0,"parent_id":27468243,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":487,"id":27511081,"title":null,"body":"<p>After Googling it again, I found that it is not possible, It is not possible. this quote from Google helps the website.<\/p>\n<p>&quot;No. You can't add a bank account that's not based in your country. Please enter the bank account that matches your Payee profile address. Please also make sure that the country code in your SWIFT code matches the country code in your AdSense account. For example, if your SWIFT code is \u201cKZKOKZKXXXX\u201d, \u201cKZKO\u201d is the code for the name of the bank, \u201cKZ\u201d is the country code and \u201cKXXXX\u201d is the code for the branch.\nMy bank account number has hyphens. Should I enter the hyphens when giving my bank account information?\nDo I need to enter the intermediary bank information?\n&quot;<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418753147737,"favorite_count":null,"last_activity_date":1593435060613,"last_edit_date":1593435060613,"last_editor_display_name":null,"last_editor_user_id":2283653.0,"owner_display_name":null,"owner_user_id":2283653.0,"parent_id":27395328,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":488,"id":27530406,"title":null,"body":"<p>Instead, find all headers using <a href=\"http:\/\/angular.github.io\/protractor\/#\/api?view=ElementArrayFinder\" rel=\"nofollow\"><code>element.all()<\/code><\/a> and use <a href=\"http:\/\/angular.github.io\/protractor\/#\/api?view=ElementArrayFinder.prototype.map\" rel=\"nofollow\"><code>map()<\/code><\/a> to assert the list in one go:<\/p>\n\n<pre><code>var headers = element.all(by.css('table.table th a')).map(function(elm) {\n return elm.getText();\n});\n\nexpect(headers).toEqual([\n \"Patient Id\",\n \"Account Number\",\n \"Title\",\n \"First Name\",\n \"Last Name\",\n \"Middle Name\",\n \"Sex\",\n \"Dob\"\n]);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418834236437,"favorite_count":null,"last_activity_date":1418834236437,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":771848.0,"parent_id":27519926,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":489,"id":27560500,"title":null,"body":"<p>There is such a list available here:\n<a href=\"http:\/\/forums.cgsociety.org\/showpost.php?p=4943422&amp;postcount=20\" rel=\"nofollow\">http:\/\/forums.cgsociety.org\/showpost.php?p=4943422&amp;postcount=20<\/a><\/p>\n\n<p>It has almost 8000 keywords.<\/p>\n\n<p>You can also make such a list with maxscript:<\/p>\n\n<pre><code>(\nfn GatherMaxscriptKeyword =\n (\n out_script=newscript()\n n_stream=stringstream \"\"\n --\/\/--\n afilter_black=#()\n afilter_blue1=#()\n afilter_blue2=#()\n afilter_Brown=#()\n afilter_Green=#()\n afilter_Gold=#()\n afilter_Red=#()\n afilter_Italic=#()\n --\/\/--\n apropos \"\" to:n_stream\n seek n_stream 0\n --\/\/--\n while not eof n_stream do\n (\n mtrim=(dotnetobject \"system.string\" (readLine n_stream)).Split \"(\" \n --\/\/--\n if mtrim.count &gt; 1 then\n (\n xtype=(dotnetobject \"system.string\" mtrim[2]).split \")\"\n --\/\/--\n if xtype.count &gt; 1 then\n (--redirect to the wanted array there ...\n appendvalstr=((dotnetobject \"system.string\" mtrim[1]).Split \" \")[1]\n --\/\/--\n case xtype[1] of\n (\n \"&lt;internal&gt;\":(appendifunique afilter_black appendvalstr)\n \"Array\":(appendifunique afilter_black appendvalstr)\n \"BooleanClass\":(appendifunique afilter_black appendvalstr)\n \"Float\":(appendifunique afilter_black appendvalstr)\n \"Integer\":(appendifunique afilter_black appendvalstr)\n \"MAXScriptFunction\":(appendifunique afilter_black appendvalstr)\n \"MSCustAttribDef\":(appendifunique afilter_black appendvalstr)\n \"MSPluginClass\":(appendifunique afilter_black appendvalstr)\n \"Point2\":(appendifunique afilter_black appendvalstr)\n \"Primitive\":(appendifunique afilter_blue1 appendvalstr)\n \"RCMenu\":(appendifunique afilter_black appendvalstr)\n \"RolloutClass\":(appendifunique afilter_black appendvalstr)\n \"StandardMaterialClass\":(appendifunique afilter_black appendvalstr)\n \"String\":(appendifunique afilter_black appendvalstr)\n \"StructDef\":(appendifunique afilter_Brown appendvalstr)\n \"TextureClass\":(appendifunique afilter_black appendvalstr)\n \"UndefinedClass\":(appendifunique afilter_black appendvalstr)\n \"const BipedGeneric\":(appendifunique afilter_blue1 appendvalstr)\n \"const BooleanClass\":(appendifunique afilter_Italic appendvalstr)\n \"const Class\":(appendifunique afilter_blue2 appendvalstr)\n \"const Color\":(appendifunique afilter_Italic appendvalstr)\n \"const CurveCtlGeneric\":(appendifunique afilter_blue1 appendvalstr)\n \"const EmptyClass\":(appendifunique afilter_Italic appendvalstr)\n \"const Float\":(appendifunique afilter_Italic appendvalstr)\n \"const Generic\":(appendifunique afilter_blue1 appendvalstr)\n \"const HKey\":(appendifunique afilter_Italic appendvalstr)\n \"const Interface\":(appendifunique afilter_Green appendvalstr)\n \"const MAXClass\":(appendifunique afilter_blue2 appendvalstr)\n \"const MAXMeshClass\":(appendifunique afilter_blue1 appendvalstr)\n \"const MAXScriptFunction\":()--empty\n \"const MAXSuperClass\":(appendifunique afilter_blue2 appendvalstr)\n \"const MappedGeneric\":(appendifunique afilter_blue1 appendvalstr)\n \"const MappedPrimitive\":(appendifunique afilter_blue1 appendvalstr)\n \"const MeditMaterialsClass\":(appendifunique afilter_Italic appendvalstr)\n \"const NodeGeneric\":(appendifunique afilter_blue1 appendvalstr)\n \"const ObjectSet\":(appendifunique afilter_Gold appendvalstr)\n \"const OkClass\":(appendifunique afilter_Italic appendvalstr)\n \"const Point3\":(appendifunique afilter_Italic appendvalstr)\n \"const Primitive\":(appendifunique afilter_blue1 appendvalstr)\n \"const Primitive\":()--empty\n \"const SelectionSetArray\":(appendifunique afilter_Italic appendvalstr)\n \"const StructDef\":(appendifunique afilter_Brown appendvalstr)\n \"const UndefinedClass\":(appendifunique afilter_Italic appendvalstr)\n \"const UnsuppliedClass\":(appendifunique afilter_Italic appendvalstr)\n \"dotNetObject\":(appendifunique afilter_black appendvalstr)\n \"persistent UndefinedClass\":(appendifunique afilter_black appendvalstr)\n \"system Array\":(appendifunique afilter_Red appendvalstr)\n \"system BooleanClass\":(appendifunique afilter_Red appendvalstr)\n \"system Color\":(appendifunique afilter_Red appendvalstr)\n \"system Control\":(appendifunique afilter_Red appendvalstr)\n \"system Float\":(appendifunique afilter_Red appendvalstr)\n \"system Integer\":(appendifunique afilter_Red appendvalstr)\n \"system Integer64\":(appendifunique afilter_Red appendvalstr)\n \"system Interval\":(appendifunique afilter_Red appendvalstr)\n \"system MAXRootNode\":(appendifunique afilter_Red appendvalstr)\n \"system MAXTVNode\":(appendifunique afilter_Red appendvalstr)\n \"system MaterialLibrary\":(appendifunique afilter_Red appendvalstr)\n \"system Name\":(appendifunique afilter_Red appendvalstr)\n \"system String\":(appendifunique afilter_Red appendvalstr)\n \"system Time\":(appendifunique afilter_Red appendvalstr)\n \"system UndefinedClass\":(appendifunique afilter_Red appendvalstr)\n \"system WindowStream\":(appendifunique afilter_Red appendvalstr)\n default:(messagebox \"New Class found, Please update the main function.\" title:\"Warning\" beep:false)\n --default:(format(xtype[1]+\"\\n\")to:out_script)\n )\n\n )\n\n )\n\n )\n --\/\/--Black keyword\n sort afilter_black\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n format (\"Black\"+\"\\n\") to:out_script\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n --\/\/--\n for f in afilter_black do\n (\n evalstr=(dotnetobject \"system.string\" f).Split (\"\\\"\"+\"&amp;\"+\"%\")\n --\/\/--\n if evalstr.count == 1 then\n (\n format (evalstr[1]+\"\\n\") to:out_script\n )\n --\/\/--\n )\n --\/\/--blue1 keyword\n sort afilter_blue1\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n format (\"Blue1\"+\"\\n\") to:out_script\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n --\/\/--\n for f in afilter_blue1 do\n (\n evalstr=(dotnetobject \"system.string\" f).Split (\"\\\"\"+\"&amp;\"+\"%\")\n --\/\/--\n if evalstr.count == 1 then\n (\n format (evalstr[1]+\"\\n\") to:out_script\n )\n --\/\/--\n )\n --\/\/--blue2 keyword\n sort afilter_blue2\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n format (\"Blue2\"+\"\\n\") to:out_script\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n --\/\/--\n for f in afilter_blue2 do\n (\n evalstr=(dotnetobject \"system.string\" f).Split (\"\\\"\"+\"&amp;\"+\"%\")\n --\/\/--\n if evalstr.count == 1 then\n (\n format (evalstr[1]+\"\\n\") to:out_script\n )\n --\/\/--\n )\n --\/\/--Brown keyword\n sort afilter_Brown\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n format (\"Brown\"+\"\\n\") to:out_script\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n --\/\/--\n for f in afilter_Brown do\n (\n evalstr=(dotnetobject \"system.string\" f).Split (\"\\\"\"+\"&amp;\"+\"%\")\n --\/\/--\n if evalstr.count == 1 then\n (\n format (evalstr[1]+\"\\n\") to:out_script\n )\n --\/\/--\n )\n --\/\/--Green keyword\n sort afilter_Green\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n format (\"Green\"+\"\\n\") to:out_script\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n --\/\/--\n for f in afilter_Green do\n (\n evalstr=(dotnetobject \"system.string\" f).Split (\"\\\"\"+\"&amp;\"+\"%\")\n --\/\/--\n if evalstr.count == 1 then\n (\n format (evalstr[1]+\"\\n\") to:out_script\n )\n --\/\/--\n )\n --\/\/--Gold keyword\n sort afilter_Gold\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n format (\"Gold\"+\"\\n\") to:out_script\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n --\/\/--\n for f in afilter_Gold do\n (\n evalstr=(dotnetobject \"system.string\" f).Split (\"\\\"\"+\"&amp;\"+\"%\")\n --\/\/--\n if evalstr.count == 1 then\n (\n format (evalstr[1]+\"\\n\") to:out_script\n )\n --\/\/--\n )\n --\/\/--Red keyword\n sort afilter_Red\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n format (\"Red\"+\"\\n\") to:out_script\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n --\/\/--\n for f in afilter_Red do\n (\n evalstr=(dotnetobject \"system.string\" f).Split (\"\\\"\"+\"&amp;\"+\"%\")\n --\/\/--\n if evalstr.count == 1 then\n (\n format (evalstr[1]+\"\\n\") to:out_script\n )\n --\/\/--\n )\n --\/\/--Italic keyword\n sort afilter_Italic\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n format (\"Italic\"+\"\\n\") to:out_script\n format (\"-------------------------------------------------------------\"+\"\\n\") to:out_script\n --\/\/--\n for f in afilter_Italic do\n (\n evalstr=(dotnetobject \"system.string\" f).Split (\"\\\"\"+\"&amp;\"+\"%\")\n --\/\/--\n if evalstr.count == 1 then\n (\n format (evalstr[1]+\"\\n\") to:out_script\n )\n --\/\/--\n )\n\n )\n--\/\/--\nGatherMaxscriptKeyword()\nok\n)\n<\/code><\/pre>\n\n<p>If you have new classes that are not included in the script yet\nit will show a messagebox.\nThe new classes needs to be added to the script if you want the keywords from them.\nTo avoid showing the messagebox you can comment out that line, or just hold in esc to close them.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418968719153,"favorite_count":null,"last_activity_date":1418968719153,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":485626.0,"parent_id":27556396,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":490,"id":27660314,"title":null,"body":"<p>Laravel-Excel runs off of PHPExcel, and you can run native PHPExcel methods on the objects exposed by Laravel-Excel.<\/p>\n\n<p>From the docs, to get the cell: <a href=\"http:\/\/www.maatwebsite.nl\/laravel-excel\/docs\/export#cells\" rel=\"nofollow noreferrer\">http:\/\/www.maatwebsite.nl\/laravel-excel\/docs\/export#cells<\/a><\/p>\n\n<pre><code>\\Excel::create('Document', function($excel) {\n $excel-&gt;sheet('Sheet', function($sheet) {\n $sheet-&gt;cell('A2', function($cell) {\n $cell-&gt;setValue('this is the cell value.');\n });\n });\n})-&gt;download('xls');\n<\/code><\/pre>\n\n<p>And, here is a screenshot of the $cell instance showing what else can be called on it:<\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/ISxlI.png\" alt=\"Kint dump of the $cell instance\"><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419616739827,"favorite_count":null,"last_activity_date":1419616739827,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":686198.0,"parent_id":27659170,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":491,"id":27675655,"title":null,"body":"<p>The problem is that your last lines encodes <code>void<\/code>. The .add function of a list returns void. Here's an updated version:<\/p>\n\n\n\n<pre class=\"lang-dart prettyprint-override\"><code>final String STORAGE_KEY = 'darttasks';\nList tasks = [];\nif(window.localStorage.containsKey(STORAGE_KEY)) {\n tasks = JSON.decode(window.localStorage[STORAGE_KEY]);\n\n \/\/ Decoding Error, should not happen\n if(tasks == null) {\n tasks = [];\n }\n}\n\nvar task = {\n \"summary\": sum,\n \"content\": con,\n \"scheduled\": sched,\n \"id\": timestamp\n};\ntasks.add(task);\nwindow.localStorage[STORAGE_KEY] = JSON.encode(tasks);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419763469193,"favorite_count":null,"last_activity_date":1420028971347,"last_edit_date":1420028971347,"last_editor_display_name":null,"last_editor_user_id":217408.0,"owner_display_name":null,"owner_user_id":2515341.0,"parent_id":27675481,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":492,"id":27697464,"title":null,"body":"<p>You need to apply it on <code>:after<\/code> :pseudo-element and change <code>#fff<\/code> to <code>transparent<\/code>.<\/p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>body {\n background-image: url(\"http:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/10\/20090529_Great_Wall_8185.jpg\");\n}\ndiv {\n position: relative;\n background-color: #ec173a;\n width: 200px;\n height: 200px;\n}\ndiv:after {\n content: '';\n position: absolute;\n background: linear-gradient(45deg, #ec173a 5px, transparent 0) 0 5px, linear-gradient(135deg, #ec173a 5px, transparent 0) 0 5px;\n background-position: right top;\n background-repeat: repeat-y;\n background-size: 10px 10px;\n width: 10px;\n height: 100%;\n right: -10px;\n}<\/code><\/pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;div&gt;test&lt;\/div&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419895342853,"favorite_count":null,"last_activity_date":1419896681170,"last_edit_date":1419896681170,"last_editor_display_name":null,"last_editor_user_id":3905567.0,"owner_display_name":null,"owner_user_id":3905567.0,"parent_id":27697410,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":493,"id":27798407,"title":null,"body":"<p>All works. I am able to get a white pixel on the image.<\/p>\n\n<pre><code>import javax.imageio.ImageIO;\nimport java.awt.image.BufferedImage;\nimport java.io.IOException;\nimport java.awt.Color;\nimport java.io.File;\n\npublic class MakeImage\n{\n public static void main(String[] args)\n { \n BufferedImage im = new BufferedImage(100, 100, BufferedImage.TYPE_BYTE_BINARY);\n im.setRGB(10, 10, Color.WHITE.getRGB());\n\n try\n {\n ImageIO.write(im, \"png\", new File(\"image.png\"));\n }\n catch (IOException e)\n {\n System.out.println(\"Some exception occured \" + e);\n }\n }\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1420546239067,"favorite_count":null,"last_activity_date":1420546239067,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1737819.0,"parent_id":27633299,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":494,"id":27407729,"title":null,"body":"<p>You can solve it by these steps:<\/p>\n\n<ul>\n<li>Set the image as a pattern<\/li>\n<li>Set the pattern as <code>fillStyle<\/code> or <code>strokeStyle<\/code><\/li>\n<\/ul>\n\n<p>When you now fill\/stroke your shapes the image will be revealed. Just make sure the initial image fits the area you want to reveal.<\/p>\n\n<p>Example showing the principle, you should be able to adopt this to your needs:<\/p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>var ctx = canvas.getContext(\"2d\"),\n img = new Image,\n radius = 40;\n\nimg.onload = setup;\nimg.src = \"http:\/\/i.imgur.com\/bnAEEXq.jpg\";\n\nfunction setup() {\n \n \/\/ set image as pattern for fillStyle\n ctx.fillStyle = ctx.createPattern(this, \"no-repeat\");\n \n \/\/ for demo only, reveals image while mousing over canvas\n canvas.onmousemove = function(e) {\n var r = this.getBoundingClientRect(),\n x = e.clientX - r.left,\n y = e.clientY - r.top;\n \n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n ctx.arc(x, y, radius, 0, 2*Math.PI);\n ctx.fill();\n };\n}<\/code><\/pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;canvas id=canvas width=900 height=600&gt;&lt;\/canvas&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n<\/p>\n\n<p>Hope this helps!<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418234213393,"favorite_count":null,"last_activity_date":1418234585183,"last_edit_date":1418234585183,"last_editor_display_name":"user1693593","last_editor_user_id":null,"owner_display_name":"user1693593","owner_user_id":null,"parent_id":27407710,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":495,"id":27409068,"title":null,"body":"<p>Most RDF libraries will have something to facilitate this. For example, if you parse your RDF data using <a href=\"http:\/\/rdf4j.org\/\" rel=\"nofollow noreferrer\">Eclipse RDF4J<\/a>'s <a href=\"http:\/\/docs.rdf4j.org\/programming\/#_parsing_and_writing_rdf_with_rio\" rel=\"nofollow noreferrer\">Rio parser<\/a>, you will get back each line as a <code>org.eclipse.rdf4j.model.Statement<\/code>, with a subject, predicate and object value. The subject in both your lines will be an <code>org.eclipse.rdf4j.model.IRI<\/code>, which has a <code>getLocalName()<\/code> method you can use to get the part behind the last #. See the <a href=\"http:\/\/docs.rdf4j.org\/javadoc\/latest\/\" rel=\"nofollow noreferrer\">Javadocs<\/a> for more details. <\/p>\n\n<p>Assuming your data is in N-Triples syntax (which it seems to be given the example you showed us), here's a simple bit of code that does this and prints it out to STDOUT:<\/p>\n\n<pre><code> \/\/ parse the file into a Model object\n InputStream in = new FileInputStream(new File(\"\/path\/to\/rdf-data.nt\"));\n org.eclipse.rdf4j.model.Model model = Rio.parse(in, RDFFormat.NTRIPLES);\n\n for (org.eclipse.rdf4j.model.Statement st: model) {\n org.eclipse.rdf4j.model.Resource subject = st.getSubject();\n if (subject instanceof org.eclipse.rdf4j.model.IRI) {\n System.out.print(((IRI)subject).getLocalName());\n }\n else {\n System.out.print(subject.stringValue());\n }\n \/\/ ... etc for predicate and object (the 2nd and 3rd elements in each RDF statement)\n }\n<\/code><\/pre>\n\n<p><em>Update<\/em> if you don't want to read data from a file but simply use a <code>String<\/code>, you could just use a <code>java.io.StringReader<\/code> instead of an <code>InputStream<\/code>:<\/p>\n\n<pre><code> StringReader r = new StringReader(\"&lt;http:\/\/www.test.com\/meta#0001&gt; &lt;http:\/\/www.w3.org\/1999\/02\/22-rdf-syntax-ns#type&gt; &lt;http:\/\/www.w3.org\/2002\/07\/owl#Class&gt; .\");\n org.eclipse.rdf4j.model.Model model = Rio.parse(r, RDFFormat.NTRIPLES);\n<\/code><\/pre>\n\n<p>Alternatively, if you don't want to parse the data at all and just want to do String processing, there is a <a href=\"http:\/\/docs.rdf4j.org\/javadoc\/latest\/index.html?org\/eclipse\/rdf4j\/model\/util\/URIUtil.html\" rel=\"nofollow noreferrer\">org.eclipse.rdf4j.model,URIUtil<\/a> class which you can just feed a string and it can give you back the index of the local name part:<\/p>\n\n<pre><code> String uri = \"http:\/\/www.test.com\/meta#0001\";\n String localpart = uri.substring(URIUtil.getLocalNameIndex(uri)); \/\/ will be \"0001\" \n<\/code><\/pre>\n\n<p>(disclosure: I am on the RDF4J development team)<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418238955733,"favorite_count":null,"last_activity_date":1511307778630,"last_edit_date":1511307778630,"last_editor_display_name":null,"last_editor_user_id":451941.0,"owner_display_name":null,"owner_user_id":451941.0,"parent_id":27408739,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":496,"id":27390762,"title":null,"body":"<p>You can use the \"links\" argument:<\/p>\n\n<pre><code>grid = SQLFORM.grid(query, fields=[db.table1.total, db.table2.count],\n links=[dict(header='Total - Count',\n body=lambda r: r.table1.total - r.table2.count)])\n<\/code><\/pre>\n\n<p>By default, all \"links\" columns appear on the right. You can change that by setting the \"links_placement\" argument to either \"left\" or \"both\".<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418167457920,"favorite_count":null,"last_activity_date":1418167457920,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":440323.0,"parent_id":27389578,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":497,"id":27424053,"title":null,"body":"<p>Getting datas from google docs is becoming harder ;-(<\/p>\n\n<p>I've tried with jquery.ajax but I met the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Cross-origin_resource_sharing\" rel=\"noreferrer\">CORS<\/a> limitation.<\/p>\n\n<p>Then I found <a href=\"https:\/\/github.com\/jsoma\/tabletop\" rel=\"noreferrer\">tabletop<\/a> and <strong>it works<\/strong> !<\/p>\n\n<ul>\n<li>go to your google spreadsheet and <code>File &gt; Publish to the web &gt; Start publishing<\/code><\/li>\n<li>note the publish url<\/li>\n<li>download <a href=\"https:\/\/raw.githubusercontent.com\/jsoma\/tabletop\/master\/src\/tabletop.js\" rel=\"noreferrer\">tabletop script<\/a> and save it to eg: js\/tabletop.js<\/li>\n<li><p>put a link at the bottom of your <code>_includes\/header.html<\/code> eg<\/p>\n\n<pre><code>&lt;script src=\"`{{ site.baseurl }}`\/js\/tabletop.js\"&gt;&lt;\/script&gt;\n<\/code><\/pre><\/li>\n<li><p>in a <code>data.html<\/code> page put<\/p>\n\n<pre><code>---\ntitle: csv to json\nlayout: page\n---\n&lt;div id=\"csvDatas\"&gt;&lt;\/div&gt;\n<\/code><\/pre><\/li>\n<li><p>you can now get your datas with a <code>js\/script.js<\/code> file that you've also included at the very end of you <code>_includes\/footer.html<\/code><\/p>\n\n<pre><code>var csvParse = function() {\n\n \/\/ put you document url here\n var sharedDocUrl = 'https:\/\/docs.google.com\/spreadsheets\/d\/1Rk9RMD6mcH-jPA321lFTKmZsHebIkeHx0tTU0TWQYE8\/pubhtml'\n\n \/\/ can also be only the ID\n \/\/ var sharedDocUrl = '1Rk9RMD6mcH-jPA321lFTKmZsHebIkeHx0tTU0TWQYE8'\n\n var targetDiv = 'csvDatas';\n\n \/\/ holds datas at a closure level\n \/\/ this then can be accessed by closure's functions\n var dataObj;\n\n function showInfo(data, tabletop) {\n dataObj = data;\n var table = generateTable();\n var target = document.getElementById(targetDiv);\n target.appendChild(table);\n }\n\n function generateTable(){\n var table = document.createElement(\"table\");\n var head = generateTableHeader();\n table.appendChild(head);\n var body = generateTableBody();\n table.appendChild(body);\n return table;\n }\n\n function generateTableHeader(){\n var d = dataObj[0];\n var tHead = document.createElement(\"thead\");\n var colHeader = [];\n $.each(d, function( index, value){\n console.log(index + ' : ' + value);\n colHeader.push(index);\n });\n var row = generateRow(colHeader, 'th');\n tHead.appendChild(row);\n return tHead;\n }\n\n \/\/ this can be factorized with generateTableHeader\n function generateTableBody(){\n var tBody = document.createElement(\"tbody\");\n $.each(dataObj, function( index, value ){\n var rowVals = [];\n $.each(value, function(colnum, colval){\n rowVals.push(colval);\n });\n var row = generateRow(rowVals);\n tBody.appendChild(row);\n });\n return tBody;\n }\n\n function generateRow(headersArray, cellTag){\n cellTag = typeof cellTag !== 'undefined' ? cellTag : 'td';\n var row = document.createElement(\"tr\");\n $.each(headersArray, function( index, value){\n if( value != \"rowNumber\"){\n var cell = document.createElement(cellTag);\n var cellText = document.createTextNode(value);\n cell.appendChild(cellText);\n row.appendChild(cell);\n }\n });\n return row;\n }\n\n return {\n init: function() {\n\n if( $('#' + targetDiv).length ){\n Tabletop.init( { key: sharedDocUrl ,\n callback: showInfo,\n simpleSheet: true } );\n }else{\n console.log('Not the good page to parse csv datas');\n }\n }\n };\n}();\n\n$( document ).ready(function() {\n csvParse.init();\n});\n<\/code><\/pre><\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418304663153,"favorite_count":null,"last_activity_date":1418310283763,"last_edit_date":1418310283763,"last_editor_display_name":null,"last_editor_user_id":1548376.0,"owner_display_name":null,"owner_user_id":1548376.0,"parent_id":27420218,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":498,"id":27585789,"title":null,"body":"<p>It is a semi-hard problem when you know neither rows nor columns beforehand.<\/p>\n\n<p>In a for-work, remained-closed project a few years ago, I collected my data as a variant type (using the corresponding Boost class) and converted at the end. <\/p>\n\n<p>In <a href=\"https:\/\/github.com\/armstrtw\/Rblpapi\/\" rel=\"nofollow\">Rblpapi<\/a> (to which I contributed some other code), Whit tried a few approaches and ended up defining <a href=\"https:\/\/github.com\/armstrtw\/Rblpapi\/blob\/master\/src\/blpapi_utils.cpp#L254\" rel=\"nofollow\">his own helper functions<\/a> and I have been meaning to distill \/ refactor this and discuss it with Kevin -- but that hasn't happened yet. <\/p>\n\n<p>So feel free to come up with something better :)<\/p>\n\n<p>Generally speaking, and getting back to your problem, we frequently receive data <em>row-wise<\/em>, often via call-backs. The Rcpp types (wrapping R types) do <em>very poorly<\/em> when you append element by element -- so don't do the naive <code>push_back<\/code> as you will end up copying <em>a lot<\/em>. <\/p>\n\n<p>So if you know your types, do <code>std::list<\/code> over corresponding <code>std::vector&lt;T&gt;<\/code> for the given <code>T<\/code>. These vectors you can grow. Once you have them, assembling a <code>Rcpp::List<\/code> and hence <code>Rcpp::DataFrame<\/code> is easier.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419123080223,"favorite_count":null,"last_activity_date":1419125663740,"last_edit_date":1419125663740,"last_editor_display_name":null,"last_editor_user_id":143305.0,"owner_display_name":null,"owner_user_id":143305.0,"parent_id":27585257,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":499,"id":27607362,"title":null,"body":"<p>Right now you you are attempting to open a browser on the <strong>server<\/strong>, using the <code>webbrowser<\/code> python module. I'll assume that your real intention was to show the page to the <strong>user<\/strong>, i.e. open in on the client side (on user's computer).<\/p>\n\n<p>To achieve that you need to use Odoo's <a href=\"https:\/\/www.odoo.com\/documentation\/8.0\/reference\/actions.html#url-actions-ir-actions-act-url\" rel=\"noreferrer\">URL Action<\/a>:<\/p>\n\n<pre><code>class mrp_bom_line(osv.osv):\n _inherit = 'mrp.bom.line'\n\n def action_go(self, cr, uid, ids, context=None):\n return {\n 'type': 'ir.actions.act_url',\n 'url': 'http:\/\/www.python.org',\n 'target': 'new',\n }\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419268611573,"favorite_count":null,"last_activity_date":1419268611573,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":262618.0,"parent_id":27605698,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":500,"id":27679995,"title":null,"body":"<p>The thing to do in a situation like this is to throw away all the misleading dross and boil it down to the simplest possible case:<\/p>\n\n<pre><code>let arr : [AnyObject] = [1,2,3]\nlet min = minElement(arr) \/\/ same error: \"Generic parameter blah-de-blah...\"\n<\/code><\/pre>\n\n<p>So, you see, <code>minElement<\/code> doesn't work on an array of AnyObject, and that's what the error is telling you. And the reason is obvious: an AnyObject is not a Comparable. There is no \"minimum\" for a bunch of AnyObject things; the entire concept of one AnyObject being \"less than\" another AnyObject is undefined. You need to cast your array down to an array of something that <code>minElement<\/code> can work on, namely a Comparable of some kind.<\/p>\n\n<p>For example, in that code, I can fix the problem like this:<\/p>\n\n<pre><code>let arr : [AnyObject] = [1,2,3]\nlet min = minElement(arr as [Int])\n<\/code><\/pre>\n\n<p>That is the sort of thing you need to be doing. Of course, what you cast down to depends upon what these elements actually are. It looks to me as if will probably be Double and NSDate respectively, but that's just a guess; I don't know what's in your arrays. You do (presumably). Note that an NSDate is not a Comparable so you will have a bit more work to do with that one.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419795922963,"favorite_count":null,"last_activity_date":1419796256250,"last_edit_date":1419796256250,"last_editor_display_name":null,"last_editor_user_id":341994.0,"owner_display_name":null,"owner_user_id":341994.0,"parent_id":27679841,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":501,"id":27699562,"title":null,"body":"<p>As the documentation for <code>didUpdateLocations<\/code> says the array is ...<\/p>\n\n<blockquote>\n <p>... An array of <code>CLLocation<\/code> objects containing the location data. This array always contains at least one object representing the current location. If updates were deferred or if multiple locations arrived before they could be delivered, the array may contain additional entries. The objects in the array are organized in the order in which they occurred. Therefore, the most recent location update is at the end of the array.<\/p>\n<\/blockquote>\n\n<p>Generally you're right and there is often only one location, so you should keep track of your own property where you'll store the last valid location you received from the last time <code>didUpdateLocations<\/code> was called. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419913519023,"favorite_count":null,"last_activity_date":1419913519023,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1271826.0,"parent_id":27699535,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":502,"id":27496775,"title":null,"body":"<p>After much looking, I found the solution to this problem. When one calls <code>new RestTemplate ()<\/code>, a whole bunch of default <code>HttpMessageConverter<\/code>s are created and loaded. This does not use any Spring beans.<\/p>\n\n<p>So if like me you want to let the <code>RestTemplate<\/code> get configured with all its default but just add the necessary content type to the list, you can do the following:<\/p>\n\n<pre><code> RestTemplate myRest = new RestTemplate ();\n for (HttpMessageConverter&lt;?&gt; myConverter : myRest.getMessageConverters ()) {\n if (myConverter instanceof MappingJackson2HttpMessageConverter) {\n List&lt;MediaType&gt; myMediaTypes = new ArrayList&lt;MediaType&gt; ();\n myMediaTypes.addAll (myConverter.getSupportedMediaTypes ());\n myMediaTypes.add (MediaType.parseMediaType (\"text\/javascript; charset=utf-8\"));\n ((MappingJackson2HttpMessageConverter) myConverter).setSupportedMediaTypes (myMediaTypes);\n }\n }\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418698492117,"favorite_count":null,"last_activity_date":1418698492117,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2026105.0,"parent_id":27496756,"post_type_id":2,"score":6,"tags":null,"view_count":null},{"index":503,"id":27570852,"title":null,"body":"<p>Pickling is unrelated to the opening and closing of the file. It only says something about the contents of the file. Hence, in your one-liner the file is opened but not closed.<\/p>\n\n<p>As such, it's better to do:<\/p>\n\n<pre><code>with open(\"objectname.p\",\"w\") as f:\n pickle.dump(objectname, f)\n<\/code><\/pre>\n\n<p>This uses the <a href=\"http:\/\/effbot.org\/zone\/python-with-statement.htm\" rel=\"noreferrer\">with statement<\/a> with ensures that at the end of the block it'll call <code>f.close()<\/code> automatically. You're using Python 2.7 and this is supported in that Python version.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419009450440,"favorite_count":null,"last_activity_date":1419009450440,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1267329.0,"parent_id":27570789,"post_type_id":2,"score":6,"tags":null,"view_count":null},{"index":504,"id":27722940,"title":null,"body":"<p>IP addresses are issued to the end users by the LIRs (Local Internet registry). LIRs are required to register various details for any assigned address space in their appropriate RIRs (Regional Internet registry) databases. There are 5 RIRs (ARIN, RIPE NCC, APNIC, LACNIC and AfriNIC) responsible for different parts of the world. As far as I know they all provide RESTful APIs you can use to get the info you need.<\/p>\n\n<p>For example if the IP is from Europe, you can use RIPE API to search for inetnum or route objects which are related to some IP address:<\/p>\n\n<p><a href=\"http:\/\/rest.db.ripe.net\/search?query-string=194.79.41.40\" rel=\"nofollow noreferrer\">http:\/\/rest.db.ripe.net\/search?query-string=194.79.41.40<\/a><\/p>\n\n<p>You will get multiple objects inside a <code>whois-resource<\/code> and the one that is most interesting to you is the <code>route<\/code> object:<\/p>\n\n<pre><code>&lt;object type=\"route\"&gt;\n &lt;link xlink:type=\"locator\" xlink:href=\"http:\/\/rest.db.ripe.net\/ripe\/route\/194.79.40.0\/22AS35796\"\/&gt;\n &lt;source id=\"ripe\"\/&gt;\n &lt;primary-key&gt;\n &lt;attribute name=\"route\" value=\"194.79.40.0\/22\"\/&gt;\n &lt;attribute name=\"origin\" value=\"AS35796\"\/&gt;\n &lt;\/primary-key&gt;\n &lt;attributes&gt;\n &lt;attribute name=\"route\" value=\"194.79.40.0\/22\"\/&gt;\n &lt;attribute name=\"descr\" value=\"NBS\"\/&gt;\n &lt;attribute name=\"origin\" value=\"AS35796\" referenced-type=\"aut-num\"&gt;\n &lt;link xlink:type=\"locator\" xlink:href=\"http:\/\/rest.db.ripe.net\/ripe\/aut-num\/AS35796\"\/&gt;\n &lt;\/attribute&gt;\n &lt;attribute name=\"mnt-by\" value=\"NBS-MNT\" referenced-type=\"mntner\"&gt;\n &lt;link xlink:type=\"locator\" xlink:href=\"http:\/\/rest.db.ripe.net\/ripe\/mntner\/NBS-MNT\"\/&gt;\n &lt;\/attribute&gt;&lt;attribute name=\"source\" value=\"RIPE\" comment=\"Filtered\"\/&gt;\n &lt;\/attributes&gt;\n&lt;\/object&gt;\n<\/code><\/pre>\n\n<p>Keep in mind that this route object can be a summary scope that is larger then the one user actually belongs to, but this is the best you can get.<\/p>\n\n<p>Check the following links for other RIRs:<\/p>\n\n<ul>\n<li>AFRINIC (Africa): afrinic.net<\/li>\n<li>APNIC (Asia Pacific): apnic.net<\/li>\n<li>ARIN (Northern America): arin.net<\/li>\n<li>LACNIC (Latin America and the Carribean): lacnic.net<\/li>\n<\/ul>\n\n<hr>\n\n<p><strong>Edit:<\/strong>\nI should have mentioned this in my original answer but I got distracted by the API part. Behind all this is actually a whois protocol which is very simple to implement especially if you're dealing with programming languages where parsing the JSON or XML requires some work. <\/p>\n\n<p>Whois protocol uses TCP port 43 and after connecting to the server only thing you need to do is send the search key (in your case the IP address). You will get the response and the server will terminate the connection. That's it. You can try to <code>telnet whois.ripe.net 43<\/code> and after opening the connection just send <code>194.79.41.40<\/code> or other IP issued by RIPE NCC.<\/p>\n\n<p>One of the problems with whois is that there is no central database which you can query and always get the result, instead you need to query the RIR that issued the specific IP. But even if you 'miss' the right RIR and query (for example) the whois.iana.org for the address which is issued by RIPE NCC you will get the response with the right whois server and the organization (RIR) that issued the IP. So you can check the geolocation statistics for your users and prioritize one whois server that will most likely get you the result, or use the response to pick the second server to query.<\/p>\n\n<p>One other problem is that the responses are not standardized so you will have to make a response parser for each of 5 whois servers.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1420039016250,"favorite_count":null,"last_activity_date":1520933290803,"last_edit_date":1520933290803,"last_editor_display_name":null,"last_editor_user_id":133.0,"owner_display_name":null,"owner_user_id":2616428.0,"parent_id":27721092,"post_type_id":2,"score":8,"tags":null,"view_count":null},{"index":505,"id":27525373,"title":null,"body":"<p>You can use the <code>FOR<\/code> command:<\/p>\n\n<blockquote>\n <p><code>FOR \/R [[drive:]path] %variable IN (set) DO command [command-parameters]<\/code><\/p>\n \n <p>Walks the directory tree rooted at [drive:]path, executing the FOR\n statement in each directory of the tree. If no directory\n specification is specified after \/R then the current directory is\n assumed. If set is just a single period (.) character then it\n will just enumerate the directory tree.<\/p>\n<\/blockquote>\n\n<p>In your case this should work:<\/p>\n\n<pre><code>FOR \/R d:\\data %a IN (*.dtd) DO \"C:\\Program Files (x86)\\Notepad++\\notepad++.exe\" \"%a\"\n<\/code><\/pre>\n\n<p>Use <code>%%a<\/code> if you need to run this from a batch file<\/p>\n\n<p>If you want to use multiple extensions you can separate those with a space<\/p>\n\n<pre><code>FOR \/R d:\\data %a IN (*.dtd *.xml *.xslt) DO \"C:\\Program Files (x86)\\Notepad++\\notepad++.exe\" \"%a\"\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418818374967,"favorite_count":null,"last_activity_date":1433334811757,"last_edit_date":1433334811757,"last_editor_display_name":null,"last_editor_user_id":578411.0,"owner_display_name":null,"owner_user_id":578411.0,"parent_id":27525175,"post_type_id":2,"score":10,"tags":null,"view_count":null},{"index":506,"id":27664384,"title":null,"body":"<p>Like this:<\/p>\n\n<pre><code>- name: Create security group for app instances\n local_action:\n module: ec2_group\n name: \"http-everywhere\"\n description: \"My Security Group\"\n vpc_id: \"vpc=abcd1234\"\n region: \"us-east-1\"\n rules: \n - proto: tcp\n from_port: 80\n to_port: 80\n cidr_ip: 0.0.0.0\/0\n register: aws_sg\n\n- name: Tag the security group with a name\n local_action:\n module: ec2_tag\n resource: \"{{aws_sg.group_id}}\"\n region: \"us-east-1\"\n state: present\n tags:\n Name: \"My Security Group Name\"\n env: \"production\"\n service: \"web\"\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419655109773,"favorite_count":null,"last_activity_date":1419655109773,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2430241.0,"parent_id":27662600,"post_type_id":2,"score":14,"tags":null,"view_count":null},{"index":507,"id":27646134,"title":null,"body":"<pre><code>\u21d2 which git\n\/usr\/bin\/git\n\n\u21d2 git --version\ngit version 1.9.3 (Apple Git-50)\n<\/code><\/pre>\n\n<p>You need to rename original <strong>git<\/strong> at <strong>\/usr\/bin\/git<\/strong>, e.g.<\/p>\n\n<pre><code>sudo mv \/usr\/bin\/git \/usr\/bin\/git-original\n<\/code><\/pre>\n\n<p>Now check location and version again<\/p>\n\n<pre><code>\u21d2 which git\n\/usr\/local\/bin\/git\n\n\u21d2 git --version\ngit version 2.2.1\n<\/code><\/pre>\n\n<p>Add a symlink for backward compatibility (in case your IDE uses direct location to git)<\/p>\n\n<pre><code>sudo ln -s \/usr\/local\/bin\/git \/usr\/bin\/git\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419501333813,"favorite_count":null,"last_activity_date":1419501730957,"last_edit_date":1419501730957,"last_editor_display_name":null,"last_editor_user_id":781048.0,"owner_display_name":null,"owner_user_id":781048.0,"parent_id":27646133,"post_type_id":2,"score":17,"tags":null,"view_count":null},{"index":508,"id":27698685,"title":null,"body":"<p>Problem solved. My <code>manager<\/code> was declared as local var inside <code>viewDidLoad()<\/code> method, but it should've been a class level property. <\/p>\n\n<p>After I moved <code>manager<\/code> declaration out of <code>viewDidLoad()<\/code>, my app worked.<\/p>\n\n<p>Not sure how exactly <code>manager.requestWhenInUseAuthorization()<\/code> work behind the scene and why exactly <code>manager<\/code> defined within <code>viewDidLoad()<\/code> not work. Hope someone who knows this detail enlighten me. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419904826050,"favorite_count":null,"last_activity_date":1454672719863,"last_edit_date":1454672719863,"last_editor_display_name":null,"last_editor_user_id":1161412.0,"owner_display_name":null,"owner_user_id":3238384.0,"parent_id":27681951,"post_type_id":2,"score":18,"tags":null,"view_count":null},{"index":509,"id":27677078,"title":null,"body":"<p>Here are some options. We loop through the 'data' with <code>sapply<\/code> and get the <code>levels<\/code> of each column (assuming that all the columns are <code>factor<\/code> class)<\/p>\n\n<pre><code>sapply(data, levels)\n<\/code><\/pre>\n\n<p>Or if we need to pipe (<code>%&gt;%<\/code>) it, this can be done as<\/p>\n\n<pre><code>library(dplyr)\ndata %&gt;% \n sapply(levels)\n<\/code><\/pre>\n\n<p>Or another option is <code>summarise_each<\/code> from <code>dplyr<\/code> where we specify the <code>levels<\/code> within the <code>funs<\/code>.<\/p>\n\n<pre><code> data %&gt;%\n summarise_each(funs(list(levels(.))))\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1419775084190,"favorite_count":null,"last_activity_date":1438955971313,"last_edit_date":1438955971313,"last_editor_display_name":null,"last_editor_user_id":3732271.0,"owner_display_name":null,"owner_user_id":3732271.0,"parent_id":27676404,"post_type_id":2,"score":25,"tags":null,"view_count":null},{"index":510,"id":27482610,"title":null,"body":"<p>The string <em>can't<\/em> be nil. That's the point of this sort of typing in Swift. <\/p>\n\n<p>If you want it to be possibly nil, declare it as an optional:<\/p>\n\n<pre><code>var date : String? \n<\/code><\/pre>\n\n<p>If you want to check a string is <em>empty<\/em> (don't do this, it's the sort of thing optionals were made to work around) then:<\/p>\n\n<pre><code>if date.isEmpty\n<\/code><\/pre>\n\n<p>But you really should be using optionals. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":2,"community_owned_date":null,"creation_date":1418641470310,"favorite_count":null,"last_activity_date":1418650962180,"last_edit_date":1418650962180,"last_editor_display_name":null,"last_editor_user_id":852828.0,"owner_display_name":null,"owner_user_id":852828.0,"parent_id":27482537,"post_type_id":2,"score":27,"tags":null,"view_count":null},{"index":511,"id":27435028,"title":null,"body":"<p>Rename the method to group instead of user_group<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418344501027,"favorite_count":null,"last_activity_date":1418344501027,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2941800.0,"parent_id":27434044,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":512,"id":27495848,"title":null,"body":"<p>Your <code>triggersData<\/code> is a dictionary containing arrays of arrays. You are currently adding <code>newData<\/code> (which is a dictionary of numbers keyed on dates) to the end of that. You need instead to create an array from your <code>date<\/code> and <code>value<\/code>, and to append that array to the relevant item in your dictionary. So, instead of:<\/p>\n\n<pre><code>var newData: [NSDate: NSNumber] = [date: value]\ntriggersData.addEntriesFromDictionary(newData)\n<\/code><\/pre>\n\n<p>try:<\/p>\n\n<pre><code>var newData : [AnyObject] = [date, value]\nif var triggerArray = triggersData[trigger] as? [AnyObject] {\n triggerArray.append(newData)\n triggersData[trigger] = triggerArray\n}\n<\/code><\/pre>\n\n<p>That will get the data into the same form as your plist. But if I were you I would restructure your plist - the lowest level arrays have to be [AnyObject] because the first item is of type NSDate while the second item is of type NSNumber, which is a bad idea.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418691276863,"favorite_count":null,"last_activity_date":1418744242190,"last_edit_date":1418744242190,"last_editor_display_name":null,"last_editor_user_id":3985749.0,"owner_display_name":null,"owner_user_id":3985749.0,"parent_id":27495202,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":513,"id":27501654,"title":null,"body":"<p>If your machine is a cluster, you should be using MPI (Message Passing Interface). It offers a rich set of communication primitives, and is the parallelization workhorse in high performance computing.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418723102600,"favorite_count":null,"last_activity_date":1418723102600,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2445184.0,"parent_id":27501011,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":514,"id":27509283,"title":null,"body":"<p>To upload a file transparently via ajax you'll have to use a <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/FormData\" rel=\"nofollow\">FormData<\/a> object<\/p>\n\n<pre><code>var file = this.files[0];\nvar xhr = new XMLHttpRequest();\nvar data = new FormData();\ndata.append('files', file);\n...\nxhr.send(data);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418747160743,"favorite_count":null,"last_activity_date":1418747160743,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1353011.0,"parent_id":27508804,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":515,"id":27679953,"title":null,"body":"<p>The problem is that you have a mistake in your code:<\/p>\n\n<pre><code>private Set&lt;BranchAddress&gt; customerAddresses;\n<\/code><\/pre>\n\n<p>it must be:<\/p>\n\n<pre><code>private Set&lt;CustomerAddress&gt; customerAddresses;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419795704867,"favorite_count":null,"last_activity_date":1419795704867,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2281751.0,"parent_id":27679803,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":516,"id":27689757,"title":null,"body":"<pre><code>def update_previous_child\n conditions = {type: self.type, parent_id: self.parent_id}\n\n if existing_child = Child.find_by(conditions) # or Child.where(conditions).last\n new_value = (existing_child.value || []) + [new_hash]\n existing_child.update_attribute(:value, new_value)\n end\nend\n<\/code><\/pre>\n\n<p>That should do what you want. But each time you're creating a child, only the last one will be updated. If you want all the existing rows to be updated, do this:<\/p>\n\n<pre><code>def update_previous_children\n conditions = {type: self.type, parent_id: self.parent_id}\n\n Child.where(conditions).each do |existing_child|\n new_value = (existing_child.value || []) + [new_hash]\n existing_child.update_attribute(:value, new_value)\n end\nend\n<\/code><\/pre>\n\n<p>If you know how to properly serialize your new hash, you could write some SQL to use <code>update_all<\/code> on the <code>ActiveRecord::Relation<\/code> returned by <code>where<\/code>, rather than turning it into an array and using <code>update_attribute<\/code> on each entry.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419859394317,"favorite_count":null,"last_activity_date":1419860173467,"last_edit_date":1419860173467,"last_editor_display_name":null,"last_editor_user_id":2493089.0,"owner_display_name":null,"owner_user_id":2493089.0,"parent_id":27689262,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":517,"id":27411605,"title":null,"body":"<blockquote>\n <p>When I set defaultAutoCommit to false my transactions don't get saved\n to the database<\/p>\n<\/blockquote>\n\n<p>This is the purpose of setting defaultAutoCommit to false.\nSet it to true and it would be auto-commited.\nSet it to false and you need to manually commit it, or it will be rollbacked.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418248639653,"favorite_count":null,"last_activity_date":1418248639653,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":533454.0,"parent_id":27411543,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":518,"id":27468386,"title":null,"body":"<p>You cannot access instance fields of the class that the <code>static<\/code> method is part of, because a static method is not called on an instance of this class. If you <em>create<\/em> an instance of that class, you can access it's instance fields as normal.<\/p>\n\n<p>Your <code>b<\/code> is not an instance field, it's a normal local variable.<\/p>\n\n<p>The sentence you quoted just means that you cannot do what you tried in the line you commented out: you cannot access <code>a<\/code> without an instance. Non-static methods use <code>this<\/code> as the default instance, so you could access <code>a<\/code> by simply writing <code>a = 17;<\/code> which is equivalent to <code>this.a = 17;<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418552818817,"favorite_count":null,"last_activity_date":1418552818817,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2060725.0,"parent_id":27468335,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":519,"id":27520410,"title":null,"body":"<pre><code>if data.find('PING') != -1 :\nirc.send(\"PONG\")\n<\/code><\/pre>\n\n<p>Needs to be changed to:<\/p>\n\n<pre><code>if data.find('PING')\nirc.send(\"PONG :tmi.twitch.tv\")\n<\/code><\/pre>\n\n<p>Try doing that &amp; it should work.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418801796697,"favorite_count":null,"last_activity_date":1418801796697,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4369274.0,"parent_id":27517602,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":520,"id":27535025,"title":null,"body":"<p>When you start your promise, set a flag to state you are currently loading. Then when loading finishes, set the flag to false. Use this with ng-class or ng-if to make the appearance of the circle conditional.<\/p>\n\n<pre><code>function doStuff(){\n $scope.loadingIsHappening = true;\n myService.getStuff().then(function(){\n\n \/\/ your processing here\n\n }).finally(function(){\n $scope.loadingIsHappening = false;\n });\n}\n<\/code><\/pre>\n\n<p>HTML:<\/p>\n\n<pre><code> &lt;!-- ng-if removes from DOM, while ng-hide modifies CSS display to none--&gt;\n&lt;div ng-if=\"loadingIsHappening == true\" class=\"circle\"&gt;\n &lt;div class=\"loader\"&gt;&lt;\/div&gt;\n&lt;\/div&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418851097133,"favorite_count":null,"last_activity_date":1418853149250,"last_edit_date":1418853149250,"last_editor_display_name":null,"last_editor_user_id":1226150.0,"owner_display_name":null,"owner_user_id":1226150.0,"parent_id":27534987,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":521,"id":27536252,"title":null,"body":"<p>A thread local cached copy is fine as it is simpler and more efficient. A cached copy where you are not sure it is thread local could be a problem.<\/p>\n\n<p>A singleton by definition means there can only be one. I wouldn't what you have as a singleton and you have one per thread.<\/p>\n\n<p>I would init() your thread local object in it's constructor.<\/p>\n\n<p>BTW Your ThreadLocal should be <code>private static final<\/code> I suspect.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418856342013,"favorite_count":null,"last_activity_date":1418856342013,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":57695.0,"parent_id":27536194,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":522,"id":27589642,"title":null,"body":"<p>Multiple ClassLoaders are commonly encountered in Java EE. The Java EE application servers loads classes from deployed War\/EAR by a tree of classloaders. The reason why they do it in this way is to isolate one application from other applications but still sharing classes between deployed modules. If you want your class to be truly singleton then you need to make sure that same classloader loads your singleton. You can achieve it like this<\/p>\n\n<pre><code>private static Class getClass(String clazz) throws ClassNotFoundException {\n ClassLoader loader = Thread.currentThread().getContextClassLoader();\n if(loader == null)\n loader = YourSingleton.class.getClassLoader();\n return (loader.loadClass(clazz));\n }\n}\n<\/code><\/pre>\n\n<p>Note Enum in java already implement singleton pattern. <\/p>\n\n<p><strong>Updated<\/strong> Can you please explain what is multiple class Loader and how it resolve the issue. <br\/><\/p>\n\n<p>Let say you have a library <code>Foo<\/code>. Some part of your project requires <code>Foo_version1.jar<\/code> and some other part requires <code>Foo_version2.jar<\/code>. So in your <code>classpath<\/code> you have <code>Foo_version1.jar<\/code> and <code>Foo_version2.jar<\/code>. Now the class loader need to load a class <code>Bar<\/code> from <code>Foo<\/code>, it will load it from first <code>Foo_versionX<\/code> that it finds on the <code>classpath<\/code>. In order to resolve this issue you need another class loader because remember that some part of your project require <code>Bar<\/code> class from different <code>jar<\/code> then the one loaded by classloader. <br\/><\/p>\n\n<p>By using the code mentioned above you are making sure that if more than 1 classloader try to load your class then always the same instance will be used. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419167105973,"favorite_count":null,"last_activity_date":1419786727973,"last_edit_date":1419786727973,"last_editor_display_name":null,"last_editor_user_id":472792.0,"owner_display_name":null,"owner_user_id":1707520.0,"parent_id":27589537,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":523,"id":27609480,"title":null,"body":"<p>I don't see what's wrong with repeating the <code>updateText<\/code> call as the <code>didSet<\/code> observer of several properties. The bad smell here, if there is one, seems to me to be the way <code>updateText<\/code> is <em>declared<\/em>. If it's always going to use <code>self.text<\/code> and <code>self.font<\/code>, why not build that into its definition and give it no parameters? That way, you can write this much more neatly:<\/p>\n\n<pre><code>var text: NSString = \"DEFAULT TEXT\" {\n didSet { updateText() }\n}\nvar font: UIFont = UIFont.systemFontOfSize(1) {\n didSet { updateText() }\n}\n<\/code><\/pre>\n\n<p>Personally, I think that expresses very neatly (and DRYly) what you want to say: when any of these properties are updated, update the interface too.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419277831837,"favorite_count":null,"last_activity_date":1419277831837,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":341994.0,"parent_id":27609119,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":524,"id":27642084,"title":null,"body":"<p>There is no Android Wear AOSP distribution at the moment. Android Wear is currently a closed platform.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419454512770,"favorite_count":null,"last_activity_date":1419454512770,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":98494.0,"parent_id":27640403,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":525,"id":27659827,"title":null,"body":"<p>There are some open source reverse engineering based solutions. All of them are not completely conforming with rfc7016 and rfc7425.<br\/><br\/>For server side there are two solutions:<br\/>\n1. <a href=\"https:\/\/github.com\/OpenRTMFP\/Cumulus\" rel=\"nofollow\">https:\/\/github.com\/OpenRTMFP\/Cumulus<\/a><br\/>\n2. <a href=\"https:\/\/github.com\/MonaSolutions\/MonaServer\" rel=\"nofollow\">https:\/\/github.com\/MonaSolutions\/MonaServer<\/a><br\/><br\/>\nThere is currently no client based lib as open source. If you are interested in that solution, I have implemented server side and working on client lib in C for crossplatform.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419613722533,"favorite_count":null,"last_activity_date":1419613722533,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4396312.0,"parent_id":27653602,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":526,"id":27675714,"title":null,"body":"<p>Use the <code>||<\/code> operator to concatenate strings, not <code>+<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419763906770,"favorite_count":null,"last_activity_date":1419763906770,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2947592.0,"parent_id":27675674,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":527,"id":27717310,"title":null,"body":"<p>You have mispelled <code>hibernate.dialect<\/code> as <code>org.hibernate.dialect.MYSQLDialect<\/code> but ideally it should be <code>org.hibernate.dialect.MySQLDialect<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1420008382480,"favorite_count":null,"last_activity_date":1420008382480,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1768226.0,"parent_id":27717044,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":528,"id":27558278,"title":null,"body":"<p>CriteriaBuilder also provides <code>CriteriaBuilder#equal(Expression&lt;?&gt;, java.lang.Object)<\/code> (<a href=\"http:\/\/docs.oracle.com\/javaee\/7\/api\/javax\/persistence\/criteria\/CriteriaBuilder.html#equal(javax.persistence.criteria.Expression,%20java.lang.Object)\" rel=\"nofollow\">javadoc here<\/a>) which could take the <code>Expression&lt;String&gt;<\/code> as the first parameter, and then your String <code>tmNumber<\/code> as the second argument.<\/p>\n\n<p>This means what you have will almost work, with only slight modification:<\/p>\n\n<pre><code>Expression&lt;String&gt; currentTm = trainingEntryRoot.get(\"tmnumber\");\nPredicate tmNumberPred = builder.equal(currentTm, tmNumber);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418950428477,"favorite_count":null,"last_activity_date":1418953323693,"last_edit_date":1418953323693,"last_editor_display_name":null,"last_editor_user_id":1554635.0,"owner_display_name":null,"owner_user_id":1554635.0,"parent_id":27558124,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":529,"id":27559019,"title":null,"body":"<p>You need to iterate over the container and process<\/p>\n\n<pre><code>function ratioDetect() {\n\n $('.thumbnail-container').each(function () {\n var $this = $(this),\n $img = $this.find('img'),\n contWidth = $this.width(),\n contHeight = $this.height(),\n imgWidth = $img.width(),\n imgHeight = $img.height();\n\n var contRatio = contWidth \/ contHeight,\n imgRatio = imgWidth \/ imgHeight;\n\n if (contRatio &gt; imgRatio) {\n $img.removeClass('full-height');\n $img.addClass('full-width');\n } else {\n $img.removeClass('full-width');\n $img.addClass('full-height');\n }\n });\n\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418957063797,"favorite_count":null,"last_activity_date":1418958406337,"last_edit_date":1418958406337,"last_editor_display_name":null,"last_editor_user_id":114251.0,"owner_display_name":null,"owner_user_id":114251.0,"parent_id":27558985,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":530,"id":27619299,"title":null,"body":"<p>It's important to understand that the current code set <em>one<\/em> value of <code>postData<\/code> during creating the grid. The value of <code>postData<\/code> parameter will be object with properties evaluated at the moment of creating of the grid.<\/p>\n\n<p>To fix the code you need use <code>function<\/code> as the value of <code>postData<\/code> properties:<\/p>\n\n<pre><code>postData: {\n \"CallTransaction.ExtUsed\": function () { return $(\"#extUsed\").val(); },\n \"CallTransaction.StartOfCall\": function () { return $(\"#startOfCall\").val(); }\n}\n<\/code><\/pre>\n\n<p>See <a href=\"https:\/\/stackoverflow.com\/a\/2928819\/315935\">the answer<\/a> for more details. For understanding: jqGrid uses <a href=\"http:\/\/api.jquery.com\/jquery.ajax\/\" rel=\"nofollow noreferrer\">jQuery.ajax<\/a> internally and <code>jQuery.ajax<\/code> uses <a href=\"http:\/\/api.jquery.com\/jQuery.param\/\" rel=\"nofollow noreferrer\">jQuery.param<\/a> helper function to process the <code>data<\/code> parameter (construction using <code>postData<\/code>) and <code>jQuery.param<\/code> execute functions if it is the properties of <code>data<\/code> (<code>postData<\/code>).<\/p>\n\n<p>Additionally I would strictly recommend you to use <code>gridview: true<\/code> option in all your grids (see <a href=\"https:\/\/stackoverflow.com\/a\/12519858\/315935\">the answer<\/a>), add <code>autoencode: true<\/code> to interpret the input data as the data instead of HTML fragments (it's the default behavior) and to use <code>pager: \"#pager\"<\/code> instead of <code>pager: jQuery(\"#pager\")<\/code>.<\/p>\n\n<p>I recommend you to remove all <code>index<\/code> properties from <code>colModel<\/code> and to consider to include additional <code>id<\/code> property in the data returned from the server with an unique values which come from the database. If some column of the grid already contains the unique value you can add <code>key: true<\/code> property to the definition of the corresponding column. The reason of such changes is easy to understand if you know that jqGrid <strong>have to<\/strong> assign <code>id<\/code> attribute to every row of grid. The value of <code>id<\/code> attribute must be unique. The value, used as rowid in the documentation, will be used in the most callbacks of jqGrid to identify the row. The same value will be send to the server if you will implement editing of data later. If you don't specify any rowid in the input data jqGrid have to assign some other value to <code>id<\/code>. The default value will be 1,2,3... On the other side if you load the data from the database you have native ids of the rows. The usage of the native ids can \"simplify your live\" in the future.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419333511517,"favorite_count":null,"last_activity_date":1419333511517,"last_edit_date":1495542194210,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":315935.0,"parent_id":27618817,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":531,"id":27668938,"title":null,"body":"<p>I'm not entirely confident of this answer in the sense that there may be alternate\/simpler ways of approaching this, but here's my understanding:<\/p>\n\n<ul>\n<li><p>I think it's just a regular RSpec \"matcher\" that you are seeking here. <code>shoulda<\/code> is a gem containing a particular set of matchers.<\/p><\/li>\n<li><p>You need to pass <code>rendered<\/code> to your matcher, either explicitly or implicitly, through <code>subject<\/code>.<\/p><\/li>\n<li><p>Your matcher needs to turn the rendered string into a Capybara node in order to use the Capybara matchers, e.g. through <code>Capybara.string<\/code><\/p><\/li>\n<li><p>The <code>match<\/code> method is expected to return a boolean, not invoke <code>expect<\/code><\/p><\/li>\n<\/ul>\n\n<p>Taken together, this gives you:<\/p>\n\n<pre><code>require 'rails_helper'\n\nRSpec::Matchers.define :have_valid_link do |title, path|\n description { \"have valid link to #{path} on #{title}\" }\n\n match do |rendered|\n Capybara.string(rendered).has_link?(title, :href =&gt; path)\n end\nend\n\nRSpec.describe 'layouts\/_navigation', :type =&gt; :view do\n context 'everyone' do\n subject { rendered }\n\n before :each do\n allow(view).to receive(:user_signed_in?).and_return(false)\n render\n end \n\n it {should have_valid_link(I18n.t(:start_reading), stories_path)}\n it {should have_valid_link(I18n.t(:unknown_tales), root_path)}\n end\nend\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419696068313,"favorite_count":null,"last_activity_date":1419696068313,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1008891.0,"parent_id":27642481,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":532,"id":27463300,"title":null,"body":"<p><strong>Is there a reason the subject class(es) have to implement the same interface as the proxy class?<\/strong><\/p>\n\n<p>Yes but it's the other way around the <strong>proxy<\/strong> has to implement the same interface as the <strong>subject<\/strong><\/p>\n\n<p>The Client doesn't realize that the instance it is using is a proxy! The Client thinks it's a <code>Subject<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418502550280,"favorite_count":null,"last_activity_date":1418502550280,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2616073.0,"parent_id":27462244,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":533,"id":27474248,"title":null,"body":"<p>You can do this :<\/p>\n\n<pre><code>$(function() {\n var curPage=\"\";\n $(\"#menu a\").click(function() {\n var page = $(this).attr(\"data-page\");\n if($(\"#\"+page).css(\"display\") != \"none\"){\n $(\"#\"+page).slideUp();\n }else{\n $(\".content\").slideUp();\n $(\"#\"+page).slideToggle();\n }\n });\n});\n<\/code><\/pre>\n\n<p><a href=\"http:\/\/jsfiddle.net\/zL4h2dsL\/3\/\" rel=\"nofollow\">http:\/\/jsfiddle.net\/zL4h2dsL\/3\/<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418592008403,"favorite_count":null,"last_activity_date":1418594207157,"last_edit_date":1418594207157,"last_editor_display_name":null,"last_editor_user_id":3815796.0,"owner_display_name":null,"owner_user_id":3815796.0,"parent_id":27474187,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":534,"id":27537934,"title":null,"body":"<p>First, it's advisable to use <code>JavaConverters<\/code> instead to get an explicit conversion to avoid accidentally converting multiple times.<\/p>\n\n<p>You should be able to use <code>breakOut<\/code> on <code>map<\/code> by specifying the expected result type:<\/p>\n\n<pre><code>import scala.collection.breakOut\nimport scala.collection.JavaConverters._\n\nval stringMap: java.util.HashMap[String, Long] = new java.util.HashMap()\nstringMap.put(\"1\", 1L)\nstringMap.put(\"2\", 2L)\n\nval result: collection.mutable.HashMap[Int, Long] = stringMap.asScala.map { case (k, v) =&gt; (k.toInt, v) }(breakOut)\n\/\/ result: scala.collection.mutable.HashMap[Int,Long] = Map(2 -&gt; 2, 1 -&gt; 1)\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418867084330,"favorite_count":null,"last_activity_date":1418867084330,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":247985.0,"parent_id":27537794,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":535,"id":27656655,"title":null,"body":"<pre><code>.stButton .stButton_gradient {height: 16px}\n<\/code><\/pre>\n\n<p>This css cause the elements to take only half of its height. That css is generated by sharethis itself.<\/p>\n\n<p>You can add this css to override.<\/p>\n\n<pre><code>.stButton .stButton_gradient, .stButton .stFb, .stButton .stTwbutton, .stButton .stMainServices {height: 22px !important}\n<\/code><\/pre>\n\n<p>Thanks<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419594136760,"favorite_count":null,"last_activity_date":1419596280883,"last_edit_date":1419596280883,"last_editor_display_name":null,"last_editor_user_id":3607064.0,"owner_display_name":null,"owner_user_id":1198878.0,"parent_id":27656568,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":536,"id":27784401,"title":null,"body":"<p>It looks like you can achieve this by polling a sysctl exposed in procfs. If you look at the <a href=\"http:\/\/lxr.free-electrons.com\/source\/fs\/proc\/proc_sysctl.c?v=3.10#L544\" rel=\"nofollow\">poll implementation in procfs for the <code>sys<\/code> subdirectory<\/a>, you'll see that any sysctl that implements notifications for poll will return a mask that includes <code>POLLERR|POLLPRI<\/code>. So how do we figure out what sysctls implement this? We look for uses of <code>proc_sys_poll_notify<\/code>!<\/p>\n\n<p>One such place is in <a href=\"http:\/\/lxr.free-electrons.com\/source\/kernel\/utsname_sysctl.c?v=3.10#L47\" rel=\"nofollow\"><code>proc_do_uts_string<\/code><\/a>, which implements a number of sysctls under <code>\/proc\/sys\/kernel<\/code>. Most of these are read-only, but <code>hostname<\/code> and <code>domainname<\/code> can be written (see also their <a href=\"http:\/\/lxr.free-electrons.com\/source\/kernel\/utsname_sysctl.c?v=3.10#L92\" rel=\"nofollow\">table entries<\/a>).<\/p>\n\n<p>Of course, this is going to require root privileges to be able to write to e.g. <code>\/proc\/sys\/kernel\/hostname<\/code>.<\/p>\n\n<p>This is probably the easiest way to do such a thing while staying within a synthetic filesystem implementation. Of course, the only <em>real<\/em> way to test your code is to <code>poll(2)<\/code> one of your pins, press a button, and see if you get your rising \/ falling signal interrupts.<\/p>\n\n<p>Note: <a href=\"http:\/\/lxr.free-electrons.com\/source\/fs\/sysfs\/file.c?v=3.10#L421\" rel=\"nofollow\">sysfs also does this for edge nodes in the tree<\/a>:<\/p>\n\n<pre><code>&gt;&gt;&gt; import select\n&gt;&gt;&gt; f = open('\/sys\/bus\/clockevents\/devices\/clockevent0\/uevent', 'r')\n&gt;&gt;&gt; p = select.poll()\n&gt;&gt;&gt; p.register(f, select.POLLPRI | select.POLLERR)\n&gt;&gt;&gt; result = p.poll(10)\n&gt;&gt;&gt; result\n[(3, 10)]\n<\/code><\/pre>\n\n<p><code>10<\/code> is of course <code>POLLPRI (0x2) | POLLERR (0x8)<\/code>. I got the same results using <code>\/sys\/power\/state<\/code> as my input. Basically, if you poll any user-readable, non-directory file entry in sysfs, you'll get <code>POLLPRI | POLLERR<\/code> back.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1420477608663,"favorite_count":null,"last_activity_date":1420581438903,"last_edit_date":1420581438903,"last_editor_display_name":null,"last_editor_user_id":3787736.0,"owner_display_name":null,"owner_user_id":3787736.0,"parent_id":27673699,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":537,"id":27645255,"title":null,"body":"<p>Please try with the below code snippet.<\/p>\n\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n &lt;meta charset=\"utf-8\"&gt;\n &lt;title&gt;Kendo UI Snippet&lt;\/title&gt;\n\n &lt;link rel=\"stylesheet\" href=\"http:\/\/cdn.kendostatic.com\/2014.3.1119\/styles\/kendo.common.min.css\"&gt;\n &lt;link rel=\"stylesheet\" href=\"http:\/\/cdn.kendostatic.com\/2014.3.1119\/styles\/kendo.rtl.min.css\"&gt;\n &lt;link rel=\"stylesheet\" href=\"http:\/\/cdn.kendostatic.com\/2014.3.1119\/styles\/kendo.default.min.css\"&gt;\n &lt;link rel=\"stylesheet\" href=\"http:\/\/cdn.kendostatic.com\/2014.3.1119\/styles\/kendo.dataviz.min.css\"&gt;\n &lt;link rel=\"stylesheet\" href=\"http:\/\/cdn.kendostatic.com\/2014.3.1119\/styles\/kendo.dataviz.default.min.css\"&gt;\n &lt;link rel=\"stylesheet\" href=\"http:\/\/cdn.kendostatic.com\/2014.3.1119\/styles\/kendo.mobile.all.min.css\"&gt;\n\n &lt;script src=\"http:\/\/code.jquery.com\/jquery-1.9.1.min.js\"&gt;&lt;\/script&gt;\n &lt;script src=\"http:\/\/cdn.kendostatic.com\/2014.3.1119\/js\/jszip.min.js\"&gt;&lt;\/script&gt;\n &lt;script src=\"http:\/\/cdn.kendostatic.com\/2014.3.1119\/js\/kendo.all.min.js\"&gt;&lt;\/script&gt;\n &lt;style&gt;\n #products .k-grid-toolbar\n {\n display:none !important;\n }\n &lt;\/style&gt; \n&lt;\/head&gt;\n&lt;body&gt;\n\n&lt;button id=\"export\" class=\"k-button\"&gt;&lt;span class=\"k-icon k-i-excel\"&gt;&lt;\/span&gt;Export to Excel&lt;\/button&gt;\n&lt;div id=\"products\"&gt;&lt;\/div&gt;\n&lt;div id=\"orders\"&gt;&lt;\/div&gt;\n&lt;script&gt;\n \/\/ used to sync the exports\n var promises = [\n $.Deferred(),\n $.Deferred()\n ];\n\n $(\"#export\").click(function(e){\n \/\/ trigger export of the products grid\n $(\"#products\").data(\"kendoGrid\").saveAsExcel();\n \/\/ trigger export of the orders grid\n $(\"#orders\").data(\"kendoGrid\").saveAsExcel();\n \/\/ wait for both exports to finish\n $.when.apply(null, promises)\n .then(function(productsWorkbook, ordersWorkbook) {\n\n \/\/ create a new workbook using the sheets of the products and orders workbooks\n var sheets = [\n productsWorkbook.sheets[0],\n ordersWorkbook.sheets[0]\n ];\n\n sheets[0].title = \"Products\";\n sheets[1].title = \"Orders\";\n\n var workbook = new kendo.ooxml.Workbook({\n sheets: sheets\n });\n\n \/\/ save the new workbook,b\n kendo.saveAs({\n dataURI: workbook.toDataURL(),\n fileName: \"ProductsAndOrders.xlsx\"\n })\n });\n });\n\n $(\"#products\").kendoGrid({\n toolbar: [\"excel\"],\n excel: {\n allPages: true\n },\n dataSource: {\n transport: {\n read: {\n url: \"http:\/\/demos.telerik.com\/kendo-ui\/service\/Products\",\n dataType: \"jsonp\"\n }\n },\n pageSize: 20\n },\n height: 550,\n pageable: true,\n excelExport: function(e) {\n e.preventDefault();\n\n promises[0].resolve(e.workbook);\n }\n });\n\n $(\"#orders\").kendoGrid({\n dataSource: {\n type: \"odata\",\n transport: {\n read: \"http:\/\/demos.telerik.com\/kendo-ui\/service\/Northwind.svc\/Orders\"\n },\n pageSize: 20,\n serverPaging: true\n },\n height: 550,\n pageable: true,\n columns: [\n { field:\"OrderID\" },\n { field: \"ShipName\", title: \"Ship Name\" },\n { field: \"ShipCity\", title: \"Ship City\" }\n ],\n excelExport: function(e) {\n e.preventDefault();\n\n promises[1].resolve(e.workbook);\n }\n });\n&lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n\n<p>Let me know if any concern.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419493511917,"favorite_count":null,"last_activity_date":1419493511917,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":879020.0,"parent_id":27644041,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":538,"id":27699537,"title":null,"body":"<p>Probably because there are many different ways of doing it; I describe a few approaches in <a href=\"http:\/\/msdn.microsoft.com\/en-us\/magazine\/dn630647.aspx\" rel=\"noreferrer\">my MSDN article on the subject<\/a>.<\/p>\n\n<p>Asynchronous lifetime commands are especially tricky. Something like a \"close\" command must be carefully considered. Is there some indication that a close is in progress? What happens if the user closes more than once (\"close\" in particular can often be initiated by an OS or another app even if a \"close button\" is disabled)?<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419913204147,"favorite_count":null,"last_activity_date":1419913204147,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":263693.0,"parent_id":27699237,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":539,"id":27432075,"title":null,"body":"<p>Change your second 'func notify' declaration to 'optional func userNotificationCenter'<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418330748890,"favorite_count":null,"last_activity_date":1418330748890,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2291892.0,"parent_id":27428590,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":540,"id":27513827,"title":null,"body":"<p>The reasoning behind dropping source mapping from recent versions is described on the <a href=\"http:\/\/blog.jquery.com\/2014\/01\/24\/jquery-1-11-and-2-1-released\/\">JQuery blog<\/a><\/p>\n\n<blockquote>\n <p>This release <strong>does not contain the sourcemap comment in the minified\n file.<\/strong> Sourcemaps have proven to be a very problematic and puzzling\n thing to developers, spawning hundreds of confused developers on\n forums like StackOverflow and causing some to think jQuery itself was\n broken.<\/p>\n \n <p><strong>We\u2019ll still be generating and distributing sourcemaps, but you will\n need to add the appropriate sourcemap comment at the end of the\n minified file if the browser does not support manually associating map\n files (currently, none do)<\/strong>. If you generate your own jQuery file using\n the custom build process, the sourcemap comment will be present in the\n minified file and the map is generated; you can either leave it in and\n use sourcemaps or edit it out and ignore the map file entirely.<\/p>\n \n <p>We hope to bring back and improve sourcemap support in the future, but\n at the moment neither the design nor the implementation seem suited\n for situations like jQuery\u2019s, where there are widely distributed files\n on CDNs. We\u2019d like sourcemaps (and browsers supporting them) to\n gracefully handle situations like file renaming or missing files. See\n our bug ticket for more information.<\/p>\n<\/blockquote>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418763540153,"favorite_count":null,"last_activity_date":1418763540153,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":746736.0,"parent_id":27513715,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":541,"id":27550204,"title":null,"body":"<p><strong>TL;DR How do you use OAuth2 to authenticate users between my client and my server without redirection?<\/strong><\/p>\n\n<p>You can't. OAuth requires that the user is directed to an authorization (and possibly login) screen, and then redirected back to your app.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418916879540,"favorite_count":null,"last_activity_date":1418916879540,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1000753.0,"parent_id":27536178,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":542,"id":27573785,"title":null,"body":"<p>I don't see any border around my popup windows, but I do set them up slightly different than you. Hopefully this points you in the right direction.<\/p>\n\n<p>popup_view.xml<\/p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;LinearLayout\n xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n android:orientation=\"vertical\"\n android:background=\"#f5f5f5\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"&gt;\n\n &lt;TextView\n android:text=\"@string\/hello_world\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\/&gt;\n\n &lt;Button\n android:id=\"@+id\/btn_close\"\n android:text=\"Close\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\/&gt;\n\n&lt;\/LinearLayout&gt;\n<\/code><\/pre>\n\n<p>activity_main.xml<\/p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:orientation=\"vertical\"\n android:id=\"@+id\/main_view\"\n tools:context=\".MainActivity\"&gt;\n\n &lt;Button\n android:id=\"@+id\/btn_popup\"\n android:text=\"Popup\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\/&gt;\n\n &lt;TextView\n android:id=\"@+id\/txt_text\"\n android:text=\"@string\/hello_world\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\/&gt;\n\n&lt;\/LinearLayout&gt;\n<\/code><\/pre>\n\n<p>MainActivity.java<\/p>\n\n<pre><code>public class MainActivity extends ActionBarActivity implements View.OnClickListener {\n\n View popupView;\n Button btnPopup;\n Button btnClose;\n PopupWindow popupWindow;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n popupView = getLayoutInflater().inflate(R.layout.popup_view, null);\n btnClose = (Button) popupView.findViewById(R.id.btn_close);\n btnClose.setOnClickListener(this);\n\n popupWindow = new PopupWindow(popupView,\n ViewGroup.LayoutParams.WRAP_CONTENT,\n ViewGroup.LayoutParams.WRAP_CONTENT);\n\n btnPopup = (Button) findViewById(R.id.btn_popup);\n btnPopup.setOnClickListener(this);\n }\n\n @Override\n public void onClick(View v) {\n if (v.getId() == R.id.btn_popup) {\n popupWindow.showAtLocation(findViewById(R.id.main_view), Gravity.NO_GRAVITY, 100, 200);\n \/\/popupWindow.showAsDropDown(btnPopup, 10, 10);\n } else if (v.getId() == R.id.btn_close) {\n popupWindow.dismiss();\n }\n }\n}\n<\/code><\/pre>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/NcxGo.png\" alt=\"Screenshot\"><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1419022620833,"favorite_count":null,"last_activity_date":1419024184450,"last_edit_date":1419024184450,"last_editor_display_name":null,"last_editor_user_id":4348328.0,"owner_display_name":null,"owner_user_id":4348328.0,"parent_id":27555543,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":543,"id":27731245,"title":null,"body":"<p>I find my answer, pocketsphinx with version 0.8 has an option that can do that:<\/p>\n\n<pre><code>pocketsphinx_continuous -infile myfile.wav \n<\/code><\/pre>\n\n<p>however file must be in a specific format: 16khz 16bit mono wav file<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1420119175593,"favorite_count":null,"last_activity_date":1420119175593,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2173780.0,"parent_id":27730529,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":544,"id":27407812,"title":null,"body":"<p>It's an unknown to you what user-installed file browser apps your intent may trigger. I think this is a case where's it's better to hand roll something. My approach was to<\/p>\n\n<p>a) Find all files with a particular extension on external media with something like (I was looking for the .saf extension, so you'd alter for .pdf accordingly):<\/p>\n\n<pre><code> public ArrayList&lt;String&gt; findSAFs(File dir, ArrayList&lt;String&gt; matchingSAFFileNames) {\n String safPattern = \".saf\";\n\n File listFile[] = dir.listFiles();\n\n if (listFile != null) {\n for (int i = 0; i &lt; listFile.length; i++) {\n\n if (listFile[i].isDirectory()) {\n findSAFs(listFile[i], matchingSAFFileNames);\n } else {\n if (listFile[i].getName().endsWith(safPattern)){\n matchingSAFFileNames.add(dir.toString() + File.separator + listFile[i].getName());\n \/\/System.out.println(\"Found one! \" + dir.toString() + listFile[i].getName());\n }\n }\n }\n } \n \/\/System.out.println(\"Outgoing size: \" + matchingSAFFileNames.size()); \n return matchingSAFFileNames;\n}\n<\/code><\/pre>\n\n<p>b) Get that result into a <code>ListView<\/code> and let the user touch the file s\/he wants. You can make the list as fancy as you want -- show thumbnails, plus filename, etc.<\/p>\n\n<p>It sounds like it would take a long time, but it didn't and you then know the behavior for every device.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418234503127,"favorite_count":null,"last_activity_date":1418234503127,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1948204.0,"parent_id":27407157,"post_type_id":2,"score":8,"tags":null,"view_count":null},{"index":545,"id":27491571,"title":null,"body":"<p>Just alter the table, Postgres will automatically cast the double values to integer by rounding the appropriately:<\/p>\n\n<pre><code>ALTER TABLE foo ALTER COLUMN some_column TYPE integer;\n<\/code><\/pre>\n\n<p>This will essentially do the same as:<\/p>\n\n<pre><code>ALTER TABLE foo ALTER COLUMN some_data TYPE integer \n USING round(some_data)::integer;\n<\/code><\/pre>\n\n<p>SQLFiddle: <a href=\"http:\/\/sqlfiddle.com\/#!15\/4ea3c\/1\" rel=\"noreferrer\">http:\/\/sqlfiddle.com\/#!15\/4ea3c\/1<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418671496813,"favorite_count":null,"last_activity_date":1418671496813,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":330315.0,"parent_id":27491471,"post_type_id":2,"score":8,"tags":null,"view_count":null},{"index":546,"id":27553516,"title":null,"body":"<p>Here is your misunderstanding: You said:<\/p>\n\n<blockquote>\n <p>The second type parameter of <code>Action<\/code> should support any type that extends <code>ActionSubject<\/code><\/p>\n<\/blockquote>\n\n<p>This is not correct. The second type parameter of <code>Action<\/code> is constrained to be a specific subclass of <code>ActionSubject<\/code>, e.g., <code>MyActionSubject<\/code>. So you can't pass in an arbitrary <code>ActionSubject<\/code> instance, because that's a more generic type.<\/p>\n\n<p>If you want to have arbitrary subtypes of <code>ActionSubject<\/code>, just use <code>ActionSubject<\/code> as the second type parameter instead of <code>? extends ActionSubject<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418928113927,"favorite_count":null,"last_activity_date":1418928113927,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":492158.0,"parent_id":27553265,"post_type_id":2,"score":10,"tags":null,"view_count":null},{"index":547,"id":27397786,"title":null,"body":"<p>There is plugin available named <a href=\"https:\/\/plugins.jetbrains.com\/plugin\/93?pr=idea\" rel=\"noreferrer\" title=\"Metrics Reloaded\">Metrics Reloaded<\/a> . Which gives your code complexity in levels.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418204901923,"favorite_count":null,"last_activity_date":1418204901923,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4340775.0,"parent_id":27375575,"post_type_id":2,"score":13,"tags":null,"view_count":null},{"index":548,"id":27431802,"title":null,"body":"<p>I'm not sure why either works, but if this is rails and those are rails models, your tasks should depend on the environment:<\/p>\n\n<pre><code>task :get_roles =&gt; [ :environment ] do\n<\/code><\/pre>\n\n<p>By depending on the :environment task, it first loads rails.<\/p>\n\n<p>see also:<\/p>\n\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/7044714\/whats-the-environment-task-in-rake\">What&#39;s the &#39;environment&#39; task in Rake?<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":3,"community_owned_date":null,"creation_date":1418329688543,"favorite_count":null,"last_activity_date":1418330437890,"last_edit_date":1495535494660,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":14253.0,"parent_id":27431532,"post_type_id":2,"score":62,"tags":null,"view_count":null},{"index":549,"id":27407980,"title":null,"body":"<p>You need to add support libraries in libs directory so that these errors are resolved. Check the official docs: <a href=\"https:\/\/developer.android.com\/tools\/support-library\/setup.html#add-library\" rel=\"nofollow\">https:\/\/developer.android.com\/tools\/support-library\/setup.html#add-library<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1418235102250,"favorite_count":null,"last_activity_date":1418235102250,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1671058.0,"parent_id":27407632,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":550,"id":27417694,"title":null,"body":"<p>You can apply constraints programatically to a specific UI element (<a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/UserExperience\/Conceptual\/AutolayoutPG\/AutoLayoutinCode\/AutoLayoutinCode.html\" rel=\"nofollow\">link to iOS developer doc<\/a>)<\/p>\n\n<p>Sample code of this eg.:<\/p>\n\n<pre><code>\/\/ Center horizontally\n[self.view addConstraint:[NSLayoutConstraint constraintWithItem:viewToBeCentered\n attribute:NSLayoutAttributeCenterX\n relatedBy:NSLayoutRelationEqual\n toItem:self.view\n attribute:NSLayoutAttributeCenterX\n multiplier:1.0\n constant:0.0]];\n\n\/\/ Center vertically\n[self.view addConstraint:[NSLayoutConstraint constraintWithItem:viewToBeCentered\n attribute:NSLayoutAttributeCenterY\n relatedBy:NSLayoutRelationEqual\n toItem:self.view\n attribute:NSLayoutAttributeCenterY\n multiplier:1.0\n constant:0.0]];\n<\/code><\/pre>\n\n<p>You can include this code into your button's action code.<\/p>\n\n<p>Hope this helps to achieve the desired effect!<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1418283859300,"favorite_count":null,"last_activity_date":1418283859300,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2129209.0,"parent_id":27417580,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":551,"id":27462009,"title":null,"body":"<p>Objects have a different way of navigation than array. I think you will need to do something like this:<\/p>\n\n<pre><code>$graphObject = $response-&gt;getGraphObject();\n$backingData = $graphObject-&gt;backingData;\n$data = $backingData[data][0];\n<\/code><\/pre>\n\n<p>In such cases you need to read and comprehend the structure carefully. There will be associative and numerically indexed arrays in such data structures.\nWhat I am doing is above is first fetching the 'backingData' property of the object. Now under this property we have an associative array with a key 'data'. Under that there is a numerically index array that in your example has only one element. If there are multiple elements, you will have to run a loop.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1418493916440,"favorite_count":null,"last_activity_date":1418493916440,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2022048.0,"parent_id":27461765,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":552,"id":27536037,"title":null,"body":"<p>Shouldn't be a problem to do so. Are you getting any errors when you try?<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1418855295170,"favorite_count":null,"last_activity_date":1418855295170,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2551766.0,"parent_id":27535974,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":553,"id":27818994,"title":null,"body":"<pre><code> var peoplePicker = this.\"WhereYourControlAdded_Id\".FindControl(\"PeoplePickerControlID\") as PeopleEditor;\n \/\/here you should find your people picker control\n\n\n PeopleEditor peoplePicker = value as PeopleEditor;\n if (peoplePicker != null &amp;&amp; peoplePicker.CommaSeparatedAccounts.ToString() != \"\")\n {\n string[] userarray = peoplePicker.CommaSeparatedAccounts.ToString().Split(',');\n SPFieldUserValueCollection usercollection = new SPFieldUserValueCollection();\n\n for (int i = 0; i &lt; userarray.Length; i++)\n {\n SPFieldUserValue usertoadd = ConvertLoginAccount(userarray[i]);\n usercollection.Add(usertoadd);\n }\n\n item[item.Fields[columnName].InternalName] = usercollection;\n }\n else\n {\n item[item.Fields[columnName].InternalName] = null;\n }\n\n\n\n\n public static SPFieldUserValue ConvertLoginAccount(string userid)\n {\n SPFieldUserValue uservalue = null;\n SPSecurity.RunWithElevatedPrivileges(delegate()\n {\n\n using (SPSite site = new SPSite(SPContext.Current.Site.Url))\n {\n using (SPWeb web = site.OpenWeb())\n {\n SPUser requireduser = web.EnsureUser(userid);\n uservalue = new SPFieldUserValue(web, requireduser.ID, requireduser.LoginName);\n }\n }\n\n });\n return uservalue;\n }\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1420631812070,"favorite_count":null,"last_activity_date":1421654938770,"last_edit_date":1421654938770,"last_editor_display_name":null,"last_editor_user_id":3859625.0,"owner_display_name":null,"owner_user_id":3859625.0,"parent_id":27653369,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":554,"id":27432291,"title":null,"body":"<p>You can check out this course:<\/p>\n\n<p>I've added most pages that have an mp3<\/p>\n\n<p>You can download the course package here:<\/p>\n\n<p><a href=\"https:\/\/ihrdc.securevdr.com\/share?#\/view\/seef68cbe2bb439c9\" rel=\"nofollow noreferrer\">https:\/\/ihrdc.securevdr.com\/share?#\/view\/seef68cbe2bb439c9<\/a><\/p>\n\n<p>A SCORM course - in this case SCORM 1.2, with an MP3 is not any different from a standard HTML course. I just added the following in most pages:<\/p>\n\n<pre><code>&lt;audio controls&gt;\n &lt;source src=\"..\/golf.mp3\" type=\"audio\/mpeg\"&gt;\nYour browser does not support the audio element.\n&lt;\/audio&gt;\n<\/code><\/pre>\n\n<p>But I think I understand what you are thinking about, most scorm courses you see online you see a lot of Flash. You can find all HTML examples of SCORM courses both 1.2 and 2004 in the link below:<\/p>\n\n<p><a href=\"http:\/\/scorm.com\/scorm-explained\/technical-scorm\/golf-examples\/\" rel=\"nofollow noreferrer\">http:\/\/scorm.com\/scorm-explained\/technical-scorm\/golf-examples\/<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1418331744150,"favorite_count":null,"last_activity_date":1500655747970,"last_edit_date":1500655747970,"last_editor_display_name":null,"last_editor_user_id":3178480.0,"owner_display_name":null,"owner_user_id":3178480.0,"parent_id":27428165,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":555,"id":27437860,"title":null,"body":"<p>You could fit a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Linear_regression\" rel=\"nofollow\">linear regression<\/a> model.<\/p>\n\n<p>Since this is a programming site, here is some <a href=\"http:\/\/www.r-project.org\/\" rel=\"nofollow\">R<\/a> code:<\/p>\n\n<pre><code>&gt; d &lt;- read.table(\"data.tsv\", sep=\"\\t\", header=T)\n&gt; summary(lm(log(Bytes.RAM) ~ log(Rows) + log(Columns), d))\n\nCall:\nlm(formula = log(Bytes.RAM) ~ log(Rows) + log(Columns), data = d)\n\nResiduals:\n Min 1Q Median 3Q Max \n-0.4800 -0.2409 -0.1618 0.1729 0.6827 \n\nCoefficients:\n Estimate Std. Error t value Pr(&gt;|t|) \n(Intercept) 12.42118 0.61820 20.093 8.72e-09 ***\nlog(Rows) 0.51032 0.09083 5.618 0.000327 ***\nlog(Columns) 0.58200 0.07821 7.441 3.93e-05 ***\n---\nSignif. codes: 0 \u2018***\u2019 0.001 \u2018**\u2019 0.01 \u2018*\u2019 0.05 \u2018.\u2019 0.1 \u2018 \u2019 1 \n\nResidual standard error: 0.4052 on 9 degrees of freedom\nMultiple R-squared: 0.9062, Adjusted R-squared: 0.8853 \nF-statistic: 43.47 on 2 and 9 DF, p-value: 2.372e-05 \n<\/code><\/pre>\n\n<p>This model explains the data pretty well (the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Coefficient_of_determination\" rel=\"nofollow\">R\u00b2<\/a> is 0.89) and suggests the following relationship between the size of the spreadsheet and memory usage:<\/p>\n\n<pre><code>Bytes.RAM = exp(12.42 + 0.51 * log(Rows) + 0.58 * log(Columns))\n<\/code><\/pre>\n\n<p>A similar model can be used to predict the execution time (the <code>Seconds<\/code> column). There, the R\u00b2 is <code>0.998<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1418364596460,"favorite_count":null,"last_activity_date":1418402771430,"last_edit_date":1418402771430,"last_editor_display_name":null,"last_editor_user_id":367273.0,"owner_display_name":null,"owner_user_id":367273.0,"parent_id":27437430,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":556,"id":27475633,"title":null,"body":"<p>I think you need to call <code>make -f Makefile_prune clean<\/code>.<\/p>\n\n<p>When calling <code>make clean<\/code> since you are not using the -f option it won't call Makefile_prune. Its calling some other file named 'Makefile' which may not have the <code>clean<\/code> target. <\/p>\n\n<p>Also reference: <a href=\"https:\/\/www.gnu.org\/software\/make\/manual\/html_node\/Makefile-Names.html\" rel=\"nofollow\">https:\/\/www.gnu.org\/software\/make\/manual\/html_node\/Makefile-Names.html<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1418602180070,"favorite_count":null,"last_activity_date":1418602545783,"last_edit_date":1418602545783,"last_editor_display_name":null,"last_editor_user_id":848038.0,"owner_display_name":null,"owner_user_id":848038.0,"parent_id":27475591,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":557,"id":27530605,"title":null,"body":"<p>Connection pooling within storm is a little bit more complicated since you need to consider a couple things:<\/p>\n\n<ol>\n<li>You are running in a clustered environment -> multiple machines need their own connections<\/li>\n<li>Each Storm <em>worker<\/em> runs in a separate JVM -> it is likely that executors are not running in the same worker... which means no sharing connections<\/li>\n<\/ol>\n\n<p>So, don't worry too much about it. Continue to use the Singleton instance (like in @bridiver's answer) of your class within your Spouts and Bolts like normal. If they happen to share the same JVM, then they will share the same pool and you are good to go!<\/p>\n\n<p>In regards to the initialization, here is what I do:<\/p>\n\n<ol>\n<li>Pass configuration information into the spout\/bolt via the constructor<\/li>\n<li>Initialize your connections in the <code>open<\/code> (for spouts) or the <code>prepare<\/code> (for bolts) methods<\/li>\n<li>Connections are <strong>not<\/strong> shared between the spout and bolt<\/li>\n<\/ol>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1418834868140,"favorite_count":null,"last_activity_date":1475845543133,"last_edit_date":1475845543133,"last_editor_display_name":null,"last_editor_user_id":98933.0,"owner_display_name":null,"owner_user_id":98933.0,"parent_id":27521797,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":558,"id":27472647,"title":null,"body":"<p><a href=\"http:\/\/jsfiddle.net\/qn6tsmwa\/\" rel=\"nofollow\">http:\/\/jsfiddle.net\/qn6tsmwa\/<\/a><\/p>\n\n<ol>\n<li>use <code>.collapse('hide')<\/code> to hide\/close all <code>div.collapse<\/code><\/li>\n<li>use <code>show.bs.collapse<\/code> and <code>hide.bs.collapse<\/code> to hide or show up appropriate icons<\/li>\n<\/ol>\n\n<p><strong>CSS:<\/strong><\/p>\n\n<pre><code>.only-expanded {\n display:none\n}\n<\/code><\/pre>\n\n<p><strong>JQ:<\/strong><\/p>\n\n<pre><code>$('.collapse').collapse('hide').on('show.bs.collapse', function (e) {\n var id = $(this).attr('id');\n $('div[data-target=\"#' + id + '\"]').find('.only-expanded').show();\n $('div[data-target=\"#' + id + '\"]').find('.only-collapsed').hide();\n\n}).on('hide.bs.collapse', function () {\n var id = $(this).attr('id');\n $('div[data-target=\"#' + id + '\"]').find('.only-expanded').hide();\n $('div[data-target=\"#' + id + '\"]').find('.only-collapsed').show();\n})\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1418582224647,"favorite_count":null,"last_activity_date":1418582224647,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4221056.0,"parent_id":27471511,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":559,"id":27528508,"title":null,"body":"<p>The special thing about this, is the link:\nIt's not just <code>http:\/\/example.com\/document.docx<\/code> . It's <code>ms-word:ofe|u|http:\/\/example.com\/document.docx<\/code> .<\/p>\n\n<p>Just add <code>ms-word:ofe|u|<\/code> in front of the link for letting the browser know to open the link with an other Application.\nThere are other strings for other links.<\/p>\n\n<p>Open a OneNote-File with:<\/p>\n\n<pre><code>onenote:http:\/\/example.com\/document.one\n<\/code><\/pre>\n\n<p>And Excel-Files with<\/p>\n\n<pre><code>ms-excel:ofv|u|http:\/\/example.com\/document.xlsx\n<\/code><\/pre>\n\n<p>And just for fun a TeamSpeak Link:<\/p>\n\n<pre><code>ts3server:\/\/example.com\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1418828562613,"favorite_count":null,"last_activity_date":1418830290647,"last_edit_date":1418830290647,"last_editor_display_name":null,"last_editor_user_id":4021938.0,"owner_display_name":null,"owner_user_id":4021938.0,"parent_id":27527672,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":560,"id":27583653,"title":null,"body":"<p>Use the <a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/Carbon\/Conceptual\/LaunchServicesConcepts\/LSCIntro\/LSCIntro.html#\/\/apple_ref\/doc\/uid\/TP30000999-CH201-TP1\" rel=\"nofollow noreferrer\">Launch Services API<\/a> to manually set the default handler for the http URL scheme:<\/p>\n\n<pre><code>LSSetDefaultHandlerForURLScheme(\"http\", \"com.ORGANIZATION.APPNAME\")\n<\/code><\/pre>\n\n<p>Additionally, to expose the app as a default browser setting under <strong>System Preferences > General > Set default web browser<\/strong>, add a URL type in the info tab of the Xcode project. Make sure to add an Identifier and the \"http\" URL Scheme. Build and run:<\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/XxQ69.png\" alt=\"enter image description here\"><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1419104177487,"favorite_count":null,"last_activity_date":1419196281907,"last_edit_date":1419196281907,"last_editor_display_name":null,"last_editor_user_id":1306872.0,"owner_display_name":null,"owner_user_id":1306872.0,"parent_id":27314938,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":561,"id":27647203,"title":null,"body":"<p>From my experience the inventory is eventually consistent after a few hours. It's rather by design than a bug. <\/p>\n\n<p>Rebooting the device or clearing cache of the Google Play services triggers the changes to propagate immediately. I think there's no programmatic workaround for this.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1419510673840,"favorite_count":null,"last_activity_date":1419510673840,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1675568.0,"parent_id":27628781,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":562,"id":27707160,"title":null,"body":"<p>In addition to <a href=\"https:\/\/stackoverflow.com\/questions\/27706775\/creating-template-app-for-multiple-android-apps\/27706879#27706879\">CommonsWear's answer<\/a>, which is correct <em>if<\/em> you are using Android Studio, what you require can also be achieved in Eclipse - albeit with a little more work.<\/p>\n\n<p>You'd need to create a 'library application' (see image below) which should be your <strong>base application<\/strong> - i.e the app you want to be the common codebase of all the children-apps.<\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/yhyxJ.png\" alt=\"Source: Vogella.com\"><\/p>\n\n<p>After that is completed and you should create a <strong>new<\/strong> Android project (a <strong>child app<\/strong>) that uses the base application library (see example image below)<\/p>\n\n<p><a href=\"https:\/\/i.stack.imgur.com\/54fN2.png\" rel=\"nofollow noreferrer\"><img src=\"https:\/\/i.stack.imgur.com\/54fN2.png\" alt=\"Source: Vogella.com\"><\/a><br>\n<sub>(source: <a href=\"http:\/\/www.vogella.com\/tutorials\/AndroidLibraryProjects\/images\/xlibrary30.png.pagespeed.ic.C6oekZBznQ.png\" rel=\"nofollow noreferrer\">vogella.com<\/a>)<\/sub> <\/p>\n\n<p>Any values in a <strong>child app<\/strong> (i.e. strings, styles, etc) are inherited from the parent <strong>library app<\/strong> <code>\/res<\/code> folder unless you specify new values in the <strong>child app<\/strong> <code>\/res<\/code> folder.<\/p>\n\n<p>e.g. if <code>libraryapp\/res\/strings.xml<\/code> contains <\/p>\n\n<p><code>&lt;string name=\"override_me\"&gt;Hello&lt;\/string&gt;<\/code> <\/p>\n\n<p>and <code>childapp\/res\/strings.xml<\/code> contains <code>&lt;string name=\"override_me\"&gt;Bonjour&lt;\/string&gt;<\/code> <\/p>\n\n<p>then running the <strong>child app<\/strong> will return \"Bonjour\" rather than what was defined in the library.<\/p>\n\n<p>As the child app is basically an empty project <em>without<\/em> activities, your child app's manifest should basically be a carbon copy of that of the library <strong>apart<\/strong> from the <code>&lt;manifest&gt;<\/code> tag which should contain the child app's <code>package<\/code>, <code>android:versionCode<\/code> and <code>android:versionName<\/code>. It can launch your library with these modified values like this:<\/p>\n\n<pre><code> &lt;activity\n android:name=\"com.example.library.MainActivity\"\n android:label=\"@string\/app_name\"\n android:launchMode=\"singleTop\"&gt;\n &lt;intent-filter&gt;\n &lt;action android:name=\"android.intent.action.MAIN\" \/&gt;\n\n &lt;category android:name=\"android.intent.category.LAUNCHER\" \/&gt;\n &lt;\/intent-filter&gt;\n &lt;\/activity&gt;\n<\/code><\/pre>\n\n<p>Being Eclipse, this <em>is<\/em> slightly more convoluted but if you manage to set up correctly, it makes creating <strong>child apps<\/strong> quick and easy (but just not as easy as with gradle!).<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1419949549980,"favorite_count":null,"last_activity_date":1569338591930,"last_edit_date":1569338591930,"last_editor_display_name":null,"last_editor_user_id":4751173.0,"owner_display_name":null,"owner_user_id":717778.0,"parent_id":27706775,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":563,"id":27689885,"title":null,"body":"<p>Your redirect syntax is incorrect. Lose the <code>|<\/code><\/p>\n\n<pre><code>sudo tee $projectname\/www\/index.php &lt;&lt;-EOF &gt;\/dev\/null\n<\/code><\/pre>\n\n<p>The other redirection attempt you have <code>1&gt;&amp;2<\/code> would merely redirect standard output to standard error, which (normally) lands on your screen in the end anyway. It's useful, but not for you are trying to accomplish.<\/p>\n\n<p>It would be better hygiene to create the project as yourself and use a separate (version control and) deployment infrastructure to publish a production version only when you have something of suitable quality and completeness, though. Then you don't need <code>sudo<\/code>, and then you don't need <code>tee<\/code>.<\/p>\n\n<pre><code>cat &lt;&lt;-EOF &gt;$projectname\/www\/index.php\n<\/code><\/pre>\n\n<p>The <code>sudo tee file &gt;\/dev\/null<\/code> trick is a bit of an antipattern to enable you to write files like with <code>cat<\/code> when you are using <code>sudo<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1419859885280,"favorite_count":null,"last_activity_date":1419861332960,"last_edit_date":1419861332960,"last_editor_display_name":null,"last_editor_user_id":258523.0,"owner_display_name":null,"owner_user_id":874188.0,"parent_id":27689811,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":564,"id":27727284,"title":null,"body":"<p>you can use CSS <code>calc()<\/code> to adjust the width of the left container. <\/p>\n\n<p><a href=\"http:\/\/jsfiddle.net\/2cm2h7ak\/3\/\" rel=\"nofollow\"><strong>OPTION 1 FIDDLE<\/strong><\/a><\/p>\n\n<p><strong>HTML<\/strong><\/p>\n\n<pre><code>&lt;div id=\"main\"&gt;\n &lt;div id=\"left\"&gt;&lt;\/div&gt;\n &lt;div id=\"right\"&gt;&lt;\/div&gt; \n&lt;\/div&gt;\n<\/code><\/pre>\n\n<p><strong>CSS<\/strong><\/p>\n\n<pre><code>#main{\n width: 100%; \/\/set to 100% since you're capping it at 1200 anyways\n max-width: 1200px;\n \/* margin-right: auto;\n margin-left: auto;\n margin-top: 0; *\/ condense these to the following:\n margin: 0 auto;\n \/*display: block;*\/ already a block element so not necessary \n padding: 0;\n overflow: hidden; \/\/add to correct floating elements\n}\n\n#left{\n background: red; \/\/just for my test\n height: 100px; \/\/just for my test\n width: calc(100% - 300px); \/\/readjusts based on screen size\n float: left;\n padding-right: 10px;\n -moz-box-sizing: border-box; \/\/if you use padding add these lines to fix issue of padding adding to width \n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n\n #right{\n background: black; \/\/just for my test\n height: 100px; \/\/just for my test\n width: 300px;\n \/*top: 0;*\/ \/\/dont need, not doing anything\n float: right;\n \/*padding-right: 10px;\n padding-left: 10px;*\/ \/\/can condense to following:\n padding: 0 10px;\n -moz-box-sizing: border-box; \/\/see padding explanation above\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n<\/code><\/pre>\n\n<h2>OR<\/h2>\n\n<p>If you are worried about older browsers you can do this with <code>display: table<\/code> and <code>display: table-cell<\/code> like so:<\/p>\n\n<p><a href=\"http:\/\/jsfiddle.net\/2cm2h7ak\/2\/\" rel=\"nofollow\"><strong>OPTION 2 FIDDLE<\/strong><\/a><\/p>\n\n<p><strong>CSS<\/strong><\/p>\n\n<pre><code>#main{\n width: 100%;\n max-width: 1200px;\n margin: 0 auto;\n display: block;\n padding: 0;\n display: table; \/\/add\n table-layout: fixed; \/\/add\n}\n\n#left{\n display: table-cell; \/\/use instead of float\n background: red;\n height: 100px;\n padding-right: 10px;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n#right{\n display: table-cell; \/\/use instead of float\n background: black;\n height: 100px;\n width: 300px;\n padding: 0 10px;\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1420069154077,"favorite_count":null,"last_activity_date":1420069846710,"last_edit_date":1420069846710,"last_editor_display_name":null,"last_editor_user_id":3113558.0,"owner_display_name":null,"owner_user_id":3113558.0,"parent_id":27727251,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":565,"id":27745847,"title":null,"body":"<p>You can simply do like below:<\/p>\n\n<pre><code>'attribute'=&gt;'is_delivered',\n'format'=&gt;'raw',\n'value'=&gt;function($row){\n $values=[\n '(1,1,0)'=&gt;'red',\n '(1,1,1)'=&gt;'green',\n '(1,0,1)'=&gt;'blue',\n \/\/other values with its color\n ];\n return Html::tag('span', $row-&gt;is_delivered, ['style'=&gt;'background-color:'.$values[$row-&gt;is_delivered]]);\n}\n<\/code><\/pre>\n\n<p>By above code, we hold all of our possible values, and we assign a color to each one. Then, we show the value in a <code>span<\/code> tag, with the background color specified into <code>$values<\/code> array. Also, as you can see, there is no need to use <code>java-script<\/code>, or any <code>==<\/code> or <code>if<\/code> statements.<\/p>\n\n<p>You can improve your code like below:<\/p>\n\n<pre><code>['style'=&gt;'background-color:'.isset($values[$row-&gt;is_delivered]) ? $values[$row-&gt;is_delivered] : 'white']\n<\/code><\/pre>\n\n<p>So, if the value is not exist in <code>$values<\/code> array, it will show it with <code>white<\/code> background. Please note that, I set <code>background-color<\/code>, you must change it to <code>color<\/code> instead.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1420218823037,"favorite_count":null,"last_activity_date":1420218823037,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":713916.0,"parent_id":27742826,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":566,"id":27625720,"title":null,"body":"<p><code>BillingInterface<\/code> is an <code>interface<\/code> not a <code>trait<\/code>. Thus it can't find the non existent trait<\/p>\n\n<p>Also you have an interface called <code>BillingInterface<\/code> in a namespace called <code>Billing\\BillingInterface<\/code>, the fully qualified name of the interface is: <code>\\Billing\\BillingInterface\\BillingInterface<\/code><\/p>\n\n<p>Perhaps you mean<\/p>\n\n<pre><code>use Billing\\BillingInterface\\BillingInterface;\n\/\/ I am not sure what namespace BillingPlatform is in, \n\/\/ just assuming it's in Billing.\nuse Billing\\BillingPlatform;\n\nclass PaymentsController extends BaseController implements BillingInterface\n{\n public function __construct(BillingPlatform $BillingProvider)\n {\n $this-&gt;BillingProvider = $BillingProvider;\n }\n\n \/\/ Implement BillingInterface methods\n}\n<\/code><\/pre>\n\n<p><strong>Or to use it as a trait.<\/strong><\/p>\n\n<pre><code>namespace Billing;\n\ntrait BillingTrait\n{\n public function charge($data) { \/* ... *\/ }\n public function subscribe($data) { \/* ... *\/ }\n public function cancel($data) { \/* ... *\/ }\n public function resume($data) { \/* ... *\/ }\n}\n<\/code><\/pre>\n\n<p>Again the modified <code>PaymentsController<\/code>, but with fully qualifies names.<\/p>\n\n<pre><code>class PaymentsController extends BaseController\n{\n \/\/ use the fully qualified name\n use \\Billing\\BillingTrait;\n\n \/\/ I am not sure what namespace BillingPlatform is in, \n \/\/ just assuming it's in billing.\n public function __construct(\n \\Billing\\BillingPlatform $BillingProvider\n ) {\n $this-&gt;BillingProvider = $BillingProvider;\n }\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1419357934220,"favorite_count":null,"last_activity_date":1425080179730,"last_edit_date":1425080179730,"last_editor_display_name":null,"last_editor_user_id":2126755.0,"owner_display_name":null,"owner_user_id":2126755.0,"parent_id":27625707,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":567,"id":27705754,"title":null,"body":"<p>Your problem may be in the order of these two lines :<\/p>\n\n<pre><code> spaceship.setScale(0.50)\n let debugFrame = SKShapeNode.init(rect: spaceship.frame)\n<\/code><\/pre>\n\n<p>You scaled down the spaceship <strong>and then<\/strong> calculate the size of the rectangle with the scaled spaceship. Then when rendering the rectangle is scaled down to half its size which is quarter of the original spaceship size.<\/p>\n\n<p>If you swap the lines, it should work as expected.<\/p>\n\n<p>In general, it is better to make compose in the <em>real<\/em> size and then scale the whole just before adding it to the scene.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1419943470817,"favorite_count":null,"last_activity_date":1419958615653,"last_edit_date":1419958615653,"last_editor_display_name":null,"last_editor_user_id":719263.0,"owner_display_name":null,"owner_user_id":719263.0,"parent_id":27701705,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":568,"id":27611721,"title":null,"body":"<p>Some background information,\nIn protocol buffers you define a field like<\/p>\n\n<pre><code> optional string msg = 1;\n<\/code><\/pre>\n\n<p>The number (<strong>1<\/strong> in this <strong>example<\/strong>) is used to identify the field in the Data-Message (or Data-Record) and for matching to proto-message used by your program.<\/p>\n\n<p>Protocol buffers store data Messages like<\/p>\n\n<pre><code> FieldId1 Data1\n FieldId2 Data2\n .....\n FieldIdn Datan\n<\/code><\/pre>\n\n<p>Where fieldId consists of the Field-Number and Field type. If a field <strong>does not<\/strong> have any data, it is <strong>not stored<\/strong> in the <strong>output message<\/strong> (record). So you may have<\/p>\n\n<pre><code> FieldId3 Data3\n FieldId7 Data7\n FieldId11 Data11\n<\/code><\/pre>\n\n<hr>\n\n<p>Answers to your questions:<\/p>\n\n<ol>\n<li><p>In protocol-buffers every field has one attribute of these attributes: <strong>Required<\/strong>, <strong>Optional<\/strong> and <strong>Repeated<\/strong>. So to <em>delete<\/em> a field you can make it optional and not store any value in it. Some people routinely make most fields optional<\/p><\/li>\n<li><p>Protocol Matches the <strong>field-numbers<\/strong> in the Data-Message with <strong>field-numbers<\/strong> in the Proto definition. In java at-least, there is are <strong>unknown fields<\/strong> Map where any extra fields are stored.<\/p><\/li>\n<\/ol>\n\n<hr>\n\n<p>It is essential you <strong>document<\/strong> fields (both the <strong>Field-Name<\/strong> and <strong>Field-Number<\/strong>) you remove to make sure you <strong>Never reuse a field name\/number<\/strong>.<\/p>\n\n<p>If you reuse a field, you could break existing code <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":4,"community_owned_date":null,"creation_date":1419289184040,"favorite_count":null,"last_activity_date":1473210745780,"last_edit_date":1473210745780,"last_editor_display_name":null,"last_editor_user_id":646723.0,"owner_display_name":null,"owner_user_id":646723.0,"parent_id":27610647,"post_type_id":2,"score":11,"tags":null,"view_count":null},{"index":569,"id":27443924,"title":null,"body":"<p>You must add overflow-y: auto or scroll to have it scrolling in vertical direction. You just disabled horizontal scrolling. So the proper CSS would be<\/p>\n\n<pre><code>.scrollable-menu {\n height: auto;\n max-height: 200px;\n overflow-x: hidden;\n overflow-y: auto;\n}\n<\/code><\/pre>\n\n<p>Hope that helps. Have fun.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1418388130760,"favorite_count":null,"last_activity_date":1418388130760,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1669805.0,"parent_id":27443861,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":570,"id":27482190,"title":null,"body":"<p>Try this:<\/p>\n\n<pre><code>{foreach from=$customer item=foo} \n Customer name: {$foo.id.firstname} {$foo.id.lastname}\n{\/foreach}\n<\/code><\/pre>\n\n<p><code>Smarty<\/code> will compile it to something equivalent with:<\/p>\n\n<pre><code>foreach ($customer as $foo) {\n echo('Customer name: '.$foo['id']['firstname'].' '.$foo['id']['laststname']);\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1418639997803,"favorite_count":null,"last_activity_date":1418639997803,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4265352.0,"parent_id":27482115,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":571,"id":27427285,"title":null,"body":"<p>Although sed will probably be quicker, this may shave some time off...<\/p>\n\n<pre><code>set newText to \"\"\nset paraList to paragraphs of theText\nrepeat with thisLine in my paraList\n\n if thisLine contains deletePhrase1 then\n set newText to newText &amp; \"\\\"Address\\\"=\\\"\" &amp; newPhrase1 &amp; \"\\\"\" &amp; return\n else if thisLine contains deletePhrase2 then\n set newText to newText &amp; \"\\\"Port\\\"=\\\"\" &amp; newPhrase2 &amp; \"\\\"\" &amp; return\n else\n set newText to newText &amp; thisLine &amp; return\n end if\nend repeat\nif newText is not \"\" then set newText to text 1 thru -2 of newText\nreturn newText\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1418314004750,"favorite_count":null,"last_activity_date":1418314004750,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1191301.0,"parent_id":27426023,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":572,"id":27510260,"title":null,"body":"<p>You can't run code after a return statement. The function has ended. Consider changing your loop to break on a condition, and to return after your loop has terminated.<\/p>\n\n<p>EDIT: Using a thread<\/p>\n\n<pre><code>new Thread()\n{\n public void run()\n {\n while(true)\n yourActivity.runOnUiThread(new Runnable()\n {\n public void run()\n {\n doStuff();\n }\n });\n }\n}.start();\nreturn returnVal;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1418750270430,"favorite_count":null,"last_activity_date":1418751065910,"last_edit_date":1418751065910,"last_editor_display_name":null,"last_editor_user_id":4307644.0,"owner_display_name":null,"owner_user_id":4307644.0,"parent_id":27510174,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":573,"id":27515217,"title":null,"body":"<p>Like so :<\/p>\n\n<pre><code>public class WrapperArray extends ArrayList&lt;DataWrapper&gt; {\n}\n\npublic class DataWrapper {\n @JsonProperty(value = \"data_type\")\n private String dataType;\n\n @JsonProperty(value = \"data\")\n private List&lt;Data&gt; data;\n\n \/\/ you need to add empty constructor and getters\/setters\n}\n\npublic abstract class Data {\n}\n\npublic class GenShiftsData extends Data {\n @JsonProperty(value = \"device_id\")\n private String deviceId;\n\n @JsonProperty(value = \"shift_type\")\n private String shiftType;\n\n @JsonProperty(value = \"start_time\")\n private String startTime;\n\n @JsonProperty(value = \"end_time\")\n private String endTime;\n\n @JsonProperty(value = \"staff_card_no\")\n private String staffCardNo;\n\n @JsonProperty(value = \"processed_date\")\n private String processedDate;\n\n \/\/ you need to add empty constructor and getters\/setters\n}\n<\/code><\/pre>\n\n<p>And serialize a WrapperArray like that : <\/p>\n\n<pre><code>ObjectMapper mapper = new ObjectMapper();\nWrapperArray wrapperArray = new WrapperArray();\nwrapperArray.add(dataWrapper1);\nwrapperArray.add(dataWrapper2);\n\nString jsonResult = mapper.writeValueAsString(wrapperArray);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1418769211583,"favorite_count":null,"last_activity_date":1418769985870,"last_edit_date":1418769985870,"last_editor_display_name":null,"last_editor_user_id":2000300.0,"owner_display_name":null,"owner_user_id":2000300.0,"parent_id":27514930,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":574,"id":27666601,"title":null,"body":"<p>No Error event means no generic way to listen\/capture generic errors. To capture an error within a user-defined vim function, do the following:<\/p>\n\n<p>The safest solution would be \u2014 just like in any other programming language \u2014 to wrap your commands in a <code>try|catch|endtry<\/code> construction:<\/p>\n\n<pre><code>function! InsertFoo()\n try\n norm Ifoo\n catch \/^Vim\\%((\\a\\+)\\)\\=:E21\/\n call SendMessage(v:exception, v:errmsg)\n endtry\nendfunction\n<\/code><\/pre>\n\n<p>The function above will insert <code>foo<\/code> at the beginning of the current line in a writable buffer but throw an <code>E21<\/code> exception when called in a read-only buffer (<code>:help<\/code> for example) and allow you to call your hypothetical <code>SendMessage()<\/code> (here with the error message and the full exception as arguments, use the one you prefer) that would presumably be in charge of displaying that information to your user.<\/p>\n\n<p>Reference:<\/p>\n\n<pre><code>:help exception-handling\n:help :try\n:help :catch\n:help v:errmsg\n:help v:exception\n:help errors\n:help &lt;errornumber&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1419678014553,"favorite_count":null,"last_activity_date":1419695144367,"last_edit_date":1419695144367,"last_editor_display_name":null,"last_editor_user_id":3757222.0,"owner_display_name":null,"owner_user_id":546861.0,"parent_id":27662655,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":575,"id":27757214,"title":null,"body":"<p>The problem exists in <em>your input data<\/em>. You posed incorrect data. The real data <strong>already contains<\/strong> <a href=\"http:\/\/en.wikipedia.org\/wiki\/Non-breaking_space\" rel=\"nofollow noreferrer\">non-breaking space<\/a>. The JSON data returned by your server are <strong>not<\/strong> <code>\"3 725 141 100\"<\/code> (with spaces inside, the space have the code 32 or 0x20), but <code>\"3\u00a0725\u00a0141\u00a0100\"<\/code> (with non-breaking spaces inside, which have the code 160 or 0xA0).<\/p>\n\n<p>UTF-8 encoded data in the HTTP traffic looks like<\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/db54m.png\" alt=\"enter image description here\"><\/p>\n\n<p>The decoded data look like<\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/IC8A6.png\" alt=\"enter image description here\"><\/p>\n\n<p>The above picture displays the fragment of your original JSON data displayed in the HEX format. I marked with green color the standard space and with red color the space used in the data returned from your server. To solve the problem you should normalize your data either in the database or in your server code or on the client side in your JavaScript code. In any way you should replace all unneeded non-breaking spaces to the standard space.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1420304246880,"favorite_count":null,"last_activity_date":1420304986680,"last_edit_date":1420304986680,"last_editor_display_name":null,"last_editor_user_id":315935.0,"owner_display_name":null,"owner_user_id":315935.0,"parent_id":27733885,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":576,"id":27632482,"title":null,"body":"<p>I solved this problem,\nSo solution is like If we want to execute proc using sql command then syntex is like below,<\/p>\n\n<pre><code>call Proc2('My Name');\n<\/code><\/pre>\n\n<p>We can use this same approach inside our proc also. \nFor that we have to follow some steps. Lets say that our above sql call is statement that we want to execute. we are going to convert that statement into String and pass necessary parameter by concating variable values. Then execute statement. <\/p>\n\n<pre><code>CREATE OR REPLACE PROCEDURE Proc1()\n IS\n Declare myName in varchar;\n -- stmt variable is to execute our proc\n STMT VARCHAR(4000);\n BEGIN \n Select fname into myName from student where fname='x'; \/\/ is returning unique value\n -- this is our logic\n STMT :='call Proc2('||myName||')';\n EXECUTE IMMEDIATE STMT;\n END;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1419402318267,"favorite_count":null,"last_activity_date":1515523182960,"last_edit_date":1515523182960,"last_editor_display_name":null,"last_editor_user_id":4390665.0,"owner_display_name":null,"owner_user_id":4390665.0,"parent_id":27632310,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":577,"id":27652608,"title":null,"body":"<p>Use Async; something like the following:<\/p>\n\n<pre><code>console.log(\" beginning insert \"+ Date() );\n\/\/ create your queries as an array of objects\nqueries = [];\nfor (var i=0;i&lt;200;i++){\n queries.push({name: \"tiger!\"});\n};\n\n\nasync.map(queries, myQuery, function(err, data){\n \/\/ Here all of your queries are done\n connection.end();\n console.log(\" end insert \" + Date() );\n});\n\nfunction myQuery(name, callback){\n connection.query('INSERT INTO animals SET ?', [name], function(err, result) {\n if(err){\n console.error(err);\n callback(err, null);\n }else{\n callback(null, result);\n }\n });\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1419565365250,"favorite_count":null,"last_activity_date":1419573737523,"last_edit_date":1419573737523,"last_editor_display_name":null,"last_editor_user_id":2821490.0,"owner_display_name":null,"owner_user_id":2821490.0,"parent_id":27652526,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":578,"id":27681472,"title":null,"body":"<p>It is because you did not declare the Vibrator class to vibrate on Notification.In your notification builder put this code and set the duration of vibrate based on your choose.<\/p>\n\n<pre><code> Vibrator v = (Vibrator) this.context.getSystemService(Context.VIBRATOR_SERVICE);\n \/\/ Vibrate for 500 milliseconds\n v.vibrate(500);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1419807549437,"favorite_count":null,"last_activity_date":1419807549437,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":4396430.0,"parent_id":27681342,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":579,"id":27719790,"title":null,"body":"<p>Well I asked a similar question on regards of how to work with caching data downloading and performing them in parallel.\nTake a look at the answer here: <a href=\"https:\/\/stackoverflow.com\/questions\/25507059\/task-caching-when-performing-tasks-in-parallel-with-whenall\">Task caching when performing Tasks in parallel with WhenAll<\/a><\/p>\n\n<p>So in short your GetImage should go in a list that holds the tasks instead of the result.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1420021622110,"favorite_count":null,"last_activity_date":1420021622110,"last_edit_date":1495535620793,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":613087.0,"parent_id":27719479,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":580,"id":27390410,"title":null,"body":"<p>Class names are case sensitive. You should have<\/p>\n\n<pre><code>var returnParameter = new SqlParameter(\"@SqlStatement\", SqlDbType.VarChar);\n<\/code><\/pre>\n\n<p>See: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/system.data.sqlclient.sqlparameter%28v=vs.110%29.aspx\" rel=\"nofollow\">http:\/\/msdn.microsoft.com\/en-us\/library\/system.data.sqlclient.sqlparameter%28v=vs.110%29.aspx<\/a><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1418165603953,"favorite_count":null,"last_activity_date":1418165603953,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":598854.0,"parent_id":27390376,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":581,"id":27620036,"title":null,"body":"<p>Use <code>addEventListener<\/code> intead of the <code>onLoad<\/code> (what is typed incorrectly, see at the end) property:<\/p>\n\n<pre><code>function drawInlineSVG(ctx, rawSVG, callback) {\n var svg = new Blob([rawSVG], {type:\"image\/svg+xml;charset=utf-8\"});\n var domURL = self.URL || self.webkitURL || self;\n var url = domURL.createObjectURL(svg);\n var img = new Image();\n img.src = url;\n img.addEventListener('load', function () {\n console.log(\"image onload\");\n ctx.drawImage(this, 0, 0); \n domURL.revokeObjectURL(url);\n callback(this);\n });\n}\n<\/code><\/pre>\n\n<p>You could use use Data URL instead of blob, but that is up to you:<\/p>\n\n<pre><code>function drawInlineSVG(ctx, rawSVG, callback) {\n var img = new Image();\n img.src = 'data:image\/svg+xml;utf8,' + rawSVG;\n img.addEventListener('load', function () {\n console.log(\"image onload\");\n ctx.drawImage(this, 0, 0); \n domURL.revokeObjectURL(url);\n callback(this);\n });\n}\n<\/code><\/pre>\n\n<p><a href=\"http:\/\/jsfiddle.net\/smkuLrbu\/\" rel=\"nofollow\">http:\/\/jsfiddle.net\/smkuLrbu\/<\/a><\/p>\n\n<p>If it's not working the issue probably is your SVG file. It must contains at least the following property in the <code>&lt;svg&gt;<\/code> tag:<\/p>\n\n<pre><code>&lt;svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" ...\n<\/code><\/pre>\n\n<p>If you want to stick with the property, use the correct version which don't have uppercase letters: <code>img.onload<\/code>, but you really should use <code>addEventListener<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1419336356223,"favorite_count":null,"last_activity_date":1419337515077,"last_edit_date":1419337515077,"last_editor_display_name":null,"last_editor_user_id":912325.0,"owner_display_name":null,"owner_user_id":912325.0,"parent_id":27619555,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":582,"id":27627468,"title":null,"body":"<p>There is no issue. You got that answer because its correct. Perhaps you need to show more digits in your cell?<\/p>\n\n<p><code>Norm.Dist(x,m,s,0)<\/code> gives you the value of the probability density function of the normal distribution function, evaluated at <strong>x<\/strong>, with mean=m and standard deviation = s. For the values of x, m and s, as given in your example, this is:<\/p>\n\n<p>exp((x-m)^2\/(2*s^2))\/sqrt(2*pi*s^2)=0.000925 (approximately).<\/p>\n\n<p>What were you expecting, or more likely, what were you trying to calculate in the first place?<\/p>\n\n<p><img src=\"https:\/\/i.stack.imgur.com\/0BtQh.png\" alt=\"enter image description here\"><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1419366085207,"favorite_count":null,"last_activity_date":1419367640967,"last_edit_date":1419367640967,"last_editor_display_name":null,"last_editor_user_id":3761815.0,"owner_display_name":null,"owner_user_id":3761815.0,"parent_id":27627412,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":583,"id":27715902,"title":null,"body":"<p>When you call <code>flatMap<\/code> and pass the function <code>A =&gt; Option[B]<\/code>, <code>flatMap<\/code> calls <code>map<\/code> and passes the same function, <strong>but<\/strong> the <code>B<\/code> in <code>flatMap<\/code> is not same <code>B<\/code> as in <code>map<\/code>. For example, if you pass some<\/p>\n\n<pre><code>Int =&gt; Option[String]\n<\/code><\/pre>\n\n<p>Then for <code>map<\/code>, <code>B = Option[String]<\/code> and will return <code>Option[Option[String]]<\/code>.<\/p>\n\n<p>Thus the <code>getOrElse<\/code> in <code>flatMap<\/code> to get the will either retrieve the inner <code>Option[B]<\/code> or return <code>None<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1419997892507,"favorite_count":null,"last_activity_date":1419997892507,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2292812.0,"parent_id":27715863,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":584,"id":27677143,"title":null,"body":"<p>I think this plugin will full fill your needs (<a href=\"https:\/\/github.com\/vliesaputra\/DeviceInformationPlugin\">https:\/\/github.com\/vliesaputra\/DeviceInformationPlugin<\/a>).\nIt will give the following data<\/p>\n\n<p>1.Your unique Device ID<\/p>\n\n<p>2.Phone Number (if it is stored in your SIM card)<\/p>\n\n<p>3.Country ISO of your phone network provider<\/p>\n\n<p>4.Name of your network provider<\/p>\n\n<p>5.Your SIM Card Serial number<\/p>\n\n<p>6.Country ISO of your SIM card\n7.Name of your SIM card mobile operator<\/p>\n\n<p>8.E-mail\/Phone number used by apps listed in your Settings > Accounts &amp; Sync list<\/p>\n\n<p>Here is sample code<\/p>\n\n<pre><code>var deviceInfo = cordova.require(\"cordova\/plugin\/DeviceInformation\");\ndeviceInfo.get(function(result) {\n \/\/fetch the device data\n console.log(\"result = \" + result);\n }, function() {\n console.log(\"error\");\n }); \n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1419775556893,"favorite_count":null,"last_activity_date":1419775556893,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2804362.0,"parent_id":27675370,"post_type_id":2,"score":6,"tags":null,"view_count":null},{"index":585,"id":27542669,"title":null,"body":"<p>If you're using Gradle to build, you can add the following to your AndroidManifest.xml to remove the permission:<\/p>\n\n<pre><code> &lt;uses-permission android:name=\"android.permission.READ_PHONE_STATE\" tools:node=\"remove\" \/&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1418893233140,"favorite_count":null,"last_activity_date":1427465957960,"last_edit_date":1427465957960,"last_editor_display_name":null,"last_editor_user_id":304876.0,"owner_display_name":null,"owner_user_id":304876.0,"parent_id":27410382,"post_type_id":2,"score":12,"tags":null,"view_count":null},{"index":586,"id":27696390,"title":null,"body":"<p>Your program seems to work as intended. I'm getting 45.55 hours. Have you tried to run it locally? <\/p>\n\n<p>Playground time is fixed, time.Now() will give you 2009-11-10 23:00:00 +0000 UTC always.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1419888904637,"favorite_count":null,"last_activity_date":1419888904637,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":2137314.0,"parent_id":27696309,"post_type_id":2,"score":15,"tags":null,"view_count":null},{"index":587,"id":27670456,"title":null,"body":"<p>The configuration isn't about the routing (despite the name) but more about the layouts driven by paths.<\/p>\n\n<p>So, with this configuration:<\/p>\n\n<pre><code>&lt;Route name=\"dashboard\" handler={availableRoutes.Dashboard}&gt;\n &lt;Route name=\"dashboard-child\" handler={availableRoutes.DashboardChild} \/&gt;\n&lt;\/Route&gt;\n<\/code><\/pre>\n\n<p>It is saying that <code>dashboard-child<\/code> is to be embedded inside <code>dashboard<\/code>. How this works is that if <code>dashboard<\/code> has something like this:<\/p>\n\n<pre><code>&lt;div&gt;&lt;h1&gt;Dashboard&lt;\/h1&gt;&lt;RouteHandler \/&gt;&lt;\/div&gt;\n<\/code><\/pre>\n\n<p>and <code>dashboard-child<\/code> has:<\/p>\n\n<pre><code>&lt;h2&gt;I'm a child of dashboard.&lt;\/h2&gt;\n<\/code><\/pre>\n\n<p>Then for the path <code>dashboard<\/code> there is no embedded child due to no matching path, resulting in this:<\/p>\n\n<pre><code>&lt;div&gt;&lt;h1&gt;Dashboard&lt;\/h1&gt;&lt;\/div&gt;\n<\/code><\/pre>\n\n<p>And for the path <code>dashboard\/dashboard-child<\/code> the embedded child has a matching path, resulting in this:<\/p>\n\n<pre><code>&lt;div&gt;&lt;h1&gt;Dashboard&lt;\/h1&gt;&lt;h2&gt;I'm a child of dashboard.&lt;\/h2&gt;&lt;\/div&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1419706371587,"favorite_count":null,"last_activity_date":1419706371587,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":722180.0,"parent_id":27612765,"post_type_id":2,"score":42,"tags":null,"view_count":null},{"index":588,"id":27478158,"title":null,"body":"<p>Here is the solution<\/p>\n\n<pre><code>sc.textFile(\"hdfs:\/\/nn1home:8020\/input\/war-and-peace.txt\")\n<\/code><\/pre>\n\n<p>How did I find out nn1home:8020?<\/p>\n\n<p>Just search for the file <code>core-site.xml<\/code> and look for xml element <code>fs.defaultFS<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1418622865977,"favorite_count":null,"last_activity_date":1536248217587,"last_edit_date":1536248217587,"last_editor_display_name":null,"last_editor_user_id":1841973.0,"owner_display_name":null,"owner_user_id":337134.0,"parent_id":27478096,"post_type_id":2,"score":61,"tags":null,"view_count":null},{"index":589,"id":27428848,"title":null,"body":"<p>Define the method manually after url option: <\/p>\n\n<pre><code>&lt;%= form_for :article, url: articles_path, method: :post %&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":5,"community_owned_date":null,"creation_date":1418318833593,"favorite_count":null,"last_activity_date":1486935259420,"last_edit_date":1486935259420,"last_editor_display_name":null,"last_editor_user_id":1772830.0,"owner_display_name":null,"owner_user_id":1772830.0,"parent_id":27428701,"post_type_id":2,"score":-1,"tags":null,"view_count":null},{"index":590,"id":27422529,"title":null,"body":"<p>Finally i got a solution for the problem. My answer may help to someone.<\/p>\n\n<p>I have installed 64 bit windows 8 and java jdk 32 bit. That's the problem when compiling hadoop hdfs native source.<\/p>\n\n<p>I just installed java jdk 64 bit and the problem is resolved.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":6,"community_owned_date":null,"creation_date":1418299685893,"favorite_count":null,"last_activity_date":1418299685893,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3496666.0,"parent_id":27271318,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":591,"id":27505188,"title":null,"body":"<p>You need to account for the fact that the <code>Font<\/code> size is specified in units of points, but the <code>AddString()<\/code> size is specified in device units.<\/p>\n\n<p>You can convert the units as follows:<\/p>\n\n<pre><code>Font font = new Font(\"Arial\", 14f, FontStyle.Bold);\nfloat emSize = e.Graphics.DpiY * font.Size \/ 72; \/\/ Here's the conversion.\ngraphicsPath.AddString(text, new FontFamily(\"Arial\"), (int)System.Drawing.FontStyle.Bold, emSize, new Point(0, 0), new StringFormat());\n<\/code><\/pre>\n\n<p>Note that I'm passing the calculated <code>emSize<\/code> to <code>AddString()<\/code> instead of passing <code>14f<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":6,"community_owned_date":null,"creation_date":1418734620917,"favorite_count":null,"last_activity_date":1418735839790,"last_edit_date":1418735839790,"last_editor_display_name":null,"last_editor_user_id":106159.0,"owner_display_name":null,"owner_user_id":106159.0,"parent_id":27504833,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":592,"id":27577137,"title":null,"body":"<p>As you're using XCode6.1 you can submit your build using Application Loader.<\/p>\n\n<blockquote>\n <p>Open XCode Menu -> Open Developer Tools -> (Select) Application Loader<\/p>\n<\/blockquote>\n\n<p>That's it, and follow the instruction.<\/p>\n\n<p>You may need to read,\n<a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/LanguagesUtilities\/Conceptual\/iTunesConnect_Guide\/Chapters\/SubmittingTheApp.html\" rel=\"nofollow\">Submitting the App<\/a>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":6,"community_owned_date":null,"creation_date":1419051979210,"favorite_count":null,"last_activity_date":1419051979210,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1603234.0,"parent_id":27577080,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":593,"id":27631198,"title":null,"body":"<p><strong>Update from comments:<\/strong> Your Emacs is version 22.1, which <a href=\"https:\/\/lists.gnu.org\/archive\/html\/info-gnu-emacs\/2007-06\/msg00000.html\" rel=\"nofollow noreferrer\">is ancient<\/a> and <a href=\"https:\/\/github.com\/realworldocaml\/book\/wiki\/Installation-Instructions#emacs\" rel=\"nofollow noreferrer\">too old for <code>tuareg<\/code><\/a>:<\/p>\n<blockquote>\n<p>These instructions have been tested on emacs 24.2 and should work for that version and newer. There are some reports of problems with earlier emacsen.<\/p>\n<\/blockquote>\n<p>My original answer recommending the use of MELPA follows, and still applies.<\/p>\n<p>This site that you linked suggests <a href=\"https:\/\/github.com\/realworldocaml\/book\/wiki\/Installation-Instructions#using-emacs24-packages\" rel=\"nofollow noreferrer\">an alternative to manually installing <code>tuareg<\/code><\/a>:<\/p>\n<blockquote>\n<h2>Using Emacs24 packages<\/h2>\n<p>As an alternative to the setup above, here is a simplified OCaml setup using MELPA packages.<\/p>\n<p>Add to <code>.emacs.d\/init.el<\/code><\/p>\n<pre class=\"lang-lisp prettyprint-override\"><code>(require 'package)\n(add-to-list 'package-archives\n '(&quot;melpa&quot; . &quot;http:\/\/melpa.milkbox.net\/packages\/&quot;) t)\n<\/code><\/pre>\n<p>Now do <code>M-x package-install<\/code> and install <code>tuareg<\/code>, <code>utop<\/code> and <code>merlin<\/code>.<\/p>\n<p>Then add the rest of the configuration to <code>.emacs.d\/init.el<\/code><\/p>\n<pre class=\"lang-lisp prettyprint-override\"><code>(add-hook 'tuareg-mode-hook 'tuareg-imenu-set-imenu)\n(setq auto-mode-alist\n (append '((&quot;\\\\.ml[ily]?$&quot; . tuareg-mode)\n (&quot;\\\\.topml$&quot; . tuareg-mode))\n auto-mode-alist)) \n(autoload 'utop-setup-ocaml-buffer &quot;utop&quot; &quot;Toplevel for OCaml&quot; t)\n(add-hook 'tuareg-mode-hook 'utop-setup-ocaml-buffer)\n(add-hook 'tuareg-mode-hook 'merlin-mode)\n(setq merlin-use-auto-complete-mode t)\n(setq merlin-error-after-save nil)\n<\/code><\/pre>\n<\/blockquote>\n<p>In my opinion this is a much better solution. Packages like this are the future of Emacs, and they are often easier to install and work with.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":6,"community_owned_date":null,"creation_date":1419392829757,"favorite_count":null,"last_activity_date":1419393830403,"last_edit_date":1592644375060,"last_editor_display_name":null,"last_editor_user_id":-1.0,"owner_display_name":null,"owner_user_id":354577.0,"parent_id":27631090,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":594,"id":27640670,"title":null,"body":"<p>Did you go over all the steps here: <a href=\"http:\/\/www.codenameone.com\/blog\/ios-code-signing-fail-checklist\" rel=\"nofollow\">http:\/\/www.codenameone.com\/blog\/ios-code-signing-fail-checklist<\/a><\/p>\n\n<p>Make sure the P12 file has a password.<\/p>\n\n<p>Make sure the package name of the main project matches the APP ID and that the app ID value is correct.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":6,"community_owned_date":null,"creation_date":1419443963983,"favorite_count":null,"last_activity_date":1419443963983,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":756809.0,"parent_id":27637846,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":595,"id":27394645,"title":null,"body":"<p><strong>EDIT<\/strong><\/p>\n\n<p>Invalid break tag<\/p>\n\n<pre><code>&lt;\/br&gt;&lt;!-- not this --&gt;\n&lt;br\/&gt;&lt;!-- try this --&gt;\n<\/code><\/pre>\n\n<p><strong><em>Grouping checkbox<\/em><\/strong><\/p>\n\n<p>Data is send in <code>name=value<\/code> pair.<\/p>\n\n<p>Try this:<\/p>\n\n<pre><code>&lt;input type=\"checkbox\" value=\"Maths\" name=\"Subject\"\/&gt;Maths\n&lt;input type=\"checkbox\" value=\"Physics\" name=\"Subject\"\/&gt;Physics\n<\/code><\/pre>\n\n<p>In the servlet use:<\/p>\n\n<pre><code>String[] Subjects = request.getParameterValues(\"Subject\");\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":7,"community_owned_date":null,"creation_date":1418193264357,"favorite_count":null,"last_activity_date":1418193846467,"last_edit_date":1418193846467,"last_editor_display_name":"user2575725","last_editor_user_id":null,"owner_display_name":"user2575725","owner_user_id":null,"parent_id":27394600,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":596,"id":27483551,"title":null,"body":"<p>That configuration has already been implemented (<a href=\"https:\/\/github.com\/allure-framework\/allure-jenkins-plugin\/pull\/39\" rel=\"nofollow\">https:\/\/github.com\/allure-framework\/allure-jenkins-plugin\/pull\/39<\/a>), but still not merged :( . <\/p>\n\n<p>So, IMO you have only few options. Either build snapshot artifact with that patch applied or launch Jenkins with JVM arg -Dallure.issues.tracker.pattern=<a href=\"http:\/\/your-bug-tracker.com\/%s\" rel=\"nofollow\">http:\/\/your-bug-tracker.com\/%s<\/a> (but you will have to ensure it exists for slave machines as well).<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":7,"community_owned_date":null,"creation_date":1418644677193,"favorite_count":null,"last_activity_date":1418644677193,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1307586.0,"parent_id":27482480,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":597,"id":27500346,"title":null,"body":"<p><code>edge-collection.save()<\/code> does not expect AQL statements as you are trying to insert. It is expecting raw <code>_id<\/code> attributes for from and to and as a thir parameter a JSON Object containing additional data for the edge.\nTo store the edge described in your example you can execute the following command:<\/p>\n\n<p><code>\nedge-collection.save(\"Sy\/403560128\", \"Im\/353031872\", points);\n ^^^^^ ^^^^^ ^^^^\n sourceId targetId JSON\n<\/code><\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":7,"community_owned_date":null,"creation_date":1418718309623,"favorite_count":null,"last_activity_date":1418718309623,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":3042327.0,"parent_id":27499740,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":598,"id":27715972,"title":null,"body":"<h1>Answer &amp; Demo<\/h1>\n\n<p>So it turns out there isn't a legit way of doing this, truth be told there isn't a lot of documentation about the subject and the plugin itself doesn't provide such functionability, or at least not in a user friendly way.<\/p>\n\n<p>But I went down to the guts of the code and <strong>managed to make it work<\/strong>.\nHere is a <a href=\"http:\/\/jsfiddle.net\/zncsd1d5\/7\/\" rel=\"nofollow\"><strong>JSFiddle<\/strong><\/a> where I demonstrate what I understood you wanted.<\/p>\n\n<h2>HTML<\/h2>\n\n<pre><code>&lt;div id=\"countdown\"&gt;&lt;\/div&gt;\n&lt;button id=\"start\"&gt;Start&lt;\/button&gt;\n&lt;button id=\"set60\"&gt;Set 60s&lt;\/button&gt;\n&lt;button id=\"set120\"&gt;Set 120s&lt;\/button&gt;\n&lt;button id=\"reset\"&gt;Reset&lt;\/button&gt;\n<\/code><\/pre>\n\n<h2>JavaScript<\/h2>\n\n<pre><code>start = document.querySelector(\"#start\");\nset60 = document.querySelector(\"#set60\");\nset120 = document.querySelector(\"#set120\");\nreset = document.querySelector(\"#reset\");\n\ndiv = $(\"#countdown\");\npingSound = new Audio(\"http:\/\/www.sounddogs.com\/previews\/2220\/mp3\/402763_SOUNDDOGS__mu.mp3\");\npingSound.preload = \"auto\"; \/\/&lt;- Optional but recommended\n\ncountdown = div.countdown360({\n radius: 50,\n seconds: 30,\n fontColor: '#FFFFFF',\n autostart: false,\n onComplete: function () {\n pingSound.play();\n }\n});\n\ncountdown.start(); \/\/This right here is for showing the clock on load.\ncountdown.stop();\n\nstart.onclick = function () {\n startCountdown(countdown);\n}\nset60.onclick = function () {\n setSeconds(countdown, 60);\n}\nset120.onclick = function () {\n setSeconds(countdown, 120);\n}\nreset.onclick = function () {\n setSeconds(countdown, 0);\n}\n\nfunction startCountdown(countdown) {\n countdown.start();\n}\n\nfunction setSeconds(countdown, seconds) {\n countdown.stop();\n countdown.settings.seconds = seconds;\n countdown.start();\n}\n<\/code><\/pre>\n\n<h2>Explanation<\/h2>\n\n<h3>Variables<\/h3>\n\n<ul>\n<li><strong>start, set60, set120, reset<\/strong> : Link to their respective <code>button<\/code> elements.<\/li>\n<li><strong>div<\/strong> : Link to the countdown <code>div<\/code> element.<\/li>\n<li><strong>pingSound<\/strong> : <code>Audio<\/code> element that contains the \"ping\" sound.<\/li>\n<li><strong>countdown<\/strong> : The countdown object itself, you <em>need<\/em> to declare it like this, passing the initial properties and saving it in a variable.<\/li>\n<\/ul>\n\n<h3>Functions<\/h3>\n\n<ul>\n<li><strong>startCountdown(<em>countdown<\/em>)<\/strong> : Takes any countdown object and start's it's execution, this will get the countdown running.<\/li>\n<li><strong>setSeconds(<em>countdown<\/em>,<em>seconds<\/em>)<\/strong> : Takes any countdown object and set's it second (it can be used in mid-excecution). It works by first stopping the countdown, then updating the <code>Countdown.settings.seconds<\/code> property, which is the actual seconds the countdown will run.<\/li>\n<\/ul>\n\n<h3>Development<\/h3>\n\n<p>With those <em>variables &amp; methods<\/em>, how I did it is pretty straight forward.<\/p>\n\n<p><strong>If you want the clock hidden until you play it:<\/strong><\/p>\n\n<p>We first create the countdown object and hide the div.<\/p>\n\n<pre><code>div = $(\"#countdown\");\ndiv.css( \"display\" , \"none\" );\n\ncountdown = div.countdown360({..});\n<\/code><\/pre>\n\n<p><strong>Why?<\/strong> Well because of <em>how the plugin works<\/em>. As soon as you create the countdown your div is made bigger by the plugin, and you need to create the countdown there because that's the only way it works, so if you don't want a blank square of nothing (since we haven't started the countdown) you have to hide the div itself.<\/p>\n\n<p>So, we add an <code>onclick<\/code> event to each button:<\/p>\n\n<ul>\n<li>for <code>start<\/code> -> <code>startCountdown(countdown) , div.css( \"display\" , \"block\" );<\/code> -> Starts the countdown and shows the div.<\/li>\n<li>for <code>set60<\/code> -> <code>setSeconds(countdown,60)<\/code> -> Sets the countdown to 60s.<\/li>\n<li>for <code>set120<\/code> -> <code>setSeconds(countdown,120)<\/code> -> Sets the countdown to 120s.<\/li>\n<li>for <code>set0<\/code> -> <code>setSeconds(countdown,0)<\/code> -> Sets the countdown to 0s.<\/li>\n<\/ul>\n\n<p>And that's it, it took me a while to figure out, hopefully I didn't just bore you to death, and may I suggest getting a better plugin next time? Good luck :)<\/p>\n\n<p><strong>If you want the clock displayed on load:<\/strong><\/p>\n\n<p>Okey, so this is an update upon your request, if we part from my original code, to make the div appear on load is quite simple (JSFiddle &amp; code here have been updated)<\/p>\n\n<p>We first create the countdown object, then start it and inmeadiatly stop it (freezing it until you start it again).<\/p>\n\n<pre><code>countdown = div.countdown360({..});\n\ncountdown.start();\ncountdown.stop();\n<\/code><\/pre>\n\n<p>Now, we add the same <code>onclick<\/code> events to the buttons except for the start button, which will no longer have to display the div as block as it isn't hidden.<\/p>\n\n<ul>\n<li>for <code>start<\/code> -> <code>startCountdown(countdown)<\/code> -> Starts the countdown.<\/li>\n<li>(..)<\/li>\n<\/ul>\n\n<p><strong>If you want to play a sound at the end of the countdown:<\/strong><\/p>\n\n<p>For the ping sound to play in the end, you just need to create a new <code>Audio<\/code> object with the mp3\/ogg src as a parameter:<\/p>\n\n<pre><code>pingSound = new Audio(\"http:\/\/www.sounddogs.com\/previews\/2220\/mp3\/402763_SOUNDDOGS__mu.mp3\");\n<\/code><\/pre>\n\n<p>Then, preload the audio so it's ready to play (otherwise when you call play it will first have to load). This is optional but recommended.<\/p>\n\n<pre><code>pingSound.preload = \"auto\";\n<\/code><\/pre>\n\n<p>And then call the <code>Audio.play()<\/code> function in the countdown's <code>onComplete<\/code> event.<\/p>\n\n<pre><code>countdown = div.countdown360({\n (..)\n onComplete:function(){\n pingSound.play();\n }\n});\n<\/code><\/pre>\n\n<p>That's it, happy coding :)<\/p>\n\n<h2>Updates<\/h2>\n\n<ul>\n<li>Updated code to display the clock on load (<em>1:43p.m 31\/12\/14<\/em>)<\/li>\n<li>Updated code to play sound in the end of countdown(<em>6:10p.m 02\/01\/14<\/em>)<\/li>\n<\/ul>","accepted_answer_id":null,"answer_count":null,"comment_count":7,"community_owned_date":null,"creation_date":1419998616013,"favorite_count":null,"last_activity_date":1420233036153,"last_edit_date":1420233036153,"last_editor_display_name":null,"last_editor_user_id":3750762.0,"owner_display_name":null,"owner_user_id":3750762.0,"parent_id":27714959,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":599,"id":27673635,"title":null,"body":"<p>You can make use of a <strong>different file descriptor<\/strong>:<\/p>\n\n<pre><code>{ cmd 2&gt;&amp;3 | stdout_1; } 3&gt;&amp;1 1&gt;&amp;2 | stderr_1\n<\/code><\/pre>\n\n<p><strong>Example:<\/strong><\/p>\n\n<pre><code>{ { echo 'out'; echo &gt;&amp;2 'error'; } 2&gt;&amp;3 | awk '{print \"stdout: \" $0}'; } 3&gt;&amp;1 1&gt;&amp;2 |\n awk '{print \"stderr: \" $0}'\nstderr: error\nstdout: out\n<\/code><\/pre>\n\n<p>Or else use <strong>process substitution<\/strong>:<\/p>\n\n<pre><code>cmd 2&gt; &gt;(stderr_1) &gt; &gt;(stdout_1)\n<\/code><\/pre>\n\n<p><strong>Example:<\/strong><\/p>\n\n<pre><code>{ echo 'out'; echo &gt;&amp;2 'error'; } 2&gt; &gt;(awk '{print \"stderr: \" $0}') \\\n&gt; &gt;(awk '{print \"stdout: \" $0}')\nstderr: error\nstdout: out\n<\/code><\/pre>\n\n<p>to pipe stdout and stderr <strong>separately<\/strong> from your <code>cmd<\/code>.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":7,"community_owned_date":null,"creation_date":1419739923773,"favorite_count":null,"last_activity_date":1420894575110,"last_edit_date":1420894575110,"last_editor_display_name":null,"last_editor_user_id":548225.0,"owner_display_name":null,"owner_user_id":548225.0,"parent_id":27673595,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":600,"id":27635523,"title":null,"body":"<p>It's probably because there's not enough heap memory for AS. You might want to try the first technique mentioned in this blog: <a href=\"http:\/\/geek.moneylover.me\/android-studio-eliminate-shutter-n-lag\/\" rel=\"noreferrer\">Eliminate Lags &amp; Stutters in Android Studio<\/a>.<\/p>\n\n<p>Content of link<\/p>\n\n<p><strong>Increasing Android Studio's Memory Heap:<\/strong><\/p>\n\n<p>Android Studio, like other Java applications, is known for hogging an insane amount of memory while running. Unless enough memory is allocated to the IDE at launch, disk swapping will start kicking in and if you're not using a SSD, God bless you.<\/p>\n\n<p>Open the file <code>[AS Installation Folder]\\bin\\studio64.exe.vmoptions<\/code> or <code>studio.exe.vmoptions<\/code>, depending on which version you're using.<\/p>\n\n<p>In it you're likely to find these two lines at the top:<\/p>\n\n<pre><code>-Xms128m\n-Xmx750m\n<\/code><\/pre>\n\n<p>Increase the two values to something reasonable, e.g. <code>-Xms256<\/code> and <code>-Xmx1024<\/code>. \nYou can boost the second value to 2048 if you like; my coworker whose computer has 8G of RAM doesn't find any issue with -Xmx2048 either.<\/p>\n\n<p>After you're done, restart AS and if you've checked Show memory indicator in Settings\/Appearance, you'll see something like this at the bottom-right corner:<\/p>\n\n<p><a href=\"https:\/\/i.stack.imgur.com\/UK5Vs.png\" rel=\"noreferrer\"><img src=\"https:\/\/i.stack.imgur.com\/UK5Vs.png\" alt=\"enter image description here\"><\/a><\/p>\n\n<p><strong>Speeding up Gradle build time<\/strong><\/p>\n\n<p>One of the reasons developers are still hesistant to ditch Eclipse is because of Gradle.\nAlthough it's indeed a nice build system and there are many benefits to using it, even the simplest Gradle calls are pretty slow and time-consuming. As a consequence, our workflow includes a lot of unavoidable waiting, and sometimes we even forget what needs to be tested after AS finishes its laborious building processes.\nThere are a few things we do to boost Gradle's speed.<\/p>\n\n<p>First, go to <code>Settings\/Compiler<\/code> and check everything, except for the 2nd option Make project automatically. \nFor VM Options, we use these configurations:<\/p>\n\n<pre><code>-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n<\/code><\/pre>\n\n<p>Next, add the following lines to gradle.properties in your project directory:<\/p>\n\n<pre><code>org.gradle.daemon=true\norg.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\norg.gradle.parallel=true\norg.gradle.configureondemand=true\n<\/code><\/pre>\n\n<p><strong>Accelerating the emulator with hardware virtualization<\/strong><\/p>\n\n<p>Although the Android emulator is not part of Android Studio, it's well worth mentioning that if you're using one of the newer Intel CPUs which support hardware virtualization, the emulator can be amazingly fast. Check out this article for how to set it up on your machine.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":7,"community_owned_date":null,"creation_date":1419417406977,"favorite_count":null,"last_activity_date":1453971880753,"last_edit_date":1453971880753,"last_editor_display_name":null,"last_editor_user_id":2655678.0,"owner_display_name":null,"owner_user_id":4159941.0,"parent_id":27540695,"post_type_id":2,"score":63,"tags":null,"view_count":null},{"index":601,"id":27442251,"title":null,"body":"<p>Try using this code, instead. It will switch to the <strong>iframe having 'target attribute' as 'main' and 'display attribute' as 'block'<\/strong>:<\/p>\n\n<pre><code>try{\n WebDriverWait wait1 = new WebDriverWait(_driver, 60);\n wait1.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.xpath(\"\/\/iframe[@target='main' and @display='block']\")));\n}catch(Throwable e){\n System.err.println(\"Error while switching to frame. \"+e.getMessage());\n}\n<\/code><\/pre>\n\n<h2>EDIT<\/h2>\n\n<p>Otherwise if at a time only one frame is visible, try this below code to switch to it:<\/p>\n\n<pre><code>driver.switchTo().frame(0);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":8,"community_owned_date":null,"creation_date":1418382226627,"favorite_count":null,"last_activity_date":1418387825643,"last_edit_date":1418387825643,"last_editor_display_name":null,"last_editor_user_id":4193730.0,"owner_display_name":null,"owner_user_id":4193730.0,"parent_id":27442024,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":602,"id":27702896,"title":null,"body":"<p>What you're doing here is just creating a global reference to the loaded <em>class<\/em>:<\/p>\n\n<pre><code>jclass clazz = env-&gt;FindClass(\"com\/example\/ledemo\/MainActivity\");\n\ngActivity = (jobject)env-&gt;NewGlobalRef(clazz);\n<\/code><\/pre>\n\n<p>You're not creating an <em>instance of that class<\/em>, which is what <code>setAppContext<\/code> expects.<\/p>\n\n<p>Your declaration of <code>setJNI<\/code> is also a bit incorrect. Instead of:<\/p>\n\n<pre><code>extern \"C\" void Java_com_example_ledemo_MainActivity_setJNI(\n JNIEnv* env,\n jclass clazz,\n jobject assetManager)\n<\/code><\/pre>\n\n<p>it should be:<\/p>\n\n<pre><code>extern \"C\" void Java_com_example_ledemo_MainActivity_setJNI(\n JNIEnv* env,\n jobject thiz, \/\/ &lt;-- note the difference here\n jobject assetManager)\n<\/code><\/pre>\n\n<p>The <code>jobject thiz<\/code> argument is a reference to the Java object on which the native method was invoked (i.e. your <code>MainActivity<\/code>). So you should be able to pass <code>thiz<\/code> as the second argument to <code>setAppContext<\/code> (I'm not sure if you need to create a global reference to it as well).<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":8,"community_owned_date":null,"creation_date":1419932218793,"favorite_count":null,"last_activity_date":1419932218793,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1524450.0,"parent_id":27702391,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":603,"id":27401944,"title":null,"body":"<p>This line:<\/p>\n\n<pre><code>esrbConfirmationDialog.modal('hide');\n<\/code><\/pre>\n\n<p>Is hiding the second dialog. <\/p>\n\n<hr>\n\n<p>EDIT:\nBoth dialogs use the same div as there reference: <\/p>\n\n<pre><code>var esrbAlertDialog = $('#esrb-dialog');\n<\/code><\/pre>\n\n<p>Create seperate dialogs one for the alert and one for confirmation.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":8,"community_owned_date":null,"creation_date":1418217220843,"favorite_count":null,"last_activity_date":1418228664357,"last_edit_date":1418228664357,"last_editor_display_name":null,"last_editor_user_id":1537154.0,"owner_display_name":null,"owner_user_id":1537154.0,"parent_id":27401843,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":604,"id":27477561,"title":null,"body":"<p>Sks files are serialized SKScene objects. The intent is to provide something like interface builder for constructing SKScene scenes visually. The common use case is to layout complex backgrounds or levels and define starting positions. You would only have one file per scene in many cases. However you can use the sks files to organize and serialize conceptual components of a scene, as demonstrated in versions of the Apple Adventure sample code released since the sks format and scene editor were introduced with Xcode 6<\/p>\n\n<p>In the screenshot above, you could organize the project into sections that are fairly generic and reusable, like the keyboard for one file and the hud atop the scene for another file. However, you could put them all in one file, then duplicate the file for variations on a theme.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":8,"community_owned_date":null,"creation_date":1418619079490,"favorite_count":null,"last_activity_date":1418660877893,"last_edit_date":1418660877893,"last_editor_display_name":null,"last_editor_user_id":1722462.0,"owner_display_name":null,"owner_user_id":1722462.0,"parent_id":27476787,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":605,"id":27537306,"title":null,"body":"<p>The <code>sqlite3_prepare_v2<\/code> only prepares a statement, you need to use <code>sqlite3_step<\/code> for executing it.<\/p>\n\n<pre><code> if (sqlite3_prepare_v2(myDatabase, query_stmt, -1, &amp;statement, NULL) == SQLITE_OK)\n {\n if(sqlite3_step(statement) == SQLITE_DONE)\n {\n NSLog(@\"statement deleted successfully\");\n }\n }\n<\/code><\/pre>\n\n<p>For referece:<\/p>\n\n<ol>\n<li><a href=\"https:\/\/www.safaribooksonline.com\/library\/view\/using-sqlite\/9781449394592\/re325.html\" rel=\"nofollow\">sqlite_step<\/a><\/li>\n<li><a href=\"https:\/\/www.sqlite.org\/c3ref\/step.html\" rel=\"nofollow\">Evaluate An SQL Statement<\/a><\/li>\n<\/ol>","accepted_answer_id":null,"answer_count":null,"comment_count":8,"community_owned_date":null,"creation_date":1418862628700,"favorite_count":null,"last_activity_date":1418863008427,"last_edit_date":1418863008427,"last_editor_display_name":null,"last_editor_user_id":1104384.0,"owner_display_name":null,"owner_user_id":1104384.0,"parent_id":27537133,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":606,"id":27395762,"title":null,"body":"<p>In addition to the syntax problem explained by IanH - you must use <code>character(*)<\/code> in select type - I will add something to your second problem. Possibly that should have been a new question.<\/p>\n\n<p>You cannot assume that you know that two objects have the same dynamic type. You have to list all of them as selectors in <code>select type<\/code> otherwise the non-listed ones remain polymorphic. This is the very same reason why you use <code>select type<\/code> for <code>t1<\/code>.<\/p>\n\n<p>I will also ads that it seems that your routine <code>splits_str_to_str<\/code> accepts optional arguments. In that case you don't have to test presents of all of them, you can pass them as optional actual arguments even if not present.<\/p>\n\n<p>Unfortunately, to use them in <code>select type<\/code> as selectors you still need to test their presence.<\/p>\n\n<p>One big design question remains. Why doesn't have <code>splits<\/code> <code>character<\/code> dummy arguments? Why it needs unlimited polymorphics?<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":8,"community_owned_date":null,"creation_date":1418197766067,"favorite_count":null,"last_activity_date":1418198175643,"last_edit_date":1418198175643,"last_editor_display_name":null,"last_editor_user_id":721644.0,"owner_display_name":null,"owner_user_id":721644.0,"parent_id":27392400,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":607,"id":27438181,"title":null,"body":"<p>Problem is not using regex delimiters, use:<\/p>\n\n<pre><code>preg_match_all('~&lt;!--\\*\\*(\\w+)\\*\\*--&gt;~', $content, $matches);\n<\/code><\/pre>\n\n<p><strong>Or better use <code>s<\/code> (DOTALL) flag with <code>.*?<\/code> to match multiline comments as well:<\/strong><\/p>\n\n<pre><code>preg_match_all('~&lt;!--\\*\\*(.*?)\\*\\*--&gt;~s', $content, $matches);\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":8,"community_owned_date":null,"creation_date":1418366262273,"favorite_count":null,"last_activity_date":1418366262273,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":548225.0,"parent_id":27438165,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":608,"id":27458683,"title":null,"body":"<p>Anyhow, mule leverages a hyerarchical classpath isolating intentionally the applications to reduce clashing. Please, read this <a href=\"http:\/\/www.mulesoft.org\/documentation\/display\/current\/Classloader+Control+in+Mule\" rel=\"nofollow\">document<\/a> to understand it better.<\/p>\n\n<p>If what you have is some kind of shared utility, why not just create a common project that creates a jar and then just have both projects to depend on it?<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":9,"community_owned_date":null,"creation_date":1418473136267,"favorite_count":null,"last_activity_date":1418473136267,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":912190.0,"parent_id":27454741,"post_type_id":2,"score":0,"tags":null,"view_count":null},{"index":609,"id":27737466,"title":null,"body":"<p>Do you mean <a href=\"https:\/\/github.com\/jgritman\/httpbuilder\/blob\/master\/src\/main\/java\/groovyx\/net\/http\/HTTPBuilder.java\" rel=\"nofollow\">groovyx.net.http.HTTPBuilder<\/a>? It has several fields that are modified by calling methods, and there's no synchronization or locking, and no use of thread-safe collections or other classes, so no, it's very much non-thread-safe. Most builders are similarly stateful and should be assumed to not be thread-safe.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":9,"community_owned_date":null,"creation_date":1420173874770,"favorite_count":null,"last_activity_date":1420173874770,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":160313.0,"parent_id":27737175,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":610,"id":27709701,"title":null,"body":"<p>Your expression is not sufficient, as the <code>lexical_cast<\/code> function template takes everything and only reports errors via an internal <code>static_assert<\/code>. Instead test whether inserting the object into an <code>std::ostream<\/code> is valid:<\/p>\n\n<pre><code>template &lt;typename T, typename=void&gt;\nstruct IsLexCastable : std::false_type {};\n\n\/\/ Can be extended to consider std::wostream as well for completeness\ntemplate &lt;typename T&gt;\nstruct IsLexCastable&lt;T,\n decltype(void(std::declval&lt;std::ostream&amp;&gt;() &lt;&lt; std::declval&lt;T&gt;()))&gt;\n : std::true_type {};\n<\/code><\/pre>\n\n<p><a href=\"http:\/\/coliru.stacked-crooked.com\/a\/6e9f34665aacb9cb\" rel=\"nofollow\"><strong>Demo<\/strong><\/a>.<br>\nThat requirement is called <em>OutputStreamable<\/em> by <a href=\"http:\/\/www.boost.org\/doc\/libs\/1_40_0\/libs\/conversion\/lexical_cast.htm#lexical_cast\" rel=\"nofollow\"><strong>the documentation<\/strong><\/a>, and the direct one imposed onto the source type.<\/p>\n\n<p><hr><\/p>\n\n<h3>Why did your implementation not work?<\/h3>\n\n<p><code>decltype<\/code> only causes the <strong>instantiation of the declaration<\/strong> of a function template. The internal static assertion is triggered inside the definition of <code>lexical_cast<\/code> though, hence it cannot be used in SFINAE.<\/p>\n\n<p>[temp.inst]\/10:<\/p>\n\n<blockquote>\n <p>If a function template or a member function template specialization\n <strong>is used in a way that involves overload resolution, a declaration of the specialization is implicitly instantiated (14.8.3).<\/strong><\/p>\n<\/blockquote>","accepted_answer_id":null,"answer_count":null,"comment_count":9,"community_owned_date":null,"creation_date":1419959947057,"favorite_count":null,"last_activity_date":1419962156820,"last_edit_date":1419962156820,"last_editor_display_name":null,"last_editor_user_id":3647361.0,"owner_display_name":null,"owner_user_id":3647361.0,"parent_id":27709461,"post_type_id":2,"score":5,"tags":null,"view_count":null},{"index":611,"id":27642261,"title":null,"body":"<p>In the Contacts provider, the \"connections\" of a Contact are just all the entries in <a href=\"https:\/\/developer.android.com\/reference\/android\/provider\/ContactsContract.RawContacts.html\" rel=\"nofollow\"><code>RawContacts<\/code><\/a> for that particular <a href=\"https:\/\/developer.android.com\/reference\/android\/provider\/ContactsContract.RawContactsColumns.html#CONTACT_ID\" rel=\"nofollow\"><code>CONTACT_ID<\/code><\/a>. And their data is stored in the <a href=\"https:\/\/developer.android.com\/reference\/android\/provider\/ContactsContract.Data.html\" rel=\"nofollow\"><code>Data<\/code><\/a> table. <\/p>\n\n<p>Therefore, to get all the info on all the connections of a contact, it's enough to query the <code>Data<\/code> table with the appropriate filter. For example:<\/p>\n\n<pre><code>private static void getConnections(Context context, int contactId)\n{\n \/\/ Read all data for contactId\n String selection = RawContacts.CONTACT_ID + \" = ?\";\n String[] selectionArgs = new String[] { String.valueOf(contactId) };\n\n Cursor c = context.getContentResolver().query(ContactsContract.Data.CONTENT_URI, null, selection, selectionArgs, null);\n while (c.moveToNext())\n {\n String accountType = c.getString(c.getColumnIndexOrThrow(ContactsContract.RawContacts.ACCOUNT_TYPE));\n String accountName = c.getString(c.getColumnIndexOrThrow(ContactsContract.RawContacts.ACCOUNT_NAME));\n String dataMimeType = c.getString(c.getColumnIndexOrThrow(ContactsContract.Data.MIMETYPE));\n String dataValue = c.getString(c.getColumnIndexOrThrow(ContactsContract.Data.DATA1));\n\n Log.d(\"contactInfo\", accountName + \" (\" + accountType + \") - \" + dataMimeType + \" - \" + dataValue);\n }\n\n c.close();\n}\n<\/code><\/pre>\n\n<p>You can filter this data by using more restrictive <code>selection<\/code> \/ <code>selectionArgs<\/code> arguments (such as for a specific <code>ACCOUNT_TYPE<\/code>, <code>MIMETYPE<\/code>, and so forth).<\/p>\n\n<p>Of course, you need the appropriate permission in AndroidManifest.xml:<\/p>\n\n<pre><code>&lt;uses-permission android:name=\"android.permission.READ_CONTACTS\" \/&gt;\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":10,"community_owned_date":null,"creation_date":1419456030930,"favorite_count":null,"last_activity_date":1419456030930,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":82788.0,"parent_id":27480150,"post_type_id":2,"score":3,"tags":null,"view_count":null},{"index":612,"id":27699238,"title":null,"body":"<p>Unfortunately you've asked your question rather badly - you have not said what it is that you are actually trying to do! It looks, however, as if you might be trying to punch a rectangular hole in your image view using a mask. If so, your code has at least three huge flaws.<\/p>\n\n<ul>\n<li><p>One reason your code is not working is that a mask is based on transparency, not on color. You are using an opaque white and an opaque black, which are both opaque, so there is no difference there. You need your two colors to be like this:<\/p>\n\n<pre><code> var color = UIColor(white: 1.0, alpha: 1.0)\n\/\/ ... and then, later ...\ncolor = UIColor(white: 1.0, alpha: 0.0)\n<\/code><\/pre><\/li>\n<li><p>The second problem is that your layer has no size. You need to give it one:<\/p>\n\n<pre><code>var maskLayer = CALayer()\nmaskLayer.frame = CGRectMake(\n 0, 0, self.imageView.bounds.width, self.imageView.bounds.height)\n<\/code><\/pre><\/li>\n<li><p>The third and biggest problem is that your mask image is never getting into your mask layer, because you have forgotten to extract its <code>CGImage<\/code>:<\/p>\n\n<pre><code>maskLayer.contents = maskImage.CGImage\n<\/code><\/pre><\/li>\n<\/ul>\n\n<p>That last one is really the killer, because if you set the <code>contents<\/code> to a UIImage without extracting its <code>CGImage<\/code>, the image fails <em>silently<\/em> to get into the layer. There is no error message, no crash - and no image.<\/p>\n\n<p>Making those three corrections in your code, I was able to make the mask punch a rectangular hole in an image. So if that's your purpose, those changes will achieve it.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":10,"community_owned_date":null,"creation_date":1419910017113,"favorite_count":null,"last_activity_date":1419954449477,"last_edit_date":1419954449477,"last_editor_display_name":null,"last_editor_user_id":341994.0,"owner_display_name":null,"owner_user_id":341994.0,"parent_id":27699098,"post_type_id":2,"score":13,"tags":null,"view_count":null},{"index":613,"id":27550659,"title":null,"body":"<p>You can fudge it with the x axis label's <code>x<\/code> property.<\/p>\n\n<p>Example:<\/p>\n\n<ul>\n<li><a href=\"http:\/\/jsfiddle.net\/jlbriggs\/3qtZr\/36\/\" rel=\"nofollow\">http:\/\/jsfiddle.net\/jlbriggs\/3qtZr\/36\/<\/a><\/li>\n<\/ul>\n\n<p>[[update after comments:<\/p>\n\n<p>if you mean that you want the data points to also line up 'between', then there isn't a good easy way.<\/p>\n\n<p>My approach would be <\/p>\n\n<p>1) make sure there is only one data point per axis tick, ideally<\/p>\n\n<p>2) adjust the x value of the data point to push it to the right in a way that corresponds with the label offset<\/p>\n\n<p>3) adjust tooltip formatters to correct the date for display<\/p>\n\n<p>or, 4) just go with categories<\/p>\n\n<p>However, if you can explain why you want to do this, what effect you're going for, perhaps there's more that can be done.<\/p>\n\n<p>{{<strong>further updates<\/strong>:<\/p>\n\n<p>After playing around a little more, I found another way to fudge the data point placement, though I am unclear whether you need that.<\/p>\n\n<p>Example here:<\/p>\n\n<ul>\n<li><a href=\"http:\/\/jsfiddle.net\/jlbriggs\/3qtZr\/39\/\" rel=\"nofollow\">http:\/\/jsfiddle.net\/jlbriggs\/3qtZr\/39\/<\/a><\/li>\n<\/ul>\n\n<p>It uses the <code>pointPlacement<\/code> property.\nThe catch is that the pointPlacement property doesn't work if there is not a columns series present with as many data points as the line series, it seems.<\/p>\n\n<p>So this method adds and hidden dummy column series in order to make the <code>pointPlacement<\/code> property affect the line series.<\/p>\n\n<p>Not elegant, but it beats having to adjust the data values and then re-adjust them in the formatter.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":11,"community_owned_date":null,"creation_date":1418918185087,"favorite_count":null,"last_activity_date":1420035508780,"last_edit_date":1420035508780,"last_editor_display_name":null,"last_editor_user_id":1011544.0,"owner_display_name":null,"owner_user_id":1011544.0,"parent_id":27544218,"post_type_id":2,"score":1,"tags":null,"view_count":null},{"index":614,"id":27717217,"title":null,"body":"<p>You can add <code>OnClick<\/code> event for <code>Button<\/code> as below, no need of specifying <code>CommandName<\/code><\/p>\n\n<pre><code>&lt;asp:LinkButton ID=\"LinkEmail\" runat=\"server\" CommandArgument='&lt;%# Eval(\"Email\") %&gt;' OnClick=\"LinkEmail_Click\"&gt;&lt;%#Eval(\"Email\") %&gt;&lt;\/asp:LinkButton&gt;\n<\/code><\/pre>\n\n<p>And in code-behind you can add event call<\/p>\n\n<pre><code>protected void LinkEmail_Click(object sender, EventArgs e)\n{\n string emailId = (sender as LinkButton).CommandArgument;\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":11,"community_owned_date":null,"creation_date":1420007894750,"favorite_count":null,"last_activity_date":1420009017453,"last_edit_date":1420009017453,"last_editor_display_name":null,"last_editor_user_id":1665670.0,"owner_display_name":null,"owner_user_id":1665670.0,"parent_id":27716768,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":615,"id":27482831,"title":null,"body":"<p>Solved with the following tasks:<\/p>\n\n<pre><code>task jarTask(type: Jar) {\n baseName=\"my-sdk-android\"\n from 'src\/main\/java'\n}\n\ntask createJarWithDependencies(type: Jar) {\n baseName = \"my-sdk-android-jar-with-dependencies\"\n\n from {\n configurations.compile.collect {\n it.isDirectory() ? it : zipTree(it)\n }\n\n }\n\n with jarTask\n}\n\nconfigurations {\n jarConfiguration\n}\n\nartifacts {\n jarConfiguration jarTask\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":11,"community_owned_date":null,"creation_date":1418642209047,"favorite_count":null,"last_activity_date":1418642209047,"last_edit_date":null,"last_editor_display_name":null,"last_editor_user_id":null,"owner_display_name":null,"owner_user_id":1170945.0,"parent_id":27422722,"post_type_id":2,"score":12,"tags":null,"view_count":null},{"index":616,"id":27398958,"title":null,"body":"<p>your controller is messy and incorrect, extra <code>}<\/code> &amp; <code>)<\/code><\/p>\n\n<pre><code>nameSpace.controller(\"MyInfoFunction\", function MyInfoFunction($scope, testService) {\n\n function Init() {\n $scope.data = {};\n testService.getData().then(function(data) {\n $scope.myinfoVariable = data.data;\n \/\/ console.log(data) \n });\n }\n Init();\n});\n<\/code><\/pre>\n\n<p>your .json should be like<\/p>\n\n<pre><code>[\n {\"name\":\"a\",\"city\":\"b\",\"state\":\"c\"},\n {\"name\":\"x\",\"city\":\"y\",\"state\":\"z\"}\n]\n<\/code><\/pre>\n\n<p>if your data.json file is in inside of the <code>js<\/code> folder then the getting json should be like<\/p>\n\n<pre><code> this.getData = function () {\n return $http.get('js\/data.json');\n}\n<\/code><\/pre>","accepted_answer_id":null,"answer_count":null,"comment_count":12,"community_owned_date":null,"creation_date":1418208170760,"favorite_count":null,"last_activity_date":1418209391817,"last_edit_date":1418209391817,"last_editor_display_name":null,"last_editor_user_id":2032751.0,"owner_display_name":null,"owner_user_id":2032751.0,"parent_id":27398680,"post_type_id":2,"score":4,"tags":null,"view_count":null},{"index":617,"id":27587246,"title":null,"body":"<p>The garbage collector - the Reaper, as it's sometimes known - runs on its own schedule, and collects objects which are out of reference. \nThe local variables, of course, cannot be referenced after the method exits, because they are out of scope, so to your program they are dead*, but they still exist on the heap until the GC runs. <\/p>\n\n<p>Under normal circumstances (and most abnormal ones) you do not need to tell the Reaper when to do its work. It will come, silently, when it is needed, and carry away those things which are no longer needed. This is one of the major advantages of working in a high-level language: it's safe to assume that you never need to think about things like managing deallocation of dead objects. You can just toss them over your shoulder and know that they will never bother you. I suppose there are some high-performance, high-demand applications that need to fiddle with the GC, but that's an optimization which should always be presumed premature unless you have really good evidence to the contrary. <\/p>\n\n<p>*except, of course, for local variables which are returned to the calling function, which may become local variables in that scope and gain a little more lease on life. In general, the rule is: if some part of your code still cares about the variable, it will not be garbage collected, and if no part of your program cares about it, then you don't need to think about it.<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":12,"community_owned_date":null,"creation_date":1419143443810,"favorite_count":null,"last_activity_date":1526923920970,"last_edit_date":1526923920970,"last_editor_display_name":null,"last_editor_user_id":405303.0,"owner_display_name":null,"owner_user_id":405303.0,"parent_id":27587219,"post_type_id":2,"score":7,"tags":null,"view_count":null},{"index":618,"id":27750389,"title":null,"body":"<p>Inside the <code>.content<\/code> div, try wrapping the <code>list-test<\/code> with a <code>session<\/code> and you will have a scollable list again. Please see this <a href=\"http:\/\/jsbin.com\/vufigipega\/1\/\" rel=\"nofollow\">jsbin<\/a>.<\/p>\n\n<pre><code>&lt;div class=\"content\"&gt;\n &lt;core-animated-pages id=\"pages\" selected=\"0\"&gt;\n &lt;session&gt;\n &lt;list-test id=\"list\" data=\"{{data}}\"&gt;&lt;\/list-test&gt;\n &lt;\/session&gt;\n &lt;\/core-animated-pages&gt;\n&lt;\/div&gt;\n<\/code><\/pre>\n\n<p>Here is why.<\/p>\n\n<p>Before you wrap the <code>list-test<\/code> with the <code>core-animated-pages<\/code>, the <code>.content<\/code> <code>div<\/code> has an <code>absolute<\/code> position (with a <code>padding-top<\/code> so it doesn't get covered up by the main heading of the <code>core-scroll-header-panel<\/code>) and that's <a href=\"https:\/\/github.com\/Polymer\/core-list\/issues\/47#issuecomment-63126241\" rel=\"nofollow\">why<\/a> your <code>list-test<\/code> was displaying correctly.<\/p>\n\n<p>Now that you wrap it with a <code>core-animated-pages<\/code> which has a default <code>position<\/code> of <code>relative<\/code>, your list becomes collapsed.<\/p>\n\n<p>The fix is easy, wrap your <code>list-test<\/code> with another <code>session<\/code>. You don't even need to make it <code>fit<\/code> as the <code>core-animated-pages<\/code> will automatically give its <em>direct<\/em> children the css below -<\/p>\n\n<pre><code>{\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n<\/code><\/pre>\n\n<p>Hope this helps!<\/p>\n\n<hr>\n\n<p><strong>Update<\/strong><\/p>\n\n<p>For the <code>core-list<\/code> rendering bug, you might be able to get away from re-calling <code>updateSize()<\/code> after a short day (50ms), like this -<\/p>\n\n<pre><code> t.addEventListener('template-bound', function () {\n var list = document.querySelector('list-test::shadow core-list');\n \/\/ to update the size\n list.updateSize();\n this.job('delay', function () {\n list.updateSize();\n }, 50);\n<\/code><\/pre>\n\n<p>Here's another <a href=\"http:\/\/jsbin.com\/wifota\/1\/\" rel=\"nofollow\">jsbin<\/a> for this. Hopefully this issue will be addressed by the Polymer team in the future!<\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":15,"community_owned_date":null,"creation_date":1420244263283,"favorite_count":null,"last_activity_date":1420284336350,"last_edit_date":1420284336350,"last_editor_display_name":null,"last_editor_user_id":231837.0,"owner_display_name":null,"owner_user_id":231837.0,"parent_id":27736325,"post_type_id":2,"score":2,"tags":null,"view_count":null},{"index":619,"id":27397318,"title":null,"body":"<pre><code>viewMore = (i,j) =&gt; () =&gt; {\n console.log(i,j)\n}\n<\/code><\/pre>\n\n<p>To pass parameters to event handlers we need to use <strong>currying<\/strong>. \nWith the above method no new functions created all the time while render is called. <\/p>","accepted_answer_id":null,"answer_count":null,"comment_count":16,"community_owned_date":null,"creation_date":1418203450173,"favorite_count":null,"last_activity_date":1575277463170,"last_edit_date":1575277463170,"last_editor_display_name":null,"last_editor_user_id":100297.0,"owner_display_name":null,"owner_user_id":441387.0,"parent_id":27397266,"post_type_id":2,"score":52,"tags":null,"view_count":null}]
This file has been truncated, but you can view the full file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment