texts
sequence | tags
sequence |
---|---|
[
"InstallShield Limited Edition Error ISEXP : error : -5002: Product Configuration 'Express' is not found in the specified project.",
"i have developed a application on VisualStudio 2012 and tried InstallShield Limited Edition to build and package the installer. but when i try to build my application i got an error regarding to the InstallShield the error. \n\nISEXP : error : -5002: Product Configuration 'Express' is not found in the specified project. Verify that the Product Configuration name is correct."
] | [
"visual-studio-2012",
"installshield-le"
] |
[
"CSS how to make a website scalable for 1600x1200",
"Im trying to make some sort of liquid-fixed weblayout with CSS. The problem is that the site isn't very big, so when users with big screen resolution visits the site it looks very small and empty.So I need the menubar(which is located in the bottom) and some of the main elements to use some more screen space, when visited with larger screen resolutions. Sort of \"scale to fit\" can anybody help me out please?\n\nMy CSS styling as for now is just made as a fixed weblayout."
] | [
"css",
"layout",
"web"
] |
[
"ListView acting strange due to ScrollView?",
"Screenshot: \n\n\n\nAs can be seen in the picture above for some reason I get a strange white area of nothing in my listView when using a ScrollView. If I remove the ScrollView the white area of nothing dissapears, but unfortunately I must use the ScrollView in my interface. If I fill my list with items the white \"area\" is still there and being placed beneath the items instead.\n\nAnyone seen this before? How can I remove it without removing my ScrollView which for some reason makes it appear? Ive tried to change all different type of setting such as fill_parent/wrap_content/0dip without any success so far.\n\nPlease help if you know something!\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n\n<ScrollView \nxmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:layout_height=\"fill_parent\"\nandroid:layout_width=\"fill_parent\">\n\n<TableLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\nandroid:layout_width=\"fill_parent\"\nandroid:layout_height=\"fill_parent\"\nandroid:background=\"@drawable/orginalbild\"\nandroid:fillViewport=\"true\"\nandroid:gravity=\"center|top\"\nandroid:orientation=\"vertical\"\nandroid:stretchColumns=\"1\"\nandroid:weightSum=\"1.0\">\n\n<TableRow\n android:paddingTop=\"3dp\" >\n\n <TextView\n android:layout_width=\"0dip\"\n android:layout_height=\"fill_parent\" \n android:layout_weight=\"0.04\">\n </TextView>\n\n <EditText\n android:id=\"@+id/search_task_field\"\n android:layout_width=\"0dip\"\n android:layout_height=\"fill_parent\"\n android:layout_weight=\"0.7\"\n android:hint=\"@string/SearchTaskHint\" \n />\n\n <ImageButton\n android:id=\"@+id/search_task_button\"\n android:layout_width=\"0dip\"\n android:layout_height=\"50dp\"\n android:layout_gravity=\"center\"\n android:layout_weight=\"0.22\"\n\n android:src=\"@drawable/find3\" />\n\n <TextView\n android:layout_width=\"0dip\"\n android:layout_height=\"fill_parent\" \n android:layout_weight=\"0.04\"\n android:visibility=\"invisible\"\n >\n </TextView>\n </TableRow>\n\n\n <TableRow\n android:paddingTop=\"0.9dp\"\n android:paddingRight=\"0.9dp\"\n android:paddingLeft=\"0.9dp\"\n android:background=\"#90767878\"\n android:paddingBottom=\"0.9dp\"\n android:layout_marginLeft=\"24dp\"\n android:layout_marginRight=\"24dp\"\n android:layout_marginBottom=\"20dp\"\n android:layout_width=\"fill_parent\"\n android:layout_height=\"fill_parent\">\n\n <ListView\n android:id=\"@+id/search_task_list\"\n android:layout_width=\"0dip\"\n android:layout_height=\"fill_parent\"\n android:layout_weight=\"1\"\n android:background=\"#FFFFFF\"\n android:gravity=\"left\"\n />\n</TableRow> \n </TableLayout>\n </ScrollView>"
] | [
"android",
"listview",
"background",
"scrollview",
"items"
] |
[
"Can't get FCKEditor to work in a virtual directory",
"I have a WebForm that contains the following definition for the FCKeditor:\n\n<FCKeditorV2:FCKeditor ID=\"txtBody\" runat=\"server\" \n BasePath=\"/fckeditor/\" \n Height=\"480px\"\n ToolbarSet=\"WebCal1\" \n>\n</FCKeditorV2:FCKeditor>\n\n\nThis works fine in my VS2008-based web application. However, when I deploy it to a Virtual Directory in IIS, it looks for the FCKEditor files (e.g. javascript, stylesheets, etc...) in the /fckeditor folder, not in the /MyVirtualDir/fkceditor.\n\nI've tried changing the BasePath to ~/fckeditor/, but then it won't work on my dev machine.\n\nWhat is the right way to go, so that the FCKEditor maps onto the right directory. In my project the fckeditor directory is right off the root."
] | [
"asp.net",
"visual-studio-2008",
"webforms",
"fckeditor"
] |
[
"Java library that finds sentence boundaries",
"Does anyone know of a Java library that handles finding sentence boundaries? I'm thinking that it would be a smart StringTokenizer implementation that knows about all of the sentence terminators that languages can use.\n\nHere's my experience with BreakIterator:\n\nUsing the example here:\nI have the following Japanese:\n\n今日はパソコンを買った。高性能のマックは早い!とても快適です。\n\n\nIn ascii, it looks like this:\n\n\\ufeff\\u4eca\\u65e5\\u306f\\u30d1\\u30bd\\u30b3\\u30f3\\u3092\\u8cb7\\u3063\\u305f\\u3002\\u9ad8\\u6027\\u80fd\\u306e\\u30de\\u30c3\\u30af\\u306f\\u65e9\\u3044\\uff01\\u3068\\u3066\\u3082\\u5feb\\u9069\\u3067\\u3059\\u3002\n\n\nHere's the part of that sample that I changed:\n static void sentenceExamples() {\n\n Locale currentLocale = new Locale (\"ja\",\"JP\");\n BreakIterator sentenceIterator = \n BreakIterator.getSentenceInstance(currentLocale);\n String someText = \"今日はパソコンを買った。高性能のマックは早い!とても快適です。\";\n\n\nWhen I look at the Boundary indices, I see this:\n\n0|13|24|32\n\n\nBut those indices don't correspond to any sentence terminators."
] | [
"java",
"string",
"nlp",
"text-segmentation"
] |
[
"Unit testing with jasmine",
"I'm new to jasmine. Here is my directive\n\n(function () {\n'use strict';\nangular.module('AccountPortal.components').directive('forgotPasswordForm', forgotPasswordForm);\nforgotPasswordForm.$inject = ['Account', 'accountApi', 'emailApi', 'utils', 'Exception'];\nfunction forgotPasswordForm(Account, accountApi, emailApi, utils, Exception) {\n\n var directive = {};\n directive.restrict = 'E';\n directive.templateUrl = 'app/components/_utilities/forgotPasswordForm/forgotPasswordForm.html';\n directive.controller = ['$scope', ctrl];\n directive.controllerAs = 'vm';\n directive.scope = {};\n\n return directive;\n\n function link(scope, elem, attrs, vm) {\n\n }\n\n function ctrl($scope) {\n var vm = this;\n vm.formSubmitted = false;\n vm.email = '';\n vm.forgotPasswordSubmit = function () {\n if (!vm.forgotPasswordForm.$valid) {\n return;\n }\n delete vm.forgotPasswordForm.email.$error.accountNotFound;\n Account.customerForgotPassword(vm.email)\n .then(function (response) {\n emailApi.sendForgotPasswordEmail(response.data.EmailAddress, response.data.FirstName, response.data.LastName, response.data.QueryString);\n vm.formSubmitted = true;\n })\n .catch(function (response) {\n if (response.status === 400) {\n $scope.forgotPasswordForm.email.$error.accountNotFound = true;\n }\n else {\n throw new Exception();\n }\n });\n };\n }\n}\n\n\n})();\n\nHere I've tested my controller and the function in it to be defined. In the 3rd It block, I want to test if the emailApi.sendForgotPasswordEmail function is invoked with (response.data.EmailAddress, response.data.FirstName, response.data.LastName, response.data.QueryString) arguments\n\ndescribe('forgotPasswordForm directive', function () {\nvar ctrl,emailApi, $componentController;\nbeforeEach(module('AccountPortal'));\nbeforeEach(inject(function (_$componentController_, _emailApi_) {\n $componentController = _$componentController_;\n ctrl = $componentController('forgotPasswordForm');\n emailApi=_emailApi_;\n ctrl.forgotPasswordForm = {\n $valid: true,\n email: {\n $error:{}\n }\n };\n}));\n\nbeforeEach(inject(function(_Account_) {\n Account = _Account_;\n}));\n\n\nit('forgotPasswordForm controller should be defined', function () {\n expect(ctrl).toBeDefined();\n});\n\nit('forgotPasswordSubmit function should be defined', function () {\n expect(ctrl.forgotPasswordSubmit).toBeDefined()\n});\n\nit('new password should be sent if email exists', function () {\n\n\n});\n\n\n});\n\nThanks for help guys, I really cant figure out"
] | [
"javascript",
"unit-testing",
"jasmine"
] |
[
"Absolute positioning ignoring padding of parent",
"How do you make an absolute positioned element honor the padding of its parent? I want an inner div to stretch across the width of its parent and to be positioned at the bottom of that parent, basically a footer. But the child has to honor the padding of the parent and it's not doing that. The child is pressed right up against the edge of the parent.\n\nSo I want this:\n\n\n\nbut I'm getting this:\n\n\n\n<html>\n <body>\n <div style=\"background-color: blue; padding: 10px; position: relative; height: 100px;\">\n <div style=\"background-color: gray; position: absolute; left: 0px; right: 0px; bottom: 0px;\">css sux</div>\n </div>\n </body>\n</html>\n\n\nI can make it happen with a margin around the inner div, but I'd prefer not to have to add that."
] | [
"css",
"padding",
"css-position"
] |
[
"how to change english date according to nepali date in sql2014?",
"in the below image you see that due_ndate and due_edate.many times it occurred that date due_edate is changed because of problem in database,\ndue_Edate means english date and due_ndate means nepali date.\nhow to change english date according to nepali date?"
] | [
"sql-server"
] |
[
"Fastest way to compare one byte array with many others?",
"I have a loop with the following structure :\n\n\nCalculate a byte array with length k (somewhere slow)\nFind if the calculated byte array matches any in a list of N byte arrays I have.\nRepeat\n\n\nMy loop is to be called many many times (it's the main loop of my program), and I want the second step to be as fast as possible.\n\nThe naive implementation for the second step would be using memcmp:\n\nchar* calc;\nchar** list;\nint k, n, i;\nfor(i = 0; i < n; i++) {\n if (!memcmp(calc, list[i], k)) {\n printf(\"Matches array %d\", i);\n }\n}\n\n\nCan you think of any faster way ? A few things :\n\n\nMy list is fixed at the start of my program, any precomputation on it is fine.\nLet's assume that k is small (<= 64), N is moderate (around 100-1000).\nPerformance is the goal here, and portability is a non issue. Intrinsics/inline assembly is fine, as long as it's faster.\n\n\nHere are a few thoughts that I had :\n\n\nGiven k<64 and I'm on x86_64, I could sort my lookup array as a long array, and do a binary search on it. O(log(n)). Even if k was big, I could sort my lookup array and do this binary search using memcmp.\nGiven k is small, again, I could compute a 8/16/32 bits checksum (the simplest being folding my arrays over themselves using a xor) of all my lookup arrays and use a built-in PCMPGT as in How to compare more than two numbers in parallel?. I know SSE4.2 is available here.\n\n\nDo you think going for vectorization/sse is a good idea here ? If yes, what do you think is the best approach.\nI'd like to say that this isn't early optimization, but performance is crucial here, I need the outer loop to be as fast as possible.\nThanks\n\nEDIT1: It looks like http://schani.wordpress.com/tag/c-optimization-linear-binary-search-sse2-simd/ provides some interesting thoughts about it. Binary search on a list of long seems the way to go.."
] | [
"c",
"algorithm",
"assembly",
"x86-64",
"sse"
] |
[
"Instagram logout is not working in iphone?",
"I am integrated Instagram in iPhone,At first time login page display on my iPhone and after logout when again login than credentials are not Asking and directly login. i also 'nil' old credentials on logout and i also clear cookie at logout but it not working.when i delete cookie from safari then it work fine. how to solve it programetically. \n\nLogout Button code as below\n\n-(void)doLogout\n {\n IGAppDelegate* appDelegate = (IGAppDelegate*)[UIApplication sharedApplication].delegate;\n [cookies deleteCookie:cookie];\n\n// clear cookie\n\n NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage];\n NSArray* instagramCookies = [cookies cookiesForURL:[NSURL URLWithString:@\"https://instagram.com/\"]];\n\n NSLog(@\"Array is == %@\",instagramCookies);\n\n for (NSHTTPCookie* cookie in instagramCookies) \n {\n [cookies deleteCookie:cookie];\n }\n\n// accessToken set nil\n\n [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@\"accessToken\"];\n [[NSUserDefaults standardUserDefaults] synchronize];\n [self.navigationController popViewControllerAnimated:YES];\n}"
] | [
"ios",
"iphone",
"cookies",
"instagram"
] |
[
"jQuery UI, sortables and Cookie plugin with multiple lists",
"I'm using jQuery UI sortable plugin with the cookie plugin to set and get the list of two sortable lists.\n\nI found this piece of code to set and get a cookie: http://www.shopdev.co.uk/blog/sortable-lists-using-jquery-ui/#comment-6441\n\nIt works as I want to for one list, but not two (I've made the changes listed in the comments but fail somewhere).\n\nMy guess is that I have to specify the first and the second list for the setSelector and not use a class for the list. I tried \"var setSelector = \"#first, #second\"; but that that doesn't do it. \n\nIdeas?\n\nThanks \n\n$(function() {\n\n// set the list selector\nvar setSelector = \".sortable\";\n// set the cookie name\nvar setCookieName = \"listOrder\";\n// set the cookie expiry time (days):\nvar setCookieExpiry = 7;\n\n// function that writes the list order to a cookie\nfunction getOrder() {\n // save custom order to cookie\n $.cookie(setCookieName, $(setSelector).sortable(\"toArray\"), { expires: setCookieExpiry, path: \"/\" });\n}\n\n// function that restores the list order from a cookie\nfunction restoreOrder() {\n var list = $(setSelector);\n if (list == null) return\n\n // fetch the cookie value (saved order)\n var cookie = $.cookie(setCookieName);\n if (!cookie) return;\n\n // make array from saved order\n var IDs = cookie.split(\",\");\n\n // fetch current order\n var items = list.sortable(\"toArray\");\n\n // make array from current order\n var rebuild = new Array();\n for ( var v=0, len=items.length; v<len; v++ ){\n rebuild[items[v]] = items[v];\n }\n\n for (var i = 0, n = IDs.length; i < n; i++) {\n\n // item id from saved order\n var itemID = IDs[i];\n\n if (itemID in rebuild) {\n\n // select item id from current order\n var item = rebuild[itemID];\n\n // select the item according to current order\n var child = $(\"ul\" + setSelector + \".ui-sortable\").children(\"#\" + item);\n\n // select the item according to the saved order\n var savedOrd = $(\"ul\" + setSelector + \".ui-sortable\").children(\"#\" + itemID);\n\n // remove all the items\n child.remove();\n\n // add the items in turn according to saved order\n // we need to filter here since the \"ui-sortable\"\n // class is applied to all ul elements and we\n // only want the very first! You can modify this\n // to support multiple lists - not tested!\n $(\"ul\" + setSelector + \".ui-sortable\").filter(\":first\").append(savedOrd);\n\n }\n }\n}\n\n// code executed when the document loads\n$(function() {\n // here, we allow the user to sort the items\n $(setSelector).sortable({\n cursor: 'move',\n items: 'li',\n //axis: \"y\",\n opacity: 0.6,\n //revert: true,\n scroll: true,\n scrollSensitivity: 40,\n placeholder: 'highlight',\n update: function() { getOrder(); }\n });\n\n // here, we reload the saved order\n restoreOrder();\n});\n\n\n});"
] | [
"jquery",
"jquery-ui",
"cookies",
"jquery-ui-sortable"
] |
[
"Memory management question",
"Is there a memory leaks when I set an attribut in this way : \n\ntitleView = [[UIWebView alloc] initWithFrame:CGRectMake(10, 0, 300, 5)];\n\n\nAnd is there a difference with\n\nUIWebView *newWebView = [[UIWebView alloc] initWithFrame:CGRectMake(10, 0, 300, 5)];\n[self setTitleView:newWebView];\n[newWebView release];\n\n\nThanks,\n\nEDIT : \nI'm releasing the titleView in the dalloc function"
] | [
"iphone",
"ios",
"memory-management"
] |
[
"Python Pandas: NameError: name is not defined",
"Ok, this is my first Python Pandas program and I'm having a hard time figuring out what the column name is so I can reference it in a function call.\n\nBelow is my code. parseDeviceType is calling a function to parse useragentstring. But when I call it using what I think the column name is, I get an error that name is not defined:\n\ndf = pd.read_csv('user_agent_strings.txt',index_col=None, na_values=['NA'],sep=',')\ndt=parseDeviceType(user_agent_string)\nprint df.columns\n\nNameError: name 'user_agent_string' is not defined\nIndex([u'user_agent_string'], dtype='object')\n\n\nAnd here's the header and first row of data from the input file containing the useragentstrings:\n\n\"user_agent_string\"\n\"Mozilla/5.0 (iPad; CPU OS 7_1_1 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D201 Safari/9537.53\"\n\n\nCan you help me understand how to reference the column name in the dt=parseDeviceType(user_agent_string) call? I'd like to also know how to reference it by column number if that is possible in a call to a function.\n\nThanks"
] | [
"python",
"pandas"
] |
[
"Load CSS and JS over HTTPS in Wordpress",
"One of my websites is in Wordpress. I setup SSL on the site. I would like the entire site be loaded via HTTP except 1 page lets call it PAYMENTS.\n\nHow can I achieve in Wordpress when I click in the menu PAYMENTS it loads it over HTTPS and also load all CSS and JS over HTTPS. Because when I did manually in the url: https://www.example.com/payments/ it loads without any CSS and JS because its all blocked due its loaded over HTTP in the source.\n\nAlso want to achieve that if I click in the menu any other item and it goes back to HTTP."
] | [
"wordpress",
".htaccess",
"http",
"ssl",
"https"
] |
[
"Get 400 (empty response) when sending multi-part form to django",
"I'm working on an existing Django app and need to be able to upload a file.\n\nI'm sending it a multi-part form so I can send a file and some fields, but the server I get back a 400, but the server errors silently and keeps running.\n\nHow can I allow my view to accept a multi-part form?\n\nMy route function definition is simply:\n\n@api_view(['POST'])\ndef upload(request, pk)\n print \"hello\"\n\n\nIt doesn't get to hello, so somewhere in the magical box of Django this JSON error is occuring. Can anyone give me a clue where to look? I've checked our urls.py file and see nothing that would make this decision or interrupt a request and our init.py file is empty. runserver isn't even a file... I guess it's just more django magic.\n\n(Python: 2.7, Django: 1.10.6)"
] | [
"django",
"django-rest-framework"
] |
[
"Where is the StackExchange Chat room?",
"This is informative for the users of this site. I just came across a chat section for stackoverflow. At risk of a ding I thought it useful for everyone to know about it.\n\nSo where is the chat room located?"
] | [
"livechat"
] |
[
"adding select list to Editable grid Knockout.js",
"I am testing how Knockout.js works, but am looking for a way to fix my select, so that i can choose my array. Here's my code.\n\nController (where I get my array)\n\nViewBag.FakturaProdukterId = JsonConvert.SerializeObject( new SelectList(db.FakturaProdukters, \"Id\", \"Overskrift\"));\n\n\nScript\n\nvar GiftModel = function (gifts) {\n var self = this;\n self.gifts = ko.observableArray(gifts);\n\n var Test = @Html.Raw((ViewBag.FakturaProdukterId));\n\n console.log(Test);\n\n\n self.addGift = function () {\n self.gifts.push({\n //default seleceted array value\n Beskrivelse: \"\",\n Pris: \"\"\n });\n };\n\n self.removeGift = function (gift) {\n self.gifts.remove(gift);\n };\n\n\n//where Id is the value of Array.\n var viewModel = new GiftModel([\n { Id: 0, Beskrivelse: \"Tall Hat\", Pris: \"39.95\" },\n { Id: 1, Beskrivelse: \"Long Cloak\", Pris: \"120.00\" }\n ]);\n ko.applyBindings(viewModel);\n\n // Activate jQuery Validation\n $(\"form\").validate({ submitHandler: viewModel.save });</script>\n\n\nand last i have my Cshtml:\n\n`<select data-bind=\"\n options: Test,\n optionsText: Text,\n value: Value,\n optionsCaption: 'Choose...'\">\n\n </select>`\n\n\nto sum up, I want the array to be binded with the select. If possible i would like to use the Html.helper\nThanks in Advance \n\nEdit:\nAfter editing to fitting the answer given, i get this error\n\n Uncaught ReferenceError: Unable to process binding \"foreach: function (){return gifts }\"\nMessage: Unable to process binding \"options: function (){return gifts }\"\nMessage: gifts is not defined\n at options (eval at parseBindingsString (knockout-3.4.2.js:68), <anonymous>:3:60)\n at update (knockout-3.4.2.js:94)\n at function.a.B.i (knockout-3.4.2.js:73)\n at Function.Uc (knockout-3.4.2.js:52)\n at Function.Vc (knockout-3.4.2.js:51)"
] | [
"javascript",
"jquery",
"asp.net-mvc",
"knockout.js"
] |
[
"How to get mid point of triangle in opegl",
"i have code of triangle drawing on plane which are follow\n\n glTranslatef(0,0,-6);\n\n\n glBegin(GL_TRIANGLES); \n glVertex3f( 0.2, 0.0, 0.0 ); \n glVertex3f( 0.0, 0.2, 0.0 ); \n glVertex3f( 0.0, 0.0, 0.2 ); \n glEnd();\n\n\nIf i m right triangle is drawing from point (0,0,-6). I want to calculate the middle point and vertices of triangle ( more and less like radius or diameter of circle). Is it right angle triangle ?"
] | [
"opengl",
"game-physics"
] |
[
"Creating SUMO logic pie chart with SUM totals",
"I would like to create a SUMO logic pie chart however I am having difficultu doing it with SUM totals. below you can see my query\n\n_sourceCategory=MyAppSource\n| parse \"* [*] {\\\"machineName\\\":*,\\\"requestPath\\\":*,\\\"requestMethod\\\":*,\\\"requestSize\\\":*,\\\"requestType\\\":*,\\\"service\\\":*,\\\"duration\\\":*,\\\"stack\\\":*,\\\"errorMessage\\\":*,\\\"errorObject\\\":*,\\\"userName\\\":*,\\\"clientId\\\":*,\\\"statusCode\\\":*,\\\"traceIdentifier\\\":*}\" as TimeStamp,Subject,MachineName,RequestPath,RequestMethod,RequestSize,RequestType,Service,Duration,Stack,ErrorMessage,ErrorObject,UserName,ClientID,StatusCode,TraceIdentifier\n| if (Duration >= 40, 1, 0) as RequestTimeGreaterThan40ms\n| if (Duration < 40, 1, 0) as RequestTimeUnder40ms \n| sum(RequestTimeGreaterThan40ms) as RequestTimeGreaterThan40ms, sum(RequestTimeUnder40ms) as RequestTimeUnder40ms\n| RequestTimeGreaterThan40ms + RequestTimeUnder40ms as TotalRequest\n| (RequestTimeGreaterThan40ms/TotalRequest)*100 as RequestTimeGreaterThan40ms\n| (RequestTimeUnder40ms/TotalRequest)*100 as RequestTimeUnder40ms\n\n\nThis produces this result:\n\n\n\nHowever when I look at my pie chart it looks like this \n\n\n\nMy question:\nAs you can see my issue is that the pie chart is only grabbing the first value which would be 4.03717 and nothing else. I need to transpose the other columns into rows so that the pie chart can understand that these are different values and they all need to be represented in the pie chart. Does anyone know what would be the best way to do this?"
] | [
"sumologic"
] |
[
"two side slide menu in onsen-ui skips main page, while swiping from right menu",
"Im implementing facebook like two side swipe menus for phone app, Im using the following code in \n\ncode herehttp://codepen.io/anon/pen/xGWPVj\n\nslide right and left work fine when i use top extreme buttons, but when try swiping on phone (click drag pages on PC) there are anomalies. \nwhen i swipe this way\n\n1) main page to left menu - works fine\n2) left menu to main page - works fine\n3) main page to right menu - works fine\n4) right menu to main page - fails, instead of main page it goes to left menu\nafter 4. main page never accessible\n\n\ni tried to nest the sliding menu in other way around then right menu gives same symptoms and left works fine.\n\nshould i stop propagating touchmove/drag event in any pages?"
] | [
"onsen-ui"
] |
[
"Performance tuning powershell text processing",
"I have a SSIS Script Task written in C# and I want it ported to powershell to be used as a script. The C# version runs in 12.1s, but the powershell version takes 100.5s almost an order of magnitude slower. I'm processing 11 text files (csv) with about 3-4 million rows in each of the format:\n\n<TICKER>,<DTYYYYMMDD>,<TIME>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>\nAUDJPY,20010102,230100,64.30,64.30,64.30,64.30,4\nAUDJPY,20010102,230300,64.29,64.29,64.29,64.29,4\n<snip>\n\n\nI want to simply write out the contents to a new file where the column has a date of 20110101 or later. Here's my C# version:\n\n private void ProcessFile(string fileName)\n {\n string outfile = fileName + \".processed\";\n StringBuilder sb = new StringBuilder();\n using (StreamReader sr = new StreamReader(fileName))\n {\n string line;\n int year;\n while ((line = sr.ReadLine()) != null)\n {\n year = Convert.ToInt32( sr.ReadLine().Substring(7, 4));\n if (year >= 2011)\n {\n sb.AppendLine(sr.ReadLine());\n }\n }\n }\n\n using (StreamWriter sw = new StreamWriter(outfile))\n {\n sw.Write(sb.ToString());\n }\n }\n\n\nHere's my powershell version:\n\nforeach($file in ls $PriceFolder\\*.txt) {\n $outFile = $file.FullName + \".processed\"\n $sr = New-Object System.IO.StreamReader($file)\n $sw = New-Object System.IO.StreamWriter($outFile)\n while(($line = $sr.ReadLine() -ne $null))\n { \n if ($sr.ReadLine().SubString(7,4) -eq \"2011\") {$sw.WriteLine($sr.ReadLine())}\n } \n}\n\n\nHow can I get the same performance in powershell that I can get in my C# Script Task in SSIS?"
] | [
"c#",
"performance",
"powershell"
] |
[
"Is there a standard/common practice for documenting an event handler?",
"This is something that causes me some pause from time to time. It seems like I need to provide \na description for sender and e. Since I cannot think of anything particularly meaningful I'd prefer to delete the two param elements.\n\n /// <summary>\n /// Fired when the destination project is updated.\n /// </summary>\n /// <param name=\"sender\"></param>\n /// <param name=\"e\"></param>\n private void UpdateDestinations(object sender, EventArgs e)"
] | [
".net",
"documentation"
] |
[
"UITextField within UIView not responding to user interaction",
"Here's my scenario:\n\nI have a UIViewController in my StoryBoard for my mapping feature. I'm adding a Google Map view (GoogleMaps iOS 1.3.1) like:\n\nGMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86\n longitude:151.20 zoom:6];\nmapView_ = [GMSMapView mapWithFrame:CGRectMake(0, 49, 320, 450) camera:camera];\nmapView_.myLocationEnabled = YES;\nself.view = mapView_;\n\n\nI created a custom view: MapTopBar.xib. Simply put, it's a UIView with an UIImageView (background) and a UITextField & Button. It has a backing class file and all of the UITextFields properties have been set (delegate, outlets, etc).\n\nI'm adding my custom view to my Map VC like:\n\nUIView *topBar = [[MapTopBar alloc] initWithFrame:CGRectMake(0, 0, 320, 49)];\n[self.view addSubview:topBar];\n\n\nMy custom view is being added to the main view, but the UITextField is not receiving any touch events. The keyboard is not being displayed, no cursor in the field, nothing. It's as if something is covering it up, not allowing any user interaction. The button next to it can be pressed and works fine. \n\nI've tried doing this many different ways (creating the entire topBar view programmatically, adding the text field programmatically) and no matter what, the text field will not get user interaction.\n\nI've enabled user interaction, made sure no view was on top of the text field, all for null. I feel like I'm missing something simple. Why can't I interact with my textfield?\n\nAlso: in case it's relevant, the code above is within it's own sub being called from the viewDidLoad before the super call."
] | [
"ios",
"ios6",
"uitextfield"
] |
[
"Group data with id and get data from first and last row",
"I have a database table schedules, which look like this:\n\n\n\nNow, I am trying to get data such as:\n\n----------------------------------------------\n| id | bus_id | route | dept_time | arr_time |\n----------------------------------------------\n| 1 | 1 | 1, 4 | 07:00:59 | 23:30:30 |\n----------------------------------------------\n\n\nroute is just the collection of station_id which can be indexed using route_index. When arr_time is NULL, its mean it is the departing station and when dept_time is NULL, its mean, it is the destination. I have group the route with this query:\n\nSELECT id,bus_id,GROUP_CONCAT(station_id SEPARATOR ', ') AS route FROM schedules GROUP BY bus_id;\n\n\nBut I don't know how to get the arr_time and dept_time using this query. Also, how to get station names instead of id in this query. Station table only contains (id and name)."
] | [
"mysql",
"sql",
"database",
"select",
"group-by"
] |
[
"ARC two-way relationship",
"So I want to have multiple nodes that are connected. Every node has outgoing and incoming connections. But the NSMutableArrays are creating leaks although i'm using ARC. How can i get the objects to be released properly? I'm already using an autoreleasepool.\n\n\nThe code so far is:\n\n@interface TestObj()\n@property(strong) NSMutableArray *incoming;\n@property(strong) NSMutableArray *outgoing;\n@end\n\n@implementation TestObj\n@synthesize incoming,outgoing;\n\n- (id)init\n{\n self = [super init];\n if (self) {\n incoming = [NSMutableArray array];\n outgoing = [NSMutableArray array];\n }\n return self;\n}\n\n-(void)addIncoming:(TestObj *)incomingN {\n if([incoming indexOfObject:incomingN] == NSNotFound) {\n [incoming addObject:incomingN];\n [incomingN addOutgoing:self];\n }\n}\n\n-(void)addOutgoing:(TestObj *)outgoingN {\n if([outgoing indexOfObject:outgoingN] == NSNotFound) {\n [outgoing addObject:outgoingN];\n [outgoingN addIncoming:self];\n }\n}"
] | [
"ios",
"objective-c",
"cocoa",
"automatic-ref-counting"
] |
[
"SVN to Git Migration: additional commits found in gitlab",
"I had a repository in SVN, which i moved to Git using the \"Git SVN Clone\" command.\n\nAfter Migrating repository, when checking the history of some of the files, we could see additional commits.\n\nFor example, lets say I have a file File.txt in SVN with 3 commits (lets say commit ids are r4, r5 and r6). After the migration, history of File.txt in GitLab shows more commits i.e (2dcdb6 corresponds r4, 5fgefd3 corresponds r5, 6sdsdr2 corresponds r6 and also 3jdhes5 corresponds r1, 1sdfer4 corresponds r2)\n\nIn r1 and r2, File.txt is not modified. When opening the commits 3jdhes5 and 1sdfer4 in GitLab it does not show the File.txt changes => which is expected.\n\nBut the History of File.txt is displaying the commits 3jdhes5 and 1sdfer4."
] | [
"git",
"gitlab",
"git-svn"
] |
[
"How to change DbSchema for Entity Framework at runtime?",
"We are using EF5.0 in our project and we are supplying the Db Schema name using following code in the OnModelCreatingevent \n\nstring schemaName = DbSchema; \nmodelBuilder.Configurations.Add(new TableMap(schemaName));\n\n\nBut our problem is that the OnModelCreating event is called only once(even if I create context object again) and we need to change the Db Schema name for different databases which we are processing in a loop.\n\nI believe that EF 6.0 has a method like HasDefaultSchema but I am unable to find a way for EF5.0\n\nIs there any way to achieve this?"
] | [
"c#",
"oracle",
"entity-framework"
] |
[
"IE11 width calc() not evaluating in border & padding when using inline-table or inline-block",
"I am having an issue with IE11 and utilizing the CSS calc() function along with display: inline-block and/or display: inline-table.\n\nCurrently I have a text input and a button that should be next to each other (inline), with the button always being a fixed width and the input should take up the available space leftover (i.e. calc(100% - 92px)). Both elements are display: inline-table;. In all other browsers, doing this calc() worked fine. In IE11, it drops the button to the next line.\n\nIncluded in the JSBin are a couple styles at the bottom that make the elements appear inline, although this fix will not work for an end result. What I did was added display:inline-block to both the input & button and also removed padding and border from the input. At the end of the day, the input **must have padding & border` so this will not work for my use case.\n\n^^ box-sizing: border-box fixed that \"hack\", but the issue as a whole still exists in IE11.\n\nHere is the JSBin (in order to see the issue, you must be using IE11)\n\nThe CSS, as it stands now, looks like this... \n\nbody, dd, figure, form {\n margin: 0;\n}\n\nform {\n margin-top: 1.6875rem;\n width: 100%;\n margin-right: auto;\n margin-left: auto;\n}\n\nform fieldset {\n margin: 0;\n padding: 0;\n border:0;\n}\n\ninput {\n border: none;\n border-radius: 0;\n outline: 0;\n margin: 0;\n padding: 0;\n text-align: left;\n}\n\ninput {\n font-size: 12px;\n line-height: 15px;\n display: inline-table;\n padding: 4px 12px 5px;\n border: 1px solid #000;\n border-radius: 0;\n background-color: #fff;\n color: #999;\n font-style: italic;\n font-weight: 300;\n vertical-align: top;\n margin: 6px 0 14px;\n margin-top: 0;\n margin-bottom: 0; \n width: calc(100% - 92px);\n height: 40px;\n}\n\nbutton {\n border: 0;\n height: 40px;\n text-transform: uppercase;\n margin-top: 0;\n margin-bottom: 0;\n font-size: 13px;\n display: inline-table;\n position: relative;\n padding: 0;\n background-color: #000;\n color: #fff;\n width: 92px;\n}\n\n\nI'm assuming there is a bug with IE11 and calc() in which calc() doesn't take into account the border/padding when an element is display:inline-block or display:inline-table, although I could not find anything in my research to suggest this 100%. \n\nUltimately my question is, how do I get two elements to be \"inline\" with one being a fixed pixel value and the other a percentage width that is cross browser compliant. \n\nEDIT: added box-sizing: border-box which made the display: inline and padding/border: 0 obsolete at the bottom of the JSBin. The issue still persists in IE11 though."
] | [
"css",
"layout"
] |
[
"how to refresh listview using arrayadapter",
"I am working on getting the song played from the sdcard and when the particular song is being searched then on its OnItemClickListener() the particular song should be played. But the listview does not refresh by using adapter.setNotifydatasetChanged() method. \nHere's my code:\n\n mAdapter = new ArrayAdapter<String>(this,\n android.R.layout.simple_list_item_1, songs);\n mListView.setAdapter(mAdapter);\n\n\non search:\n\n inputsearch.addTextChangedListener(new TextWatcher() {\n\n @Override\n public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {\n // When user changed the Text\n\n mAdapter.getFilter().filter(cs);\n updatelist();\n //mListView.invalidateViews();\n //mAdapter.notifyDataSetChanged();\n }\n\n @Override\n public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,\n int arg3) {\n // TODO Auto-generated method stub\n\n }\n\n @Override\n public void afterTextChanged(Editable arg0) {\n //updatelist();\n\n\n\n }\n });\n\n\nthe playlist is generated using the cursor originally:\n\n private void generate_Playlist() {\n // TODO Auto-generated method stub\n uri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;\n String projection[] = { android.provider.MediaStore.Audio.Media.DATA,\n android.provider.MediaStore.Audio.Media.TITLE,\n android.provider.MediaStore.Audio.Media.ARTIST,\n android.provider.MediaStore.Audio.Media.ALBUM,\n android.provider.MediaStore.Audio.Media.DURATION };\n mCursor=this.managedQuery(uri, projection, null, null, null);\n songs=new ArrayList<String>();\n while(mCursor.moveToNext())\n {\n songs.add(mCursor.getString(1));\n }\n}\n\n\nAnd the updatelist():\n\n private void updatelist()\n{\n mCursor=this.managedQuery(uri, new String[] {\n MediaStore.Audio.Media.ARTIST,\n MediaStore.Audio.Media.ALBUM,\n MediaStore.Audio.Media.TITLE,\n MediaStore.Audio.Media._ID,\n MediaStore.Audio.Media._ID}, null, null, null);\n\n //mAdapter.clear();\n mListView.invalidateViews();\n mAdapter.notifyDataSetChanged();\n\n}\n\n\nEDIT:\nthe updatelist method:\n\n private void updatelist()\n{ \n mCursor=this.managedQuery(uri, new String[] {\n MediaStore.Audio.Media.ARTIST,\n MediaStore.Audio.Media.ALBUM,\n MediaStore.Audio.Media.TITLE,\n MediaStore.Audio.Media._ID,\n MediaStore.Audio.Media._ID}, null, null, null);\n while(mCursor.moveToNext())\n {\n songs.add(mCursor.getString(1));\n }\n //mAdapter.clear();\n mListView.invalidateViews();\n\n mAdapter.notifyDataSetChanged();\n\n}"
] | [
"android",
"listview",
"search"
] |
[
"Android Developer: change version",
"Is there a way to change the Android version on my app without redoing everything? I just realized that Nook Color only has version 1.4. Well, I have my app set at 3.2 ... so those who have the Nook Color will not be able to access it. Why on earth did I do this to myself!\n\nI am using Eclipse."
] | [
"android"
] |
[
"how to show images in RDLC report?",
"i have a column were i want the image to come out but at run-time only the name appears\n\n\n MIMEType: image/jpeg Source: Database Value: =Fields!Image.Value\n\n\ni saw this code but idk were to put it:\n\n\n MemoryStream ms = new MemoryStream();\n \n Image.Save(ms, System.Drawing.Imaging.ImageFormat.Png);\n \n return ms.ToArray();\n\n\nplease help"
] | [
"vb.net",
"rdlc"
] |
[
"Vue.js script not working in my heroku Laravel app",
"I'm trying to deploy a laravel app on heroku. All is going well except on all the vue.js script.\nI already have node js buildpack and tried running npm run prod at heroku.\nMy laravel app is working perfectly in my local.\nThis is the error I get from the console: https://imgur.com/a/uqFC97y\nThis is my site:http://dqrs.herokuapp.com/queues/create\nHow to replicate error:\n\nChoose any of the departments.\nExpected result: A dropdown list with options should appear below the transaction label.\n\nMy code for the buttons that will trigger the transaction dropdown:\n<div class=" btn-group-toggle col-sm-12 col-md-4 text-center mt-2">\n <label @click="setDropdown('{{$department->name}}')" class="btn btn-default btn-lg w-100 text-uppercase" onclick="getdept({{$department}})">\n <input type="radio" name="department" value="{{ $department->name}}" sr-only required> {{ $department->name}}\n </label>\n </div>\n\nMy transaction dropdown code:\n<div class="col-sm-12 col-md-4 form-group{{ $errors->has('transaction') ? ' has-danger' : '' }}">\n <label class="form-control-label" for="input-transaction">{{ __('Transaction') }}</label>\n <select class="form-control form-control-md" v-if="dropdown.length" v-model="selected" name="transaction" required>\n <option v-for="item in dropdown" :value="item">@{{ item }}</option>\n <option>Other</option>\n </select>\n @if ($errors->has('transaction'))\n <span class="invalid-feedback" role="alert">\n <strong>{{ $errors->first('transaction') }}</strong>\n </span>\n @endif\n </div>\n\nMy vue.js script:\n<script>\n const app = new Vue({\n el:'main',\n data:{\n dropdown: [],\n selected: null,\n trans:{\n\n}\n\n },\n mounted(){\n this.getTrans();\n $('#confirmModal').modal({\n backdrop: 'static',\n keyboard: false\n });\n },\n methods:{\n getTrans(){\n axios.get('create/transactions')\n .then((response)=>{\n this.trans=response.data\n })\n\n .catch(function (error){\n console.log(error);\n });\n },\n setDropdown: function (type) {\n this.selected = null;\n this.dropdown = this.trans[type];\n console.log(type)\n },\n\n isPrio(value) {\n document.getElementById('prio').value = value;\n $('#confirmModal').modal('hide');\n }\n\n }\n })\n</script>"
] | [
"php",
"laravel",
"vue.js",
"heroku"
] |
[
"How to block usage of DateTime.parse() from coders on VisualStudio project?",
"We want our coders to NOT use DateTime.parse().\nHow can we block to use it?\nCan we override this, to hide from them?\n\nEDIT1\nActually we want to override this method, we have our own method which gets called this way: clsStrUtils.ISOToDate().\n\nEDIT2\n\nWe do trust our programmers, but this is a specific situation. I don't want to restrict no-one using a better way, I just want to restrict Parse(). They can still use ParseExact()."
] | [
"c#",
"visual-studio",
"overriding"
] |
[
"Weblogic Stuck Thread - ArrayList",
"We have JSF2.1 app deployed in weblogic10.3.4 ,in one of our backing bean ,when we try to assign the reference ArrayList to a List instance ,weblogic ends up in Struck thread ,during peak traffic to our application.\n\njava.util.ArrayList.indexOf(ArrayList.java:210)\njava.util.ArrayList.contains(ArrayList.java:199)\n\n\nAny one has faced this issue before."
] | [
"java",
"jsf-2",
"weblogic-10.x"
] |
[
"Table in Word looks different if halted on breakpoint",
"I have stumbled on a very annoying problem when setting column widths on a table in Word (using Microsoft Office 15.0 Object Library, VS 2013). If I run the code below without having any breakpoints, the result becomes incorrect (first column width should be 30%), but if I put a breakpoint (e.g.) on line 47, the generated Word file becomes as I want it to be.\n\nThe conclusion I make is that when the debugger stops execution, the given column size values are flushed into the data model and the output will be as I want it to be. Without the breakpoint, the merging of cells changes the widths (e.g. the first column becomes 12,5%).\n\nI have searched for some sort of method/function to make the data model adjust to my programmatically given column sizes before the cell merging, with no luck. Anyone out there that can explain why halting on the breakpoint will change the output?\n\nRegards,\nOla\n\nusing System;\nusing System.Linq;\nusing System.Runtime.InteropServices;\nusing Microsoft.Office.Interop.Word;\n\nnamespace ShowWordProblem\n{\n class Program\n {\n private const string WordFileName = @\"C:\\temp\\test.doc\";\n static void Main(string[] args)\n {\n var wordApplication = new Application();\n wordApplication.Visible = false;\n var wordDocument = wordApplication.Documents.Add();\n\n FillDocument(wordDocument);\n\n wordDocument.SaveAs2(WordFileName);\n wordDocument.Close();\n\n wordApplication.Quit(Type.Missing, Type.Missing);\n Marshal.FinalReleaseComObject(wordApplication);\n\n wordApplication = null;\n wordApplication = new Microsoft.Office.Interop.Word.Application();\n wordApplication.Visible = true;\n wordApplication.Documents.Open(WordFileName);\n }\n\n private static void FillDocument(Document wordDocument)\n {\n Range range = wordDocument.Content.Paragraphs.Add().Range;\n\n var table = range.Tables.Add(range, 5, 8);\n table.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;\n table.PreferredWidth = (float)100.0;\n table.Columns.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;\n\n table.Columns.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;\n table.Columns[1].PreferredWidth = 30;\n for (int i = 2; i <= 8; i++) table.Columns[i].PreferredWidth = 10;\n\n var widths = table.Columns.OfType<Column>().Select(c => c.Width).ToArray();\n\n MergeGroupHeaderCells(table.Rows[1], 5, 9);\n MergeGroupHeaderCells(table.Rows[1], 2, 5);\n }\n\n private static void MergeGroupHeaderCells(Row row, int startIndex, int lastIndex)\n {\n var r = row.Cells[startIndex].Range;\n Object cell = WdUnits.wdCell;\n Object count = lastIndex - startIndex - 1;\n r.MoveEnd(ref cell, ref count);\n r.Cells.Merge();\n }\n }\n}"
] | [
"debugging",
"office-interop"
] |
[
"java.lang.UnsatisfiedLinkError: Couldn't load native_sample from loader",
"The errors:\n\nProcess: com.example.syafiq.opencvoi, PID: 7760\njava.lang.UnsatisfiedLinkError: Couldn't load native_sample from loader dalvik.system.PathClassLoader[dexPath=/data/app/com.example.syafiq.opencvoi-13.apk,libraryPath=/data/app-lib/com.example.syafiq.opencvoi-13]: findLibrary returned null\nat java.lang.Runtime.loadLibrary(Runtime.java:358)\nat java.lang.System.loadLibrary(System.java:526)\nat com.example.syafiq.opencvoi.Sample3Native$1.onManagerConnected(Sample3Native.java:79)\nat org.opencv.android.AsyncServiceHelper$3.onServiceConnected(AsyncServiceHelper.java:319)\nat android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1114)\nat android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1131)\nat android.os.Handler.handleCallback(Handler.java:733)\nat android.os.Handler.dispatchMessage(Handler.java:95)\nat android.os.Looper.loop(Looper.java:146)\nat android.app.ActivityThread.main(ActivityThread.java:5602)\nat java.lang.reflect.Method.invokeNative(Native Method)\nat java.lang.reflect.Method.invoke(Method.java:515)\nat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)\nat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)\nat dalvik.system.NativeStart.main(Native Method)\n\n\nThe sample3Native.java line 79 were:\n\n public void onManagerConnected(int status) {\n switch (status) {\n case LoaderCallbackInterface.SUCCESS:\n {\n Log.i(TAG, \"OpenCV loaded successfully\");\n\n // Load native library after(!) OpenCV initialization\n System.loadLibrary(\"native_sample\");\n\n\nAnd the AsyncServiceHelper.Java line 319 were\n\nmUserAppCallback.onManagerConnected(status);\n\n\nAndroid.mk\n\nLOCAL_PATH := $(call my-dir)\ninclude $(CLEAR_VARS)\ninclude ../../sdk/native/jni/OpenCV.mk\nLOCAL_MODULE := native_sample\nLOCAL_SRC_FILES := jni_part.cpp\nLOCAL_LDLIBS += -llog -ldl\ninclude $(BUILD_SHARED_LIBRARY)\n\n\nAnd application.mk\n\nAPP_STL := gnustl_static\nAPP_CPPFLAGS := -frtti -fexceptions\nAPP_ABI := armeabi armeabi-v7a\nLOCAL_ARM_NEON := true\n\n\nThere's no errors in the codes. I've tried several solution but yet the result are still the same, The codes was obtained from open source website. I'm not good enough with android studio, and I'm still learning. I hope you guys can help me to solve this error. I really appreciate your help and consideration to help me and solve my error. I appreciate your time :)"
] | [
"java",
"android",
"classloader"
] |
[
"How do I call a Network Image type in a ListView?",
"I have a gridView that should display a network Image. All its elements are defined in a List with multiple elements. It calls an AssetImage right now but I want to change it to a network Image. This is the declaration of the elements of the list. \nI want to change the imagePath but I can't understand the declaration. \n\nclass Category {\n Category({\n this.title = '',\n this.imagePath = '',\n this.lessonCount = '',\n this.money = 0,\n this.rating = 0.0,\n });\n\n String title;\n String lessonCount;\n int money;\n double rating;\n String imagePath;\n\n static List<Category> offerwallList = <Category>[\n\n Category(\n imagePath: 'assets/app/games.png',\n title: 'Games',\n lessonCount: 'Play Games',\n money: 18,\n rating: 4.6,\n ),\n ];\n\n\nIt is also defined in a few other places as below which is also something I will have to change. \n\n child: Image.asset(category.imagePath)"
] | [
"user-interface",
"flutter",
"dart",
"uiimageasset"
] |
[
"How can I bind a Python list as a parameter in a custom query in SQLAlchemy and Firebird?",
"Environment\n\nI am using Firebird database with SQLAlchemy as ORM wrapper.\n\nBackgound\n\nI know that by using in_ it is possible to pass the sales_id list in IN clause and get the result.\n\nI have a use case where I must use textual sql.\n\nQuestion\n\nHere is my snippet, \n\nconn.execute('select * from sellers where salesid in (:sales_id)', sales_id=[1, 2, 3] ).fetchall()\n\n\nThis always throws token unknown error\n\nAll I need is to pass the list of sales_id ([1, 2, 3]) to bind parameter (:sales_id) and get the result set."
] | [
"python",
"sqlalchemy",
"firebird"
] |
[
"Error \"not all arguments converted during string formatting\" pymysql",
"This is my code and I'm getting the error \"not all arguments converted during string formatting\" in python 2.7 I can't understand what I am doing wrong here, can anyone help with this? Thanks!\n\n\r\n\r\nimport csv\r\nimport pymysql\r\n\r\n\r\nmydb = pymysql.connect(host='127.0.0.1', user='root', passwd='root', db='jupix', unix_socket=\"/Applications/MAMP/tmp/mysql/mysql.sock\")\r\ncursor = mydb.cursor()\r\ncsv_data = csv.reader(open('activeproperties.csv'))\r\n\r\nprint(\"Connect Success\")\r\n\r\nfor row in csv_data:\r\n cursor.execute('INSERT INTO ALL_ACTIVE_PROPERTIES(Property ID, Reference_Number,Address_Name,Address_Number,Address_Street,Address_2,Address_3,Address_4,Address_Postcode,Owner_Contact_ID,Owner_Name,Owner_Number_Type_1,Owner_Contact_Number_1,Owner_Number_Type_2,Owner_Contact_Number_2,Owner_Number_Type_3,Owner_Contact_Number_3,Owner_Email_Address,Display_Property_Type,Property_Type,Property_Style,Property_Bedrooms,Property_Bathrooms,Property_Ensuites,Property_Toilets,Property_Reception_Rooms,Property_Kitchens,Floor_Area_Sq_Ft,Acres,Rent,Rent_Frequency,Furnished,Next_Available_Date,Property_Status,Office_Name,Negotiator,Date_Created)' 'VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)', row)\r\n\r\nmydb.commit()\r\ncursor.close()\r\nprint\"Imported!\""
] | [
"python",
"mysql",
"python-2.7",
"pymysql"
] |
[
"localhost loading forever .asp.net waiting for localhost forever read it but not working",
"I was coding on the script side and I was testing it. I finished my project and added it to the folder where the physical path is located, but localhost is being installed continuously and I don't know what the problem is."
] | [
"iis",
"localhost",
"load",
"port"
] |
[
"How can you tell the size of a register in x86?",
"How would you know how to fill in the underscore in the following assembly code:\n\nmov_ %eax, (%rsp)\n\n\nIt's either \"b\" for byte, \"w\" for word, \"l\" for double word, or \"q\" for quad. The syntax of the registers is supposed to (I think) indicate how much data is getting moved. I've looked through my book and can't seem to sort how this is determined.\n\nIs there a general way of figuring this out?"
] | [
"assembly",
"x86"
] |
[
"python ssh(paramiko) fail to connect to remote machine without password?",
"I want to connect to my remote machine with python module paramsiko. First, I try with password, it is ok, like this:\n\nimport paramiko\nimport socket\nimport os\n\nparamiko.util.log_to_file('demo_sftp.log')\nusername = 'xxxxx'\nhostname = 'dev81'\nPort = 22\npassword = \"xxxxx\"\nt = paramiko.Transport((hostname, Port))\nt.connect(None, username, password)\nsftp = paramiko.SFTPClient.from_transport(t)\n# dirlist on remote host\ndirlist = sftp.listdir('.')\nprint(\"Dirlist: %s\" % dirlist)\n\n\nthen I want to remove password, use key, according to demo in demo_sftp like this:\n\nimport paramiko\nimport socket\nimport os\n\nparamiko.util.log_to_file('demo_sftp.log')\nusername = 'xxxxx'\nhostname = 'dev81'\nPort = 22\npassword = None\nhost_keys = paramiko.util.load_host_keys(os.path.expanduser('~/.ssh/known_hosts'))\nhostkeytype = host_keys[hostname].keys()[0]\nhostkey = host_keys[hostname][hostkeytype]\nprint('Using host key of type %s' % hostkeytype)\nt = paramiko.Transport((hostname, Port))\nt.connect(hostkey, username, password, gss_host=socket.getfqdn(hostname),\n gss_auth=True, gss_kex=True)\nsftp = paramiko.SFTPClient.from_transport(t)\n# dirlist on remote host\ndirlist = sftp.listdir('.')\nprint(\"Dirlist: %s\" % dirlist)\n\n\nThis fail with Exception paramiko.ssh_exception.BadAuthenticationType: ('Bad authentication type', [u'publickey', u'password']) (allowed_types=[u'publickey', u'password'])\n\nAnd I can login with command ssh xxxxx@dev81 without password"
] | [
"python",
"ssh",
"sftp"
] |
[
"Fire a controller action from a jQuery Autocomplete selection",
"I have a jQuery autoselect box displaying the correct data. Now I would like to fire an ASP.NET MVC 3 controller when an item is selected. The controller should then redirect to a View. Here's my jQuery autocomplete code (I'm sure something is missing in the 2nd Ajax call, but I haven't found it yet):\n\n<script type=\"text/javascript\">\n $(function () {\n $(\"#Client\").autocomplete({\n source: function (request, response) {\n $.ajax({\n url: 'Entity/GetClientAutoComplete', type: 'POST', dataType: 'json',\n data: { query: request.term },\n success: function (data) {\n response($.map(data, function (item) {\n return { label: item, value: item };\n }))\n }\n })\n },\n minLength: 1,\n select: function (event, ui) {\n $.ajax({\n url: 'Entity/GetApplicationsByName/' + ui.item.value, type: 'POST'\n })\n }\n });\n });\n </script>\n\n\nAnd here's the controller I'm trying to call:\n\n public ActionResult GetApplicationsByName(string id)\n {\n ViewBag.Client = id;\n var apps = _service.GetDashboardByName(id);\n return View(\"Dashboard\", apps.ToList());\n }\n\n\nWhen I watch the Ajax call fire in Firebug, I see the correct URL configuration, but nothing else happens. It's acting as though it wants to load something rather than send something. I'm confused. Thank you for any guidance."
] | [
"asp.net",
"jquery-ui",
"asp.net-mvc-3"
] |
[
"Scala/Play thread pool metrics",
"Is there any way to get thread pool metrics in Scala or Play Framework?\n\nIn scala.concurrent I can only access \n\nExecutionContextExecutor\n\n\nwhich does not have the methods returning active connections, queued task count etc.\n\nI cannot cast it the implementations which have access to the executor since they are private.\n\nThank you for any help."
] | [
"scala",
"playframework"
] |
[
"Add space on top of second row of divs in a grid",
"I'm using Bootstrap and have a bunch of boxes in a grid shape (think of a store's items search result page). I want there to be space on top of all the item boxes except for those on the first row. It's hard to do with CSS because they stack differently depending on the viewport size. \n\nI've tried adding a margin top to ALL of them but then I have the space on the top row, too. I would work with that if there was no other option but I'm wondering if there's a better way.\n\n\n\nAnd here's a bootply to work with."
] | [
"javascript",
"jquery",
"html",
"css",
"twitter-bootstrap"
] |
[
"SQLite binding blob in C is terminated early",
"I have a png file that is to be stored in a database, however, even when passing a length to sqlite3_bind_blob() it stops filling in the value at the first nul character.\n\nHere's the code in question:\n\nfseek(file,0xC,SEEK_CUR); // Skip to 12 (0xC) and read everything (It's a raw png file)\nchar content[size-0xC];\nfread(content,1,size-0xC,file);\n\nsqlite3_bind_int(inserticonstmt,1,id);\nsqlite3_bind_blob(inserticonstmt,2,content,size-0xC,SQLITE_STATIC);\nsqlite3_step(inserticonstmt);\nsqlite3_clear_bindings(inserticonstmt);\nsqlite3_reset(inserticonstmt);\n\n\nAny ideas?\n\nEdit: It looks like, while the database is in fact storing the whole blob, it's not returning it from the CLI interface"
] | [
"c",
"sqlite"
] |
[
"Code for removing space between 2 images and centering",
"I am having difficulty with code for two images that I want to be centered and to have no space in-between. \n\nI am inexperienced and don't really know how to merge both codes into 1..\n\nCode I am using for removing space in-between images:\n\n<div class=\"row\">\n<p style=\"line-height: 0.0em;\"><img src=\"photo1 \"/><img src=”photo2” /></p>\n</div>\n\n\nCode I am using to center an image:\n\n<div id=\"wrapper\" style=\"width:100%; text-align:center\">\n<img id=\"yourimage\"/>\n</div>\n\n\nAny help would be appreciated."
] | [
"html"
] |
[
"PhpExcel stops working after setting 20 cell types",
"I have a script that generates a little xls table (~25x15). It contains percentages and strings and i have an if operator that sets the current cell as percentage type with this code:\n\n$this->objPHPExcel->getActiveSheet()->getStyle($coords)->getNumberFormat()->setFormatCode('0.00%');\n\n\nBut when i export and look at the file I see it only managed to set type and style about 20 cells. And all the rest are with default settings. I debugged it and realized the problem isn't in my logic. I read about increasing php cache memory - tried it but it didn't work. Please help because i need to export at least 15 times larger table. Thanks in advance!"
] | [
"php",
"export",
"phpexcel"
] |
[
"React not updating text (issue with .getDOMNode())",
"I'm using React to make a Markdown previewer and trying to make sense of what was used here to make the right box update with a live preview as soon as the text is changed on the left. They have this code at the bottom: \n\nvar RawInput = React.createClass({\n update:function(){\n var modifiedValue=this.refs.inputValue.getDOMNode().value;\n this.props.updateValue(modifiedValue);\n },\n render:function(){\n return (<textarea rows=\"22\" type=\"text\" ref=\"inputValue\" value={this.props.value} onChange={this.update} className=\"form-control\" />)\n }\n});\n\n\nI implementing this in my code: \n\nconst InputText = React.createClass ({\n update() {\n let newValue = this.refs.inputValue.getDOMNode().value;\n this.props.updateValue(newValue);\n },\n render() {\n return (\n <div>\n <textarea \n id=\"input-text\" \n rows=\"18\"\n type=\"text\"\n ref=\"inputValue\"\n value={this.props.value}\n onChange={this.update}\n />\n </div>\n );\n }\n});\n\n\nThe app runs fine except that there is no live preview and the text on the right doesn't update. In the console I get this error: this.refs.inputValue.getDOMNode is not a function .\n\nHere is the full code: \n\nimport React from 'react';\nimport Banner from './components/Banner.jsx';\nimport ContainerHeader from './components/ContainerHeader.jsx';\nimport marked from 'marked';\n\nconst App = React.createClass ({\n updateValue(newValue) {\n this.setState ({\n value: newValue\n })\n },\n getInitialState() {\n return {\n value: 'Heading\\n=======\\n\\nSub-heading\\n-----------\\n \\n### Another deeper heading\\n \\nParagraphs are separated\\nby a blank line.\\n\\nLeave 2 spaces at the end of a line to do a \\nline break\\n\\nText attributes *italic*, **bold**, \\n`monospace`, ~~strikethrough~~ .\\n\\nShopping list:\\n\\n * apples\\n * oranges\\n * pears\\n\\nNumbered list:\\n\\n 1. apples\\n 2. oranges\\n 3. pears\\n'\n }\n },\n markup(value) {\n return {__html: value}\n },\n render() {\n return (\n <div>\n <Banner />\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-xs-12 col-sm-6\">\n <ContainerHeader text=\"I N P U T\" />\n <InputText \n value={this.state.value}\n updateValue={this.updateValue} />\n </div>\n <div className=\"col-xs-12 col-sm-6\">\n <ContainerHeader text=\"O U T P U T\" />\n <div id=\"output-text\">\n <span dangerouslySetInnerHTML={this.markup(marked(this.state.value))}></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n }\n});\n\nconst InputText = React.createClass ({\n update() {\n let newValue = this.refs.inputValue.getDOMNode().value;\n this.props.updateValue(newValue);\n },\n render() {\n return (\n <div>\n <textarea \n id=\"input-text\" \n rows=\"18\"\n type=\"text\"\n ref=\"inputValue\"\n value={this.props.value}\n onChange={this.update}\n />\n </div>\n );\n }\n});\n\nexport default App;\n\n\nAny help welcome on solving this, and thanks!"
] | [
"javascript",
"reactjs"
] |
[
"Error: Received rst: 1 when running nodejs spdy example",
"I am able to run example from https://coderwall.com/p/2gfk4w but when I refresh page in the browser second time I am getting below error on console\n\nThis example uses response.push for spdy - Example code and Error are below:\n\nCode:\n\nvar fs = require('fs');\nvar spdy = require('spdy');\n\nvar backbone = fs.readFileSync('backbone.js');\nvar underscore = fs.readFileSync('underscore.js');\nvar applicationjs = fs.readFileSync('application.js');\nvar indexhtml = fs.readFileSync('index.html');\n\nvar options = {\n key: fs.readFileSync('newkeys/server.key'),\n cert: fs.readFileSync('newkeys/server.crt'),\n ca: fs.readFileSync('newkeys/server.csr')\n};\n\nvar server = spdy.createServer(options, function(request, response) {\n var headers = {\n 'content-type': 'application/javascript'\n }\n\n response.push('/backbone.js', headers, function(err, stream){\n if (err) return;\n stream.end(backbone);\n });\n\n response.push('/underscore.js', headers, function(err, stream){\n if (err) return;\n stream.end(underscore);\n });\n\n response.push('/application.js', headers, function(err, stream){\n if (err) return;\n stream.end(applicationjs);\n });\n\n response.writeHead(200, {'content-type': 'text/html'});\n var message = \"No SPDY for you!\"\n if (request.isSpdy){\n message = \"YAY! SPDY Works!\"\n }\n response.end(\"\" +\n \"<html>\" + \n \"<head>\" +\n \"<title>First SPDY App!</title>\" +\n \"<script src='/underscore.js'></script>\" +\n \"<script src='/backbone.js'></script>\" +\n \"<script src='/application.js'></script>\" +\n \"<head>\" +\n \"<body>\" +\n \"<h1>\" + message + \"</h1>\" +\n \"</body>\" +\n \"<html>\");\n});\n\nserver.listen(8099, function(){\n console.log(\"HTTP 1.1 Server started on 8099\");\n});\n\n\nError: \n\nError: Received rst: 1\n at Parser.<anonymous> (D:\\nodejs\\node_modules\\spdy\\lib\\spdy\\server.js:406:26)\n at Parser.EventEmitter.emit (events.js:95:17)\n at onFrame (D:\\nodejs\\node_modules\\spdy\\lib\\spdy\\parser.js:229:12)\n at Object.parseRst (D:\\nodejs\\node_modules\\spdy\\lib\\spdy\\protocol\\v3\\protocol.js:74:3)\n at Framer.execute (D:\\nodejs\\node_modules\\spdy\\lib\\spdy\\protocol\\v3\\framer.js:59:14)\n at Parser.execute (D:\\nodejs\\node_modules\\spdy\\lib\\spdy\\parser.js:223:19)\n at Parser.write [as _write] (D:\\nodejs\\node_modules\\spdy\\lib\\spdy\\parser.js:118:8)\n at D:\\nodejs\\node_modules\\spdy\\lib\\spdy\\parser.js:132:12\n at Parser.execute (D:\\nodejs\\node_modules\\spdy\\lib\\spdy\\parser.js:208:5)\n at Parser.write [as _write] (D:\\nodejs\\node_modules\\spdy\\lib\\spdy\\parser.js:118:8)\n\n\nPlease help me to solve this error, is this happening because the connection is not persistent?"
] | [
"node.js",
"spdy"
] |
[
"How to open play-store inside an android app",
"I am trying to open a playstore link in a window inside my app (example in the image attached), but I cannot find a way to do it (except for opening the playstore app - and set mine to the background).\n\nTried to look at: https://developers.google.com/android/reference/packages - but no luck.\n\nany suggestions?"
] | [
"android",
"google-play",
"app-store",
"google-play-services"
] |
[
"Regex capture group always as first",
"I have this PHP regular Expression:\n\nhttps?://(?:[a-z0-9]+\\.)?livestream\\.com/(?:(accounts/[0-9]+/events/[0-9]+(?:/videos/[0-9]+)?)|[^\\s/]+/video\\?clipId=([^\\s&]+)|([^\\s/]+))\n\nI like to match the following URLs with the the results.\n\nhttp://original.livestream.com/bethanychurchnh = bethanychurchnh\n\nhttp://original.livestream.com/bethanychurchnh/video?clipId=flv_b54a694b-043c-4886-9f35-03c8008c23 = flv_b54a694b-043c-4886-9f35-03c8008c23\n\nhttp://livestream.com/accounts/142499/events/3959775 = accounts/142499/events/3959775\n\nhttp://livestream.com/accounts/142499/events/3959775/videos/83958146 = /accounts/142499/events/3959775/videos/83958146\n\n\nIt works fine but I have this problem that the capture groups are 2nd and 3rd for some of the matches. I like to have the captured string always be matched as the first capture group. Is this possible?"
] | [
"php",
"regex"
] |
[
"Calculating distance in kilometers between coordinates",
"I'm trying to calculate distance in kilometers between two geographical coordinates using the haversine formula.\n\nCode:\n\nDim dbl_dLat As Double\nDim dbl_dLon As Double\nDim dbl_a As Double\n\ndbl_P = WorksheetFunction.Pi / 180\ndbl_dLat = dbl_P * (dbl_Latitude2 - dbl_Latitude1)\ndbl_dLon = dbl_P * (dbl_Longitude2 - dbl_Longitude1)\n\ndbl_a = Sin(dbl_dLat / 2) * Sin(dbl_dLat / 2) + Cos(dbl_Latitude1 * dbl_P) * Cos(dbl_Latitude2 * dbl_P) * Sin(dbl_dLon / 2) * Sin(dbl_dLon / 2)\n\ndbl_Distance_KM = 6371 * 2 * WorksheetFunction.Atan2(Sqr(dbl_a), Sqr(1 - dbl_a))\n\n\nI'm testing with these coordinates:\n\ndbl_Longitude1 = 55.629178\ndbl_Longitude2 = 29.846686\ndbl_Latitude1 = 37.659466\ndbl_Latitude2 = 30.24441\n\n\nAnd the code returns 20015.09, which is obviously wrong. It should be 642 km according to Yandex maps.\n\nWhere am I wrong? Are the longitude and latitude in wrong format?"
] | [
"vba",
"excel",
"worksheet-function",
"geographic-distance"
] |
[
"ObjectContext.ExecuteStoreCommand doesn't recognise parameter",
"What am I doing wrong here?\n...\nusing (var ctx = ObjectContextManager<MyDataContext>.GetManager("MyDataContext"))\n{\n var idsToUpdate = "2,3";\n\n var parameters = new[]\n {\n new SqlParameter("DesiredEndDate", SqlDbType.DateTime).Value = newUpperLimit,\n new SqlParameter("TasksToUpdate", SqlDbType.NVarChar).Value = idsToUpdate\n };\n\n ctx.ObjectContext.ExecuteStoreCommand("UPDATE dbo.Tasks SET DesiredEndDate = @DesiredEndDate WHERE Id IN (SELECT Id FROM dbo.fn_Split(@TasksToUpdate, N','))", parameters);\n\n ctx.ObjectContext.SaveChanges();\n}\n...\n\nI get the error\n\nMust declare the scalar variable "@DesiredEndDate".\nMust declare the scalar variable "@TasksToUpdate".\n\nBut I cannot see what is wrong with my code :/"
] | [
"c#",
"sql-server",
"entity-framework"
] |
[
"JQuery onclick execute event of input field",
"I don´t know if it´s possible do this , in this case i want when click over input text field activate function in jQuery and after of this action execute the code of jQuery - inside onclick - , i put my example :\n\n<input type=\"password\" name=\"password\" value=\"\" class=\"input_text_register\" id=\"pass\" onclick=\"jQuery(\"#list\").show();\"/>\n\n\nI can´t do this works , i supose i have some error because no get works finally , in this case the activation from input text field open other div for show informations\n\nThank´s , Regards !"
] | [
"jquery",
"input"
] |
[
"Initialise a UITableViewController recursively",
"I have a TableViewController called MachinesListViewController that gets loaded when the application starts. \nThe data that the tableview shows is a hierarchical tree data so a item has got children, and those children have children and so forth. So first time this loads, it shows the root node. \n\nWhat I am trying to do is, when a item is selected from the MachinesListViewController I want to create another instance of the same MachinesListViewController so that I can recursively navigate the tree structure.\n\nNSDictionary *orgObject = [orgStructure objectAtIndex:indexPath.row];\nUIStoryboard *storyboard = [UIStoryboard storyboardWithName:@\"Main\" bundle:nil];\nMachinesListViewController *m = (MachinesListViewController*)[storyboard instantiateViewControllerWithIdentifier:@\"MachineListViewController\"];\nm.orgId = [orgObject objectForKey:@\"id\"];\n[self.navigationController pushViewController:m animated:NO];\n\n\nThe code works, but I find that the same UITableView is getting updated and the new view controller is not being pushed. It is as though the same instance of the controller is being returned and being changed.\n\nTo verify that i am getting different instances of the controller, I debugged the same and printed the memory address of the object. The debugger shows different memory addresses so I am not sure what I am doing wrong here.\n\n\n\nI am not sure what is going on and any help to resolve this is greatly appreciated."
] | [
"ios",
"uitableview",
"recursion"
] |
[
"SQL Server 2012 Enterprise Edition setup for Integration Services",
"I have just set up Microsoft SQL Server 2012 Service Pack 1 Enterprise Edition on my machine and have checked to install the Reporting Service, and also the Integration Services package.\n\nSee the discovery report post-installation: \n\nI have enabled the following ports:\n2383, 2382, 4022, 1433, 1434, 135, 80, 443\n\nMy attempts to start/connect to the Integration Services have been futile. When I open Management Studio, I select Integration Services to connect but I get the following message (screenshot): \n\nCan somebody point me in the right direction so I can get started to using SSIS please?\n\nMore information:\nI have 2 physical drives -- SSD (C:) and a HDD (D:). SQL Server is installed on D:, which Windows 7 is running on C:.\n\nMy user name belongs to or is part of the group of administrators. The Administrator account is disabled."
] | [
"sql-server",
"ssis"
] |
[
"Rails ActiveRecord Join Query With conditions",
"I have following SQL Query:\n\nSELECT campaigns.* , campaign_countries.points, offers.image\nFROM campaigns\nJOIN campaign_countries ON campaigns.id = campaign_countries.campaign_id\nJOIN countries ON campaign_countries.country_id = countries.id\nJOIN offers ON campaigns.offer_id = offers.id\nWHERE countries.code = 'US'\n\n\nThis works perfectly well. I want its rails active record version some thing like:\n\nCampaign.includes(campaign_countries: :country).where(countries: {code: \"US\"})\n\n\nAbove code runs more or less correct query (did not try to include offers table), issue is returned result is collection of Campaign objects so obviously it does not include Points\n\nMy tables are:\n\ncampaigns --HAS_MANY--< campaign_countries --BELONGS_TO--< countries\ncampaigns --BELONGS_TO--> offers\n\n\nAny suggestions to write AR version of this SQL? I don't want to use SQL statement in my code."
] | [
"sql",
"ruby-on-rails",
"activerecord"
] |
[
"Use a repository, event or service provider here?",
"I have this function in an UploadController, which is used to cancel an upload, and I am trying to improve it.\n\nThis \"File::delete..block\" exists twice in my application. Would it for example make sense to exclude this block from the controller? And if yes, what should I use, Repository, Service Provider or an Event?\n\npublic function postDelete(Request $request)\n{\n $filename = $request->input('filename');\n\n $upload = Upload::where('filename',$filename)->where('accepted',0)->firstOrFail();\n\n File::delete('img/uploads/'.$filename.'_o.jpg');\n File::delete('img/uploads/'.$filename.'.jpg');\n File::delete('img/uploads/'.$filename.'_zoom.jpg');\n File::delete('img/uploads/'.$filename.'_tn.jpg');\n File::delete('img/uploads/'.$filename.'_250.jpg');\n File::delete('img/uploads/'.$filename.'_50.jpg');\n\n $upload->delete();\n\n Cache::forget('waiting_uploads');\n\n $msg = 'upload has been deleted';\n Mail::to('[email protected]')->send(new TextMail($msg));\n\n return redirect('upload');\n}"
] | [
"php",
"laravel-5.4"
] |
[
"Using an old version of node in VS Code debugger",
"I updated VS Code to 1.14.2 and am attempting to run an application that requires Node 6.x. Prior to this update, the configuration I was using worked just fine:\n\n{\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"type\": \"node\",\n \"request\": \"launch\",\n \"name\": \"Launch Program\",\n \"program\": \"${workspaceRoot}/keystone.js\"\n },\n {\n \"type\": \"node\",\n \"request\": \"attach\",\n \"name\": \"Attach to Port\",\n \"address\": \"localhost\",\n \"port\": 5858\n }\n ]\n}\n\n\nnow, when I execute the program, it just hangs without starting (expected when I run with Node 7.x or above). In addition, it provides the following message, which I'm not sure is relevant:\n\nDebugging with inspector protocol because Node.js v8.2.1 was detected.\n\nnode --inspect=38743 --debug-brk keystone.js\n\nDebugger listening on ws://127.0.0.1:38743/d4a20480-3a0f-4aa7-8882-aec756edd6da\nDebugger attached.\n\nI'm using nvm to manage my Node versions, and nvm list provides the following (as you can see, I already have 6.11.0 aliased to default):\n\n$ nvm list\n-> v6.11.0\n v8.0.0\n system\ndefault -> 6.11.0 (-> v6.11.0)\nnode -> stable (-> v8.0.0) (default)\nstable -> 8.0 (-> v8.0.0) (default)\niojs -> N/A (default)\nlts/* -> lts/boron (-> N/A)\nlts/argon -> v4.8.4 (-> N/A)\nlts/boron -> v6.11.1 (-> N/A)\n\n\nI'm assuming it's not executing due to trying to use the wrong version of Node, and any help figuring this out would be greatly appreciated."
] | [
"node.js",
"visual-studio-code",
"keystonejs"
] |
[
"Necessary to encode characters in HTML links?",
"Should I be encoding characters contained within a url?\n\nExample:\n\n<a href=\"http://google.com?topicId=1&pageId=1\">Some link using &</a>\n\n\nor\n\n<a href=\"http://google.com?topicId=1&amp;pageId=1\">Some link using &amp;</a>"
] | [
"html",
"encoding",
"hyperlink"
] |
[
"Why am I getting the same results on every std::nexttoward function call",
"Why does the following code returns the same number on every std::nexttoward function call?\n\n#include <cmath>\n#include <iostream>\n#include <limits>\n\nint main()\n{\n std::cout.precision(std::numeric_limits<double>::max_digits10);\n std::cout.setf(std::ios::fixed);\n\n auto foo = 0.00000000000011134;\n std::cout << foo << std::endl;\n\n for (int i = 0; i < 100; ++i)\n {\n foo = std::nexttoward(foo, 1.0);\n std::cout << foo << std::endl;\n }\n}\n\n\nhttp://coliru.stacked-crooked.com/a/551b6e2b867b2f3b\n\nNone of the flags mentioned here (FE_OVERFLOW, FE_UNDERFLOW и FE_INEXACT) are set."
] | [
"c++"
] |
[
"Ionic Bluetooth printing POS command not working",
"I am working on this ionic app, and I am printing receipts using a Bluetooth thermal printer using this library.\n\nhttps://github.com/srehanuddin/Cordova-Plugin-Bluetooth-Printer\n\nI want to cut the paper after printing, because my printer has this feature.\n\nBTPrinter.printPOSCommand(function(data){\n console.log(\"Success\");\n console.log(data)\n},function(err){\n console.log(\"Error\");\n console.log(err)\n}, \"1D\")\n\n\nI have tried 0x1d and \"0x1d v 1\" but it just doesn't work."
] | [
"android",
"cordova",
"ionic-framework",
"printing",
"bluetooth"
] |
[
"how to pass the new old identifier with userenv from dual table in postgres trigger",
"I convert oracle scripting to PostgreSQL which requires the user to update the last login information in Oracle trigger this I used:\nif inserting then \n:new.last_update := sysdate\nselect osuser into :new.updated_by from gv@session where audsid =\n(select userenv('sessionid') from dual);\nend if;\n\nhow can I covert to postgres? I get stuck after the select ... from dual and dual is not a table in postgres.\nif TG_OP = 'INSERT' then\nnew.last_update :=current_timestamp;\nSELECT usename INTO :new.update_by\nFROM pg_user\nWHERE usesysid = (SELECT ..(I got stuck here)\nRETURN NEW;\nEND IF;\n\nhow to get the trigger function would work properly with dual table?"
] | [
"postgresql",
"triggers",
"plpgsql"
] |
[
"Building an array from a MySQL Query",
"I hope it's the heat, this is the second question today and it's one problem after the other. Relatively simple stuff...\n\nI have this query ...\n\nwhile ($resultV = mysql_fetch_assoc($metQueryViews)) { $allViews[] = $resultV; }\n\n\nThe date it's getting is:-\n\ndate Count\nNULL 6\n14-5-2009 12\n15-5-2009 21\n26-6-2009 18\n29-6-2009 61\n\n\nI'm trying to build an array, that reads out\n\n\"14-5-2009\" = > \"12\"\n\n\nBut, the above while statement produces what seems to be a multi-dimensional array or sommet, which has the field name => value.\n\nThoughts on a little post card are most welcome."
] | [
"php",
"mysql",
"arrays"
] |
[
"Animation Not Proper starting",
"i do clock animation it works well but i use setinterval to call the function. the animation has little delay while start[ it stops some time on 12]\n\nvar timemin=0;\nvar timehr=0;\nvar timesec=0;\nvar a=0;\nfunction clockRotate(){\ntimemin=timemin+6;\ntimehr=timehr+0.5;\ntimesec=timesec+360;\n$(\"#cimg3\").animate({rotate:timemin},2500);\n$(\"#cimg4\").animate({rotate:timesec},2500);\n$(\"#cimg2\").animate({rotate:timehr},2500);\n}\n\nsetInterval(function(){\nclockRotate();\na=1;\n},0*2500);\n\n\nSee The Action Here\n\nHow can i remove This delay. Thanks"
] | [
"javascript",
"jquery",
"html",
"animation"
] |
[
"in eclipse export jar database is not working",
"I have created a Swing application that uses msaccess database. \nThe application runs fine on Eclipse, but when I run the packaged executable Jar, I get the following error:\n\njava.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver\n\n\nhere is my code\n\nClass.forName(\"sun.jdbc.odbc.JdbcOdbcDriver\");\nconn = DriverManager.getConnection(\"jdbc:odbc:cs\");\n\n\nplease help me"
] | [
"java",
"eclipse"
] |
[
"Beam - Handling failures during huge data load for bigquery",
"I have recently started with Apache beam. I am sure I am missing something here. I have a requirement to load from a very huge database to bigquery. These tables are huge. I have written sample beam jobs to load minimal rows from simple tables. \n\n\nHow would I able to load n number of rows from tables using JDBCIO? Is there anyway that i can load these data in batches as we do in conventional data migration jobs.?\nCan I do batch read from a database and write in batches to bigquery?\nAlso i have seen that, the suggested approach to load the data to bigquery is by adding the files to the data store buckets. But, in automated environment, the requirement is to write it as a dataflow job to load from db and write it to bigquery. What should my design approach to solve this issue using apache beam?\n\n\nPlease help.!"
] | [
"google-bigquery",
"google-cloud-dataflow"
] |
[
"Unable to compile or run sqlite3 using Visual Studio 2015",
"I'm trying to compile the source of sqlite3.c and shell.c I downloaded from the SQLite website using Visual Studio 2015. I created DLL project sqlite3 and put the sqlite3.c source into it. Then I created project sqlite3shell and put shell.c source into it. I added include \"stdafx.h\" into both. When I compiled both projects the DLL did not produce a .lib file, so the compile of sqlite3shell got the error LNK1104 cannot open sqlite3.lib.\n\nI manually created a .lib file using this solution. Then the sqlite3shell program compiled successfully. But when I went to run the program, I got the error The application was unable to start correctly (0xc000007b). Looking into this error is seems one reason it could be caused is by trying to access a 64-bit program from a 32-bit program. But everything was created using the x86 configuration.\n\nIs there some way to have the DLL compile produce the correct .lib file? Or if that won't fix the problem, is there something I can do to prevent the 0xc000007b error?"
] | [
"c",
"visual-studio",
"visual-studio-2015",
"sqlite"
] |
[
"Postman how to add an image inside of nested JSON object",
"after looking on the internet: i found this Stack overflow post (link) on how to add an Image by using Postman.\nhowever, my situation is a little bit different. I need to add the image inside of JSON object (nested bracket) here sample:\n...\n, \n"snapshot": { \n "snapshot_data": "pathImageHere", \n "snapshot_type": "jpg" \n}, \n...\n\nBut, i'm enable to do so."
] | [
"image",
"http",
"postman",
"jpeg"
] |
[
"Keywords of app in AppStore same as name of another app",
"What might be the consequences if the keywords the application has the phrase as the name of another app in the AppStore?\n\nAnd what if the developer of this app complain in the AppStore for my app?"
] | [
"ios",
"app-store",
"keyword"
] |
[
"Escaping single quote in String.Format()",
"I have been all over the 'tubes and I can't figure this one out. Might be simple.\n\nThe following String.Format call:\n\nreturn dt.ToString(\"MMM d yy 'at' H:mmm\");\n\n\nCorrectly returns this:\n\n\n Sep 23 08 at 12:57\n\n\nNow let's say I want to add a single quote before the year, to return this:\n\n\n Sep 23 '08 at 12:57\n\n\nSince the single quote is a reserved escape character, how do I escape the single quote to get it to display?\n\nI have tried double, triple, and quad single quotes, with no luck."
] | [
".net",
"escaping",
"string.format"
] |
[
"UI Automation: Open File dialog elements tree contains not all elements",
"I'm trying to use UI Automation with C# to type file path in opened Open dialog and then press Open button. I'm able to find the dialog itself, but searching for inner elements (file path text box and Open button) gives no result. When I traverse elements tree writing elements to log file, I see that the log is obviously too short and not all elements printed out.\n\nStrange behavior: if I switch with mouse on another window, traversing of the dialog returns all elements and I'm able to find desired controls and interact with them.\n\nI've tried many approaches to bypass the problem:\n\n\nopen some window, switch to it with AutomationElement.SetFocus;\nsearch for element with Win API (FindWindowEx);\nget AutomationElement by point on screen within dialog's bounding rectangle iterating by x and y with some step.\n\n\nNo one approach give me desired result.\n\nWhat can cause incomplete elements tree using UI Automation and what is workaround for this?\n\nMy scenario is:\n\n\ntest clicks on a button on web page\nstandard Windows dialog to select a file is opened\nI'm trying to fill file path text box and press Open button using UI Automation"
] | [
"c#",
"ui-automation"
] |
[
"Apply Color Filter to Action Overflow Icon at Runtime",
"Is there any way to get the Action bar overflow icon drawable at runtime to apply a color filter? I'm looking for something similar to menu.findItem(R.id.menu_id).getIcon() except for the 3 dot overflow so that I can do a .setColorFilter.\n\nThanks!"
] | [
"android",
"android-actionbar"
] |
[
"Weired character when using pandas.to_csv",
"I'm having an Excel file with some French characters. I'm using the following code to load the file\n\np = pd.read_excel(file_path, encoding = 'ISO-8859-1')\n\n\nWhen I look at the dataframe in python it looks good. \n\nI then want to save it as a csv file with pipe-delimited (|) file. I'm using the code\n\np.to_csv(outputfile,delimeter= '|',encoding = 'utf-8)\n\n\nbut after opening the csv file, it contains some weired character. What encoding should I use"
] | [
"python",
"pandas",
"csv",
"character-encoding"
] |
[
"why this way \"this.foo = new (function () {..})();\" vs. \"this.foo = function (){...};\"",
"Is there any difference in the two definitions and assignments of functions?\n\nthis.foo = new (function () {..})();\n\n\nvs.\n\nthis.foo = function (){...};"
] | [
"javascript"
] |
[
"How to add a custom payload to PromptDialog.Choice",
"I am trying to add a custom data payload to PromptDialog.Choice / or PromptDialog.Text to indicate a special activity to my bot client.\n\nI know there is a field to specify InputHint to IMessageActivity.\nis there a way to add an inputhint/ or a custom tag to PromptDialog flow?"
] | [
"botframework"
] |
[
"Dicom UnCompression by Dcm2dcm",
"I am getting compressed dicom files from my server and uncompressed using Dcm2Dcm API but the problem is not getting original dicom image. I got image with some dots and circles..so please provide any solution.\n\nThis is original compressed image.\n\n\n\nThis is after uncompressed image."
] | [
"java",
"dicom",
"dcm4che"
] |
[
"Zynq-7000 by Xilinx. Interrupts system for AXI Uartlite",
"I use Picozed SDR SOM 2x2. The version of my Vivado and SDK tools is 2015.4.\n\nI need to use some PMOD connectors for axi_uartlite block.\n\nThere is my design\n\nAfter generating bitstream I has exported my hardware to SDK. Then I imported xuartlite_polled_example. Using oscilloscope and physical loopback from tx to rx I maked sure then example work well.\n\nThen I imported xuartlite_intr_example (because there are important for me to use interrupts) and it don't work.\n\nSome source for handling interrupts from example:\n\nstatic volatile int TotalSentCount = 0;\nstatic volatile int TotalReceivedCount = 0;\n\nvoid SendHandler(void *CallBackRef, unsigned int EventData)\n{\n TotalSentCount = EventData;\n}\n\nvoid RecvHandler(void *CallBackRef, unsigned int EventData)\n{\n TotalReceivedCount = EventData;\n}\n\n\nThe place where the program is catched at loop (checked with System Debugger and GDB) :\n\n/*\n * Wait for the entire buffer to be received, letting the interrupt\n * processing work in the background, this function may get locked\n * up in this loop if the interrupts are not working correctly.\n */\n\nwhile ((TotalReceivedCount != TEST_BUFFER_SIZE) ||\n (TotalSentCount != TEST_BUFFER_SIZE)) {\n}\n\n\nWhy my interrupts are not working correctly? I tried also with Vivado and SDK 2016.4 and on the ZC702 board. Result the same, xuartlite_polled_example are working and xuartlite_intr_example are not.\n\nAlso I imported SDK examples for AXI Interrupt Controller and no one is working."
] | [
"fpga",
"xilinx",
"uart",
"interrupt-handling",
"zynq"
] |
[
"how to prevent special characters at generating a token in c#",
"i generate a token which converts the datetime in bytes.\nHere is how i generate the token:\n\npublic string generateToken()\n {\n byte[] time = BitConverter.GetBytes(DateTime.UtcNow.ToBinary());\n byte[] key = new Guid().ToByteArray();\n string token = Convert.ToBase64String(time.Concat(key).ToArray());\n return token;\n }\n\n\nThis is how it looks like when the token is generated:\n\n\n chas42Sbo9AAAAAAAAAAAAAAAAAAAAA \n\n\nbut on some days it generates special characters,too. like in this example:\n\n\n chs2BiT/z0gAAAAAAAAAAAAAAAAAAAAA\n\n\ni parse the result in a link to redirect to another page \n\n\n http://test.com/abo.aspx?chas42Sbo9AAAAAAAAAAAAAAAAAAAAA\n\n\nwith the special characters it looks like this:\n\n\n http://test.com/abo.aspx?chs2BiT/z0gAAAAAAAAAAAAAAAAAAAAA\n\n\nand this doesnt work.\n\nis it possible to generate a token but without special characters?"
] | [
"c#",
"asp.net",
"visual-studio-2008"
] |
[
"Apache Thrift : Python server with Javascript client",
"I'm currently using Apache Thrift for an API project.\n\nI started with a little test project in order to understand how Thrift works. So, I would like to use a python server with a browser-based javascript Client.\n\nI've read the documentation entirely, but I still have an issue I can't resolve :( :\n\n\n\nServer output :\n\n127.0.0.1 - - [04/Dec/2018 17:04:34] code 501, message Unsupported method ('OPTIONS')\n127.0.0.1 - - [04/Dec/2018 17:04:34] \"OPTIONS / HTTP/1.1\" 501 -\n\n\ntest.thrift\n\nenum Modulation\n{\n BPSK\n QPSK\n APSK16\n APSK32\n}\n\nstruct Coordinate {\n 1: i32 X,\n 2: i32 Y\n}\n\nstruct Constellation {\n 1: string name,\n 2: i32 timestamp,\n 3: list<Coordinate> coordinates\n}\n\nservice Dealer\n{\n Constellation getConstellation()\n\n Modulation getModulation()\n void setModulation(1: Modulation new_modulation)\n i32 getTimestamp()\n}\n\n\nserver.py\n\nimport glob\nimport sys\nsys.path.append('gen-py')\n\nfrom TApp import Dealer\nfrom TApp.ttypes import *\n\nfrom thrift.transport import TSocket\nfrom thrift.transport import TTransport\nfrom thrift.protocol import *\nfrom thrift.server import TServer, THttpServer\n\nimport time\n\nclass DealerHandler:\n def __init__(self):\n self.modulation = Modulation.BPSK\n\n def getConstellation(self):\n c = Constellation()\n c.name = \"Test\"\n c.timestamp = self.getTimestamp()\n c.coordinates = []\n\n return c\n\n def getModulation(self):\n return self.modulation\n\n def setModulation(self, new_modulation):\n self.modulation = new_modulation\n\n def getTimestamp(self):\n return int(str(time.time()).split('.')[0])\n\n\nif __name__ == '__main__':\n handler = DealerHandler()\n processor = Dealer.Processor(handler)\n\n port = 9090\n host = '127.0.0.1'\n\n # HTTP SERVER\n tfactory = TTransport.TBufferedTransportFactory()\n pfactory = TJSONProtocol.TJSONProtocolFactory()\n # List of all protocols : https://thrift-tutorial.readthedocs.io/en/latest/thrift-stack.html\n\n #server = TServer.TSimpleServer(processor, transport, tfactory, pfactory)\n server = THttpServer.THttpServer(processor, (host, port), pfactory)\n server.serve()\n\n\nindex.html\n\n<!DOCTYPE html>\n<html>\n<head>\n<title>Test</title>\n<link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css\">\n\n</head>\n\n<body>\n <div id=\"timestamp\" style=\"margin:auto; width:70%; padding:15px; text-align:center; border:1px solid black;\">\n No Value\n </div>\n <br />\n <button type=\"button\" name=\"button\" class=\"btn btn-info\" style=\"width:100%\" onclick=\"update_timestamp()\">Start connection</button>\n</body>\n\n<script src=\"https://code.jquery.com/jquery-3.3.1.min.js\"\n integrity=\"sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=\"\n crossorigin=\"anonymous\"></script>\n<script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js\" charset=\"utf-8\"></script>\n\n\n<script src=\"thrift.js\" charset=\"utf-8\"></script>\n<script src=\"test_types.js\" charset=\"utf-8\"></script>\n<script src=\"Dealer.js\" charset=\"utf-8\"></script>\n\n<script type=\"text/javascript\">\n function update_timestamp() {\n var transport = new Thrift.TXHRTransport(\"http://localhost:9090\");\n var protocol = new Thrift.TJSONProtocol(transport);\n\n var client = new DealerClient(protocol);\n var val = client.getTimestamp();\n\n document.getElementById(\"timestamp\").innerHTML = val;\n}\n</script>\n\n</html>"
] | [
"javascript",
"python",
"thrift"
] |
[
"Amazon: is it possible to specify zip code in the URL for Amazon search results?",
"I have noticed an issue. If I copy Amazon URL with search results and somebody with another IP opens it then the results can be different.\nFor example:\nhttps://www.amazon.com/s/ref=sr_nr_p_36_0?lo=toys-and-games&rh=n%3A165793011%2Cp_72%3A1248964011&sort=price-desc-rank&low-price=34.99&high-price=34.99\n\nIf you open this URL in from Dallas IP you'll get 102 pages with results. \n\nIf you open it with Honolulu IP you'll get 101 pages. \n\nIf you open it from Russian IP you'll get 93 pages.\n\nIs that possible to specify US ZIP code for shipping right in the url so that it displays same results for every IP address?\n\nAnother little issue I have noticed - it displays different page layout for different people. Sometimes it's default blue links, sometimes it has silver buttons. Maybe somebody knows how to lock the design to one layout with url parameters? :)"
] | [
"url",
"web-scraping",
"get",
"amazon"
] |
[
"Looping in Q language",
"I am trying to figure out Q language basics. I am trying a sample program in which let's say for a given number I can find the sum of all the multiples of 3 and 5?\n\nif input is 10 sum : 23\n\nI am trying to think in terms using of til and sum but cannot but to no avail till now."
] | [
"kdb"
] |
[
"Limitations of Qualtrics API",
"With respect to the Qualtrics API (v3) documentation (https://api.qualtrics.com/docs/overview) there does not appear to be any means to send a GET request through a REST client to get the individual survey responses for a specific survey (I suppose that the developers figured that no would be interested in decoupling the survey results from the admin panel). \n\nThe reason why I would like to be able to submit a GET request to get survey results is for real-time data visualization purposes that do not depend on me exporting the data every so often to re-update the visualization. If Qualtrics does not support such a GET request, which service (perhaps SurveyMonkey or its ilk) best facilitates what I'm trying to build? Or do I have to build an entire survey module from scratch? (shudders)"
] | [
"surveymonkey",
"qualtrics"
] |
[
"use jq and loop through the json and get multiple values",
"I have the command to get individual responses using jq from a json file. but multiple values are not getting displayed when I use [].\nThis is my json\n\n{\n \"status\" : \"UP\",\n \"details\" : {\n \"Service1\" : {\n \"status\" : \"UP\",\n \"details\" : {\n \"Credit\" : {\n \"status\" : \"UP\",\n \"details\" : {\n \"Tablename\" : \"credittable\"\n }\n }\n }\n },\n \"Service2\" : {\n \"status\" : \"UP\",\n \"details\" : {\n \"Debit\" : {\n \"status\" : \"UP\",\n \"details\" : {\n \"Tablename\" : \"debittable\"\n }\n }\n }\n },\n \"Service3\" : {\n \"status\" : \"UP\",\n \"details\" : {\n \"Loan\" : {\n \"status\" : \"UP\",\n \"details\" : {\n \"Tablename\" : \"loantable\"\n }\n }\n }\n }\n }\n}\n\n\nBelow are my commands:\n\ncat api.json | jq '.details.Service1.status'\ncat api.json | jq '.details.Service1.details.Credit.status'\ncat api.json | jq '.details.Service1.details.Credit.details.TableName\n\n\ncurrently assigning these values to individual variables and then doing an echo wanted to see if we can have a loop and display all with one command. \n\nI am trying to print as below \n\nService1 up \ncredittable up \nService2 UP \ndebittable up \nService3 up \nloantable up"
] | [
"json",
"jq"
] |
[
"Determine Tracking Branch in JGit",
"I would like to determine the remote tracking branch of HEAD using JGit.\n\nIn straight git, I can do:\n\ngit rev-parse --abbrev-ref --symbolic-full-name @{upstream}\n\n\nHow can I do this in JGit?"
] | [
"jgit"
] |
[
"How do I reset an asp.net website within the site itself with a button?",
"I am working on an ASP.NET 2.0 website. The issue that I'm having is that it queries a database to get the info it displays on screen, but the database occasionally gets to where it has too many open connections. This causes the website to reject the attempt to log-in for anyone, after that database error.\n\nThis is caused because many users will log-in, do what they need to do, but then leave the website running while they do other things without logging out. It will time out on them, but the connection still seems to be open. We then have to contact the person in charge of the server it's running on and have him reset it for us.\n\nI have looked and all connections made to the database seem to be closed after the request and query is made. So, what I want to do is to add a button that when clicked will reset the website, instead of having to call the guy in charge of the server every time. Then we can reset it whenever we need to. So, how do I reset an ASP.NET 2.0 website with a button on one of the pages inside the site?\n\nMany thanks,\n\nMike"
] | [
"c#",
"asp.net"
] |
[
"Creating classes on vertices data frame from components$membership",
"I am looking to add a 'description' variable to the vertices data frame which describes the cluster in which a node is found. My network is family relationships so clusters could be a family of two adults and two children, single parent with three children, couple etc. \n\nMy data looks like\n\nVertices data frame \n\n ID Date.Of.B Nationality \n X1 02/05/1995 Ugandan \n X2 10/10/2010 Ugandan \n X3 15/12/1975 Irish \n : : : \n\n\nEdgelist\n\nID1 ID2 \n\nX1 X2 \nX1 X3 \nX2 X3 \nX3 X1 \n: :\n\n\nI plan to create factor levels to describe clusters i.e \n\n 2 adults = 2A\n 2 adults 2 children = 2A2C\n 5 adults 0 children = 5A\n\n\nAfter creating the graph using graph_from_data_frame() I can extract the components using componets() with components$membership giving each cluster a membership number with the IDs an attribute of components$membership. I can apply a label to each vertex to determine their status as an adult or child. \n\nBasically I am looking to add another variable which classes each ID given the cluster it is in: \n\nNew vertices data frame \n\nID Date.Of.B Nationality Class \n X1 02/05/1995 Ugandan 2A1C\n X2 10/10/2010 Ugandan 2A1C\n X3 15/12/1975 Irish 2A1C\n : : : \n\n\nI am thinking I am going to have to use some sort of loop to go through each cluster and apply a level to each vertex by component$membership\n\nThis is one option I thought of and am currently working on. \n\nPlease let me know if you have any other ideas or better ways to do it. \n\nThanks"
] | [
"networking",
"graph",
"igraph",
"sna"
] |
[
"select option remove() method on removing multiple options",
"I'm having a select box which contains 17 values/options. \n\n<select id=\"_class\" name=\"_class\">\n <option value=\"0\"></option>\n <option value=\"1\">PREKG</option>\n <option value=\"2\">LKG</option>\n <option value=\"3\">UKG</option>\n <option value=\"4\">I</option>\n <option value=\"5\">II</option>\n <option value=\"6\">III</option>\n <option value=\"7\">IV</option>\n <option value=\"8\">V</option>\n <option value=\"9\">VI</option>\n <option value=\"10\">VII</option>\n <option value=\"11\">VIII</option>\n <option value=\"12\">IX</option>\n <option value=\"13\">X</option>\n <option value=\"14\">XI</option>\n <option value=\"15\">XII</option>\n <option value=\"16\">XIII</option> \n</select>\n\n\nNow, I'm trying to remove the option from 5 to 8. For that, I'm using the following JavaScript code.\n\n<script type=\"text/javascript\">\n var _class = document.getElementById(\"_class\");\n for(var i=1; i < _class.length;i++) {\n if(i>=5 && i<=8) {\n _class.remove(i);\n }\n }\n</script>\n\n\nBut, I'm not getting the expected result, because every time as if the for loop runs, the order of the option is getting changed.\n\nHow can I get the desired result?\n\nHere I've attached the Fiddle."
] | [
"javascript"
] |
[
"PRISM. Task with RegisterInstance",
"I would like to understand something.\n\nI have \"Service\" silverlight application project that contains Module class and next code line into its \"Initialize\" method in order to register type:\n\nunityContainer.RegisterInstance<IService>(instance);\n\n\nAnd I have another \"Controls\" silverlight application project. Module is described into \"catalog.xaml\" file:\n\n<Modularity:ModuleInfo\n Ref=\"Service.xap\"\n ModuleName=\"ServiceModule\"\n ModuleType=\"Service.ModuleDefinitions.Module, Service, Version=1.0.0.0\">\n</Modularity:ModuleInfo>\n\n\nYou can find \"Bootstrapper\" code below:\n\nprotected override IModuleCatalog CreateModuleCatalog()\n{\n Uri uri = new Uri(\"catalog.xaml\", UriKind.Relative);\n ModuleCatalog moduleCatalog = Microsoft.Practices.Prism.Modularity.ModuleCatalog.CreateFromXaml(uri);\n // NOTE: State of \"ServiceModule\" is \"NotStarted\" here...\n return moduleCatalog;\n}\n\nprotected override DependencyObject CreateShell()\n{\n Shell shell = new Shell();\n Application.Current.RootVisual = shell;\n IRegionManager regionManager = Container.Resolve<IRegionManager>();\n regionManager.RegisterViewWithRegion(\"MainRegion\", typeof(MainView));\n return shell;\n}\n\n\nOne ViewModel class (into \"Controls\" project) contains reference to IService interface that has to be registered into Modul class of \"Service\" project.\n\nCreateModuleCatalog() and CreateShell() methods were executed without any problem during programm debug, but I got exception before executing of Initialize() method with registration of IService.\n\nError message: \"The current type, Service.ServiceReference.IService, is an interface and cannot be constructed. Are you missing a type mapping?\"\n\nI thought that I need register/mapping types only one time and if I have done it into Module class of Service project then I didn't have to do it Controls project again.\n\nI need help to understand situation above :)"
] | [
".net",
"silverlight-4.0",
"c#-4.0",
"unity-container",
"prism"
] |
[
"When Should a Class Implement an Interface, and When Should it Not?",
"Should a class implement an interface always in order to enforce a sort of 'contract' on the class?\n\nWhen shouldn't a class implement an interface?\n\nEdit: Meaning, when is it worthwhile to have a class implement an interface? Why not have a class just have public members and private members with various accessor/setter functions?\n\n(Note: Not talking about COM)"
] | [
"c#",
".net",
"interface"
] |
[
"if statement has no comparison operator only an equal, what does it mean?",
"I have some code from a previous programmer and I'm a little confused to what it means.\nThe if statement is:\n if( !$this->report = $this->get_report()){\n... do something }\n\nI'm used to seeing the if statement with some "truthy" condition or a comparison operator.\nIs this saying if $this->report is false or doesn't exist then make it = $this_.get_report()?"
] | [
"php"
] |
[
"Python version of Matlab Signal Toolbox's tfestimate()?",
"Is there a Python version of Matlab's tfestimate()? I have looked into the control toolbox but it only offers linear transfer functions."
] | [
"python",
"matlab",
"numpy",
"scipy"
] |
[
"How can I implement the use of two textboxes for my calculator?",
"The purpose of my assignment is to create a calculator that uses number inputs from two textboxes. The calculator works when only dealing with a single textbox(boxequation1) but I need it to accept another input from the other textbox(boxequation2). Is there any way to input a number into boxequation1, select an operation, input a number into boxquation2, and then compute the result?\n\n Public Class Form1\nPrivate Sub ButtonClickMethod(sender As Object, e As EventArgs) Handles num0.Click, num1.Click, num2.Click, num3.Click, num4.Click, num5.Click, num6.Click, num7.Click, num8.Click, num9.Click, opdivision.Click, opmultiply.Click, opdecimal.Click, opclear.Click, opminus.Click, opadd.Click, opequal.Click\n Dim button As Button = CType(sender, Button)\n If button.Name = \"num1\" Then\n boxequation1.Text = boxequation1.Text + \"1\"\n End If\n If button.Name = \"num2\" Then\n boxequation1.Text = boxequation1.Text + \"2\"\n End If\n If button.Name = \"num3\" Then\n boxequation1.Text = boxequation1.Text + \"3\"\n End If\n If button.Name = \"num4\" Then\n boxequation1.Text = boxequation1.Text + \"4\"\n End If\n If button.Name = \"num5\" Then\n boxequation1.Text = boxequation1.Text + \"5\"\n End If\n If button.Name = \"num6\" Then\n boxequation1.Text = boxequation1.Text + \"6\"\n End If\n If button.Name = \"num7\" Then\n boxequation1.Text = boxequation1.Text + \"7\"\n End If\n If button.Name = \"num8\" Then\n boxequation1.Text = boxequation1.Text + \"8\"\n End If\n If button.Name = \"num9\" Then\n boxequation1.Text = boxequation1.Text + \"9\"\n End If\n If button.Name = \"num0\" Then\n boxequation1.Text = boxequation1.Text + \"0\"\n End If\n If button.Name = \"opdecimal\" Then\n boxequation1.Text = boxequation1.Text + \".\"\n End If\n If button.Name = \"opequal\" Then\n Dim equation1 As String = boxequation1.Text\n Dim equation2 As String = boxequation2.Text\n Dim result = New DataTable().Compute(equation1, Nothing)\n\n boxresult.Text = result\n End If\n If button.Name = \"opminus\" Then\n boxequation1.Text = boxequation1.Text + \"-\"\n boxoperator.Text = boxoperator.Text + \"-\"\n End If\n If button.Name = \"opmultiply\" Then\n boxequation1.Text = boxequation1.Text + \"*\"\n boxoperator.Text = boxoperator.Text + \"x\"\n End If\n If button.Name = \"opdivision\" Then\n boxequation1.Text = boxequation1.Text + \"/\"\n boxoperator.Text = boxoperator.Text + \"÷\"\n End If\n If button.Name = \"opadd\" Then\n boxequation1.Text = boxequation1.Text + \"+\"\n boxoperator.Text = boxoperator.Text + \"+\"\n End If\n If button.Name = \"opclear\" Then\n boxequation1.Clear()\n boxoperator.Clear()\n boxresult.Clear()\n End If\nEnd Sub\nPrivate Sub opbackspace_Click(sender As Object, e As EventArgs) Handles opbackspace.Click\n boxequation1.Text = boxequation1.Text.Remove(boxequation1.Text.Count - 1)\nEnd Sub\n\nEnd Class"
] | [
"vb.net"
] |
[
"Set field in mongoose document to array length",
"I have a Mongoose document (Mongoose 5.4.13, mongoDB 4.0.12):\nvar SkillSchema = new mongoose.Schema({\n skill: { type: String },\n count: { type: Number, default: 0 },\n associatedUsers: [{ type : mongoose.Schema.Types.ObjectId, ref: 'User' }]\n});\n\nThat I update as follows:\nvar query = { skill: req.body.skill };\nvar update = { $addToSet: { associatedUsers: req.params.id } };\n \nvar options = { upsert: true, new: true, setDefaultsOnInsert: true };\n\nawait skillSchema.findOneAndUpdate(query, update, options);\n\nDuring this update, I would like to also update count to be equal to the length of associatedUsers.\nIdeally I want this to happen at the same time as updating the other fields (i.e not in a subsequent update), either via a pre-hook or within findOneAndUpdate.\nI've tried using a pre hook after schema definition:\nSkillSchema.pre('findOneAndUpdate', async function(){\n console.log("counting associated users");\n this.count = this.associatedUsers.length;\n next();\n});\n\nAs well as using aggregate in my UPDATE route:\nawait skillSchema.aggregate([{ $project: { count: { $size: "$associatedUsers" } } } ])\n\nBut I can't get either to work.\nDoes anyone have any suggestions for how I could achieve this?"
] | [
"javascript",
"node.js",
"mongodb",
"mongoose"
] |
[
"what's wrong with dynamic matchers on rails 4.0",
"I have an attribute which name is alias and method which create_alias.I use create_alias method as before_validation callback.In the method decleration I have following lines \n\nwhile ProjectType.find_by_alias(tmp) != nil \n tmp = self.alias + \"-\" + i.to_s\n i += 1 \nend\n\n\nAs you can see, the code tries to create unique alias but on rails 4.0 we encounter this error message.\n\nSyntaxError: /home/vagrant/.rvm/gems/ruby-1.9.3-p194@comRails4/bundler/gems/rails-39555a5b1989/activerecord/lib/active_record/dynamic_matchers.rb:65: syntax error, unexpected keyword_alias, expecting ')'\n def self.find_by_alias(alias, options = {})"
] | [
"ruby-on-rails",
"ruby-on-rails-4"
] |
[
"How to calculate distance using geopandas",
"I wanted to calculate the distance from Manila to cities in the Philippines using geopandas GeoSeries.distance(self, other) function.\nSteps:\n# So I start with the dataset, which should produce a geopandas dataframe consisting basically of cities and a polygon of its boundaries in latlong.\n\nurl = 'https://raw.githubusercontent.com/macoymejia/geojsonph/master/MuniCities/MuniCities.minimal.json'\ndf1 = gpd.read_file(url)\n\n# then I define a centroid column\ndf1['Centroid'] = df1.geometry.centroid\n\n# then I define Manila location as a shapely point geometry, which produces a DataFrame with point geometry and address as columns\nmanila_loc = gpd.tools.geocode('Manila')\n\n# then I try to calculate the distance\ndf1.Centroid.distance(manila_loc.geometry)\n\n\nBut I'm getting this error:\nAttributeError Traceback (most recent call last)\n<ipython-input-30-76585915942f> in <module>\n----> 1 df1.Centroid.distance(manila_loc.geometry)\n\n~/opt/anaconda3/envs/Coursera/lib/python3.8/site-packages/pandas/core/generic.py in __getattr__(self, name)\n 5137 if self._info_axis._can_hold_identifiers_and_holds_name(name):\n 5138 return self[name]\n-> 5139 return object.__getattribute__(self, name)\n 5140 \n 5141 def __setattr__(self, name: str, value) -> None:\n\nAttributeError: 'Series' object has no attribute 'distance'\n\nI'm new to GeoPandas but I thought from the documentation that distance method can act on GeoSeries and that df1.Centroid and manila.geometry are valid shapely geometry objects. So I don't know what I am missing. Help pls."
] | [
"geopandas"
] |
[
"Where do I find code examples of a Drupal client consuming WCF Web Service?",
"I have a WCF Web Service up and running in a production environment, and everything works fine if I use a .NET client. But now I want to test if I have the ability to use this Web Service with a Drupal client.\n\nI've searched for the topic, but didn't find any useful content. If anyone have any leads to get me forward I would greatly appreciate it.\n\nWhere do I find code examples of a Drupal client consuming WCF Web Service?"
] | [
"drupal",
"wcf-client"
] |
[
"Lazy loading occasionally doesn't work in angular",
"I am encountering some strange behavior for the following code.\n\n function linkFunc(scope, element, attribute) {\n var page = angular.element($window);\n\n page.bind('scroll', function() {\n\n var windowHeight = \"innerHeight\" in window ? window.innerHeight : document.documentElement.offsetHeight;\n var body = document.body, html = document.documentElement;\n var docHeight = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n var windowBottom = windowHeight + window.pageYOffset;\n\n if (windowBottom >= docHeight) {\n scope.$apply(attribute.myDirective);\n }\n });\n }\n\n\nThe above is a piece of code that detects if the bottom of the page is reached, if its reached it will call whatever function bind to myDirective\n\nThe main issue is that most of the time the lazy loading works, and myDirective gets sucessfully called. However some of the times the lazy loading won't work, and I wasn't able to reproduce the bug.\n\nI tried different screen size, different browser, but it seems like the bug just happens randomly.\n\nMaybe someone have this happened to them before, and can point me a direction? \n\nEdit: \n\nMore information\n\nI was able to reproduce the bug after a bit of experimenting.\n\nBasically, when the zoom in percentage of the browser is < 100 % , window.pageY returns a decimal value that is slightly inaccurate which cause windowBottom to be off by a 0.1 to 0.9\n\neg.\n\n console.log(windowBottom); // 1646.7747712336175\n console.log(docHeight); // 1647\n\n\nDoes anyone know why this happens?\n\nEdit 2:\n\nThe above behavior is also non deterministic, but the decimal part is true."
] | [
"javascript",
"angularjs",
"infinite-scroll"
] |
[
"Is it possible to make an array of struct node type?",
"I was just wondering. Say you will need to store these values:\n\nHours\nMinutes\n\ninside an array, is the following implementation logically possible?\n\nstruct node\n{\nint hour;\nint minutes;\n};\n\n\nint main()\n{\nint numOfLanding, minGap, hour, minutes;\ncin>>numOfLanding;\ncin>>minGap;\ncout<<endl;\n\nstruct node *arr[numOfLanding];\n\nfor (int i=0; i<numOfLanding; i++)\n{\n cin>>hour;\n cin>>minutes;\n arr[i]->hour=hour;\n arr[i]->minutes=minutes;\n}\n\n\nI am still trying very hard to understand struct node logic. Any help would be much appreciated!"
] | [
"c++",
"arrays",
"struct"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.