texts
sequence | tags
sequence |
---|---|
[
"Alfresco space user permissions",
"I have an alfresco folder (PARENT_FOLDER) with more than 300 subfolder, and I want to grant consumer role to certain group (GROUP1) and certain subfolder (PARENT_FOLDER/FOLDER1), and consumer role to other group (GROUP2) and all subfolder.\n\nAll subfolders have \"Inherit Parent Space Permissions\" activated, and parent folder has this space user permissions:\n\n\nOWNER_USER: Coordinator\nGROUP2: Consumer\n\n\nThe PARENT_FOLDER/FOLDER1 has:\n\n\nGROUP1: Consumer\n\n\nWith this configuration:\n\n\nGROUP2 can access to PARENT_FOLDER and all subfolders.\nGROUP1 only to objects contained in PARENT_FOLDER/FOLDER1 (by id), but cannot access to objects from their path, and whit a CMIS client cannot make a getParent(), etc. To make it possible, PARENT_FOLDER must have GROUP1: Consumer grant, and in this case , GROUP1 could access all subfolders.\n\n\nI think the solution is revoke \"Inherit Parent Space Permissions\" and specify this user space permissions:\n\n\nPARENT_FOLDER:\n\nOWNER_USER: Coordinator\nGROUP1: Consumer\nGROUP2: Consumer\n\nPARENT_FOLDER/FOLDER1:\n\nOWNER_USER: Coordinator\nGROUP1: Consumer\nGROUP2: Consumer\n\nOther subfolders differents to PARENT_FOLDER/FOLDER1:\n\nOWNER_USER: Coordinator\nGROUP2: Consumer\n\n\n\nbut make it is very difficult because I can't select many subfolders and change their user permissions. I was looking to make it from database model (postgres) but I haven't got sufficient model knowledge to do it. I was looking to make this permission changes from CMIS, but I didn't find anything.\n\nQuestion 1: How can I change space user permissions to many alfresco object at once?\n\nQuestion 2: Do you know other way to do what I need?\n\nThanks."
] | [
"permissions",
"alfresco"
] |
[
"Search tags by text which contain other tags",
"The following code shows that BeautifulSoup.find(text=) will not search for tags which contain some other tags.\n\nI am not sure if there is a way to do so.\n\nCould anybody let me know whether there a way to perform such a search?\n\nThanks.\n\n$ cat main.py \n#!/usr/bin/env python\n# vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 fileencoding=utf-8:\n\nfrom bs4 import BeautifulSoup\nimport sys\nimport re\nsoup = BeautifulSoup(sys.stdin.read(), 'html.parser')\nprint soup.find('td', text = re.compile(sys.argv[1]))\n\n$ cat main.sh \n#!/usr/bin/env bash\n# vim: set noexpandtab tabstop=2:\n\nset -v\n./main.py 'Overall design' <<EOF\n<td nowrap=\"\">Overall design<b>xxx</b></td>\nEOF\n\n./main.py 'Overall design' <<EOF\n<td nowrap=\"\">Overall design</td>\nEOF\n\n$ ./main.sh \n./main.py 'Overall design' <<EOF\n<td nowrap=\"\">Overall design<b>xxx</b></td>\nEOF\nNone\n\n./main.py 'Overall design' <<EOF\n<td nowrap=\"\">Overall design</td>\nEOF\n<td nowrap=\"\">Overall design</td>"
] | [
"python",
"beautifulsoup"
] |
[
"Rails route to get a resource using query string",
"I would like to have a custom route querystring based, to access a specified resource. For example:\n\n/opportunities/rent/san-miguel-de-tucuman?id=45045\n\nThat route should map to the action OpportunitiesController#show, with the resource id 45045.\n\nThanks in advance!!!\n\nUpdated\n\nThis are my current routes:\n\n\nget 'oportunidades/alquiler/san-miguel-de-tucuman/:id', to: \"opportunities#show\"\nget 'oportunidades/alquiler/san-miguel-de-tucuman', to: \"opportunities#index\"\n\n\nSo, if I navigate to the /oportunidades/alquiler/san-miguel-de-tucuman?id=123456 route, it go to the Opportunities#index action.\n\nP/S: sorry, I forget to mention that I have a similar route for the index action."
] | [
"ruby-on-rails",
"routing",
"url-routing"
] |
[
"Woocommerce how to change selected variation when changing gallery thumbnails",
"By default Woocommerce changes the featured image on the gallery when you change the selected variation form the dropdown on variable products.\n\nI want to vice versa that: when you swipe the product gallery thumbnails and the feature image changes i want to change the selected corresponding value on the dropdown.\n\nAnyone?"
] | [
"php",
"woocommerce",
"hook-woocommerce"
] |
[
"Bash script running correctly in Linux machine but not when executed via Jenkins from a Windows machine",
"I have a Bash script as below:\n\n#!/bin/bash\n\nVAR_A=$(echo \"cat //artifact/fileName\" | xmllint --shell BuildResult.xml | sed '/^\\/ >/d' | sed 's/<[^>]*.//g' | tr -d '\\n' | awk -F\"-------\" '{print $3}')\necho $VAR_A\n\n\nI have Jenkins installed on a Windows machine and via Cygwin openssh, I am connecting to the Suse Linux machine in which this script is residing.\n\nWhen I call the above script via an ANT sshexec command configured in Jenkins, it is running OK but no output.\n\nOn the other hand, when I am running the same script from within the SUSE Linux system, it is echoing current result.\n\nI am not able to figure the root cause and respective fix. I have checked the shell in Suse Linux and it is set to /bin/bash system wide."
] | [
"linux",
"bash",
"shell",
"jenkins",
"ant"
] |
[
"Quickly checking whether two line segments are from the same line",
"I have two edges, both of which are made up of 2 3-dimensional points, forming a line segment. \n\nIs there a relatively quick way of checking whether both of the line segments part of the same line?"
] | [
"c#",
"geometry"
] |
[
"Better way of sending bulk requests to a remote API with Django Celery?",
"I have users table with 24K users on my Django website and I need to retrieve information for each of my users by sending a request to a remote API endpoint which's rate limited (15 requests/minute).\n\nSo my plan is to use the Celery periodic tasks with a new model called \"Job\". There are two ways in my perspective:\n 1. For each user I will create a new Job instance with the ForeignKey relation to this user.\n 2. There will be a single Job instance and this Job instance will have a \"users\" ManyToManyField field on it.\n\nThen I'll process the Job instance(s) with Celery, for example I can process one Job instance on each run of periodic task for the first way above. But..there will be a huge amount of db objects for each bulk request series...\n\nBoth of them seem bad to me since they are operations with big loads. Am I wrong? I guess there should be more convenient way of doing so. Can you please suggest me a better way, or my ways are good enough to implement?"
] | [
"django",
"django-celery",
"bulk",
"django-celery-beat"
] |
[
"Local address of the photo or image taken with UIImagePickerController",
"I use the UIImagePickerController to take photo or to select it from an album. Here I put the selected image to the imageView : \n\n- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {\n\n UIImage *chosenImage = info[UIImagePickerControllerEditedImage];\n self.temporaryImageView.image = chosenImage;\n [picker dismissViewControllerAnimated:YES completion:NULL];\n}\n\n\nBut How can i get the address of the selected photo on the device? or the name of it? Is it possible?"
] | [
"ios",
"uiimagepickercontroller"
] |
[
"Kafka number of topics vs number of partitions",
"Please bear with me. I'm pretty new to kafka. \nI'm working on the project where producers can come up at runtime(not a fixed number) and publish messages. Currently they publish to unique topic (topic.uuid) created at runtime in kafka broker, I have one consumer on the other end which subscribes to topic.* pattern and subscribes to all the topics and does re-balancing as new topics come in.Is it the correct approach?\n\nNow, I'm confused should we have one topic with multiple partitions or multiple topics with one partition each.Technically, it is same.\n\nBut, what is the complexity involved in getting new partition (at runtime) and new consumer for every partition (at runtime) to achieve higher throughput as it is mentioned in various blogs that number of partition should have same number of consumer's in a group."
] | [
"apache-kafka"
] |
[
"Running NUnit in Mono with Jenkins",
"I'm sorry if this is already answered in another place, but I can not find anything after an hour searching google.\n\nI have a Jenkins CI environment set up on a Ubuntu server. Right now it successfully compiles c# code with the help of mono. I'd like it to also be able to run NUnit tests.\n\nWhat's the best way to do this?\nIs there a way that does not include a slave'd windows version of Jenkins, perhaps with nunit-console? (Would be cool if after running that command, I could view results via Jenkins' web interface)"
] | [
"mono",
"jenkins",
"nunit"
] |
[
"Is it possible to Redirect audio output to phone speaker or headset in iOS programmatically",
"I am developing an application in which I want to redirect audio output to phone speaker, but I don't have idea how to do this programmatically.\n\nAny idea about it?"
] | [
"ios",
"iphone",
"audio"
] |
[
"JavaFX WebView simulate KeyEvent",
"I have a problem with firing KeyEvent to a JavaFX WebView.\nI crawl a page (Facebook) and there is an Inputfield with Javascript/Ajax reload. When i do the Key-Type on my own Facebook load the content but if I fire the KeyEvent manually via Event.fireEvent Facebook don't load the content (But the WebView shows the pressed Key in the Inputfield).\n\nI don't wanna use the Robot class because the Application should run in background without taking control over the whole userinput. \n\nExample code:\n\npublic void simulateTyping(WebView wv, String text) {\n KeyEvent ke = new KeyEvent(KeyEvent.KEY_PRESSED, \n \"a\" , \"a\", \n KeyCode.A, false, false, false, false);\n KeyEvent ke2 = new KeyEvent(KeyEvent.KEY_TYPED, \n \"a\" , \"a\", \n KeyCode.A, false, false, false, false);\n KeyEvent ke3 = new KeyEvent(KeyEvent.KEY_RELEASED, \n \"a\" , \"a\", \n KeyCode.A, false, false, false, false);\n wv.addEventHandler(KeyEvent.ANY, new EventHandler<KeyEvent>() {\n @Override\n public void handle(KeyEvent e) {\n System.out.println(e.getEventType()+\" \"+e.getText()+\" \"+e.getCharacter()+\" \"+e.getCode()+\" \"+e.getSource()+\" \"+e.getTarget());\n }\n });\n wv.fireEvent(ke);\n wv.fireEvent(ke2);\n wv.fireEvent(ke3);\n}\n\n\nSo with this example code on the same facebook page I got those outputs:\n\nKEY_PRESSED a A WebView@5fbe21e7[styleClass=root web-view] WebView@5fbe21e7[styleClass=root web-view]\nKEY_TYPED a UNDEFINED WebView@5fbe21e7[styleClass=root web-view] WebView@5fbe21e7[styleClass=root web-view]\nKEY_RELEASED a A WebView@5fbe21e7[styleClass=root web-view] WebView@5fbe21e7[styleClass=root web-view]\n\n\nAnd I got exactly the same output when I press the key myself.\n\nAnyone here with a good clue why my own Events don't act in the same way like the \"real\" Events do? \n\nUPDATE (09.03.17):\nI investigated the problem further and it seems that my own Events just work purely visual. Not even the value attribute is set from my own fired Events. In Google Chrome and when I use my \"Browser\" the value attribute is set and the Javascript/Ajax Event is triggered."
] | [
"javascript",
"ajax",
"javafx",
"webview",
"keyevent"
] |
[
"Jenkins - Builds always unstable when some test failed even though it must fail",
"I am using the Junit plugin for the tests report. My problem is most of the builds will mark as unstable which should be failed. Is there any way to mark the build as failed when having more than one test failed?\nExample1:\n\nExample2:\n\nExample3:"
] | [
"jenkins",
"continuous-integration",
"jenkins-pipeline",
"jenkins-plugins"
] |
[
"Code for fetching a picture (bitmap) from gallery not working",
"MY SOLUTION: Ok some good answers. This is what I came up with. Not sure to answer my own question or put it here for proper stackoverflowness so if anyone knows please share. \n\n@Override\nprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n // TODO Auto-generated method stub\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == RESULT_OK) {\n switch (requestCode) {\n case cameraData:\n Bundle extras = data.getExtras();\n bmp = (Bitmap) extras.get(\"data\");\n iv.setVisibility(View.VISIBLE);\n break;\n case SELECT_PICTURE:\n Uri selectedImageUri = data.getData();\n selectedImagePath = getPath(selectedImageUri);\n File imgFile = new File(selectedImagePath);\n bmp = BitmapFactory.decodeFile(imgFile.getAbsolutePath());\n break;\n }\n iv.setVisibility(View.VISIBLE);\n iv.setImageBitmap(bmp);\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bmp.compress(Bitmap.CompressFormat.JPEG, 50, stream); // compress\n byte[] ba = stream.toByteArray();\n image_str = Base64.encodeBytes(ba);\n }\n}\n\n\n//////////////////////////////////////////////////////////////////////////////////////////\n\nOK I have a path to picture in my gallery. I want to take that picture and turn it into a bundle so I can 64 encode it to upload to my server. here is my onActivityResult. I have it working from taking a picture with the camera just not getting it from the gallery.\n\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n // TODO Auto-generated method stub\n super.onActivityResult(requestCode, resultCode, data);\n if (resultCode == RESULT_OK){\n switch(requestCode){\n case cameraData: \n Bundle extras = data.getExtras();\n bmp = (Bitmap) extras.get(\"data\");\n Log.e(\"picture\",\"Take Picture\");\n break;\n case SELECT_PICTURE:\n Uri selectedImageUri = data.getData();\n selectedImagePath = getPath(selectedImageUri);\n Log.e(\"picture\",selectedImagePath);\n File imgFile = new File(selectedImagePath); \n bmp = (Bitmap) BitmapFactory.decodeFile(imgFile.getAbsolutePath());\n Bundle extras1 = ((Cursor) imgFile).getExtras();\n // bmp = (Bitmap) extras1.get(\"data\");\n Log.e(\"picture\",\"from Gallery\");\n break;\n }\n }\n } \n\n\nthe base 64 code is not mine its from this site: http://blog.sptechnolab.com/2011/03/09/android/android-upload-image-to-server/\n\ngetPath:\n\npublic String getPath(Uri uri) {\n String[] projection = { MediaStore.Images.Media.DATA };\n Cursor cursor = managedQuery(uri, projection, null, null, null);\n int column_index = cursor\n .getColumnIndexOrThrow(MediaStore.Images.Media.DATA);\n cursor.moveToFirst();\n return cursor.getString(column_index);\n}"
] | [
"android",
"bitmap",
"gallery"
] |
[
"Selecting elements on \"shift + arrow up\"",
"I have some list of elements (each element is one line of text). When you click on it it changes color. After you clicked on some item if you press \"shift + arrow up\" above items are selected too. How to implement it? I thought it could go this way: put focus on particular element in ng-click function, and then in ng-keydown function implement selecting other elements. But it doesn't seem to work. \n\n<div ng-repeat=\"elem in listCtrl.availableElements\" class=\"list-elem\" ng-class=\"{ 'selected' : listCtrl.availableElements[$index].selected }\" ng-click=\"listCtrl.listHandler($event, listCtrl.availableElements[$index])\" ng-keydown=\"$event.shiftKey && ($event.which == 38 || $event.which == 40) && listCtrl.listHandler($event, listCtrl.availableElements[$index])\">\n <div>\n {{elem.text}}\n </div>\n</div>"
] | [
"javascript",
"angularjs"
] |
[
"Vector element ID's C++",
"UserFile.open(cname + \".txt\");\nint numOfElements = name.size();\n\nif (UserFile.is_open())\n{\n name.push_back(cname);\n pass.push_back(cpass);\n posx.push_back(0);\n posy.push_back(0);\n id.push_back(numOfElements);\n\n std::cout << \"Your player name has been registered successfully.\" << std::endl;\n UserFile << cname << \";\" << cpass << \";\" << \"0\" << \";\" << \"0\";\n}\n\n\nI've gotten this far with adding players to vectors and even the numOfElements works correctly.. How can I read statistics of each player representing the player id as the nth element in the vector?\nExample:\n\nelse if (userInput == \"stats\") // Ignore the else\n{\n // Name is Allura. ID is stored too. Increments from 0 to work with the vector\n // What can I do to make a way of showing information only in that nth element (like element 0 if player id is 0) etc?\n}"
] | [
"c++",
"class",
"vector",
"elements"
] |
[
"SQL SELECT where column CONTAINS substring",
"I have a database containing all usernames. Now, I have a page where I can search for an user. At the moment I use the following SQL: \n\nSELECT uid, username, id, status \nFROM users \nWHERE `username` LIKE <search string>\n\n\nNow, I have a record with the username Hattorius. But when I use that SQL syntax, and search for hatt. It doesn't give any results. How can I still make this work?\n\nI searched some around, but nobody really had an answer to this."
] | [
"sql"
] |
[
"How do I fix error \"Invalid locator strategy: css selector\"",
"I'm new to robotframework, I have just installed Python 2.7.9, wxpython2.8.1 unicode and ride 1.3 then appiumlibrary. When I run a test with the KeyWord \"Click Element\": \n\nClick Element id=fr.axa.soon.qa:id/subscription\n\nI get an error message : \n\n\n WebDriverException: Message: Invalid locator strategy: css selector\n\n\nI know it's not a css selector, but I'm on a native app and I don't understand why this isn't a AppiumDriver.\n\nHow do I fix this ?"
] | [
"appium",
"robotframework"
] |
[
"Sort a list of cards prolog",
"I have a list of card structures such as:\n\n[card(ace, spades), card(10, diamonds), card(king, clubs)]\n\n\ncan anyone help me understand how to sort these according to face value?\n\nI have this:\n\nbubblesort(L, L1) :-\n ( bubble(L, L2)\n -> bubblesort(L2, L1)\n ; L = L1 ).\n\nbubble([card(A,A2), card(B,B2)|T], L) :-\n ( A > B\n -> L = [card(B,B2), card(A,A2)|T]\n ; L = [card(A,A2) | L1],\n bubble([card(B,B2)|T], L1)).\n\n\nwhich works well (its bubble sort) except when you have card(ace, spades) or alike because ace is not a number"
] | [
"prolog",
"bubble-sort"
] |
[
"Ionic 3 App Size for android is more then compared to ionic 2",
"I am working in Ionic for couple of months. I developed ionic 2 App with more 10pages and App size was 6Mb after Apk Generated, but in ionic 3 I have not even used more than 8pages and less lines of code then compared to Ionic 2 App. Still my Ionic 3 App Size is 35Mb. Any solution for this?\n\nNote: No images are used for both App,\n\nand is it required to keep .module.ts in all the pages which is new feature in Ionic 3."
] | [
"angular",
"typescript",
"ionic-framework",
"ionic3"
] |
[
"How should I arrange my projects/classes in .NET to avoid circular dependecies",
"My program is attempting to draw grammars in C# & WPF. I have:\n\n1 DataStructure project which describes a tree structure of how it should be visualised. Each node in the tree relates to a symbol in the grammar. Nodes at the top define the rule for that nonterminal symbol.\n\n1 Drawer project which describes the user controls in WPF.\n\nI need to reference drawer in my datastructure as when i traverse the tree, I call DataStructure.draw(); on each node. I also need to reference the datastructure in my drawer project so I can respond to a user clicking on my GUI, it will update the data structure.\n\nThis creates a circular depedency, I have tried to use a controller class but I have no idea :/"
] | [
"c#",
"user-interface",
"oop",
"visualization",
"circular-dependency"
] |
[
"Text in the dom get selected when click the screen",
"I have added some text element in the Window, while selecting the screen the text in the DOM get selected as below\n\n\n\ni have mentioned \"pointer-events\": \"all\", for text element, but his not working. Can anyone suggest some way\n\nThanks in advance"
] | [
"javascript",
"jquery"
] |
[
"Upgrade pip in Bitnami Odoo Stack",
"I am finding trouble while trying to install the python library cryptography in Bitnami Odoo Stack in Widnows. Looking through, I found that upgrading pip could solved the issue.\nSo I tried to upgrade pip in the Bitnami Odoo Stack but the following error ocurred.\n C:\\Bitnami\\odoo-13.0.20210315-0\\python\\Scripts>pip.exe install --upgrade pip\nCollecting pip\n Using cached https://files.pythonhosted.org/packages/ac/cf/0cc542fc93de2f3b9b53cb979c7d1118cffb93204afb46299a9f858e113f/pip-21.1-py3-none-any.whl\nInstalling collected packages: pip\n Found existing installation: pip 9.0.1\n Uninstalling pip-9.0.1:\n Successfully uninstalled pip-9.0.1\n Rolling back uninstall of pip\nException:\nTraceback (most recent call last):\n File "c:\\bitnami\\odoo-1~1.202\\python\\lib\\site-packages\\pip-9.0.1-py3.7.egg\\pip\\basecommand.py", line 215, in main\n status = self.run(options, args)\n File "c:\\bitnami\\odoo-1~1.202\\python\\lib\\site-packages\\pip-9.0.1-py3.7.egg\\pip\\commands\\install.py", line 342, in run\n prefix=options.prefix_path,\n File "c:\\bitnami\\odoo-1~1.202\\python\\lib\\site-packages\\pip-9.0.1-py3.7.egg\\pip\\req\\req_set.py", line 784, in install\n **kwargs\n File "c:\\bitnami\\odoo-1~1.202\\python\\lib\\site-packages\\pip-9.0.1-py3.7.egg\\pip\\req\\req_install.py", line 851, in install\n self.move_wheel_files(self.source_dir, root=root, prefix=prefix)\n File "c:\\bitnami\\odoo-1~1.202\\python\\lib\\site-packages\\pip-9.0.1-py3.7.egg\\pip\\req\\req_install.py", line 1064, in move_wheel_files\n isolated=self.isolated,\n File "c:\\bitnami\\odoo-1~1.202\\python\\lib\\site-packages\\pip-9.0.1-py3.7.egg\\pip\\wheel.py", line 462, in move_wheel_files\n generated.extend(maker.make(spec))\n File "c:\\bitnami\\odoo-1~1.202\\python\\lib\\site-packages\\pip-9.0.1-py3.7.egg\\pip\\_vendor\\distlib\\scripts.py", line 372, in make\n self._make_script(entry, filenames, options=options)\n File "c:\\bitnami\\odoo-1~1.202\\python\\lib\\site-packages\\pip-9.0.1-py3.7.egg\\pip\\_vendor\\distlib\\scripts.py", line 276, in _make_script\n self._write_script(scriptnames, shebang, script, filenames, ext)\n File "c:\\bitnami\\odoo-1~1.202\\python\\lib\\site-packages\\pip-9.0.1-py3.7.egg\\pip\\_vendor\\distlib\\scripts.py", line 212, in _write_script\n launcher = self._get_launcher('t')\n File "c:\\bitnami\\odoo-1~1.202\\python\\lib\\site-packages\\pip-9.0.1-py3.7.egg\\pip\\_vendor\\distlib\\scripts.py", line 351, in _get_launcher\n result = finder(distlib_package).find(name).bytes\nAttributeError: 'NoneType' object has no attribute 'bytes'\nYou are using pip version 9.0.1, however version 21.0.1 is available.\nYou should consider upgrading via the 'python -m pip install --upgrade pip' command.\n\nDoes anyone know how to solve it?\nThanks in advance."
] | [
"python",
"pip",
"odoo",
"bitnami"
] |
[
"is it correct about dimension table and star schema?",
"is it correct dimensions of star schema also has foreign and primary key relationship ?Is it conceptually correct , please help as its confusion I am having in my Dateware implementation.\nIf yes then in what cases , same for No\nThanks"
] | [
"sql",
"data-warehouse",
"olap",
"star-schema"
] |
[
"Check string for word, then add text to end of word",
"I have a lot of long strings (from JSON) that I want to check when i load them in.\n\nThey should be checked for the word \"youtube.com/v/\" which is within a src tag within an embed.\n\nThe youtube video can be anywhere within the string and there can be multiple ones.\n\nAfter \"youtube.com/v/\" there is the name of the video like \"CtgYY7dhTyE\".\n\nAfter \"CtgYY7dhTyE\" it should add \"?theme=light&color=white\" or \"?theme=dark&color=white\" depending on another jQuery variable. Its because i can switch themes at runtime of the site. A dark and a light theme. I want the youtube video to change according to that.\n\nHope someone can figure this one out.\n\nI have no problems in loading them in and displaying them. Everything works fine except for the youtube embed not changing theme when it gets loaded in."
] | [
"jquery"
] |
[
"How to set a button to toggle an image with animation in android?",
"Image is getting invisible with animation correctly but not getting visible again after clicking on the button.\n\npublic void jerry(View view) {\n\n Button button = (Button) findViewById(R.id.button);\n ImageView sjt = (ImageView) findViewById(R.id.imageView2);\n\n if(sjt.getVisibility() == View.VISIBLE) {\n sjt.setVisibility(View.GONE);\n sjt.animate().alpha(0).rotationBy(1800).setDuration(3000);\n } else {\n sjt.setVisibility(View.VISIBLE);\n sjt.animate().alpha(1).rotationBy(1800).setDuration(3000);\n }\n}"
] | [
"android",
"android-animation",
"toggle"
] |
[
"MySQL Stored procedure for updating two tables (2nd with auto increment value from 1st)",
"I want to update two tables at the same time in my database. One table is for groups, and the other table is for members of groups:\n\nCREATE TABLE IF NOT EXISTS groups (\n group_id INTEGER UNSIGNED AUTO_INCREMENT,\n group_name VARCHAR(150) NOT NULL DEFAULT '',\n group_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n PRIMARY KEY (group_id)\n) ENGINE=InnoDB DEFAULT CHARACTER SET utf8;\n\nCREATE TABLE IF NOT EXISTS group_members (\n group_mem_user_id INTEGER UNSIGNED NOT NULL,\n group_mem_group_id INTEGER UNSIGNED NOT NULL,\n group_mem_role TINYINT DEFAULT 1,\n group_mem_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n CONSTRAINT group_mem_pk PRIMARY KEY (group_mem_user_id, group_mem_group_id),\n FOREIGN KEY (group_mem_user_id) REFERENCES user (user_id),\n FOREIGN KEY (group_mem_group_id) REFERENCES groups (group_id)\n) ENGINE=InnoDB DEFAULT CHARACTER SET utf8;\n\n\nI want to use a stored procedure to create an entry in group and create an entry in group_members with the id that was just created for the group.\n\nI know how to do this on the server (I have a java server and I'm using Spring's JdbcTemplate to make calls to the database) but I thought it would be better and more efficient to do this in a stored procedure.\n\nThe two individual queries are (im using prepared statements):\n\nINSERT INTO groups (group_name) VALUES (?)\n\n\nand \n\nINSERT INTO group_members (group_mem_user_id, group_mem_group_id, group_mem_role) VALUES (?,?,?)\n\n\nBut I'm not sure how to merge these into one stored procedure.\n\nDELIMITER //\n\nDROP PROCEDURE IF EXISTS create_group //\nCREATE PROCEDURE create_group(\n #in/out here\n)\nBEGIN\n #no idea\nEND //\n\nDELIMITER ;\n\n\nIdeally I would like it to return some value describing whether the operation was sucessful or not."
] | [
"mysql",
"stored-procedures"
] |
[
"Xcode Error: \"EXC_BAD_ACCESS\"",
"I am attempting to compile and run a C program in Xcode. This program requires a text file for reading input and another text file for writing the data. I have put the program, and these two text files in the Source folder. The program builds successfully, but when I try to run the program I get the error: GDB: Program received signal: \"EXC_BAD_ACCESS\"\n\nWhat could be causing this?\n\n int main() {\n\n FILE *fp; \n FILE *fr;\n\n //Declare and intialize all variables to be used\n float ax = 0, ay = 0, x = 0, y = 0, vx = 0, vy = 0; \n float time = 0, deltaTime = .001; \n float timeImpact = 0, vyImpact = 0, vxImpact = 0, xImpact = 0, yImpact = 0; \n\n int numBounces = 0;\n\n //Coefficient of Restitution; epsilon = ex = ey\n float ex = .5;\n float ey = .5;\n\n fr = fopen(\"input_data.txt\", \"rt\"); //Open file for reading\n\n fp = fopen( \"output_data.txt\", \"w\" ); // Open file for writing\n\n if(fr == NULL){ printf(\"File not found\");} //if text file is not in directory...\n\n if(fp == NULL){ printf(\"File not found\");} //if text file is not in directory...\n\n fscanf(fr, \"ax: %f ay: %f x: %f y: %f vx: %f vy: %f\\n\", &ax, &ay, &x, &y, &vx, &vy); \n\n while (time < 5) {\n\n //time = time + deltaTime\n time = time + deltaTime;\n //velocity[new] = velocity[old] + acc * deltaTime\n vx = vx + ax*deltaTime;\n vy = vy + ay*deltaTime;\n //position[new] = position[old] + velocity*deltaTime + .5*acc*(deltaTime)^2\n x = x + vx*deltaTime + (.5*ax*deltaTime*deltaTime);\n y = y + vy*deltaTime + (.5*ay*deltaTime*deltaTime); \n\n //fprintf(fp, \"%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t\\n\", ax, ay, x, y, vx, vy, time);\n\n //Collision occurs; implement collision response\n if (y < 0) {\n\n //Find time of collision by solving for t in equation vy*t + .5*ay*t^2 + y = 0\n timeImpact = (-vy + sqrt((vy*vy) - (2*ay*y)) / (2*.5*ay)); //Collision time = 3.7?\n\n //velocity = -epsilon*velocity[Impact] + acc*time\n vy = (-1*ey)*vyImpact + ay*((deltaTime - time) - timeImpact);\n vx = (-1*ex)*vxImpact + ay*((deltaTime - time) - timeImpact); \n\n //Position = position[Impact] - epsilon*velocity[Impact]*time + 1/2*acc*time^2\n x = xImpact - ex*vxImpact*((deltaTime - time) - timeImpact) + .5*ax* ((deltaTime - time) - timeImpact) * ((deltaTime - time) - timeImpact);\n y = yImpact - ey*vyImpact*((deltaTime - time) - timeImpact) + .5*ay*((deltaTime - time) - timeImpact) * ((deltaTime - time) - timeImpact);\n\n //velocity = v[o] + ay(time)\n vyImpact = vy + ay*(timeImpact - time);\n vxImpact = vx + ax*(timeImpact - time); \n\n //position = position[o] + velocity(time) + 1/2*acc*time^2\n xImpact = x + vx*(timeImpact - time) + .5*ax*(timeImpact - time)*(timeImpact - time); \n //yImpact = y + vy*(timeImpact - time) + .5*ay*(timeImpact - time)*(timeImpact - time); \n\n numBounces++; //Increment number of bounces ball takes\n\n //fprintf(fp, \"%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t%f\\t\\n\", ax, ay, x, y, vx, vy, time);\n printf(\"timeImpact: %f\\nxImpact: %f\\nyImpact: %f\\nvxImpact: %f\\nvyImpact: %f\\n\", timeImpact, xImpact, yImpact, vxImpact, vyImpact);\n printf(\"Number of Bounce(s): %d\\n\\n\", numBounces); \n }\n }\n\n fclose(fp); //Close output file\n fclose(fr); //Close input file\n\n system (\"PAUSE\"); \n return 0;\n }\n\n\nSample Input: \n\nax: 0 ay: -9.8 x: 0 y: 50 vx: 8.66 vy: 5"
] | [
"c",
"xcode"
] |
[
"RijndaelManaged doesn't encrypt",
"I'm trying to encrypt a buffer with RijndaelManaged class without any success. It always return byte[0]. Here's the code:\n\n public byte[] Encrypt(byte[] data, byte[] key)\n {\n using (var ms = new MemoryStream())\n {\n using (var aes = RijndaelManaged.Create())\n {\n aes.Key = _checksumProvider.CalculateChecksum(key);\n aes.IV = _checksumProvider.CalculateChecksum(key);\n var stream = new CryptoStream(ms, aes.CreateEncryptor(aes.Key, aes.IV), CryptoStreamMode.Write);\n stream.Write(data, 0, data.Length);\n return ms.ToArray();\n }\n }\n }\n\n\nKey and IV are correctly assigned. Any idea what's wrong with the code? Thanks."
] | [
"c#",
"cryptography",
"rijndaelmanaged"
] |
[
"Python - taking each item in a list and adding it to an integer",
"This is my task: https://i.stack.imgur.com/qv6us.png\n\nI have tried to get each item out of the ASCII list by using z as the list item so the program increases z by one every time I go through the for loop.\n\nciphertext = []\nz=0\nfor item in messagelist: # messagelist a list of characters\n\n\nIf there is a space then I want to ignore it.\n\n if ' ' in messagelist:\n break\n\n\nThen I want it to add the item to an integer:'offsetfactor'.\n\n else: # ascii list is a list of ascii codes/integers\n y = asciilist[z] + offsetFactor # offset factor is a randomly generated integer\n print (y)\n\n\nThen if the answer is more than 126, I will minus 94 and turn the answer into an ASCII character. Then I want to append all the ASCII characters to a list and convert the list into a string.\n\n if y > 126:\n y = y - 94\n asciichar = str(chr(y)) # turns y into an ascii character\n ciphertext.append(asciichar) # adds the ascii character to a list called ciphertext\n else:\n asciichar = str(chr(y)) \n ciphertext.append(asciichar)\n z+=1\nencrypted = str(ciphertext) # turns ciphertext into a string\nprint ('Your encrypted message is: ',encrypted)\n\n\nThis doesn't seem to be working as 'encrypted' is printed as an empty list.\nI will be grateful for any help as it took me ages even to write the question!"
] | [
"python",
"list",
"ascii",
"caesar-cipher"
] |
[
"iOS available architecture issue",
"I'm little bit confused about the architectures available in iOS build settings.\n\nI found that there are 4 types:\n\n\ni386\narmv6\narmv7\narmv7s.\n\n\nI know i386 is for simulator, armv6 is for iOS devices (older devices, think so).\n\nBut I'm confused about armv7 and armv7s.\n\n1) What is the difference between armv7 and armv7s ?\n\n2) Will the armv7 and armv7s architecture based apps support older iOS version ?\n\nI searched but couldn't get any useful information.\nPlease help me to understand the difference, thanks in advance."
] | [
"ios",
"armv7",
"armv6"
] |
[
"React Redux mapStateToProps parameter for connect function",
"Is there a way to return a plain object from a resolved promise in redux connect function?\n\nconst resolveStateFunction = (state) =>{\n return Promise.resolve(state);\n}\nconst mapStateToProps = async (state)=>{\n const resolvedState = await resolveStateFunction(state);\n return resolvedState;\n}\nconst mapDispatchToProps = () => {\n return { apiResponse: apiResponse };\n};\nexport default connect(mapStateToProps, mapDispatchToProps)(SchoolTemp);\n\n\n\n\nthe resolvedState variable returns a resolved object value but then I am getting an error that says \n\n\n that mapStateToProps() in Connect(SchoolTemp) must return a plain\n object. Instead received [object Promise]."
] | [
"reactjs",
"redux",
"react-redux"
] |
[
"Don't highlight the cells when close dialog in react?",
"I am building a table. When a user clicks and drags through the cells, the table will show the dialog. But when I click the close button, the cells still highlight. So how I disable highlight when I click the closes button.\n\nThe code: \n\n\nexport default function Table() {\n\n const [start, setStart] = useState(null);\n const [end, setEnd] = useState(0);\n const [selecting, setSelecting] = useState(false);\n const [isOpen, setIsOpen] = useState(false);\n\n let toggleModal = () => {\n setIsOpen(!isOpen);\n };\n\n let beginSelection = i => {\n setSelecting(true);\n setStart(i);\n setEnd(i);\n updateSelection(i);\n };\n\n let endSelection = (i = end) => {\n setSelecting(false);\n updateSelection(i);\n toggleModal();\n };\n\n let updateSelection = i => {\n if(selecting) {\n setEnd(i);\n }\n };\n\n let cells = [];\n for(let j = 0; j < 12*4; j++) {\n cells.push(\n <Cell key={j}\n inputColor={\n (end <= j && j <= start || (start <= j && j <= end) ? \"#adf\": \"\")\n }\n onMouseDown={()=>beginSelection(j)}\n onMouseUp={()=>endSelection(j)}\n onMouseMove={()=> updateSelection(j)}\n onClick={toggleModal}\n >\n {j+1}\n </Cell>\n )\n }\n\n return (\n <TableCalendar>\n {cells}\n <Dialog onClose={()=> toggleModal()} show={isOpen} >\n Here's some content for the modal\n </Dialog>\n </TableCalendar>\n )\n}\n\n\nHere is my full code and demo: https://codesandbox.io/s/flamboyant-browser-50h6v\nPlease help me. Thanks"
] | [
"javascript",
"reactjs",
"react-hooks"
] |
[
"Rails production log: \"can't dump hash with default proc\" for Sass cache",
"I'm displaying every iteration of a record with a text file in it that generates SCSS code (within the markup) based on the file.\n\nThis works on my local machine, but not on the server. Checking the log file on the server wields this error:\n\nWarning. Error encountered while saving cache 207b5d2f6eb7b9bc6c3519448f6bbfb3e2c9423f/application.sassc: can't dump hash with default proc\n\n\nAs it stands, the assets on my project have to be manually precompiled.\nSo I'm guessing that it's attempting to write these additions in the markup to the manifested application.scss but can't because it won't allow for the assets to be compiled.\n\nShould I be compiling these assets? Or precompiling? How should this be handled?\n\nNote again that this works fine on my local machine."
] | [
"ruby-on-rails",
"ruby",
"compilation",
"sass",
"assets"
] |
[
"Omit xmlns and d4p1 from DotNetXmlSerializer",
"I send a Webrequest using \n\n var request = new RestRequest(string.Format(url, config.ApiLocale), Method.POST)\n {\n RequestFormat = DataFormat.Xml,\n XmlSerializer = new RestSharp.Serializers.DotNetXmlSerializer(\"\")\n };\n\n\nMy request is built like this:\n\n List<RequestParam> listParams = new List<RequestParam>()\n {\n new RequestParam(\"Foo1\"),\n new RequestParam(\"Foo2\"),\n new RequestParam(12345)\n };\n\n request.AddBody(new XmlRequest\n {\n MethodName = \"api.Testcall\",\n ListParams = listParams\n });\n\n\nMy classes:\n\n using RestSharp.Deserializers;\n using System;\n using System.Collections.Generic;\n using System.Xml.Serialization;\n\n namespace Testcall\n {\n [XmlRoot(\"methodCall\")]\n public class XmlRequest\n {\n [XmlElement(ElementName = \"methodName\")]\n public string MethodName { get; set; }\n [XmlArray(ElementName = \"params\")]\n [XmlArrayItem(\"param\")]\n public List <RequestParam> ListParams { get; set; }\n\n } \n\n public class RequestParam\n {\n [XmlElement(ElementName = \"value\")]\n public ParamFather Value { get; set; }\n\n public RequestParam() { }\n public RequestParam(String PassValue)\n {\n Value = new StringParam(PassValue);\n }\n public RequestParam(int PassValue)\n {\n Value = new IntParam(PassValue);\n }\n public RequestParam(Boolean PassValue)\n {\n Value = new BoolParam(PassValue);\n }\n }\n\n [XmlInclude(typeof(StringParam))]\n [XmlInclude(typeof(BoolParam))]\n [XmlInclude(typeof(IntParam))]\n public class ParamFather\n {\n [XmlElement(ElementName = \"father\")]\n public String Content { get; set; }\n }\n\n public class StringParam : ParamFather\n {\n [XmlElement(ElementName = \"string\")]\n public String StringContent { get; set; }\n public StringParam() { }\n public StringParam(String Content)\n {\n StringContent = Content;\n }\n }\n }\n\n\nBut the Serializer returns an XML including Strange d4p1 and xmlns-Tags. Those I want to omit! I just need the plain xml not wearing any tags.\n\n <methodCall>\n <methodName>api.Testcall</methodName>\n <params>\n <param>\n <value d4p1:type=\\\"StringParam\\\" xmlns:d4p1=\\\"http://www.w3.org/2001/XMLSchema-instance\\\">\n <string>Foo1</string>\n </value>\n </param>\n <param>\n <value d4p1:type=\\\"StringParam\\\" xmlns:d4p1=\\\"http://www.w3.org/2001/XMLSchema-instance\\\">\n <string>Foo2</string>\n </value>\n </param>\n <param>\n <value d4p1:type=\\\"IntParam\\\" xmlns:d4p1=\\\"http://www.w3.org/2001/XMLSchema-instance\\\">\n <int>12345</int>\n </value>\n </param>\n </params>\n </methodCall>\n\n\nI tried using the classic XMLSerializer instead but failed. Is it possible to do this with the DotNetXmlSerializer at all?"
] | [
"xml",
"serialization",
"xml-namespaces",
"restsharp",
"xmlserializer"
] |
[
"How to send post request without submit button",
"I have form where I don't have submit button and actually the form didn't send post request, so my question how is possible to send request on image click?\n\n@foreach($items as $item)\n <form class=\"form-horizontal\" role=\"form\" method=\"post\" action=\"{{ route('index', $item->id) }}\">\n {{ csrf_field() }}\n <div class=\"col-md-3\">\n <div class=\"well\"> \n <a><img class=\"img-responsive center-block\" src=\"{{ $item->imagePath }}\" alt=\"\"></a>\n <h4 class=\"text-center\">{{ $item->item_name }}</h4>\n </div>\n </div> \n </form>\n @endforeach\n\n\nThank you"
] | [
"laravel",
"laravel-5"
] |
[
"Remove the max value from an array in a document",
"Using mongodb. I have a collection of vehicles, each one has an array of accidents, and each accident has a date. \n\nVehicle {\n _id: ...,,\n GasAMount...,\n Type: ...,\n Accidents: [\n {\n Date: ISODate(...),\n Type: ..,\n Cost: ..\n },\n {\n Date: ISODate(..),\n Type: ..,\n Cost:...,\n }\n ]\n}\n\n\nHow can i remove the oldest accident of each vehicle without using aggregate ?\nImportant not to use the aggregate method."
] | [
"mongodb"
] |
[
"node inspector installation error",
"While installing node inspector I am getting this error - \n\n\nnpm ERR! Windows_NT 6.1.7601\nnpm ERR! argv \"C:\\\\Program Files\\\\nodejs\\\\node.exe\" \"C:\\\\Program Files\\\\nodejs\\\\\nnode_modules\\\\npm\\\\bin\\\\npm-cli.js\" \"install\" \"-g\" \"node-inspector\"\nnpm ERR! node v6.9.1\nnpm ERR! npm v3.10.8\nnpm ERR! code ELIFECYCLE\n\nnpm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`\nnpm ERR! Exit status 1\nnpm ERR!\nnpm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fal\nlback-to-build'.\nnpm ERR! Make sure you have the latest version of node.js and npm installed.\nnpm ERR! If you do, this is most likely a problem with the v8-debug package,\nnpm ERR! not with npm itself.\nnpm ERR! Tell the author that this fails on your system:\nnpm ERR! node-pre-gyp install --fallback-to-build\nnpm ERR! You can get information on how to open an issue for this project with:\nnpm ERR! npm bugs v8-debug\nnpm ERR! Or if that isn't available, you can get their info via:\nnpm ERR! npm owner ls v8-debug\nnpm ERR! There is likely additional logging output above. \n\n\nWhat could be the issue?"
] | [
"javascript",
"node.js"
] |
[
"Access variable value from one window in another one",
"I'm relatively new to C# and I have an question regarding how to access a variable from one window in another one. I want to do something like this:\n\npublic partial class MainWindow : Window\n{\nint foo=5;\n....\n}\n\n\nand in window2:\n\npublic partial class Window2: Window\n{\nint bar=foo;\n}\n\n\nHow should I do that? Thanks in advance..."
] | [
"c#",
"wpf"
] |
[
"Unobtrusive validation on multiple models with same property names",
"I have a view containing multiple partial views bind to different models.\n\n@model MyApp.ViewModels.ParentViewModel\n\[email protected](\"_PartialView1\", Model.PartialView1)\[email protected](\"_PartialView2\", Model.PartialView2)\n\n\nUnobtrusive validation works, problem is, the models for the views have properties with the same name.\n\npublic class ClassA\n{\n public int SomeProperty { get; set; }\n}\n\npublic class ClassB\n{\n public int SomeProperty { get; set; }\n}\n\npublic class ParentViewModel\n{\n public int ClassA PartialView1 { get; set; }\n public int ClassB PartialView2 { get; set; }\n}\n\n\nSince both properties have the same name, their html name attributes are the same too.\n\nIf ClassA.SomeProperty has an error, same error is shown in ClassB.SomeProperty.\nIs there a way to have proper validation without changing the property names?"
] | [
"asp.net-mvc",
"unobtrusive-validation",
"asp.net-mvc-partialview"
] |
[
".jar executable file that stays \"small window\"",
"here is my problem. \nThere is a .jar executable file that I try to launch (on W10) using the command line javaw.exe -java \"C:\\thefile.jar\" and I can see a small window opened using alt+tab, but it's impossible to select it/make it the main window.\nI have never seen such a thing before. The file (a chess program) is used by several people and it seems that I am the only one dummy that can't use it :( \nThanks for your help!"
] | [
"java"
] |
[
"How React main homepage detect changes from database",
"I have one main page display all users detail. There is another fomr component with Email field can be used to add new user on the page. When the form has submitted, the new user will receive one Email with the information setting link. The new user will go to the new page when click the link and finish his detail then. The new user detail will be saved to the database after detail form is submitted.\nWith the main page, how can I detect or monitor when a new user submit his detail setting form? I feel I could not use Redux here for a global user info as they're seperate pages...\nShould I set a timer load the user information always? I feel it is not a good solution... Are there some other ways I can do it?"
] | [
"reactjs"
] |
[
"Query failed: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected",
"dbConn.php\n\n<?php\nfunction getConnection()\n{\n try {\n $connection = new PDO(\"mysql:host=localhost;*****=username\", \"*****\", \"*****\");\n $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n return $connection;\n } catch (Exception $e) {\n throw new Exception(\"Connection error \" . $e->getMessage(), 0, $e);\n }\n}\n\n?>\n\n\nAdmin page:\n\n<?php\ntry {\n require_once(\"dbconn.php\");\n $dbConn = getConnection();\n\n $sqlQuery = \"SELECT eventID, eventTitle, eventDescription, NE_events.venueID, venueName, location, NE_events.catID, catDesc, eventStartDate, eventEndDate, eventPrice \n FROM NE_events\n INNER JOIN NE_category\n ON NE_category.catID = NE_events.catID\n INNER JOIN NE_venue\n ON NE_venue.venueID = NE_events.venueID\n ORDER BY eventTitle\";\n $queryResult = $dbConn->query($sqlQuery);\n\n while ($rowObj = $queryResult->fetchObject()) {\n echo \"<div class='event'>\\n\n <span class='eventTitle'>{$rowObj->eventTitle}</span>\\n\n <span class='categoryName'>{$rowObj->catDesc}</span>\\n\n <span class='venue'>{$rowObj->venueName}</span>\\n\n <span class='startDate'>($rowObj->eventStartDate)</span>\\n\n <span class='endDate'>($rowObj->eventEndDate)</span>\\n\n <span class='price'>($rowObj->eventPrice)</span>\n </div>\\n\";\n }\n} catch (Exception $e) {\n echo \"<p>Query failed: \" . $e->getMessage() . \"</p>\\n\";\n}\n?>\n\n\n\n\n\nI'm trying to retrieve data from MySQL database, but for some reason I get an error saying:\n\n\n Query failed: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected."
] | [
"php",
"mysql",
"sql",
"pdo"
] |
[
"Print documents go to the print spool with status printing, but its not printing document using rawprint nuget packages C#",
"I am implementing print document without print dialog using rawprint nuget packages C#\n\nWhen i print word document with print dialog then it adds to print queue with status \"Printing\" and successfully\nprint the document.\n\nWhen i print PDF document with \"PrinterName\" and FilePath using rawprint nuget packages C#, then it's add to print queue with status \"Printing\" But no print out from printer.\n\nMy code sample given bellow\n\npublic void printPDF(string printerName)\n {\n // Absolute path to your PDF to print (with filename)\n string combinedPdf = new UrlHelper(System.Web.HttpContext.Current.Request.RequestContext).Content(\"~/temp/\") + \"conbined_5248422286163515789.pdf\";\n // The name of the PDF that will be printed (just to be shown in the print queue)\n string Filepath = System.Web.HttpContext.Current.Server.MapPath(combinedPdf);\n if (System.IO.File.Exists(Filepath))\n {\n string Filename = \"conbined_5248422286163515789.pdf\";\n // The name of the printer that you want to use\n // Note: Check step 1 from the B alternative to see how to list\n // the names of all the available printers with C#\n string PrinterName = printerName;\n\n // Create an instance of the Printer\n IPrinter printer = new Printer();\n\n // Print the file\n printer.PrintRawFile(PrinterName, Filepath, Filename);\n }\n }\n\n\nPlease help and suggest."
] | [
"c#",
"printing",
"nuget-package"
] |
[
"How to add unique menu for a page?",
"I want to add a mega menu for my page in word press, but its should be unique menu. And its should not my page menu(primary menu). and the mega menu should be call by using short code."
] | [
"wordpress",
"plugins"
] |
[
"ASP.Net MVC: IAuthorizationFilter/Attribute prefered security check for login?",
"Is IAuthorizationFilter coupled with an attribute the preferred way to check if a user is logged in before a controller runs it's course?\n\nSince I'm new to MVC I've been trying to figure out how to handle situations done in WebForms. The one I ran into yesterday is checking to see if the user is able to view a page or not depending on whether logged in or not. When taking a project of mine and \"transforming\" it into an MVC project, I was a little at odds on how to solve this situation.\n\nWith the WebForms version, I used a base page to check if the user was logged in:\n\nif (State.CurrentUser == null)\n{\n State.ReturnPage = SiteMethods.GetCurrentUrl();\n Response.Redirect(DEFAULT_LOGIN_REDIRECT);\n}\n\n\nWhat I did find is this:\n\n[AttributeUsage(AttributeTargets.Method)]\npublic sealed class RequiresAuthenticationAttribute : ActionFilterAttribute, IAuthorizationFilter\n{\n public void OnAuthorization(AuthorizationContext context)\n {\n if (State.CurrentUser == null)\n {\n context.Result = \n new RedirectToRouteResult\n (\n \"Login\", \n new RouteValueDictionary\n (\n new \n { \n controller = \"Login\", \n action = \"Error\", \n redirect = SiteMethods.GetCurrentUrl()\n }\n )\n ); \n }\n }\n} \n\n\nThen I just slap that attribute on any give controller method and life is good. Question is, is this the preferred and/or best way to do this?"
] | [
"asp.net-mvc",
"authentication",
"login"
] |
[
"NSMutableDictionary with accent",
"I am working with NSMutableDictionary and in this array I am using words with accent and to add this work, fine. The problem is to retrieve and work with.\n\nTo add:\n [dicPT_SP setObject:@\"São Paulo\" forKey:@\"São Paulo\"];\n\nWhen retrieving, I am getting:\n \"S\\U00e3o Paulo\"\n\nHow can I solve this issue? I think it is simple, however I cant find a solution googling.\nAny idea is very welcome."
] | [
"objective-c",
"nsdictionary"
] |
[
"Which elememt does DataFrame. DropDuplicate drop",
"If I sort a dataframe in descending ortder based on a column. And then drop the duplicates using df.dropDuplicate then which element will be removed? The element which was smaller based on sort?"
] | [
"scala",
"apache-spark-sql",
"spark-dataframe",
"scala-collections"
] |
[
"How to render bitmaps effectively using OpenGL ES on Android?",
"My app generates 25 bitmaps(1080 * 1920) per second, I try to render them by converting them into texture(calling createTexture()), and then use the default render mode(calling OnDrawFrame() 50 times per second). However, my app crashes several seconds after launched. Is it correct to use OpenGL ES in this way? Or is there any better way to render bitmaps effectively?\nThe main code of my render is as following:\n\n public abstract class BaseRenderer implements GLSurfaceView.Renderer{\n\n\n public BaseRenderer(Context context, String vertex, String fragment){ \n ...\n }\n\n @Override\n public void onSurfaceCreated(GL10 gl, EGLConfig config) {\n GLES20.glClearColor(1.0f,1.0f,1.0f,1.0f);\n GLES20.glEnable(GLES20.GL_TEXTURE_2D);\n mProgram= ShaderUtils.createProgram(mContext.getResources(),vertex,fragment);\n glHPosition=GLES20.glGetAttribLocation(mProgram,\"vPosition\");\n glHCoordinate=GLES20.glGetAttribLocation(mProgram,\"vCoordinate\");\n glHTexture=GLES20.glGetUniformLocation(mProgram,\"vTexture\");\n glHMatrix=GLES20.glGetUniformLocation(mProgram,\"vMatrix\");\n onDrawCreatedSet(mProgram);\n }\n\n\n @Override\n public void onSurfaceChanged(GL10 gl, int width, int height) {\n ...\n }\n\n @Override\n public void onDrawFrame(GL10 gl) {\n GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT|GLES20.GL_DEPTH_BUFFER_BIT);\n GLES20.glUseProgram(mProgram);\n\n onDrawSet();\n\n GLES20.glUniformMatrix4fv(glHMatrix,1,false,mMVPMatrix,0);\n GLES20.glEnableVertexAttribArray(glHPosition);\n GLES20.glEnableVertexAttribArray(glHCoordinate);\n GLES20.glUniform1i(glHTexture, 0);\n\n textureId=createTexture();\n\n GLES20.glVertexAttribPointer(glHPosition,2,GLES20.GL_FLOAT,false,0,bPos);\n GLES20.glVertexAttribPointer(glHCoordinate,2,GLES20.GL_FLOAT,false,0,bCoord);\n\n GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP,0,4);\n }\n\n public abstract void onDrawSet();\n public abstract void onDrawCreatedSet(int mProgram);\n\n private int createTexture(){\n int[] texture=new int[1];\n if(mBitmap!=null&&!mBitmap.isRecycled()){\n GLES20.glGenTextures(1,texture,0);\n GLES20.glBindTexture(GLES20.GL_TEXTURE_2D,texture[0]);\n GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER,GLES20.GL_NEAREST);\n GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D,GLES20.GL_TEXTURE_MAG_FILTER,GLES20.GL_NEAREST);\n GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S,GLES20.GL_CLAMP_TO_EDGE);\n GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T,GLES20.GL_CLAMP_TO_EDGE);\n GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, mBitmap, 0);\n return texture[0];\n }\n return 0;\n }\n }"
] | [
"android",
"bitmap",
"opengl-es"
] |
[
"Please suggest the ( Interaction model of view model) MVVM design in the simple scenario discussed in the subject",
"Data Layer\n\nI have an Order class as an entity. This Order entity is my model object.\n\nOrder can be different types, let it be \n\n\nA\nB\nC\nD\n\n\nAlso Order class may have common properties like Name, Time of creation, etc.\n\nAlso based on the order type there are different fields that are not common. \n\nView Layer\n\nThe view contains the following\n\n\nMain Menu\nListView\n\n\nThe Main Menu contains the drop down menu button which is used to create the order based on the type selected from the drop down. The drop down contains the Order types ( A ,B , C and D).\n\nThere are different user control based on the order type. Like for example if user chooses to create an order of type A then different view with different inputs field is popped up.\n\nHence, there are four user control for each order type.\n\nIf user selects A option from the drop down then Order of type A is created and vica versa.\n\nNow below is the List View that contains the List of orders so far created by the user. \n\nTo Edit any particular order user may double click the list view row. Based on the order type clicked by the user in the listview, the view of that order type opens in edit mode. For example if user selects an order type A from the list view then view for order type A open in edit mode.\n\nPlease suggest an interaction model for view models in the scenario discussed above.\n\nPlease excuse me if the query is very basic, since I am new new to MVVM and WPF."
] | [
"wpf",
"mvvm",
"viewmodel",
"mvvm-foundation"
] |
[
"Are Helidon's Oracle Cloud Infrastructure dependencies present in Maven Central?",
"I'm messing about with Helidon's OCI Object Storage integration, and it has a dependency like this:\n\n<dependency>\n <groupId>com.oracle.oci.sdk</groupId>\n <artifactId>oci-java-sdk-objectstorage</artifactId>\n <scope>compile</scope>\n <type>pom</type>\n</dependency>\n\n\nBut I don't see any reference to that artifact in Maven Central.\n\nWhere can I find these dependencies?"
] | [
"maven",
"oracle-cloud-infrastructure",
"helidon"
] |
[
"exec(foo | at now) in PHP script",
"I'm currently trying to execute in a PHP script a command using exec(), but delayed in time.\n\nI tried :\n\nexec('at now | fooCommand >> aLog.log 2>&1');\n\n\nDoes not work and :\n\nexec('fooCommand >> aLog.log 2>&1 | at now');\n\n\nNeither. However :\n\nexec('echo \"fooCommand >> aLog.log 2>&1\" | at now\"');\n\n\nWorks but seems to launch only the echo command, not the desired fooCommand.\n\nAny ideas how to write this correcty ?"
] | [
"php",
"command",
"exec"
] |
[
"Why not \"docker push\" only publish the Dockerfile?",
"The image is built from Dockerfile. So instead of pushing a whole image (tens of MB at least), publishing a Dockerfile(only KBs usually) will save much space."
] | [
"docker"
] |
[
"Why is my IntelliJ IDEA project not finding this import?",
"Trying to follow the guide here https://spring.io/guides/gs/rest-service/#scratch\n\nHere is my Gradle file\n\nversion '1.0'\n\nbuildscript {\n repositories {\n mavenCentral()\n }\n dependencies {\n classpath(\"org.springframework.boot:spring-boot-gradle-plugin:1.5.3.RELEASE\")\n }\n}\n\napply plugin: 'java'\napply plugin: 'eclipse'\napply plugin: 'idea'\napply plugin: 'org.springframework.boot'\n\njar {\n baseName = 'gs-rest-service'\n version = '0.1.0'\n}\n\nrepositories {\n mavenCentral()\n}\n\nsourceCompatibility = 1.8\ntargetCompatibility = 1.8\n\ndependencies {\n testCompile group: 'junit', name: 'junit', version: '4.11'\n compile(\"org.springframework.boot:spring-boot-starter-web\")\n testCompile('org.springframework.boot:spring-boot-starter-test')\n testCompile('com.jayway.jsonpath:json-path')\n}\n\n\nAnd just for context, a screen of my project:\n\nhttps://i.stack.imgur.com/m8aqE.png\n\nFor some reason when I hit build, it seems to work fine, but for whatever reason it isn't able to find the org.springframework files such as the imports in this file:\n\npackage hello;\n\nimport java.util.concurrent.atomic.AtomicLong;\nimport org.springframework.web.bind.annotation.RequestMapping; \nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.web.bind.annotation.RestController;\n\n@RestController\npublic class GreetingController {\n\n private static final String template = \"Hello, %s!\";\n private final AtomicLong counter = new AtomicLong();\n\n @RequestMapping(\"/greeting\")\n public Greeting greeting(@RequestParam(value=\"name\", defaultValue=\"World\") String name) {\n return new Greeting(counter.incrementAndGet(),\n String.format(template, name));\n }\n}"
] | [
"java",
"spring",
"intellij-idea",
"gradle",
"import"
] |
[
"When autowiring use would be beneficiary with example",
"I have recently learned concept of autowiring in spring. When I was trying to understand in which particular scenarios spring autowiring can be useful \nI came up with the below two reasons from one of the questions asked in our stakoverflow forum. \n\n1.I wanted to read values from a property file and inject them into a bean. Only way I could figure out how to do this at start up of my app was to \nwire the bean in XML (and inject the properties.) I ended up using the \"byName\" attribute (because the bean was also marked as @Component) and then \nused @Autowired @Qualifier(\"nameIChose\") when injecting the bean into another class. It's the only bean I've written that I wire with XML.\n\n2.I've found autowiring useful in cases where I've had a factory bean making another bean (whose implementation class name was described in a system \nproperty,so I couldn't define the all wiring in XML). I usually prefer to make my wiring explicit though;\n\nCan any body please give me some code snippet example of the above situations that would make my understanding of autowiring more clearer?"
] | [
"spring",
"dependency-injection"
] |
[
"firefox: keys is not a function",
"I'm getting .keys is not a function on every object, using firefox 32beta but also with earlier firefox versions. Unsure what's is the cause?\n\nvar controls={'txt':{},'btn':{}};\nalert(controls.keys());"
] | [
"javascript",
"firefox"
] |
[
"How to accurately draw a 3D point in Kinect space on a WPF canvas?",
"I am developing a Kinect (v1) application where I want to be able to detect the floor position of the user relative to the user's head. \n\nI want to draw a line in WPF on the canvas which goes from the head of the user, and ends at the point on the floor plane which is closest to the head point (this should be a completely vertical line).\n\nI am however new to using WPF, canvas and Kinect, and I am having a scaling issue where the line ends much further down than it should (outside of the Kinect feed's grid). The reason I believe for it to be a scaling issue is because it is completely vertical and does move up and down correctly when I walk closer or further from the camera.\n\nThis is the main body of code for this operation:\n\nSkeletonPoint headPos = currentSkeleton.Joints[JointType.Head].Position;\nSkeletonPoint floorPoint = getSkeletonFloorPoint(headPos, floorPlane); \nCoordinateMapper mapper = new CoordinateMapper(KinectSensor);\n\nColorImagePoint colorHeadPoint = mapper.MapSkeletonPointToColorPoint(headPos, ColorImageFormat.RgbResolution640x480Fps30);\nPoint mappedHeadPoint = new Point(colorHeadPoint.X, colorHeadPoint.Y);\n\n\nColorImagePoint colorFloorPoint = mapper.MapSkeletonPointToColorPoint(floorPoint, ColorImageFormat.RgbResolution640x480Fps30);\nPoint mappedFloorPoint = new Point(colorFloorPoint.X, colorFloorPoint.Y);\n\n\ndrawUserPosition(userPos, mappedHeadPoint, mappedFloorPoint);\n\n\nThis the method which computes the floor point based on the head position:\n\nprivate SkeletonPoint getSkeletonFloorPoint(SkeletonPoint skeletonHeadPos, Tuple<float, float, float, float> floorPlane)\n{\n Point3D headPos = new Point3D(skeletonHeadPos.X, skeletonHeadPos.Y, skeletonHeadPos.Z);\n Point3D pointOnPlane = new Point3D(0, (double) -(floorPlane.Item2 / floorPlane.Item4), 0);\n Vector3D planeNorm = new Vector3D(floorPlane.Item1, floorPlane.Item2, floorPlane.Item3);\n Vector3D planeToHead = Point3D.Subtract(headPos, pointOnPlane);\n\n double dist = Vector3D.DotProduct(planeNorm, planeToHead);\n Point3D floorPoint = Vector3D.Add(Vector3D.Multiply(-dist, planeNorm), headPos);\n\n SkeletonPoint skeletonFloorPoint = new SkeletonPoint();\n skeletonFloorPoint.X = (float) floorPoint.X;\n skeletonFloorPoint.Y = (float) floorPoint.Y;\n skeletonFloorPoint.Z = (float) floorPoint.Z;\n\n return skeletonFloorPoint;\n}\n\n\nThis sets the line position:\n\nprivate void drawUserPosition(Line userPos, Point headPoint, Point floorPoint)\n{\n userPos.X1 = headPoint.X;\n userPos.Y1 = headPoint.Y;\n userPos.X2 = floorPoint.X;\n userPos.Y2 = floorPoint.Y;\n\n}\n\n\nThis is the XAML for the canvas:\n\n<Canvas>\n <kt:KinectSkeletonViewer \n KinectSensorManager=\"{Binding KinectSensorManager}\"\n Visibility=\"{Binding KinectSensorManager.ColorStreamEnabled, Converter={StaticResource BoolToVisibilityConverter}}\"\n Width=\"{Binding ElementName=ColorViewer,Path=ActualWidth}\"\n Height=\"{Binding ElementName=ColorViewer,Path=ActualHeight}\"\n ImageType=\"Color\" />\n\n <Line X1=\"0\" Y1=\"0\" X2=\"0\" Y2=\"0\" Name=\"userPos\" Stroke=\"Red\" StrokeThickness=\"2\" />\n\n</Canvas>\n\n\nAs I said, I think the geometry is correct, I just don't have any experience with WPF so I am fairly certain that is where I am going wrong.\n\nThank you for any help, and if there are any details I can provide to make this easier to solve I will be happy to provide them."
] | [
"c#",
"wpf",
"xaml",
"canvas",
"kinect"
] |
[
"Byte class object to Json",
"I have the following byte variable, which I am trying to parse to become JSON.\npayload = b'{\\n "time" : "2021-03-09T02:14:13.312Z",\\n "age" : 56,\\n "trackingMode" : "PERMANENT_TRACKING",\\n "number" : 4.0,}'\n\npayload_decoded = codecs.decode(payload, 'utf-8')\njson_record = json.load(payload_decoded, parse_float=Decimal)\nprint(json_record)\n\nIt's returning this error.. How can I parse my byte var above to Json? Thank You!\n[ERROR] AttributeError: 'str' object has no attribute 'read'"
] | [
"python",
"python-3.x"
] |
[
"Facebook ads click and page views",
"anyone have problems with facebook ads click report and other statistic system report? \nI'm using facebook ads for my landing page with 3 reporting system: facebook / google analytics / my own \n\nMy own tracking system very simple, just log/count every single visit in to database so the flow looks like:\n\nfacebook ads -> facebook redirect page (l.php) -> mypage.php ( I log the visit here) -> google analytics\n\nThe difference between facebook and google analytics is reasonable (could be browser/js/cookie...). but mypage.php and facebook is different in statistic also (This is not understandable - what happen in https://www.facebook.com/l.php? )\n\nThere is only one reason, l.php is not redirect to mypage.php (so it can't log anything). The user's browser has to have javascript enabled for facebook to load and track clicks. \n\nI never get more than 60% clicks come to mypage.php\n\nAnother thing, the percentage of it is different between countries. \n\nAnyone has experience in this problem please help / explain.\n\nMany thanks"
] | [
"php",
"facebook",
"google-analytics",
"ads"
] |
[
"size of a pointer allocated by malloc",
"char* pointer;\npointer = malloc (20000);\n\nprintf(\"%d\", sizeof(pointer));\n//output: 8\n\n\nI was expecting 20000 for the output since I reserved 20000 bytes with malloc.\nBut, it returned 8. Why is this happening?"
] | [
"c",
"memory",
"malloc"
] |
[
"How do I authenticate using requests for google drive v3 api calls",
"I'm trying to use requests in python with the google drive api v3. I can get my script to authenticate and run calls with a service. But I notice that most of the documentation for API V3 shows examples using http requests under the "reference" tab. When I try to complete a call using requests, I'm not sure how to put my Oath 2.0 authentication in to reference the token.pickle. Tried to force the token to a string but did not work. The whole script is below. You can see the "#delete mp4File" section is where I'm trying to create a request and add authentication. This is where I need help.\n from __future__ import print_function\nimport pickle\nimport os.path\nfrom googleapiclient.discovery import build\nfrom google_auth_oauthlib.flow import InstalledAppFlow\nfrom google.auth.transport.requests import Request\nimport os\nimport io\nfrom googleapiclient.http import MediaIoBaseDownload\nimport requests\n\n# If modifying these scopes, delete the file token.pickle.\nSCOPES = ['https://www.googleapis.com/auth/drive.metadata',\n 'https://www.googleapis.com/auth/drive',\n 'https://www.googleapis.com/auth/drive.file'\n ]\n\ndef main():\n """Shows basic usage of the Drive v3 API.\n Prints the names and ids of the first 10 files the user has access to.\n """\n creds = None\n # The file token.pickle stores the user's access and refresh tokens, and is\n # created automatically when the authorization flow completes for the first\n # time.\n if os.path.exists('token.pickle'):\n with open('token.pickle', 'rb') as token:\n creds = pickle.load(token)\n # If there are no (valid) credentials available, let the user log in.\n if not creds or not creds.valid:\n if creds and creds.expired and creds.refresh_token:\n creds.refresh(Request())\n else:\n flow = InstalledAppFlow.from_client_secrets_file(\n 'client_secrets.json', SCOPES)\n creds = flow.run_local_server(port=0)\n # Save the credentials for the next run\n with open('token.pickle', 'wb') as token:\n pickle.dump(creds, token)\n\n service = build('drive', 'v3', credentials=creds)\n\n # List contents of mp4 folder\n results = service.files().list(\n q="'XXXXXXXXXXXXXXXXXXXX' in parents", pageSize=1).execute()\n items = results.get('files', [])\n\n if not items:\n print('No files found.')\n else:\n for item in items:\n mp4File=(u'{0}'.format(item['id']))\n mp4Name=(u'{0}'.format(item['name']))\n print (mp4Name + " " + mp4File)\n\n # Download mp4File\n file_id = mp4File\n request = service.files().get_media(fileId=file_id)\n fh = io.FileIO(mp4Name, 'wb')\n downloader = MediaIoBaseDownload(fh, request)\n done = False\n while done is False:\n status, done = downloader.next_chunk()\n\n #delete mp4File\n url = "https://www.googleapis.com/drive/v3/files/" + file_id\n\n headers = {\n 'Authorization': 'Bearer ' + str(token)\n }\n\n response = requests.request("DELETE", url, headers=headers)\n\n print(response.text.encode('utf8'))\n\n\n\nif __name__ == '__main__':\n main()"
] | [
"python-3.x",
"google-drive-api"
] |
[
"is the class name does not take argument when creating instances?",
"class User:\n""" user description """\ndef init(self,name,age, profesion):\nself.name = name\nself.age = age\nself.profesion = profesion\ndef user_profile(self):\nprint(f" the user name is {self.name}")\nnema = User('nemata',22,'student')\nnema.user_profile()"
] | [
"instance"
] |
[
"Google books api: how to show the title?",
"I'm trying to do an exercise where I need to have an AJAX feed for my webpage. As my website is about books I'm using the Google Books API. \nI cant figure out how to show the title of the book though. This is the code I have so far:\n\n $(document).ready(function(){\n var url = 'https://www.googleapis.com/books/v1/volumes?q=:a';\n $.get(url, function(data,status){\nconsole.log(data);\nvar intValue =data.totalitems;\nvar strOne =data.kind;\n\nvar items = data.items;\n$.each(items, function( index, value) {\n console.log(value.title);\n $('#div1').append('<li><div>'+value.title+'</div></li>') });\n});\n\n });\n });"
] | [
"google-api",
"google-books"
] |
[
"Not sure how to create FK relationship using Code First Fluent API",
"I have the following entities:\n\n public class Bicycle\n {\n public int BicycleId { get; set; }\n public DateTime YearOfManufacture { get; set; }\n public BicycleType BicycleType { get; set; }\n }\n\n public class BicycleType\n {\n public int BicycleTypeId { get; set; }\n public string Description { get; set; }\n }\n\n\nEvery Bicycle must have just one BicycleType. A BicycleType could be associated with none to many Bicycles. I'm not sure how to create a Fluent Api FK relationship in this situation between Bicycle and BicycleType."
] | [
"entity-framework",
"ef-code-first"
] |
[
"how to force bash interpreter?",
"I have two simple shell scripts to run my solr installation in a screen and restart it on crash (sometimes a memory heap exception happens...)\n\nstartserver.sh\n\ncd apache-solr/example\nscreen -S solrserver ./runner.sh\ncd ../..\n\n\nrunner.sh\n\nuntil java -jar -Xmx1024m start.jar; do\n echo \"server stopped with exit code $? restart...\" >&2\n sleep 10\ndone\n\n\nthey work just fine so far, the problem however is, that runner.sh must be executeable for the current user.\n\nso this has to explicitly set. \n\ni have everything in subversion, and subversion is not intelligent enough to manage access rights.\n\nso i am looking for a solution to start the script not as executeable script in the current environment but rather pass it on to the interpreter. \n\nsomething like:\n\n/bin/bash runner.sh\n\n\nanother alias for that should be just . runner.sh (well than its not necessarily bash but the current users shell)\ni did this with perl and php scripts before but somehow it won't work\n\ni have a straight forward ubuntu 10.04 lts server on an amazon instance. well i installed apache2 and some apache modules, subversion and my favorite command line editor but no major system adaptations.\n\n\n\nit works very well with /bin/bash i must have gotten something else wrong. sorry."
] | [
"bash",
"shell"
] |
[
"possible bug in django models",
"models.py:\n\nclass root(models.Model):\n uid_string = models.CharField(max_length=255, unique=True) \n\nclass tree(models.Model):\n uid_string = models.ForeignKey(root, to_field='uid_string', db_column='uid_string')\n\nclass shrub(models.Model):\n uid_string = models.ForeignKey(root, to_field='uid_string')\n\n\nobviously, the column in shrub will be uid_string_id while the column in tree will bee uid_string. the _id appendix is supressed. \n\nIf I now do a\n\nrootentry = root(uid_string = \"text\")\nroot.save()\n\n\nI get different behaviour doing the following queries:\n\n>>> shrubentry = shrub(uid_string_id = rootentry.uid_string)\n>>> treeentry = tree(uid_string = rootentry.uid_string) \nTraceback (most recent call last): \n File \"<console>\", line 1, in <module>\n File \"/usr/local/lib/python2.6/site-packages/django/db/models/base.py\", line 328, in __init__\n setattr(self, field.name, rel_obj)\n File \"/usr/local/lib/python2.6/site-packages/django/db/models/fields/related.py\", line 318, in __set__\n self.field.name, self.field.rel.to._meta.object_name))\nValueError: Cannot assign \"'text'\": \"tree.uid_string\" must be a \"root\" instance.\n>>> \n\n\nobviously rootentry.uid_string is text"
] | [
"django",
"django-models",
"models"
] |
[
"Drawing on canvas and refreshing image",
"Hello and sorry for my bad English.\nOn my application, onDraw() method draws 10x10 field with lines using canvas.\nThen, in other method I want some cells to be painted in yellow for example. \n\nThe code is: \n\n Paint ship = new Paint();\n ship.setColor(getResources().getColor(R.color.ship_color));\n Canvas canvas = new Canvas();\n Rect r = new Rect(x*(rebro_piece),y*rebro_piece, x*(rebro_piece+1), y*(rebro_piece+1));\n canvas.drawRect(r, ship);\n\n\nbut nothing happens. What shall I do?\n\nUPD: am I right, that Canvas only draws within onDraw() method and from nothing else?"
] | [
"android",
"canvas"
] |
[
"Why is all of the different scatter points gathered closely in the same area in logistic regression graph?",
"I am currently doing a project where my team and I have to pick a dataset and apply some machine learning methods on it (SLR, MLR etc.), hence for me, I am doing logical regression. My dataset is related to the top hit songs on Spotify from 2010-2019, and I want to see how the duration and danceability of a song affects its popularity. Given that the popularity values is numerical, I have converted the popularity value of each song to binary values. Hence, the popularity value of a song will change to \"0\" if it is below 65, and \"1\" if it is above the value of 65. I then decided to plot a 2d logistic regression plot for two dimensions. The end result is that both the \"0\" and \"1\" values are all gathered in the same area, where they are supposed to be separated from each other and there should be a decision boundary at .5 showing. I just want to know what does this show about the relationship between the popularity of the songs and their duration and danceability respectively. Is this supposed to be normal or did i make a mistake?\n\n%matplotlib inline\nimport numpy as np\nimport matplotlib.pyplot as plt \nimport pandas as pd\nfrom sklearn.linear_model import LogisticRegression \n\ndf = pd.read_csv('top10s [SubtitleTools.com] (2).csv')\n\nBPM = df.bpm\nBPM = np.array(BPM)\nEnergy = df.nrgy\nEnergy = np.array(Energy)\ndB = df.dB\ndB = np.array(dB)\nLive = df.live\nLive = np.array(Live)\nValence = df.val\nValence = np.array(Valence)\nAcous = df.acous\nAcous = np.array(Acous)\nSpeech = df.spch\nSpeech = np.array(Speech)\n\ndef LogReg0732():\n Dur = df.dur\n Dur = np.array(Dur)\n Dance = df.dnce\n Dance = np.array(Dance)\n Pop = df.popu\n\n df.loc[df['popu'] <= 65, 'popu'] = 0\n\n df.loc[df['popu'] > 65, 'popu'] = 1\n\n Pop = np.array(Pop)\n\n X = Dur\n\n X = np.stack((X, Dance))\n\n y = Pop\n\n clf = LogisticRegression().fit(X.T, y)\n print(\"Coef \", clf.intercept_, clf.coef_)\n xx, yy = np.mgrid[np.min(Dur):np.max(Dur), np.min(Dance):np.max(Dance)]\n gridxy = np.c_[xx.ravel(), yy.ravel()]\n probs = clf.predict_proba(gridxy)[:,1].reshape(xx.shape)\n f, ax = plt.subplots(figsize=(20,8))\n contour = ax.contourf(xx, yy, probs, 25, cmap=\"BrBG\", vmin=0, vmax=1)\n ax_c = f.colorbar(contour)\n ax_c.set_ticks([0, 1/4, 1/2, 3/4, 1])\n idx = np.where(y==1); idx = np.reshape(idx,np.shape(idx)[1])\n y1 = X[:,idx]\n idx = np.where(y==0); idx = np.reshape(idx,np.shape(idx)[1])\n y0 = X[:,idx]\n ax.scatter(y1[0,:], y1[1,:], c='green')\n ax.scatter(y0[0,:], y0[1,:], c='blue')\n plt.xlabel('Danceability')\n plt.ylabel('Duration')\n plt.savefig('LR1.svg')\n plt.show()\n\nLogReg0732()"
] | [
"python",
"logistic-regression",
"scatter-plot",
"sigmoid"
] |
[
"Are there a faster developing alternative than backbone js? / Backbone alternative",
"I have been developing backbone applications for 2 months and I must say that this framework is awesome. Nevertheless when I compare the development velocity of backbone js against Rails/Ruby web app, I feel that javascript with backbone take too much time to being developed. Do you know if exist a backbone alternative that works like rails works? I mean I am looking for a javascript framework that works like rails for ruby (commands to generate controllers, model, view, etc).\n\nThanks for all."
] | [
"javascript",
"backbone.js"
] |
[
"Vuex store - callback is not a function",
"Why do I keep getting the error "callback is not a function" in this action in my Vuex store?\nupdateRemoteUser: ({ state, commit }, callback) => {\n const user = state.user\n axios.put(`/users/${user.id}`, { \n user: user\n })\n .then(response => {\n commit('changeUser', response.data.user)\n callback(true)\n })\n .catch(errors => {\n console.log(errors)\n callback(false)\n })\n},\n\nEDIT\nAnd then I'm calling the above action like this:\nasync setResponses() {\n this.userResponse = await this.updateRemoteUser()\n if(this.userResponse) {\n this.$router.push({ name: 'weddingDetails' })\n }\n else {\n console.log("Something is jacked")\n }\n},"
] | [
"javascript",
"vue.js",
"vuex"
] |
[
"default routing in codeigniter",
"I'm exploring codeigniter. On app startup default controller is changed to load my controller. \n\nController properly loads the view and that's fine, so I'm guessing routing works as expected, but when I use (manually type on address bar other method on same controller) same url pattern /controller/method I'm getting 404 error, either view exist. \n\nDo have to change some default routing behavior or something else is problem?\n\nThanks"
] | [
"php",
"codeigniter"
] |
[
"Creating a KieSession (Drools 6.1) in Scala",
"What is the \"proper\" way of creating a new Drools KieSession in Scala? The resources I've found are mostly Java-based, which I've adapted to Scala and got something of the sort (which works):\n\ndef getKieSession(fileName: String): KieSession = {\n val kieServices = KieServices.Factory.get()\n\n val kfs = kieServices.newKieFileSystem()\n val fis = new FileInputStream(fileName)\n\n kfs.write(\"src/main/resources/rulesfile.drl\", kieServices.getResources().newInputStreamResource(fis))\n\n val kieBuilder = kieServices.newKieBuilder(kfs).buildAll()\n\n val results = kieBuilder.getResults()\n if (results.hasMessages(Message.Level.ERROR)) {\n throw new RuntimeException(results.getMessages().toString())\n }\n\n val kieContainer = kieServices.newKieContainer(kieServices.getRepository().getDefaultReleaseId())\n val kieBase = kieContainer.getKieBase() //Necessary?\n\n kieContainer.newKieSession()\n }\n\n\nI'm trying to streamline the code and split up the functionality between calling the Kie Service and creating a new KieSession. I believe the entire method is needed to create a new session however I'm not sure the middle bit is necessary (kfs.write).\n\nAny guidance on this? (Also, yes, still tinkering with Scala + Drools)"
] | [
"scala",
"drools"
] |
[
"Hide a .gif if it is beside another .gif",
"I have a service where people can upload their images, and I display them on my website. I want to automatically hide a .gif if it is uploaded beside another .gif.\n\nI don't want this to effect images ending in .png or .jpg.. only .gifs.\n\nHere is an image example..\n\n\n\nIf there are three .gifs in a row, only display the first one.\n\nI have tried selecting it, and hiding it, but this doesn't work at all.\n\nimg > .gif{\n display:none;\n}\n\n\nDo I need to use JavaScript or jQuery to achieve this?"
] | [
"javascript",
"html",
"css",
"css-selectors"
] |
[
"JAXB classes missing form eclipse Enterprise edition",
"I need to create JAXB schema from Java class and vice-versa and i have installed the proper version of eclipse, since its stated that the EE edition has support for JAXB classes. \nHowever i have none of them.\n\nWhen i try to create new file or even project nothing appears in the search bar:\n\n\n\nI considered trying to download some sort of plug in for jaxb specifically, but for now im trying not to use this approach.\nThanks in advance!"
] | [
"java",
"eclipse",
"xsd",
"jaxb"
] |
[
"Bypassing IE's long-running script warning using setTimeout",
"I've asked about this before, and have found a few articles online regarding this subject, but for the life of me I cannot figure this out. I have a set of Javascript functions that calculate a model, but there's a ton of looping going on that makes the script take a while (~4 seconds). I don't mind the processing time, but IE prompts with a warning since there are so many executions.\n\nI've tried optimizing my code, but I simply can't cut down the number of executions enough to bypass the IE warning. Therefore, I figure that I must use the setTimeout function to reset the counter in IE.\n\nThe code is quite long, and I just can't figure out how to properly implement setTimeout in IE. I've tried mimicking the code found here, but for some reason it ends up crashing after the 100th iteration.\n\nI don't know if this is common at all, but would anyone mind taking a look at the code if I sent it to them? I just wouldn't want to post it on here because it's quite lengthy.\n\nThanks!\n\nEDIT: I've placed my code on JSfiddle as some people have suggested. You can find it here. Thanks for the suggestion and let me know if there are any questions!"
] | [
"javascript",
"internet-explorer",
"settimeout"
] |
[
"Workflow for admin/user accounts creation in Rails",
"I'm building an event registration system in Ruby on Rails. I'll need admin users as well as normal users. Is there any best practice for creating the admin users manually and not letting any random person \"Sign Up\" as an admin? Also, is there any way to prevent signups in general?\n\n(I'm thinking about using the Devise gem)"
] | [
"ruby-on-rails",
"authentication",
"database-design",
"devise",
"rubygems"
] |
[
"NoClassDefFoundError when running HelloWorld.class",
"Im getting this error when I try to run HelloWorld.class\n\nFrom this it looks like it's trying to run HelloWorld/class. The program should simply print out HelloWorld!.\n\n\npackage threads;\n\npublic class HelloWorld {\n\n public static void main(String[] args) {\n System.out.println(\"Hello World!\");\n }\n}\n\n\nAny ideas?"
] | [
"noclassdeffounderror"
] |
[
"How can a class member be left unconstructed for later construction with placement new",
"I want to make a template that contains a private member that should be left unconstructed, until it is explicitly constructed using placement new.\n\nHow can this be achieved with C++14?\n\nSomewhat like this:\n\ntemplate <typename T>\nclass Container {\n private:\n T member; //should be left unconstructed until construct() is called\n public:\n Container() = default;\n void construct() {\n new (&this->member) T();\n }\n};"
] | [
"c++",
"constructor",
"initialization",
"c++14"
] |
[
"Push values without keys to javascript array",
"In react-native I'm trying to push values from the code below to an array without the keys because the component (react-native-table-component) I'm using will only accept an array of strings or numbers and not objects with key value pairs. I'm so close to figuring it out but I'm getting stuck! \n\nStructure of response.data\n\nresponse.data = {\n \"Hours\": 234,\n \"Minutes\": 343,\n \"Days\": 23,\n \"Months\": 4\n}\n\n\nCode to receive response.data and push to array\n\n toScreenTwo = async () => {\n const { isLoggedIn, user} = this.state;\n try {\n if (!isLoggedIn) { \n const response = await http.post('/v1/signup/user', {\n user,\n })\n for (var value in response.data) {\n this.state.tableData2.push(value);\n }\n console.log('response', this.state.tableData2);\n }\n\n\n\n await this.setState({\n modalVisible: false,\n friendsModalVisible: false\n });\n } catch(err) {\n console.log(\"error \", err);\n }\n}\n\n\nCurrent Code Result\n\nThe code above, is currently push only the keys to the array tableData2 when I want to push only the values to the array tableData2\n\nArray format that react-native-table-component accepts\n\n tableData: [\n ['1', '2', '3'],\n ['a', 'b', 'c'],\n ['1', '2', '3'],\n ['a', 'b', 'c']\n ]\n\n\nIt seems that react-native-table-component needs to be passed an array with at least one array nested within it\n\nErrors\n\n\n\nIf anyone has any suggestions that would be great!"
] | [
"javascript",
"arrays",
"key-value"
] |
[
"Why does my drawing disappear from a canvas?",
"I perform some drawing on a canvas every 10 sec. Unfortunately it disappears before it will be redrawn, so we have 10 sec with a blank screen. I tired to save a canvas before drawing and restore it, did not help. \nThis bug was appeared after I had shifted a line canvas.drawPath(linePath, linePaint); from outside of a loop into the loop.\n\nCODE:\n\nprivate void drawLine(Canvas canvas) {\n yStep = (yHeight) / fullChargeLevel;\n xStep = (xWidth) / timeStampBarsQuantity;\n\n boolean check = false;\n float time;\n float chrg;\n\n while (batteryUsageHistory != null && batteryUsageHistory.moveToNext()) {\n int charge = batteryUsageHistory.getInt(1);\n int time_stamp = batteryUsageHistory.getInt(2);\n\n if (charge < 1) {\n\n if(check){\n canvas.drawPath(linePath, linePaint); //This line I shifted into here\n linePath.reset();\n }\n\n check = false;\n\n continue;\n }\n\n time = xPos + time_stamp * xStep;\n chrg = yPos - (charge * yStep);\n\n if (!check) {\n linePath.moveTo(time, chrg);\n check = true;\n\n continue;\n }\n linePath.lineTo(time, chrg);\n }\n //canvas.drawPath(linePath, linePaint); //This line I shifted from here\n }"
] | [
"java",
"android",
"canvas",
"ondraw"
] |
[
"Automatically fill the current date in a cell if the data is not empty in Google sheet",
"I have 9 columns of data. With the requirement in column 9 that there are data, the first column will dynamically fill in the current date.\nI use the formula "= ArrayFormula (IF (ISTEXT (D7), TODAY ()," "))" but the problem is that if it passes the next day it will change to the next day's date. I do not want it to change the day after the new day, what should I do?"
] | [
"google-sheets-formula"
] |
[
"WebView underneath Andengine",
"I'm trying to put a joypad made with AndEngine on a WebView that will be the view of an ipCamera. How can I do? I've searched a lot about that, but still haven't found the solution. Thank you all very much"
] | [
"layout",
"view",
"webview",
"andengine"
] |
[
"Set up a udp stream using c# with a vlc wrapper for the newest version of VLC",
"I would like to set up a udp stream in a c# WPF application using a vlc wrapper. I am unsure how exactly to do this with the newest version of vlc, as most of the posts I have seen regarding wrappers are very outdated. Does anyone have any examples or advice on how to set up a wrapper in c# so that I can transmit and receive a udp stream without using the actual VLC GUI?"
] | [
"c#",
"wpf",
"udp",
"wrapper",
"vlc"
] |
[
"oracle forms 10g not running on windows 8.1",
"In Oracle forms 10g when i click ctrl-R nothing happens the form is not displayed in my browser or anywhere although everything is correct and there's no errors. I am working on Windows 8.1 . So is anyone familiar with this issue ? how can i fix it ?"
] | [
"forms",
"oracle",
"oracle10g",
"oracleforms"
] |
[
"ActiveMQ browser needs long time for last .hasMoreElements()",
"I try to implement a queue browser for ActiveMQ.\nThe code shown below should display the text messages in the queue named 'Q1'. There are two messages in there. In general it works but the last e.hasMoreElements() call needs up to 20 seconds. I wanted to update the list every 500 millis. Why is that so slow?When i press 'update' in the browser view for http://localhost:8161/admin/browse.jsp?JMSDestination=Q1 e.hasMoreElements() returns immediately. What's going on here? How to achieve a 'realtime' view?\n\n //init:\n ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(\"tcp://localhost:61616\");\n Connection connection = connectionFactory.createConnection();\n connection.start();\n Session session = connection.createSession(true, Session.CLIENT_ACKNOWLEDGE);\n Queue queue = session.createQueue(\"Q1\");\n\n boolean run = true;\n while (run) {\n LOG.info(\"--------------------------------------------------------------------------------\");\n QueueBrowser browser = session.createBrowser(queue);\n Enumeration e = browser.getEnumeration();\n while (e.hasMoreElements()) { //<- very slow before returning false after last message. why?\n Object o = e.nextElement();\n if (o instanceof ActiveMQTextMessage) {\n LOG.info(((ActiveMQTextMessage) o).getText());\n } else {\n LOG.info(o.toString());\n }\n }\n Thread.sleep(500);\n browser.close();\n }\n\n session.close();\n connection.close();"
] | [
"java",
"activemq"
] |
[
"Error:Failed to open zip file. Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)",
"I just clone this project ImageBluring, cannot run successfully."
] | [
"android"
] |
[
"Fragment Login issues with Facebook 3.0",
"I am trying to login using a fragment in Facebook 3.0. I created an image button in my fragment which responds to an on click method as shown below :\n\n OnCreateView and OnClickView code :\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup group, Bundle saved){\n\n View v = inflater.inflate(R.layout.mefrag, group, false);\n ImageButton button = (ImageButton) v.findViewById(R.id.facebooklogin); \n button.setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n\n loginToFacebook();\n\n }\n });\n return v;\n\n}\n\n\nThe logintoFacebook method does not start the next activity. It just shows the fb dialog, accepts my details and then shows the fragment again. I tested this code in a separate activity and it works fine, i just can't figure out why it isn't working here.\n\n Facebook Login Code:\n\npublic void loginToFacebook(){\n\n Session.openActiveSession(getActivity(), true, new Session.StatusCallback() {\n\n @Override\n public void call(Session session, SessionState state, Exception exception) {\n if (session.isOpened()) {\n\n Log.d(\"LOGIN\", \"activated session\");\n // make request to the /me API\n Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {\n\n // callback after Graph API response with user object\n @Override\n public void onCompleted(GraphUser user, Response response) {\n if (user != null) {\n\n Log.d(\"LOGIN\", \"activated on complete\");\n\n fbuserid = user.getId();\n fbusername = user.getFirstName(); \n\n SharedPreferences fbDetails = getActivity().\n getSharedPreferences(\"fbDetails\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = fbDetails.edit();\n editor.putString(FB_USER, user.getFirstName());\n editor.putString(FB_ID,user.getId()); \n editor.putBoolean(\"logged in\", true);\n editor.commit();\n\n\n loginFacebookKinveyUser();\n\n\n Intent i = new \n Intent(\"com.example.chartviewer.MyArtistsActivity\");\n\n\n startActivityForResult(i, 1);\n\n }\n }\n });\n }\n }\n });\n\n}\n\n\nAny thoughts?"
] | [
"android",
"facebook",
"facebook-android-sdk"
] |
[
"How can i change the color of the tile on which the cube steps on?",
"As the title suggests, I need to change the color of the tiles as the cube moves through the level? \nIt can be seen in Adventure Cube, a game by Ketchapp\nThis is the link for further information: \nhttps://www.youtube.com/watch?v=nsP3FPSGUP4"
] | [
"unity3d",
"colors",
"tiles"
] |
[
"Azure Functions: How do I control development/production/staging app settings?",
"I've just started experimenting with Azure functions and I'm trying to understand how to control the app settings depending on environment.\n\nIn dotnet core you could have appsettings.json, appsettings.development.json etc. And as you moved between different environments the config would change.\n\nHowever from looking at Azure function documentation all I can find is that you can set up config in the azure portal but I can't see anything about setting up config in the solution?\n\nSo what is the best way to manage build environment?\n\nThanks in advance :-)"
] | [
"json",
"azure",
"visual-studio-2017",
"azure-functions",
"devops"
] |
[
"Batch Script to Rename JPEGS adding a 1 to the end",
"I have a large amount of JPEGs inside subfolders that I need to rename to their current name with an extra 1 at the end. \n\nFor example:\n\nG:\\FILENAME\\Subfolder1\\subfolder2\\JPEGNAME.JPG\n\n\nWant to rename to\n\nG:\\FILENAME\\Subfolder1\\subfolder2\\JPEGNAME1.JPG\n\n\nI have over 900 files in this format that I need to rename.\n\nAny help?"
] | [
"batch-file",
"rename",
"file-rename",
"batch-rename"
] |
[
"Knockout two-way binding to object",
"I am trying to use Knockout.js to create a two-way binding between a javascript object and some DOM elements. I want my object to reflect the changes in the DOM elements and vice versa. I successfully achieved the first goal, the vice versa part I can't get to work however.\n\nJSFiddle demo\n\nmyPerson = {\n firstName : \"\",\n lastName : \"\",\n age : null,\n test : function() {alert('Testing');}\n};\n\nmyViewModel = function myViewModel(obj) {\n this.firstName = ko.observable();\n this.lastName = ko.observable();\n this.age = ko.observable();\n this.fullName = ko.computed(function() {\n obj.firstName = (this.firstName() || '');\n obj.lastName = (this.lastName() || '');\n obj.age = (this.age() || '');\n\n return (this.firstName() || '') + ' ' + (this.lastName() || '');\n }, this);\n};\n\nko.applyBindings(new myViewModel(myPerson));\n\n\n\n //How to get property changes reflected in the DOM inputs?\n\n\nWhen I make changes in the DOM inputs the properties of the myPerson object change accordingly. Next step is changing these properties manually and automagically see these changes reflected in de DOM inputs. I tried messing around with the mapping plugin but no cigar so far."
] | [
"javascript",
"jquery",
"html",
"dom",
"knockout.js"
] |
[
"linq function fails on type conversion",
"I have a linq query with a comparison of varchar to int\n\nsoemthing = Lookups.Where(Function(lookupToSearch) lookupToSearch.ServiceFeature = \nCONST_ServiceFeature_EventLog And _ \nlookupToSearch.Name = CONST_ActivityTypeLookup_Name And _\nlookupToSearch.Value = type.ToString()).FirstOrDefault.EntityKey\n\n\nlookupToSearch.Value is varchar\ntype is an enum\n\nsome of the values in lookuptosearch are letters and they fail to convert to int.\n\nWhat is the best way to solve this problem, given that I can't change the data that is mixed letters and numbers?"
] | [
"linq"
] |
[
"allign video and canvas side by side in HTML5",
"I have a HTML file using Video Tag and canvas Tag . How can i allign them side my side with CSS. The current sample code is added here\n\nHow can i allign the Video Tag and Canvas tag side by side as in the screenshot below\n\nCurrent Screen Design :\n\n\n\nExpected Screen Design"
] | [
"html",
"css"
] |
[
"BizTalk WCF Timeout Issue",
"I have a orchestration in BizTalk which is collect to data via web services from SAP.\n\nMy process is as below.\n\n\n\nWe have a SOAP service on receive port and when we get an request from SOAP we transform it to SAP RFC File format and send it to SAP. When we try to get a response from SAP we get an error when response data is big. If response message size is so big our service get a timeout error. Otherwise there is a no problem if the message size is not big.\n\nI tried to increase timeout duration on BizTalk management console but still fails. Whatever I did, the timeout duration is always in 1 minutes. \n\nAfter Adding below XML config tags to machine.config file I get an error as below figure.\n\n\n C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Config\n\n\n<configuration>\n<system.transactions>\n <machineSettings maxTimeout=\"00:20:00\" />\n</system.transactions> \n</configuration> \n\n\n\n\nBelow image is SAP Send Port\n\n\n\nSAP Send Port Details\n\n\n\nIn the detail as you can see my time out duration about 10 hour but in SOAP UI I get an timeout error after 1 minute.\n\nBelow image is Receive Port\n\n\n\nAlso you can find biztalk event viewer error as below.\n\nA response message sent to adapter \"SOAP\" on receive port \"WebPort_SAP/MusteriFaturaT/ABC_SAP_Fatura_T_FaturaOrch_InvoiceReceivePort\" with URI \"/SAP/MusteriFaturaT/ABC_SAP_Fatura_T_FaturaOrch_InvoiceReceivePort.asmx\" is suspended. \n Error details: The original request has timed out. The response arrived after the timeout interval and it cannot be delivered to the client. \n\n\nAnd SOAPUI response screen is blank as below"
] | [
"wcf",
"soap",
"biztalk",
"saprfc"
] |
[
"Its code cannot update or insert data in to mysql db",
"$retval = mysql_query(\"\nIF EXISTS(SELECT * FROM config WHERE distance1 = '{$distance1}')\n\n UPDATE config SET distance2 = $distance2, distance3 = $distance3, totaldistance = $totaldistance, passengers = $passengers, chairwell = $chairwell, babychairs = $babychairs, companions = $ppc, luggage = $ppl, pet = $ppp, insurance = $in, stopinway = $siw where distance1 = $distance1\n\n ELSE\n\n INSERT into config(distance1, distance2, distance3, totaldistance, passengers, chairwell, babychairs, companions, luggage, pet, insurancestopinway) values('$distance1', '$distance2', '$distance3', '$totaldistance', '$passengers', '$chairwell', '$babychairs', '$ppc', '$ppl', '$ppp', '$in', '$siw')\n \");"
] | [
"mysql"
] |
[
"How to define enum values in array or enum as key in map property?",
"I am using swagger-codegen-maven-plugin (2.2.1) to generate java and typescript code class files from YML configuration. I have two questions.\n\nHow to define array of enum property in YML?\n\nHow to define map property enum as key and boolean as value in YML?\n\nLet me know is it possible or is there any workaround? Currently, I defined enum class in java and typescrtipt and pass it as string. Thanks. \n\nDataInfo:\n type: object\n properties:\n enumTest: -- works fine\n type: string\n enum:\n - one\n - two \n enumTestArray: --failing to generate code\n type: array\n items:\n type: string\n enum:\n - one\n -two \n testMap: -- works fines generate Map<String, Boolean> and { [key: string]: boolean; };\n type: object \n additionalProperties:\n type: boolean \n\n\nswagger enum doc\n\nMap Property\n\nUpdated:\n\nRelated to first question: Define array of enum property. swagger-codegen-maven-plugin generate invalid java class file as follows: Look like and issue with generating <, > and \" characters.\n\n@XmlType(name=\"List&lt;EnumTestArrayEnum&gt;\")\n@XmlEnum\npublic enum List&lt;EnumTestArrayEnum&gt; {\n\n ONE(List&lt;String&gt;.valueOf(\"&quot;one&quot;\")), TWO(List&lt;String&gt;.valueOf(\"&quot;two&quot;\"));\n\n\n private List&lt;String&gt; value;\n\n List&lt;EnumTestArrayEnum&gt; (List&lt;String&gt; v) {\n value = v;\n }\n\n public String value() {\n return value;\n }\n\n public static List&lt;EnumTestArrayEnum&gt; fromValue(String v) {\n return valueOf(v);\n }\n}"
] | [
"rest",
"api",
"yaml",
"swagger-2.0",
"swagger-codegen"
] |
[
"'ionic cordova run android' command stuck for 11 minute",
"I have two git branch, one is development and the other is lazy-load.\nI did lazy load in my lazy-load branch, but it stuck for 11 minutes after 'copy finished in 19.81 s' which case the build process too slow. \nThe development branch which is not lazy loaded, build app normally, but it takes too much time to startup. \n\nI want lazy-load branch should not take a long time in its build process. \n\nImage when i run command ionic cordova run android\n\n\nWhen it finishes building the image.\n\n\nIt seems that webpack takes 11 minutes to finish its task.\n\nWhen I run the app in the development branch, which does not have any lazy load the webpack takes 34.59 s."
] | [
"ionic-framework",
"ionic2",
"ionic3",
"webpack-2",
"ionic-cli"
] |
[
"install multiple versions of protoc on MacOS",
"I'm looking for a way to have multiple versions of protoc available on my Mac (Sierra).\n\nOn Windows I have my .exe files on the path whereas the filenames contain the version.\n\nOn Mac I found (with brew) versions 2.5, 2.6 and 3.1. If I want to have both 2.5 and 2.6 available how would I achieve that?\n\nThanks"
] | [
"homebrew",
"protocol-buffers"
] |
[
"video system didn't initialize pygame",
"I have some issue with quit the pygame\n\nwhen I am trying to close the window, it tells me Video System didn't initialized\nI don't know how to pack an image here, sorry. Error happens in line marked“!!!!!”\n\nhere is my code \n\n # PreTitleScreen\n\n# cited from http://programarcadegames.com/python_examples/\n# f.php?file=sprite_collect_blocks.py\n# the framework of this file are mostly cited from the above address\n\n\nimport pygame, configure, instructions, game\n\n# constant \nPTS_WIDTH = 1024 # pre screen width\nPTS_HEIGHT = 768 # pre Screen height\n\nclass TitleScreen():\n def __init__(self):\n self.c = configure.Configure()\n done = False\n pygame.init()\n clock = pygame.time.Clock()\n\n while not done:\n self.screen = pygame.display.set_mode([PTS_WIDTH,PTS_HEIGHT])\n pygame.display.set_caption(\"Bomberman\")\n\n # import background image\n bgImagePath = self.c.IMAGE_PATH + \"titleScreen.png\"\n bgImage = pygame.image.load(bgImagePath).convert()\n bgImage = pygame.transform.scale(bgImage,(PTS_WIDTH,PTS_HEIGHT))\n self.screen.blit(bgImage,[0,0])\n\n pygame.mixer.music.load(self.c.AUDIO_PATH + \"title.mid\")\n pygame.mixer.music.play()\n\n # pygame.display.flip()\n notValidOp = False\n # under valid control mode\n while not notValidOp:\n print(\"enter the inner loop\")\n # get mouse position \n pos = pygame.mouse.get_pos()\n # testCode\n for event in pygame.event.get(): \n # deal with the exit\n print('event.type', event.type)\n if event.type == pygame.QUIT:\n print(\"quit\")\n notValidOp = not notValidOp\n done = not done\n\n elif event.type == pygame.MOUSEBUTTONDOWN:\n print(\"get from general\",pos)\n if self.inBoundary(pos[0],pos[1],25, 500, 250, 550):\n self.playGame(\"S\")\n\n elif self.inBoundary(pos[0],pos[1],25, 550, 250, 600):\n self.playGame(\"M\")\n\n elif self.inBoundary(pos[0],pos[1],25, 600, 250, 650):\n self.instructions()\n\n elif self.inBoundary(pos[0],pos[1],25, 650, 250, 700):\n print(\"high Score\")\n print(\"get from score\",pos)\n\n elif self.inBoundary(pos[0],pos[1],40, 700, 250, 750):\n print(\"exit\")\n done = not done\n notValidOp = not notValidOp\n\n # Go ahead and update the screen with what we've drawn.\n pygame.display.flip() # !!!!!!!!!!!!!!\n\n # Limit to 60 frames per second\n clock.tick(self.c.FPS)\n\n\n def inBoundary(self,x0,y0,x1,y1,x2,y2):\n if ((x1 <= x0 <= x2) and (y1 <= y0 <= y2)):\n return True\n return False\n\n def instructions(self):\n instructions.Instructions()\n\n def playGame(self,mode):\n game.Game(mode)\n\n# pygame.init()\n# test Code below\nTitleScreen()"
] | [
"python-3.x",
"pygame"
] |
[
"Missing something in If statement argument",
"Why is this code doesn't execute the statement within the if() statement?\n\nPage has two input fields and a button. The code is:\n\nvar n = document.getElementById(\"user\").value;\n var p = document.getElementById(\"password\").value;\n\n\n document.getElementById(\"button\").onclick=function(){\n\n if(n=='abc' && p=='abc') alert('Welcome '+n);\n else \n alert('Enter the correct credentials');\n };\n\n\nAlways the alert after the else is displayed even if i enter the values abc&abc."
] | [
"javascript"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.