texts
sequence
tags
sequence
[ "Apply dynamic filters using Tags", "I have a list of elements which is displayed in a table using ng-repeat. I want to apply dynamic filters which are added using Tags(ng-tags-input). This tag input generates dynamic tags which I want to use as filters. \n\nHere is the plunk I have created. How can I use entries from these tags to create filters.\n\nFor a single element i tried\n\n<body ng-controller=\"MainCtrl\">\n <tags-input ng-model=\"tags\"></tags-input>\n <p>Model: {{tags}}</p>\n <table border=1 cellpadding=10px>\n <tr ng-repeat = \"t in tableData | filter:tags[0].text\">\n <td>{{t.data1}}</td>\n <td>{{t.data2}}</td>\n </tr>\n </table>\n</body>\n\n\nbut this will take only a single element. I want to apply entire entries of tags to be a filter.\n\nI have seen other questions on SO, but they have filters applied as \n\n<tr ng-repeat = \"t in tableData | filter:{data1:someFilteData}\">\n\nHere is one of the fiddle. I am not able to apply filter from JSON Array.\nHow can I do this?" ]
[ "javascript", "angularjs", "filter", "tags", "angularjs-filter" ]
[ "ruby - mysql - Not saving password field", "I'm having a problem that I have never found. I have a form to create a new user, in it, I have the field to save my password with has_secure_password\n\n<div class=\"row\">\n <div class=\"col-md-4\">\n <div class=\"form-group\">\n <%= form.label \"Contraseña\" %>\n <%= form.password_field :password_digest, class:\"form-control\", id: :user_password_digest %>\n </div>\n </div>\n</div>\n\n\nThe question is that all the fields are been saved correctly, but password field is always NULL.\n\nMy model:\n\nclass User < ApplicationRecord\n has_one :rol\n\n #attr_accessible :email, :password\n attr_accessor :password_digest\n\n validates_confirmation_of :password_digest\n #validates_presence_of :password, :on => :createrail\n validates :password_digest, presence: true, length: {minimum: 5}, allow_nil: false\n validates_presence_of :email, :on => :create\n validates_uniqueness_of :email\n has_secure_password\n\n def self.authenticate(email, password_digest)\n user = find_by_email(email)\n p user\n if user && user.password_digest\n p \"Me he logueado\"\n user\n else\n p \"No hace hash\"\n nil\n end\n end\n\n def logged_in\n !current_user.nil?\n end\n\n\nMy controller:\n\ndef create\n@user = User.new(user_params)\n\np \"Parametros\"\np user_params\np @user\nrespond_to do |format|\n if @user.valid?\n\n @user.active = 1\n if @user.save\n p \"El usuario es\"\n p @user\n\n session[:usuario_id] = @user.id\n p \"Test\"\n p @user.password_digest\n\n p \"EndTest\"\n format.html { redirect_to @user, notice: 'Usuario creado correctamente.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\nend \nend\n\n\nIn test, I can see that the password_digest field has content, but later, it is not saving. Any help?" ]
[ "ruby-on-rails", "ruby" ]
[ "How to create QString in PyQt4?", ">>> from PyQt4 import QtCore\n>>> str = QtCore.QString('Hello')\nAttributeError: 'module' object has no attribute 'QString'\n\n>>> QtCore.QString._init_(self)\nAttributeError: 'module' object has no attribute 'QString' \n\n\nYes, I've read QString Class Reference \n\nWhy can't I import QString from QtCore, as specified in the docs ?" ]
[ "python", "user-interface", "pyqt" ]
[ "My css and javascript files not running", "I installed Nginx server for my laravel project. But css and javascript file not working. Css and javascript file downloadable on server. For example http://myipaddress/css/bootstrap.css download the bootstrap.css file. I call the css file like <link href=\"{{ URL::asset('css/bootstrap.css') }}\" rel=\"stylesheet\"> like this. \n\nMy source code \n\nMy public folder permissions\n\n/etc/nginx/sites-available/default looks like the following\n\n# Default server configuration\n#\nserver {\nlisten 80 default_server;\nlisten [::]:80 default_server ipv6only=on;\n\n# SSL configuration\n#\n listen 443 ssl default_server;\n listen [::]:443 ssl default_server;\n#\n# Note: You should disable gzip for SSL traffic.\n# See: https://bugs.debian.org/773332\n#\n# Read up on ssl_ciphers to ensure a secure configuration.\n# See: https://bugs.debian.org/765782\n#\n# Self signed certs generated by the ssl-cert package\n# Don't use them in a production server!\n#\n# include snippets/snakeoil.conf;\n\nroot /var/www/english4-u.com/public;\n\n# Add index.php to the list if you are using PHP\nindex index.php index.html index.htm;\n\nserver_name english4-u.com;\nssl_certificate /etc/nginx/ssl/nginx.crt;\nssl_certificate_key /etc/nginx/ssl/nginx.key;\n\nlocation / {\n # First attempt to serve request as file, then\n # as directory, then fall back to displaying a 404.\n try_files $uri $uri/ /index.php?$query_string;\n}\n\n# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\n#\nlocation ~ \\.php$ {\n# include snippets/fastcgi-php.conf;\n#\n# # With php7.0-cgi alone:\n# fastcgi_pass 127.0.0.1:9000;\n# # With php7.0-fpm:\n try_files $uri =404;\n fastcgi_split_path_info ^(.+\\.php)(/.+)$;\n fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;\n fastcgi_index index.php;\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n include fastcgi_params;\n}\n\n# deny access to .htaccess files, if Apache's document root\n# concurs with nginx's one\n#\nlocation ~ /\\.ht {\n deny all;\n}\n\naccess_log /var/log/nginx/english4-u.com-access.log;\nerror_log /var/log/nginx/english4-u.com-error.log error;\n\nlocation = /favicon.ico { log_not_found off; access_log off; }\nlocation = /robots.txt { access_log off; log_not_found off; }\n\ncharset utf-8;\n\nerror_page 404 /index.php;}\n\n\nCan you help me with this?\n\nThank You." ]
[ "laravel", "nginx", "laravel-5.4" ]
[ "password to be used with external service", "I have an application that uses Django REST server on the backend and I'm integrating with a communication service called QuickBlox that provides real time text and video chat. I have to create a user as well as log in users with the service using a password, and I have some concerns.\n\nThe user will not need to know their password, it is something that is only going to be used in API calls from the server to an API endpoint provided by QuickBlox. The current plan is to make a random string of characters and store that value on the User object. The problem is that the quickblox password is stored in plain text, and I don't want that. Is there any way to store a hashed value of the generated password and then unhash it before sending it as the password in my request to Quickblox?\n\nI was hoping to find something in Django Password docs, but there's nothing on unencrypting a hashed value, for good reason!\n\nMaybe I'm going down the wrong path and someone has another suggestion. The problem is that I need to store a randomly generated password and use that password to issue requests to an external service." ]
[ "django", "quickblox" ]
[ "Is it ok to style inside react components using jquery", "I'm new to react, I get enough to know that manipulating the dom composed by react with Jquery is a very bad Idea. However is it a bad Idea to manipulate styles on dom components rendered by react with Jquery?\n\nReactDom.render( <LoginPage/>, document.getElementById('root') ); \n//after render call activateJQ();\n\nvar activateJQ = function(){\n $('button').animate({\n backgroundColor: \"#aa0000\",\n color: \"#fff\",\n width: 500\n }, 1000 );\n $('.error-msg').css(\"color\",\"red\");\n};\n\n\nIt works on this page, but I would like to incorporate this into more complex pages that change states and rerender. How will react address components with added stylings?" ]
[ "javascript", "jquery", "css", "reactjs" ]
[ "how to fetch streams and display its name on console using server side API", "I want to fetch all the streams of a project area and display their names on console using server side API.\n\nIWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(teamRepository);\nIWorkspaceSearchCriteria wsSearchCriteria = WorkspaceSearchCriteria.FACTORY.newInstance();\nwsSearchCriteria.setKind(IWorkspaceSearchCriteria.STREAMS);\nwsSearchCriteria.setPartialOwnerNameIgnoreCase(projectAreaName);\nList <iworkspacehandle> workspaceHandles = workspaceManager.findWorkspaces(wsSearchCriteria, Integer.MAX_VALUE, monitor);\nIWorkspaceConnection workspaceConnection = workspaceManager.getWorkspaceConnection(workspaceHandles.get(0),monitor); \nString obj=\"\";\nobj=workspaceConnection.getName();\nSystem.out.println(obj);\n\n\nthis code does the task on client side.\nHow this can be done using server side API?" ]
[ "java", "rtc" ]
[ "Admob ad requests in Unity", "At the start of my game I am loading a banner Ad, but due to the implementation of admob for Unity it stays throughout all scenes. So my question is: \nTo maximize revenue should I hide the ad and request a new one, or if I tweak the refresh rate ( of the banner ad ) it would be the same ?" ]
[ "unity3d", "request", "admob", "banner" ]
[ "Replicate a Facebook page and all its content", "I would like to achieve the following:\n\n\nGET all posts from a page and their related content (attachments, likes, visibility, tags, shares, comments, creation time...)\nPOST all that content in a new page\n\n\nAssuming that I am admin of both pages.\n\nI know that it's pretty straight forward to loop over the feed of a page and get all the posts' information. However, I'm not so sure about the POST part:\n\n\nI guess that Facebook doesn't allow to \"clone\" people's\nlike/shares/comments below each post, on their behalf?\nConsidering that I will delete the first page, will all attachments disappear from Facebook's servers as well?" ]
[ "facebook-graph-api", "facebook-javascript-sdk", "facebook-page" ]
[ "Laravel image paths from controller to view", "My image's path is public/uploads/users/image.png then using src like this:\n\n<img src=\"{{ asset('uploads/users/image.png') }}\" />\n\n\nBut for every user the image has to be changed.\n\nI pass the image name of the user from controller as something like this \n\nforeach ($user as $key) {\n $this->data['user_img'] = $key->avatar;\n }\n\n\nHere, I have to change the user image as per $user_img from controller\n\nHow should I give it in the src of image tag.\n\nI tried like this way\n\nsrc=\"{{ asset('uploads/users/\"{{$user_img}}\"')}}\"\n\n\nBut it seems to be an error for me.How should I resole this.\n\nSomebody help me." ]
[ "php", "laravel" ]
[ "Why is MQTT not connecting with NodeJS?", "I have a weird issue trying to connect to an MQTT server with NODEJS:\n\nIf I connect to the MQTT server and I do not get a connect it just hangs.\n\nIf I do it with the command line I see data so network, server etc is all good.\n\nIf I use a port thats wrong then command line gives me a valid reject message but NODE just hangs.\n\nCommand line is:\n\nmosquitto_sub -h 10.10.10.30 -p 1883 -t sim \n\n\nMy code is completely basic:\n\nvar mqtt = require('mqtt');\n\nvar MQTT_TOPIC = \"sim\";\nvar MQTT_ADDR = \"10.10.10.30\";\nvar MQTT_PORT = 1883;\nvar client = mqtt.connect({host: MQTT_ADDR, port : MQTT_PORT, debug: true});\n\nclient.on('connect', function() {\n console.log('Connected');\n client.subscribe(MQTT_TOPIC, function() {\n client.on('message', function(topic, message, packet) {\n console.log(topic + \": '\" + message);\n });\n });\n});" ]
[ "node.js", "mqtt" ]
[ "Bypass Scala Type Erasure (with Guava EventBus)", "I am using Guava's EventBus in my Scala project.\n\nI have a parameterized event like so:\n\nclass MyEvent[T]\n\n\nAnd a simple event listener:\n\nclass MyEventListener {\n\n @Subscribe\n def onStringEvent(event: MyEvent[String]) {\n println(\"String event caught\")\n }\n\n @Subscribe\n def onIntEvent(event: MyEvent[Int]) {\n println(\"Int event caught\")\n }\n\n}\n\n\nI can create my com.google.common.eventbus.EventBus, register MyEventListener, and fire an event:\n\nval eventBus = new EventBus\neventBus.register(new MyEventListener)\neventBus.post(new MyEvent[String])\n\n\nBut, as you may have guessed already, both onStringEvent and onIntEvent get called as a result. The issue is that Java's/Scala's type erasure drops off the parameter type at runtime and both subscriptions appear to Guava as event: MyEvent.\n\nOk, my question:\n\nDue to erasure, using the same Event object for different types of Guava events in this manner wouldn't be possible in Java and isn't possible in Scala. However, Scala proves to have a number of nice ways to circumvent Java's erasure problems. Does anybody see another way to achieve this, perhaps using some Scala wizardry?" ]
[ "scala", "event-handling", "guava" ]
[ "What's wrong here? (EXC_BAD_ACCESS)", "My app crashes during when it tries to round some numbers down. What could be the problem?\nThe debugger shows the first line causes EXC_BAD_ACCESS.\n\n- (NSInteger) hebrewCalanderEndDay:(NSInteger)year{\n\nNSInteger monthsElapsed = [[NSNumber numberWithLongLong:floor((235*year-234)/19.0)]integerValue];\nNSInteger partsElapsed = 12084 + 13753*monthsElapsed;\nNSInteger day = 29*monthsElapsed + [[NSNumber numberWithLongLong:floor(partsElapsed/25920)] integerValue];\n\nif(((3 * (day+1))%7 <3){\n day++;\n} \nreturn day;\n}" ]
[ "objective-c" ]
[ "PersistenceException from a simple CRUD for a simple class", "Using the in-memory database (db=mem), I'm simply trying to insert a new object into the database using CRUD.\n\nThe class is as follows:\n\n@Entity\npublic class ActivityModel extends Model {\n @Required\n public String description;\n\n @Required\n public String link;\n\n @Required\n public Date timestamp;\n\n public ActivityModel(String description, String link, Date timestamp) {\n this.description = description;\n this.link = link;\n this.timestamp = timestamp;\n }\n}\n\n\nAnd the CRUD controllers looks like this:\n\[email protected](ActivityModel.class)\npublic class Activities extends CRUD {\n}\n\n\nYet, when I try to add a new activity to the database, I get the following error:\n\n13:48:20,710 INFO ~ Application 'ScoreDB' is now started !\n13:48:48,323 WARN ~ SQL Error: -177, SQLState: 23000\n13:48:48,323 ERROR ~ Integrity constraint violation - no parent FKF0DCD93AADF686FF table: USERMODEL in statement [insert into ActivityModel (id, description, link, timestamp) values (null, ?, ?, ?)]\n13:48:48,370 ERROR ~ \n\n@65pagp52g\nInternal Server Error (500) for request POST /admin/activities\n\nExecution exception (In {module:crud}/app/controllers/CRUD.java around line 135)\nPersistenceException occured : org.hibernate.exception.ConstraintViolationException: could not insert: [models.users.hidden.ActivityModel]\n\nplay.exceptions.JavaExecutionException: org.hibernate.exception.ConstraintViolationException: could not insert: [models.users.hidden.ActivityModel]\n at play.mvc.ActionInvoker.invoke(ActionInvoker.java:290)\n at Invocation.HTTP Request(Play!)\nCaused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not insert: [models.users.hidden.ActivityModel]\n at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1235)\n at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1168)\n at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1174)\n at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:674)\n at play.db.jpa.JPABase._save(JPABase.java:37)\n at controllers.CRUD.create(CRUD.java:135)\n at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:413)\n at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:408)\n at play.mvc.ActionInvoker.invoke(ActionInvoker.java:182)\n ... 1 more\n\n... etc ...\n\n\nWhat am I doing wrong? :S" ]
[ "jpa", "crud", "playframework" ]
[ "how to limit results that are returned in a PHP array", "I have this foreach loop in PHP where i loop through some array results:\n\nforeach(array_reverse($output) as $row)\n\n\nbut i want to be able to limit the number of results so i can display the results on separate pages\n\ni have tried using the function array_slice in PHP but had no luck, using the below code i just get no results returned\n\nforeach(array_reverse(array_slice($output),0,5) as $row)\n\n\nhow can i limit the results returned in the array?" ]
[ "php" ]
[ "Run Play jobs on a custom threadpool", "I would like to run some jobs on a custom thread pool / executor service.\n\nThe reason is I have a lot of jobs that might overwhelm the normal job pool, so I want to separate them into a dedicated pool.\n\nI tried creating a new ExecutorService and running jobs on it:\n\npublic static <T> F.Promise<T> runJobWithExecutor(ExecutorService executor, final Job<T> job) {\n final F.Promise<T> promise = new F.Promise<T>();\n executor.submit(new Callable<T>() {\n public T call() throws Exception {\n T result = job.call();\n promise.invoke(result);\n return result;\n }\n });\n return promise;\n}\n\n\nbut I'm getting various JPA errors:\n\n\n An SQLException was provoked by the following failure:\n java.lang.InterruptedException [Cause: java.lang.InterruptedException\n at java.lang.Object.wait(Native Method) at\n com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1315)\n at\n com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557)\n at\n com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477)\n at\n com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525)\n at\n com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)\n at\n org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:71)\n at\n org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)\n at\n org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)\n at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160) at\n org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81)\n at\n org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)\n at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:60) at\n play.db.jpa.JPAPlugin.startTx(JPAPlugin.java:350) at\n play.db.jpa.JPAPlugin.beforeInvocation(JPAPlugin.java:318) at\n play.plugins.PluginCollection.beforeInvocation(PluginCollection.java:428)\n at play.Invoker$Invocation.before(Invoker.java:217) at\n play.jobs.Job.call(Job.java:139) at\n org.commercesciences.play.Jobs3$1.call(Jobs3.java:16) at\n java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at\n java.util.concurrent.FutureTask.run(FutureTask.java:166) at\n java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)\n at\n java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)\n at java.lang.Thread.run(Thread.java:722)\n\n\nIs there anything more I need to do in order to run jobs on separate threads?\n\nI'm using play 1.2.4-mbknor-3." ]
[ "playframework", "playframework-1.x" ]
[ "Use of TJSONAncestor.Owned to keep included Objects after free", "I don't understand the help for the owned property of the TJSONAncestor Class.\nI want to make sure that a TJSONARRAYI add to a TJSONOBJECTis not freed when I free the TJSONOBJECT.\nHow do I use the owned property for this?" ]
[ "delphi", "delphi-10.3-rio" ]
[ "How to separate auth (using nodeJS) from react app?", "I'm trying to create a web app in which I want the authentication to be separate from the front end app.\nI have written the auth in expressJS & have the frontend application in react. I'm looking for a way to use only nodeJS for auth, and redirect to the react application only after the user logs in.\n\nIs there a possible way to create a route in express to render the React app like the following?\n\nrouter.get('/app', (req, res) => {\n if(userLoggedIn())\n render_react_app\n else\n render_login_page\n})" ]
[ "node.js", "reactjs", "authentication", "router" ]
[ "Prettier ERB conditionally adding element class", "I'm trying to learn how to write more beautiful ERB. How could I format this to look prettier?\n<% site.data.navigation.each { |item| %>\n <a href="<%= item.link %>"\n <% if page.url == item.link %>class="current"<% end %>>\n <%= item.name %>\n </a>\n<% } %>\n\nin particular the wrapping around class="current" just seems kludgy. I'm looking for the best way that doesn't incorporate some helper method. Is there something cleaner?" ]
[ "ruby-on-rails", "ruby", "erb" ]
[ "EC2 Auto Scaling scale-up event while Code deploy process going on", "I am using CodeDeploy with AutoScaling and would like to know if there is a way to ensure that newly created instances due to scale-up event would receive the application version (latest) deployed on the older instances that where running during the deployment.\n\nThe new instances were launched while CodeDeploy was in the process of deploying application code to the deployment group." ]
[ "amazon-web-services", "aws-code-deploy" ]
[ "Error adding flyway-sbt plugin for Scala 2.12 (Play Framework)", "TLDR: Are there any publically available jars for flyway-sbt for Scala 2.12 and SBT 1.0?\n\n\n\nHas anyone else had issues with dependency resolution for flyway-sbt when using Scala 2.12? Looking at the URLs below, they indeed do not exist.\n\n[warn] module not found: org.flywaydb#flyway-sbt;4.0\n[warn] ==== typesafe-ivy-releases: tried\n[warn] https://repo.typesafe.com/typesafe/ivy-releases/org.flywaydb/flyway-sbt/scala_2.12/sbt_1.0//4.0/ivys/ivy.xml\n[warn] ==== sbt-plugin-releases: tried\n[warn] https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.flywaydb/flyway-sbt/scala_2.12/sbt_1.0//4.0/ivys/ivy.xml\n[warn] ==== local: tried\n[warn] /Users/adu/.ivy2/local/org.flywaydb/flyway-sbt/scala_2.12/sbt_1.0//4.0/ivys/ivy.xml\n[warn] ==== public: tried\n[warn] https://repo1.maven.org/maven2/org/flywaydb/flyway-sbt_2.12_1.0/4.0/flyway-sbt-4.0.pom\n[warn] ==== local-preloaded-ivy: tried\n[warn] /Users/adu/.sbt/preloaded/org.flywaydb/flyway-sbt/4.0/ivys/ivy.xml\n[warn] ==== local-preloaded: tried\n[warn] file:////Users/adu/.sbt/preloaded/org/flywaydb/flyway-sbt_2.12_1.0/4.0/flyway-sbt-4.0.pom\n[warn] ==== Flyway: tried\n[warn] https://flywaydb.org/repo/org/flywaydb/flyway-sbt_2.12_1.0/4.0/flyway-sbt-4.0.pom\n[warn] ::::::::::::::::::::::::::::::::::::::::::::::\n[warn] :: UNRESOLVED DEPENDENCIES ::\n[warn] ::::::::::::::::::::::::::::::::::::::::::::::\n[warn] :: org.flywaydb#flyway-sbt;4.0: not found\n[warn] ::::::::::::::::::::::::::::::::::::::::::::::\n[warn] \n[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.\n[warn] org.flywaydb:flyway-sbt:4.0 (scalaVersion=2.12, sbtVersion=1.0)\n[warn] \n[warn] Note: Unresolved dependencies path:\n[warn] org.flywaydb:flyway-sbt:4.0 (scalaVersion=2.12, sbtVersion=1.0) (/Users/adu/workspace/seed-play/project/plugins.sbt#L42-43)\n[warn] +- default:seed-play-build:0.1-SNAPSHOT (scalaVersion=2.12, sbtVersion=1.0)\n[error] sbt.librarymanagement.ResolveException: unresolved dependency: org.flywaydb#flyway-sbt;4.0: not found\n\n\nThese are the additions to my plugins.sbt file:\n\nresolvers += \"Flyway\" at \"https://flywaydb.org/repo\"\naddSbtPlugin(\"org.flywaydb\" % \"flyway-sbt\" % \"4.0\")" ]
[ "scala", "playframework", "sbt", "flyway", "sbt-plugin" ]
[ "platform.pause.subscribe at Ionic-React", "I am using Ionic Framework with React. I want to run a code when platform.pause as mentioned in ionic-react-platform.\nBut the codes in react documents are unbelievably for angular instead of react!\nI want exactly code below, but for react not for angular. Can any one help me with it please?\nimport { Platform } from '@ionic/angular';\n\n@Component({...})\nexport class MyPage {\n constructor(public platform: Platform) {\n\n }\n\n init(){\n this.platform.pause.subscribe(async () => {\n alert('Pause event detected');\n });\n }\n}" ]
[ "reactjs", "ionic-framework" ]
[ "I Can't install Laravel 4's package", "I just started learn Laravel 4, i have problem when install laravel's package, in this case it is: http://packalyst.com/packages/package/greggilbert/recaptcha\n\nI do all steps, but it always display: Class 'Greggilbert\\Recaptcha\\RecaptchaServiceProvider' not found\n\nI think problem is i don't know where to put recaptcha-master.zip, root folder? or in Vendor folder? i don't know :(\n\nPlease help, thank you so much :(" ]
[ "class", "laravel", "package" ]
[ "formtastic errors with remote true", "When i use :remote => true formtastic does not autoclear the form after successful submission\n\nalso if i use a remote form for updating the data as shown in the following code , the form is always stuck associated with that model , not allowing me to save a new model , even though i attempt to create a new model using build and try passing ti through locals in the js \n\nSo heres the formtastic view \n\n<%= semantic_form_for @deliverable,:remote=>true do |f| %>\n<%= f.input :quantity, :as => :number , :name => \"items\"%>\n<%= f.input :product_id, :as => :select, :collection => current_user.products.all %>\n<%= f.actions%>\n<% end %>\n\n\nand here's the controller\n\ndef create\n@micropost = current_user.microposts.find(Rails.cache.read('mp_id'))\n@deliverable = @micropost.deliverables.build(params[:deliverable])\n@curr_product = current_user.products.find(params[:deliverable][:product_id])\[email protected]_price_cents = @deliverable.quantity * @curr_product.price_cents\nif @deliverable.save\n @del_items = @micropost.deliverables.find(:all)\n\n respond_to do |format|\n format.html {redirect_to root_path}\n format.js\n end \nelse\n respond_to do |format|\n format.html {redirect_to root_path}\n format.js {render :text => @deliverable.errors.full_messages.to_s}\n end \n\n\n\n\nend\nend\ndef edit\n @deliverable = Deliverable.find(params[:id])\n respond_to do |format|\n\n format.js \n end\n\n end\n def update\n @deliholder = Deliverable.find(params[:id])\n if @deliholder.update_attributes(params[:deliverable])\n @micropost = current_user.microposts.find(Rails.cache.read('mp_id'))\n\n @del_items = @micropost.deliverables.find(:all) \n @deliverable = @micropost.deliverables.new\n\n\n respond_to do |format|\n format.js \n end\n else\n respond_to do |format|\n format.html {redirect_to root_path}\n format.js {render :text => @deliverable.errors.full_messages.to_s}\n end \n end \nend\n\n\nand heres the js view for edit\n\n$(\"#deliver-list\").hide();\n$(\"#deliver-holder\").html(\"<%= escape_javascript( render( 'shared/deliverable_formtastic',:locals => {:deliverable => @deliverable }))%>\");\n\n\nand the js for update\n\nalert(\"the deliverable has been updated \")\n$(\"#deliver-list\").html(\"<%= escape_javascript( render( 'shared/deliverable_list' ,:locals => {:del_items => @del_items } ))%>\");\n$(\"#deliver-list\").show();\n$(\"#deliver-holder\").empty();\n$(\"#deliver-holder\").html(\"<%= escape_javascript( render( 'shared/deliverable_formtastic',:locals => {:deliverable => @deliverable }))%>\");\n\n\ni tried replacing the @deliverable with @deliholder for updating , as shown above , makes no difference , passing or not passing @deliverables in the js locals also makes no difference\n\ncreate.js\n\nalert(\"the deliverable has been saved to the bill \");\n$('#fc')[0].reset();\n$(\"#deliver-list\").html(\"<%= escape_javascript( render( 'shared/deliverable_list' ,:locals => {:del_items => @del_items } ))%>\");" ]
[ "javascript", "ruby-on-rails-3.2", "formtastic" ]
[ "How comes, that i get an ArgumentException for existing Key on Children.Add?", "i use an inheritance of AbsoluteLayout to avoid the Children in the Maincode for reasons.\nSo i have an own Add Method:\n internal void Add(View control, Rectangle rectangle)\n {\n if (!this.Children.Contains(control)) this.Children.Add(control, rectangle);\n }\n\nThe Xamarin-UWP Version works flawless, but\ni also use Ooui to use it for ASP.NET which works great.\nBut there i get following Exception:\nAn item with the same key has already been added. Key: Xamarin.Forms.BindableProperty\n at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)\n at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)\n at Xamarin.Forms.BindableObject.GetValue(BindableProperty property)\n at Xamarin.Forms.Layout.get_Padding()\n at Xamarin.Forms.Layout.UpdateChildrenLayout()\n at Xamarin.Forms.Layout.OnSizeAllocated(Double width, Double height)\n at Xamarin.Forms.VisualElement.SizeAllocated(Double width, Double height)\n at Xamarin.Forms.VisualElement.SetSize(Double width, Double height)\n at Xamarin.Forms.VisualElement.set_Bounds(Rectangle value)\n at Xamarin.Forms.VisualElement.Layout(Rectangle bounds)\n at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion(VisualElement child, Rectangle region)\n at Xamarin.Forms.AbsoluteLayout.LayoutChildren(Double x, Double y, Double width, Double height)\n at Xamarin.Forms.Layout.UpdateChildrenLayout()\n at Xamarin.Forms.Layout.OnSizeAllocated(Double width, Double height)\n at Xamarin.Forms.VisualElement.SizeAllocated(Double width, Double height)\n at Xamarin.Forms.Layout.ForceLayout()\n at Xamarin.Forms.Layout.InvalidateLayout()\n at Xamarin.Forms.Layout.OnInternalAdded(View view)\n at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)\n at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)\n at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)\n at System.Collections.ObjectModel.Collection`1.Add(T item)\n at Xamarin.Forms.ObservableWrapper`2.Add(TRestrict item)\n at Xamarin.Forms.AbsoluteLayout.AbsoluteElementCollection.Add(View view, Rectangle bounds, AbsoluteLayoutFlags flags)\n at DT_AbsoluteLayout.Add(View control, Rectangle rectangle) in DT_AbsoluteLayout.cs\n\nI tried printing all Ids of every Children before, but it was not present.\nWhat can i do or try to fix that problem?\nI tried different Assembly and Visual Studio Versions.\nUsing the Children directly caused the same Error.\nThe View which causes that exception is always the same one and it will be placed, but at the wrong position." ]
[ "c#", "asp.net", "xamarin" ]
[ "Adding autoprefix-cli to ANT build", "I am trying to add autoprefix-cli to my ANT build. Below is my code.\n\n<target name=\"auto\">\n<apply executable=\"autoprefixer-cli.bat\" verbose=\"true\" force=\"true\" failonerror=\"true\">\n <arg value=\"-d\" /> <!-- Turn on verbose -->\n <arg value=\"prefix\" />\n <arg value=\"*.css\" /> \n</apply>\n</target>\n\n\nWhen i do a ant build, it gives me an error saying resource not specified.\n\nBUILD FAILED\nD:\\tempTest\\AntTestProject\\build.xml:25: no resources specified\n\n\nNote: I can access autoprefix-cli from command line, its installed with -g flag and also it works when i directly use it from commandline." ]
[ "java", "css", "build", "ant", "autoprefixer" ]
[ "PreferenceFragment: No view found for id android:id/prefs) for fragment", "I have a PreferenceActivity with a custom layout to keep a static header on top of all the items. I followed this thread to set this up:\n\nAdding a header to a PreferenceActivity\n\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\">\n\n <ImageView\n android:id=\"@+id/myCustomImageView\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"50dp\"\n android:src=\"@mipmap/ic_launcher\" />\n\n <ListView\n android:id=\"@android:id/list\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\"\n android:layout_below=\"@+id/myCustomImageView\" />\n\n</RelativeLayout>\n\n\nand here is my Activity snippet:\n\n@Override\npublic void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n // this makes a static header\n setContentView(R.layout.preferences_layout);\n\n // register as a listener\n PreferenceManager.getDefaultSharedPreferences(this)\n .registerOnSharedPreferenceChangeListener(this);\n}\n\n@Override\npublic void onBuildHeaders(List<Header> target) {\n loadHeadersFromResource(R.xml.preference_headers, target);\n}\n\n\nyet, when I tap on an item it should spawn a fragment as my xml specifies:\n\n<preference-headers xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n<header\n android:fragment=\"ui.UserPreferences\"\n android:summary=\"@string/preferences_activity_user_settings_summary\"\n android:title=\"@string/preferences_activity_user_settings_title\" />\n\n more items.... \n\n\nHowever, it does not. Instead, it crashes saying:\n\njava.lang.IllegalArgumentException: No view found for id 0x1020463 (android:id/prefs) for fragment UserPreferences\n\n\nI looked at a bunch of threads like the one below, but they did not help.\n\nAndroid PreferenceFragment No view found for id for fragment\n\nHowever if I just commented out the custom layout, the code works and the fragment shows up correctly. This works, in other words:\n\npublic class Preferences extends PreferenceActivity\n implements SharedPreferences.OnSharedPreferenceChangeListener {\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n // this works: By commenting out the custom header, the exception goes away\n //setContentView(R.layout.preferences_layout);\n\n // register as a listener\n PreferenceManager.getDefaultSharedPreferences(this)\n .registerOnSharedPreferenceChangeListener(this);\n }\n\n\nI believe the fragment manager is not able to find the id because the listview is now nested inside a relativelayout. Yet, I have no idea how to fix this.\n\nhere's a bit of item fragment, however I don't think this is the problem:\n\npublic class UserPreferences extends PreferenceFragment implements\n Preference.OnPreferenceChangeListener,\n Preference.OnPreferenceClickListener,\n SharedPreferences.OnSharedPreferenceChangeListener {\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n /* Load the preferences from an XML resource */\n addPreferencesFromResource(R.xml.user_settings);\n\n getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);\n\n }\n\n more stuff...\n\n\nAny help is greatly appreciated.\n\nthank you." ]
[ "android-fragments", "sharedpreferences" ]
[ "Insert XML into DOM in Angular 2", "I'm fairly new to Angular 2 and am really having a hard time trying to figure out how to add XML to my html template. I would like to conditionally insert specific sets of XML into my template from which an external library renders some SVG. I have my XML sets as js strings which I'm trying to interpolate in my template. \n\nUPDATE:\n\nI've got some XML as a string that would I like to display in a template. \n\nPseudo-code:\n\nconst xml = 'valid xml string';\n\n\nin component:\n\n@Component({\n selector: \"toolbox\",\n template: `{{xml}}` <-- gives me xml as a string into DOM\n});\n\n\nI've tried using DOMParser on the xml first, but then I just get a string that says [object XMLDocument]. I was trying to do it this way so that I could change the xml based on user input, what worked before was simply putting the XML into the template. Perhaps there is a way to swap component templates dynamically?\n\nUPDATE SOLVED\n\nUsing DomSanitizationService, and [outerHTML], I was able to correctly output my XML string into the DOM. \n\nPseudo-code:\n\nimport { DomSanitizationService, SafeHtml } from '@angular/platform-browser';\n\n@Component({\n...\n\n template: `<div [outerHTML]=\"xml\"></div>`\n\n...\n})\n\nexport class MyClass {\n\n xml: SafeHtml;\n\n constructor(sanitizer: DomSanitizationService){\n this.xml = sanitizer.bypassSecurityTrustHtml('my valid xml string');\n }\n\n...\n\n}" ]
[ "xml", "templates", "dom", "angular" ]
[ "Combining automatic and manual export package selection in Maven bundle plugin", "Maven bundle plugin, as I know, will automatically add export/import package information to your bundle manifest.mf file, according to it sources. \n\nSometimes you need manually specify export-packages for example if you want to add *.impl packages, which maven-bundle-plugin will not include automatically. \nBut if you specify packages in <Export-Package> tag, automatic export would not be performed.\nIf I have only one package that requires to be declared manually and other could be added to export-package block automatically by this plugin.\nSo I want to use automatically generated export-package manifest and add to it manually specified packages.\n\nHow can I turn on automatic generation of export info while I using manual?" ]
[ "java", "maven", "osgi", "bundle", "maven-bundle-plugin" ]
[ "Append tables in SQL", "If I have the two following tables,\n\nTable1\n\nItemNo Desc Order Number Qty S_Date Location\nAA AA AAA A AA/AA/AAAA AAAA\nBB BB BBB B BB/BB/BBBB BBBB\nCC CC CCC C CC/CC/CCCC CCCC\n\n\nTable 2\n\nM_Order Item M_Date Total\nXXX X XX/XX/XXXX XX\nYYY Y YY/YY/YYYY YY\n\n\nCan anyone advice me how to get the following table please.\n\nResult Table\n\nItemNo Desc Order Number Qty S_Date Location M_Date Total\nAA AA AAA A AA/AA/AAAA AAAA \nBB BB BBB B BB/BB/BBBB BBBB \nCC CC CCC C CC/CC/CCCC CCCC \nX XXX XX/XX/XXXX XX\nY YYY YY/YY/YYYY YY\n\n\nThanks" ]
[ "sql", "sql-server", "union" ]
[ "asp.net mvc set number format default decimal thousands separators", "How can I set both default decimal and thousands separator for formatting number in asp.net mvc regardless of culture?" ]
[ "asp.net-mvc", "number-formatting" ]
[ "Is it possible to have field level generic in a index signature type?", "So you can declare a generic index signature for example like this:\n\ntype GenericType<A> = { firstField: A, secondField: any };\n\ntype GenericIndex<T extends object> = {\n [K in keyof T]: GenericType<T[K]>;\n};\n\n\nBut is it possible to have a generic on field level?\n\nSee <R> in following example: \n\ntype GenericType<A, R> = { firstField: A, secondField: R };\n\ntype GenericIndex<T extends object> = {\n // this line is not compiling because \"<R>\" is no valid ts syntax here\n [K in keyof T]<R>: GenericType<T[K], R>;\n};\n\n\nExample usage:\n\ntype SomeType = { a: number, b: string }\n\n\nconst generic: GenericIndex<SomeType> = {\n a: { firstField: 1, secondField: \"anyString\"},\n b: { firstField: \"someString\", secondField: 2}\n}\n\ngeneric.a.secondField // type should be string but is any\ngeneric.b.secondField // type should be numer but is any\n\n\nPlease don't take the example to serious. It could also be something more complex." ]
[ "typescript", "generics" ]
[ "how to prevent tomcat from caching mysql data", "I'm not sure if this is a tomcat issue, or a mysql issue. When reading an entire table (select * from Employees), and returning the data through jsp, the same data is returned even after updating the table.\n\nI am using my own homespun connection pool. That cant change at the moment as both a desktop app and the servlets use the same core libraries.\n\nI have READ-COMMITTED set in mysql config\n\ntransaction-isolation=READ-COMMITTED\n\n\nI even set it when creating the connection\n\n conn = DriverManager.getConnection(url, userName, password);\n if (conn != null)\n conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);\n\n\nThen in the servlet I get the data and send it out like this (GetAll() is effectively SELECT * from Employees):\n\nVector<DBO_Employees>vc = DBO_Employees.GetAll(); \nVector<JSONObject>vr = new Vector<JSONObject>();\nfor (DBO_Employees h : vc)\n vr.add(h.json());\n try {\n json.put(\"employees\", vr);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\nresponse.setContentType(\"application/json;charset=utf-8;\");\nPrintWriter pw = response.getWriter();\npw.write(json.toString());\n\n\nTo test I call the servlet once, make a quick change in the database (using mysql cli), then refresh the page however the change in data is not there. I'm not sure if mysql is caching the data or if tomcat is caching the data." ]
[ "mysql", "jsp", "tomcat", "servlets" ]
[ "FastAPI how to add ZMQ to eventloop", "I am surprised this has not really been asked in detail but for some reason i could not find this question or solution anywhere. It seems to be that a lot of people are having a problem where you have a fastAPI application that also needs to communicate to some other microservice (in something more efficient than http messages). I have read all of the zmq documentation on integration into asyncio, but so far i have not found anything about how to add zmq into the eventloop with fastapi (or even starlette for that matter). here is an example of the code from the zmq website:\nimport asyncio\nimport zmq\nfrom zmq.asyncio import Context\n\nctx = Context.instance()\n\nasync def recv():\n s = ctx.socket(zmq.SUB)\n s.connect('tcp://127.0.0.1:5555')\n s.subscribe(b'')\n while True:\n msg = await s.recv_multipart()\n print('received', msg)\n s.close() \n\nThis shows us an async function, which is great, but once again this needs to run in the eventloop alongside the fastAPI coroutine. How is this supposed to be done? The fastAPI documentation does not really provide any interface for us to run a separate coroutine besides a background task. I am not sure if there is any other magic happening in a background task, but for something that needs to communicate with another microservice, i would want this to have scheduling similar to the fastAPI coroutine. Furthermore, you can't start a background task at startup, so you have to do some hokey call to even get it running (it's hacky .. but technically works). Furthermore, it would be even better if we could just register a handler with something like\[email protected]("zmq_recv)\nasync def recv():\n s = ctx.socket(zmq.SUB)\n s.connect('tcp://127.0.0.1:5555')\n s.subscribe(b'')....\n\nThis would, based on config somewhere, allow all messages on the zmq context to automatically go to this function. This would maybe allow us to run zmq INSIDE the fastAPI coroutine, just binding another port, and making sure that all traffic from that port goes to this special app.set method. I would be more than fine with something like this ...\nctx = Context.instance()\n\[email protected]_event("startup")\nasync def startup_event():\n s = ctx.socket(zmq.PULL)\n s.bind('tcp://127.0.0.1:5555').setHandler("zmq_recv") # this setHandler is something magic that tells fastAPI to have all traffic on port 5555 to go to this handler function\n\[email protected]_special_handler("zmq_recv")\nasync def zmq_recv(socket):\n msg = await socket.recv_multipart()\n print('received', msg)\n \n\nThis is ideally what i would like, using the fastAPI coroutine... but having zmq sockets invoke responses to a specific function. Is either creating a coroutine example OR this sort templated example possible? If not, how are people claiming you can use zmq with fastapi efficiently? (i guess background tasks could do the trick.. but it seems really hokey)" ]
[ "python-asyncio", "zeromq", "pyzmq", "fastapi", "starlette" ]
[ "sqlite3, fmdb, build is failed", "I'm using sqlite3, fmdb glad to know that, but try to use, build upon get errors. I do not know why. Gcc4.2 compilation options are used. (or LLVM GCC4.2). I need a good solution." ]
[ "sqlite", "fmdb" ]
[ "Google plus API and Gmail API integration in android app", "In android I need to create an app where user can login through google account and can access its basic profile information and its inbox mails also. How do I integrate google plus API and gmail API together. \nAlso please let me know how to integrate gmail API to access mails." ]
[ "android" ]
[ "MySQL search from an array", "So first I do this:\n\n$zip_code_array = mysql_query(\"SELECT * FROM zip_code WHERE (lon BETWEEN '$lng_min_rnd' AND '$lng_max_rnd') AND (lat BETWEEN '$lat_min_rnd' and '$lat_max_rnd')\") or die (mysql_error());\nwhile($zip_code_cells = mysql_fetch_array($zip_code_array))\n{\n$zip_codes_raw = $zip_code_cells['zip_code'];\n$zip_codes_in_distance .= $zip_codes_raw.\", \";\n}\n\n\nThis works and spits out the zipcodes like this EX: 07110, 07111, 07112 etc:\nBut then I do this:\n\n$user_list_array = mysql_query(\"SELECT * FROM member_search WHERE IN($zip_codes_in_distance) AND gender = '$gender_of_interest_session'\");\nwhile($user_list = mysql_fetch_array($user_list_array))\n{\n$id_from_array = $user_list['id'];\n$username_from_array = $user_list['user_name'];\n$defaultpic_from_array = $user_list['defaultpic'];\n$city_from_array = $user_list['city'];\n\n}\n\n\nI get Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource on \n\n$user_list_array = mysql_query(\"SELECT * FROM member_search WHERE IN($zip_codes_in_distance) AND gender = '$gender_of_interest_session'\");\n\n\nI can't seem to figure out the proper way to query the list of zipcodes it comes out with. I do believe it has something to do with when I turn the zip code result into a string and have all of the zip codes seperated by a comma." ]
[ "php", "mysql" ]
[ "COBOL - Differing answer from mainframe to PC for same COMPUTE", "I have this very simple dummy COBOL program which does a dummy COMPUTE and displays the result.\n\n ID DIVISION.\n PROGRAM-ID. DUMMYPGM.\n DATA DIVISION.\n WORKING-STORAGE SECTION.\n 01 NUM-A PIC 9(3) VALUE 399.\n 01 NUM-B PIC 9(3) VALUE 211.\n 01 NUM-C PIC 9(3).\n *\n PROCEDURE DIVISION.\n MAIN.\n COMPUTE NUM-C = ((NUM-A / 100) - (NUM-B / 100)) * 100\n DISPLAY 'NUM-C IS ' NUM-C\n STOP RUN.\n\n\nWhen I compile this code on a mainframe (with compiler MVS Enterprise COBOL V4.2) and execute it, I get \"NUM-C IS 100\", probably because (399 / 100) is treated as a 3 instead of a 3.99 in the calculation (and same goes for 211 / 100).\n\nBut when I compile the same exact code on a PC (with the GnuCobol compiler) and execute it, I get \"NUM-C IS 188\".\nThe PC's answer is correct , but I would like to make it behave like the mainframe (and thus, losing precision in that compute statement to give 100 instead of 188)... How would I do that ? \n\nThe reason for the above is a general expression of this code:\n\n COMPUTE PDISCR = (((((X(1) + DX - XBRAK) * (ABRAK(1) / 1000)) / 100)\n + PHT(1) + DPH - PHBRAK) * 2) + ((V(1) + DV \n + VBRAKMPM) * (V(1) + DV - VBRAKMPM) / 100000)) \n\n\nThis is part of a 50-year-old Train simulation program, which I need to migrate to GnuCOBOL. All the fields used in the COMPUTE are integers. I need to be able to get the same answer from GnuCOBOL.\n\nConfirmed for OpenCOBOL/GnuCOBOL up to 2.0." ]
[ "cobol", "mainframe", "gnucobol" ]
[ "newly created hyper links are automatically convert to https", "I have site that is running on https. I am facing one problem here when I trying to add new Hyper links on my site. These are automatically converted into https. Can anyone know why this happening ?" ]
[ "c#", ".net", "https" ]
[ "How to check if the next td in a tr empty or not using jQuery", "I have a table that has 3 columns. In the first column I have a button and I want to check if the second column has a div of not. I am not trying to do this using jQuery.\n\nThis is my html\n\n<table class=\"customFiltersTable\" id=\"customFiltersTable\" width=\"100%\" style=\"background-color: #75A1D0; padding:10px 10px 10px 10px\">\n <tbody>\n\n\n </tbody>\n</table>\n\n\nThe (dropdown menu) button is generated dynamically inside the 1st column. Here is the script\n\n//create a tr and 3 td inside it then append tr\nvar fType1 = $('<tr class=\"rowTableFilters\" id=\"rowFilters'+filtersRow+'\" name=\"rowFilters'+filtersRow+'\"><td class=\"colFilters\" id=\"colFilters'+column1+'\" name=\"colFilters'+column1+'\" width=\"480px\" align=\"center\" columnNum=\"'+column1+'\"></td><td class=\"colFilters\" id=\"colFilters'+column2+'\" name=\"colFilters'+column2+'\" width=\"480px\" align=\"center\" columnNum=\"'+column2+'\"></td><td class=\"delButton\" id=\"delButton\" name=\"delButton\" width=\"40px\" align=\"center\"><button type=\"button\" class=\"btn btn-link\" id=\"deleteFilter'+filtersRow+'\" name=\"deleteFilter'+filtersRow+'\" style=\"float: right;\">Del</button></td></tr>');\n$(\"#customFiltersTable\").append(fType1);\n\n// create the dropdown menu button in the 1st column along with the list (li)\nvar fType = $('<div class=\"btn-group\" style=\"padding: 5px; width: 70%;\"><button type=\"button\" class=\"btn btn-default dropdown-toggle\" data-toggle=\"dropdown\" style=\"width: 100%;\">Select Filter <span class=\"caret\"></span></button><ul class=\"dropdown-menu\" role=\"menu\" style=\"width:100%\" data-userid=\"'+(intIdFilters-2)+'\" id=\"filUl'+(intIdFilters-2)+'\" currData-value=\"-1\"></ul></div>');\n$(\"#colFilters\"+(intIdFilters-2)).append(fType);\n$(\"#filUl\"+(intIdFilters-2)).append(li); // li is list already generated.\n\n\nso the if statement I am using (which not working) is this\n\n$('#customFiltersTable').on('click', '.dropdown-menu li a', function () {\nif($(this).closest('td').next('td').find('div').length){\n...\n}\n});\n\n\nAny idea please?" ]
[ "javascript", "jquery", "twitter-bootstrap-3" ]
[ "Why does passing a struct in this way produce a segfault?", "I'm trying to get the hang of c and I can't figure out why this code is producing a segfault.\n\n// In src/test.c\n\n#include <stdio.h>\n\ntypedef struct {\n int length;\n int *arr[1000];\n} Stack;\n\nvoid push(Stack *stack, int el) {\n (*stack->arr)[stack->length++] = el;\n}\n\nint pop(Stack *stack) {\n return (*stack->arr)[--stack->length];\n}\n\nint main(int argc, char* argv[]) {\n Stack stack;\n push(&stack, 5);\n printf(\"%d\\n\", pop(&stack));\n return 0;\n}\n\n\nThen I compile and run:\n\n$ gcc src/test.c -o test && ./test\n[1] 79484 segmentation fault ./test" ]
[ "c", "memory", "segmentation-fault" ]
[ "How to implement my own collection that can be used like a dictionary", "So I have an object that is part of a reply from a web request that has two properties on it. Both are string arrays. The first one is called COLUMNNAMES and the second is called VALUES. For instance COLUMNNAMES would have the following in it: \n\n\"ID\", \"NAME\", \"DATEADDED\", \"DATECHANGED\"\n\nand VALUES would have the following in it:\n\n\"1\", \"APPLES\", \"09/21/2013\", \"09/21/2013\"\n\n\"2\", \"ORANGES\", \"09/21/2013\", \"09/21/2013\"\n\n\"3\", \"STRAWBERRIES\", \"09/21/2013\", \"09/21/2013\"\n\nWhat I want to be able to do is somehow process these into a sort of data structure that I can call like so: \n\nDim rows = GetReply()\n\nFor Each r in rows\n Dim value = r(\"ID\") 'ID is a column name\nNext \n\n\nIs there a type that I can implement to create this or does this already exist? Thanks!" ]
[ ".net", "vb.net" ]
[ "Select cell from column with row value", "This simple problem has caused me some recent issues. I have a range of cells which are columns that hold onto different types of information. Using a row value (Integer not Range) which is previously determined I am looking to perform a check with the values within a single cell.\n\nFor example, I look through a list of names in column A. If the name is found it holds onto the Row value. Let's assume that the row is 10. This row value will be used in checking the column values for this row (I.e. C10, J10, and K10). How can I select a single cell and then compare the values within those cells?" ]
[ "vba", "excel" ]
[ "How to run a command to run a HTTP address?", "I have a server that sends emails and I want them to be logged into a database. I have all the actions set up, and if I open an internet window and enter http://192.168.0.2/email/getmail.php it runs the code in the PHP file and grabs any new emails from a remote mail server and downloads them into my database.\n\nBut I am having issues trying to get Windows Task Scheduler to do this task for me. I wold like it that every 10 minutes it will run this line, \n\nhttp://192.168.0.2/email/getmail.php.\n\n\nI set up this code I found on here into a text file and saved it as a vbs file, the Task scheduler runs the vbs file and it works for the first time, but it stays as Running in the status. So 10 minutes later it will not start to run again as it already is running and so it will not get new mails.\n\nSet oX = CreateObject(\"Microsoft.XmlHTTP\")\noX.Open \"GET\", \"http://192.168.0.2/email/getmail.php\", False\noX.Send \"\"\nWScript.Echo oX.responseText" ]
[ "http" ]
[ "C++ - CGI - Audio not working properly", "I have a website with an HTML5 audio element whose audio data shall be served via a cgi script.\nThe markup is rather simple:\n\n<audio controls>\n <source type=\"audio/mpeg\" src=\"audio.cgi?test.mp3\">\n <em>Me, your browser does not support HTML5 audio</em>\n</audio>\n\n\nThe cgi is written in C++ and is pretty simple too, I know there is need of optimizing, e.g. reading the whole file in a buffer is really bad, but that's not the point.\nThis basic version kinda works, meaning the audio is played, but the player does not display the full length and one can only seek through the track in parts that have already been played.\n\nIf the audio file is placed in a location accessible via the web-server everything works fine.\nThe difference between these two methods seems to be, that the client issues a partial-content request if the latter method is chosen and an ordinary 200 if I try to serve the audio data via the cgi at once.\n\nI wanted to implement partial-content serving into the cgi but I failed to read out the environment variable Request-Range, which is needed to serve the requested part of data.\n\nThis leads me to my questions:\n\n\nWhy does the HTML5 player not display the full length of the track if I'm serving the audio data via the cgi script?\nWould implementing a partial-content handling solve this issue?\nIf the partial-content handling is the right approach, how would I access the required environment variables in apache, since I have not found anything about them? Do I need to send a complete HTTP header indicating partial-content is coming, so the client knows he needs to send the required fields?\n\n\nThis is the source of the .cgi:\n\nvoid serveAudio()\n{\n //tried these, were not the right ones\n //getenv(\"HTTP_RANGE\");\n //getenv(\"HTTP_CONTENT_RANGE\");\n\n ifstream in(audioFile, ios::binary | ios::ate);\n size_t size = in.tellg();\n char *buffer = new char[size];\n\n in.seekg(0, ios::beg);\n in.read(buffer, size);\n\n cout<<\"Content-Type: audio/mpeg\\n\\n\";\n cout.write(buffer, size);\n}\n\n\nAny suggestions and helpful comments are appreciated!\nThanks in advance!\n\nP.S.:\n\nForgot to mention that this behaviour applies to FF 31 and IE 11." ]
[ "c++", "html", "apache", "audio" ]
[ "Angular Library - Nested component error - 'X' is not a known element", "I have the following Angular 10 library:\nprojects/\n my-lib/\n app-lib.component.ts\n app-lib.module.ts\n toolbar/\n toolbar.component.ts\n \n\nmy abbreviated module library\n@NgModule({\n declarations: [\nAppLibComponent,\nToolbarComponent],\nexports: [\n AppLibComponent,\n ToolbarComponent\n ]\n})\nexport class AppLibModule { }\n\nThe AppLibComponent.html uses the toolbar:\n<lib-toolbar></lib-toolbar>\n<div>main content</div>\n\nI push this library to my local Artifactory and use it in another Angular project.\nThe main abbreviated module looks like this:\nimport { AppLibComponent } from 'app-lib';\n@NgModule({\n declarations: [\n AppComponent,\n AppLibComponent\n ],\n})\n\nexport class AppModule { }\n\nThe app.component.html :\n<app-lib></app-lib>\n\nWhen I run this, the app renders the main content of the library\n<div>main content</div>\n\nbut gives me the following error for the toolbar component:\ncore.js:14085 'lib-toolbar' is not a known element:\n1. If 'lib-toolbar' is an Angular component, then verify that it is part of this module.\n2. If 'lib-toolbar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.\n\nThat makes no sense since I declare the toolbar component in the AppLibModule. What I am missing?\nAdditionally, when I debug the source code in Chrome debugger, I can see that the ToolbarComponent is present.\nThe library works fine when tested with the same project using a path in tsconfig.json pointing to the build in dist/app-lib.\nIt only fails when published to the repo and thereafter imported.\nIs it possible to use a child component in an Angular library?" ]
[ "angular", "angular-library" ]
[ "Reset the value to the configuration \"spark.executor.instances\"", "We have a YARN cluster and we use Spark 2.3.2 version. I wanted to use Spark's dynamic resource allocation while submitting the spark applications but in the spark-defaults.conf file the value of the property spark.executor.instances is set to 16. From my understanding, I should not set spark.executor.instances if we wanted to use dynamic resource allocation. Otherwise, even if the dynamic resource allocation is enabled, it is getting overridden by the property spark.executor.instances.\nI can't edit the spark-defaults.conf, so I wanted to reset the value assigned to spark.executor.instances through the --conf argument to spark-submit. I tried setting it to blank or 0 but in both of the cases, the job failed with spark.executor.instances should be a positive number.\nGiven this situation, how can I successfully use Spark's dynamic resource allocation?.\nOne more observation is, I do not see that the dynamic resource allocation enabled in the spark-defaults.conf file. Isn't it a default property since Spark 2.0?." ]
[ "apache-spark" ]
[ "signal test environment for arduino?", "I know this is a simple question with a very simple answer, but I am such a beginner I don't think I'm even able to effectively google. So please bear with me.\n\nI'm just looking for some kind of diagnostic software for arduino. Not a virtual environment, I want to test the controller itself. Specifically, I'm learning about I/O and analog signals and want to test if the rotary potentiometer I hooked up is sending a 0-255 value (as programmed) to the controller when I turn it. \n\nDoes anyone have the name of a software of this type, where I can get real-time values from my analog inputs? \n\nThanks so much in advance!" ]
[ "io", "arduino", "diagnostics" ]
[ "Node.js simplest code not working", "As I am a newbie to Node.js and is learning from different articles. So, far I have learnt, my code is\n\nAt server side with app.js\n\nvar http = require('http');\n\nvar app = http.createServer(function(req,res)\n{\n req.on('end',function()\n {\n res.writeHead(200, {'Content-Type': 'text/plain'});\n res.end('Hello');\n });\n});\n\nvar io = require('socket.io').listen(app);\n\nio.sockets.on('connection',function(socket)\n{\n socket.emit('connect',{msg:'Hello Client'});\n socket.on('client_Says',console.log);\n});\n\napp.listen(3000);\n\n\nAt client side with index.html\n\n<script type=\"text/javascript\" src=\"//localhost:3000/socket.io/socket.io.js\"></script>\n<script type=\"text/javascript\">\nvar socket = io.connect('//localhost:3000');\nsocket.on('connect',function(data)\n{\n alert('Server says '+data.msg);\n socket.emit('client_Says',{data:'Hello Server'});\n});\n</script>\n\n\nWhat is that I am doing wrong in above code? When I run app.js in console, it says info - socket.io started but when I run http://localhost:3000 it just keep requesting server.\n\nplus I want to know that is it true that wherever on my pc I create my folder for Node and place app.js and index.html files like above in it and run http://localhost:3000 in browser will automatically make that folder my site folder for localhost after running app.js in Node console?" ]
[ "javascript", "html", "node.js", "websocket", "socket.io" ]
[ "Sorting a vector of strings by the first letter in non-ascii order in C++", "I have a text file with a list of words.\n\nI used ifstream to read these words into a vector and now I am trying to sort them in an order similar to:\n\nA a B b C c [...]\n\n\nI tried to implement this using a third for loop inside of a bubble search algorithm to look at the first character of each word (I know this is far from the most efficient way especially if I was using a large data set)\n\nAnd then check whether the letter and the next letter were uppercase or lowercase and switching if the uppercase letter was the same letter as the current letter, but this didn't seem to work.\n\nvoid bubble_Sort (vector <string> & words)\n{\n for (unsigned i = words.size(); i >= 2; --i)\n {\n for (unsigned k = 0; k + 1 < i; k++)\n {\n int hi = k+1;\n string temp1 = words[hi];\n string temp2 = words[k];\n int smallsize = words[hi].size();\n int smallprecedence = 0;\n\n if (words[k].size() < words[hi].size())\n smallsize = words[k].size();\n\n for (unsigned j = 0; j < smallsize; j++)\n {\n if (temp1[j] >= 'A' && temp1[j] <= 'Z')\n {\n if (temp2[j] >='a' && temp2[j] <= 'z')\n {\n char lowercase1 = temp1[j] + 32;\n if (lowercase1 == temp2[j])\n {\n string temp = words[k];\n words[k] = words[hi];\n words[hi] = temp;\n break;\n }\n }\n\n else if (temp2[j] >= 'A' && temp2[j] <= 'Z')\n {\n if (temp1[j] < temp2[j])\n {\n string temp = words[k];\n words[k] = words[hi];\n words[hi] = temp;\n break;\n }\n }\n }\n\n if (temp1[j] >= 'a' && temp1[j] <= 'z')\n {\n if (temp2[j] >= 'A' && temp2[j] <= 'Z')\n {\n char uppercase1 = temp1[j] - 32;\n if (uppercase1 < temp2[j])\n {\n string temp = words[k];\n words[k] = words[hi];\n words[hi] = temp;\n break;\n }\n }\n\n else if (temp2[j] >= 'a' && temp2[j] <= 'z')\n {\n if (temp1[j] < temp2[j])\n {\n string temp = words[k];\n words[k] = words[hi];\n words[hi] = temp;\n break;\n }\n }\n }\n\n else if (temp1[j] == temp2[j] && temp1.size() < temp2.size())\n ++smallprecedence;\n }\n\n if (smallprecedence == smallsize)\n {\n string temporary = words[k];\n words[k] = words[hi];\n words[hi] = temporary;\n }\n }\n }\n}" ]
[ "c++", "sorting", "vector", "ascii", "bubble-sort" ]
[ "How to add slot in repeat dom in polymer 2", "i want to create a layout element, so i write the template like this\n\n\r\n\r\n <template>\r\n <div class=\"row\">\r\n <template is=\"dom-repeat\" items=\"[[cols]]\">\r\n <div class$=\"col-[[item]]\">\r\n <slot id=\"id[[index]]\" name=\"id[[index]]\">no value</slot>\r\n </div>\r\n </template>\r\n </div>\r\n </template>\r\n\r\n\r\n\n\nand in the html page file, i use this component like this:\n\n\r\n\r\n <tcpc-row>\r\n <span slot=\"id0\">cc id-tcpc-col-0 </span>\r\n <span slot=\"id1\">cc id-tcpc-col-1 </span>\r\n <span slot=\"id1\">cc id-tcpc-col-3 </span>\r\n </tcpc-row>\r\n\r\n\r\n\n\nbut i result is not correctly, when i write the template without repeat is ok, like this:\n\n\r\n\r\n<template>\r\n <div class=\"row\">\r\n <div class=\"col-3\">\r\n <slot name=\"id0\"></slot>\r\n </div>\r\n <div class=\"col-3\">\r\n <slot name=\"id1\"></slot>\r\n </div>\r\n <div class=\"col-3\">\r\n <slot name=\"id2\"></slot>\r\n </div>\r\n <!--<template is=\"dom-repeat\" items=\"[[cols]]\">\r\n <div class$=\"col-[[item]]\">\r\n <slot id=\"id[[index]]\" name=\"id[[index]]\">no value</slot>\r\n </div>\r\n </template>-->\r\n </div>\r\n</template>\r\n\r\n\r\n\n\nis there have some way to add slot in repeat?" ]
[ "web", "polymer", "components", "repeat", "slot" ]
[ "How to create html file from html table", "I want to create report in HTML format from HTML table. It's my table in Laravel.\nI try to do it with html2pdf but its not working properly anyone can help me to fix this? I want my table download like this table1.html with CSS and HTML table data or convert it to PDF.\n<div class="col-lg-12" id="Reports">\n <div >\n <table class="table table-dark" >\n <thead>\n <tr>\n <th scope="col">#</th>\n <th scope="col">نام دارایی</th>\n <th scope="col">CVSS</th>\n <th scope="col">توضیحات</th>\n <th scope="col">امتیاز</th>\n <th scope="col">تاریخ پیدایش</th>\n </tr>\n </thead>\n <tbody>\n @foreach($Reports as $Report)\n <tr class="{{\\App\\Report::CvssColor(json_decode($Report->Data)->score)}}">\n <th scope="row"><h6 style="color: white">{{$loop->iteration}}</h6></th>\n <td><h6 style="color: white" id="Name">{{$Report->Title}}</h6></td>\n <td><h6 style="color: white">{{json_decode($Report->Data)->cve}}</h6></td>\n <td><h6 style="color: white">{{json_decode($Report->Data)->summary}}</h6></td>\n <td><h6 style="color: white">{{json_decode($Report->Data)->score}}</h6></td>\n <td>\n <h6 style="color: white">{{\\Carbon\\Carbon::parse(preg_replace('/\\s/','',json_decode($Report->Data)->create_date))->format('Y-m-d')}}</h6>\n </td>\n </tr>\n @endforeach\n </tbody>\n </table>\n </div>\n</div>" ]
[ "javascript", "php", "html", "laravel", "pdf" ]
[ "Is it appropriate to use the singleton pattern on a Web Service class?", "I currently have a class MyClass with a constructor that logs into a Web Service, returns a Session ID if it doesn't already have one, and saves it in a private static SomeWebService service attribute. \n\nIn my controller, a call would look like new MyClass().doSomething() which in turn would end up calling service.someWebServiceMethod() within MyClass. \n\nIs it appropriate to continue creating a new MyClass for every call, seeing as I'm saving the session itself as static? Would it be more ideal to make SomeWebService service non-static and implement the Singleton pattern instead? Does it even matter?\n\nI saw this thread as I was about to switch to Singleton and now I'm unsure which approach to take." ]
[ "c#", "asp.net-mvc", "web-services", "singleton" ]
[ "how would i manage to install python's boto library on shared hosting?", "how would i manage to install python's boto library on shared hosting?" ]
[ "python" ]
[ "Postgres 9.5: Non-zero xmax of a row refenced as a foreign key", "According to http://www.postgresql.org/docs/current/static/ddl-system-columns.html:\n\n\n xmax - The identity (transaction ID) of the deleting transaction, or\n zero for an undeleted row version. It is possible for this column to\n be nonzero in a visible row version. That usually indicates that the\n deleting transaction hasn't committed yet, or that an attempted\n deletion was rolled back.\n\n\nBut if a row is referenced as a foreign key by another row, it also has a non-zero value for xmax:\n\ndrop table if exists demo;\ncreate table demo\n(\n id bigint primary key not null,\n pid bigint,\n constraint demo_pid_fk\n foreign key (pid)\n references demo (id)\n);\n\ninsert into demo(id, pid) values(1, NULL); \ninsert into demo(id, pid) values(2, 1); \ninsert into demo(id, pid) values(3, 3); \nselect xmin, xmax, * from demo;\n xmin | xmax | id | pid \n------+------+----+-----\n 1074 | 1075 | 1 | \n 1075 | 0 | 2 | 1\n 1076 | 1076 | 3 | 3\n(3 rows)\n\ninsert into demo(id, pid) values(4, 1); \nselect xmin, xmax, * from demo;\n xmin | xmax | id | pid \n------+------+----+-----\n 1074 | 1077 | 1 | \n 1075 | 0 | 2 | 1\n 1076 | 1076 | 3 | 3\n 1077 | 0 | 4 | 1\n(4 rows)\n\n\nIn the example above, it seems that xmax is set to the id of a last transaction that referenced the row as a foreign key. Why is it so? How does Postgres know that the row is still alive?" ]
[ "postgresql", "foreign-key-relationship" ]
[ "writing tcp server -- buffering a stream", "#include <sys/socket.h> // for socket(), bind(), listen(), accept()\n#include <netinet/in.h> // for PF_INET, SOCK_STREAM, IPPROTO_TCP\n#include <stdio.h> // for printf(), perror()\n#include <unistd.h> // for read(), write(), close()\n#include <string.h> // for bzero()\n\n#define DEMO_PORT 9723\n\n\nint main( void )\n{\n //-----------------------------------------\n // create an unnamed socket for the server\n //-----------------------------------------\n int sock = socket( PF_INET, SOCK_STREAM, IPPROTO_TCP );\n if ( sock < 0 )\n {\n perror( \"opening stream socket\" );\n return -1;\n }\n printf( \"\\nsock=%d \\n\", sock );\n\n //----------------------------------------\n // construct a name for the server socket\n //----------------------------------------\n struct sockaddr_in self;\n socklen_t nlen = sizeof self;\n bzero( &self, sizeof self );\n self.sin_family = AF_INET;\n self.sin_port = htons( DEMO_PORT );\n self.sin_addr.s_addr = htonl( INADDR_ANY );\n if ( bind( sock, (sockaddr *)&self, nlen ) < 0 )\n {\n perror( \"bind failed\" );\n return -1;\n }\n printf( \"bind succeeded port: %d\\n\",DEMO_PORT);\n\n //---------------------------------------------------------\n // now create a connection queue and wait for some clients\n //---------------------------------------------------------\n if ( listen( sock, 5 ) < 0 )\n {\n perror( \"listen failed\" );\n return -1;\n }\n printf( \"listen succeeded \\n\" );\n\n\n //---------------------------------------------------\n // main loop to process clients' connection-requests\n //---------------------------------------------------\n while ( 1 )\n {\n sockaddr_in peer;\n socklen_t plen = sizeof peer;\n bzero( &peer, plen );\n\n printf( \"server waiting \\n\" );\n\n int client = accept( sock, (sockaddr *)&peer, &plen );\n if ( client < 0 ) { perror( \"accept\" ); break; }\n\n //---------------------------------------------\n // we can now read from or write to the client\n //---------------------------------------------\n char ch;\n int index = 0;\n char get[1024];\n\n if ( read( client, &ch, 1 ) < 0 )\n {\n perror( \"read\" );\n } \n\n\n bool go = true;\n\n\n while(go){\n\n if(ch != '/' && ch != '\\r'){\n\n printf(\"read: %hhd\\n\", ch);\n\n get[index] = ch;\n printf( \"got stuff: %s\\n\", get );\n\n index++;\n\n read(index, &ch, 1);\n\n\n } else {\n\n go = false;\n index = 0;\n close( client );\n printf( \"server responded, connection closed\" );\n\n\n }\n }\n\n\n //if ( write( client, &ch, 1 ) < 0 ) { perror( \"write\" ); break; }\n\n\n\n }\n\n close( sock );\n printf( \"\\n\" );\n}\n\n\nthe while(go) look never works and it buffers incorrectly. I do not see the pattern within the buffer or how it works. \n\nWhat is the correct way to do this? to except a certain amount of bytes, store them in a string, then terminate the read if it reaches a newline character?" ]
[ "c++", "c", "string", "tcp", "buffer" ]
[ "Is the IoC container allowed to use the Messenger/Mediator class?", "I'm new with IoC, and i'm wondering if best practices allow the container to use the mediator class, for example MVVM Lite's Messenger. Can the container regiser for and send messages?\n\nThank you very much!" ]
[ "mvvm", "inversion-of-control", "ioc-container", "mediator", "messenger" ]
[ "How to generate graphql schema on run time?", "I have a graphql server written in golang using graphql-go api which fetches data from MongoDb and sends the data to the user. But this is when the graphql schema is static. In the future if there is a new field added to a mongodb collection, and the user queries it, then graphql server should be able to fetch that field dynamically. That means, run time schema needs to be generated. The type of the field is unknown. How can this be achieved ?" ]
[ "mongodb", "go", "graphql" ]
[ "how to pull custom field value", "I have a custom field, \"price\" and I want to pull that custom field for each individual post.\n\nI have the code:\n\n<?php $price = get_post_meta($post->ID, 'Price', true); ?>\n<?php echo $price; ?>\n\n\nBut this is pulling the value of the first post and applying it to all the posts. Can someone help me understand this code and understand why it's applying the same field value to all my posts? How can I make it pull the individual value for each post?\n\nThank you all, I'm really new at this." ]
[ "php", "wordpress", "field", "meta" ]
[ "Where do you put jquery javascript code in a CodeIgniter application?", "If I have this line in my view:\n\n<script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js\"></script>\n\n\nDo I also put my actual script in my view?\n\n <script type=\"text/javascript\"> \n $(document).ready(function() {\n\n alert(\"Hello world!\");\n\n }); </script>\n\n\nOr do I put my actual javascript somewhere else and send it to the view somehow?\n\nThanks." ]
[ "jquery", "codeigniter" ]
[ "Driver issues with porting code to new computer (CL_DEVICE_NOT_AVAILABLE...Build Program driver returned (517))", "I have a piece of code that I'm able to run on my iMac, and I'm trying to get it to run on a Mac Pro that I'm using for work. However, after doing a git clone to put the code on my Mac Pro, I'm running into an issue where I can't run the code via the GPU, and I'm pretty stumped.\n\nComputer #1 (code works): Late 2013 iMac, macOS Mojave (10.14.6), GPU is an NVIDIA GeForce GT 755M 1 GB\n\nComputer #2 (code does not work): Late 2013 Mac Pro, OS X Yosemite (10.10.3), GPU is an AMD FirePro D500 3072 MB\n\nI do not believe that the difference in OS is the issue; I ran El Capitan on my iMac until about a week ago, and the code ran fine (no changes to the program have been made since then).\n\nWhen I run the program on the Mac Pro, I get the following error:\n\n14:42:45 : RS : [CL_DEVICE_NOT_AVAILABLE] : OpenCL Error : Error: Build Program driver returned (517) (via pfn_notify)\n\n14:42:45 : RS : OpenCL Warning : clBuildProgram failed: could not build program for 0x1021c00 (AMD Radeon HD - FirePro D500 Compute Engine) (err:-2) (via pfn_notify)\n\n14:42:45 : RS : [CL_BUILD_ERROR] : OpenCL Build Error : Compiler build log:\n\nError returned by cvms_element_build_from_source\n(via pfn_notify)\n\n14:42:45 : RS: ERROR: CL Compilation failed:\nError returned by cvms_element_build_from_source\n\n\nI can run the code on the Mac Pro on the CPU, but I cannot get the code to run on the GPU. Is there some sort of driver that I'm missing, or is there something else in the code that I need to change?" ]
[ "c", "macos", "opencl", "amd" ]
[ "MySQL Spatial Data Type Indexing Performance Comparison", "Would a MBR function query against an indexed column with geometry type containing points and polygons (GeomCollection type) be slower than a MBR function against an indexed column with a polygon type?\n\nMy programmer instincts tell me that it would be slower and I should use the most descriptive spatial type I can.\n\nEdit: After reading Denis's answer, the real question is:\n\nIn MySQL \"does an indexed column with geometry type containing points and polygons actually contain the latter or are they reduced to a MBR?\"" ]
[ "mysql", "gis", "spatial-index", "spatial-query" ]
[ "Catch error's command lines while executing multiple inserts in a single sqlcommand", "i have to automate executing of multiple sql insert commands in a single sqlcommand of my application , and I have to keep insert commands which cloud not execute (because of errors) in executed c#'s sqlcommand .\nBy the way i don't want that errors suppress continuing the query execution.\n\nany suggestions?\n\nthank you" ]
[ "c#", "sql-server", "sqlcommand" ]
[ "Remove lines between pattern with awk", "Hello I would like to delete all the lines refering to an interface (from /etc/network/interfaces) with awk and I am not awk friendly but it seems that sed isn't easy to achieve that.\nauto lo\niface lo inet loopback\n\nauto eth0\niface eth0 inet static\n address 192.168.1.2\n netmask 255.255.255.0\n\nauto wlan0\niface wlan0 inet static\n address 192.168.2.2\n netmask 255.255.255.0\n\nauto eth1\niface eth1 inet static\n address 192.168.3.2\n netmask 255.255.255.0\n\nExample I want to remove wlan0 from a command line:\nauto lo\niface lo inet loopback\n\nauto eth0\niface eth0 inet static\n address 192.168.1.2\n netmask 255.255.255.0\n\nauto eth1\niface eth1 inet static\n address 192.168.3.2\n netmask 255.255.255.0\n\nThank you in advance for your help." ]
[ "bash", "awk", "sh" ]
[ "asp.net FriendlyUrl and querystring inline handling", "i successfully installed FriendlyUrl from Nuget using Install-Package Microsoft.AspNet.FriendlyUrls -Pre \n\nnow I am trying to do this in my default page : \n\n<a href=\"<%: FriendlyUrl.Href(\"~/About\",\"Watch\") %>\">About.aspx</a> \n\n\nbut this error occurred : 'FriendlyUrl' does not exist in the current context\n\nhow can I fix it ?" ]
[ "c#", "asp.net" ]
[ "How to manage significant functionality differences between user types in ASP.NET MVC2", "I think I may have made a mess of my controllers. I have a fairly simple site that allows users of type \"Staff\" or \"Client\" to view Projects. Staff have access to all projects, can add and delete them, add and delete users, assign clients permission to projects, etc.\n\nAs it stands this means I have a UserController and ProjectController, littered with Authentication attributes (ie. so a Client can change his email but nothing else like permissions, and Clients can't add/remove/edit projects but can browse their contents).\n\nAnd also, based on the user type/role, I switch out menu components. Should I be splitting up my controllers to have narrower focus, or is this a candidate for Areas? I \"feel\" like to much of my code is checking whether user X can do action Y based on both his role AND explicit per-project permissions.\n\nPS. I rewrote the subject several times trying to make it shorter :\\" ]
[ "asp.net-mvc", "asp.net-mvc-2", "asp.net-membership" ]
[ "Passing arrays in Perl", "All right, I'll try to explain what I've done so far. I'm using a Parellel::ForkManager to grab data from an array of URLs, which is then stored in variables (value1, value2, value3).\n\nI then collect the data from all of those processes, and display the data with $pm->run_on_finish.\n\n#...\nmy $pm = new Parallel::ForkManager(10);\n\n$pm->run_on_finish (\n sub {\n my @info = @{$data_structure_reference};\n\n print $info[0];\n print $info[1];\n print $info[2];\n }\n);\n\nfor my $var (@urls) {\n\n $pm->start and next;\n #...\n @returned = &something($var);\n #...\n $pm->finish(0, \\@returned);\n\n}\n\nsub something {\n\n #... getting data from each URL and storing it in variables\n\n my @array = (\n $value1,\n $value2,\n $value3\n );\n return @array;\n}\n\n\nNow, what I want to do, is to pass an array, @value4, as well, and then only display that data if there is something in the array. So, I want it to look like this:\n\nsub something {\n\n #... getting data from each URL and storing it in variables\n\n my @array = (\n $value1,\n $value2,\n $value3,\n @value4\n );\n return @array;\n}\n\n\nAnd then I want it to print that array, only if there is something in it.\n\nUnfortunately, I'm not entirely sure how to go about doing that." ]
[ "perl" ]
[ "AngularJS : How to get a sub-total from my directive using ng-repeat?", "I have a situation where I'm using an ng-repeat to display a directive, and this directive is responsible for calculating a sub-total and using 2-way binding to add that sub-total to my total.\n\nHowever, by using the ng-repeat, it's adding to the scope of the ng-repeat instead of my controller. How can I get this to work correctly?\n\nEdit: I figured out a solution, but not sure if it's the best way to do it...\n\nI changed:\n\n<div ng-repeat='item in myArray'>\n <add-it-up sub-total='total1'></add-it-up>\n</div>\n\n\nto\n\n<div ng-repeat='item in myArray'>\n <add-it-up sub-total='$parent.total1'></add-it-up>\n</div>\n\n\nand it's working. Is there a better way to do this?\n\nPlunker: http://plnkr.co/edit/lqh0z93yc5Q5E2gNBdtG?p=preview\n\n<!DOCTYPE html>\n<html ng-app='testApp'>\n\n <head>\n <script data-require=\"[email protected]\" data-semver=\"1.3.15\" src=\"https://code.angularjs.org/1.3.15/angular.js\"></script>\n </head>\n\n <body ng-controller='TestCtrl'>\n <!-- This doesn't work -->\n <div ng-repeat='item in myArray'>\n <add-it-up sub-total='total1'></add-it-up>\n </div>\n {{total1}}\n <br />\n\n <!-- This does work -->\n <add-it-up sub-total='total2'></add-it-up>\n <add-it-up sub-total='total2'></add-it-up>\n <add-it-up sub-total='total2'></add-it-up>\n {{total2}}\n\n <script>\n var app = angular.module('testApp', []);\n\n app.controller('TestCtrl', ['$scope', function($scope) {\n $scope.myArray = [0, 1, 2];\n $scope.total1 = 0;\n $scope.total2 = 0; \n }])\n\n app.directive(\"addItUp\", function () {\n return {\n restrict: 'E',\n scope: {\n subTotal: \"=\"\n },\n controller: ['$scope', '$timeout', function ($scope, $timeout) {\n $timeout(function() {\n console.log($scope.subTotal)\n $scope.subTotal += 5;\n console.log($scope.subTotal)\n })\n }]\n }\n })\n </script>\n </body>\n\n</html>" ]
[ "angularjs", "angularjs-directive", "angularjs-scope", "angularjs-ng-repeat" ]
[ "Error Code: 1062. Duplicate entry' for key Unique data field using UPDATE. MYSQL", "I'm trying to add a stored procedure for my Java project that communicates with a MYSQL database.\nWhen I try to edit a department record in my database it gives me an error code 1062 which states that there is a duplicate entry.\nAfter doing some searching it's clear that the error is due to the departmentName being a unique field.\nNot sure how to overcome this problem since the solutions online didn't help me.\nSo far I've turned off save mode and tried to add an IGNORE statement between UPDATE and department but that would just incorrectly force the new record into position 1 of the table (overwriting whatever was there).\nLet's assume that my database holds the following data:\nDID - departmentName\n 3 - Basketball\n 1 - CS\n 2 - English \n\nIf in my department table I want to change the departmentName in DID 1 to Math. It will give me that error message if I use the new stored procedure that I created. Yet this works fine with my manual call to the database from Java.\n(Error Code)\n07:50:09 call piercecollege.updateDepartment(1, 'Math') Error Code: 1062. Duplicate entry 'Math' for key 'departmentName_UNIQUE' 0.062 sec\n(MYSQL workbench procedure)\nCREATE DEFINER=`autofakt5`@`%` PROCEDURE `updateDepartment`(\nIN dID int,\nIN dName varchar(45)\n)\nBEGIN\nUPDATE department\nSET \ndepartmentName = dName\n\nWHERE DID = dID;\n\nEND\n\nPicture of Table\n CREATE TABLE `department` (\n `DID` int(11) NOT NULL,\n `departmentName` varchar(45) NOT NULL,\n PRIMARY KEY (`DID`),\n UNIQUE KEY `DID_UNIQUE` (`DID`),\n UNIQUE KEY `departmentName_UNIQUE` (`departmentName`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\nThis is my stored procedure\n (Stored Procedure call in JAVA)\n public void updateDepartmentMYSQL(Department temp) {\n Connection conn = null;\n try {\n conn = getConnection();\n } catch (SQLException e2) {\n System.out.println("ERROR: Could not connect to the database");\n e2.printStackTrace();\n return;\n }\n CallableStatement statement = null;\n\n try {\n int dID = temp.getDID();\n String dName = temp.getDepartmentName();\n \n \n statement = (CallableStatement) conn.prepareCall("{call \n updateDepartment(" \n +String.valueOf(dID) +",'" + dName +"')}");\n System.out.println(statement);\n \n statement.execute();\n \n statement.close();\n } catch (SQLException e) {\n \n e.printStackTrace();\n }\n \n }\n\nWhich replaced this working manual call to the database.\npublic void updateDepartmentMYSQLREPLACED(Department editedDepartment) { //replaced with procedure\n Connection conn = null;\n try {\n conn = getConnection();\n } catch (SQLException e2) {\n System.out.println("ERROR: Could not connect to the database");\n e2.printStackTrace();\n return;\n }\n\n Statement stmt = null;\n try {\n stmt = conn.createStatement();\n } catch (SQLException e3) {\n // TODO Auto-generated catch block\n e3.printStackTrace();\n }\n\n String sqlStatement = "UPDATE department " + "SET departmentName = '" + editedDepartment.getDepartmentName()\n + "' " + "WHERE DID = " + String.valueOf(editedDepartment.getDID()) + ";";\n System.out.println(sqlStatement);\n int rows = 0;\n try {\n rows = stmt.executeUpdate(sqlStatement);\n } catch (SQLException e2) {\n // TODO Auto-generated catch block\n e2.printStackTrace();\n }\n\n System.out.println(rows + " row(s) added to the table.");\n try {\n conn.close();\n } catch (SQLException e2) {\n // TODO Auto-generated catch block\n e2.printStackTrace();\n }\n\n}" ]
[ "java", "mysql" ]
[ "Applying the use of Functions and Procedures", "public static void main (String[] args) \n{\n Scanner sc = new Scanner(System.in);\n int number;\n System.out.println(\"Enter a number to find the factorial of it: \"); \n number= sc.nextInt(); \n int factor=1;\n if (number<0 && number>10)\n {\n System.out.println(\"Invalid!! the number has to be between 1 and 10\");\n }\n for( int x=1; x<=number; x++ )\n { \n factor = factor*x; \n System.out.println(\"The factorial of \"+number+\" is = \" +factor);\n }\n\n }\n\n\nCan u check my code @TNT? tell me if that's what u wanted me to do" ]
[ "java", "bluej" ]
[ "Convert char to number", "I'm in the process of reading a flat file - to use the characters read I want to convert them into numbers. I wrote a little function that converts a string to a vector:\n\n(defun string-to-vec (strng)\n (setf strng (remove #\\Space strng)) \n (let ((vec (make-array (length strng))))\n (dotimes (i (length strng) vec)\n (setf (svref vec i) (char strng i)))))\n\n\nHowever this returns a vector with character entries. Short of using char-code to convert unit number chars to numbers in a function, is there a simple way to read numbers as numbers from a file?" ]
[ "numbers", "lisp", "char" ]
[ "How to create C# async powershell method?", "So I want to create a way to run a powershell script asynchronously. The below code is what I have so far, but it doesn't seem to be async because it locks up the application and the output is incorrect.\n\n public static string RunScript(string scriptText)\n {\n PowerShell ps = PowerShell.Create().AddScript(scriptText);\n\n // Create an IAsyncResult object and call the\n // BeginInvoke method to start running the \n // pipeline asynchronously.\n IAsyncResult async = ps.BeginInvoke();\n\n // Using the PowerShell.EndInvoke method, get the\n // results from the IAsyncResult object.\n StringBuilder stringBuilder = new StringBuilder();\n foreach (PSObject result in ps.EndInvoke(async))\n {\n stringBuilder.AppendLine(result.Methods.ToString());\n } // End foreach.\n\n return stringBuilder.ToString();\n }" ]
[ "c#", "powershell", "asynchronous", "async-await" ]
[ "Can't run \"rake test\" after dropping a table", "In one of my recent migration files, I dropped a table I created a long time ago (drop_table :transactions)\n\nSince then \"rake test\" fails with \n\nActiveRecord::StatementInvalid: PG::Error: ERROR: relation \"transactions\" does not exist\nLINE 1: DELETE FROM \"transactions\"\n^\n: DELETE FROM \"transactions\"\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `async_exec'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `exec_no_cache'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:671:in `block in exec_delete'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:670:in `exec_delete'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:101:in `delete'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `delete'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:497:in `block (4 levels) in create_fixtures'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:496:in `each'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:496:in `block (3 levels) in create_fixtures'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:492:in `each'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:492:in `block (2 levels) in create_fixtures'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:491:in `block in create_fixtures'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:523:in `disable_referential_integrity'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:476:in `create_fixtures'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:895:in `load_fixtures'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-3.2.13/lib/active_record/fixtures.rb:849:in `setup_fixtures'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:407:in `_run__291023375__setup__979454852__callbacks'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_setup_callbacks'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'\nC:/Ruby/1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.13/lib/active_support/testing/setup_and_teardown.rb:35:in `run'\n\n\nI have no mention of transactions in my entire app (beside migration files).\n\nIt's working fine in dev and production environment, it's just the test that fails.\n\nI tried rake db:test:prepare but it's already ran after a rake test. I dropped the test database before running my rake test, the database is re-created but same error happen.\n\nAny idea where to look at/how fix it so I can run my tests again?" ]
[ "ruby-on-rails", "ruby-on-rails-3", "activerecord", "ruby-on-rails-3.2" ]
[ "Does having multiple activation function type neurons in a single layer make sense?", "I am wondering if there exists any case or needs for having multiple type of neurons which have different activation functions to each other, mixed within a single layer, and if so, how to implement that using tensorflow Estimator framework.\n\nI can think of simple example for which such a configuration might become useful.\nThink about trying to train a neural network that can predict whether an any given 2D point which has its coordinate value as (x, y), lying inside or outside of the given circle which also has its center and radius defined in a same 2D simple space.\n\nLets say that our circle has its center at (0.5, 0.5), and its radius defined to be 0.5.\nThe strategy for our training might be something like: to generate many points randomly first, and to judge for each point lies whether inside or outside of the circle, so that we can feed those set of randomly generated coordinates as the features and the result of the inside/outside judgement for each of it as its corresponding labels.\n\nThe judgement could easily be done by verifying formula below:\n(x-0.5)^2 + (y-0.5)^2 < r^2\nand this could be transformed as below:\nx^2 - x +y^2 - y + 0.5 < r^2\n\nNow, looking at this last formula, the training might obviously become effective if the neural network itself could obtain the value such as x^2 and y^2 automatically, simply out of its feature value which is given as (x, y).\nFor this, I have come to an idea to mix such an neurons that has f(x)=x^2 as its activation function, amongst the standard ReLU neurons.\n\nTo be honest, I already have done several test implementations of this problem using tensorflow Estimator framework, and in one of those I have seen that giving x^2 and y^2 as the additional features (total 4 feature values) should contribute to the effective training convergence compared to the case of 2 features, but the solution using f(x)=x^2 activation function appeard much smarter to me.\n\nAnd thats how I came up with my question here.\nHope if I could hear any opinion for this.\n\nThank you." ]
[ "tensorflow", "neural-network", "tensorflow-estimator", "activation-function" ]
[ "Why use Pythons 'virtualenv' on Linux when one has 'chroot' (and union/overlay filesystems)?", "First of all let me state that I am a proponent of generic software (in general ;-). I am no expert on Python, but it seems that the 'virtualenv' utility solves pretty much the same problem 'chroot' can help to solve - bootstrapping a directory tree that can be passed as root, thus effectively protecting the real directory tree, if needed.\n\nSince I am no expert in Python as already mentioned, I wonder - what problem can virtualenv solve that chroot cannot? I mean, can't I just set up a nice fake root tree (possibly using union mounting), chroot into it, and do pip install a package I want in my new environment, and then play around within the bounds of my new environment, running python scripts and what not?\n\nAm I missing something here?\n\nUpdate:\n\nCan't one install packages/modules locally in whatever application directory, I mean, without root privileges and subsequently without overwriting or adding files to /usr/lib or /usr/local/lib? It appears that this is what virtualenv does, however I think it has to symlink or otherwise provide a python interpreter for each environment one creates, does it not?" ]
[ "python", "linux", "virtualenv", "chroot" ]
[ "Execute PowerShell command from cmd - quotes issue", "I have to execute two commands (including a PowerShell one) in new console window. Let me explain:\n\nI am able to execute a PowerShell command from cmd in a new console window (I can specify the command inside quotes):\n\nstart /W cmd /K powershell -command \"&{Write-Host 'Hello World!';}\"\n\n\nAnd I can execute two commands (I can write both commands in quotes):\n\nstart /W cmd /K \"echo Hello && echo World\"\n\n\nBut how can I do it together (execute two commands, one of them PowerShell)? I would like to do it without any .bat or .ps script.\n\nI tried something like following (and some variations with escaping character), but I cannot deal with this quotes issue (there are quotes for joining two commands and inside quotes for PowerShell command).\n\nstart /W cmd /K \"echo Hello && powershell -command \"&{Write-Host 'Hello World!';}\"\"" ]
[ "powershell", "cmd", "double-quotes" ]
[ "Parsing a file and creating histogram with python", "I have to create an histogram from a source file that I have to parse:\n\nfor line in fp:\n data = line.split('__')\n if(len(data)==3 and data[2]!='\\n' and data[1]!=''):\n job_info = data[0].split(';')\n [...]\n job_times_req = data[2].split(';')\n if(len(job_times_req)==6):\n cpu_req = job_times_req[3]\n\n\nThe parsing is correct, I have try it, but now I would like to create an histogram on how many time I have called the X cpu. Example if I have called the first one 10 times, the second 4 times and so on I would like to see the hist of this.\n\nI have try something like:\n\na.append(cpu_req )\nplt.hist(a, 100)\nplt.xlabel('CPU N°', fontsize=20)\nplt.ylabel('Number of calls', fontsize= 20)\nplt.show()\n\n\nbut is not working, how can I store the data in the correct way to show them in a histogram?\n\nSolved with a simple cast \n\na.append(int(cpu_req))" ]
[ "python", "matplotlib", "histogram" ]
[ "use react-native-google-signin with custom domain", "I have google signin in a web and a react native app (android and ios).\n\nI can login in both platforms but the token data differs (and because of that the app's one is invalid) \n\nI've looked the docs and try multiple params in different fields but no success\n\napp configuration:\n\n // scopes: ['profile', 'email'], // it doesn't matter if commented or not\n // webClientId: '**********.apps.googleusercontent.com', //\n // offlineAccess: false, // if you want to access Google API on behalf of the user FROM YOUR SERVER\n // hostedDomain: 'https://securetoken.google.com/**********', // if I use this, (or other strings I tried, cant login\n // loginHint: '',\n forceConsentPrompt: true,\n accountName: '**********', // \n // accountName: '**********:android:**********', // nothing happens\n iosClientId: '**********.apps.googleusercontent.com', // is different from the android one\n\n\nweb configuration (with firebase):\n\n apiKey: \"**********\",\n authDomain: \"**********.firebaseapp.com\",\n databaseURL: \"https://**********.firebaseio.com\",\n projectId: \"**********\",\n storageBucket: \"\",\n 2: \"**********\",\n appId: \"**********:web:**********\"\n\n\nweb token infromation:\n\n {\n \"iss\": \"https://securetoken.google.com/**********\",\n \"aud\": \"**********\",\n \"sub\": \"**********\",\n \"email\": \"**********@gmail.com\",\n \"email_verified\": true,\n \"name\": \"**********\",\n \"picture\": \"**********\",\n \"auth_time\": 1568973313,\n \"user_id\": \"**********\",\n \"sign_in_provider\": \"google.com\",\n \"iat\": **********,\n \"exp\": **********,\n \"firebase\": {\n \"identities\": {\n \"google.com\": [\"**********\"],\n \"email\": [\"**********@gmail.com\"]\n }\n }\n }\n\n\napp token information:\n\n {\n \"iss\": \"https://accounts.google.com\",\n \"azp\": \"**********.apps.googleusercontent.com\",\n \"aud\": \"**********.apps.googleusercontent.com\",\n \"sub\": \"**********\",\n \"email\": \"**********@gmail.com\",\n \"email_verified\": true,\n \"name\": \"**********\",\n \"picture\": **********\",\n \"given_name\": \"**********\",\n \"family_name\": \"**********\",\n \"locale\": \"es\",\n \"iat\": **********,\n \"exp\": **********\n }" ]
[ "react-native", "google-signin" ]
[ "writing a parser for GUI debugger", "I want to write a GUI frontend to gdb, using MI. Currently I can communicate with gdb via pipe, but a GUI debugger should be able to display source code and allow users to check/modify data using thier mouse.\n\nThe question is, in order to know what variable the user is pointing at, I think I need to write a parser. However, I don't want to implement the whole lexer and parser things. How can I get the locations of those identifiers in the source code?\n\n[EDIT]\n\nIn short, I want the user to be able to check the value of a variable by hover over the variable using mouse, so I have to parse the code to know where does each variable appear. I want to achieve functions like this:" ]
[ "parsing", "debugging", "user-interface", "lexer" ]
[ "How to use AJAX & JSON with an API to call multiple URLs?", "I have several areas in which I need to take information and append it to my main HTML document, from separate pages that are generated with a weather API. \n\nFor instance, in the Current Conditions section, I need to reference \"http://api.wunderground.com/api/6905d444cd421efb/forecast/geolookup/conditions/q/CT/New_Haven.json\" but in my Hourly Forecast, I would need to be drawing the JSON info from \"http://api.wunderground.com/api/6905d444cd421efb/hourly/q/CT/New_Haven.json\" and then I need to repeat that same process again in a third separate section with another url for a 10 day forecast. Each time I call to a new URL, I will be creating new variables and appending their results to the DOM. \n\nThe code that I have below works, but if I try calling to the ajax method a second or third time, it does not work and things either show up as \"undefined\" or absolutely nothing shows on the page in the other sections. The only thing that remains displayed on my web page is the Current Conditions. \n\n\r\n\r\n$.ajax({ \r\n url : \"http://api.wunderground.com/api/6905d444cd421efb/forecast/geolookup/conditions/q/CT/New_Haven.json\",\r\n dataType : \"json\", \r\n success : function(parsed_json) {\r\n \r\n var current_icon = parsed_json['current_observation']['icon_url'];\r\n var current_weather = parsed_json['current_observation']['weather'];\r\n var location = parsed_json['location']['city']; \r\n var temp_f = parsed_json['current_observation']['temp_f'];\r\n var current_feels = parsed_json ['current_observation']['feelslike_f'];\r\n var current_humidity = parsed_json ['current_observation']['relative_humidity'];\r\n var current_windDirection = parsed_json ['current_observation']['wind_dir'];\r\n var current_windMPH = parsed_json ['current_observation']['wind_mph'];\r\n \r\n $(\"#icon\").append(\"<img src=' \" + current_icon + \"' alt='weather icon'/>\" );\r\n \r\n $(\"#currentCond\").append(\"Current Conditions: \" + current_weather);\r\n \r\n $(\"#currentLoc\").append(\"Location: \" + location);\r\n \r\n $(\"#currentTemp\").append(\" Temp: \" + temp_f + \"ºF\");\r\n \r\n $(\"#currentFeel\").append(\"Feels Like: \" + current_feels + \"ºF\");\r\n \r\n $(\"#currentHumid\").append(\"Humidity: \" + current_humidity);\r\n \r\n $(\"#currentWindDir\").append(\"Wind Direction: \" + current_windDirection);\r\n\r\n $(\"#currentWindMph\").append(\"Wind Speed: \" + current_windMPH + \" MPH\"); \r\n\r\n }/* Close Success */ \r\n }); /* Close Ajax */\r\n\r\n\r\n\n\nI try adding something like this after the first call is closed out. \n\n\r\n\r\n$.ajax({ \r\n url : \"http://api.wunderground.com/api/6905d444cd421efb/hourly/q/CT/New_Haven.json\",\r\n dataType : \"json\", \r\n success : function(parsed_json2) {\r\n \r\n var hourly_icon = parsed_json2['hourly_forecast']['icon_url'];\r\n var hourly_icons = parsed_json2['hourly_forecast']['icon'];\r\n \r\n $(\"#icons\").append(\"Icon Type: \" + hourly_icons);\r\n \r\n $(\"#icons\").append(\"<img src=' \" + hourly_icon + \"' alt='weather icon'/>\" );\r\n \r\n\r\n }/* Close Success */ \r\n }); /* Close Ajax */" ]
[ "javascript", "jquery", "json", "ajax" ]
[ "Best mysql datatype for grams, milligrams, micrograms and kilojoule", "I'm very dubious about datatype of my database, I need to use different unit of measurements because I have different elements and different scales, and I'm sure about the limits used, because I take them from standard elements, but I'm afraid about the variety.\nJust consider I work with 100 grams of product and take from it all elements, so, I'm sure I can't go over 100 grams for proteins, but i can reach 3500 kilojoule or 3,27 milligrams of iron element.\n\nSo I need various datatypes I think, but I'm not sure about the right kind.\nI'll show the max values to be more clear about the unit limits:\n\ngrams 99,99 g\nmilligrams 9999,99 mg\nmicrograms 99999 µg\nkilojoule 9999 kj\n\n\nSo, what is the right way?\nI'm sure the best way (the best performance) is to store the various elements with their standard values (for example, kilojoule for calories) but what are the datatype equivalents?" ]
[ "mysql", "types", "units-of-measurement" ]
[ "Python: Remove element from list returns None", "According to this link it should be easy to remove an element from a list. The example provided in the link works fine. In my use case I need a wrapper function that avoids the error from being returned if the passed list does not contain the element that should be removed.\n\nThis is the code that I've come up with:\n\ndef filterval(ls,val):\n if val in ls:\n return(ls.remove(val))\n else:\n return(ls)\n\n\nStrangely though, this code returns None in the following situation:\n\nprint(filterval([1,2,3,4,5],2))\n\n\nInterestingly if I define a list:\n\ntlist = [1,2,3,4,5]\n\n\nand execute\n\nprint(filterval(tlist,2))\n\n\nit still prints None, but printing tlist reveals that '2' has been removed successfully.\n\nWhat am I doing wrong?" ]
[ "python", "python-3.x", "list" ]
[ "Store the grouping element in two different array in perl?", "I tried to store the first group in @a1 and second group in @a2\n\nmy $string = \"abc123def456abc321def654\";\nmy (@a1,@a2) = $string =~m/abc(\\d+)def(\\d+)/g;\n$, = \"\\n\";\nprint @a1; \n\n\nResult is 123 456 321 654 and then @a2 is empty. But i want the result is @a1 = 123 321; @a2 = 456 654\nFor this result i tried hash , for to store the keys are first grouping and the values are second grouping but the problem is duplicates are removed. Any possible way for to do it with a single regex matching ?\n\nI tried eval group within pattern matching. I get the correct result from @a1 but @a2 going wrong. And don't know what is the problem?\n\nmy (@a1, @a2);\n$string =~m/abc(\\d+) (?{push @a1, $1}) def(\\d+)(?{push @a2,$2 }) \\G/x;\n\n\n@a1 result is\n\n1234\n321\n666\n\n\n@a2 result is\n\n4567\n456\n45\n4\n654\n65\n6\n777\n77\n7" ]
[ "regex", "perl" ]
[ "Opening phone's camera capture from browser automatically saves image locally", "I am opening the camera of a phone so the user can select and image and upload it to the server.\n\nSeems like that on android 4.4.2 and also 'android 4.1.2' when the user clicks on the image capture button - the image capture dialog is open.\n\nThe user than takes the picture, but if he clicks cancel (or ok) it creates a local copy of the image on the phone.\n\ni have checked it on android version > 5 and it didn't seem to happen there\n\n** Added example code **\n\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <title>Try Page</title>\n</head>\n<body>\nPress:\n<input type=\"file\" id=\"input\">\n</body>\n</html>\n\n\nquestion\n\nIs there a way to tell the phone not to save the image locally? (i just want it to upload to my server without filling the phone's memory with a lot of images)." ]
[ "javascript", "android", "html", "image-uploading", "image-capture" ]
[ "How to select first time from this given set of values", "Hi everyone i have this time column with data like this \n\ntime |\n------- |\n9:17:19 |\n9:17:23 |\n9:17:28 |\n9:17:33 |\n9:17:38 |\n9:18:03 |\n9:18:08 |\n9:18:13 |\n9:18:18 |\n9:19:03 | \n9:19:13 |\n9:19:59 |\n9:20:04 |\n9:20:59 |\n9:21:04 |\n9:21:09 |\n9:21:54 |\n9:21:59 |\n9:22:04 |\n9:22:09 | \n\n\nfrom this column my result should be from every Minute i want first time like \n\n9:17:19 |\n9:18:03 |\n9:19:03 |\n9:20:04 |\n9:21:04 |\n9:22:04 |\n\n\nif any mistakes please forgive me." ]
[ "mysql" ]
[ "Serializing object graph using MongoDB Bson serializer", "I've been playing a little with the MongoDB Bson serializer, using the following piece of code: \n\nclass Program\n{\n public class myValue\n {\n public int Id = 0;\n public string Label = \"\";\n }\n\n public class myValueMap : Dictionary<string, myValue>\n {\n }\n\n public class myProdData\n {\n public myValueMap Mapping { get; set; }\n\n }\n public class mySystemPosition\n {\n public string Text { get; set; }\n public myProdData ProdData { get; set; }\n\n }\n static void Main(string[] args)\n {\n BsonClassMap.RegisterClassMap<mySystemPosition>();\n BsonClassMap.RegisterClassMap<myProdData>();\n BsonClassMap.RegisterClassMap<myValueMap>();\n BsonClassMap.RegisterClassMap<myValue>();\n var o = new mySystemPosition()\n {\n ProdData = new myProdData()\n {\n Mapping = new myValueMap()\n {\n {\"123\", new myValue() {Id = 1, Label = \"Item1\"}},\n {\"345\", new myValue() {Id = 2, Label = \"Item2\"}},\n }\n }\n };\n var bson = o.ToBson();\n\n var text = Encoding.ASCII.GetString(bson);\n }\n}\n\n\nhowever I don't seem to be able to get the myProdData.Mapping serialized....\n\nDo I need to configure the MongoDB Bson serializer in a special way, to make this work?" ]
[ "serialization", "mongodb", "mongodb-.net-driver", "bson" ]
[ "How to put some relations into a custom defined field in the HTTP response in Laravel 6?", "I'm working with a Laravel 6.x project and I need to manipulate the response format. I need to put my prices relations results into a prices field in the returning JSON response.\nI have a Product model with these relationships:\npublic function sellingPrices() {\n return $this->morphToMany(SellingPrice::class, 'product_variantables');\n}\n\npublic function supplyingPrices() {\n return $this->morphToMany(SupplyingPrice::class, 'product_variantables');\n}\n\npublic function supplierListPrices() {\n return $this->morphToMany(SupplierListPrice::class, 'product_variantables');\n}\n\nAnd here is the current code from my controller:\npublic function index() {\n return Product::with([\n 'orderStatus',\n 'files',\n 'properties',\n 'sellingPrices',\n 'suppyingPrices',\n 'supplierListPrices',\n ])->get();\n}\n\nOf course this gets back this result:\n{\n "id": 1,\n "name": "My Product",\n "order_status": { ... },\n "files": [],\n "properties": [],\n "selling_prices": [],\n "supplying_prices": [],\n "supplier_list_prices": []\n}\n\nWhat is the best way to say Laravel I want to get back this result?\n{\n "id": 1,\n "name": "My Product",\n "order_status": { ... },\n "files": [],\n "properties": [],\n "prices": {\n "selling_prices": [],\n "supplying_prices": [],\n "supplier_list_prices": []\n }\n}\n\nHow can I put some relations into a custom defined field in the HTTP response?" ]
[ "php", "laravel", "laravel-6" ]
[ "threejs line follow along geometry", "I am looking for a way to draw a (poly)line around an object. I have a mesh where I need lines projected on so I can use this for my project.\n\nFor example I have this geometry: https://threejs.org/examples/webgl_materials_skin.html\n\nNo horizontal around the head. Going over the nose, ears and should be closed. I have thought about raycasting to the center of the object every 1 degree. But this will lose accuracy.\n\nThis is a really bad picture but gives the idea, I want to try and get the red line around the geometry as a new polyline: \n\n\nIs there a way I can get a polyline out of the geometry at a specific height?" ]
[ "javascript", "three.js" ]
[ "How do I force an SSIS package to NOT reuse execution plans?", "I know in SQL Server that I can force an execution plan to recompiled when running a stored procedure.\n\nHowever, I have an SSIS package that is running through the SQL Agent. After some big changes to the data which it operates on, the package went from taking 3 minutes to run to taking 3 hours. When I run the package manually in SSDT, or after the server has restarted, it runs fine. After some troubleshooting, I believe it's because the cached execution plan it had was no longer correct for the data it's operating on.\n\nIt there a way to tell SQL Server that when it runs this particular SSIS package, it should recompile everything and get a fresh execution plan? The data it operates on can vary wildly in size from day to day.\n\nMany thanks." ]
[ "sql-server", "ssis" ]
[ "How Xcode Convert var names to View Names in Storyboard", "I would like to know if there is any easy way to do this\n\nHere is the value name \n\nHere is the View Name \n\nI want to know how to do this programmatically, is there any easy way? \nPreferably in Swift, obj-C will do too\n\nThank you" ]
[ "ios", "objective-c", "xcode", "swift", "storyboard" ]
[ "Drawing segments on QML canvas", "Consider the code below, which allows you to insert successive points represented as black circles onto the canvas. The aim of the code, is to \njoin each successive point by a red line segment. \n\nHowever, the code gives me a canvas which looks like this\n\n\n\nOnly the first and second points have been joined by a red segment. None of the other points have been joined by segments. How do I fix that? \n\nHere is the QML code\n\nimport QtQuick 2.7\nimport QtQuick.Window 2.2\nimport QtQuick.Controls 1.4\nWindow{\n id: root\n width: 640\n height: 480\n visible: true\n\n Canvas {\n id: mycanvas\n width: 500\n height: 500\n function clear() {\n var ctx = getContext(\"2d\");\n ctx.reset();\n mycanvas.requestPaint();\n }\n\n Path {\n id: myPath\n startX: 0; startY: 100\n PathLine { x: 400; y: 500 }\n }\n property var arrpoints : []\n\n onPaint: {\n var context = getContext(\"2d\");\n\n // Render all the points as small black-circles\n context.strokeStyle = Qt.rgba(0, 1, 1, 0)\n for(var i=0; i < arrpoints.length; i++){\n var point= arrpoints[i]\n context.ellipse(point[\"x\"], point[\"y\"], 10, 10)\n }\n\n context.fill()\n context.stroke()\n\n // Join successive points with red segments\n for (var j=1 ; j < arrpoints.length ; j++){\n var start = arrpoints[j-1]\n var end = arrpoints[j]\n context.beginPath();\n context.lineWidth = 2;\n context.moveTo(start[\"x\"], start[\"y\"]);\n context.strokeStyle = \"red\"\n context.lineTo(end[\"x\"], end[\"y\"]);\n }\n context.stroke();\n }\n\n MouseArea {\n id: mymouse\n anchors.fill: parent\n onClicked: {\n mycanvas.arrpoints.push({\"x\": mouseX, \"y\": mouseY})\n mycanvas.requestPaint()\n console.log( mycanvas.arrpoints )\n }\n }\n }\n\n Button {\n text: \"Clear Points\"\n anchors.top : mycanvas.bottom\n onClicked: {\n mycanvas.arrpoints.length = 0\n mycanvas.clear()\n console.log( mycanvas.arrpoints )\n }\n }\n}//Window" ]
[ "qt", "canvas", "qml", "qt5" ]
[ "Automatic route calculation from A to B with JavaScript + Google Distance Matrix Service", "My goal is to automate process of route calculation from A to B in Google Maps by using JavaScript + Google Distance Matrix Service. I would like to find route which is the fastest (based on current traffic). Script should calculate route by using current date and time. \n\n<script src=\"https://maps.google.com/maps/api/js?sensor=false\"></script>\n<script>\nfunction init() {\n var service = new google.maps.DistanceMatrixService;\n var origin = 'Great,Lake,8';\n var destination = 'Lake,Great,21';\n service.getDistanceMatrix({\n origins: [origin],\n destinations: [destination],\n travelMode: google.maps.TravelMode.DRIVING,\n unitSystem: google.maps.UnitSystem.METRIC,\n drivingOptions: {\n departureTime: new Date(Date.now()), // for the time N milliseconds from now.\n trafficModel: \"best_guess\"\n }\n}, function(response, status) {\n if (status !== google.maps.DistanceMatrixStatus.OK) {\n alert('Error was: ' + status);\n } else {\n\n<!-- The same accessing of elements in object\n --> \n<!-- document.getElementById(\"result\").innerHTML += '1)' + JSON.stringify(response.rows[0].elements[0].distance.text) + '<br>';\n document.getElementById(\"result\").innerHTML += '2)' + JSON.stringify(response.rows[0].elements[0]['distance']['text']) + '<br>';;\n document.getElementById(\"result\").innerHTML += '3) RESPONSE: ' + JSON.stringify(response) +'<br><br>'; -->\n\n document.getElementById(\"result\").innerHTML += 'RESULT: ' + JSON.stringify(response);\n\nalert(response.originAddresses[0] + ' ' + response.destinationAddresses[0] + ' ==> ' + response.rows[0].elements[0].duration.text + ' ' + response.rows[0].elements[0].distance.text);\n }\n });\n}\n</script>\n<body onload=\"init()\">\n<div id=\"result\">\n</div>\n</body>\n\n\nCode works only if drivingOptions is removed. But I need this object - because I would like to calculate route based on traffic situation. I am executing script in https://jsfiddle.net/ - so I don't see any errors - except that when I removed drivingOptions object I saw that pop up with time and distance shown in pop up." ]
[ "javascript" ]
[ "Javascript client side login, how to authenticate server side?", "I'm looking for the best practice to pass secure data from client side to server side. \n\nFor example, I have a client side authentication and sometimes I need to call private apis on the server side from the client side, but I need to make sure that user is authenticated/authorized to perform those calls on the server side, and right now only the browser knows if user is authenticated. \n\nThank you!" ]
[ "javascript", "authentication", "client-side", "server-side" ]
[ "Getting a TypeError: can't multiply sequence by non-int of type 'str'", "TypeError Full code\n #Input of Rectangles\n\nprint(\"~\" * 60)\nprint(\"~\" * 60)\nlengthOne = str(int(input(\"Enter the Length of Rectangle #01 = \")));\nwidthOne = str(int(input(\"Enter the Width of Rectangle #01 = \")));\nareaRecOne = (lengthOne * widthOne)\nprint(\"~\" * 60)\nlengthTwo = str(input(\"Enter the Length of Rectangle #02 = \"));\nwidthTwo = str(input(\"Enter the Width of Rectangle #02 = \"));\n\n#Output of Rectangles\nprint(\"~\" * 60)\nprint(\"~\" * 60)\nprint(\"Length of Rectangle #01 = \" + lengthOne + \" SQ Inches\");\nprint(\"Width of Rectangle #01 = \" + widthOne + \" SQ Inches\");\nprint(\"Area of Rectangle #01 = \" + areaRecOne + \" SQ Inches\");\nprint(\"~\" * 60)\nprint(\"Length of Rectangle #02 = \" + lengthTwo + \" SQ Inches\");\nprint(\"Width of Rectangle #02 = \" + widthTwo + \" SQ Inches\");\nprint(\"~\" * 60)\nprint(\"~\" * 60)\n#Calculation which Rectangle is greater\n\n\nI just started COP1000 class and im stuck on this problem that keeps coming up. Iv tried everything i learned so far with no results. \n\nWhat i need is for the code to calculate the AREA of the rectangle and stat which Rectangle is greater\n\nBut everytime the multiplying keeps saying that\n\n areaRecOne = (lengthOne * widthOne)\n TypeError: can't multiply sequence by non-int of type 'str'\n\n\nThank you in advance!" ]
[ "python" ]
[ "FCM push notification receiving in Signed APK but not in debug", "FCM push is working fine in Signed APK but when I am using the same server key and JSON in the debug version, the FCM is showing mismatch sender id. I have already added the SHA 1 in the firebase console and also tried with the legacy key but still getting the mismatch sender id error. Package name, google service JSON and the notification everything is the same for both cases but it's working only in the signed APK. How can I solve this issue?\n\nthis is my notification JSON\n\n{\"collapse_key\":\"axxxpex\",\"data\":{\"match_id\":7,\"sound\":\"default\",\"title\":\"test\",\"body\":\"Goal....\",\"android_channel_id\":\"channelone\"},\"to\":\"f8Yf3AxxxxxxxxxxxxEFXUrcKLxzRfyzfw-J5xxxxxxxxFCC\",\"priority\":\"high\",\"ttl\":\"86400s\"}" ]
[ "android", "push-notification", "firebase-cloud-messaging", "signed-apk" ]
[ "How do I replace a word in a text file with another word and an action?", "hi all\nSuppose we have a text file (file1.txt)\n\nfile1.txt contains many words and spaces and enter characters (cR+LF). \nI wanna to replace a specific word that follows with an enter character and replace it with only that word. I mean eliminating cr+lf character.\n\nHow ?\n\nThank you" ]
[ "file", "text", "replace", "newline", "hidden-characters" ]
[ "How do I reduce phantomjs memory usage", "I run on my VPS a script that generates organic visitors from google. The script generates .sh files and the traffic starts once the file is opened.\n\nI4M NOT A DEVELOPPER AS I BOUGHT THE SCRIPT\n\nbut their support don't answer lately and I need a way to reduce the memory usage (it\"s 98%)\n\nThanks everyone" ]
[ "phantomjs" ]
[ "Python Imaging Library Mac OSX for Python 2.7?", "Possible Duplicate:\n how to install PIL on mac os x 10.7.2 Lion \n\n\n\n\nHow can I get PIL for Mac OSX for Python 2.7? If there is none, is there a different library just as powerful?" ]
[ "python", "macos", "image", "osx-lion", "python-imaging-library" ]
[ "Retrieving annotation information in soot", "I would like to search all occurrences of a certain annotation to select analysis regions.\nTake nullck analysis for example; I would want to find all @NotNull annotations and start running the nullck analysis from methods containing a variable declared @NotNull.\nIs it possible to do this with soot? It appears that Jimple does not preserve annotation information.\nAlternatively, would it be a good idea to write an annotation preprocessor that generates special markers around local variables annotated with @NotNull and match these markers when Soot is running?" ]
[ "java", "annotations", "soot" ]
[ "Fill/update the enum values at runtime in C#", "I have windows app where-in i need to fill enum values at runtime by reading a text file named \"Controls.txt\".\nAs restriction, i'm not suppose to use dictionary. Below is the default values available in the enum MyControls. I have to use enums only.\n\npublic enum MyControls\n{\n Button1 = 0,\n Button2 = 1,\n Button3 = 2,\n}\n\n\nIf Controls.txt file is available, then content of enum should change like\n\npublic enum MyControls\n{\n btn1 = 0,\n btn2 = 1,\n btn3 = 2,\n}\n\n\nhow do i achieve this. I also came across the link Creating / Modifying Enums at Runtime but could not get idea." ]
[ "c#", "dynamic", "enums" ]