texts
sequence | tags
sequence |
---|---|
[
"SharePoint 2013 Page Layout Error",
"I'm really finding it difficult to set up a new theme for my SharePoint 2013 site.\nI have uploaded all other files to the design gallery. But when I uploaded the page layouts, and I try to change the Content Type to Page Layout, I get the error below:\n\n\n Sorry, something went wrong List does not exist.\n The page you selected contains a list that does not exist. It may have been deleted by another user. \n\n\nTechnical Details \nCorrelation ID: ce2b429d-0147-d0c2-bc23-32b039f7d8a6 \n\nPlease what can I do to resolve this?\n\nThanks."
] | [
"sharepoint",
"sharepoint-2013"
] |
[
"What is the closest equivalent of \"Python interpreter\" for C#?",
"Here is what I mean:\n\nPython interpreter is a great tool for checking something quickly and then throwing it away.\n\nFor instance, I wish to examine how NameValueCollection behaves in .Net (since the new MSDN help sucks so much).\n\nhttp://msdn.microsoft.com/en-us/library/system.collections.specialized.namevaluecollection.get.aspx\n\nI tried using http://www.linqpad.net/ but it barks at using statements.\n\nI am looking for something like that - a tiny IDE which has powerful code completion, where I can try things quickly. VS2008 is too bulky for that.\n\nSo, any recommendations? Thanks!"
] | [
".net",
"ide"
] |
[
"Protractor drivers stable versions?",
"What are the most stable versions of Chrome, FireFox, IE and Edge for protractor?\nI'm currently using chromedriver 78 with Chrome 78, and works fine, but FF 57 with geckodriver 19 has some fleaky behavior, I'm trying to gather info on their official website but no luck, they only mention FF 47 which I already tried but doesn't work for me, I'm trying to use IE and Edge as well.."
] | [
"javascript",
"selenium-webdriver",
"protractor"
] |
[
"starting my wpf application whenever windows starts like skype",
"I am creating wpf application using visual studio 2010 specifically for windows 7 operating system.\nNow I want my wpf app to start when ever computer starts. I googled it and wrote service but couldn't succeeded what I need. I do not know how to use that service properly or how to make one installer of both service project and wpf project ( I am new to wpf dev).\n\nthis is the code I found on msdn forum but do not know if I am using it right way - I think I am not giving right path of exe file\n\n protected override void OnStart(string[] args)\n {\n ProcessStartInfo info = new ProcessStartInfo(@\"C:\\Users\\Zeshan\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\TaskManagerPro\");\n info.CreateNoWindow = false;\n Process p = new Process();\n p.StartInfo = info;\n p.Start();\n }\n\n\nPlease guide me to the right direction and if possible kindly share some source code and also guide what is the best way to create installer."
] | [
"c#",
"wpf",
"visual-studio-2010",
"windows-services",
"installation"
] |
[
"Is there a CALDAV plugin for Eclipse Mylyn?",
"We use Zimbra at work and I'm thinking I should centralize my todo list into one thing. I'm starting to lean towards that one thing being Eclipse, given how awesome Mylyn is. Is there a remote repository plugin to Mylyn so that it can connect to CALDAV calendars / task lists?"
] | [
"eclipse",
"mylyn",
"caldav",
"zimbra"
] |
[
"How programatically we can transfer file form android mobile 2.0(API level 8) to windows PC?",
"our requirement is for API LEVEL 8 (android 2.0). In our application we have requirement of transfering file from my android phone to PC via USB.\nHere i would create user interface which can show me the file structure of windows system where i can copy the file or reverse also will do. that is transfering file from windows pc to mobile but programmatically via USB. i dont know whether i am going in right direction or not can anybody help me on that. and suggest me the right way to define the problem so i can achieve some right solution.\nThank you in advance..."
] | [
"android",
"usb",
"file-transfer"
] |
[
"Reduce HTML using Applets",
"My supervisor has tasked me with programmatically reducing a website's content by looking at the HTML tags to reveal only the core content. Importantly, this particular piece of the project must be written in Java.\n\nNow having learnt about the differences betweenPlugins, Extensions, Applets, and Widgets, I think I want to use an Extension that calls a client-side Applet. My approach was going to be this: \n\n\nUsing the Google-Chrome API, I was going to display a button that\nthe user can click.\nIf clicked, the action is to launch a new browser tab that has the\nApplet embedded within it.\nThe applet automatically sources the called tab's HTML code and\nfilters it.\nOnce filtered, the reduced copy of the original site appears.\n\n\nSo I have a few questions. To start, is it even possible to use an Extension with an Applet? Moreover, is it possible for an applet to look @ another tabs HTML code? If not, is it possible to just reload the original tab with the Applet now embedded within it and complete the function. Thanks."
] | [
"java",
"html",
"google-chrome",
"applet"
] |
[
"SQL Server database remote transfer - best method",
"I have two databases, one on a remote server the other local. (SQL Server 2008)\n\nThe database on my local server has the entire structure setup but no data. I would like to copy the data from the remote server to my server and I am wondering the best method in which to do this.\n\nThe main issue I am experiencing is the user that I have to the remote database has limited permissions. I cannot read the stored procedures, user defined functions so when I use Import/Export wizard I do not get the schema etc. So a regular dump/restore is not working for me as it restores the tables without the Primary Keys/Foreign Keys and the stored procedures.\n\nI'd like to do this,\n\nINSERT INTO localtable SELECT * FROM remotedb.table\n\n\nI was having issues because of the IDENTITY fields and I had to explicitly name all of the columns. Also I am not sure if SQL Server Management Studio allows you to use two different databases, remote and local, so I was looking for any advice. \n\nI have also tried applications like SQL FTP and Backup and it fails because it runs out of memory (I have 16GB of memory on the machine and the DB is like 4GB). I also can use the SQL Server import/export wizard but then I don't get the schema information. I also tried SQL Compare from Red Gate and it runs into issues with the permissions. Unfortunately I do not have the time to request and gain access to a new user so I was hoping someone had a creative idea."
] | [
"sql-server",
"database",
"sql-server-2008",
"database-backups"
] |
[
"How control display order in responsive design?",
"I have had lot of search on google and stackoverflow also but couldn't find a solution for this issuu.\nMy question is this that how can i control that when in browser reach to breakpoint the with left float(mainleft) goes to down of with right float(mainright)?\nThanks\n\nThis question on stackoverflow ir regarding the priority of div floating but cannot help me:\nResponsive CSS div positioning priority\n\nYou can see my issue in jsfidle in this address:\n\nhttps://jsfiddle.net/jamshidi/8ahb03qn/1/ \n\nHtml:\n\n <div class=\"maincontainer\">\n <div class=\"mainleft\">\n mainleft\n </div>\n <div class=\"mainright\">\n mainright\n </div>\n </div>\n <footer>\n <div class=\"footer-end\">\n footer\n </div>\n </footer>\n\n\nCSS:\n\n .maincontainer{\n height:auto;\n width: 700px;\n margin-top: 0px;\n margin-right: auto;\n margin-left: auto;\n margin-bottom: 0px;\n background-color: red;\n overflow: hidden; \n }\n.mainleft{\nfloat: left;\nwidth: 200px;\nheight:auto;\nbackground-color: #D0D1F9;\nmargin-top: 0px;\nmargin-right: auto;\nmargin-left: auto;\nmargin-bottom: 0px;\n}\n .mainright{\nfloat: right;\nwidth: 500px;\nheight:auto;\nbackground-color: #C4F4D6;\nmargin-top: 0px;\nmargin-right: auto;\nmargin-left: auto;\nmargin-bottom: 0px;\n}\n .footer-end{\nheight:35px;\nwidth: 700px;\nbackground-color: #bb0700;\ncolor:#fff;\npadding-right: 0px;\nmargin-top: 0px;\nmargin-right: auto;\nmargin-left: auto;\nmargin-bottom: 0px;\nclear:both;\n}\n @media screen and (max-width: 500px) {\n.mainleft{\nfloat: none;\nwidth: 100%;\nheight:auto;\nbackground-color: #D0D1F9;\nmargin-top: 0px;\nmargin-right: auto;\nmargin-left: auto;\nmargin-bottom: 0px;\n}\n .mainright{\nfloat: none;\nwidth: 100%;\nheight:auto;\nbackground-color: #C4F4D6;\nmargin-top: 0px;\nmargin-right: auto;\nmargin-left: auto;\nmargin-bottom: 0px;\n}\n\n\n}"
] | [
"html",
"css",
"responsive-design"
] |
[
"How do I exclude a folder from ASP.NET Core's static files?",
"I have a folder under \"wwwroot\" that I don't want to include when returning static files.\n\nI want to return various directories under \"wwwroot\" (for instance \"wwwroot/images\") and this middleware step enables that:\n\napp.UseStaticFiles(); \n\n\nI can pass this StaticFileOptions to configure what's returned.\n\nI want to exclude a directory (for instance \"wwwroot/node_modules\") and not allow any statif files to be served from that.\n\nThere doesn't appear to be a filter I can use on StaticFileOptions - how should I apply that filter?"
] | [
"asp.net-core",
"static-files",
"asp.net-core-middleware"
] |
[
"How do I cleanup at request end in Catalyst?",
"I'm trying to get some code called after each request completes using Catalyst. Basically, I want to run some code as part of finalize. Supposedly Catalyst::Plugin::Observe will do this, but it appears completely broken (just loading the plugin breaks Catalyst).\n\nI'm trying to fix the Observe plugin, but that's proving stubborn.\n\nSo, is there a better way to do get some cleanup code called at the end of each request?\n\n(Note: This is in a model, not a controller, so I can't just use sub end { ... })"
] | [
"perl",
"catalyst"
] |
[
"Ant If/Unless Attribute Issue",
"Forewarning, this is my first attempt at actually creating an ANT build script. I'm trying to make it so that my test target only runs if the compiled property is set to true, additionally I want my dist target to run unless the junit.failure property is set to true. But for some reason, the following code doesn't seem to be doing what I intended it to; meaning that when I try to run ant it will not execute tests as compiled is not set to true (I believe), but if I look in the bin folder I can see that the .class files were indeed generated. And consequently this means that dist will not run either as it depends on both the compile and test targets. Any thoughts or ideas on what I may be doing wrong?\n\n<project name=\"project\" default=\"dist\" basedir=\".\" xmlns:if=\"ant:if\" xmlns:unless=\"ant:unless\">\n <description>\n Build file for the project\n </description>\n <!-- set global properties for this build -->\n <property name=\"src\" location=\"src\"/>\n <property name=\"lib\" location=\"lib\"/>\n <property name=\"bin\" location=\"bin\"/>\n <property name=\"dist\" location=\"dist\"/>\n <property name=\"distDirName\" value=\"dist\"/>\n\n <!-- including the external jar files -->\n <path id=\"proj.classpath\">\n <fileset dir=\"${lib}\" includes=\"*.jar\"/>\n <pathelement location=\"${bin}\"/>\n </path>\n\n <target name=\"compile\" description=\"compile the source\">\n <!-- Create the distribution directory -->\n <mkdir dir=\"${bin}\"/>\n <!-- Compile the java code from ${src} into ${bin} -->\n <javac srcdir=\"${src}\" classpathref=\"proj.classpath\" destdir=\"${bin}\"/>\n <!-- Set condition for dependent target -->\n <condition property=\"compiled\">\n <and>\n <available file=\"**/SampleTest.class\"/>\n <available file=\"**/DBConnection.class\"/>\n </and>\n </condition>\n </target>\n\n <target name=\"test\" depends=\"compile\" if=\"compiled\">\n <junit failureproperty=\"junit.failure\" errorproperty=\"junit.failure\" printsummary=\"withOutAndErr\" fork=\"yes\" haltonfailure=\"true\" haltonerror=\"true\">\n <formatter type=\"xml\"/>\n <test name=\"this.one.dir.SampleTest\" todir=\"${bin}\"/>\n <classpath refid=\"proj.classpath\"/>\n </junit>\n </target>\n\n <target name=\"dist\" depends=\"compile,test\" unless=\"junit.failure\" description=\"generate the distribution\">\n <!-- Create the distribution directory -->\n <mkdir dir=\"${dist}\"/>\n\n <!-- Put everything in ${bin} into the distribution.jar file -->\n <jar jarfile=\"${dist}/distribution.jar\" basedir=\"${basedir}\" excludes=\"**/test/,${distDirName}/**\"/>\n </target>\n</project>"
] | [
"java",
"ant",
"build",
"compilation",
"target"
] |
[
"on Android configuration changed Application is restarting",
"I am newbie to android development. I am writing an application and my requirement is when the orientation changes the application does not restart. Below is the sample application which i am testing in the samsung galaxy duos mobile.\n\nI'm using the 4.0.4 Android OS Version, and my application is developed under API level 8.\n\nI tried with the following methods:\n\nandroid:configChanges=\"orientation|keyboard|keyboardHidden\"\nandroid:configChanges=\"orientation|keyboard\"\nandroid:configChanges=\"orientation\"\nandroid:configChanges=\"keyboard|keyboardHidden\"\nandroid:configChanges=\"orientation|keyboardHidden\"\n\n\nPlease Help me\n\npublic class MainActivity extends Activity {\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n Toast.makeText(getApplicationContext(), \"this is starting\",Toast.LENGTH_LONG).show(); \n } \n @Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.activity_main, menu);\n return true;\n }\n\n @Override\n public void onConfigurationChanged(Configuration newConfig) {\n super.onConfigurationChanged(newConfig);\n\n if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT)\n {\n Toast.makeText(this, \"portrait\", Toast.LENGTH_SHORT).show();\n //setContentView(R.layout.activity_main);\n }\n if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE)\n {\n Toast.makeText(this, \"landscape\", Toast.LENGTH_SHORT).show();\n //setContentView(R.layout.activity_main );\n } \n }\n\n\n}\n\n\nand my mainfest file\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"com.example.orientationtest\"\n android:versionCode=\"1\"\n android:versionName=\"1.0\" >\n\n <uses-sdk\n android:minSdkVersion=\"8\"\n android:targetSdkVersion=\"15\" />\n\n <application\n android:icon=\"@drawable/ic_launcher\"\n android:label=\"@string/app_name\"\n android:theme=\"@style/AppTheme\" >\n <activity\n android:name=\".MainActivity\"\n android:label=\"@string/title_activity_main\" \n android:configChanges=\"orientation|keyboard|keyboardHidden\">\n <intent-filter>\n <action android:name=\"android.intent.action.MAIN\" />\n\n <category android:name=\"android.intent.category.LAUNCHER\" />\n </intent-filter>\n </activity>\n </application>\n</manifest>"
] | [
"android"
] |
[
"How to fix the border pixel of the android ImageView",
"Initially the image is:\n\n\nNow when I swipe this image the border pixels gets disturbed as:\n\n\nFor anti-aliasing issues I have used Displaying a small png (drawable) in a larger ImageView answer, but the border pixels looks similar. I have searched on the Google but can't find the appropriate solution.\n\nNote: For swiping the image I am using https://github.com/Diolor/Swipecards"
] | [
"android",
"android-imageview",
"android-xml",
"android-ui"
] |
[
"How to update an NSManagedObject whenever a specific attribute is changed?",
"Imagine I have a Core Data object, Product. Each Product has a quantity, price, and total attribute. Total is there for efficiency when retrieving items from the table. (I understand that there may be an efficient way to get the computed value using fetched properties, but this is only an example, and that answer is not what I am looking for.)\n\n+------+----------+-------+-------+\n| Name | Quantity | Price | Total |\n+------+----------+-------+-------+\n| Foo | 1 | 20 | 20 |\n| Bar | 0 | 30 | 0 |\n| Baz | 3 | 5 | 15 |\n+------+----------+-------+-------+\n\n\nAssume that the price of a product never changes. However, the quantity does change. Whenever the quantity changes, I would like to be notified so that I can recompute the total. I would like to avoid using KVO if possible because I have a custom NSManagedObject class, product, and I would like to override one of its methods in order to update the price and not have to worry about registering/unregistering for notifications on its own attributes.\n\nThis method should only be called when the price is changed, not every time any of the attributes on the object has changed.\n\nI would also like this method to be triggered right when the value is changed (e.g. not right before the context is saved), so that I can access the new total attribute before the context is saved.\n\nWhich method should I override and can it be done in a category on my Product class?\n\n\n\nNote: this question is similar but is mainly concerned with running more than one thread, which may require more complicated answers. I am looking for something simple, on a single thread."
] | [
"core-data",
"nsmanagedobject"
] |
[
"Spring MVC Multi module Property Source failure",
"enter image description hereSpringMVC with javaconfig PropertySource failed in same module what should I do\ncode below :\n@Configuration\n@Import(ContextMyBatis.class)\n@PropertySource("/properties/datasource.properties")\npublic class ContextDatabase {\n @Value("${datasource.driverClass}")Class<? extends Driver> driver;\n @Value("${datasource.username}") String user;\n @Value("${datasource.password}") String password;\n @Value("${datasource.url}") String URL;\n [enter image description here][1]....\n}"
] | [
"spring",
"maven",
"properties",
"spring-test",
"multi-module"
] |
[
"How to send Form Input field into JSON Format using Jquery Ajax",
"I want to send data on the controller into JSON format. but getting into a string. so can I do this?\nI used header that is being passed on ajax call but it not converting Form filed into JSON format .\ndue to string format Laravel not able to process this response.\n\n\n My Browser Response.\n \n \n HTML Code\n\n\n <form id=\"NoeticeBoardGetAllFrm\" name=\"NoeticeBoardGetAllFrm\" role=\"form\" method=\"post\" >\n <div class=\"row\">\n <div class=\"col-sm-6\">\n <label> URL </label>\n <input type=\"text\" name=\"NoeticeBoardGetAllUrl\" id=\"NoeticeBoardGetAllUrl\"\n class=\"form-control\" placeholder=\"URL\"\n value=\"https://XXXXXXXXXXXX/get-all-notice-board-information\"/>\n </div>\n\n <div class=\"col-sm-4\">\n <label> Session Code </label>\n <input type=\"text\" name=\"scode\" id=\"scode\" class=\"form-control\"\n value=\"cFZnMVJUY0JNUUJsTXZBeVZhZmRHZz09\"\n maxlength=\"50\" minlength=\"32\" placeholder=\"Session Code\"/>\n </div>\n </div>\n <br>\n <div class=\"row\">\n <div class=\"col-sm-2\">\n <input type=\"submit\" name=\"NoeticeBoardGetAllBtn\" id=\"NoeticeBoardGetAllBtn\"\n class=\"btn btn-danger \" value=\"Get Result\" />\n </div>\n <div class=\"col-sm-3\"> <i class=\"fa fa-reddit-square\"></i>\n <span class=\"inLine\">Result :</span>\n <div id=\"NoeticeBoardGetAllResult\" class=\"inLine result_box\">---</div>\n </div>\n </div>\n </form>\n\n\nMy Javascript Code\n\n $(\"#NoeticeBoardGetAllFrm\").submit(function(e) {\n e.preventDefault();\n\n console.log( new FormData(this));\n $.ajax({\n url: $(\"#NoeticeBoardGetAllUrl\").val(),\n type: 'POST',\n headers: {'Accept': 'application/json','Content-Type': 'application/json',\n 'DBAuth': $(\"#DBAuth\").val(),'Authorization': $(\"#Authorization\").val(),},\n dataType: 'json',\n data: new FormData(this),\n cache: false,\n contentType: false,\n processData: false,\n success: function (data) {\n if (data.error == 0) {\n $(\"#NoeticeBoardGetAllResult\").html(\"Record fetched successfully!\");\n $(\"#NoeticeBoardGetAllResult\").addClass(\"alert alert-success\");\n\n } else {\n $(\"#NoeticeBoardGetAllResult\").html(data.errmsg);\n $(\"#NoeticeBoardGetAllResult\").addClass(\"alert alert-warning\");\n }\n }, statusCode: {\n 500: function (data) {\n $(\"#NoeticeBoardGetAllResult\").html(\"Something went wrong!\");\n $(\"#NoeticeBoardGetAllResult\").addClass(\"alert alert-danger\");\n },\n 401: function (data) {\n $(\"#NoeticeBoardGetAllResult\").html(\"Login Failed\");\n $(\"#NoeticeBoardGetAllResult\").addClass(\"alert alert-danger\");\n }\n }\n });\n setTimeout(function(){ resetResult(); }, 3000);\n });"
] | [
"php",
"json",
"ajax",
"laravel",
"jquery-ajaxq"
] |
[
"Google Drive Share access to other email address for oAuth 2 using API",
"Is it possible to share google drive access of other email address using oAuth2 and javascript client API?\n\nIf I have both of other's emailaddress and password?\nIf using Service account?\n\nI just want to create an app that will allow other Google Signed In users to see and manage my files and directories.\n\nLet me know what is your idea, best practices, steps on this. Thanks"
] | [
"google-api",
"google-drive-api",
"google-oauth",
"google-docs-api"
] |
[
"Problems using literals and codeblocks with c# to interact with powershell 2.0",
"If I try to run a Powershell Command through c# I get the following error:\n\"The term 'select' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.\"\n\nIf the Command was executed directly with Powershell(.exe) all works fine!\n\nThe command I try to run looks like i.g:\n\"Get-Mailbox -Organization 'CoolOrganizationNameGoesHere' | select ServerName\"\n\nIt seems that there is a problem with the \"Pipe\" |, \nI have wasted hours on searching at major search engines with the wildest keyword combinations, \nbut I've found nothing that works.\n\nThe last thing I have tried is setting the PSLanguageMode property of the published IIS-Application for Powershell, The result is still the same as written before.\n\nMaybe there is WinRM wrong configured? Or my local Powershell configuration is corrupted?\nIs there any well written documentation on C# (or any other .Net language) using Powershell with remote access\nand using the Pipe | \"command\"?\n\nCan anybody tell me what is wrong, that's like to find the needle in a haystack!\n\nThanks!"
] | [
"c#",
"pipe",
"powershell-2.0",
"powershell-remoting",
"cmdlets"
] |
[
"AWS CLI DynamoDB Called From Powershell Put-Item fails when a value contains a space",
"So, let's say I'm trying to post this JSON via the command line (not in a file because I'm not going to write a file for every invocation of this script) to a dynamo DB table\n{\\"TeamId\\":{\\"S\\":\\"One_Space_123\\"},\\"TeamName\\":{\\"S\\":\\"One_Space\\"},\\"Environment\\":{\\"S\\":\\"cte\\"},\\"StartDate\\":{\\"S\\":\\"null\\"},\\"EndDate\\":{\\"S\\":\\"null\\"},\\"CreatedDate\\":{\\"S\\":\\"today\\"},\\"CreatedBy\\":{\\"S\\":\\"someones user\\"},\\"EmailDistributionList\\":{\\"S\\":\\"[email protected]\\"},\\"RemedyGroup\\":{\\"S\\":\\"OneSpace\\"},\\"ScomSubscriptionId\\":{\\"S\\":\\"guid-ab22-2345\\"},\\"ZabbixActionId\\":{\\"S\\":\\"11\\"},\\"SnsTopic\\":{\\"M\\":{\\"TopicName\\":{\\"S\\":\\"ATopicName\\"},\\"TopicArn\\":{\\"S\\":\\"AtopicArn1234\\"},\\"CreatedDate\\":{\\"S\\":\\"today\\"},\\"CreatedBy\\":{\\"S\\":\\"someones user\\"}}}}\n\nThen the result from the CLI is one like this:\nUnknown options: Space"},"ScomSubscriptionId":{"S":"guid-ab22-2345"},"ZabbixActionId":{"S":"11"},"SnsTopic":{"M":{"TopicName":{"S":"ATopicName"},"TopicArn":{"S":"AtopicArn1234"},"CreatedDate":{"S":"today"},"CreatedBy":{"S":"someones, user"}}}}, user"},"EmailDistributionList":{"S":"[email protected]"},"RemedyGroup":{"S":"One\n\nAs you can see, it fails on the TeamName property that in the above example is "One Space". If I change that value to "OneSpace" then instead it starts to fail on the "CreatedBy" property that is populated by "someones user" but if I remove all spaces from all properties I can suddenly pass this json to dynamoDB successfully.\nIn a working example the json looks like this:\n{\\"TeamId\\":{\\"S\\":\\"One_Space_123\\"},\\"TeamName\\":{\\"S\\":\\"One_Space\\"},\\"Environment\\":{\\"S\\":\\"cte\\"},\\"StartDate\\":{\\"S\\":\\"null\\"},\\"EndDate\\":{\\"S\\":\\"null\\"},\\"CreatedDate\\":{\\"S\\":\\"today\\"},\\"CreatedBy\\":{\\"S\\":\\"someonesuser\\"},\\"EmailDistributionList\\":{\\"S\\":\\"[email protected]\\"},\\"RemedyGroup\\":{\\"S\\":\\"OneSpace\\"},\\"ScomSubscriptionId\\":{\\"S\\":\\"guid-ab22-2345\\"},\\"ZabbixActionId\\":{\\"S\\":\\"11\\"},\\"SnsTopic\\":{\\"M\\":{\\"TopicName\\":{\\"S\\":\\"ATopicName\\"},\\"TopicArn\\":{\\"S\\":\\"AtopicArn1234\\"},\\"CreatedDate\\":{\\"S\\":\\"today\\"},\\"CreatedBy\\":{\\"S\\":\\"someonesuser\\"}}}}\n\nI can't find any documentation that tells me I can't have spaces, if I read this in from a file it will post it with the spaces, so what gives? If anyone has any advice on this matter, I certainly appreciate it.\nFor what it's worth in Powershell the execution looks like this currently (though I've tried various combinations of quoting the $dbTeamTableEntry variable\n $dbEntry = aws.exe dynamodb put-item --region $region --table-name $table --item "$($dbTeamTableEntry)""
] | [
"amazon-web-services",
"powershell",
"amazon-dynamodb"
] |
[
"How do I tell hyperjaxb3 what to use as primary key?",
"I'm working on a project to import a bunch of xml into a mysql database. I found the tool hyperjaxb3 that works as a maven plugin and generates jpa / jaxb annotated java classes that I can use to marshal xml and suck it in, but it creates its own primary key field. How do I get rid of that in favor of a field that exists in the schema?"
] | [
"hyperjaxb"
] |
[
"Opengl, Ruby, glBlendFunc: place transparent images on top of each others as if it was opaque",
"I'm not sure if glBlendFunc is the great function to resolve my problem, but I think that I'll need it! Here is my problem: \n\n\n\nYou see the two pine trees' reflects on the right? I'd like to have something like that:\n\n\n\nThen, I need a method which is doing the same display than for an opaque image, but with transparent image. Is there a special combination in the glBlendFunc, or should I proceed by other means?"
] | [
"ruby",
"opengl",
"transparent",
"glblendfunc"
] |
[
"Cannot install tweepy on Rasbian with sudo pip install",
"I am trying to make a Twitter app with my Pi but when I try the command\n\nsudo pip install tweepy\n\n\nI get greeted by the following error:\n\nAttributeError: 'NoneType' object has no attribute 'skip_requirements_regex'\n----------------------------------------\nCommand python setup.py egg_info failed with error code 1 in /home/pi/build/tweepy\n\n\nAny suggestions? This also happens if I try to install directly from GitHub"
] | [
"python",
"raspberry-pi",
"tweepy"
] |
[
"insert into. while loop, mysql",
"I'm new one in php, and I have a question. \n\n $result = mssql_query('stored proc. with some parameters');\n\n while ($row = mssql_fetch_row($result)){\n mysqli_query('INSERT INTO dbname VALUES ($row[0], $row[1], ... , $row[15] );') or die ('Insertion mistake.');\n }\n\n\nThe problem is, I've got die() exception after ~430 insertions. The size of $result query can be up to 100.000 results. I cannot access the MS base and touch stored procedures, and this data transfer in needable. Can somebody help me, with a solution, or show the place, I can read more about that kind of problem?"
] | [
"php",
"mysql"
] |
[
"What is the limit of the Value Type BigInteger in C#?",
"As described in MSDN BigInteger is :\n\n\n An immutable type that represents an arbitrarily large integer whose\n value in theory has no upper or lower bounds.\n\n\nAs I can see BigInteger is a ValueType, as much as I know, a ValueType must have a maximum size of 16 bytes.\n\nMSDN goes further saying : \n\n\n an OutOfMemoryException can be thrown for any operation that causes a\n BigInteger value to grow too large.\n\n\nand more :\n\n\n Although this process is transparent to the caller, it does incur a\n performance penalty. In some cases, especially when repeated\n operations are performed in a loop on very large BigInteger values\n\n\nHow could it store such big values, as big as double.MaxValue + double.MaxValue ?\nI was told that it has ReferenceType obejects inside it, but all I can find here in its definition in VisualStudio is ValueTypes.\n\nWhat's its real limit ? And even if doesn't have one, how can it \"as a value type\" manage to store all that amount of data ?"
] | [
"c#",
".net",
"numerical",
"value-type"
] |
[
"Python 3.8 multiprocessing for copying the random on MacOS",
"from multiprocessing import Pool, cpu_count\nimport numpy as np\nfrom numpy.random import multivariate_normal\n\nF = multivariate_normal(np.zeros(3), np.eye(3), (3, 5))\n\ndef test(k):\n print(k)\n res = np.zeros((5, 3))\n for i in range(3):\n res[:, i] = F[k, :, i]\n #print(res[:, i])\n return res\n\n\nif __name__ == '__main__':\n with Pool(cpu_count()) as pool:\n result = pool.map(test, range(3))\n pool.close()\n pool.join()\n result = np.array(results)\n\nIn python3.6, the result is equal to the random matrix F. But their two matrices are different in python 3.8. This is just an example. In the real code, I want to pick up each column of F in each time step and do some operations on it."
] | [
"python",
"python-3.x",
"numpy",
"random",
"multiprocessing"
] |
[
"Return object with 2 optional ctors in function",
"I have function in c++ with 2 optional c'tor of an object I've built (one with something in vector \"vals\" and other without).\n\n...\n RecievedMessage a(sc, type);\n if (!vals.empty()){\n //a.~RecievedMessage();\n RecievedMessage a(sc, type, vals);\n }\n return &a;\n}\n\n\nthe line in // is optional.\n\nWould it work (with or without the optional line)? Why? If no, how to fix it without setter for \"vals\"?\nthanks a lot."
] | [
"c++",
"function",
"object",
"constructor",
"return"
] |
[
"Moving image through screen react native",
"I have an splashpage that leads to a loginpage. The splashpage is only visible for 1000ms and it has an image in the center of the screen, i want this image to move during the 1000ms to the top so where the loginpage comes in the image is in the top and the login information appears in the center. \nAny idea how could i do that? \nThanks."
] | [
"reactjs",
"native"
] |
[
"Dynamically Set SubForm Validators from the Parent component",
"I've been creating reuseable subforms in Angular 8, and using the FormGroupDirective to get a reference of the parent FormGroup for the child is quite easy to accomplish, but I'm having a hard time figure out how to dynamically set the validators on the child form from the parent.\n\nUsing ngAfterViewInit I can see the form controls of the child forms have been added to the parent, but I can't seem to update the default child form validators directly from the parent. \n\n// PARENT COMPONENT\npublic ngAfterViewInit() {\n // Form controls have been applied to the form group\n console.log('ngAfterViewInit', this.form.value);\n\n // BUT the validators of profile form aren't being set?\n this.form.get('profile').get('description').setValidators([Validators.required]);\n}\n\n\nI created a StackBlitz of my example code. All the fields except the profile description is a required field and has a default value. So without any changes being made to the validators the form will pass validations on submission and output VALID in the console. In ngAfterViewInit I set the description fields validator to be required, which should prevent the form from being submitted and output INVALID in the console, but it still submits and outputs VALID.\n\nIs it possible to dynamically set the validators of a subform without passing them in via @Input bindings?"
] | [
"angular",
"angular-reactive-forms",
"angular-forms",
"angular-validation"
] |
[
"Why is foreach loop Read-Only in C#",
"Why is foreach loop a read only? I mean you can fetch the data but can't increase++ or decrease--. Any reason behind it? \nYes I am a beginner :)\n\nExmaple:\n\nint[] myArray={1,2,3};\nforeach (int num in myArray)\n{\n num+=1;\n}"
] | [
"c#",
"loops"
] |
[
"Is there a proposed CSS3 “soft floating” property?",
"Does anyone have any idea if there is anything planned in the html5 or CSS3 spec regarding the floating of elements.\n\nI titled this question \"soft floating\" as I'm interested in the idea of giving a group of elements css properties something like the following...\n\nimagine if you will a styled list of images...\n\n<ul>\n<li><img src='1.jpg'></li>\n<li><img src='2.jpg'></li>\n<li><img src='3.jpg'></li>\n<li><img src='4.jpg'></li>\n<li><img src='5.jpg'></li>\n<li><img src='6.jpg'></li>\n<li><img src='7.jpg'></li>\n<li><img src='8.jpg'></li>\n<li><img src='9.jpg'></li>\n</ul>\n\n\nand styled with:-\n\nul{\nlist-style:none;\n}\nli{\nfloat:left;\n}\n\n\nimagine the images are of fairly random heights, say between 50 and 100 pixels high.\n\nCurrently floating these left might result in one or more of the images snagging, resulting in the rest of the floats also being out of place ( visually, but not actually wrong as far as browser rendering is concerned).\n\nI'm wondering if there might be any kind of proposal or attribute for some kind of \"soft floating\" whereby elements pushed out by the right hand extent of the floated element(s) container would be effectively carriage returned/cleared past the bottom edge of all preceeding floated elements.\n\nWow. Does any of that make any sense whatsoever...?"
] | [
"html",
"css",
"element",
"css-float"
] |
[
"How can I use EventMachine from within a Sinatra app?",
"I use an api, that is written on top of EM. This means that to make a call, I need to write something like the following:\n\nEventMachine.run do\n api.query do |result|\n # Do stuff with result\n end\n EventMachine.stop\nend\n\n\nWorks fine.\n\nBut now I want to use this same API within a Sinatra controller. I tried this:\n\nget \"/foo\" do\n output = \"\"\n EventMachine.run do\n api.query do |result|\n output = \"Result: #{result}\"\n end\n EventMachine.stop\n end\n output\nend\n\n\nBut this doesn't work. The run block is bypassed, so an empty response is returned and once stop is called, Sinatra shuts down.\n\nNot sure if it's relevant, but my Sinatra app runs on Thin.\n\nWhat am I doing wrong?"
] | [
"ruby",
"sinatra",
"eventmachine"
] |
[
"Python reload, and IPython autoreload as well, is not working",
"I am using Python + IPython for Data Science. I made a folder that contains all the modules I wrote, organised in packages, something like\n\npython_workfolder\n|\n|---a\n| |---__init__.py\n| |---a1.py\n| |---a2.py\n|\n|---b\n| |---__init__.py\n| |---b1.py\n| |---b2.py\n|\n|---c\n| |---__init__.py\n| |---c1.py\n| |---c2.py\n|\n|\n|---script1.py\n|---script2.py\n\n\nAt the beginning of each session I ask IPython to autoreload modules:\n\n%load_ext autoreload\n%autoreload 2\n\n\nNow... let's say a1.py contains a class, A1, that I want to call from one of the scripts. In the __init__.p of package a I import the module\n\nimport a1\n\n\nThen in the script I import the class I need\n\nfrom a.a1 import A1\n\n\nIf there is some error in class A1 and I modify it, there is no way to have Python reload it without restarting the kernel.\n\nI tried with del a1, del sys.modules['a1'], del sys.modules['a']. Each time it uses the old version of the class until I don't restart the kernel... anyone can give me some suggestions?"
] | [
"python",
"python-3.x",
"ipython",
"pyzo"
] |
[
"How to get data from rest api which has basic authentication?",
"I'm trying to get data from this website through HTTP get method. This website has basic authentication. The data is in JSON format. \nThis is the rest api website:\n(https://shoploapi.herokuapp.com/sellers)\n\n\r\n\r\n// Code goes here\r\nangular.module('myapp', ['myapp.controller']);\r\n\r\nangular.module('myapp.controller', ['myapp.service'])\r\n .controller('testController', function($scope, testService) {\r\n\r\n $scope.posts = {};\r\n\r\n function GetAllPosts() {\r\n var getPostsData = testService.getPosts();\r\n\r\n getPostsData.then(function(post) {\r\n $scope.posts = post.data;\r\n\r\n }, function() {\r\n alert('Error in getting post records');\r\n });\r\n }\r\n\r\n GetAllPosts();\r\n });\r\n\r\nangular.module('myapp.service', [])\r\n .service('testService', function($http) {\r\n\r\n //get All NewsLetter\r\n this.getPosts = function() {\r\n return $http.get('https://shoploapi.herokuapp.com/sellers');\r\n };\r\n });\r\nangular.module('myApp', ['base64'])\r\n .config(function($httpProvider, $base64) {\r\n var auth = $base64.encode(\"bhupendra7:ice123age456\");\r\n $httpProvider.defaults.headers.common['Authorization'] = 'Basic ' + auth;\r\n });\r\n<!DOCTYPE html>\r\n<html>\r\n\r\n<head>\r\n <script data-require=\"[email protected]\" data-semver=\"1.5.0\" src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js\"></script>\r\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/angular-base64/2.0.5/angular-base64.js\"></script>\r\n <link rel=\"stylesheet\" href=\"style.css\">\r\n <script src=\"script.js\"></script>\r\n</head>\r\n\r\n<body ng-app=\"myapp\">\r\n <h1>Hello Plunker!</h1>\r\n <div ng-controller=\"testController\">\r\n <div>\r\n <ul>\r\n <li ng-repeat=\"post in posts\">\r\n {{post.careof}} {{post.district}} {{post.gender}} {{post.name}}\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n</body>\r\n\r\n</html>\r\n\r\n\r\n\n\nHere's the link to my Plunker:\n\n(https://plnkr.co/edit/7pqljm?p=preview)\n\nCan anyone help?"
] | [
"javascript",
"angularjs",
"rest",
"restful-authentication"
] |
[
"dtype: integer, but loc returns float",
"I have a weird data set:\n\n year firms age survival\n0 1977 564918 0 NaN\n2 1978 503991 0 NaN\n3 1978 413130 1 0.731310\n5 1979 497805 0 NaN\n6 1979 390352 1 0.774522\n\n\nwhere I have cast the dtype of the first three columns to be integer:\n\n>>> df.dtypes\nyear int64\nfirms int64\nage int64\nsurvival float64\n\n\nBut now I want to search in another table based on an index here:\n\nidx = 331\notherDf.loc[df.loc[idx, 'age']]\nTraceback (most recent call last):\n(...)\nKeyError: 8.0\n\n\nThis comes from \n\ndf.loc[idx, 'age']\n8.0\n\n\nWhy does this keep returning a float value? And how can I perform the lookup in otherDf? I'm in pandas version 0.15."
] | [
"python",
"pandas",
"dataframe",
"types"
] |
[
"Nested Overloading of '<<' within Multiple Typedefs",
"This code compiles and runs in CLion 1.2.4, however the GUI is indicating errors (via red underline) with the output nesting involving std::ostream, noted below. This is meant to work with std:cout, and it does so far.\n\nPoint is a point (a vector) in k-dimenional space.\n\nCluster is a set of these points (a linked list).\n\nClusters is a set of clusters (a vector).\n\nWhen I replace the typedefs with the parent class (std::vector<double> for Point) the indicated error persists.\n\nIs there rationale for this error being misreported?\n\ntypedef std::vector<double>Point;\ntypedef std::list<Point>Cluster;\ntypedef std::vector<Cluster>Clusters;\n\nstd::ostream& operator<< (std::ostream& os, Point& v) {\n if ( !v.empty() ) {\n os << v[0];\n for(ctr_type i = 1; i < v.size(); ++i)\n os << \", \" << v[i];\n }\n return os;\n}\n\nstd::ostream& operator<< (std::ostream& os, Cluster& v) {\n if ( !v.empty() ) {\n for(Cluster::iterator iter = v.begin(); iter != v.end(); iter++) {\n os << \"\\n\";\n os << *iter; // Error: Binary operator '<<' can't be applied to the expressions of type 'ostream' and 'Point'\n }\n }\n return os;\n}\n\nstd::ostream& operator<< (std::ostream& os, Clusters& v) {\n if ( !v.empty() ) {\n for(Clusters::iterator iter = v.begin(); iter != v.end(); iter++) {\n os << *iter; // Error: Binary operator '<<' can't be applied to the expressions of type 'ostream' and 'Cluster'\n }\n }\n return os;\n}\n\n\nEDIT: Adding screenshots as requested by Quuxplusone.\n\n\n\n\n\nAdditionally, the majority of the bug reports surrounding this issue appear to revolve around strings."
] | [
"c++",
"overloading"
] |
[
"Cannot retrieve data from Active Directory",
"I created a new Blazor application with Azure AD authentication. Login functionality works as expected. Now I need to retrieve a list of users of a particular group. On Azure AD, I created a Client Secret. Also, I added Microsoft.Graph permissions Directory.Read.All, Group.Read.All, and\nGroupMember.Read.All, and granted admin consent for the permissions.\nHere are the permissions:\n\nHere is my code I use to retrieve the users of a group:\n var scopes = new string[] { "https://graph.microsoft.com/.default" };\n var confidentialClient = ConfidentialClientApplicationBuilder\n .Create(_adSettings.ClientId)\n .WithAuthority($"{_adSettings.Instance}/{_adSettings.TenantId}/ v2.0")\n .WithClientSecret(_adSettings.ClientSecret)\n .Build();\n\n GraphServiceClient graphServiceClient = new GraphServiceClient(new DelegateAuthenticationProvider(async (requestMessage) => {\n // Retrieve an access token for Microsoft Graph (gets a fresh token if needed).\n var authResult = await confidentialClient.AcquireTokenForClient(scopes).ExecuteAsync();\n\n // Add the access token in the Authorization header of the API\n requestMessage.Headers.Authorization =\n new AuthenticationHeaderValue("Bearer", authResult.AccessToken);\n }));\n\n var members = await graphServiceClient.Groups["[email protected]"]\n .Members\n .Request()\n .GetAsync();\n\nThe last statement throws an exception:\n\nAn error occurred sending the request. HttpStatusCode: 404: NotFound\n\nI tried to replace it with\nvar users = await graphServiceClient.Users.Request().GetAsync();\n\nBut result was the same."
] | [
"azure-active-directory",
"blazor-server-side"
] |
[
"Upload Node Request-Response Response To MongoDB",
"I'm playing around with Cheerio in Node. I have a scraper that goes to a list of articles, grabs all the article URLS, and then goes to each article and scrapes the title and url. Everything works fine, except when I try to upsert the results to my Mongodb, I get undefined.\n\nI'm assuming it's trying to upsert before the values are defined... But even using Request-Response I can't get it working. Any help would be greatly appreciated! Since the code isn't too long, I'll just paste the whole thing so it's easier to see what I'm trying to do. Again, the main issue is getting upsertArticle to actually upsert the variables.\n\nconst request = require('request');\nconst cheerio = require('cheerio');\nconst rp = require('request-promise');\nconst mongoose = require('mongoose');\nconst Article = require('./models/article');\n\nvar urls = [];\n//get the list of articles to scrape\nrp('https://www.somesite.com/', function(error, response, html) {\n if (!error && response.statusCode == 200) {\n var $ = cheerio.load(html);\n $('.c-entry-box--compact__title').each(function(i, element) {\n var a = $(this);\n urls.push(a.children().attr('href'));\n }); } })\n //scrape over each article individually\n .then(function(getStuff) {\n var arrayLength = urls.length;\n //get the list of articles to scrape and upsert each one\n for (var i = 0; i < arrayLength; i++) {\n const result = rp(urls[i], function(error, response, html) {\n if (!error && response.statusCode == 200) {\n var $ = cheerio.load(html);\n var parsedResults = [];\n $('.l-main-content').each(function(n, element) {\n var a = $(this);\n var title = a.find('.c-page-title').text();\n var url = response.request.uri.href;\n //I also tried upserting the variables right here, that didn't work\n return { title, url };\n });\n } else {console.log(error);}\n }).then(function(upsertStuff) {\n //also tried returning and upserting stuff here... but nothing gets upserted\n upsertArticle({\n title: result.title,\n source: result.url,\n dateCrawled: new Date()\n });\n console.log('Upserted ' + result.title);\n }).catch(function(err) {console.log(err); }); }\n }) .catch(function(err) {console.log(err); });\n\nfunction upsertArticle(userObj) {\n const DB_URL = 'mongodb://localhost/articles';\n if (mongoose.connection.readyState == 0) {\n mongoose.connect(DB_URL, {\n useMongoClient: true\n });\n }\n let conditions = {\n title: userObj.title\n };\n let options = {\n upsert: true,\n new: true,\n setDefaultsOnInsert: true\n };\n Article.findOneAndUpdate(conditions, userObj, options, (err, result) => {\n if (err) throw err;\n });\n}"
] | [
"javascript",
"node.js",
"mongodb",
"response",
"cheerio"
] |
[
"Heroku Java \"JVM Common app detected\" and not \"Executing Maven\"",
"I struggled to figure out this issue myself and Heroku support is only for non-free accounts. They direct me to post it as a question ... but I now know the answer. Hoping that posting it here helps someone in the future.\nI had used the Heroku Maven plugin at first because I thought it would be neat to just click the run configuration in my IDE and have it do the deployment. However, I then noticed the downside of it uploading the entire large deployment jar each time. This wasn't the effect that I wanted. So, then I switched to using git. However, it was not doing the maven build on the server when I did the "git push". I went through all of their examples and went round and round through so many guesses. Then I finally got a little smarter and copied my app code into a new folder and created a new heroku app directly from it. And it worked. It did the maven build. I noticed that what it was saying right before when it was working was "Java app detected" whereas when the original wasn't working it was saying "JVM Common app detected"."
] | [
"java",
"git",
"maven",
"heroku"
] |
[
"Are paypal direct payments supported in australia?",
"Does paypal direct payment api support transactions between individuals that reside in australia.What countries does it support."
] | [
"paypal",
"paypal-ipn",
"paypal-sandbox"
] |
[
"Accessing a .net application GUI",
"I need to access a .net application which has no public COM or API. Apparently the only means of access is Forms GUI.\n\nBasically, I need to simulate users filling and submitting a form. Enter text here, something else there, and submit.\n\nWe have a \"click at this position and simulate typing this text\" kind of robot, but it doesn't handle new versions of the form well.\n\nIs it possible to interact with such a GUI (or application?) in a programmatic way which doesn't rely on exact position of components? Ideally, something like: \"Type bla-bla-bla into Address field and click the Submit button\"."
] | [
".net",
"winforms",
"user-interface",
"robot"
] |
[
"Adding default Columns Automatically with Code First Migrations using Entity Framework Core",
"I have an requirement to add default columns to the models when i run the migration. for example: i have created a model before migration. I am using .net core v3.1\n\nusing DataLayer.DataContext;\nusing System.ComponentModel.DataAnnotations;\nusing System.ComponentModel.DataAnnotations.Schema;\n\nnamespace DataLayer.Models\n{\n [Table(\"TodoItem\", Schema = \"dbo\")]\n public class TodoItem : ModalBase\n {\n [Required]\n [Column(TypeName =\"varchar(50)\")]\n [Display(Name = \"Employee Name\")]\n public string EName { get; set; }\n\n [Required]\n [Column(TypeName = \"varchar(50)\")]\n [Display(Name = \"Employee Department\")]\n public string EDept { get; set; }\n }\n}\n\n\nnow i want my model to be as like below after migration. i need to do this for all the Models/entities available in the application. it should be automated. it should provide the default columns dynamically when i run the migration.\n\nusing DataLayer.DataContext;\nusing System.ComponentModel.DataAnnotations;\nusing System.ComponentModel.DataAnnotations.Schema;\n\nnamespace DataLayer.Models\n{\n [Table(\"TodoItem\", Schema = \"dbo\")]\n public class TodoItem : ModalBase\n {\n //default column which has to be added to this model after i run migration\n [Key]\n [DatabaseGenerated(DatabaseGeneratedOption.Identity)]\n public int Id { get; set; }\n\n [Required]\n [Column(TypeName =\"varchar(50)\")]\n [Display(Name = \"Employee Name\")]\n public string EName { get; set; }\n\n [Required]\n [Column(TypeName = \"varchar(50)\")]\n [Display(Name = \"Employee Department\")]\n public string EDept { get; set; }\n\n //default column which has to be added to this model after i run migration\n [Required]\n [Column(TypeName = \"bit\")]\n [Display(Name = \"IsActive\")]\n public string IsActive { get; set; }\n\n //default column which has to be added to this model after i run migration\n [Required]\n [Column(TypeName = \"bit\")]\n [Display(Name = \"IsDeleted\")]\n public string IsDeleted { get; set; }\n }\n}\n\n\nThe default columns need to be created on DB tables. can anyone help me with a working example would be appreciated.\n\nThanks in advance."
] | [
".net-core",
"entity-framework-core",
"azure-functions"
] |
[
"PM give me ERROR: Type is not resolved for member..on any migration command",
"I was run a downloaded application from the internet. If I used migration in PM console, I got this error. I spent a lot of time searching for a solution.\n\nI found Microsoft's reference of common errors.\n\nhttp://msdn.microsoft.com/cs-cz/data/jj618307.aspx\n\nit say\n\nERROR: Type is not resolved for member 'System.Data.Entity.Migrations.Design.ToolingFacade+UpdateRunner,EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.\n\nNOTICE: This error can be caused by specifying an incorrect startup directory. This must be the location of migrate.exe"
] | [
"c#",
"asp.net-mvc",
"entity-framework-6"
] |
[
"Print the result of a command and then compare two files",
"Introduction:\nI would like to monitor the IPs left from a database (there is a View that I consult) to do that, I am creating a python script that logs through ssh from a remote machine, and then it parses all the information to a list like this one:\n['10.123.123.321/29-NetworkName=0', '10.123.2.5/19-NetworkName2=0']\n\nThe idea is to put that information into a file, and then, the next day, generate another file\nwith actual information and compare both for differences and inform only for the new additions.\nFor example:\nDay 1, I have this IPs:\n['10.123.123.321/29-NetworkName=0', '10.123.2.5/19-NetworkName2=0']\n\nDay 2, Now I have this IPs:\n['10.123.123.321/29-NetworkName=0', '10.123.2.5/19-NetworkName2=0', '10.123.2.22/19-NetworkName3=0']\n\nThe script should return:\nALERT: '10.123.2.22/19-NetworkName3=0 Ips Left.\n\nSo, my question is.\nHow can I put those outputs to a txt file, and then compare both files?"
] | [
"python"
] |
[
"How to persist Mongoose virtuals through Passport",
"I found this post, which explains how to keep the virtual fields when calling toObject and toJSON methods. However, my problem is that I'm trying to use the req.user object set by the Passport.js local strategy, which is (apparently) not a Mongoose model.\n\nI have a User schema that stores the first and the last name, and I am using a virtual property name.full to call the full name with a space in-between. I don't have to use a virtual for this, no, but I really want to.\n\nconst schema = new Schema({\n name: {\n first: \"john\",\n last: \"smith\"\n }\n})\n .virtual(\"name.full\")\n .get(function () {\n return this.name.first + \" \" + this.name.last;\n });\n\nmodule.exports = mongoose.model(\"User\", schema);\n\n\nNow, I have a router that points to /login, where the user can post his/her login information and Passport.js will authenticate using a local strategy.\n\nAfter the user is authenticated, I save the user's information inside the Express.js session using the req.user object automatically set by Passport.js.\n\nfunction redirectToHome (req, res) {\n req.session.contextVars = { user: req.user };\n res.redirect(\"/home\");\n}\n\n\nSo the entire post router looks like:\n\nrouter.post(\"/login\", passport.authenticate(\"local\", { failureRedirect: \"login\" }), redirectToHome);\n\n\nThe problem here is that, even though the req.user is an Object that can do everything a Mongoose model can do -- even calling the instance methods -- but it doesn't have any of the virtual fields. I set toObject: { virtuals: true } and toJSON: { virtuals: true } like suggested in the aformentioned post because I thought maybe Passport.js calls one of the two under the hood before storing data in the session object, but that doesn't seem to be the case.\n\nI am using express-session and passport.session() for session management.\n\napp.js\n\nconst express = require(\"express\")\n , app = express();\nconst session = require(\"express-session\");\nconst passport = require(\"passport\");\n\napp.use(session({\n secret: \"secret key\",\n saveUninitialized: true,\n resave: true\n}));\n\napp.use(passport.initialize())\n .use(passport.session());\n\n\nI am trying to read this data in a pug file, which is receiving the data as an Object through res.render.\n\nroutes/index.js\n\nrouter.get(\"/home\", function (req, res) {\n res.render(\"home\", { LOCAL_DATA: req.session.contextVars });\n});\n\n\nhome.pug\n\n... usual head stuff\nbody\n p #{JSON.stringify(LOCAL_DATA.user)}\n\n\nI can think of a few work-arounds, but I'd like to resolve the issue this specific way. Does anyone know how to make sure Passport.js assigns the req.user object with all virtual fields visible?\n\nThank you."
] | [
"node.js",
"mongoose",
"passport.js",
"passport-local"
] |
[
"Cannot Unserialize an object array in php",
"I have an array of Shift objects that I'm working with in PHP. I need to store these objects within a database. I'm working on a function that will add shifts to the database:\n\n$Serialized_S = get_option('MasterShiftString');\n$MasterShiftArray = unserialize($Serialized_S);\n\nif(!$MasterShiftArray)\n{\n echo \"MasterShiftArray returns false\";\n}//end if\n\necho \"Serialized_S:\";\nprint_r($Serialized_S); \necho \"<br />MasterShiftString:\";\nprint_r($MasterShiftString); \necho \"<br />end<br />\"; \n\n\n\nif(!is_array($MasterShiftArray))\n{\n echo \"MasterShiftArray is not an Array....\";\n $MasterShiftArray = array($last_monday_from_date => \"\");\n\n}//end if\nelse\n{\n\n\n}//end else \n\n$WeekShiftArray = $MasterShiftArray;\n\narray_push($WeekShiftArray, $CurrentShift); \n\n$MasterShiftArray[$last_monday_from_date] = $WeekShiftArray;\n\n$Serialized_s = serialize($MasterShiftArray);\n\nupdate_option('MasterShiftArray', $Serialized_s);\n\n\nOf course what I'm getting when I execute this is:\n\nlast_monday_from_date: 1260777600\nMasterShiftArray returns falseSerialized_S:admin,resource,2,1;admin,resource,2,1;admin,resource,2,1;admin,resource,2,1;\nMasterShiftString:\nend\n\n\nWhat am I doing wrong here? I've tried the base64 encoding, but that doesn't do anything to help.\n MasterShiftArray is not an Array...."
] | [
"php",
"serialization"
] |
[
"Android 3D button text position",
"How to change text position for different button states?\n\nOn image you can see how its look like now:\n\n\n\ndrawable\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n\n <item android:state_pressed=\"true\">\n <layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item android:top=\"4dp\">\n <shape android:shape=\"rectangle\">\n <solid android:color=\"#DCDBDB\" />\n <corners android:radius=\"7dp\" />\n <stroke android:width=\"1dp\" android:color=\"#B1B1B1\"/>\n </shape>\n </item>\n\n <item android:bottom=\"4.5dp\" android:left=\"1.5dp\" android:right=\"1.5dp\" android:top=\"5.5dp\">\n <shape android:shape=\"rectangle\" android:gravity=\"bottom\">\n <solid android:color=\"#F2F1F1\" />\n <corners android:radius=\"6dp\" />\n <stroke android:width=\"1dp\" android:color=\"#FFFFFF\"/>\n </shape>\n </item>\n </layer-list>\n </item>\n\n <item>\n <layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item>\n <shape android:shape=\"rectangle\">\n <solid android:color=\"#DCDBDB\" />\n <corners android:radius=\"7dp\" />\n <stroke android:width=\"1dp\" android:color=\"#B1B1B1\"/>\n </shape>\n </item>\n\n <item android:bottom=\"8.5dp\" android:left=\"1.5dp\" android:right=\"1.5dp\" android:top=\"1.5dp\">\n <shape android:shape=\"rectangle\">\n <solid android:color=\"#F2F1F1\" />\n <corners android:radius=\"6dp\" />\n <stroke android:width=\"1dp\" android:color=\"#FFFFFF\"/>\n </shape>\n </item>\n </layer-list>\n </item>\n\n</selector>\n\n\nFew days ago I asked similar question - Android 3D button src padding, but for text I cant use this trick :/ (or dont know how)."
] | [
"android",
"android-layout",
"android-button"
] |
[
"Insert in sqlite doesn't work",
"i'm trying to make insert call to add row to my table in sqlite code,\nevery time insert return 1, and also after i insert row i check that the row was insert and it can't be found.\n\nhere is my code:\n\ncreate tables:\n\npublic void onCreate(SQLiteDatabase db) {\n // TODO Auto-generated method stub\n // create table artists\n String createTableStatement1 = \"CREATE TABLE \" + TABLE_ARTISTS +\" (\"+ KEY_ID + \" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE , \"\n + KEY_ARTIST_NAME + \" TEXT UNIQUE , \" + KEY_ARTIST_IMAGE + \" BLOB, \" + KEY_ARTIST_JSON + \" TEXT, \"\n + KEY_ARTIST_DATE + \" DATETIME DEFAULT (datetime('now')), \" + KEY_ARTIST_FLAG + \" INTEGER NOT NULL DEFAULT 1);\";\n db.execSQL(createTableStatement1);\n\n\n //creat table users\n String createTableStatement2 = \"CREATE TABLE \"+ TABLE_USERS + \" (\"+ KEY_USER_ID + \" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL UNIQUE, \"\n + KEY_PROFILE_ID + \" TEXT UNIQUE, \" + KEY_PROFILE_JSON + \" TEXT, \"+ KEY_PROFILE_IMAGE + \" BLOB, \" + KEY_PROFILE_FLAG \n + \" INTEGER NOT NULL);\";\n db.execSQL(createTableStatement2);\n\n }\n\n\nupgrade tables\n\n@Override\n public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {\n // TODO Auto-generated method stub\n // Drop older table if existed\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_ARTISTS);\n db.execSQL(\"DROP TABLE IF EXISTS \" + TABLE_USERS);\n\n // Create tables again\n onCreate(db);\n }\n\n\ninsert user row\n\npublic void insertUserToDB(User user)\n {\n SQLiteDatabase db = this.getWritableDatabase();\n\n ContentValues values = new ContentValues();\n values.put(KEY_PROFILE_FLAG, user.getProfile_flag());\n values.put(KEY_PROFILE_IMAGE, user.getProfileImageByteArray());\n values.put(KEY_PROFILE_JSON, user.getProfile_json());\n values.put(KEY_PROFILE_ID, user.getProfile_id());\n\n db.beginTransaction();\n long result = db.insertOrThrow(TABLE_USERS, null, values);\n\n db.endTransaction();\n db.close();\n\n\n }\n\n\ncheck user in database\n\npublic boolean isUserInDB(String profileID)\n {\n SQLiteDatabase db = this.getReadableDatabase();\n db.beginTransaction();\n String sqlStatement = \"SELECT * FROM \"+ TABLE_USERS +\" WHERE \" + TABLE_USERS + \".\"+ KEY_PROFILE_ID +\n \"=\" + \"\\\"\"+ profileID + \"\\\"\";\n Cursor cursor = db.rawQuery(sqlStatement, null);\n boolean exists = ((cursor.getCount())!=0);\n cursor.close();\n db.endTransaction();\n db.close();\n\n return exists;\n }\n\n\nany ideas?"
] | [
"java",
"android",
"sqlite"
] |
[
"mysqli insert statement error",
"Just updating my mysql connections and so forth to use this mysqli implementation.\nI'm trying to run the code below...\n\nThe connection to the database is fine and works, and when I substitute the ? for real values it works. Can someone help me with the error below?\n\nThanks.\n\nThe code:\n\n$sql = \"INSERT INTO customers (cap_login, cap_pword, title, firstname, lastname, email)\nVALUES (?,?,?,?,?,?)\";\necho $sql;\n\n$stmt = $db->prepare($sql);\n$stmt->bind_param($username, $pass_hash, $title, $firstname, $lastname, $email);\n$stmt->execute();\n$stmt->close();\n\n\nThe error:\n\nWarning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement in....\n\n\nI echoed out the sql statment and got this:\n\nINSERT INTO customers (cap_login, cap_pword, title, firstname, lastname, email) VALUES (?,?,?,?,?,?)"
] | [
"php",
"sql",
"mysqli",
"insert"
] |
[
"Flask use native upload features or Flask-Uploader module for uploading image files?",
"I've gone through the documentation of both a bit, and it seems like flask-upload simplifies the process quite a bit. Is one easier or inherently better than the other? Can flask-upload cause any problems?"
] | [
"flask"
] |
[
"jQuery on() not working on element inside disabled fieldset",
"<form>\n <fieldset disabled='disabled'>\n <input type='text' name='text' value='not to be edited' />\n <a href='#' class='editbutton'>click me</a>\n </fieldset>\n</form>\n\n\njQuery not working:\n\n$(\"body\").on(\"click\", \".editbutton\", function(e) {\n e.preventDefault();\n console.log(\"hello\");\n});\n\n\njQuery working:\n\n$(\".editbutton\").on(\"click\", function(e) {\n e.preventDefault();\n console.log(\"hello\");\n});\n\n\nSo, when you take $(\"body\") as a starting point, jQuery does not catch the event click on the editbutton, because of fieldset being disabled.\n\nIf you take $(\".editbutton\") as a starting point, jQuery works, although fieldset is still disabled.\n\nIs this expected behaviour and is there a workaround? I cannot use the working solution because the form is created dynamically."
] | [
"jquery",
"click",
"dynamically-generated",
"fieldset"
] |
[
"Debug error InvocationTargetException?",
"08-05 00:25:13.320: ERROR/AndroidRuntime(16232): at dalvik.system.NativeStart.main(Native Method)\n08-05 00:25:13.320: ERROR/AndroidRuntime(16232): Caused by: java.lang.reflect.InvocationTargetException\n08-05 00:25:13.320: ERROR/AndroidRuntime(16232): at java.lang.reflect.Method.invokeNative(Native Method)\n08-05 00:25:13.320: ERROR/AndroidRuntime(16232): at java.lang.reflect.Method.invoke(Method.java:491)\n08-05 00:25:13.320: ERROR/AndroidRuntime(16232): at android.view.View$1.onClick(View.java:2678)\n08-05 00:25:13.320: ERROR/AndroidRuntime(16232): ... 11 more\n\n\ni keep getting these errors while running this method.\n\npublic void watchVideo(View view) {\n video.setVideoPath(current.url);\n video.setMediaController(new MediaController(this));\n video.requestFocus();\n video.start();\n}\n\n\nCurrent is the YouTubeResult object from the Gdata api.\n\nstatic YouTubeResult current;"
] | [
"android",
"youtube-api"
] |
[
"Python integer refusing to increment (+=) during debug",
"I am debugging a complicated Python program (VSCode Python debugger) and there is a very baffling behavior that I am noticing:\n\n> type(self.i)\n<class 'int'>\n> self.i\n1\n> self.i+1\n2\n> self.i += 1\nNone\n> self.i\n1\n> self.i = self.i + 1\nNone\n> self.i\n1\n\n\nThe variable self.i just refuses altogether to increment. I have highlighted a debugging session but even without any breakpoint, if the execution is inside a debug session, a loop that should take 5 iterations takes a random, longer, number of iterations. This behavior happens:\n\n\nonly when some external code is modified in a specific way\nonly when using the debugger. Just running the script via python makes the problem go away\n\n\nThe context is that we are inside a __next__ method of an iterator, the snippet is\n\ndef __next__(self):\n if self.i < self.num_samples:\n i = self.i\n self.i += 1 # <- here is a breakpoint\n ....\n\n\nThe code that toggles the behavior is inside a for loop using an instance of said iterator. There should really be no relation between it and what happens inside the iterator, but when a computationally expensive line that involves pytorch backpropagation is decommented the problem happens.\n\nThis is puzzling me because it is so mysterious. I can't understand why a variable should refuse to increment, whether there is a bug, and if so where it is (in the VSCode debugger, in my code, in Python, in PyTorch, ...?). So I would be very grateful if someone could shed a bit of light on the issue\n\nEDIT:\n\nThe class where this happens is called SpectraDataLoader and is an iterator. The only references to i are in __iter__ and __next__ (shown before):\n\ndef __iter__(self):\n ...\n self.i = 0\n ...\n return self"
] | [
"python",
"debugging",
"visual-studio-code"
] |
[
"Webkit Performance Rendering 5-ish images",
"This relates to a webview in an app (iPad 2, so using WebKit). \n\nIt seems the layout is happening immediately, but it is not drawing to the screen immediately.\n\nMy HTML output looks somewhat similar to this example,\n\n<div style=\"position:relative;width:1024px;height:768px;\" data-reactid=\".0.1.0\">\n <img src=\"blob:http%3A//localhost%3A8080/d4e138d6-aa6b-41a6-878b-8ee26ba450a3\" style=\"position:absolute;left:51.055712117927555px;top:93.9596791675699px;width:972.9442878820724px;height:157.16280078040322px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg==);\" data-reactid=\".0.1.0.$notation-1728\">\n <img src=\"blob:http%3A//localhost%3A8080/b860fbef-8b40-4a09-9d00-2575fac9bb8c\" style=\"position:absolute;left:4.661608497723819px;top:271.12247994797315px;width:1019.3383915022762px;height:191.79189247778018px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg==);\" data-reactid=\".0.1.0.$notation-1729\">\n <img src=\"blob:http%3A//localhost%3A8080/2b655007-792a-4ad7-8fcd-42b9ece6ec2f\" style=\"position:absolute;left:4.661608497723819px;top:482.9143724257533px;width:1019.3383915022762px;height:188.46217212226315px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWP4////fwAJ+wP9CNHoHgAAAABJRU5ErkJggg==);\" data-reactid=\".0.1.0.$notation-1730\">\n</div>\n\n\n\nThe images are being placed on the page via React\nThere are three images using blob urls\nAll blobs are generated from base64 strings at start up, and this is not recalculated (confirmed this is the case)\nThere is a small amount of CSS positioning and other styles\nThe base64 strings are no larger than 60kb, so the images are no larger than 40kb\nThe images are scaled down\n\n\nYou are able to navigate to different sections, which will replace the images with a similar amount of images at slightly different positions (done via React).\n\nHowever, changing the section is slow. It feels like 400-600ms to see the new section.\n\nI had an implementation that wasn't using react: each section would be placed on a div and all but the current section would positioned off screen. When you change section, I would just move the divs. This process was in the milliseconds, but it still took the same 400-600ms to see the changes on the screen. This lead me to conclude the second sentence: that the layout is happening immediately, but it is not drawing to the screen at the same time.\n\nAm I correct in thinking that the layout and drawing happen at different times? And are there any optimisations I could be using?"
] | [
"html",
"performance",
"webview",
"wkwebview"
] |
[
"Multiple asynchronous HTTP requests using Resttemplate",
"I have a service which uses springs RestTemplate to call out to multiple urls.\n\nTo improve performance I'd like to perform these requests in parallel. Two options available to me are:\n\n\njava 8 parallel streams leveraging the fork-join common pool \ncompletable future using isolated thread pool\n\n\nJust wondering if it best practice to use parallel streams with blocking I/O calls ?"
] | [
"java",
"java-8",
"resttemplate",
"spring-web"
] |
[
"EaselJS adds Bitmap to stage oversized",
"I'm trying to dynamically create and add a Bitmap image and add it to stage, but when I do the image always comes in incredibly oversized (2-3x), so I always have to find some arbitrary scale numbers to get it right (ex 375x500 image made me use scale of scaleX:.8 scaleY:.33), and even then it comes out crappy and tiled. I even tried messing around with the canvas size, and it's lack of proper scale scales with the allotted space :x\n\nThe code I'm using is essentially this:\n\nvar stage = new createjs.Stage(\"canvas\");\nvar bmp = new createjs.Bitmap(\"images/img.jpg\");\nstage.addChild(bmp);\nstage.update();\n\n\nWhat do I need to set to make the image show up like I intend it to?"
] | [
"easeljs",
"createjs"
] |
[
"CSS: Image not showing on iOS devices",
"For some reason, my div of id \"home\" (landing image/screen) disappears on just iPhones when I run responsive test. Other mobile devices were fine, it's a PNG file so I'm not sure what is going on.\n\nIt's probably a simple CSS issue but nothing so far I've tried is working\n\nhttp://productvisionclub.com/"
] | [
"ios",
"css",
"mobile",
"responsive-design",
"media-queries"
] |
[
"What happens to unmatched messages with Akka?",
"The Akka documentation says that the mailbox is NOT scanned for messages. Each message is handled after another (FIFO by default) in the order of their arrival. However, when I send a message from an actor to another which is not matched be the receiving actor, it is neither moved to the deadletters actor (which would appear in the log I suppose) nor does it block handling the next message in the mailbox which arrives one second later and can be handled correctly.\n\nWhat does happen to the unmatched message from the mailbox?\n\nI am using Scala 2.10.4 and Akka 2.4-SNAPSHOT in sbt.\n\npackage main.scala\n\nimport akka.actor._\n\nclass SRActor(dest: ActorRef) extends Actor with ActorLogging {\n dest ! A\n dest ! B\n\n context.stop(self)\n\n override def receive = {\n case _ => {\n log.info(\"Finally got something\")\n }\n }\n}\n\nclass SRActorReceiver extends Actor with ActorLogging {\n override def receive = {\n case B =>\n log.info(\"Finally got B\")\n }\n}\n\n\nActor creation:\n\npackage main.scala\n\nimport akka.actor._\ncase object A\ncase object B\n\nobject ErrorApp extends App {\n// SR: Send nowhere received\n var system6 = ActorSystem(\"ErrorActorSystem\")\n val srActorReceiver = system6.actorOf(Props(classOf[SRActorReceiver]), \"sractorreceiver\")\n val sractor = system6.actorOf(Props(classOf[SRActor], srActorReceiver), \"sractor\")\n\n // wait until actors have finished\n Thread.sleep(1000)\n\n system6.shutdown"
] | [
"scala",
"akka",
"actor"
] |
[
"how to get md5 hash of an image, without being affected by jpeg compression",
"I have alot of .jpg images with some duplicates (of the same size) that only differ slightly in their jpg comrpession level. I need to make a function that somehow returns the same md5 hash of all similar images based on their colors or color/shape/.. signature and ignore the compression level.\n\nI thought about calculating the color average of each 4 pixels, and write it as 1 pixel into a grid, then use the result to get an md5 signature of the whole image?\n\nI was wondering if there is a better way of doing this, maybe a library or an algorithme that does just this?"
] | [
"java",
"algorithm",
"image-processing"
] |
[
"Find out where this function has been called?",
"I want to be able to quickly go through all invocations of a function inside a file or outside. Currently i use search in all files method. But is there a way to see where this method was used.\n\nOptional: Also i'd want to go back in other direction as well. Say there is a method call like this:\n\nmakeBread();\n\n\nNow i want to see what the function do. so somehow jump to its declaration."
] | [
"javascript",
"sublimetext3",
"sublimetext",
"sublime-text-plugin"
] |
[
"How can I quickly identify most recently modified stored procedures in SQL Server",
"I Need to manually migrate modified stored procedures from a DEV SQL Server 2005 database instance to a TEST instance. Except for the changes I'm migrating, the databases have the same schemas. How can I quickly identify which stored procedures have been modified in the DEV database for migration to the TEST instance?\n\nI assume I can write a query against some of the system tables to view database objects of type stored procedure, sorting by some sort of last modified or compiled data, but I'm not sure. Maybe there is some sort of free utility someone can point me to.\n\nThanks in advance,\n\nBob"
] | [
"sql-server",
"stored-procedures",
"migration"
] |
[
"Authorization Code Grant (WSO2 API Manager 3.2.0 )",
"I created a simple angular application then I configured it as a client for keycloak (client angular-app, realm master)\n\nI configured keycloak as an external keymanager for WSO2 APIM (client apim-client, realm master)\n\nI launched the following request : http://localhost:8080/auth/realms/master/protocol/openid-connect/auth?client_id=angular-app&response_type=code&state=fj8o3n7bdy1op5 from the browser to authenticate user to my angular app which redirected me to my angular application and generated an authorization code\n\nI used the authorization code generated to get the access token from the /token endpoint => Access token generated successfully\n\n\nThe problem is that I still cannot invoke the APIs published on WSO2 using the access token generated using the authorization code grant and I get the following error from WSO2 server :\n{"fault":{"code":900908,"message":"Resource forbidden ","description":"User is NOT authorized to access the Resource. API Subscription validation failed."}}\n\nAny recommendation, help ??"
] | [
"angular",
"keycloak",
"wso2-am"
] |
[
"send method function of a specific object to a thread",
"The only way of using a method function in a thread i've seen so far is:\n\nstd::thread t1(&mymethod::myfunction, param1, param2, ...);\n\n\nIf I understand correctly, the above example calls the general function, but not from a specific object, that means that the function does'nt work based on the current state of the object.\n\nSo, how can I call the function using a specific object?\n\nIn this way, error C3867 occurs:\n\nmyclass myobj(param);\nstd:: thread t1(myobj.myfunction, param1, param2, ...);\n\n\nthis is what happened in my specific work:\nI want to create a class that has functions of read and write to a text file, using threads (RW lock)\nI have the following class:\n\nclass readersWriters{\nprivate:\n /*... here are some mutexes to implement readers writers lock... doesn't matter*/\n string _fileName;\n\npublic:\n readersWriters(string fileName); //constructor\n /*...*/\n void readLine(int lineNumber); //lineNumber - line number to read\n void WriteLine(int lineNumber, string newLine);//lineNumber - line number to write\n}\n\n\nSo in the main function, i create an object of the class...\n\nreadersWriters one(\"sample.txt\");\n\n\nIf i create the thread calling the function as i did in the example, how does the function know from which text to read and write? here i'm not succeeding:\n\n//thread that reads from \"sample.txt\" through object \"one\"\n//thread that writes through object \"one\"\n//etc.\n\n\nhow can I do in order for the thread to read and write in sample.txt, from the object \"one\"?\nThanks"
] | [
"c++",
"multithreading"
] |
[
"Java 7 FileSystemProvider backward compatibility",
"We are building a new Java 7 NIO.2 FileSystemProvider, and would like to not exclude Java 6 users. Is there any good strategy for supporting Java 6 users? Is it better to build something compatible with Java 6 and then build the new API on top?"
] | [
"java",
"filesystems",
"nio",
"java-7",
"java-6"
] |
[
"React Testing Library - Avoid getBy?",
"When testing components with React Testing Library, I find myself starting with getBy*, and occasionally needing to replace it with queryBy* (for example if I need to check for the non-existence of an element). My tests end up with a mix of getBy and queryBy, and I've recently just been using queryBy for everything.\nIt got me thinking... is there ever a reason to use getBy?\nAssertions like this fail as expected, without the need to throw an error:\nexpect(queryByText('Click me')).toBeInTheDocument();\nexpect(queryByLabel('Name').value).toBe('George')\n\nWhat's the advantage of throwing an error if an element isn't found, and is there a reason not to use queryBy for all (synchronous) queries?\nEDIT: It looks like queryBy is now only recommended for asserting that something is not in the document:\nhttps://kentcdodds.com/blog/common-mistakes-with-react-testing-library#using-query-variants-for-anything-except-checking-for-non-existence\nThe article also recommends using screen.queryBy/screen.getBy rather than destructuring from render, which simplifies changing from one to another, since you no longer have to update the destructured function."
] | [
"javascript",
"reactjs",
"testing",
"jestjs",
"react-testing-library"
] |
[
"Cant click when I do a transform:translate (no jquery)",
"I want auto-adjust and auto-center a div of one game that I am working (HTML5), I have tried some css combinations, the perfect combination is it:\n\n.centered {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n\n\nThis centers the game great on all moment, but I cant click after use the \"centered\" class, I dont know whats the problem and its difficult find a solution searching on the net, anybody can help me with this?\n\nThe main .html file (with style and js) is there:\n\n<head>\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <meta http-equiv=\"pragma\" content=\"no-cache\"/>\n <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n <meta name =\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\" />\n <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\" />\n <meta charset=\"utf-8\"/>\n\n <!-- Set the title bar of the page -->\n <title></title>\n\n <!-- Set the background colour of the document -->\n <style>\n body {\n background: #000000;\n color:#cccccc;\n margin: 0px;\n padding: 0px;\n border: 0px;\n }\n canvas {\n image-rendering: optimizeSpeed;\n -webkit-interpolation-mode: nearest-neighbor;\n -ms-touch-action: none;\n margin: 0px;\n padding: 0px;\n border: 0px;\n }\n :-webkit-full-screen #canvas {\n width: 100%;\n height: 100%;\n }\n div.gm4html5_div_class\n {\n margin: 0px;\n padding: 0px;\n border: 0px;\n }\n /* START - Login Dialog Box */\n div.gm4html5_login\n {\n padding: 20px;\n position: absolute;\n border: solid 2px #000000;\n background-color: #404040;\n color:#00ff00;\n border-radius: 15px;\n box-shadow: #101010 20px 20px 40px;\n }\n div.gm4html5_cancel_button\n {\n float: right;\n }\n div.gm4html5_login_button\n {\n float: left;\n }\n div.gm4html5_login_header\n {\n text-align: center;\n }\n /* END - Login Dialog Box */\n :-webkit-full-screen {\n width: 100%;\n height: 100%;\n }\n .centered {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n </style>\n</head>\n\n<body>\n <div class=\"gm4html5_div_class centered\" id=\"gm4html5_div_id\">\n <img src=\"html5game/splash.png\" id=\"GM4HTML5_loadingscreen\" alt=\"Loading screen\" style=\"display:none;\"/>\n <!-- Create the canvas element the game draws to -->\n <canvas id=\"canvas\" width=\"1024\" height=\"600\">\n <p>Your browser doesn't support HTML5 canvas.</p>\n </canvas>\n </div>\n\n <!-- Run the game code -->\n <script type=\"text/javascript\" src=\"html5game/SaveTheCity.js?LGLZB=1822663509\"></script>\n</body>"
] | [
"javascript",
"html",
"transform"
] |
[
"Listing details in one table based on count in another table",
"Given three tables\n\n\ndepartments\ndept_emp\nemployees\n\n\nI want to list employees who are assigned to departments with more than 50,000 employees.\n\nI've tried several different approaches using sub-queries but haven't got it right. \n\nHere is one failed attempt. Note: I want the details for the employee and the department they are in\n\nselect \n a.dept_name,\n c.*\nfrom\n departments a\nleft outer join\n dept_emp b\non\n b.dept_no = a.dept_no\nleft outer join\n employees c\non\n c.emp_no = b.emp_no\nwhere\n c.emp_no\nin\n (select\n emp_no\n from\n dept_emp\n group by\n dept_no\n having\n count(dept_no) > 50000\n )"
] | [
"mysql",
"sql"
] |
[
"How to reproduce and fix the cause of the crash on ios 9?",
"Application is crashes on iPad mini 2 Retina iOS 9.0.2.\nI have crash information from the TestFlight External Tester, but I can not reproduce the error and can not find the line of code with an error.\nPlease help me to solve this problem. \n\nThanks."
] | [
"ios",
"objective-c",
"xcode",
"ios9",
"testflight"
] |
[
"Vue virtual DOM not updating immediately when followed by expensive calculation",
"I'm trying to add a loading screen that displays while my app is doing expensive hashing and deciphering of some data (takes 2-3 seconds). When I experimentally remove the expensive parts following what should update the DOM, the screen loads immediately. Otherwise, it doesn't render until after the expensive function is complete. Any ideas what I'm screwing up?\n\n\r\n\r\nexport default {\r\n data(){\r\n return {\r\n loading: false,\r\n password: ''\r\n }\r\n },\r\n methods: {\r\n async unlock(){\r\n this.loading = true;\r\n await this.$nextTick()\r\n // DOM should update, but it doesn't\r\n try{\r\n await this.$root.UnlockVaultPassword(this.password);\r\n } catch(err){\r\n this.loading = false;\r\n return;\r\n }\r\n // DOM updates once finished with hashing and ciphering\r\n this.loading = false;\r\n this.$router.push({name: 'vault'});\r\n }\r\n }\r\n}\r\n\r\n\r\n\n\nI'm thinking that because vue updates the dom asynchronously, I'm experiencing a race condition where it can't fit in the dom update amidst the hashing. How can I WAIT until the dom is done?"
] | [
"javascript",
"asynchronous",
"vue.js"
] |
[
"How to create a signature for the Ascentis API using PHP",
"I am trying to create the proper signature for the Ascentis API. There documentation is http://www.ascentis.com/API/Ascentis_API_Documentation.pdf. Page 4 describes the Signature format.\n\nHere is my PHP code. Am I doing something wrong? I get a \"not authorized error\".\n\n$url='https://selfservice2.ascentis.com/mycompany/api/v1.1/employees';\n$timestamp=gmdate('Y-m-d\\TH:i:s\\Z');\n$path=strtolower(str_replace('https://selfservice2.ascentis.com','',$url));\n$signature_string=\"GET {$path} {$timestamp}\";\n$signature=hash_hmac(\"sha1\",$signature_string,$secret_key);\n$authorization=encodeUrl($client_key).':'.encodeUrl($signature);"
] | [
"php",
"api"
] |
[
"how to filter an array of objects with jQuery",
"Recently I'm studying jQuery . I wish that when I write here \n<input type=\"text\" id=\"scrivo\" /> \nI want to filter an array derived from a json file. \nThe json file is like this:\n\n{\n \"Re\": \n[\n {\n \"nm\": \"Edward the Elder\",\n \"cty\": \"GB\",\n \"hse\": \"House of Wessex\",\n \"yrs\": \"899-925\"\n },\n {\n \"nm\": \"Edgar\",\n \"cty\": \"GB\",\n \"hse\": \"House of Wessex\",\n \"yrs\": \"959-975\"\n },\n {\n \"nm\": \"Edward the Martyr\",\n \"cty\": \"GB\",\n \"hse\": \"House of Wessex\",\n \"yrs\": \"975-978\"\n }\n ]\n}\n\n\nand the piece of code is this:\n\n<script language=\"JavaScript\">\n$(document).ready(function() \n {\n $('#scrivo').keyup(function()\n {\n var json = (function () {\n var json = null;\n $.ajax({\n 'async': false,\n 'global': false,\n 'url': \"re.json\",\n 'dataType': \"json\",\n 'success': function (data) {\n json = data;\n }\n });\n return json.Re;\n })();\n var o = $.grep(json, function (n) { return (n.nm.indexOf(\"El\")) },true);\n });\n });\n</script>\n\n\nFor example I would like to filter the objects that contain \"El\", which is the first object in the json file. Instead I do not receive anything. \nCan you help me please?"
] | [
"javascript",
"jquery",
"json"
] |
[
"how to choose which dependency resources will be used in spring boot application",
"I have fat-jar spring boot application in jar A.jar\nin this fat-jar I have folder lib with two jar files (dependencies)\nlet's say B.jar and D.jar in each of these jar file (B and D) we have application.properties (resource) which is loaded automatically during initialization of application.\n\nUnfortunately application.propertiesfrom D.jar is loaded before application.properties from B.jar\n\nHow to load application.properties from B.jar instead of application.properties from D.jar ?"
] | [
"spring",
"spring-boot",
"resources"
] |
[
"update always inserting last array value",
"i m new to node and search a lot find solution but don't know how to use with my condition if anyone pro who can help me with this thing \n\nPermissiontb.assembleAndInsert = async (ctx, cb) => {\nfor (let i = 0; i < ctx.req.body.view.length; i++) {\n console.log('outside i '+i)\n await Process(ctx,i);\n }\n};\n\n function Process(ctx,i) {\nlet data={company_id:ctx.args.options.accessToken.userId,\n userid:ctx.req.body.userid,\n perpage:ctx.req.body.perpage[i].id,\n view:ctx.req.body.view[i],\n edit:ctx.req.body.edit[i],\n update:ctx.req.body.update[i],\n delete:ctx.req.body.delete[i]}\n\n console.log('inside '+i)\n return new Promise((resolve, reject) => {\n Permissiontb.find({where:{and: [{userid:ctx.req.body.userid}, {perpage:ctx.req.body.perpage[i].id}] }},function(err,result){\n if(err){\n var err = new Error('Some thing went wrong');\n err.statusCode = 444;\n console.log('err'+err)\n resolve(err)\n }else{ console.log(result.length)\n if(result.length>0){\n console.log(ctx.req.body.userid) \n console.log('page id '+ctx.req.body.perpage[i].id)\n const pgid=ctx.req.body.perpage[i].id\n const vd=ctx.req.body.view[i]\n const ed=ctx.req.body.edit[i]\n const up=ctx.req.body.update[i]\n const del=ctx.req.body.delete[i]\n console.log(ctx.req.body.view[i])\n console.log(ctx.req.body.edit[i])\n console.log(ctx.req.body.update[i])\n console.log(ctx.req.body.delete[i])\n console.log('findinside update '+i)\n\n resolve(Permissiontb.update({where:{and: [{userid:ctx.req.body.userid}, {perpage:pgid}] }},{view:vd,edit:ed,update:up,delete:del}))\n\n }else{\n resolve(Permissiontb.create([data]))\n }\n\n }\n\n })\n\n })\n}\n\n\nnow problem is that console log inside if(result.lenght>0) condition for eg:- console.log(ctx.req.body.view[i]) correct value getting but when update method always inserting last array value can anyone tell me what i m doing wrong"
] | [
"node.js",
"express",
"loopbackjs",
"strongloop"
] |
[
"SalesForce integration — custom UI functionality",
"My company wants to use SalesForce as its backend for a new Web application that we are building. We will host the Web application with an ISP on our own servers. The integration points mainly involve sending customer and transaction data via the API. In essence, the Web application will have its own database, but will send over customer and transaction data to saleforce at key points.\n\nThe plan is to use SalesForce as a backend, so that we can save some time in developing all of this. What I don't understand though, is how custom functionality is handled by SalesForce?\n\nLet's assume that our application offers some functionality. How would we expose that functionality in the SalesForce application? Initially I had imagined we could reference this function/page (in our app) via an iframe from the salesforce app — but this does not seem to be possible... are there any other options?\n\nSo, to summarise, I need to show parts (or pages) of our web app in the SalesForce UI. If I can achieve this, it would mean that the customer services team can do everything in one interface (handle tickets, update user data etc.).\n\nI am at my wit's end with this, it's even causing some sleepless nights. I would appreciate any useful advice!"
] | [
"force.com"
] |
[
"How to delete breakpoints in XCode",
"I go to Breakpoints panel in XCode, in the 'Breakpoints' I click a breakpoint and click 'Delete', but it does not remove the breakpoint. And I try go to go to 'Project Breakpoints' and find the same breakpoint and click 'Delete'. But it still does not break the breakpoint."
] | [
"xcode",
"debugging",
"breakpoints"
] |
[
"TextBox AutoComplete from MDB",
"I have a .Net 4 Windows Forms app that uses a Microsoft Access Database with one table which has three columns CityCode, Name and Country.\n\nWhat I want to do is have an autocomplete which shows the “Name” and “Country” but when selected the “CityCode” Value is shown in the textbox. In addition if the user types A City Code eg LAX as they type L it would list all the cities whose code or Name starts with L.\n\nCan this be done?\n\nCurrently I have the following for access the database (but it seems to be a bit slow!)\n\ntextBoxCity.AutoCompleteCustomSource = CityList(); \n\npublic static AutoCompleteStringCollection CityList()\n {\n string connectionStringLD = string.Empty;\n\n connectionStringLD = @\"Driver={Microsoft Access Driver (*.mdb)};DBQ=c:\\CityList.mdb\";\n\n\n string SQL = \"SELECT CityCode from CityTable\";\n\n OdbcConnection conn = new OdbcConnection(connectionStringLD);\n\n OdbcCommand cmd = new OdbcCommand(SQL);\n cmd.Connection = conn;\n\n conn.Open();\n\n OdbcDataReader reader = cmd.ExecuteReader();\n AutoCompleteStringCollection theCityList = new AutoCompleteStringCollection();\n\n while (reader.Read()) \n {\n\n theCityList.Add(reader.GetValue(0).ToString());\n\n }\n\n return theCityList;\n }"
] | [
"c#"
] |
[
"facebook share from android application",
"I am doing a android application.From my App I have to share a page when user clicks a button.So please provide me some sample code or suggest me some useful tutorial.Thanks in advance."
] | [
"android"
] |
[
"How to export exact format table from teradata to excel?",
"For a project at work, i need to export from teradata to excel an sql request.\n\nSo far i managed to fully export several request to my excel file, but the output format is not exactly what I am looking for. Indeed the output does not respect the origin table and just gave a concatenation row by row like :\n A\n1('000000000DUM', 'RRFOR', '', '', 'NOTE_CONTREP', '20.00')\nand i want\n\nA1 :000000000DUM B1 : RRFOR C1 :'' D1 : '' E1 : NOTE_CONTREP F1 : 20.00\n\nThis is my code :\n\ndef KPI_MAKER(instid):\nconn=pyodbc.connect('DRIVER={Teradata};DBCNAME=FTGPRDTD;UID='+str('L291506')+';PWD='+str('Pilote06!')+';QUIETMODE=YES;')\nAgg=str(\"sel code_gen1,code_gen2,cd_prd_cpta,lieu_stkph_cd,don_source_cd,incorrect_value from DB_FTG_SRS_DATALAB.mdc_ctrl_anomalie where rg_no = 'RGC-TIE-012'\")\ncursor = conn.cursor()\ncursor.execute(Agg)\nAgg_output = cursor.fetchall()\nconn.close\n\ndf = pd.DataFrame(Agg_output)\nwriter = pd.ExcelWriter('KPI_FORTIS_13082019.xlsx', engine='xlsxwriter')\ndf.to_excel(writer, index=False, sheet_name='POC_output') # sheet 0\nwriter.save()\nprint('done')"
] | [
"python",
"excel",
"pandas",
"teradata",
"xlsxwriter"
] |
[
"How to install selenium for python2.7",
"I've been asked to help a friend with a script health.py which uses python 2 and selenium.\nI've been using python 3 and have selenium downloaded and working with 3.\nWhen I try run the script with python 2 I get:\nfrom selenium import webdriver\nImportError: No module named selenium\nIf I try install:\npip install selenium\n\nThen it says:\nRequirement already satisfied: selenium in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (3.141.0)\nRequirement already satisfied: urllib3 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from selenium) (1.25.11)\n\nI notice that those paths both point to python3.6 so how do I install selenium in my python 2.7 location?\nSadly I've always been a bit confused with how these python paths specifically work so have probably just made a mess in previous acts. If it helps here is this:\nwhich python2.7\n/usr/bin/python2.7\n\nI also tried reisntalling python2 with brew\nbrew install python@2\n\nhoping this would reset my settings and allow another pip install of selenium to put things in the correct place, but nothing seemed to change.\nThanks for any help!\nedit - extra info: I've noticed that my python3 is inside /Library while my python 2 is inside /System. Could this be a source of my issues?\n/Library/Frameworks/Python.framework/Versions/3.6\n/System/Library/Frameworks/Python.framework/Versions/2.7"
] | [
"python",
"selenium",
"pip",
"version"
] |
[
"Is it a bad idea to use a web api instead of a tcp socket for master/slave communication?",
"TL:DR; Are there any drawbacks / pitfalls to use a RESTful API instead of a TCP/Socket connection for a master-slave pattern?\n\n\n\nI'm writing a web application that fetches data from an 3rd party API, calculates statistics (and more), and presents it. The fetched data is stored in a database.\n\nI'm writing this web application with NodeJS and AngularJS. \n\nSo there are 2 basic opertions the app will do: \n\n\nAnswer HTTP requests from the front end\nUpdate the database. This includes: Fetching data, saving data to database, and caching results of some heavy queries every 5 minutes in a in-memory database like redis.\n\n\nI want to seperate these operations in two applications. The HTTP server shall be the master. The second application is a just a slave, of which as many instances can be spawned.\n\nThe master will implement some kind of task-processor which just distributes tasks to idle slaves. The Slave is very dumb. It can report about its status (idle/busy and some details like current load etc). You can start tasks on a slave. The master will take care of queueing tasks and so on.\n\nI guess this is common server/agent pattern.\n\nSo I've started implenting a TCP Server and Client, but it just feels like so much overhead to do this. A bit like reinventing the wheel. So I thought I just could use a HTTP server on my client which just has two endpoints like \n\n[GET] /status \n[POST] /execute/:task\n\n\nAm I on the right track here?"
] | [
"node.js",
"master-slave"
] |
[
"not getting magento image url from bestseller",
"I wrote some code for best-seller product in magento but\n\nI m not getting product image url ....\n\nI need small image for the gallery..\n\nI m developing bestseller slider .....the whole thing is good\n\nbut only i m not getting image url...\n\nmy code\n\n$current_category = Mage::registry('current_category');\n $is_category_filter = Mage::getStoreConfig('productslider/product_setting/category_filter');\n $collection = Mage::getResourceModel('reports/product_collection')\n ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())\n ->addOrderedQty()\n ->addMinimalPrice()\n ->addTaxPercents()\n ->addStoreFilter(); \n Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);\n Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);\n if($current_category && $is_category_filter == '1'){\n $current_category_id = Mage::registry('current_category')->getId();\n $currentCategory = Mage::getModel('catalog/category')->load($current_category_id);\n $collection->addCategoryFilter($currentCategory);\n }\n $collection->setPageSize(30);\n\n $this->setProductCollection($collection);\n\n\n\n\n\n\n\n\nreturn $collection;"
] | [
"magento"
] |
[
"is io_service_.stop() only required when io_service_.run() previously called",
"I implement a tcp client using boost asio and synchronous socket. \n\nI'm wondering if I have to call io_service_.stop() after (or before?) shutdown/closed my socket?"
] | [
"c++",
"sockets",
"boost-asio"
] |
[
"Geopandas contains working for one point but not many",
"I need filter rows of a dataframe within a multipolygon. My multypolygon is stored in gdf_polygon and my points are stored in gdf. Here is a bit resume of how they look.\n\ngdf_polygon\nid geometry\n0 MULTIPOLYGON (((39.81239 21.43429, 39.81445 21...\n\ngdf\nid geometry\n0 POINT (50.05832 26.43992)\n... ...\n\n\nThe problem is that when I tried to check if there are any points inside it return False, but I know there are some points inside the polygon.\n\nBasically, if I run this I have False as output.\n\ngdf_polygon.geometry.contains(gdf.geometry).any()\n\n\nOtherwise, if I run this I have True as output, because that point is inside the polygon.\n\ngdf_polygon.geometry.contains(gdf.geometry[141828])\n\n\nI know I could iterate through all the rows of gdf and run the contains for each one, but since my dataset is quite big (around 30.000.000 rows) that would be very inefficient. So I was looking for an explanation or possible fixes.\n\nMy dataframes creations is:\n\n crs = {'init': 'epsg:4326'}\n\n df = pd.read_csv(FOLDER+file, compression='gzip', escapechar='\\\\')\n\n geometry = [Point(xy) for xy in zip(df.longitude, df.latitude)]\n gdf = gpd.GeoDataFrame(df,crs=crs, geometry=geometry)\n\n inside = gdf.geometry.within(gdf_polygon.geometry)"
] | [
"python",
"geopandas"
] |
[
"How to use the correct git account in git push?",
"Whenever I type:\n\ngit push\n\n\nI get:\n\nremote: Permission to [username]/[project-name].git denied to [old-username].\nFatal: unable to access [https://github.com/link/.git]: the requested url returned error: 403\n\n\nI think that git tries to push using [old-username] which is a github account I don't use for this project.\n\nI'm new to git but I can't seem to find the solution. How can I get github to prompt me for my correct username and password so I can push to the remote branch my new account has access to?"
] | [
"git",
"github"
] |
[
"What is the _snowman param in Ruby on Rails 3 forms for?",
"In Ruby on Rails 3 (currently using Beta 4), I see that when using the form_tag or form_for helpers there is a hidden field named _snowman with the value of ☃ (Unicode \\x9731) showing up.\n\nSo, what is this for?"
] | [
"ruby-on-rails",
"forms",
"unicode"
] |
[
"Delphi 7, SelectDirectory with UNC",
"I use Delphi 7 on Windows 7, I need to open a dialog that allow to choose a directory.\nI use SelectDirectory (from unit FileCtrl).\nThe problem is that I want to navigate through an \"unmapped\" network directory, like \"\\\\10.0.0.1\\Mickey\". \n\nIs it possible to do this?"
] | [
"delphi",
"delphi-7"
] |
[
"Combine 2 data variable in Laravel",
"How can i combine 2 variable data in Laravel. Im trying combine data in $income1 and $income2 become $income data show all data from $income1 and $income2\n\nHere my controller\n\n<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Collection;\n\nuse App\\Product;\nuse App\\Blok;\n\nclass ProductController extends Controller\n{\n public function income()\n {\n $products = Product::all();\n $income1 = \\App\\Pembelian::join('debitur','debitur.id','=','pembelian.debiturID')\n ->join('blok','blok.blok_id', '=', 'debitur.blokID')\n ->join('products','products.id', '=', 'blok.productID')\n ->get();\n\n $income2 = \\App\\Pembayaran::join('angsuran','angsuran.id','=','pembayaran.angsurID')\n ->join('debitur','debitur.id','=','angsuran.debiturID')\n ->join('blok','blok.blok_id', '=', 'debitur.blokID')\n ->join('products','products.id', '=', 'blok.productID')\n ->get();\n\n $income = collect($income1, $income2);\n\n $income->all();\n\n\n return view('income', compact('products', 'income'));\n}\n}\n\n\nBut it end up only showing $income1 data."
] | [
"php",
"laravel",
"collect"
] |
[
"Is Servlet 3.0 XML-less configuration possible with tapestry-spring?",
"I started writing an app using Spring MVC, then decided to go with Tapestry instead. I want to keep the XML-less configuration approach that I was using originally. I first tried this:\n\npublic class ServletConfig implements WebApplicationInitializer {\n\n @Override\n public void onStartup(ServletContext servletContext) throws ServletException {\n // Spring //\n AnnotationConfigWebApplicationContext rootContext = new\n AnnotationConfigWebApplicationContext();\n rootContext.register(PersistenceContext.class, ApplicationContext.class);\n servletContext.addListener(new ContextLoaderListener(rootContext));\n\n // Tapestry //\n servletContext.setInitParameter(\"tapestry.app-package\", \"...\");\n FilterRegistration.Dynamic filter = servletContext.addFilter(\"app\", TapestrySpringFilter.class);\n filter.addMappingForUrlPatterns(null, false, \"/*\");\n }\n}\n\n\nThe problem here is that tapestry creates another ContextLoaderListener, using the empty constructor. Instead of taking in a WebApplicationContext, it looks at the contextClass and contextConfigLocation init parameters. So I tried this:\n\n@Override\npublic void onStartup(ServletContext servletContext) throws ServletException {\n // Spring //\n servletContext.setInitParameter(\"contextClass\",\n \"org.springframework.web.context.support.AnnotationConfigWebApplicationContext\");\n servletContext\n .setInitParameter(\n \"contextConfigLocation\",\n \"...config.PersistenceContext ...config.ApplicationContext\");\n\n // Tapestry //\n servletContext.setInitParameter(\"tapestry.app-package\", \"...\");\n FilterRegistration.Dynamic filter = servletContext.addFilter(\"app\", TapestrySpringFilter.class);\n filter.addMappingForUrlPatterns(null, false, \"/*\");\n}\n\n\nWhich caused this:\n\n java.lang.IllegalArgumentException: When using the Tapestry/Spring integration library, you must specifiy a context class that extends from org.apache.tapestry5.spring.TapestryApplicationContext. Class org.springframework.web.context.support.AnnotationConfigWebApplicationContext does not. Update the 'contextClass' servlet context init parameter.\n\n\nTapestryApplicationContext inherits from org.springframework.web.context.support.XmlWebApplicationContext. So my question(s): is there a way to make annotation-based configuration work with this approach? If not, is there another approach that will allow me to use it? Or is there no way to avoid the XML?\n\nI tried reverting to the first version of ServletConfig I put up on here, but I added\n\nservletContext.setInitParameter(\"tapestry.use-external-spring-context\", \"true\");\n\n\nI'm no longer getting the error message, but the page isn't loading either. When I try to load /app/, instead of loading the index page I get this:\n\n<html>\n <head>\n <title>Error</title>\n </head>\n <body>/app/index.jsp</body>\n</html>\n\n\nI'm not sure what's causing this, I can't find anything in the logs to indicate any problems. I'm thinking that there's some sort of issue with the dispatcher service. Has anybody seen this type of error before? I'm not sure if this is unrelated to my original problem or if this is a symptom of my approach not being valid. If somebody can tell me that this is a separate issue I'll take the appropriate action."
] | [
"java",
"spring",
"tapestry"
] |
[
"Iphone SDK set static IP",
"Does anyone know how to setup an IP address in iOs programmatically? It is really easy to do manually, just go to settings and configure the network. However, I want to do this inside a program, to connect to a WiFi network that do not have a DHCP server. Any pointers would help.\n\nUpdate: This does not seem to be possible. Any suggestion on what I should do instead? The app needs to connect to a network that does not have a DHCP server."
] | [
"iphone",
"ios",
"sdk",
"static",
"ip"
] |
[
"Unable to preventDefault inside passive event jquery error",
"I am using a burger menu on my website, when I click it, I receive an error. \n\n\n [Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080\n jquery.self-d03a5518f45df77341bdbe6201ba3bfa547ebba8ed64f0ea56bfa5f96ea7c074.js?body=1:4987\n\n\nHere is the jQuery error:\n\n // If preventDefault exists, run it on the original event\n if (e.preventDefault) {\n e.preventDefault(); // Shows the error is here.\n\n // Support: IE\n // Otherwise set the returnValue property of the original event to false\n } else {\n e.returnValue = false;\n }\n},..\n\n\nThere were no problem previously, I don't know what has happened. Thank you for your help."
] | [
"jquery",
"touch"
] |
[
"Eigen Dense Storage Segmentation Fault in Open3D function",
"I need to do some operation on PointCloud by using Open3D library but it gives me Segmentation Fault and debuggers don't give much information about the problem. It's weird beacause the same code works on Windows but on Ubuntu gives such an error.\nGDB backtrace output:\n#0 0x00005555555f5c77 in open3d::geometry::Geometry3D::ComputeMinBound(std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&) const (this=0x7fffffffd250, points=...) at /home/rufus/Open3D/cpp/open3d/geometry/Geometry3D.cpp:50\n#1 0x000055555561d951 in open3d::geometry::PointCloud::GetMinBound() const (this=<optimized out>) at /home/rufus/Open3D/cpp/open3d/geometry/PointCloud.cpp:52\n#2 0x0000555555622dcd in open3d::geometry::PointCloud::VoxelDownSample(double) const (this=0x7fffffffd250, voxel_size=0.01) at /home/rufus/Open3D/cpp/open3d/geometry/PointCloud.cpp:312\n#3 0x000055555557a690 in colorCloudRegistrationOptimization(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const>, boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const>, Eigen::Matrix<double, 4, 4, 0, 4, 4> const&) ()\n#4 0x000055555557d569 in main ()\n\nValgrind output:\n==7030== Process terminating with default action of signal 11 (SIGSEGV)\n==7030== Access not within mapped region at address 0x10\n==7030== at 0x1A9C47: DenseStorage (DenseStorage.h:194)\n==7030== by 0x1A9C47: PlainObjectBase (PlainObjectBase.h:520)\n==7030== by 0x1A9C47: Matrix (Matrix.h:413)\n==7030== by 0x1A9C47: open3d::geometry::Geometry3D::ComputeMinBound(std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&) const (Geometry3D.cpp:50)\n==7030== by 0x1D1920: open3d::geometry::PointCloud::GetMinBound() const (PointCloud.cpp:52)\n==7030== by 0x1D6D9C: open3d::geometry::PointCloud::VoxelDownSample(double) const (PointCloud.cpp:312)\n==7030== by 0x12E68F: colorCloudRegistrationOptimization(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const>, boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const>, Eigen::Matrix<double, 4, 4, 0, 4, 4> const&) (in /home/rufus/HoloportationLinuxPart/san_holo/build/san_holo\n\nI tried to compile it with EIGEN_DONT_ALIGN_STATICALLY but the result is the same."
] | [
"c++",
"linux",
"segmentation-fault",
"eigen",
"open3d"
] |
[
"Creating MVC Views that are not HTML",
"This is a general question about MVC as a pattern, but in this case I am using ASP.NET MVC.\n\nI need to create an application whose output is an HTTP-accessed XML stream (content type text/xml).\n\nI can do this using traditional ASP.NET using a Generic Handler object.\n\npublic void ProcessRequest(HttpContext context)\n{\n context.Response.ContentType = \"text/xml\";\n context.Response.Write(someXmlText);\n}\n\n\nCan I create an ASP.NET MVC View that achieves the same result?\n\nIs this an appropriate use of an MVC View?"
] | [
"asp.net-mvc",
"model-view-controller"
] |
[
"How to create a GTFS_RT feed from a bogus AVL feed in csv format",
"I am trying to produce a GTFS Realtime Feed from AVL data that a transit agency is providing. The thing is that there doesn't seem to be a link between the offical GTFS data and this AVL data set.\n\nThe vehicle position and 'lateness' data is under an url /gps_full.txt and is updated every 5-7 seconds. The format of the data is as follows: \n\nTransportType,RouteShortName,TransitId,VehicleNumber,Longitude,Latitude,Speed,Azimuth,TripStartTime,DeviationInSeconds,MeasurementTime,VehicleType,\nBus,20,9790770943,7031,25206880,54644738,0,232,583,0,39179,KZ,\nTrolleybus,6,9733751022,1681,25279878,54687890,0,18,622,93,39175,KZ,\n\n\nThe only primary key I could think of is a composite key (RouteShortName,TripStartTime) but I am not sure if that would not cause some collisions.\n\nIs there any better way of doing this? Maybe someone had the same issue with data from other transit agencies and could point me to some resources?\n\nI did try to search for resources myself but it seems that almost everyone had some sort of a link between the AVL feeds and static GTFS data.\n\nAll help will be greatly appreciated."
] | [
"gps",
"gtfs",
"opentripplanner"
] |
[
"How to combine a control command with a parameterized query in Kusto?",
"According to this doc page the result of a control command can be used in a query by using $command_results.\n\nNow, how to achieve that when the query makes use of query_parameters?\n\n.show tables;\ndeclare query_parameters(_rootPath:string = \"root\")\n$command_results\n| where Folder startswith _rootPath\n\n\nThis throws\n\n400 - \"General_BadRequest: Request is invalid and cannot be executed.\nSyntax error: Query could not be parsed: SYN0002: A recognition error occurred. [line:position=3:0]"
] | [
"azure-data-explorer",
"kql"
] |
[
"find all hash # links in a div and remove hash for the last twenty ones",
"I got a div with a links to gallery pictures which are generated by a script. There are -let say x numbers of links + 20 which are alwas generated by the script. \nSo every of the link has a # and number. Like www.example.com/#1. \nSo in a gallery I can have e.g 5 pictures which will have #1 #2 #3,etc and those 20 that are always generated with the number starting in this case from #6 #7 till 26#.\n\nSo my question is how to find with jQuery those last twenty url's and remove # from them.\n\nArek"
] | [
"jquery",
"hash"
] |
[
"How to hide host groups from Zabbix dashboard?",
"As shown in the image below, there's a host group I want to hide (keep out) from Zabbix dashboard.\n\n\n\nI need to remove it, because that host group is like the \"master\" host group of my system, that is, all other host group is kind of \"grouped\" in this master host group which I want to keep hidden in my dashboard.\n\nThis \"master\" host group is a summary of the other host groups. For example, if you sum up all the warning counts for Host Groups 1, 2, 3 and 5 (19 + 1 + 22 + 23) you get 65 as the answer, which is the exact \"master group\" warning count. \n\nSo, since this given host group acts as a summary of the other host groups, I don't really need it on the dashboard. Keeping it on the dashboard is even harmful because it doubles the count of everything recorded for the other host groups.\n\nIs there some way to hide that host group from my dashboard view?"
] | [
"filter",
"monitoring",
"dashboard",
"zabbix"
] |
[
"Generate SQL query for one-to-many relation",
"Actual Result: \n[ \n { id: 1, title: 'Test Tournament #$1', d_title: 'Rendering Vue Slots content to an iframe'},\n { id: 1, title: 'Test Tournament #$1', d_title: 'Example' },\n { id: 1, title: 'Test Tournament #$1', d_title: 'Example' },\n { id: 1, title: 'Test Tournament #$1', d_title: 'asdfasdf' },\n { id: 2, title: 'Test Tournament #$2', d_title: 'Rendering Vue Slots content to an iframe'},\n { id: 2, title: 'Test Tournament #$2', d_title: 'Example' },\n { id: 2, title: 'Test Tournament #$2', d_title: 'Example' },\n { id: 2, title: 'Test Tournament #$2', d_title: 'asdfasdf' } \n]\n\nExpected Result: \n[ \n { id: 1, title: 'Test Tournament #$1', detail: \n [\n { d_title: 'Rendering Vue Slots content to an iframe'},\n { d_title: 'Example'},\n { d_title: 'Example'},\n { d_title: 'asdfasdf'},\n ]\n },\n { id: 2, title: 'Test Tournament #$2', detail: \n [\n { d_title: 'Rendering Vue Slots content to an iframe'},\n { d_title: 'Example'},\n { d_title: 'Example'},\n { d_title: 'asdfasdf'},\n ]\n }\n]\n\n\nHow do I obtain the 'Expected Result' by using SQL queries?\n\nIn Laravel, we can obtain it by using the relation with table but how do I get it with pure SQL queries?"
] | [
"mysql",
"laravel"
] |
[
"Mongo details are not showing in phpinfo() in windows",
"I am installing mongodb on my windows 7 PC. I have installed mongodb 3.0 along with the necessary drivers & tried starting mongo server, it is working well but when i open the localhost & check for the phpinfo page, it does not show me the details of mongo. I also am using Umongo client for database interaction where i am not able to create database manually. It is just because of this? Where is the problem?. How to resolve this?"
] | [
"mongodb",
"mongodb-php"
] |
[
"TextInputLayout floating label custom font and edittext custom font",
"I have layout like this - \n\n<android.support.design.widget.TextInputLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\">\n\n <android.support.design.widget.TextInputEditText\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:hint=\"@string/form_username\"/>\n\n </android.support.design.widget.TextInputLayout>\n\n\nAs per our UI design document, we need to have different custom font for Floating label and Edittext.\n\nAny help is appreciated. Thank you."
] | [
"android",
"xml",
"android-layout",
"android-textinputlayout"
] |
[
"Django Viewflow with custom views - start different flows, depending on user selection in the first screen",
"I have a view with StartFlowMixin, it contains a form - user posts the form and a workflow starts. That works fine currently, but I need to introduce a dropdown in the form with 4 options - based on the selection in that dropdown I need to run a different flow.\n\nE.g. the dropdown contains options like Apply for position A, Apply for position B, etc. Based on the selection the applicant needs to enter different information and different people need to approve the application.\n\nHow can I do this? One option would be to have a single workflow with a lot of ifs, but I don't like that."
] | [
"django-viewflow"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.