texts
sequence
tags
sequence
[ "Filter on Cell Value Inside a Table", "I have a table from A2 to A7. The cell A1 doesn't belong to that table.\nAs long as the Cell A1 is empty the below macro works properly, but when I enter any value in cell A1 the macro stops working. The VBA debugger says: The AutoFilter Method of the Rang cannot be run (ErrorCode 1004).\nPublic Sub FilterOnCellValue()\n Dim nField As Long\n With ActiveCell\n nField = .Column - .CurrentRegion.Cells(1).Column + 1\n .CurrentRegion.AutoFilter Field:=nField, Criteria1:=.Value\n End With\nEnd Sub\n\nThe Question: How can I limit my macro to filter only inside the table?\n \nUpdate:\nI want to use this macro in all tables and all files and not in a certain table. Is there any solution?" ]
[ "excel", "vba" ]
[ "Python 3 inheritance multiple classes with __str__", "How do I use multiple __str__ from other classes? For example:\n\nclass A:\n def __str__(self):\n return \"this\"\n\nclass B:\n def __str__(self):\n return \"that\"\n\nclass C(A,B):\n def __str__(self):\n return super(C, self).__str__() + \" those\"\n # return something(A) + \" \" something(B) + \" those\"\n\ncc = C()\nprint(cc)\n\n\nOutput: this those\n\nI would like the output to be: this that those\n\nThis post is almost a solution (with super())" ]
[ "python", "string", "python-3.x", "class", "inheritance" ]
[ "Python - Heroku job scheduler file created dont appear", "I am running a job scheduler on the Heroku server. This job creates a file named 'informe_diario_fundos.csv'.\n\nWhen the job is running, the program creates the file as shown below in the Heroku logs.\n\n2020-05-30T17:35:01.908367+00:00 app[clock.1]: 2020-05-30 17:35:01 -- Criando as diferenças do período de datas inicial e final\n2020-05-30T17:35:02.185849+00:00 app[clock.1]: ['informe_diario_fundos.csv', 'runtime.txt', 'tabelas.sql', '.profile.d', 'robo.py', 'postgree_tabelas.txt', 'Procfile', 'app', '.vscode', 'main.py', 'requirements.txt', '.idea', 'manage.py', '.heroku']\n\nBut when I run the command ls to list the files of the folder, the file informe_diario_fundos.csv doesn't appear.\nThe output of ls looks like:\n\nls\n\n\napp manage.py Procfile robo.py tabelas.sql\nmain.py postgree_tabelas.txt requirements.txt runtime.txt\n\nwhy the Heroku logs do not show the file created?" ]
[ "python", "heroku", "apscheduler" ]
[ "How to test the keys and values of api response for Request specs", "I am writing Request specs, and having trouble with to test api respond in json formate. I am using capybara and fabricator, here is my code which i trying...\n\n context 'discounts in api' do\n let(:user) { Fabricate(:user, activated: true) }\n let(:api_token) { user.api_token }\n\n before { visit api_url_for('/v1/discount_coupons', api_token) }\n\n it 'returns coupons collection' do\n Fabricate(:discount_coupon, code: 'Discount One', global: true)\n\n save_screenshot(\"tmp/capybara/screenshot-#{Time::now.strftime('%Y%m%d%H%M%S%N')}.png\")\n save_and_open_page\n\n\n expect(json_response['total_records']).to eq 1\n expect(json_response['total_pages']).to eq 1\n expect(json_response['page']).to eq 0\n expect(json_response['discount_coupons'].size).to eq 1\n expect(json_response['discount_coupons'][0]['code']).to eq 'Discount One'\n end\nend\n\n\nthe responce i getting is this \n\n{\"discount_coupons\":[{\"id\":11,\"code\":\"Discount One\",\"type\":\"DiscountPercentage\",\"amount_off\":1.5,\"global\":true,\"expires_on\":null,\"vendors\":[]}],\"page\":0,\"total_pages\":1,\"total_records\":1}\n\n\nand error goes to stop me for run a successful test,\n\nFailure/Error: expect(json_response['total_pages']).to eq 1\n NoMethodError:\n undefined method `body' for nil:NilClass \n\n\nI think my expect to json_response is wrong or something missing, can somone help me to do it handsome way please, hint to that how can i test using key and value." ]
[ "ruby-on-rails-4", "capybara", "rspec-rails", "fabrication-gem" ]
[ "Check if the value change in loop Vuejs", "I'm making chat app by Vuejs and want to handle if messages in loop belong to new user for styling color/background-color of user's message.\n<template v-for="msg in allMsgs">\n <li :key=msg.id> //I want to add some class to handle if next message belong to new user.\n <span class="chatname">{{msg.user.name}}</span>\n {{msg.content}}\n </li>\n</template>\n\nhttps://prnt.sc/114ynuq\nThank you so much" ]
[ "vue.js" ]
[ "UriTemplate prefix for RESTful WCF web service", "I have various interfaces (endpoints) in a WCF service host, each for a completely different concern. In a classic soapy web service, I'm able to define a base host address (e.g. http://myhost.com/) and map each interface to a relative URI (IServiceContract -> service/, IMaintenanceContract -> maintenance/) so I can call them by e.g. http://myhost.com/service/mymethod.\n\nNow I'm taking my first steps towards a RESTful WCF service using JSON as message format for CRUD web requests and the only thing I see to address an operation is by using the UriTemplate field from WebInvoke (or WebGet) attribute. Unfortunately, it doesn't seem that I can put this on the interface, just on operation contract methods.\n\nHow can I map each interface to a different relative URI?" ]
[ "c#", ".net", "wcf", "web-services", "rest" ]
[ "Beautifulsoup regex: how to detect this pattern ==> SOME TEXT", "I am facing an issue with Beautifulsoup.\n\nI have some HTML like so:\n\nCe n'est pas de l'oubli ; nous répétons encore\n<br><br>\nPoète de l'amour, ces chants que fit éclore\n<br><br>\nDans ton âme éperdue un éternel tourment\n<br><br>\nEt le Temps sans pitié qui brise de son aile\n\n\nAnd I need a way to detect this pattern:\n\n<br><br>\nsometext\n<br><br>\n\n\nHow can I do this?" ]
[ "html", "regex", "beautifulsoup" ]
[ "tableView not appearing in ViewController (swift)", "While running the code in XCode 6.1 nothing appears in the ViewController.\n\nimport UIKit\n\nclass ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {\n\n var tableView: UITableView!\n var messages: [String] = [String]()\n\n override func viewDidLoad() {\n super.viewDidLoad()\n tableView = UITableView()\n tableView.dataSource = self\n tableView.delegate = self\n self.view.addSubview(self.tableView)\n\n //http://stackoverflow.com/questions/25413239/custom-uitablecellview-programmatically-using-swift\n //Auto-set the UITableViewCells height (requires iOS8)\n tableView.rowHeight = UITableViewAutomaticDimension\n tableView.estimatedRowHeight = 44\n\n // add something to messages\n messages.append(\"foo\")\n messages.append(\"bar\")\n }\n\n // TABLEVIEWS\n //func numberOfSectionsInTableView(tableView: UITableView!) -> Int {\n // return 1\n //}\n\n func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {\n var count = messages.count ?? 0\n NSLog(\"message count: \\(count)\")\n return count\n }\n\n func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {\n //var cell = tableView.dequeueReusableCellWithIdentifier(\"MyCell\") as MyCell\n var cell = UITableViewCell()\n NSLog(\"row[\\(indexPath.row)]: \\(messages[indexPath.row])\")\n cell.textLabel.text = messages[indexPath.row]\n return cell\n }\n\n override func didReceiveMemoryWarning() {\n super.didReceiveMemoryWarning()\n // Dispose of any resources that can be recreated.\n }\n}" ]
[ "ios", "uitableview", "swift", "uiviewcontroller" ]
[ "Typescript compilation returns a lot of errors after VisualStudio 2017 install", "After VisualStudio 2017 install on my pc I have problem with typescript compilation. Could somebody help with this issue? I can't find any explanation of this behaviour. In VS2015 it also returns same errors. Now I have installed [email protected] globally.\n\nHere is my typings.json\n\n{\n \"globalDependencies\": {\n \"core-js\": \"registry:dt/core-js#0.0.0+20160725163759\",\n \"jasmine\": \"registry:dt/jasmine#2.2.0+20160621224255\",\n \"node\": \"registry:dt/node#6.0.0+20160909174046\"\n }\n}\n\n\nHere is my tsconfig.json\n\n{\n \"compileOnSave\": true,\n \"compilerOptions\": {\n \"target\": \"es5\",\n \"module\": \"commonjs\",\n \"moduleResolution\": \"node\",\n \"sourceMap\": true,\n \"emitDecoratorMetadata\": true,\n \"experimentalDecorators\": true,\n \"removeComments\": false,\n \"noImplicitAny\": false\n },\n \"exclude\": [\n \"node_modules\"\n ]\n}\n\n\nHere in log from VisualStudio\n\n\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(569,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'Number'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(599,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'Math'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(619,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'RegExp'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(623,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'Map'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(624,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'Set'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(625,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'WeakMap'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(626,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'WeakSet'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(627,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'Promise'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(628,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'Symbol'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(629,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'Dict'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(630,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'global'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(631,11):\n error TS2451: Build:Cannot redeclare block-scoped variable 'log'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(632,11):\n error TS2451: Build:Cannot redeclare block-scoped variable '_'.\n 2>C:\\dev\\Marketplace\\Marketplace.Web\\node_modules\\@types\\core-js\\index.d.ts(661,5):\n error TS2300: Build:Duplicate identifier 'export='." ]
[ "typescript", "typescript-typings" ]
[ "Find number of occurrences of modal value for a group using data.table [R]", "I've been using the excellent answer here to find the mode for groups with data table. However, I'd also like to find the number of occurrences of the modal value of x for each group of variable y. How can I do this?\n\nEdit: there is a faster way to find mode than in the answer linked above. I can't find the answer I got it from (please edit and link if you do), but it uses this function (and finds multiple modes if they exist):\n\n MultipleMode <- function(x) {\n ux <- unique(x)\n tab <- tabulate(match(x, ux)); ux[tab == max(tab)]\n}\n\n\nHere is a version which arbitrarily takes only the first mode when there are two:\n\nSingleMode <- function(x) {\n ux <- unique(x)\n ux[which.max(tabulate(match(x, ux)))]\n\n\n}\n\nI'm now using this as the base code from which I write a function to find the frequency of the mode, as seen below, instead of the answer I linked to above." ]
[ "r", "function", "data.table", "mode" ]
[ "keypress not working in chrome or firefox", "function firstname()\n{\nvar x=document.forms[\"frm\"][\"fname\"].value;\nif(x==\"\")\n { \n document.getElementById(\"checkfname\").value = \" First Name required\";\n return false;\n}\n else\n {\n document.getElementById(\"checkfname\").value = \"\";\nreturn true;\n}\n }\n<html>\n<body>\n <form method=\"post\" name=\"frm\">\n <input type=\"text\" name=\"fname\" onkeypress=\"firstname()\" onkeydown=\"firstname()\" onkeyup=\"firstname()\"/>\n <input name=\"checkfname\"/>\n </body>\n </html>\n\n\ncant get the function run at all in chrome or Firefox?? it isn't firing up. Any help pls?" ]
[ "javascript", "html" ]
[ "How to set keyframes 50% using jquery(or javascript)?", "I'm making time(second) bar.\n\nWhen opening page, bar's width should be (second/60)*100%.\n\nI want to start from 50% instead of the beginning.\n\nUsing jquery or javascript.\n\nPlease tell me about.\n\n #loader {\n width: 50%;\n height: 5px;\n background-color: #fff;\n animation-name: loadingBar;\n animation-duration: 60s;\n animation-timing-function: steps(60, end);\n animation-direction: normal;\n animation-play-state: running;\n animation-iteration-count: infinite;\n\n @keyframes loadingBar {\n 0% {\n width: 0%; \n }\n\n 100% {\n width: 100%;\n }\n }" ]
[ "javascript", "jquery", "css", "css-animations" ]
[ "Create client for connect server soap with JAVA + AXIS2 + Rampart", "I need to implement a client service to a SOAP server, I use eclipse + java + axis2 + rampart\nto do this.\nI'm quite new on the soap front but mostly about axis2 + rampart.\nThrough the wsdl with the wsdl2java.sh utility I created the class to reach my service.\nI find it difficult to configure the call by adding the following securities:\n-All SOAP messages MUST be serialized using UTF-8 character encoding of the Unicode character set\n\n-Use SOAP Request-Response Message Exchange Pattern as specified in SOAP 1.1 (see http://www.w3.org/TR/2000 NOTE-SOAP-20000508/)\n\n-A correctly processed client request MUST be answered with a server response, consisting of a HTTP response with a 200 Status Code containing a soap:Envelope element\n\n-The soap:Envelope element MUST contain a soap:Header child element\n\n-The soap:Body element MUST contain exactly one, namespace-qualified child element\n\n-The soap:Body element MUST have a wsu:ID attribute with a unique value that enables it to be included in the signature and encrypted\n\n-Encription Key must be encrypted and included in soap:Header “xenc:EncryptedKey”\n\n-The wsse:Security element in request messages MUST contain exactly one wsu:Timestamp\n\n-SignedParts and EncryptedParts: \n a. SignedParts: wsu:Timestamp (the request timestamp), Body.\n b. EncryptedParts: Body.\n\nI uploaded the certificate of my service in the keystore I believe that axis2 loads it automatically in order to access the https service.\nAlso in the keystore I have two other certificates that are used one to sign the header and the other to encrypt the body of the message.\nOn the site http://axis.apache.org/axis2/java/rampart/index.html I don't find an example of how to do this, could someone give me some examples?\nThanks in advance\npublic class ctest1 {\n public static void main(String[] args) throws Exception {\n new ctest1();\n }\n \n public ctest1() {\n try {\n String log4jConfPath = "log4j.properties";\n PropertyConfigurator.configure(log4jConfPath);\n \n System.setProperty("javax.net.ssl.keyStore", "key.jks");\n System.setProperty("javax.net.ssl.trustStore", "key.jks");\n System.setProperty("javax.net.ssl.keyStorePassword", "changeit");\n System.setProperty("javax.net.ssl.trustStorePassword", "changeit"); \n \n \n \n MYRequest req = new MYRequest();\n\n \n \n req.setaction(status);\n req.setrequest("12345");\n req.setiss("2222");\n req.setcode("3333");\n req.settime(Calendar.getInstance()); \n \n \n AServiceStub man = new AServiceStub();\n \n \n Response res = new Response();\n AResponse response = new AResponse();\n Request request = new Request();\n \n request.setRequest(req);\n \n try {\n res = man.invoke(request);\n \n res.setResponse(response);\n \n System.out.println( response.getValid() ) ;\n \n } catch (RemoteException e) {\n System.out.println( e.getMessage() ) ;\n e.printStackTrace();\n }\n } catch (AxisFault e) {\n e.printStackTrace();\n }\n }\n}" ]
[ "java", "soap", "axis2", "soap-client", "rampart" ]
[ "Vuetify error: Unknown custom element: - did you register the component correctly?", "When i normal start my app (npm run serve) it's all right. But when i want start Unit testing with Jest, the console gives me an error:\n[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.\nCan someone help me?\nplugins/vuetify.ts\nimport '@mdi/font/css/materialdesignicons.css'\nimport Vue from 'vue'\nimport Vuetify from 'vuetify'\n\nVue.use(Vuetify)\n\npackage.json\n"dependencies": {\n "@vue/composition-api": "^1.0.0-rc.5",\n "core-js": "^3.6.5",\n "register-service-worker": "^1.7.1",\n "vue": "^2.6.11",\n "vuetify": "^2.4.0",\n "webpack": "^4.45.0",\n "webpack-assets-manifest": "^4.0.1"\n },\n "devDependencies": {\n "@mdi/font": "^5.9.55",\n "@types/jest": "^24.0.19",\n "@typescript-eslint/eslint-plugin": "^4.18.0",\n "@typescript-eslint/parser": "^4.18.0",\n "@vue/cli-plugin-babel": "~4.5.0",\n "@vue/cli-plugin-e2e-cypress": "~4.5.0",\n "@vue/cli-plugin-eslint": "~4.5.0",\n "@vue/cli-plugin-pwa": "~4.5.0",\n "@vue/cli-plugin-typescript": "~4.5.0",\n "@vue/cli-plugin-unit-jest": "^4.5.0",\n "@vue/cli-service": "~4.5.0",\n "@vue/eslint-config-prettier": "^6.0.0",\n "@vue/eslint-config-typescript": "^7.0.0",\n "@vue/test-utils": "^1.0.3",\n "eslint": "^6.7.2",\n "eslint-formatter-gitlab": "^2.2.0",\n "eslint-plugin-prettier": "^3.3.1",\n "eslint-plugin-vue": "^7.0.0-beta.4",\n "node-sass": "^4.12.0",\n "prettier": "^2.2.1",\n "sass": "^1.32.0",\n "sass-loader": "^10.0.0",\n "typescript": "~4.1.5",\n "vue-cli-plugin-vuetify": "~2.3.1",\n "vue-template-compiler": "^2.6.11",\n "vuetify-loader": "^1.7.0"\n }" ]
[ "vue.js", "jestjs", "vuetify.js" ]
[ "Cant login with docker compose to Postgres via pgadmin", "I have the following docker-compose:\n\nversion: '3.1'\nservices:\n db:\n image: postgres\n restart: always\n environment:\n POSTGRES_PASSWORD: postgres\n volumes:\n - postgres:/pgdata\n ports:\n - \"5432:5432\"\n\n pdadmin:\n image: dpage/pgadmin4\n restart: always\n ports:\n - \"8080:80\"\n environment:\n PGADMIN_DEFAULT_EMAIL: [email protected] \n PGADMIN_DEFAULT_PASSWORD: example\n\nvolumes:\n postgres: \n\n\nwhen I try to login to postgres via pgadmin i am getting the error: password authentication failed for user \"postgres\"\n\nI am trying with user postgres and password postgres.\nI also tryied to add explisit POSTGRES_USER to the env with no success. \n\nHow can I login to my postgres database?\nThanks" ]
[ "postgresql", "docker" ]
[ "Using custom directive with isolated scope, in a modal", "I use a custom directive to get places from Google API. This directive works like a charm in a controller. But when I want to use it inside a modal, it doesn't work any more. It's a question of scope, but I can't figure out what's exactly happened. Any idea ?\n\nMy directive :\n\n 'use strict';\nangular.module('app').directive('googleplace', function() {\n return {\n require: 'ngModel',\n scope: {\n ngModel: '=',\n details: '=?'\n },\n link: function(scope, element, attrs, model) {\n var options;\n options = {\n types: ['address'],\n componentRestrictions: {}\n };\n scope.gPlace = new google.maps.places.Autocomplete(element[0], options);\n google.maps.event.addListener(scope.gPlace, 'place_changed', function() {\n scope.$apply(function() {\n scope.details = scope.gPlace.getPlace();\n if (scope.details.name) {\n element.val(scope.details.name);\n model.$setViewValue(scope.details.name);\n element.bind('blur', function(value) {\n if (value.currentTarget.value !== '') {\n element.val(scope.details.name);\n }\n });\n }\n });\n });\n }\n };\n});\n\n\nMy modal controller : \n\n modalInstance = $modal.open\n templateUrl: \"modal.html\"\n controller: ($scope, $modalInstance) ->\n $scope.$watch 'placeDetails', ->\n _.forEach $scope.placeDetails.address_components, (val, key) ->\n $scope.myaddress = val.short_name + ' ' if val.types[0] is 'street_number'\n return\n\n\nAnd finally, my html : \n\n<div class=\"modal-body\">\n <div>\n <input type=\"text\" placeholder=\"Start typing\" ng-model=\"address\" details=\"placeDetails\" googleplace />\n </div>\n <div>\n <input type=\"text\" ng-model=\"myaddress\">\n </div>\n</div>\n\n\nI should have the ng-model=\"address\" populated with the result of the call to Google Place API, and the ng-model=\"myaddress\" populated by the $watch, but nothing happens.\n\nHere is my plunkr http://plnkr.co/edit/iEAooKgfUUfxoBWm8mgw?p=preview\n\nClick on \"Open modal\" causes the error : Cannot read property 'address_components' of undefined" ]
[ "angularjs", "angularjs-directive", "modal-dialog", "angularjs-scope" ]
[ "matlab: return 2 numbers after decimal points in a matrix column", "Sorry if this is stupid question, but I'm new to MATLAB. I have a big matrix which contains float numbers and I want to change matrix to show two numbers after the decimal point.\n\nWhen I enter below code in the command window:\n\n sprintf('%.2f', ObjectTrack3(5,6))\n\n\nIt's ok and the output is: ans = 3.40\n\nHowever, when I add sprintf('%.2f', ObjectTrack3(i,6)) in my code to show only two numbers after decimal points of all of the items in column 6 from ObjectTrack3, it just gives me an error.\n\nHow can I do this?\n\n(The code is for converting cell array to matrix)\n\nwith guide of somebody I just noticed that the actual number for one of the cells of matrix is 44.849998474121094 but I just see 44.8500 \n0.400000005960465 is shown 0.4000\n\nWhy it adds zero ? why it does not show 0.4 and 44.85 ?" ]
[ "matlab", "precision" ]
[ "How do i change all occurrences only in the function in VScode?", "In VSCode i can change all occurrences of a word by selecting a word and using the "change all occurrences" feature.\nThis feature will select all matching words in the file.\nIs there any way I can select all occurrences in a function only and not all over the file?\nFor example, change all the occurrences of "some_variable" in f1() without changing the ones in f2():\nf1():\n some_variable = 'meow'\n print(some_variable)\n \n\nf2():\n some_variable = 'bark'\n print(some_variable)" ]
[ "python", "visual-studio-code", "ide" ]
[ "Does designating a foreign key automatically take care of updates to the foreign table's value?", "I have two tables: student and faculty\n\nI added a column to the student table that is a foreign key that references a column in faculty.\n\nLet's say that a faculty's id changes. Based on my code below, will my student table update accordingly? Or do I need to do anything extra to ensure that it updates? For example, pretend that James's id updates from 1 to 99. Will the advisorid column of student update accordingly?\n\nNote - I am using LINQPad and I have no way to test this because when I try to make a change to the referenced table I get an Error 547: The UPDATE statement conflicted with the REFERENCE constraint \"FK__enroll__studenti__178D7CA5\". The conflict occurred in database \"tempdb\", table \"dbo.enroll\", column 'studentid'.\n\nalter table student\nadd advisorid int foreign key(advisorid) references faculty(facultyid);\n\nupdate student set advisorid = 1 where studentid = 1;\n\nselect * from student\n\nselect * from faculty;" ]
[ "sql", "oracle", "foreign-keys" ]
[ "Use a function in a conditions hash", "I'm building a conditions hash to run a query but I'm having a problem with one specific case:\n conditions2 = ['extract(year from signature_date) = ?', params[:year].to_i] unless params[:year].blank?\n\nconditions[:country_id] = COUNTRIES.select{|c| c.geography_id == params[:geographies]} unless params[:geographies].blank?\nconditions[:category_id] = CATEGORY_CHILDREN[params[:categories].to_i] unless params[:categories].blank?\nconditions[:country_id] = params[:countries] unless params[:countries].blank?\nconditions['extract(year from signature_date)'] = params[:year].to_i unless params[:year].blank?\n\n\nBut the last line breaks everything, as it gets interpreted as follows:\n\nAND (\"negotiations\".\"extract(year from signature_date)\" = 2010\n\n\nIs there a way to avoid that \"negotiations\".\" is prepended to my condition?\n\nthank you,\nP." ]
[ "ruby-on-rails" ]
[ "Canvas: drawing tiles in a loop result in only a single tile being drawn", "I'm generating a random \"map\" like so:\n\ngenerateTiles() {\n for (let x = 0; x < this.width; x++) {\n for (let y = 0; y < this.height; y++) {\n if (Math.random() < 0.3) {\n this.worldmap[x][y] = new Wall(x, y);\n } else {\n this.worldmap[x][y] = new Floor(x, y);\n }\n }\n }\n }\n\n\nThen, I try to render it to canvas by mapping over rows & cells:\n\ndrawMap(context) {\n this.worldmap.map(function(row) {\n return row.map(function(cell) {\n return this.drawSprite(\n context,\n loadSpritesheet(sprites),\n cell.attributes.sprite,\n cell.x,\n cell.y,\n this.tilesize\n );\n }, this);\n }, this);\n }\n\n\nBy the above only renders a single tile in a {x: 0, y:0}. When I inspect the row and cell arrays over which map is iterating they all have distinct coordinates. This implies that the generation part works fine, and the problem lies with how I loop & render the map.\n\nI read few answers on SO about preloading images. Its something to consider for the future but as I'm only loading a single spritesheet I don't think this is my issue.\n\nI can't figure this one out, suggestions will be greatly appreciated!\n\nFor completeness sake, here is my drawing function:\n\ndrawSprite(context, spritesheet, sprite, x, y, tilesize) {\n context.drawImage(\n spritesheet, // image\n sprite * 16, // sx\n 0, // sy\n 16, // sWidth\n 16, // sHeight\n x, // dx\n y, // dy\n tilesize, // dWidth\n tilesize // dHeight\n );\n }\n\n\nAnd a function loading the spritesheet:\n\nconst loadSpritesheet = src => {\n const spritesheet = new Image();\n spritesheet.src = src;\n\n return spritesheet;\n};\n\nexport default loadSpritesheet;\n\n\nAlso, here is a gist with more complete code exhibiting described problem.\n\nEDIT:\nAs per @CertainPerformance suggestion, I tried nested for loop:\n\nfor (let x = 0; x < this.worldmap.length; x++) {\n for (let y = 0; y < this.worldmap[x].length; y++) {\n this.drawSprite(\n context,\n loadSpritesheet(sprites),\n this.worldmap[x][y].attributes.sprite,\n this.worldmap[x][y].x,\n this.worldmap[x][y].y,\n this.tilesize\n );\n }\n}\n\n\nStill, only a single tile is being rendered." ]
[ "javascript", "loops", "html5-canvas", "roguelike" ]
[ "How to COPY files of current directory to folder in Dockerfile", "I'm trying to create a Dockerfile that copies all the files in the currently directory to a specific folder.\n\nCurrently I have\n\nCOPY . /this/folder\n\n\nI'm unable to check the results of this command, as my container closes nearly immediately after I run it. Is there a better way to test if the command is working?" ]
[ "docker", "dockerfile" ]
[ "How to check which stored procedure/function inserts/deletes/updates data to particular table with time stamp in SQL server", "I want to check which stored procedure/function inserts/deletes/updates data to particular table with time stamp in SQL server.\n\nI can get list of stored procedure(SP) and function that has table name in its body. but those Sp's or functions may or may not be calling the particular table\n\nPlease suggest." ]
[ "sql", "sql-server", "database" ]
[ "Custom date format problem in MVC application", "I have the following model and view, and I would very much like to accept date values in the format 'dd/MM/yyyy'. However, despite using the DisplayFormat annotation, I still get a validation error using my chosen format.\n\n[MetadataType(typeof(MilestoneMetadata))]\npublic partial class Milestone { \n public class MilestoneMetadata {\n [Required][DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = \"{0:dd/MM/yyyy}\")]\n public object Date { get; set; }\n }\n}\n\n\nand the view:\n\n<div class=\"editor-field\">\n <%: Html.EditorFor(model => model.Date) %> \n <%: Html.ValidationMessageFor(model => model.Date) %>\n</div>\n\n\nNamespaces etc. are correct for the annotations and main classes to be in the same namespace. This is not my first encounter with this issue, but I see no results from annotations that are supposed to affect mappings between form values and the model. A template for dates doesn't help me because I can't find a way to set how dates are parsed when posting a create or update.\n\nNOTE: I do not wish to use a different UI culture to achieve this." ]
[ "asp.net-mvc", "metadata", "data-annotations" ]
[ "Breakpoint never hit when dll would be called", "I have added a managed c++ dll to my c#.net project (using \"add resource\"); it finds the class I'm trying to instantiate just fine, no compiler errors. But somehow, fields I know I instantiated are getting null reference exceptions. So I put in a breakpoint at the top of the method that sets the field... and it's never hit. If I comment out the line using the class from the .dll, it hits the breakpoint. Uncomment that and the method never executes despite being called. What's happening here?\n\nThe dll is ManagedSpyLib, the class is ControlProxy, if that helps any. The call is inside the DoWork method of a backgroundworker which is most definitely getting started asynchronously -- could that entire thread be crashing silently without even alerting the debugger? How can I debug this?\n\nETA: I couldn't find anything about the dll in the output window or the Modules window. Some googling found a fix: change the target to the .net 3.5 framework. But I'm no closer to understanding WTF is going on than before -- my code works, but now I have no idea why, which is even more puzzling. Can someone explain this phenomenon?" ]
[ "c#", "c++", ".net", "dll" ]
[ "D3.js sunburst with multiple transitions", "I've been trying to modify the zoomable sunburst example with a size/count transition. This fiddle shows my current situation.\n\nI am stuck with one problem, namely, the combination of the two transformations does not produce the expected result. If you first click on a node to zoom-in, and then trigger the size/count transition, the nodes that should be shown are not correctly displayed.\n\nMy solution to this is to avoid triggering the size/count transition if the graph has been zoomed in: I reset the sunburst by simulating a click on the root node (to zoom out) and then changing size/count. This approach does work, but the visual effects are not very pleasing, as you can see in my example. This is one of the two ways that I am testing: graph reset and size/count transition triggered by a radio button \"change\" event.\n\n// Size/count radio-buttons with reset 1:\n// dispatch both transitions on same event\nd3.selectAll(\"input#size1, input#count1\")\n .on(\"change\", function() {\n // reset\n var root_node = d3.select(\"#root_node\");\n var check = simulateClick(root_node[0][0]);\n // size/count\n if (check === true) {\n var change_value = this.value;\n path.data(partition.value(function(d) {\n if (change_value===\"size\") { return d.size; }\n else if (change_value===\"count\") { return 1; }\n }))\n .transition()\n .delay(400)\n .duration(600)\n .attrTween(\"d\", arcTweenSwitch);\n }\n});\n\n\nLeaving aside implementation choices (trigger transitions on same event or on different events) and browser issues (tried Firefox and Chrome with different results), the problem is that two transitions seem to overlap. Using .delay() in the second one does not help.\n\nThe visual effect is that the second transition, instead of being a single smooth process, it seems to snap into the final stage at once, to then go back to the initial stage and playing the transition smoothly from the start.\n\nAny pointers or advice warmly welcome... Thanks!" ]
[ "javascript", "d3.js", "transition", "sunburst-diagram" ]
[ "Perform an action in Django after a period of time?", "I'm working in a project with Django and I want to remove a register from the DataBase after a period of time (1 week after being created). Is there any way that I can do that?" ]
[ "python", "django", "time", "backend" ]
[ "how to get all the photos uploaded in instagram for a specific location", "I went through the API documentation for /media/recent, but it does not specify what is the duration for which we receive the media files for a specific location. \n\nThey have mentioned that we could pass the below parameters to the API.\n\n\nMIN_TIMESTAMP\nMAX_TIMESTAMP\n\n\nCan anyone give me an example on how to pass this value to the API?\n\nAlso is there any API exposed to get the total number of photos for a specific location in instagram?" ]
[ "java", "media", "instagram", "photo" ]
[ "How to iterate through all users belonging to another user", "I'm working on a project to allow a teacher to do batch grade creation for students. I already have standard grade creation working fine when doing it for a specific student. \n\nA teacher (User) has a number of students (User) that belong to them. What I'm trying to achieve is when you click 'create batch of grades', it takes you to the create_grade_path for the first student where you can input the grade and click create. This takes you to the create_grade_path for the next student and so on until all students have had a grade created.\n\nMy question is in a general sense what would be the best way to iterate through them as I haven't come across something like this. I have a variable @all_students that is an array of all students belonging to the current logged in teacher. Would I create copy of this and remove records from it until it's empty?\n\nThank you so much," ]
[ "ruby-on-rails" ]
[ "how to get form id from ajax and set it in click function in symfony2", "i want to store id in global variable and then store this id for form edit\nhere is my xml request:\n\nif($request->isXmlHttpRequest()) {\n $response = new Response();\n $output = array('success' => true, 'title' => $entity->gettitle(), 'id' => $entity->getId(), 'notes' => $entity->getnotes(), 'accountid' => $entity->getaccountid(), 'clientid' => $entity->getClientID(), 'status' => $entity->getstatus(), 'totalamount' => $entity->getTotalAmount(), 'paidamount' => $entity->getPaidAmount(), 'balanceamount' => $entity->getBalanceAmount(), 'createdby' => $entity->getcreatedby(), 'updatedby' => $entity->getupdatedby(), 'createddatetime' => $entity->getcreateddatetime(), 'updateddatetime' => $entity->getupdateddatetime());\n $response->headers->set('Content-Type', 'application/json');\n $response->setContent(json_encode($output));\n return $response;\n }\n\n\nand here is my ajax code:\n\n$(\"form\").submit(function(e) { \n e.preventDefault();\n var url = $(this).attr('action');\n var data = $(this).serialize();\n $.ajax({\n type: \"POST\",\n url: url,\n data: data,\n }).done(function( result ) {\n invoiceid=result.id;\n if(result.success) {\n $('#result').css({'color':'black','background-color':'#8F8','display':'Block','width':'200px'});\n $('#result').html('Invoices Record Inserted');\n setTimeout(function(){\n $('#result').hide();\n },3000);\n }\n });\n this.reset();\n });\n $(\"#edit\").click(function(){\n\n window.location.href= \"{{ path('invoices_edit', {'id': invoiceid }) }}\"; \n }); \n\n\nand here is myjson response who contain id:\n\n {\"success\":true,\"title\":\"invoice\",\"id\":57,\"notes\":\"gjgjgjgjg\",\"accountid\":1,\"clientid\":\"5\",\"status\":\"sent\",\"totalamount\":\"90000\",\"paidamount\":\"45000\",\"balanceamount\":\"45000\",\"createdby\":1,\"updatedby\":1,\"createddatetime\":{\"date\":\"2013-10-03 17:37:00\",\"timezone_type\":3,\"timezone\":\"Asia\\/Karachi\"},\"updateddatetime\":{\"date\":\"2013-10-03 17:37:00\",\"timezone_type\":3,\"timezone\":\"Asia\\/Karachi\"}}\n\n\nwhen i alert invoiceid then it show value of result.id but invoiceid not pass to click function,how i do this?" ]
[ "javascript", "php", "jquery", "ajax", "symfony" ]
[ "Not getting a return from React-redux", "I want to filter the results from my store in React-Redux. Therefor I have created a filter selector.\nMy code only returns all the "shoppers", while it should only be returning the filtered shoppers.\nEach shopper has an array of reviews that contains (one or more) objects with the review (text) and review number. We want to filter on the review number. See printscreen:\nenter image description here\nSo to clarify, I want to filter by the reviews of a shopper and if that number >= the filter to then return only the shoppers that match this criteria.\nWhat am I doing wrong here? How can I get it to return only the filtered results?\nexport const selectShoppersWithFilters = (filters) => (state) => {\n let shoppers = [...state.publicShoppers];\n\n if (filters.minAverageReview) {\n return shoppers.filter((shopper) => {\n return shopper.reviews.map((review) => {\n if (review.review >= filters.minAverageReview) {\n return (shoppers = shopper);\n }\n });\n });\n }\n console.log(shoppers);\n return shoppers;\n};\n\n\nps. bear with me, I'm a junior developer..." ]
[ "reactjs", "redux", "react-redux", "redux-selector" ]
[ "Parsing Outlook Email Amount, Maturity and Beneficiary into Excel", "I'm trying to pull data from emails in an Outlook folder through Excel VBA.\n\nWhen I get to\n\nThisWorkbook.Sheets(\"Sheet2\").Cells(iRow + 1, 1) = olFolder.Items.Item(iRow).Amount:\n\n\nI get an error message\n\n\n Object doesn't support this property or method.\n\n\nSub FetchEmailData()\n\nDim appOutlook As Object\nDim olNs As Object\nDim olFolder As Object\nDim olItem As Object\nDim iRow As Integer\n\nSet appOutlook = GetObject(, \"Outlook.Application\")\nIf appOutlook Is Nothing Then\n Set appOutlook = CreateObject(\"Outlook.Application\")\nEnd If\nOn Error GoTo 0\n\nSet olNs = appOutlook.GetNamespace(\"MAPI\")\nSet olFolder = olNs.GetDefaultFolder(olFolderInbox).Folders(\"Test\")\n'Clear\nThisWorkbook.Sheets(\"Sheet2\").Cells.Delete\n\n'Build headings:\nThisWorkbook.Sheets(\"Sheet2\").Range(\"A1:D1\") = Array (\"Amount\", \"Maturity\", \"Beneficiary\", \"Size\")\n\nFor iRow = 1 To olFolder.Items.Count\n ThisWorkbook.Sheets(\"Sheet2\").Cells(iRow + 1, 1).Select\n\n '***This is where I get my error **\n ThisWorkbook.Sheets(\"Sheet2\").Cells(iRow + 1, 1) = olFolder.Items.Item(iRow).Amount:\n\n ThisWorkbook.Sheets(\"Sheet2\").Cells(iRow + 1, 2) = olFolder.Items.Item(iRow).Maturity:\n ThisWorkbook.Sheets(\"Sheet2\").Cells(iRow + 1, 3) = olFolder.Items.Item(iRow).Beneficiary:\n ThisWorkbook.Sheets(\"Sheet2\").Cells(iRow + 1, 4) = olFolder.Items.Item(iRow).Size\n Next iRow\n\n End Sub" ]
[ "excel", "vba", "outlook" ]
[ "Oracle trigger return after update", "I am trying to create a trigger named invoices_after_update_payment for the Invoices table\nthat displays the vendor name, invoice number, and payment total in the output\nwindow whenever the payment total is increased. \n\nThis is my first time working with triggers and all I am getting is errors\n\n\ncreate or replace trigger invoices_after_update_payment\nafter update\non invoices\nfor each row\nwhen (new.payment_total > old.payment_total)\ndeclare\nvendor_name_var vendors%rowtype%;\nBegin\nSelect v.vendor_name, i.invoice_number, i.payment_total\ninto vendor_name_var, :new.invoice_number, :new.payment_total\nfrom Vendors v\ninner join Invoices i\non v.vendor_id = i.vendor_id\nwhere i.vendor_id = :new.vendor_id\ndbms_output.put_line(vendor_name_var || :new.invoice_number || :new.payment_total);\nend;\n/" ]
[ "oracle", "join", "plsql", "triggers" ]
[ "ISN AutoIT Studio - creating new form", "I created .isf form file in ISN studio. In my main.au3 file I have included this form (#include \"Forms\\main.isf\"). But when i hit run nothing happens. Do I have to add somenthing in my main.au3? (I'm pretty new with AutoIT)\n\nAlso when I look into code which form generates there is:\n\n$btn1 = GUICtrlCreateButton(\"Button\",170,70,100,30,-1,-1)\nGUICtrlSetOnEvent(-1,\"onBtn1Click\")\n\n\nshloudn't be there $btn1 instead of -1 in the second line?\n\nThanks :)" ]
[ "user-interface", "autoit" ]
[ "Java using Xbox controller", "What library would you recommend to hook up my Xbox 360 controller to Java, and be able to read key inputs into keyPressed Event as a KeyEvent.\n\nSo I would like something like this\n\nprivate class KeyInputHandler extends KeyAdapter {\n public void keyPressed(KeyEvent e) {\n }\n}\n\n\nAnd I want all the controller presses to go into keyPressed.\n\nI would appreciate it even further if you can provide good libraries for PS3 controllers too." ]
[ "java", "xbox360" ]
[ "Why is Controller reinitialised when model updates?", "Below is a small toy version of my problem.\n\nSo I have a controller (coffeescript): \n\nTest.PriceController = Em.ObjectController.extend\n init: ->\n this._super();\n console.log 'initialized'\n\n\nAnd a model:\n\nTest.Price = DS.Model.extend\n cost: DS.attr 'string'\n\n\nAnd the price model updates every 5 seconds from a data source. Every time the model updates, the console.log in the init of the controller is triggered. Can't seem to see in the ember docs whether this is the correct behaviour or not. Thing is, I'd like to add a property to the controller that stores the last \"cost\" value, but given that the object keeps being reinitialised, this would be wiped when the model updates. Also, if this is correct behaviour, any alternative approaches to this would be appreciated. \n\nTo summarise: why does the controller act like this, and if it is by design, what is the correct way to store the \"last cost\" variable like I've outlined above?" ]
[ "ember.js", "coffeescript", "ember-data" ]
[ "Pip install error (Pyside to Raspberry Pi)", "I'm trying to pip install pyside to my Raspberry Pi and receive the following error:\n\npi@raspberrypi:/ $ sudo pip install pyside\nCollecting pyside\n Using cached https://files.pythonhosted.org/packages/36/ac/ca31db6f2225844d37a41b10615c3d371587677efd074db29855e7035de6/PySide-1.2.4.tar.gz\nBuilding wheels for collected packages: pyside\n Running setup.py bdist_wheel for pyside ... error\n Complete output from command /usr/bin/python -u -c \"import setuptools, tokenize;__file__='/tmp/pip-build-TXwQwt/pyside/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))\" bdist_wheel -d /tmp/tmps80BMupip-wheel- --python-tag cp27:\n Removing /tmp/pip-build-TXwQwt/pyside/pyside_package\n running bdist_wheel\n running build\n Python architecture is 32bit\n error: Failed to find cmake. Please specify the path to cmake with --cmake parameter.\n\n ----------------------------------------\n Failed building wheel for pyside\n Running setup.py clean for pyside\nFailed to build pyside\nInstalling collected packages: pyside\n Running setup.py install for pyside ... error\n Complete output from command /usr/bin/python -u -c \"import setuptools, tokenize;__file__='/tmp/pip-build-TXwQwt/pyside/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))\" install --record /tmp/pip-5BdNE7-record/install-record.txt --single-version-externally-managed --compile:\n Removing /tmp/pip-build-TXwQwt/pyside/pyside_package\n running install\n running build\n Python architecture is 32bit\n error: Failed to find cmake. Please specify the path to cmake with --cmake parameter.\n\n ----------------------------------------\nCommand \"/usr/bin/python -u -c \"import setuptools, tokenize;__file__='/tmp/pip-build-TXwQwt/pyside/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\\r\\n', '\\n');f.close();exec(compile(code, __file__, 'exec'))\" install --record /tmp/pip-5BdNE7-record/install-record.txt --single-version-externally-managed --compile\" failed with error code 1 in /tmp/pip-build-TXwQwt/pyside/\npi@raspberrypi:/ $\n\n\nI've tried fixing it with sudo pip install setuptools --no-use-wheel --upgrade, sudo apt install -y libmysqlclient-dev, python setup.py install, and sudo pip install --upgrade setuptools but none have worked to allow me to install Pyside. Any help would be much appreciated. Thank you.\n\nI'm running Raspbian Stretch on a raspberry pi 3 if that matters." ]
[ "python", "pip", "pyside" ]
[ "mysql pivot table by date", "I'm trying to display results of a payment table containing the sum of specific columns by day;\n\npayment id | payment_actual_timestamp | payment type | amount\n1 | 2015-11-23 13:01:20 | AUTH | 0.16\n2 | 2015-11-23 13:07:20 | AUTH | 23.65\n3 | 2015-11-24 08:07:20 | VOID | 19.24\n4 | 2015-11-24 13:45:20 | AUTH | 0.65\n5 | 2015-11-24 16:34:10 | REFUND | 1.20\n6 | 2015-11-25 13:07:20 | SETTLE | 4.40\n\n\nWhat i'd like to display is the following;\n\nDate | SETTLE | AUTH | VOID | REFUND\n2015-11-23 | 0.00 | 23.81| 0.00 | 0.00\n2015-11-24 | 0.00 | 0.65 | 19.24| 1.20\n2015-11-25 | 4.40 | 0.00 | 0.00 | 0.00\n\n\nis there a way of doing this?\n\nMany thanks." ]
[ "php", "mysql" ]
[ "Images not displaying from remote database", "I stored images in remote server. Then i use JSON framework for fetching data from database. I used NSLog it displaying id,name,image name. But images are not displaying. I used BLOB for storing images in locally. But when i use array for NSLog it displaying some encript values.\n\ncode:\n\nsofArray = [[NSMutableArray alloc] init]; \n\n\n NSFileManager *fileMgr = [NSFileManager defaultManager];\n NSError *err;\n\n NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@\"Empty\" ofType:@\"sqlite\"];\n //NSLog(@\"bundlePath %@\", bundlePath);\n\n\n //call update function to check any data updated,\n //if there is a version difference\n //update the data base with all the required fileds.\n\n\n\n NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);\n NSString *documentsDirectory = [paths objectAtIndex:0];\n //NSLog(@\"docs dir is %@\", documentsDirectory);\n\n NSString *appFile = [documentsDirectory stringByAppendingPathComponent:@\"App10.sqlite\"];\n\n [fileMgr copyItemAtPath:bundlePath toPath:appFile error:&err];\n\n NSURL *URL = [NSURL URLWithString:@\"http://server.net/projects/mobile/jsonstring.php\"];\n\n NSLog(@\"URL is %@\", URL);\n\n\n NSError *error;\n NSString *stringFromFileAtURL = [[NSString alloc]\n initWithContentsOfURL:URL\n encoding:NSUTF8StringEncoding\n error:&error];\n\n //NSLog(@\"response is %@\", stringFromFileAtURL);\n\n NSString *path = [documentsDirectory stringByAppendingPathComponent:@\"App10.sqlite\"];\n\n\n NSArray *userData = [stringFromFileAtURL JSONValue];\n\n // NSArray *skarray = [[NSArray alloc]init];\n\n\n\n NSLog(@\"userdata is %@\", userData);\n\n // int i = 0;\n BOOL notExist = TRUE;\n\n\n for (NSArray *skarray in userData) {\n\n for (NSDictionary *tuser in skarray) {\n\n // if (sqlite3_open([dbPath UTF8String], &db) == SQLITE_OK) {\n\n\n if (sqlite3_open([path UTF8String], &db) == SQLITE_OK) {\n\n // const char *sql = \"SELECT * FROM categories\";\n\n // const char *sql = [[NSString stringWithFormat:@\"SELECT id FROM categories where cat_id = '%@'\",[tuser objectForKey:@\"cat_id\"]] cStringUsingEncoding:NSUTF8StringEncoding];\n\n\n const char *sql = [[NSString stringWithFormat:@\"SELECT id FROM categories where id = '%@'\",[tuser objectForKey:@\"id\"]] cStringUsingEncoding:NSUTF8StringEncoding]; \n\n //NSLog(@\"check stmt is %s\", sql);\n\n sqlite3_stmt *sqlStatement,*addStmt;\n\n if (sqlite3_prepare_v2(db, sql, -1, &sqlStatement, NULL) == SQLITE_OK) {\n\n notExist = TRUE;\n\n while (sqlite3_step(sqlStatement) == SQLITE_ROW) {\n\n notExist = FALSE;\n\n\n Mysof *Mylist = [[Mysof alloc]init];\n Mylist.sofaId = sqlite3_column_int(sqlStatement, 0);\n Mylist.sofa = [NSString stringWithUTF8String:(char *) sqlite3_column_text(sqlStatement,1)];\n Mylist.rating = [NSString stringWithUTF8String:(char *) sqlite3_column_text(sqlStatement, 2)];\n\n\n\n const char *raw = sqlite3_column_blob(sqlStatement, 3);\n int rawLen = sqlite3_column_bytes(sqlStatement, 3);\n NSData *data = [NSData dataWithBytes:raw length:rawLen];\n Mylist.photo = [[UIImage alloc] initWithData:data];\n [sofArray addObject:Mylist];\n\n }\n\n if(notExist){\n //NSLog(@\"cat id does not exist\");\n\n const char *sqlInsert = [[NSString stringWithFormat:@\"insert into categories (id, cat_name,order_by) values ('%@', '%@', '%@')\", [tuser objectForKey:@\"id\"], [tuser objectForKey:@\"cat_name\"],[tuser objectForKey:@\"order_by\"]] cStringUsingEncoding:NSUTF8StringEncoding];\n //NSLog(@\"stmt is %s\", sqlInsert);\n\n if(sqlite3_prepare_v2(db, sqlInsert, -1, &addStmt, NULL) != SQLITE_OK)\n NSAssert1(0, @\"Error while creating add statement. '%s'\", sqlite3_errmsg(db));\n\n if(SQLITE_DONE != sqlite3_step(addStmt))\n NSAssert1(0, @\"Error while inserting data. '%s'\", sqlite3_errmsg(db));\n\n }\n\n\n }\n\n }\n\n }\n\n }\n\n\nreturn sofArray;" ]
[ "iphone", "json", "web-services", "uiimage" ]
[ "Get Leaflet pop up to only show when feature properties are not null", "I have GeoJSON data that contains URLs. Not all of the features have url data. I have a pop up which shows the name and a link to the url. I'd like to be able to only show the link to URL when the feature URL is not null but will always show the name as a minimum. My code is below:\n const tackleshop_point = {\n "type": "FeatureCollection",\n "name": "tackleshop",\n "crs": {\n "type": "name",\n "properties": {\n "name": "urn:ogc:def:crs:OGC:1.3:CRS84"\n }\n },\n "features": [{\n "type": "Feature",\n "properties": {\n "gid": 1,\n "name": "test 1",\n "url": "www.google.com"\n },\n "geometry": {\n "type": "Point",\n "coordinates": [-2.284362363619518, 50.983444094390933]\n }\n },\n {\n "type": "Feature",\n "properties": {\n "gid": 7,\n "name": "test 2",\n "url": null\n },\n "geometry": {\n "type": "Point",\n "coordinates": [-2.283893608524902, 50.981411456895998]\n }\n }\n ]\n}\n\nconst tackleshop = L.geoJSON(tackleshop_point, {}).bindPopup(function(layer) {\n let cap_name = layer.feature.properties.name.replace(/(^\\w{1})|(\\s+\\w{1})/g, letter => letter.toUpperCase());\n return `<p>${cap_name}</p><a href="http://${layer.feature.properties.url}" target="_blank">View<a>`\n /******/\n ;\n}).addTo(map);" ]
[ "javascript", "leaflet" ]
[ "Controlling the number of significant factors in R", "I want the number of significant figures in my whole R-code to be 15. The option:\n\noptions(digits=15) \n\n\ndoes not give me the output I want. It is rounding a result to the least number of significant digits. It gives me for example the output:\n\n-1.234567890123456\n-0.123456789012345\n\n\nThe number of significant digits of the second number is the smallest, so R sets this on 15. The first number is then by R with the same number of decimal places. This gives for the first number significant factors 16. What I want is 15 significant factors for all numbers in my output. So what I want is:\n\n-1.23456789012345\n-0.123456789012345\n\n\nHow can this be done for every output?\n\nAny help is appreciated." ]
[ "r", "digit", "significant-digits", "significance" ]
[ "some of the error list members in django form doesn't show up in the template", "I have a form in django and I wanna show errors before each field.\n\nThe problem is when I use form.field_name.errors or form.errors.field_name, it happens for one of the fields that error does not show up, just for one of them, here's the template code:\n\n<table class=\"\">\n <form action=\"\" method=\"POST\" enctype=\"multipart/form-data\">\n\n {% csrf_token %}\n\n <div>\n <div>{{ form.errors.competitor_name }}</div>\n <br/>\n <div>name:</div>\n <div>{{ form.competitor_name }}</div>\n </div>\n <div>\n <div>{{ form.errors.notional_code }}</div>\n <br/>\n <div>code:</div>\n <div>{{ form.national_code }}</div>\n </div>\n <div>\n <table id=\"filesContainer\">\n <tbody>\n {% for form_ in formset.forms %}\n <tr id=\"{{ form_.prefix }}-row\">\n <td>{{ form_.file.label }}:</td>\n <td>{{ form_.file }}</td>\n <td></td>\n </tr>\n {% endfor %}\n </tbody>\n </table>\n <p>\n {{ formset.management_form }}\n </p>\n </div>\n <div class=\"arsh-signup-row\">\n <input type=\"submit\" value=\"SignUp\" />\n </div>\n </form>\n </table>\n\n\nI have problem in showing errors of national_code field.\n\nI have used break points and I absolutely realized that I'm adding errors in the right way and everything about form is alright, it seems something is wrong with the template and I don't know what's this.\n\nThe interesting part is, when I wanna show up this field's error in some other part of the page, it's ok, everything is done, but it doesn't show in that specific part, if I use this code:\n\n<div>\n <div>{{ form.errors.notional_code }}</div>\n <br/>\n <div>name:</div>\n <div>{{ form.competitor_name }}</div>\n </div>\n <div>\n <div>{{ form.errors.notional_code }}</div>\n <br/>\n <div>code:</div>\n <div>{{ form.national_code }}</div>\n </div>\n\n\nI can see what I want. It's really funny at first, but now it's confusing for me.\n\nAny advice would be appreciated." ]
[ "django", "forms", "templates", "error-list" ]
[ "How to make Lisp input case sensitive", "I'm programming in lisp. The function I'm working on is appending two lists together, and it works.\nHowever, the output also comes back as uppercase letters, and when. I use an escape symbol, the lowercase letters are surrounded by '|' symbols. Here is an example:\n"Input your first list"\n(a b)\n"Input another list"\n( \\a \\b)\nOutput: (A B |a| |b|)\nI want it to be (a b a b).\nIs there a way to input things differently or write a function to fix this?\nMy current REPL stores the input as a variable, runs it through the function, and outputs it. Thank you!" ]
[ "lisp" ]
[ "Material Table Search doesn't work for custom column", "Folks,\nI have a mat table with a custom column as "Items" , this can have multiple values.\nI can render it as comma separated values however for better look and feel , I am rendering each item as chip.\nNow the issue is mat table default search doesn't work on this field.\nAny help would be greatly appreciated.\n\nimport React, { Fragment, useState } from "react";\nimport MaterialTable from "material-table";\nimport { Box, makeStyles, Chip } from "@material-ui/core";\n\nconst useStyles = makeStyles((theme) => ({\n chip: {\n margin: 2\n },\n noLabel: {\n marginTop: theme.spacing(3)\n },\n }));\n \n\nconst originalData = [\n {\n id: "1",\n productName: "Meat",\n items: [\n {id : 1, name : "chicken"},\n {id : 2, name : "pork" },\n {id : 3, name : "lamb" }\n ]\n \n },\n {\n id: "2",\n productName: "Vegetables",\n items: [\n {id : 1, name : "Okra"},\n {id : 2, name : "Pumpkin" },\n {id : 3, name : "Onion" }\n ]\n \n },\n\n];\n\nexport default function MatTableTest(props) {\n const [data, setData] = useState(originalData);\n const classes = useStyles();\n const tableColumns = [\n { title: "id", field: "id", editable : "never" },\n { title: "Product Name", field: "productName" , editable : "never" },\n { title: "Item", field: "items", editable : "never", \n render: rowData => {\n return (\n <Box className="box" id="style-7">\n { rowData.items.map((exprt) => <Chip\n key={exprt.id}\n label={exprt.name}\n className={classes.chip}\n />)}\n </Box>\n );\n }\n},\n\n \n ];\n\n return (\n <Fragment>\n <MaterialTable\n columns={tableColumns}\n data={data}\n title="Material Table - Custom Colum Search"\n />\n </Fragment>\n );\n}" ]
[ "reactjs", "material-table" ]
[ "GCE Docker container process (user)owner is not root", "I'm running docker airflow in GCE using docker swarm.\nThe strange thing is that even though I deployed my airflow cluster with root user, the owner of the airflow process is not root, but some random user in the node.\n\n\nWhen I run docker in my local machine, the process is started with root.\n\nIs there some kind of rules for choosing a user on GCE??\nDoes anyone have any clue why this is happeneing?" ]
[ "docker", "google-cloud-platform", "google-compute-engine", "docker-swarm" ]
[ "How can I change child component background color", "I implement two simple react component like this:\n\nUsers Component (Parent):\n\nexport default class Users extends React.Component {\n\n constructor(props){\n super(props);\n this.state={\n users:[\n {id:1,name:'name1'},\n {id:2,name:'name2'},\n {id:3,name:'name3'},\n {id:4,name:'name4'}\n ]\n }\n }\n\n\n render(){\n return (\n <View>\n <Text>Users</Text>\n {this.state.data.map((user) => {\n return <Card user={user}/>\n })}\n </View>\n )\n }\n}\n\n\nCard Component (Child):\n\nclass Card extends React.Component {\n\nrender(){\n return (\n <View>\n <Text>{this.props.user.name}</Text>\n </View>\n )\n}\n\n}\n\n\nI want changing the background color of card when tap on,\n\nAnd I try change Card component to this:\n\nclass Card extends React.Component {\n\n constructor(props) {\n super(props);\n this.state = {\n BGClass: 'unselectedCard'\n }\n }\n\n select() {\n\n this.setState({BGClass: 'selectedCard'})\n }\n\n render() {\n return (\n <TouchableWithoutFeedback onPress={() => {\n this.select()\n }}>\n <View style={styles[this.state.BGClass]}>\n <Text>Card</Text>\n </View>\n </TouchableWithoutFeedback>\n )\n }\n}\n\n\nWith this change, when I tap on Card, Card background is change but my problem is when new Card is changed to selected background color, another card not return to unselected background color," ]
[ "javascript", "react-native" ]
[ "Chart Series Line: Bring to Front, Send to Back", "If I use VBA in Excel to make a line chart with multiple series, and two of the series' data are very similar so that their chart series lines partly overlap, the last one written is in front of earlier ones written. \n\nIn the Worksheet_Change event, I want to be able to go back and forth between which chart series line is in front, based on user actions that change the data. Can I do that without deleting and recreating the chart?\n\nHere's how I'm identifiying the series line, for example here's series 2:\n\nSheet1.ChartObjects(\"MyChart\").Chart.SeriesCollection(2)\n\n\nGetting TypeName on that returns Series. I see Series in help, but with no information on its properties and methods. I don't see Series in the Object Browser (I'm on Excel 2007). I was able to get a list of properties and methods in the context help dropdown, but I didn't see anything promising in the dropdown.\n\nSo, can I bring a chart series to the front/send it to the back, without deleting and recreating the chart?" ]
[ "vba", "excel", "charts", "excel-charts" ]
[ "Laravel Lumen, Swagger returns json not the view", "I installed SwaggerLume with the following configurations\nclass ApiController extends Controller\n{\n /**\n * @OA\\Info(\n * version="3.0",\n * title="OpenApi Documentation",\n * description=""\n * )\n *\n * @OA\\Server(\n * url=SWAGGER_LUME_CONST_HOST,\n * description="API Server"\n * )\n */\n ...\n}\n\nand\n<?php\n\nreturn [\n 'api' => [\n 'title' => 'Swagger Lume API',\n ],\n\n 'routes' => [\n 'api' => '/api/documentation',\n 'docs' => '/api/oa',\n 'oauth2_callback' => '/api/oauth2-callback',\n 'assets' => '/swagger-ui-assets',\n 'middleware' => [\n 'api' => [],\n 'asset' => [],\n 'docs' => [],\n 'oauth2_callback' => [],\n ],\n ],\n\n 'paths' => [\n 'docs' => storage_path('api-docs'),\n 'docs_json' => 'api-docs.json',\n 'annotations' => base_path('app'),\n 'excludes' => [],\n// 'base' => env('L5_SWAGGER_BASE_PATH', null),\n\n /*\n |--------------------------------------------------------------------------\n | Absolute path to directory where to export views\n |--------------------------------------------------------------------------\n */\n 'views' => base_path('resources/views/vendor/swagger-lume'),\n ],\n 'generate_always' => env('SWAGGER_GENERATE_ALWAYS', false),\n 'swagger_version' => env('SWAGGER_VERSION', '3.0'),\n 'proxy' => false,\n\n 'additional_config_url' => null,\n 'operations_sort' => env('L5_SWAGGER_OPERATIONS_SORT', null),\n 'validator_url' => null,\n 'constants' => [\n 'SWAGGER_LUME_CONST_HOST' => env('SWAGGER_LUME_CONST_HOST', 'http://my-default-host.com'),\n ],\n];\n\nI should note that I commented\n// 'base' => env('L5_SWAGGER_BASE_PATH', null),\n\nsince swagger 3 doesn't support basePath.\nand .env\nSWAGGER_LUME_CONST_HOST=payment.local\nL5_SWAGGER_BASE_PATH=payment.local\n\nbut the result is\n\nNot the view. I also have the view" ]
[ "laravel", "swagger", "swagger-ui", "lumen" ]
[ "How can I access attributes of Html elements in ASP.NET MVC", "With ASP.NET Webforms, I could drag and drop a control on a form and be able to access its properties:\n\nif (number == 0)\n AddButton.Enabled = false;\n\n\nAlthough I cannot drag and drop a control on a ASP.NET MVC View template, can I change its attributes? \n\nFor instance:\n\n\ndisable a button in some conditions and be able to enable it if conditions change.\nBe able to change the text of a button from \"Next->\" to \"Finish\" \netc." ]
[ "c#", ".net", "html", "asp.net-mvc" ]
[ "Combining form validation and closing the popup window?", "How can I make sure that the window doesn't close before the form is valid and properly submited?\nBecause now it closes the popup and nobady knows if the form was valid. Because even iff there are errors the form is immediately closed.\n\n $(document).ready(function(){\n\n $(\".requestPassword\").hide();\n $(\".popupwindow\").popupwindow(profiles);\n\n $(\".fp\").click(function(){\n $(\".loginForm\").hide();\n $(\".requestPassword\").show();\n });\n $(\".back\").click(function(){\n $(\".loginForm\").show();\n $(\".requestPassword\").hide();\n });\n\n //form validation\n $(\"#aanmeldForm\").validate({\n\n\n //set the rules for the field names\n rules: {\n firstname: {\n required: true,\n minlength: 2\n },\n email: {\n required: true,\n email: true\n },\n message: {\n required: true,\n minlength: 2\n },\n },\n //set messages to appear inline\n messages: {\n name: \"Please enter your name\",\n email: \"Please enter a valid email address\"\n\n },\n errorPlacement: function(error, element) {\n error.appendTo( element.parent(\"td\"));\n }\n\n });\n\n $(\"#aanmeldForm\").submit(function(){\n //TODO: some data keeping jobs to be done\n self.opener.location = 'http://ladosa.com';\n self.close();\n });\n\n\n});" ]
[ "jquery", "validation", "forms", "popup" ]
[ "Remove row from Kendo UI Grid with jQuery", "I am using a Kendo UI grid and for deleting a row I am using a custom button with bootstrap that when I click on it, with ajax I call a web api method to remove that row and if it is successfully deleted that row removes it from the DOM. (I'm not using the command destroy of kendo)\n\nThe problem I have is that if I try to filter that row that was removed, it appears again in the grid and it seems that it was not removed at all.\n\nThis is my Kendo UI grid: \n\nvar table = $(\"#grid\").kendoGrid({ \n dataSource: {\n transport: {\n read: {\n url: \"/api/customers\",\n dataType: \"json\"\n }\n },\n pageSize: 10\n }, \n height: 550,\n filterable: true,\n sortable: true,\n pageable: {\n refresh: true,\n pageSizes: true,\n buttonCount: 5\n },\n columns: [{\n template: \"<a href='' class='btn-link glyphicon glyphicon-remove js-delete' title='Delete' data-customer-id= #: Id #></a>\",\n field: \"Id\",\n title: \" \",\n filterable: false,\n sortable: false,\n width: 50,\n attributes: {\n style: \"text-align: center\" \n }\n }, {\n field: \"Name\",\n title: \"Name\",\n width: 100,\n }, {\n field: \"LastName\",\n title: \"LastName\",\n width: 100,\n }, {\n field: \"Email\",\n title: \"Email\",\n width: 150\n }]\n});\n\n\nAnd this is my jQuery code for deleting a row:\n\n$(\"#grid\").on(\"click\", \".js-delete\", function () {\n var button = $(this);\n if (confirm(\"Are you sure you want to delete this customer?\")) {\n $.ajax({\n url: \"/api/customers/\" + button.attr(\"data-customer-id\"),\n method: \"DELETE\",\n success: function () {\n button.parents(\"tr\").remove(); //This part is removing the row but when i filtered it still there.\n }\n });\n }\n });\n\n\nI know that in jQuery DataTables when can do something like this: \n\n table.row(button.parents(\"tr\")).remove().draw();\n\n\nHow can i do something like this with Kendo UI using jQuery?" ]
[ "javascript", "jquery", "kendo-ui", "kendo-grid" ]
[ "C# WinForm multiple click event handlers for similar function", "I have a few toolStripMenuItems that act as a useful links for a series of websites, a rough example of the code would be something like:\n\nprivate void toolStripMenuItem1_Click(object sender, EventArgs e)\n{\n Process.Start(\"http://www.google.com\");\n}\n\nprivate void toolStripMenuItem2_Click(object sender, EventArgs e)\n{\n Process.Start(\"http://www.bing.com\");\n}\n\nprivate void toolStripMenuItem3_Click(object sender, EventArgs e)\n{\n Process.Start(\"https://www.duckduckgo.com\");\n}\n\nprivate void toolStripMenuItem4_Click(object sender, EventArgs e)\n{\n Process.Start(\"http://www.yahoo.com/\");\n}\n...\n\n\nIs there a more elegant way to handle this?" ]
[ "c#", "winforms", "event-handling", "mouseclick-event" ]
[ "Wordpress upload media in a specific folder for a special post", "I am beginner in wordpress. I have to upload a file in the subfolder of root(http://www.domain.com/myfoldername) for a special post. It will work only for a special post, not for all. No need to change my default directory and I wan't not use any plugin.\n\nCan anyone help me to do this? I already searched, but didn't get any solution.\n\nThanks" ]
[ "php", "wordpress", "upload" ]
[ "css jquery text-overflow ellipsis not working", "I want the each individual topic-container div to only show up to a 100px height by default, and show ellipsis at the end to indicate that there is more text. When a particular div has been clicked, I want it to show at 100% height. My issue now is that text keeps adjusting to the width of 100% instead of the height. How do I accomplish this? \n\nHTML\n\n <div class=\"topics\">\n <div class=\"topic-container\"> \n <img src=\"http://via.placeholder.com/150x150\">\n <div class=\"name\">Full Name</div>\n <div class=\"title\">Title</div>\n <div class=\"description\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eget iaculis massa. Mauris sed cursus eros. Quisque tempus eros a diam mollis tincidunt. Ut fermentum diam tortor. Morbi auctor, ipsum nec consequat pharetra, nisl nibh mollis eros, a molestie purus nunc quis augue. Curabitur et erat felis. Nullam eu purus quis dolor consectetur commodo eu a velit. Vivamus at velit.</div>\n </div>\n\n <div class=\"topic-container\"> \n <img src=\"http://via.placeholder.com/150x150\">\n <div class=\"name\">Full Name 2</div>\n <div class=\"title\">Title 2</div>\n <div class=\"description\">2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eget iaculis massa. Mauris sed cursus eros. Quisque tempus eros a diam mollis tincidunt. Ut fermentum diam tortor. Morbi auctor, ipsum nec consequat pharetra, nisl nibh mollis eros, a molestie purus nunc quis augue. Curabitur et erat felis. Nullam eu purus quis dolor consectetur commodo eu a velit. Vivamus at velit.</div>\n </div>\n </div>\n\n\nCSS\n\n.topics {\n background-color: white;\n width: 50%; \n position: relative; \n}\n.topic-container {\n float: left;\n margin-left: 1em;\n}\n.overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: black;\n opacity: 0.5;\n z-index: 50;\n}\n.description {\n white-space: nowrap;\n width: 100px; \n height: 100px;\n border: 1px solid red;\n overflow: hidden;\n word-wrap: break-word;\n text-overflow: ellipsis;\n}\n/*.expand-description {\n width: 150px;\n height: 200px !important;\n position: absolute;\n top: 0;\n background: rgba(0,0,0,0.2);\n color: white;\n}*/\n\n\nJQuery\n\n$('.topics').click(function() {\n $('.description').addClass('expand-description').css('zIndex', '60');\n});\n\n\nWorking fiddle: http://jsfiddle.net/qfjk3dmt/" ]
[ "jquery", "css" ]
[ "IOS UiBarButtoItemn is not removed when changing ViewController in UITabBar", "I have created programmatically 2 UIBarButtonItem from a UIButton. The Nav Controller is in a UITabBar. When I move to another controller in the same UITabBar, these 2 UIBarButton do not get removed. Anyone has an idea on how to delete these 2 UIBarButtonItem\n\n- (void)viewWillAppear:(BOOL)animated {\n\n // Left Tab Bar Items\n UIButton *fbutton = [[UIButton alloc] init];\n [fbutton setImage:[[UIImage imageNamed:@\"ble\"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];\n [fbutton addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];\n fbutton.frame=CGRectMake(0, 0, 48 , 48);\n UIBarButtonItem *fBLEItem = [[UIBarButtonItem alloc] initWithCustomView:fbutton];\n fBLEItem.enabled = NO;\n\n UIButton *tbutton = [[UIButton alloc] init];\n [tbutton setImage:[[UIImage imageNamed:@\"ble\"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];\n [tbutton addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];\n tbutton.frame=CGRectMake(0, 0, 48, 48);\n UIBarButtonItem *tBLEItem = [[UIBarButtonItem alloc] initWithCustomView:tbutton];\n tBLEItem.enabled = NO;\n\n self.tabBarController.navigationItem.leftItemsSupplementBackButton = YES;\n self.tabBarController.navigationItem.leftBarButtonItems = @[fBLEItem,tBLEItem];\n\n}\n\n\n- (void) viewWillDisappear:(BOOL)animated {\n\n [self.navigationItem setLeftBarButtonItem:nil animated:NO];\n [self.navigationItem setRightBarButtonItem:nil animated:NO];\n\n}" ]
[ "ios", "uinavigationcontroller", "uibarbuttonitem", "uitabbar" ]
[ "How to make classes with objects with defined sizes", "I need to create objects that produce defined squares on a display. I thought if I made a separate class for each object I would be able to make a class instance which would already be of the correct size and use str to show what sizes and associated parameter names. I know it doesn't work the way I am doing it as I cannot pass in the parameter args the way I am doing so, I am not even getting a sensible error return but it fails at the line where I have ints passed as args in the method for 'objOne'.\n\nCode:\n\nclass Wide():\n\n def __init__(self, DW, XfromLeftEdge, YfromTopEdge, Width, Height):\n self.XfromLeftEdge = XfromLeftEdge\n self.YfromTopEdge = YfromTopEdge\n self.Width = Width\n self.Height = Height\n\n def objOne(self, DW, 141.0, 300.0, 1551.0, 800.0 ): #XfromLeftEdge, YfromTopEdge, Width, Height\n return DW.SetRoi(141.0,300.0,1551.0,800.0)\n\n def __repr__(self):\n return '{}, {}, {}, {}'.format(\n self.XfromLeftEdge = XfromLeftEdge,\n self.YfromTopEdge = YfromTopEdge,\n self.Width = Width,\n self.Height = Height)\n\n def __str__(self):\n return 'instance object of box, XfromLeftEdge:{},YfromTopEdge: {}, Width:{}, Height:{}'.format(\n self.XfromLeftEdge = XfromLeftEdge,\n self.YfromTopEdge = YfromTopEdge,\n self.Width = Width,\n self.Height = Height)\n\n\nclass Narrow():\n\n def __init__(self, DW, XfromLeftEdge, YfromTopEdge, Width, Height):\n self.XfromLeftEdge = XfromLeftEdge\n self.YfromTopEdge = YfromTopEdge\n self.Width = Width\n self.Height = Height\n\n\n def objOne(self, DW, 141.0, 300.0, 141.0, 800.0 ): #XfromLeftEdge, YfromTopEdge, Width, Height\n return DW.SetRoi(141.0,300.0,141.0,800.0)\n\n\n def __repr__(self):\n return '{}, {}, {}, {}'.format(\n self.XfromLeftEdge = XfromLeftEdge,\n self.YfromTopEdge = YfromTopEdge,\n self.Width = Width,\n self.Height = Height)\n\n\n def __str__(self):\n return 'instance object of box, XfromLeftEdge:{},YfromTopEdge: {}, Width:{}, Height:{}'.format(\n self.XfromLeftEdge = XfromLeftEdge,\n self.YfromTopEdge = YfromTopEdge,\n self.Width = Width,\n self.Height = Height)\n\n\na = Wide()\nprint(a)\n\n\nOuptput\n\nSyntaxError: invalid syntax\n(base) user % /usr/local/bin/python3 \"/Users/.../Desktop/.../play_a.py\"\n File \"/Users/.../Desktop/.../play_a.py\", line 9\n def objOne(self, DropWatch, 141, 300, 1551, 800 ): #XfromLeftEdge, YfromTopEdge, Width, Height\n ^\n\n\nDesired Output\nI would like to be able to make a class for Wide, another for narrow, and when I instantiate either I can get predefined size objects and when I print them I can see the parameter names." ]
[ "python", "class", "oop", "methods" ]
[ "Symfony3 FOSUserBundle populate table", "I'm messing about with Symfony3 FOSUserBundle by following this Symfony docs\n\nI managed to successfully install it and set it up as show in the docs. Checked by database and FSOUserBundle has created this table for me:\n\n +-----------------------+--------------+------+-----+---------+----------------+\n | Field | Type | Null | Key | Default | Extra |\n +-----------------------+--------------+------+-----+---------+----------------+\n | id | int(11) | NO | PRI | NULL | auto_increment |\n | username | varchar(255) | NO | | NULL | |\n | username_canonical | varchar(255) | NO | UNI | NULL | |\n | email | varchar(255) | NO | | NULL | |\n | email_canonical | varchar(255) | NO | UNI | NULL | |\n | enabled | tinyint(1) | NO | | NULL | |\n | salt | varchar(255) | NO | | NULL | |\n | password | varchar(255) | NO | | NULL | |\n | last_login | datetime | YES | | NULL | |\n | locked | tinyint(1) | NO | | NULL | |\n | expired | tinyint(1) | NO | | NULL | |\n | expires_at | datetime | YES | | NULL | |\n | confirmation_token | varchar(255) | YES | | NULL | |\n | password_requested_at | datetime | YES | | NULL | |\n | roles | longtext | NO | | NULL | |\n | credentials_expired | tinyint(1) | NO | | NULL | |\n | credentials_expire_at | datetime | YES | | NULL | |\n +-----------------------+--------------+------+-----+---------+----------------+\n\n\nUnderstand that these fields come from BasuUser which I extend in User entity.\n\nNext step I am using Fixtures to load data into this table but what I am wondering is this wether I need to set every single field in this table i see by default the are NULL so when and how I should populate these fields?\n\nThx" ]
[ "php", "symfony" ]
[ "Comment out multiline log statements using perl one liner regex substitution", "I have a perl one-liner that works when log statements are on a single line:\n\nfind -type f -iname \"*java\" | xargs -d'\\n' -n 1 perl -i -pe 's{(log.*((info)|(debug)).*)}{//$1}gi'\n\n\nBut trying to modify this to work on multiple lines is tricky. I know that the s modifier will match newlines, but how do I get it to comment out subsequent lines (i.e. up to ; assuming the log string doesn't have it)? \n\nI'm fine with a solution that makes multi-line log statements into single-line log statements too. I'll also accept C-style comments (though it would be nice to find a solution for C++ style comments).\n\n(Don't tell me to turn off logging. Anyone who's actually tried that will realize how brutally complicated that is in non-trivial applications.)" ]
[ "regex", "perl" ]
[ "How to show/hide a nested list using JavaScript in ASP.NET?", "Edit: Found the solution, and posted the answer below.\n\nIn my ASP.NET c# project, I have a ListView (ParentList) bound to a DataSource. Within the ParentList, inside the ItemTemplate, I have another Repeater (ChildList) bound to an attribute of each ListViewDataItem.\n\n<asp:ListView ID=\"ParentList\" runat=\"server\" DataSourceID=\"objectDataSourceID\" DataKeyNames=\"ID\"> \n <ItemTemplate>\n <tr>\n <td>\n <asp:Label ID=\"Label1\" runat=\"server\" Text='<%# Eval(\"Attribute1\") %>' />\n </td>\n <td valign=\"top\">\n <asp:Repeater ID=\"ChildList\" runat=\"server\" DataSource='<%# Eval(\"Attribute2ReturnsAnotherList\") %>'>\n <HeaderTemplate>\n <ul>\n </HeaderTemplate>\n <ItemTemplate>\n <li>\n <%# DataBinder.Eval(Container.DataItem, \"childAttribute\") %> \n </li>\n </ItemTemplate>\n <FooterTemplate>\n </ul>\n </FooterTemplate>\n </asp:Repeater>\n </td>\n </tr>\n </ItemTemplate>\n <LayoutTemplate>\n ...\n </LayoutTemplate>\n</asp:ListView>\n\n\nThe code above works just fine, everything renders great. Now I want to add a link that will show/hide the ChildList. Something like the below:\n\n<td valign=\"top\">\n <a href=\"javascript:ToggleListVisibility()\" >Show/Hide</a>\n <asp:Repeater ID=\"ChildList\" runat=\"server\" DataSource='<%# Eval(\"Attribute2ReturnsAnotherList\") %>'>\n </asp:Repeater>\n</td>\n\n\nHow can I achieve this? I can't just use getElementById as I normally would, as the ul lists are within a Repeater nested inside the ListView. I tried obtaining the parentNode, then accessing the children and toggling the visibility of the ul element within:\n\nfunction ToggleListVisibility(source) {\n var childrenlist = source.parentNode.children;\n for (var i = 0; i < childrenlist.length; i++) {\n if (childrenlist[i].tagName == 'ul') {\n if (childrenlist.style.display == \"none\") {\n childrenlist.style.display = \"block\";\n } else {\n childrenlist.style.display = \"none\";\n } \n }\n } \n}\n\n<a href=\"javascript:ToggleListVisibility(this)\" >Show/Hide</a>\n\n\nbut that didn't work. IE's 'error on page' gave me this error: \n\n\n The parentNode is null or not an object.\n\n\nI also tried setting the a runat=\"server\" attribute to my ul element, then using <%# ulID.ClientID %> to pass the ul id to the Js function, but visual studio complained:\n\nServer elements cannot span templates.\n\n\nFinally, I tried just passing the ul object into the Js function, like this:\n\nfunction ToggleListVisibility(src) {\n if (src.style.display == \"none\") {\n src.style.display = \"block\";\n } else {\n src.style.display = \"none\";\n } \n}\n\n<a href=\"javascript:ToggleListVisibility(ulID)\" >Show/Hide</a>\n...\n<ul id=\"ulID\">\n\n\nwhich works, but it toggles the visibility for the ChildList in all rows within my ParentList. I want it to only toggle the visibility for the ChildList in its own row.\n\nI'm at a loss of what to do. JavaScript is not my forte, and I would appreciate if someone can provide some pointers. Thanks in advance." ]
[ "c#", "javascript", "asp.net", "listview", "repeater" ]
[ "Activity indicator (spinner) with UIActivityIndicatorView", "I have a tableView that loads an XML feed as follows:\n\n- (void)viewDidAppear:(BOOL)animated {\n [super viewDidAppear:animated];\n\n if ([stories count] == 0) {\n NSString *path = @\"http://myurl.com/file.xml\";\n [self parseXMLFileAtURL:path];\n }\n}\n\n\nI'd like to have the spinner to show on the top bar at the app launch and dissapear once the data is displayed on my tableView.\n\nI thought that putting the beginning at viewDidAppear and the end at -(void)parserDidEndDocument:(NSXMLParser *)parser but it didn't work.\n\nI'd appreciate a good explained solution on how to implement this solution." ]
[ "iphone", "objective-c", "cocoa-touch" ]
[ "Why does a loop in R starts at 0 as opposed to the first number in the sequence?", "The output of the following loop starts at zero, and has a length of 76, while my intention was for the loop to produce 27 values. What am I doing wrong?\n\n p=0\n for(i in 50:76){ \n p[i]= choose(76,i)*.5^76 } \n p\n\n [1] 0.000000e+00 NA NA NA\n [5] NA NA NA NA\n [9] NA NA NA NA\n[13] NA NA NA NA\n[17] NA NA NA NA\n[21] NA NA NA NA\n[25] NA NA NA NA\n[29] NA NA NA NA\n[33] NA NA NA NA\n[37] NA NA NA NA\n[41] NA NA NA NA\n[45] NA NA NA NA\n[49] NA 2.034472e-03 1.037182e-03 4.986451e-04\n[53] 2.258016e-04 9.617474e-05 3.846990e-05 1.442621e-05\n[57] 5.061829e-06 1.658185e-06 5.058870e-07 1.433347e-07\n[61] 3.759597e-08 9.095800e-09 2.021289e-09 4.105743e-10\n[65] 7.579834e-11 1.263306e-11 1.885531e-12 2.495555e-13\n[69] 2.893398e-14 2.893398e-15 2.445125e-16 1.698003e-17\n[73] 9.304128e-19 3.771944e-20 1.005852e-21 1.323489e-23" ]
[ "r", "loops" ]
[ "Delete / Hide / Remove Actionbar", "I read about 20 topics and still didn't find a solution that worked for me.\n\nI need to delete, hide, or remove the actionbar in my all activities.\n\nStyles.xml (I tried Theme.AppCompat.NoActionBar and many, many more):\n\n<style name=\"AppTheme\" parent=\"Theme.AppCompat\">\n\n</style>\n\n\nDependencies\n\ndependencies {\ncompile fileTree(include: ['*.jar'], dir: 'libs')\nandroidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {\n exclude group: 'com.android.support', module: 'support-annotations'\n})\ntestCompile 'junit:junit:4.12'\ncompile 'com.github.hotchemi:android-rate:1.0.1'\ncompile 'com.github.florent37:materialtextfield:1.0.5'\ncompile \"com.android.support:support-core-utils:25.0.1\"\n}\n\n\nOnly Theme.AppCompat works (with actionbar), others shut down the application on start." ]
[ "android" ]
[ "Fastest way to find an item in a collection", "Right now my I have a script which parses all of the items, places it into a collection (currently a list which is slow), and then I want to return the element that matches a list of keywords that I've inputted beforehand. \n\nWhat would be the best type of collection for this purpose and is there any way i can find my desired element without having to loop through the whole collection? \n\nThank you. \n\nEdit:\n\nAn example sitemap\n\ndef parse(sitemap):\n req = urllib.request.urlopen(sitemap)\n soup = BeautifulSoup(req, 'xml')\n soup.prettify()\n inventory_url = []\n\n\n for item in soup.find_all('url'):\n\n\n inventory_url.append(item.find('loc').text)\n\n\n #matches all keywords\n #keywords is a list of string\n for item in inventory_url:\n if all(kw in item for kw in keywords):\n return item" ]
[ "python" ]
[ "#include header with C declarations in an assembly file without errors?", "I have an assembly file (asm.S) which needs a constant #define'd in a C header file (c_decls.h). The header file contains C function declarations in addition to the #define I want. Unfortunately, gcc barfs when trying to compile the assembly file. For example,\n\nc_decls.h\n\n#ifndef __c_decls_h__\n#define __c_decls_h__\n\n#define I_NEED_THIS 0xBEEF\nint foo(int bar);\n\n#endif\n\n\nasm.S\n\n#include \"c_decls.h\"\n\n.globl main\nmain:\n pushl %ebp\n movl %esp, %ebp\n movl $I_NEED_THIS, %eax\n leave\n ret\n\n\nOutput\n\n\n > gcc -m32 asm.S\n c_decls.h: Assembler messages:\n c_decls.h:6: Error: junk '(int bar)' after expression\n c_decls.h:6: Error: suffix or operands invalid for 'int'\n\n\nIs there a way to #include a C header file that contains function declarations in an assembly file? (Changing the header or moving/redefining the #define is not an option.)" ]
[ "c", "gcc", "assembly", "include", "x86" ]
[ "Most Pythonic/Django way to dynamically load client libraries at runtime", "I'm writing a Django application in which we will have multiple client libraries that make calls to third party APIs. We want to be able to determine which client library to load at runtime when calling different endpoints. I'm trying to determine the most Django/Pythonic way to do this\n\nThe current idea is to store class name in a model field, query the model in the View, and pass the class name to a service factory that instantiates the relevant service and makes the query. I've also considered writing a model method that uses reflection to query the class name\n\nFor example lets say we have a model called Exchange that has an id, a name, and stores the client name.\n\nclass Exchange(models.Model):\n exchange_name = models.CharField(max_length=255)\n client_name = models.CharField(max_length=255)\n\n def __str__(self):\n return self.exchange_name\n\n\nThen in the View we might have something like:\n\nfrom rest_framework.views import APIView\nfrom MyProject.trades.models import Exchange\nfrom django.http import Http404\nfrom MyProject.services import *\n\n\nclass GetLatestPrice(APIView):\n\n def get_object(self, pk):\n try:\n exchange = Exchange.objects.get(pk=pk)\n except Exchange.DoesNotExist:\n raise Http404\n\n def get(self, request, pk, format=None):\n exchange = self.get_objectt(pk)\n service = service_factory.get_service(exchange.client_name)\n latest_price = service.get_latest_price()\n serializer = PriceSerializer(latest_price)\n return Response(serializer.data)\n\n\nThis syntax may not be perfect but it hasn't been tested. But the idea is that maybe we have \n\nExchangeA - client1 \nExchangeB - client2\nExchangeC - client3\n\n\nAnd for each client we have a service class that all inherit from the same Abstract Base. Each service has an override that are all the same. That way when you call /api/get_latest_price you pass the Exchange id as a query param and the code loads whatever service and client library is relevant. This would be so we could easily add new types to the system, have consistent and small Views, and decouple the business logic. Is this an acceptable, scalable pythonic method? Or is there a better solution for it? Essentially the problem is implementing Polymorphism in django and seperating the domain model from the data model. This has to be a solved problem so I'm curious on the way other people might be doing this. I know it's unusual to be calling a third party API like this but since we are forced to I want to do it in the cleanest most scalable way possible." ]
[ "python", "django", "oop", "design-patterns", "django-rest-framework" ]
[ "View all nodes by this user: filters or arguments", "I'm generating a view that lists all nodes created by this user. To restrict it to the currently logged in user, do I need to use Filters or Arguments?\n\nI thought Arguments -> User: Uid, but not sure how to specify current logged user as the argument." ]
[ "php", "drupal", "content-management-system", "drupal-views" ]
[ "Combining Session and Cache", "To make my extranet web application even faster/more scalable I think of using some of the caching mechanisms. For some of the pages we'll use HTML caching, please ignore that technique for this question.\n\nE.g.: at some point in time 2500 managers will simultaneously login on our application\n(most of them with the same Account/Project)\n\nI think of storing an Account-cachekey and Project-cachekey into the user's Session and use that to get the item from the Cache.\n\nI could have simply stored the Account into the session, but that would result in 2500 of the same Accounts in memory.\n\nIs there a better solution to this or does it make sense :)?" ]
[ "asp.net", "session", "caching" ]
[ "Emacs Evil mouse clicks don't work in motion state", "I'm using Emacs Evil. Whenever I'm in motion state, mouse clicks don't work. For example, if I go to recent files (recentf), and wanna click some file, I am forced to switch to Emacs state for it to work. How can I make them work in motion mode as well? Thanks." ]
[ "emacs", "mouseevent" ]
[ "MATLAB equivalent of NumPy masked arrays?", "Desired behavior\n\nIn Python, I can created a masked array in NumPy like so:\n\n>>> import numpy as np\n>>> x = np.arange(1, 7).reshape(3, 2)\n>>> x = np.ma.array(x, mask=[[0, 0], [1, 0], [0, 0]])\n>>> x\nmasked_array(\n data=[[1, 2],\n [--, 4],\n [5, 6]],\n mask=[[False, False],\n [ True, False],\n [False, False]],\n fill_value=999999)\n\n\nAnd then computations treat it as if the masked values do not exist. For example, compare\n\n# Matrix multiplication on raw data.\n\n>>> np.dot(x.data, x.data.T)\narray([[ 5, 11, 17],\n [11, 25, 39],\n [17, 39, 61]])\n\n# Matrix multiplication on masked data.\n\n>>> np.ma.dot(x, x.T)\nmasked_array(\n data=[[5, 8, 17],\n [8, 16, 24],\n [17, 24, 61]],\n mask=[[False, False, False],\n [False, False, False],\n [False, False, False]],\n fill_value=999999)\n\n\nNote that this is different from filling the masked values with zero or nan because things like division by zero are ignored. For example:\n\n>>> y = np.copy(x.data)\n>>> y\narray([[1, 2],\n [3, 4],\n [5, 6]])\n\n>>> y / x\nmasked_array(\n data=[[1.0, 1.0],\n [--, 1.0],\n [1.0, 1.0]],\n mask=[[False, False],\n [ True, False],\n [False, False]],\n fill_value=999999)\n\n>>> z = np.copy(x.data)\n>>> z[1, 0] = 0\n>>> z\narray([[1, 2],\n [0, 4],\n [5, 6]])\n\n>>> y / z\n...RuntimeWarning: divide by zero encountered in true_divide...\narray([[ 1., 1.],\n [inf, 1.],\n [ 1., 1.]])\n\n\nQuestion\n\nMy question is: is there a way to replicate this functionality in MATLAB? I've tried nan but I get errors in downstream callee functions, e.g. minFunc." ]
[ "matlab" ]
[ "How to pass array to ElasticSearch search template using mustache?", "This is a part of my search query template:\n"query": {\n "bool": {\n "must": [\n {\n "terms": {\n "platform_id": [\n "{{#platform_ids}}",\n "{{.}}",\n "{{/platform_ids}}"\n ]\n }\n }\n ], \n\nThis solution was taken from the elasticsearch official website.\nI have this query:\nGET _render/template\n{\n "id": "fddf", \n "params": {\n "query_string": "tinders",\n "platform_ids": [1, 2]\n }\n}\n\nAnd this results with this:\n"terms" : {\n "platform_id" : [\n "",\n "1",\n "",\n "2",\n ""\n ]\n}\n\nBut I need this:\n"terms" : {\n "platform_id" : [\n 1, 2\n ]\n}\n\nCouldn't find a solution for this." ]
[ "elasticsearch" ]
[ "PHP XML node deletion", "i have an XML file with large number of tags. it has more than 2000 tag here and there. i want to delete all that htmlText Tag and save it as a new xml. how cani do that in PHP???\nhere is the code tht iam using\n\n$remove = $doc->getElementsByTagName('htmlText');\n$doc->removeChild($remove);" ]
[ "php", "xml", "dom" ]
[ "Oracle ODBC read fails with left join", "I have a small Problem but its annoying me extremly.\ni want to left join a table but i get only the error that the odbc read fails.\nWhen i comment out the left join block the query works.\n\nim pretty sure that theres no typo and im frustated.. \n\nany ideas?\n\nselect \n*\nfrom\nSYSADM.KATARTIKEL\n\nleft join SYSADM.TBLFALL\non SYSADM.KATARTIKEL.ITBROWID = SYSADM.TBLFALL.ITBROWID\n\nwhere rownum <= 150;\n\n\nheres the error \nits in german..\n\nFehler beim Lesen über ODBC\nselect \n*\nfrom\nSYSADM.KATARTIKEL\n\nleft join SYSADM.TBLFALL\non SYSADM.KATARTIKEL.ITBROWID = SYSADM.TBLFALL.ITBROWID\n\nwhere rownum <= 150\n\n\nEDIT: The Solotion for this case is to create aliases:\n\nselect \n K.*,\n\n T.ITBROWID as ITID\nfrom\n SYSADM.KATARTIKEL K\n\nleft join SYSADM.TBLFALL T\non K.ITBROWID = T.ITBROWID\n\nwhere \n rownum <= 150;\n\n\nEDIT: The problem is select * you cant select anything and doing a join afterwards!" ]
[ "sql", "database", "oracle", "left-join" ]
[ "PostgreSQL SELECT when integer unique - invalid input syntax", "cur.execute(\"\"\"SELECT name, number \n FROM store\n WHERE number=%s OR name =%s\"\"\",\n (number, name))\n\n\nMy problem is that number is INTEGER UNIQUE and when I try to select by number everything is ok, but if I try to select by name I received an error: \n\n\n invalid input syntax for integer" ]
[ "sql", "postgresql", "tkinter" ]
[ "Animating divs to act as pages in CSS3", "I'm trying to get content to move across the screen but I was having trouble moving text with Bootstrap's carousel.\n\nI have an animation working, but the divs sit on top of each other so they animate in and out of their own positions, not in and out of the same position.\n\nHere's the CSS\n\n/* Home and about pages */\n#about-page {\n transform: translateX(200%);\n}\n\n.slideOutLeft {\n animation: slideOutLeft 1s forwards;\n}\n.slideInLeft {\n transform: translateX(-200%);\n animation: slideInLeft 1s forwards;\n}\n.slideOutRight{\n transform: translateX(200%);\n animation: slideOutRight 1s forwards;\n}\n.slideInRight {\n animation: slideInRight 1s forwards;\n}\n\n/* Slide in from the left */\n@keyframes slideOutLeft {\n 0% { transform: translateX(0%); }\n 100% { transform: translateX(-200%); }\n}\n@keyframes slideInLeft {\n 0% { transform: translateX(-200%); }\n 100% { transform: translateX(0%); }\n}\n@keyframes slideOutRight {\n 0% { transform: translateX(0%); }\n 100% { transform: translateX(200%); }\n}\n@keyframes slideInRight {\n 0% { transform: translateX(200%); }\n 100% { transform: translateX(0%); }\n}\n\n\nwhich is triggered by the following JavaScript\n\n$(function() {\n // Go to home\n $(\"#home-link\").click(function(){\n // Link appearance\n $(this).addClass('active');\n $('#about-link').removeClass('active');\n\n // Slide in homepage\n $('#home-page').removeClass('slideOutLeft');\n $('#home-page').addClass('slideInLeft');\n // Slide out about page\n $('#about-page').removeClass('slideInRight');\n $('#about-page').addClass('slideOutRight');\n $('#about-page').addClass('hidden');\n\n });\n\n // Go to about slide\n $(\"#about-link\").click(function(){\n // Link appearance\n $(this).addClass('active');\n $('#home-link').removeClass('active');\n\n // Slide out homepage\n $('#home-page').removeClass('slideInLeft');\n $('#home-page').addClass('slideOutLeft');\n $('#home-page').addClass('hidden');\n // Slide in about page\n $('#about-page').removeClass('slideOutRight');\n $('#about-page').addClass('slideInRight');\n });\n\n});\n\n\nYou can see the problem at testing version of the site here.\n\nThanks for all of your help and advice." ]
[ "javascript", "jquery", "css", "css-animations" ]
[ "Can you dynamically switch databases using useDb?", "Is it possible to have the original connection point to a new database?\n\nBasically I have one connection that I want to always use the same database and then I have a second that the database can be dynamic.\n\nSo:\n\nglobal.db = mongoose.createConnection('mongodb://localhost:27017');\nglobal.db1 = db.useDb('static');\nglobal.db2 = db.useDb('dynamic');\n\n\nand then elsewhere in the code be able to change db2 so it will point to a new database:\n\ndb2.useDb('newDb');" ]
[ "mongoose" ]
[ "How to overwrite Windows Phone Suggestion Bar programmatically?", "Talking about Suggestion Bar as we can see here, I'd like to know if there's a way to show/hide this bar programmatically, and/or add/remove buttons in it programmatically?" ]
[ "windows-phone-7", "toolbar" ]
[ "Why is this skipping one row of cells?", "I have a macro that filters a spreadsheet by department and then copies & paste the results into the appropriate departments worksheet. It then repeats for each of the 9 departments. It is working fine except it doesn't copy and paste the last line of the data for the \"Punch Press\" section. It shows the cells highlighted but the data does not transfer with it. \n\nAny help is greatly appreciated! \n\nHere's what I have:\n\nSub UpdateTables()\n 'PunchPress Macro\n\n\n\n Sheets(\"Audit scores\").Select\n ActiveSheet.Range(\"$A$1:$AL$118\").AutoFilter Field:=2, Criteria1:= _\n \"Punch Press ESP\"\n\n\n Range(\"X1\").Select\n Range(Selection, Selection.End(xlDown)).Select\n Range(Selection, Selection.End(xlToRight)).Select\n\n\n Selection.Copy\n Sheets(\"Punch Press\").Select\n Range(\"X1\").Select\n ActiveSheet.Paste\n Columns(\"A:A\").ColumnWidth = 17.57\n Columns(\"A:A\").ColumnWidth = 20.57\n Rows(\"2:2\").RowHeight = 15\n Selection.RowHeight = 15\n\n Range(\"A1\").Select\n\nEnd Sub" ]
[ "excel", "excel-2010", "vba" ]
[ "Hide specific shipping options based on products or categories in WooCommerce", "My WooCommerce website uses 3 different shipping types.\n\n\nRoyal mail signed for (7 days)\nNext day guaranteed\nRecorded delivery\n\n\nSome products can only be shipped using option 1. When this product is added to the cart, a shipping class i created helps to show option 1 in the cart but the other two options are still visible (customers are not allowed to choose these options for this product). By using jQuery i was able to hide the other two options because option 1 was the default selection. (So it was easy to hide the other two based on this).\n\nThe problem i am having is that the 2 hidden options still appear on the checkout page and I'm not sure why.\n\nThis is the code I am using to hide the other two options when the first option is selected in the cart:\n\njQuery(document.body).ready(function() {\n if(jQuery('#shipping_method_0_ced_pps').val() == 'ced_pps')\n jQuery('ul#shipping_method li:nth-child(2)').hide();\n jQuery('ul#shipping_method li:nth-child(3)').hide();\n});\n\n\nThe strange thing is if I test to see if a value exists on the checkout page I can fire an alert but when I use the above code it does not work at all.\n\nCan someone provide some help or an alternative method?\n\nI've had a look on here and this is the closest I've got to a solution without using jQuery. The problem with this solution is that I need to manually enter the product id's into the functions.php file. Which is not ideal when there's over 100 products." ]
[ "php", "wordpress", "woocommerce", "shipping", "custom-taxonomy" ]
[ "A communication error occurred within the Reporting Services endpoint on this SharePoint site", "I have a SharePoint 2013 farm with 2 app servers and 3 web front-ends. I'm using Reporting Services in SharePoint Mode. I have the report service installed on one app server. I also installed the add-in on this server. I've also installed the Add-In on all the front-ends. So the other app server doesn't have anything related to reporting services installed. \n\nThe problem is that sometimes on the first report request of a new browser session, I'm receiving a HTTP/1.1 500 A communication error occurred within the Reporting Services endpoint on this SharePoint site. If the error persists, contact the SharePoint site administrator for help. If I hit the refresh button, the report renders fine and will continue to render fine until I kill the browser and try again. This is happening for many of my users. \n\nAny ideas what could be the cause? I'm wondering if I have to install the report service and add-in on the other app server. MSDN doesn't specify if it's required or not. Looking at http://msdn.microsoft.com/en-us/library/hh479774.aspx shows that I didn't really need to install the add-in on the app server, but I don't think that's the problem." ]
[ "reporting-services", "sharepoint-2013" ]
[ "How to force YouTube Lowest Quality via Embed URL Parameter [2016]", "This question (only similar Q on S/O) was answered in a perplexing haywire back in 2012: YouTube force 480p embed link\n\nIt briefly covers using &vq=small to load 240p, as so:\n\n<iframe src=\"//youtube.com/embed/FqRgAs0SOpU?rel=0&vq=small\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen></iframe>\n\n\nIt is said in the answers that &rel=0 was also required at the time.\n\nThe Problem: It is also said that if the video isn't available in the chosen quality, it will load the default (usually 720p).\n\nThere are also other keywords, such as &hd=0 and &fmt=### to choose the codec & quality.\n\nIt is also known that changing the iframe's width and height will tell YT which quality to use.\n\nQuestion: First of all, which parameter (or combination of) is right? \n\nMore specific Question: How do I tell Youtube, in a URL, to use the lowest quality possible, regardless of connection speed, screen size, or any other circumstance?\n\nExtra: What is the URL parameter for 144p? Proof: Screenshot of Youtube App\n\nAlso, this is Google Dev's YouTube URL parameter reference, here\n\nThanks for any input." ]
[ "html", "iframe", "youtube", "youtube-api" ]
[ "Async Tcp Server I just can get one client", "Async Tcp Server I just can get one client.\n\nWhen I have more than one client.I just get first client in server,but others client connected in client.\n\nHere is my server code:\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Net.Sockets;\nusing System.Threading;\n\nnamespace BeginAcceptTcpClientserver\n{\n\nclass Program\n{\n\n static void Main(string[] args)\n {\n TcpListener listener = new TcpListener(1234);\n listener.Start();\n listener.BeginAcceptTcpClient(callbake,listenner);\n\n Console.WriteLine(\"print q to quit\");\n ConsoleKey key;\n do \n {\n key = Console.ReadKey().Key;\n } while (key != ConsoleKey.Q);\n\n }\n static void callbake(IAsyncResult ar)\n {\n\n TcpClient clienter = ((TcpListener)ar.AsyncState).EndAcceptTcpClient(ar);\n Console.WriteLine(\"---client connect {0}<--{1} ---\", clienter.Client.LocalEndPoint, clienter.Client.RemoteEndPoint);\n }\n}\n}" ]
[ "c#", "asynchronous", "tcp" ]
[ "can non-unique index avoids the duplication of records", "I have table in which I am not able to create primary key as well as unique indexing,the reason is, table contains employee's salary data,employee code is unique but because pay codes are different and each pay code associated to individual employee,that's why we are allowing the duplication of records.\n\nNow the problem is,salary data is pushed by the third party vendor into the shared database and when we migrate the salary data into our database, then it happened that data records inserted twice or thrice times.\n\nfor example, suppose third party pushed 5000 records, now we need to fetch those 5000 records into our database, but it happened last month that data fetched 3 to 4 times, it becomes 20,000 records instead of 5000, the reaso was simple we don't have any validation in our table.\n\nNow i was suggested to create unique index to avoid duplication, but because employee code is repeated, i am not able to do it.\n\nNow we are left with non-unique index and I am not able to understand , is it really helpful in order to avoid duplication.\n\nMy main purpose is to avoid duplication.\nPlease suggest me the better solution. \n\nHere is some data\n\n SALARY_REPORT_ID EMP_NAME EMP_CODE PAY_CODE PAY_CODE_NAME AMOUNT PAY_MODE PAY_CODE_DESC YYYYMM REMARK EMP_ID PRAN_NUMBER PF_NUMBER PRAN_NO ATTOFF_EMPCODE REFERENCE_ID\n 13488158 Mr. Javed Jafri 91559037 104 7427 1 HOUSE RENT ALLOW 201802 119 22782303 150025 1-268\n 13488159 Mr. Javed Jafri 91559037 100 23885 3 BASIC PAY 201802 119 22782303 150025 1-268\n 13488160 Mr. Javed Jafri 91559037 103 9590 1 DEARNESS ALLOW. 201802 119 22782303 150025 1-268\n 13488161 Mr. Javed Jafri 91559037 100 191800 1 BASIC PAY 201802 119 22782303 150025 1-268\n 13488162 Mr. Javed Jafri 91559037 303 40000 2 PF SUB-PAY(GPF) 201802 119 22782303 150025 1-268\n 13488163 Mr. Javed Jafri 91559037 502 20 2 G.T.I.S. 201802 119 22782303 150025 1-268\n 13488164 Mr. Javed Jafri 91559037 503 72 2 SCLIS 201802 119 22782303 150025 1-268\n 13488165 Mr. Javed Jafri 91559037 999 69441 1 NET EARNING 201802 119 22782303 150025 1-268\n 13488166 Mr. Javed Jafri 91559037 998 195692 2 GROSS DEDUCTION 201802 119 22782303 150025 1-268\n 13488167 Mr. Javed Jafri 91559037 997 265133 1 GROSS EARNING 201802 119 22782303 150025 1-268\n 13488168 Mr. Javed Jafri 91559037 134 16006 3 WAGE REVISION ARREARS 201802 119 22782303 150025 1-268\n 13488169 Mr. Javed Jafri 91559037 108 400 1 CONVEYANCE ALLOWANCE 201802 119 22782303 150025 1-268\n 13488170 Mr. Javed Jafri 91559037 134 16025 3 WAGE REVISION ARREARS 201802 119 22782303 150025 1-268\n 13488171 Mr. Javed Jafri 91559037 506 600 2 GSLI(Board Employee) 201802 119 22782303 150025 1-268\n 13488172 Mr. Javed Jafri 91559037 312 155000 2 INCOME TAX 201802 119 22782303 150025 1-268\n\n\nMore Indent way" ]
[ "sql", "oracle" ]
[ "how SameSite attribute added to my Asp.net_SessionID cookie automatically?", "Recently samesite=lax add automatically to my session cookie!\nthis attribute just add to sessionID:\n\"Set-Cookie ASP.NET_SessionId=zana3mklplqwewhwvika2125; path=/; HttpOnly; **SameSite=Lax**\"\n\nMy website hosted on IIS 8.5, Windows 2012 R2, and dont have WAF or UrlRewrite and I turn off AntiVirus (kasper).\n\nbut yet have same problem on some customer servers.\n\nany idea?\n\nEDITED:\nI Find this:\nhttps://support.microsoft.com/en-us/help/4524419/kb4524419\n\n\n ASP.NET will now emit a SameSite cookie header when HttpCookie.SameSite value is 'None' to accommodate upcoming changes to SameSite cookie handling in Chrome. As part of this change, FormsAuth and SessionState cookies will also be issued with SameSite = 'Lax' instead of the previous default of 'None', though these values can be overridden in web.config.\n\n\nHow can i overridde samesite cookies for SessionState in web.config?\ni add this line, but it not work on SessionID cookie!\n<httpCookies sameSite=\"Unspecified\" />\n\nEDITED: I find this: https://docs.microsoft.com/en-us/dotnet/api/system.web.configuration.sessionstatesection.cookiesamesite?view=netframework-4.8#System_Web_Configuration_SessionStateSection_CookieSameSite\n\nSet samesite for stateserver by \"cookieSameSite\" attribute of SessionState tag." ]
[ "asp.net", "iis", "samesite" ]
[ "Qt: Dragging a widget to scroll the widget's parent QScrollArea?", "I've got a long horizontal QLabel displaying a png (the image shows a signal/time graph). Under that, I've got a QTableWidget. Both of these are in a QScrollArea because I want them to stay vertically aligned (the cells in the table correspond with the signal seen directly above them). I'm trying to add a handler to the QLabel such that the user can use the picture itself to scroll the scrollarea, rather than having to use the scrollbar. Is there a tried-and-tested way to do this? Directly setting the scrollarea's sliderPosition inside the QLabel's dragMoveEvent doesn't seem smart, because when the scrollarea scrolls it also leads to another dragMoveEvent on the (moving) QLabel." ]
[ "c++", "qt", "scroll", "draggable" ]
[ "Axios 0.19.2 not sending CSRF token with", "I have a problem with my Laravel application, after pushing local changes to the master branch and then pulling master from the Linux server, I get a CSRF token mismatch whenever I do an axios request.\nThis issue is not present in the local environment which uses PHP artisan serve, but the Linux server uses apache2.\nI have tried clearing cookies, I have tried incognito windows I have tried on another computer, I have updated axios to 0.19.2 I have cleared all errors with dependencies missing and I cannot get rid of this error.\nWhen I inspect the network tab I see that the request header does not contain XSRF-thing-a-ma-jig and as far as I know axios includes it automatically. Also, on the local environment it is included and visible.\nHere is how I make the axios request\n axios.delete(`/${objectType.toLowerCase()}/${objectId}`)\n .then((returnData) => {\n this.getPosts(); // to be replaced\n })\n .catch(function (error) {\n console.log(error);\n });\n\nand here are the two rows for axios in bootstrap.js\nwindow.axios = require('axios');\n\nwindow.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';\n\nObviously I have the csrf_token meta tag in the head of the page.\nI am at a loss, I can't test the old version from git since it throws a 500 server error, I guess I broke something somewhere along the lines but the same master branch is working on the local environment so it should work on the Linux server...\nI need help !\nUPDATE: I think I found a possible reason, the cookies tab shows the same XSRF-Token all the time, even after multiple times deleting the cookies in browser, also on other computers as well. What could be the reason for this ?" ]
[ "laravel", "axios", "csrf-token" ]
[ "cant retrieve data to editor AjaxControlToolkit C#", "i use asp.net 4.5 and i create Project to post news with use ajax\nAjaxControlToolkit NET45\ndata when post is no any problem's and save is success to database ?\ndata when retrieve to label no problems ? but when i want retrieve to editor box cant show and retrieve empty ? why ? i want update my news by retrieve new to editor box ?\nshow file.aspx\n\ni want set retrieve data to editor content ? to update them to database ?\nwhen i post editor.content= " example any string "; in Page_Load Function is post and no problem ? but when data post to content into file.aspx is post empty ?\nwhy\nsea data\n\nall field is post data from database but content my news cant post into editor i use post my content new into label is success and you can show data content ?" ]
[ "c#", "jquery", "asp.net", "ajax" ]
[ "Setup Flask to use *.scss - with Flask-Assets and PyScss", "I can't get Flask to work with scss. I looked into this Using sass with Flask and jinja2 and Set up Flask with webassets.\nBut I am currently stuck. I setup everything and when running the server with flask run the server starts without errors. When I go to localhost:5000 I get this error: \n\n\n This page isn’t working\n localhost didn’t send any data.\n ERR_EMPTY_RESPONSE\n\n\nBut the logs of the server are empty and no *.css file got generated.\nAll thats in the console:\n\n* Serving Flask app \"app\"\n* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)\n\n\nThis is my structure:\n\n── app\n   ├── __init__.py\n   ├── assets\n   │   └── scss\n   │   ├── nav.scss\n   │   └── partials\n   │   └── color.scss\n   ├── config.py\n   ├── static\n   ├── templates\n   │   └── layout.html\n   └── views.py\n\n\n\n __init__.py\n\n\nfrom flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_assets import Environment, Bundle\n\napp = Flask(__name__)\napp.config.from_object('app.config')\ndb = SQLAlchemy(app)\n\nassets = Environment(app)\nassets.url = app.static_url_path\n\nscss = Bundle(\n \"assets/scss/nav.scss\",\n filters=\"pyscss\",\n output=\"all.css\",\n depends=\"assets/scss/partials/*.scss\"\n)\n\nassets.register(\"style\", scss)\n\nfrom app import views\n\n\n\n layout.html\n\n\n<!DOCTYPE html>\n<html>\n <head>\n {% assets \"style\" %}\n <link rel=\"stylesheet\" href=\"{{ ASSET_URL }}\" type=\"text/css\" />\n {% endassets %}\n </head>\n <body>\n Hello World\n </body>\n</html>\n\n\n\n config.py\n\n\nDEBUG = True\nASSETS_DEBUG = True\nSQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/test.db'\nSQLALCHEMY_TRACK_MODIFICATIONS = False\n\n\n\n views.py\n\n\nfrom flask import render_template\nfrom app import app\n\[email protected]('/')\[email protected]('/index')\ndef index():\n return render_template('layout.html', title=\"Home\")\n\n\n\n nav.scss\n\n\nbody{\n background: green;\n}\n\n\n\n color.scss\n\n\n$primary-accent-color: rgba(33, 150, 243, 1.0);\n\n\n\n requirements.txt\n\n\nastroid==1.5.3\nattrs==17.3.0\nautopep8==1.3.3\nBabel==2.5.1\nclick==6.7\nFlask==0.12.2\nFlask-Assets==0.12\nFlask-Babel==0.11.2\nFlask-Login==0.4.0\nFlask-SQLAlchemy==2.3.2\nFlask-WTF==0.14.2\nisort==4.2.15\nitsdangerous==0.24\nJinja2==2.10\nlazy-object-proxy==1.3.1\nMarkupSafe==1.0\nmccabe==0.6.1\npluggy==0.6.0\npy==1.5.2\npycodestyle==2.3.1\npylint==1.7.4\npyScss==1.3.5\npytest==3.3.1\npytz==2017.3\nsix==1.11.0\nSQLAlchemy==1.1.15\nwebassets==0.12.1\nWerkzeug==0.12.2\nwrapt==1.10.11\nWTForms==2.1" ]
[ "python", "sass", "flask-assets" ]
[ "Completing work in constructor VS using an initializer", "From what I have seen in other peoples code, there appears to be two ways common ways in creating an object and \"readying\" it to be used.\n\nMethod 1: Ready the object in the constructor:\n\npublic class SomeClass {\n int setting;\n\n public SomeClass(int setting) {\n this.setting = setting;\n }\n}\n\n\nMethod 2: Create the Object then \"ready\" it inside an initialize method such as:\n\npublic class SomeClass {\n int setting;\n\n public SomeClass(int setting) {\n\n }\n\n public void init(int setting) {\n this.setting = setting;\n }\n}\n\n\nIs there any specific reason to use either method over another?" ]
[ "java", "constructor", "initialization" ]
[ "Imageview, last image always bigger", "I have a problem with my ImageView. The icons all display correct size, except the last one is always bigger in my ListView.\n\nCan somebody please help?\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:orientation=\"horizontal\" >\n\n<ImageView \n android:id=\"@+id/imgIcon\" \n android:layout_width=\"wrap_content\" \n android:layout_height=\"fill_parent\" \n android:layout_marginRight=\"6dip\" \n android:src=\"@drawable/icon\"\n android:gravity=\"center_vertical\" />\n\n\n<TextView android:id=\"@+id/naam\"\n android:textSize=\"14sp\" \n android:textStyle=\"bold\" \n android:textColor=\"#FFFF00\" \n android:layout_width=\"wrap_content\" \n android:layout_height=\"wrap_content\"/>\n\n<TextView android:id=\"@+id/waarde\" \n android:textColor=\"#ffffffff\"\n android:textStyle=\"bold\"\n android:layout_width=\"wrap_content\" \n android:layout_height=\"wrap_content\"\n android:layout_toRightOf=\"@+id/naam\"\n android:layout_marginLeft=\"2dip\"/>\n\n</LinearLayout>\n\n\nIf i change the ImageView as follows, it is ok but too big:\n\nandroid:layout_height=\"wrap_content\"\n\n\nEdit: Problem solved, i needed to reduce the TextSize in the TextViews" ]
[ "android", "android-layout", "android-imageview" ]
[ "Should a 502 HTTP status code be used if a proxy receives no response at all?", "According to the RFC:\n\n\n 10.5.3 502 Bad Gateway\n The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.\n\n\nCan invalid response also mean no response at all (e.g. connection refused)?" ]
[ "http", "client", "http-status-codes", "status" ]
[ "Scala's generic toOption not working as expected", "I'm tying to write a generic function that will convert any type to Option[T]\nbut somehow it's not working as expected\n\nscala> def toOption[T](obj:Any):Option[T] = obj match {\n | case obj:T => Some(obj)\n | case _ => None\n | }\n<console>:11: warning: abstract type pattern T is unchecked since it is eliminated by erasure\n case obj:T => Some(obj)\n ^\n toOption: [T](obj: Any)Option[T]\n\n\nhere it's seems ok it return the Option[String]\n\nscala> toOption[String](\"abc\")\nres0: Option[String] = Some(abc)\n\n\nbut here it return Some(def) instead of None\n\nscala> toOption[Int](\"def\")\nres1: Option[Int] = Some(def)\n\n\ni can't seem to figure the appropriate way to create this generic function ,nor to understand why is that happens, I've already read many posts and questions about type erasure in scala but still can't get it, specific explanation would be a great help!" ]
[ "scala" ]
[ "detecting a span while looping using jquery/js?", "I wanted to detect a span element while looping through a div element i.e.\n\n<div class=\"example\">\n These are some <span id =\"special\" class=\"anime\">special</span> words \n that should be faded in one after the other.\n</div>\n\n\nusing javascript i split the words and fade them in one by one i.e.\n\nJS:\n\n function doSomething(spanID) {\n alert(spanID);\n }\n\n var $el = $(\".example:first\"), text = $.trim($el.text()),\n words = text.split(\" \"), html = \"\";\n\n for (var i = 0; i < words.length; i++) {\n html += \"<span>\" + words[i] + ((i+1) === words.length ? \"\" : \" \") + \"</span>\";\n };\n $el.html(html).children().hide().each(function(i){\n // if special span is detected\n // get the span id pass it to doSomething function \n $(this).delay(i*200).fadeIn(700);\n });\n $el.find(\"span\").promise().done(function(){\n $el.text(function(i, text){\n return $.trim(text);\n }); \n });\n\n\n\n working example is here: http://jsfiddle.net/6czap/5/\n\n\neverything works, it just that i need to detect any special spans so i can do something with them, and then the for loop should carry on doing what it deos. thanks" ]
[ "javascript", "jquery" ]
[ "Contracting a tensor with a selection rule", "Imagine that you have a tensor $T_{ijkl}$ (0<=i,j,k,l< N) that has the following property\n\nT_{ijkl} is nonzero if i+j=k+l\n\nwhich acts as a \"selection rule\".\n\nYou want to contract the tensor T with another tensor u to make a third tensor v as follows\n\n$$v_{ij} = sum_{kl=0}^N T_{ijkl} u_{kl}$$\n\nis there a way to do this construction such that:\n\na. Uses the tensor contraction machinery of numpy and/or tensorflow? Things like einsum and the like.\n\nb. Uses the explicit symmetry of the tensor, i.e the above operation should require $O(N^3)$ operations, not $O(N^4)$.\n\nOne could use einsum directly getting $O(N^4)$ operations:\n\nv = np.einsum('ijkl,ij->kl',T,u)\n\n\nOr one could do a custom triple loop as\n\nv = np.zeros_like(u)\nfor i in range(N):\n for j in range(N):\n for k in range(max(1+i+j-N,0),min(i+j,N-1)+1):\n v[i,j]+=T[i,j,k,i+j-k]*u[k,i+j-k]\n\n\nBut neither of this satisfy both a. and b. above" ]
[ "python", "numpy", "tensorflow", "numpy-slicing" ]
[ "IF-Then-Else Loops in Excel VBA", "Good day all, \n\nI am trying to write a macro that will pull information from Column C of worksheet auxdata if the agent's name and date match. The rub is that the way the reports are compiled there may be a mismatch of one day (ie a record on the unified page such as 5/1/2014 | x | AGENT X may actually correspond to a record under 5/2/2014 on the auxdata sheet). I have the following code:\n\nSub testloop()\nDim unified As Worksheet\nDim auxdata As Worksheet\nSet unified = ThisWorkbook.Sheets(\"unified\")\nSet auxdata = ThisWorkbook.Sheets(\"auxdata\")\n\nunified.Activate\nunified.Range(\"a2\").Select\nDo While ActiveCell.Value <> Empty\n If ActiveCell.Value = \"auxdata[Date]\" Then\n ActiveCell.Offset(0, 3).FormulaR1C1 = _\n \"=INDEX(auxdata[Staffed Time], MATCH([@agent], auxdata[Agent], 0))\"\n Else\n ActiveCell.Offset(0, 3).Value = \"false\"\n ActiveCell.Offset(1, 0).Select\n End If\nLoop\nEnd Sub\n\n\nThis loop only goes to the Else statement. \nActivecell.value = date from unified worksheet\n\nI need help on the If-then Statement and how to add 1 day to the auxdata[Date] in the else statemnet" ]
[ "vba", "excel" ]
[ "Bootstrap 3, data-show not working", "I'm using the modal-plugin supported by Bootstrap 3 (http://getbootstrap.com/javascript/#modals) with the following mark-up:\n\n<div class=​\"modal fade\" id=​\"login_modal\" tabindex=​\"-1\" role=​\"dialog\" aria-labelledby=​\"myModalLabel\" aria-hidden=​\"true\" data-show=​\"true\">​…​</div>​\n\n\nAccording to the documentation this should work with the data-show attribute.. Unfortunately the modal won't show automatically when the page finished loading. I don't see anything wrong here so I hope one of you guys could spot the problem for me please.\n\nP.S.:\nI also found an similar existent but already closed issue they had with modals which seem to have been rewritten in v3 so I don't think it's up-to-date (https://github.com/twbs/bootstrap/issues/5891).\n\nEDIT\nWhat I forgot to mention is that I included bootstrap of course. With a button to open and close it, it works just fine. :) It's really just the data-show attribute not doing what it's supposed to" ]
[ "twitter-bootstrap", "modal-dialog" ]
[ "Android Studio app link assistant digital asset links verification failed with nginx server with valid letsencrypt certificate", "For my android app project , i wanted to use app deep linking, using app link assistant. Following steps I have done:\n\n\nAdded url intent filters.\nLogic to handle intent\nAssociate website - created DAL file using debug certificate.\nSave the file as assetlinks.json\nSave the file under my server https://sub.subdomain.example.com/.well-known/assetlinks.json\nThe file is accessible via browser.\nBut when tested inside the android studios app link assistant link and verify, it give error \"The website hosting the Digital Asset Links file must support HTTPS with a valid certificate. Please ensure the DAL file is accessible at https://sub.sudomain.example.com/.well-known/assetlinks.json\".\n\n\nI am using below configuration on server:\n\n\nUbuntu 16.04\nPHP 7\nSSL certificate generate via letsencrypt.org\nfullchain.pem and key.pem used in SSL configuration\nnginx/1.10.0\nAndroid Studio 2.3\n\nCan someone guide what could be possible issues? Why the android studio app assistant not verifying the file." ]
[ "android", "ssl", "nginx", "deep-linking", "lets-encrypt" ]
[ "How do I write a Java adapter for Oracle GoldenGate?", "According to this whitepaper [1], Oracle GoldenGate for Big Data\n\n\n \n ... also includes Oracle GoldenGate for Java,\n which enables customers to easily deliver to additional big data systems and support\n specific use cases that their environment demands.\n \n\n\nWhat is the function signature for these plugins?\n\n[1] http://www.oracle.com/us/products/middleware/data-integration/goldengate-for-big-data-ds-2415102.pdf" ]
[ "oracle-golden-gate" ]
[ "Public getter, protected setter with CodeDOM", "Is it possible to generate a property with a public getter and a protected setter with CodeDOM? The goal is to achieve something similar to the following.\n\n[Serializable]\npublic class Wrapper {\n public Wrapper() { }\n private string _Field;\n public string Field { get; protected set; }\n}\n\n\nI have a large COM based API for which I wish to compile a .Net wrapper so it would be easier to use .Net features such as LINQ, Reflection, inheritance and serialization with it. The only feasible way is to automate large parts of this work with code generation.\n\nThese objects contain some read only properties that I wish to expose through serialization which requires a property setter. But so long I haven't found any ways to set the setter protected or similar. \n\nOne way might be to mark the property as not serializable and serialize the _Field but since one goal for the serialized output is web I'd need to attribute the private member with all the possible serializer attributes that direct the serializer to use a cleaner name (without the underscore) for serialization. For the same reason I believe custom serialization isn't possible.\n\nIt's not that important that I can deserialize it accurately, ie. it isn't critical that the value remains in its original value during/through deserialization. The properties are read only just to reduce confusion by preventing the API consumer from trying to change the read only fields and wondering why they have no effect on anything." ]
[ "c#", ".net", "serialization", "codedom" ]
[ "SYBASE Table space information", "Can any one help me finding the information of multiple tables in SYBASE. I Know in ORACLE we do Select * from USEr_segments;" ]
[ "sybase", "sap-iq" ]
[ "Why my initialized object of Log4Net have all levels properties as false?", "I use Castle.Windsor and Log4Net for initialize my Logger.\n\nMy log4net.config:\n\n<?xml version=\"1.0\"?>\n <configuration>\n <log4net>\n <appender name=\"AllMessagesFile\" type=\"log4net.Appender.RollingFileAppender,log4net\">\n <file value=\"Logs/Log.log\" />\n <level value=\"ALL\" />\n <encoding value=\"utf-8\" />\n <appendToFile value=\"true\" />\n <rollingStyle value=\"Composite\" />\n <maximumFileSize value=\"100000KB\" />\n <maxSizeRollBackups value=\"-1\" />\n <staticLogFileName value=\"true\" />\n <layout type=\"log4net.Layout.PatternLayout\">\n <conversionPattern value=\"%d %identity [%t] %-5p %c{1}.%M %m%n\" />\n <IgnoresException value=\"False\" />\n </layout>\n</appender>\n\n<appender name=\"ErrorsOnlyFile\" type=\"log4net.Appender.RollingFileAppender,log4net\">\n <file value=\"Logs/Error.log\" />\n <level value=\"ERROR\" />\n <encoding value=\"utf-8\" />\n <appendToFile value=\"true\" />\n <rollingStyle value=\"Composite\" />\n <maximumFileSize value=\"100000KB\" />\n <maxSizeRollBackups value=\"-1\" />\n <staticLogFileName value=\"true\" />\n <layout type=\"log4net.Layout.PatternLayout\">\n <conversionPattern value=\"%d %identity [%t] %-5p %c{1}.%M %m%n\" />\n </layout>\n</appender>\n\n<root>\n <priority value=\"ALL\" />\n <appender-ref ref=\"AllMessagesFile\" />\n <appender-ref ref=\"ErrorsOnlyFile\" />\n</root>\n\n</log4net>\n</configuration>\n\n\nMy AssamblyInfo.cs have foolow row:\n\n[assembly: log4net.Config.XmlConfigurator(ConfigFile = \"log4net.config\", Watch = true)]\n\n\nIn constructor of class I got object via Winsdor:\n\npublic class ACIStart\n{\n private ILogger Logger { get; set; }\n\n public ACIStart(ILogger logger)\n {\n Logger = logger;\n }\n\n\nI don't have any exceptions, I just got a logger with all properties (IsDebbugEnabled, IsErrorEnabled ... ) as false.\n\nMy log no write anything to log file.\n\nWhat could be the problem?" ]
[ "log4net", "log4net-configuration" ]