texts
list
tags
list
[ "basic client server: Passing strings properly", "I am making a simple client/server that will pass strings back and forth. It is only slightly more advanced than an echo server. However, I am having some issue with passing the strings. I first ran into an issue where I was using the incorrect data type (not converting to utf-8), but am still having an issue.\n\nHere is my server code:\n\nimport socket\nimport re \n\nhost = ''\nport = 15008\nbacklog = 5 \nsize = 1024\nQUIT = bytes(\"QUIT\" , \"utf-8\")\nBYE = bytes(\"BYE\" , \"utf-8\")\nMATCH = bytes(\"MATCH\" , \"utf-8\")\nNO_MATCH = bytes(\"NO MATCH\", \"utf-8\")\n\ns = socket.socket(socket.AF_INET, socket.SOCK_STREAM) \ns.bind((host,port)) \ns.listen(backlog)\n\nwhile 1: \n client, address = s.accept() \n\n regex = client.recv(size)\n if regex == QUIT:\n client.send(BYE)\n client.close()\n break\n\n string = client.recv(size)\n if string == QUIT:\n client.send(BYE)\n client.close()\n break\n\n if re.match(regex, string):\n client.send(MATCH)\n else:\n client.send(NO_MATCH)\n\n\nand the client code:\n\nimport socket \n\nhost = 'localhost' \nport = 15008\nsize = 1024\n\ns = socket.socket(socket.AF_INET, socket.SOCK_STREAM) \ns.connect((host,port))\n\ns.send(bytes('[ws]', \"utf-8\"))\ns.send(bytes('s', \"utf-8\")) \ndata = s.recv(size) \nprint('Should match: ' + data)\n\ns.close()\n\n\nRight now both the server and client just get hung-up." ]
[ "string", "utf-8", "python-3.x", "client-server" ]
[ "Checkstyle Issues In IntelliJIdea", "I have added the checkstyle plugins to take care of coding restriction. I fetched the checkstyle.xml from sonar cube server and added in plugin config. As shown :\n\nWhen I try to check the current file. It shows me 3 warnings which actually should be errors. Moreover, On sonar server report there are 8 error. Therefore I am missing 5 errors as well as there warning that are coming as warning should display as errors. Any Idea how to fix it." ]
[ "intellij-idea", "checkstyle" ]
[ "updating file icon type to MySQL from it's adress", "i'd like to repair my file type icons, 'cause i didn't set the icon during the upload and now i don't want to set it for each file, but do it with this in a second:\n\nmysql_set_charset('utf8');\n$sql = \"SELECT * FROM `upload_files` WHERE id > '0'\";\n$result = mysql_query ($sql);\necho mysql_error();\nwhile($pole = mysql_fetch_assoc($result)){\n\n $filename = $pole['file_adress'];\n $file_ext = substr($filename, strripos($filename, '.'));\n $file_ext = str_replace(\".\",\"\",$file_ext);\n mysql_query(\"UPDATE `d30268_acko`.`upload_files` SET `icon` = '/img/file_ico/$file_ext.png' WHERE `upload_files`.`file_adress` = $file_ext;\");\n echo $pole['icon'].\"<br>\";\n }\n echo \"Done\";\n\n\nfile adress is for example rokoko.odt and from this i want just odt, this is what i have now, but i need update about 100 rows to set file type icon\n\ncan anyone help me please? it just set icon same type for all of the files, thanks." ]
[ "php", "mysql" ]
[ "Symfony : migration fail because the command run an unexpected old version", "From Symfony 4, I am on (migration) version 20190708084642 and the only next version is 20190708121109 (I generated a Migration file named \"Version20190708121109.php\")\n\nIf I execute the command ./bin/console doctrine:migrations:migrate, I get this SQL error : \n\n\n\nbecause the ./bin/console doctrine:migrations:migrate command run a old migration file. Why this command execute an old migration file ? (the 20190701095432)\n\nIs it normal ? \n\nEDIT : in my database, my current migration version is 20190708084642, I see this same current version also when I execute the command ./bin/console doctrine:migrations:status" ]
[ "symfony", "doctrine", "database-migration", "symfony4" ]
[ "Can't access PercentRelativeLayout", "I want to use PercentRelativeLayout in a command line project using Ant under win10.\nI'm new to Android but have a Java background (as a programmer).\nI'm also new to Ant.\n\nThanks for your help.\nchatt\n\nI've updated the SDK Manager to Android 6.0 (API 23) with Android Tools 24.4.1 and installed v23.2 of the Android Support Lib.\n\nI have the following:\n\nC:\\Users\\chatt\\AppData\\Local\\Android\\sdk1\\extras\\android\\support\\percent\n\n\nand\n\nC:\\Users\\chatt\\AppData\\Local\\Android\\sdk1\\extras\\android\\support\\v14\\preference\\libs\n\n\nThe critical error is:\nNo resource identifier found for attribute 'layout_marginTopPercent' in package 'com.Chatterton.Peter.ChessClock'\n\nThis is my first post here so if I could have improved upon it pls let me know.\n\nThanks again.\n\nmain.xml\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.percent.PercentRelativeLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\">\n<ImageView\n app:layout_marginTopPercent=\"25%\"\n app:layout_marginLeftPercent=\"25%\"\n app:layout_widthPercent=\"50%\"\n app:layout_heightPercent=\"50%\" />\n</android.support.percent.PercentRelativeLayout>\n\n\nCompile Results:\n\nD:\\Android\\ChessClock>ant debug\nBuildfile: D:\\Android\\ChessClock\\build.xml\n-set-mode-check:\n-set-debug-files:\n-check-env:\n [checkenv] Android SDK Tools Revision 24.4.1\n [checkenv] Installed at C:\\Users\\chatt\\AppData\\Local\\Android\\sdk1\n-setup:\n [echo] Project Name: ChessClock\n [gettype] Project Type: Application\n-set-debug-mode:\n-debug-obfuscation-check:\n-pre-build:\n-build-setup:\n[getbuildtools] Using latest Build Tools: 21.1.2\n [echo] Resolving Build Target for ChessClock...\n[gettarget] Project Target: Google APIs\n[gettarget] Vendor: Google Inc.\n[gettarget] Platform Version: 5.0.1\n[gettarget] API level: 21\n[gettarget] WARNING: No minSdkVersion value set. Application will install on all Android versions.\n [echo] ----------\n [echo] Creating output directories if needed...\n [mkdir] Created dir: D:\\Android\\ChessClock\\bin\\rsObj\n [mkdir] Created dir: D:\\Android\\ChessClock\\bin\\rsLibs\n [echo] ----------\n [echo] Resolving Dependencies for ChessClock...\n[dependency] Library dependencies:\n[dependency] No Libraries\n[dependency]\n[dependency] ------------------\n [echo] ----------\n [echo] Building Libraries with 'debug'...\n [subant] No sub-builds to iterate on\n-code-gen:\n[mergemanifest] Found Deleted Target File\n[mergemanifest] Merging AndroidManifest files into one.\n[mergemanifest] Manifest merger disabled. Using project manifest only.\n [echo] Handling aidl files...\n [aidl] No AIDL files to compile.\n [echo] ----------\n [echo] Handling RenderScript files...\n [echo] ----------\n [echo] Handling Resources...\n [aapt] Generating resource IDs...\n [aapt] D:\\Android\\ChessClock\\res\\layout\\main.xml:8: error: No resource identifier found for attribute 'layout_marginTopPercent' in package 'com.Chatterton.Peter.ChessClock'" ]
[ "android", "xml", "ant" ]
[ "onclick for a button", "I have a code at a button \n\nonClick=\"$('img').removeClass('highlighted');$(this).addClass('highlighted')\n\n\nwell it will make the button gets highlighted but is it possible to add a check statement in there to see if the button is already highlighted and dehighlight it rather then letting it just stay highlighted?" ]
[ "jquery" ]
[ "Python Converts integer into a bit number of specific length, fast", "I am trying to delta compress a list of pixels and store them in a binary file. I have managed to do this however the method I found takes ~4 minutes a frame. \n\ndef getByte_List(self):\n values = BitArray(\"\")\n for I in range(len(self.delta_values)):\n temp = Bits(int= self.delta_values[I], length=self.num_bits_pixel)\n values.append(temp)\n ##start_time = time.time()\n bit_stream = pack(\"uint:16, uint:5, bits\", self.intial_value, self.num_bits_pixel, values)\n ##end_time = time.time()\n ##print(end_time - start_time)\n\n # Make sure that the list of bits contains a multiple of 8 values\n if (len(bit_stream) % 8):\n bit_stream.append(Bits(uint=0, length = (8-(len(bit_stream) % 8)))) #####Append? On a pack? (Only work on bitarray? bit_stream = BitArray(\"\")\n\n # Create a list of unsigned integer values to represent each byte in the stream\n fmt = (len(bit_stream)/8) * [\"uint:8\"]\n return bit_stream.unpack(fmt)\n\n\nThis is my code. I take the initial value, the number of bits per pixel and the delta values and convert them into bits. I then byte align and take the integer representation of the bytes and use it elsewhere. The problem areas are where I convert each delta value to bits(3min) and where I pack(1min). Is it possible to do what I am doing faster or another way to pack them straight into integers representing bytes." ]
[ "python", "integer", "bits", "typeconverter" ]
[ "Navigation menu A Href doesn't work when back to directory try?", "I tried to make the navigation menu. I took his menu file using code \"include\" in my index.php file.\n\nWhen I select the guitar work. but when re-pressing the home button. can not go back to the index or home? guitar.php files are in direcorty pages / guitar.php. \n\nWhy this can not go back to the index directly? please help me. Thank you\r\n\r\n<ul>\r\n<li><a href=\"index.php\" >Home</a></li>\r\n <li><a href=\"pages/guitar.php\">Guitars</a>\r\n <ul>\r\n <li><a href=\"#\">Guitar Acoustics</a></li>\r\n <li><a href=\"#\">Guitar Electirs</a></li>\r\n <li><a href=\"#\">Guitar Amplifiers</a></li>\r\n <li><a href=\"#\">Guitar Effects</a></li>\r\n \r\n </ul>\r\n \r\n </ul>\r\n\r\n\r\n\n\nabove is the code in the file navigation menu.\r\n\r\n<?php\r\nrequire_once \"layout/header.php\"; \r\ninclude (\"layout/nav.php\");\r\nrequire_once \"layout/aside.php\";?>\r\n?>\r\n\r\n\r\n\n\nabove is the code in file index.php, and pages/guitar.php.\nThanks ..." ]
[ "php", "html", "css" ]
[ "Eloquent many-to-many relationship and using pivot table as separate model", "While building a laravel web application I faced and interesting problem and I believe there should be a best practice to solve this kind of problem without re-inventing the wheel.\n\nBasically, I have many-to-many relationship:\n\nPost has many categories but at the same time categories can have many posts as well.\nEach category that belongs to the post can have \"votes\". These votes do not belong generally to the category but only to the category_post pivot table entry. \n\nMy question is:\nShould I create a separate model \"CategoryPost\" and then use one to many relationship with \"votes\" table of there is a more elegant way to implement it.\n\nI am also trying to make the querying process as expressive as possible." ]
[ "php", "laravel" ]
[ "How to read RegEx Captures in C#", "I started a C# book and I decided to throw RegEx's into the mix to make the boring console exercises a little more interesting. What I want to do is ask a user for their phone number in the console, check it against a RegEx, then capture the digits so I can format them the way I want. I've got all that working except the RegEx capture part. How do I get the capture values into C# variables?\n\nAlso feel free to correct any code formatting or variable naming issues.\n\nstatic void askPhoneNumber()\n{\n String pattern = @\"[(]?(\\d{3})[)]?[ -.]?(\\d{3})[ -.]?(\\d{4})\";\n\n System.Console.WriteLine(\"What is your phone number?\");\n String phoneNumber = Console.ReadLine();\n\n while (!Regex.IsMatch(phoneNumber, pattern))\n {\n Console.WriteLine(\"Bad Input\");\n phoneNumber = Console.ReadLine();\n }\n\n Match match = Regex.Match(phoneNumber, pattern);\n Capture capture = match.Groups.Captures;\n\n System.Console.WriteLine(capture[1].Value + \"-\" + capture[2].Value + \"-\" + capture[3].Value);\n}" ]
[ "c#", "regex", "console" ]
[ "Difficult Slow speed splitter file txt?", "I wrote a program that split txt files into smaller pieces\nBut my problem is that my method is slow\nBecause this file size is 1gb and I use a variable named \"pagesize\" which base on that amount of lines in splitted files will be calculated \n\nThe problem is that the foreach is slow?\n\nIs there a better way? \n\n private void button1_Click(object sender, EventArgs e)\n {\n string inputFile = @\"G:\\Programming\\C#\\c# tamrin reza\\large-Orders.txt\";\n\n int seed = 1000;\n const int pageSize = 5000;\n int count = 1;\n const string destinationFileName = @\"F:\\Output\\\";\n string outputFile;\n string baseName = \"-CustomerApp\";\n string extension = Path.GetExtension(inputFile);\n var lst = new List<string>();\n //FileInfo fileInfo = new FileInfo(inputFile);\n //long fileSize = fileInfo.Length / pageSize;\n FileStream fs = new FileStream(inputFile, FileMode.Open);\n StreamReader sr = new StreamReader(fs);\n while (!sr.EndOfStream)\n {\n for (int j = 1; j <= pageSize; j++)\n {\n var line = sr.ReadLine();\n lst.Add(line);\n }\n outputFile = destinationFileName + count + baseName + extension;\n CopyLines(lst, outputFile);\n lst.Clear();\n count++;\n }\n }\n\n private void CopyLines(List<string> line, string outputFile)\n {\n FileStream outputFileStream = new FileStream(outputFile, FileMode.Create, FileAccess.Write);\n //StreamWriter writer = new StreamWriter(outputFile);\n //for (int i = 1; i < line.Count; i++)\n //{\n //}\n using (StreamWriter sw = new StreamWriter(outputFileStream))\n {\n foreach (var li in line)\n {\n sw.WriteLine(li);\n }\n }\n }\n\n\nThanks" ]
[ "c#", "file", "split" ]
[ "How to fix behat 'DMore\\ChromeDriver\\StreamReadException' in behat script", "I am executing my behat script and getting the following exception :\n\nDMore\\ChromeDriver\\StreamReadException in /vendor/dmore/chrome-mink-driver/src/DevToolsConnection.php\n\nI am getting the following exception in my local and also in my Acquia pipeline.Strange thing is that this exception does not appears everytime and appears on different step definations each time.\n\n@smoke\nFeature: Test SEARCH box\n @javascript @api @errors\n Scenario: Test For the SEARCH box \n Given I am on \"/\"\n # Drupal\\DrupalExtension\\Context\\MinkContext::visit()\nDMore\\ChromeDriver\\StreamReadException in /<project_folder>/vendor/dmore/chrome-mink-driver/src/DevToolsConnection.php" ]
[ "php", "drupal-8", "behat" ]
[ "How to count objects in real time using Tensorflow lite?", "Im' new in computer vision. I want to count objects that pass a line in real time, using an Adroid device. I've found some tensorflow APIs for counting objects. But, I don't know to implement it on Android Studio. Is it possible to implement it?\nHere some APIS I've mentioned:\nhttps://github.com/ahmetozlu/tensorflow_object_counting_api\nhttps://github.com/tugot17/YOLO-Object-Counting-API\nhttps://github.com/TannerGilbert/Tensorflow-2-Object-Counting\nThank you in advance." ]
[ "android", "tensorflow", "object-detection", "counting" ]
[ "Share files using socket.io P2P in Electron app", "Since I'm unable to install webtorrent-hybrid in my Veu Electron project, I'm reading about Socket.io P2P. If I want to use the library inside the electron project, will it work as expected if the server is running inside the electron instance and an https ngrok tunnel is provided to the other client who need to connect?\nFor example, using the example from the docs with a little modification\n//server setup ipcMain\nvar server = require('http').createServer();\nvar p2pserver = require('socket.io-p2p-server').Server\nvar io = require('socket.io')(server);\nserver.listen(3030)\nio.use(p2pserver);\n\nio.on('connection', function(socket) {\n socket.on('peer-msg', function(data) {\n console.log('Message from peer: %s', data);\n socket.broadcast.emit('peer-msg', data);\n })\n\n socket.on('go-private', function(data) {\n socket.broadcast.emit('go-private', data);\n });\n});\n\n//client code ipcRenderer\nvar ngrok = require('ngrok');\nvar P2P = require('socket.io-p2p');\nvar io = require('socket.io-client');\nvar socket = io();\nvar p2p = new P2P(socket);\n// generate ngrok tunnel link on connection\n// var tunnel = ngrok.connect({addr: 18000});\np2p.on('peer-msg', function (data) {\n console.log('From a peer %s', data);\n});\n\n\nWill the client who get the generated tunnel link be able to connect with the peer who created the socket.io server without having the same app installed? Maybe if I provide a simple html page for the ui from within the app and that is exposed from the internal http server of the app, the things will work?" ]
[ "node.js", "socket.io", "electron", "p2p" ]
[ "Layout out data-entry form in HTML: table or no table?", "I want to create a data-entry form like the following:\n\nName: [ Name textbox ]\nAge: [ Age textbox ]\nlabel n: [ textbox n ]\n\n\nWhere the labels left-align, and the textboxes left-align. I know I can do this in a table element, but I'm also aware that \"tables should only be for tabular data\". While I part agree/disagree with that statement - I'd like to know whether my desired layout could/should be considered \"tabular data\", and what an alternative layout would be to produce the same results without dozens of lines of complicated cross-browser CSS.\n\nI don't do web development much at the moment (strictly WinForms for some time now when I do UI work), so I appreciate there may be an elegant solution. Possibly involving an unordered list with the bullet points turned off and a bit off label->field y position offsetting, perhaps?" ]
[ "html" ]
[ "String index out of range and can't find anything similar", "I have to find the char which appears the least in a string.\n\npackage String2;\n\npublic class Methods3 {\n static final int chars=256;\n static char least(String str) {\n int[] bro=new int[chars];\n int j;\n\n //I made the frequency of chars:\n for(j=0 ; j<str.length() ; j++) {\n (bro[str.charAt(j)])++; //made the array\n }\n int min= bro[str.charAt(0)];\n\n //Tried finding the smallest value:\n for(int x=0 ; x<bro.length ; x++ ) {\n if((bro[str.charAt(x)])<=min) {\n min=(bro[str.charAt(x)]); //finding the smallest number of times \n }\n }\n return (char) min;\n }\n\n public static void main(String[] args) {\n String txt=\"yooooo bbaa ccoo\";\n char rez=least(txt);\n System.out.println(rez);\n }\n}" ]
[ "java" ]
[ "Is it an good idea to make a wrapper specifically for a DateTime that respresents Now?", "I have been noticing lately that is really nice to use a DateTime representing 'now' as an input parameter for your methods, for mocking and testing purposes. Instead of every method calling DateTime.UtcNow themselves, I do it once in the upper methods and forward it on the lower ones.\n\nSo a lot of methods that need a 'now', have an input parameter DateTime now.\n\n(I'm using MVC, and try to detect a parameter called now and modelbind DateTime.UtcNow to it)\n\nSo instead of:\n\npublic bool IsStarted\n{\n get { return StartTime >= DateTime.UtcNow; }\n}\n\n\nI usually have:\n\npublic bool IsStarted(DateTime now)\n{\n return StartTime >= now;\n}\n\n\nSo my convention is at the moment, if a method has a DateTime parameter called now, you have to feed it with the current time. Of course this comes down to convention, and someone else can easily just throw some other DateTime in there as a parameter. \n\nTo make it more solid and static-typed I am thinking about wrapping DateTime in a new object, i.e. DateTimeNow. So in one of the most upper layers I will convert the DateTime to a DateTimeNow and we will get compile errors when, someone tries to fiddle in a normal DateTime.\n\nOf course you can still workaround this, but at least if feels more that you are doing something wrong at point.\nDid anyone else ever went into this path? Are there any good or bad results on the long term that I am not thinking about?" ]
[ "c#", "dependencies" ]
[ "Form array of equivalence related classes", "I have an array in Matlab. I numbered every entry in array with natural number. So I formed equivalence relation in array.\n\nFor example,\n\narray = [1 2 3 5 6 7]\nclasses = [1 2 1 1 3 3].\n\n\nI want to get cell array: i-th cell array's position is connected with i-th entry of initial array and shows, which elements are in the one class with this entry. For the example above, I would get:\n\n{[1 3 5], [2], [1 3 5], [1 3 5], [6 7], [6 7]}\n\n\nIt can be done easily with for-loop, but is there any other solution? It will be good if it works faster than O(n^2), where n is the size of initial array.\n\nEdit.\nProblem will be solved, if I know the approach to split sorted array into cells with indeces of equal elements by O(n).\n\narray = [1 1 1 2 3 3]\ngroups = {[1 2 3], [4], [5 6]}" ]
[ "arrays", "matlab", "indexing", "cell-array", "equivalence-classes" ]
[ "Porting only HTTP portion of libcurl", "I am evaluating libcurl in order to extract only HTTP functionality for a custom OS without rest of the protocols like ftp, rtsp etc. On the face of it, it looks like a big effort. Has anyone done a libcurl port with only HTTP?" ]
[ "curl" ]
[ "How to change background color of an HTML displayed table in Jupyter Notebook", "I use the functions display(HTML(html-string)) to display an HTML formatted table in my notebook. However, trying some css to change the table background color is not being honored. Here is a snipit of my code:\n\nrownum = 1\n# make this table yellow\nsource = '<table bgcolor=\"yellow\"><tr><th>Number</th><th>Instance Type</th><th>Total Cost</th>' \\\n '<th>Number of Instances</th></tr>'\n\nfor k in keys: \n source += \"<tr><td>%d</td><td>%s</td><td>$%0.2f</td><td>%d</td></tr>\" % \\\n (rownum,resultsTable2[k][\"itype\"],k,resultsTable2[k][\"num\"])\n rownum += 1\n\nsource += '</table>'\ndisplay(HTML(source))\n\n\nOutput looks like this:\n\n\nVersion Details\n\nThe version of the notebook server is 4.4.1 and is running on:\nPython 2.7.12 (default, Sep 28 2016, 18:41:32) \n[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)]\n\nFirefox 53.0.3 on OS X Sierra." ]
[ "python", "jupyter-notebook", "jupyter" ]
[ "VS2012EXPRESS Ado.Net SQLite missing DLL issue", "I'm trying to work out how to use ADO.Net Sqlite in VS2012 Express with no luck.\n\nThings im doing from begining:\n\n\nStarting new project and installing \"System.Data.SQLite (x86/x64)\" via NuGet for solution.\nAdding using System.Data.SQLite; to directives.\nWriting simple code like:\n\nSQLiteConnection sql_sck = new SQLiteConnection(\"Data Source=test.sqlite;Version=3;New=False;Compress=True;\");\n\n\nEverything seems to look okay, VS recognize class names and changes their colors. However after running the program, in the sql_sck... line, exception is raised - about missing dll ?\n\nAn unhandled exception of type 'System.DllNotFoundException' occurred in System.Data.SQLite.dll\nAdditional information: Could not load DLL 'SQLite.Interop.dll': Could not find specified module. (Exception HRESULT: 0x8007007E)\n\n\nAny ideas how can I make this work ? Is there anything I've done wrong / any steps missing ?" ]
[ "c#", "sqlite", "exception", "ado.net" ]
[ "Modify a existing regex to include some special characters", "I have a column ('branch') on which I am performing data cleaning, basically I want to retain only alphanumeric along with some special character like, \"-\", \"/\", \"(\", \")\", spaces\n\nCurrently this is my code (retains only alphanumeric):\n\n library (stringr)\n\n df$branch1 <- str_replace_all(new_nodup$branch, \"[\\\\W]\", \"\")\n\n\nI tired to use the following but this didn't work: \n\nRegex to accept alphanumeric and some special character in Javascript?" ]
[ "regex", "r", "dataframe" ]
[ "Function call doesn't display cout", "Hello I've written a program to calculate the ending balance of a bank account. I've created an overloaded function to add the deposits to the starting balance, one for an interest amount and one without any interest. Currently, the function call does not display any value.\n\nAny input as to why this happens would be greatly appreciated! And yes, I have stepped through the code line by line and explained it to my rubber duck.\n\n#include <iostream>\n\nusing namespace std;\n\nconst int SIZE = 25;\nconst int sentinel = -999;\n\n\nint main(){\n void balanceAccount(double, int, double[]);\n void balanceAccount(double, int, double[], double);\n double balance = 0.0, interest = 0.0, num = 0.0, total = 0.0;\n double deposit[SIZE] = {};\n int count = 0;\n\n cout << \"Enter starting balance: $\";\n cin >> balance;\n\n while (num != sentinel && count < SIZE)\n {\n cout << \"Enter up to 25 deposits, or -999 to quit: \" << endl;\n cin >> num;\n if (num != sentinel){\n deposit[count] = num;\n count++;\n }\n cout << \"There are \" << count << \" deposits this week.\" << endl;\n }\n cout << \"Test deposits: \";\n for (int i = 0; i < count; i++){\n cout << deposit[i] << \" \";\n }\n\n cout << \"Enter interest amount: \";\n cin >> interest;\n if (interest == 0.0){\n balanceAccount(balance, count, deposit);\n }\n else if (interest > 0.0){\n balanceAccount(balance, count, deposit, interest);\n }\n\n system(\"pause\");\n return 0;\n}\n\nvoid balanceAccount(double bal, int ct, double dep[]){\n double sum = 0.0;\n for (int i = 0; i < ct; i++){\n sum += dep[i];\n }\n sum = sum + bal;\n\n cout << \"Ending balance: $\" << sum << endl;\n}\nvoid balanceAccount(double bal, int ct, double dep[], double rate){\n double interestAmount = 0.0, sum = 0.0;\n for (int i = 0; i < ct; i++){\n sum += dep[i];\n }\n sum = sum + bal;\n interestAmount = sum * rate;\n sum = sum + interestAmount;\n\n cout << \"Ending balance: $\" << sum << endl;\n}" ]
[ "c++", "function", "if-statement", "overloading" ]
[ "python use plotly to plot time series without date gaps", "I am using python3. I have a price quote series of 1 minute frequency. The quote is only available in trading hours. I tried to plot it using plotly, but there are gaps in non trading hours and weekends. How can I make this plot consecutive?\n\nMy code is like\n\nifBasisPlot=go.Scatter( x=ifBasis.date, y=ifBasis.basis, line=go.Line(width=1,color='blue'), name='basis' )\n\ndata = go.Data([ifBasisPlot])\n\nifBasisPlot_url = py.plot(data, filename='ifBasisPlot', auto_open=False,)\n\n\nthe plot and the data is here: https://plot.ly/~shuaihou96/14/if/" ]
[ "python", "plotly" ]
[ "Troubles with margin-bottom and vh unit", "I have a div who should scroll over the browser window. I have setted a top of 73vh and a margin-bottom of 100vh. So the effect should be, to scroll this div \"out of the browser window\". In Chrome this works like a charm, but in Firefox the margin-bottom is not the window-height.\n\nHTML:\n\n<div class=\"container\">\n Hi!\n</div>\n\n\nCSS: \n\n.container {\n position: relative;\n top: 73vh;\n margin-bottom: 100vh;\n background: red;\n}\n\n\nI have creaded a code-pen to reproduce: Code Pen example\n\nOpen the CodePen in Chrome, the red box was moving out of the view, Open the CodePen in Firefox, the red box was moving just a little. I would like to have the effect of Chrome.\n\nSOLUTION\n\nBased on fcalderan answer: change top to margin-top, then it works with FF too. CodePen\n\n.container {\n position: relative;\n margin-top: 73vh;\n margin-bottom: 100vh;\n background: red;\n}" ]
[ "html", "css" ]
[ "Refresh Activity without Closing it", "I'm using this code in activity opened from notification, but whenever refresh button is pressed activity stops instead of restarting\n refresh.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n startActivity(getIntent());\n overridePendingTransition(0, 0);\n finish();\n }\n });" ]
[ "java", "android", "android-studio" ]
[ "Accessing TFS (on prem) via powershell in docker windows container", "I have a window 2016 server running windowservercore. I am working on moving CI pipeline into containers. During our process, we build a version.html file. The file contains build data(like build date and build nbr) and TFS 2017 project information about merge/branch that have occured.\n\nWe had this working with TeamCity running a PowerShell script that would connect and run a query against TFS 2017. So I looked on docker hub for TFS, but did not have any luck. I also tried looking under Microsoft on docker hub and did not find anything. \n\nI tried to create a new docker file \n\n FROM microsoft/windowsservercore:10.0.14393.1480\n\n# Setup shell\nSHELL [\"powershell\", \"-Command\", \"$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';\"]\n\nRUN Mkdir BuildStage\nCOPY powershell/CopyBuildToStageDir.ps1 \\BuildStage\nCopy powershell/BuildVersionFile.ps1 \\BuildStage\n\nRUN dir\n\n\nBut when I ran the Powershell file inside the windows container it said...\n\nUnable to find type \n\n[09:25:00][Step 2/2] [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory].\n\n[09:25:00][Step 2/2] At C:\\BuildStage\\BuildVersionFile.ps1:192 char:12\n\n\nIn the PowerShell, there is this function\n\n#============================================================================\n# Setup TFS stuff\n#============================================================================\nfunction Setup-Tfs {\n\n # Connect to TFS\n [System.Reflection.Assembly]::LoadWithPartialName(\"Microsoft.TeamFoundation.Client\") | out-null\n [System.Reflection.Assembly]::LoadWithPartialName(\"Microsoft.TeamFoundation.VersionControl.Client\") | out-null\n\n $tfsServer = \"http://ourServer\";\n $tfs = [Microsoft.TeamFoundation.Client.TeamFoundationServerFactory]::GetServer($tfsServer) \n $Script:versionControlServer = $tfs.GetService([Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer] ) \n $Script:recursionType = [Microsoft.TeamFoundation.VersionControl.Client.RecursionType]::Full\n\n}\n\n\nHere are more details of how we are using powershell to call TFS to get Merge and Branch information to build the version.html file...\n\n # Need to get the last 5 changesets of Merge information for both MAIN and Iteration\n Setup-Tfs\n\n $baseLocation = \"$/OurBaseLocation/\"\n $locationForMain = $baseLocation + $OurProjectLocation\n\n # Query history for the TFS path\n $vCSChangeSets = $versionControlServer.QueryHistory($locationForMain, $recursionType, 5)\n\n # History of Merge changes to MAIN application (only 5 deep)\n \"<table border='2'>\" | Out-File $VersionFname -append\n \"<caption>Merge Info For: $AppName </caption>\" | Out-File $VersionFname -append\n\n # Build out headers\n \"<TH>Changeset</TH><TH>Date</TH><TH>Comment</TH>\" | Out-File $VersionFname -append\n\n Foreach ($vCSChangeSet in $vCSChangeSets) {\n # write row\n $changeset = $vCSChangeSet.ChangesetID \n $CheckinNotesName = $vCSChangeSet.Comment\n $CreationDate = $vCSChangeSet.CreationDate\n\n if ($CheckinNotesName.ToUpper().Contains(\"MERGE\")){\n \"<TR>\" | Out-File $VersionFname -append\n \"<TD>$changeset</TD><TD>$CreationDate</TD><TD>$CheckinNotesName</TD>\" | Out-File $VersionFname -append\n \"</TR>\" | Out-File $VersionFname -append\n }\n if ($CheckinNotesName.ToUpper().Contains(\"BRANCH\")){\n \"<TR>\" | Out-File $VersionFname -append\n \"<TD>$changeset</TD><TD>$CreationDate</TD><TD>$CheckinNotesName</TD>\" | Out-File $VersionFname -append\n \"</TR>\" | Out-File $VersionFname -append\n }\n }\n\n # close table add space\n \"</table><BR/><BR/>\" | Out-File $VersionFname -append\n\n\nMy guess is that my docker file needs to add something for \"Microsoft.TeamFoundation.VersionControl.Client\" \n\nAny help would be appreciated." ]
[ "windows", "tfs", "dockerfile" ]
[ "How to query a json date range on Django REST?", "How to query a JSON Date Range on Django REST?\nI have a graph on my frontend UI, I have an option which date to display. (day/week/month/year) and fetch it from an API.\nHow to do it? like if the user click "day", the API will be like. api/sample_data/current_day. or if "week" then api/sample_data/current_week.\nThanks" ]
[ "json", "django", "charts", "django-rest-framework", "view" ]
[ "Error on function call for Area2D randomly occurs", "I have created a system, within which I am instancing kinematic bodies (2D). These have scripts attached. When I call the functions within these, all is GENERALLY okay. However randomly, with wildly different wait times for it to happen (sometimes it never does), the system will crash, saying that the function, that has been working fine, is does not exist within Area2D. I have no clue why this can happen, can anyone give me any help with this.\n\nThe actual error code Invalid call. Nonexistent function 'move' in base 'Area2D'\n\nThanks" ]
[ "gd", "godot", "gdscript" ]
[ "How to call VS Code Editor from terminal / command line", "The question says it all.\n\nHow can I open VS Code editor from\n\n\nwindows cmd\nlinux and mac terminal\n\n\ne.g. for notepad++ I write\n\n> start notepad++ test.txt\n\nBy the way, the editor is awesome (cross-platform)! Thank you Nadella!\n\nYou can download it from microsoft" ]
[ "command-line", "terminal", "visual-studio-code", "text-editor" ]
[ "Regex for key value pair", "I have a regex \n\n(\\w+)\\s*:((?:\\w+[-+*%])*?\\w+)$\n\n\nthat matches key value pair like these -\n\n\n key:value\n \n key2:value2\n\n\nBut the regex match fails if the key and value are within quotes like these -\n\n\n \"key\":value\n \n \"key2\":\"value2\"\n\n\nWhat modification can be done to make the regex match key and value within quotes also ?" ]
[ "javascript", "regex", "key-value" ]
[ "Codeigniter: Update multiple Rows in Codeigniter in one statement", "I am having dictionary as \n\n\r\n\r\narray(\r\n 'ID1' => 1 ,\r\n 'ID2' => 2,\r\n 'Status' => 'Done'\r\n)\r\n\r\n\r\n\n\nWhile I have only 2 columns in my table, ID and Status. I want to update two rows having IDs 1, and 2, using only one time ($this->db->update). Is it possible or should I have to make custom query.\nI want to do like ($this->db->update(where ID1 == 1 && ID2 == 2))." ]
[ "sql", "codeigniter" ]
[ "Illegical static declaration in inner class", "import java.lang.*;\n\nclass mythread implements Runnable {\n\n Thread t1;\n String name = \"\";\n\n mythread(String thname){\n\n name = thname;\n t1 = new Thread(this, name);\n System.out.println(\"Child thread starting\" + t1 );\n }\n\n @Override\n public void run() { \n for(int i = 5 ; i > 0 ;i--){\n System.out.println(\"Name Of Thread\" + t1 + i);\n } \n }\n\n\n class t {\n\n public static void main(String args[]) {\n\n mythread m1 = new mythread(\"Child Thread 1\");\n mythread m2 = new mythread(\"Child Thread 2\");\n\n try {\n\n for(int i = 5 ; i > 0 ;i--) {\n System.out.println(\"Main Thread\" + i);\n Thread.sleep(2000);\n }\n\n }\n catch(InterruptedException e){\n\n System.out.println(\"Main Thread Interrupted\");\n }\n\n\n }\n}\n\n\nTHE ERROR IS GIVEN IN public static line:\n\nIllegical static declaration in inner class `mythread.t` modifier static is allowed in constant variable declaration" ]
[ "java", "multithreading" ]
[ "how to hide keyboard on view disappear or button click iphone", "I have a table view on a view and table view contains custom cells and cell contains text box. and i want to hide the keyboard when user click on save button or user navigate from the view.\ni already have hide the keyboard on done button.. plz can any one suggest." ]
[ "iphone", "keyboard", "hide" ]
[ "Adding links within ACF Image Caption", "So I'm using ACF Image: https://www.advancedcustomfields.com/resources/image/, and outputting my image and caption as an Array. \n\nI'd like to be able to add links within my captions e.g. '', but when I do this it literally outputs the code rather than turning the text into a link. \n\nIs there a way to make it be a link rather than just outputting the HTML as text.\n\nThis is my code for my image:\n\n<?php \n$image = get_sub_field('image'); if( $image ):\n\n// Image variables.\n$url = $image['url'];\n$title = $image['title'];\n$alt = $image['alt'];\n$caption = $image['caption'];\n?>\n\n<img class=\"img-fluid\" src=\"<?php echo esc_url($url); ?>\" alt=\"<?php echo esc_attr($alt); ?>\" />\n\n<?php if( $caption ): ?>\n <p class=\"caption\"><?php echo esc_html($caption); ?></p>\n<?php endif; ?>\n<?php endif; ?>\n\n\nBut when I add this to the caption box within Wordpress: This image is from Flickr.\n\nIt literally outputs the same as above rather than turning the word into a link." ]
[ "php", "wordpress", "image", "advanced-custom-fields", "acfpro" ]
[ "Is it necessary to check for non-zero length when read from a Reader and write to a Writer in Golang?", "When I try to copy from a Reader to a Writer manually, I notice that this works:\n\nfunc fromAToB(a, b net.Conn) {\n buf := make([]byte, 1024*32)\n for {\n n, err := a.Read(buf)\n if n > 0 {\n if err != nil {\n log.Fatal(err)\n }\n b.Write(buf[0:n])\n }\n }\n} \n\n\nBut this doesn't \n\nfunc fromAToB(a, b net.Conn) {\n buf := make([]byte, 1024*32)\n for {\n _, err := a.Read(buf)\n if err != nil {\n log.Fatal(err)\n }\n b.Write(buf)\n }\n}\n\n\nSo the questions are: \n\n\nWhy is the check if n>0 necessary? \nIs this only necessary for net.Conn or for any type that implements the Reader and Writer interfaces? \n\n\nEDIT: The second snippet runs fine without any runtime error, just that the behavior is not correct. I want to know what is the effect of that n>0 check and what will happen under the surface when I remove it." ]
[ "go" ]
[ "Is there any library for converting pdf to jpeg in C", "Possible Duplicate:\n Converting a PDF to PNG \n\n\n\n\nStaff there any open source library in C can convert PDF to JPEG. thank you" ]
[ "c" ]
[ "Cannot create table SQLite Ionic 3", "I got an error when creating a table with SQLite with ionic 3. You can see the Error screenshot image. How to solve this?\n\ncreateTable() {\n this.sqlite.create({\n name: 'data.db',\n location: 'default'\n })\n .then((db: SQLiteObject) => {\n db.executeSql('create table danceMoves(name VARCHAR(32))', {})\n .then(() => alert('table created'))\n .catch(e => alert('table not created'));\n })\n .catch(e => console.log(e));\n}\n\n\n\n\nError detail tooltip:\n\n\n Argument of type {} is not assignable to parameter of type any[]. Property length is missing in type {}" ]
[ "sqlite", "ionic3" ]
[ "Files are not attached to my Nuget Package", "I wanna create a very simple Nuet package.I just want to add a file(Such as image,Text Files,..) and when i install this test package, the attached files get added into my solution.I did the below steps :\n\n1 : i created a custom Nuget Server (IIS).\n2: I used the Nuget.exe command to create the package, create folder and copy the desired files into the folder\n\n> NuGet Pack YourPackageName.nuspec\n> mkdir content\n> copy ..\\src\\SomeController.cs content\n\n\n3: i Copied content Folder\" and created package (YourPackageName.nuspec) into my package folder of Local nuget server (IIS Website)\n\nNow, when i connect to local nuget server, i can see the package(YourPackageName.nuspec) and install it on my project BUT the \"content\" Folder, is not added to my Project.\n\nCan anyone helps me?! What am i supposed to do more?" ]
[ "nuget", "nuget-package", "nuget-server" ]
[ "Why is this php plugin still executing after 5pm?", "We have a plugin which consists of two simple files, the plugin loader php file which take cares of plugin name, and version etc. and a functions.php which is called from the plugin loader file. \n\nThe functions.php is where the actual code is that does the work. The plugin is responsible for updating WooCommerce tables with stock from a CSV file every hour. \n\nI want to change this so it only operates between the hours of 9am and 5pm, Monday to Friday. \n\nI found this: PHP script to execute at certain times\n\nand modified my script by enclosing the main execution block in an If conditional like so:\n\n$file_url = plugin_dir_path( __FILE__ );\n\n$hour = date('G'); // 0 .. 23\n\nif ($hour >= 9 && $hour <= 17 && date('w') != 0 && date('w') !=6 ) {\n\n if(file_exists($file_url.'/csv_cron.txt')){\n $get_time = fopen($file_url.'/csv_cron.txt', \"r\") or die(\"Unable to open file!\");\n $timer = fgets($get_time);\n $last_run = intval((time()-$timer)/60);\n fclose($get_time);\n\n if($last_run > 60){\n w3ip_updater();\n $myfile = fopen($file_url.\"/csv_cron.txt\", \"w\") or die(\"Unable to open file!\");\n $txt = time();\n fwrite($myfile, $txt);\n fclose($myfile);\n }\n\n }else{\n\n $myfile = fopen($file_url.\"/csv_cron.txt\", \"w\") or die(\"Unable to open file!\");\n $txt = time();\n fwrite($myfile, $txt);\n fclose($myfile);\n }\n}\n\n\nThe function w3ip_updater() is also in this file below the above code block but I omitted it as it didn't seem relevant to my question.\n\nSo I have added the if conditional as I have demonstrated above, yet the function is still operating even after 5pm. It's now 7PM and the file already updated at 6:34pm, why is the above code still executing, past 5pm, given I have wrapped it in the if conditional which says only execute if the time is between 9am and 5pm?" ]
[ "php", "wordpress" ]
[ "Azure pipeline - unzip artefact, copy one directory into Azure blob store YAML file", "I am getting stuck with Azure pipelines.\nI have an existing node SPA project that needs built for each environment (TEST and PRODUCTION). This i can do, but need to have a manual step when pushing to PROD. I am using Azure Dev-op pipeline environments with Approval and Checks to mandate this.\nThe issue is using a 'deploy job' to take an artefact from a previous step I am unable to find the right directory. This is my YAML file have so far:\nvariables:\n# Agent VM image name\n vmImageName: 'ubuntu-latest'\n\ntrigger:\n- master\n\n# Don't run against PRs\npr: none\n\nstages:\n- stage: Development\n displayName: Devlopment stage\n jobs: \n - job: install\n displayName: Install and test\n pool:\n vmImage: $(vmImageName)\n \n steps:\n - task: NodeTool@0\n inputs:\n versionSpec: '12.x'\n displayName: 'Install Node.js'\n \n - script: |\n npm install\n displayName: Install node modules\n\n - script: |\n npm run build\n displayName: 'Build it'\n# Build creates a ./dist folder. The contents will need to be copied to blob store \n \n - task: ArchiveFiles@2\n inputs:\n rootFolderOrFile: '$(Build.BinariesDirectory)'\n includeRootFolder: true\n archiveType: 'zip'\n archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'\n replaceExistingArchive: true\n verbose: true\n \n - deployment: ToDev\n environment: development\n dependsOn: install\n strategy:\n runOnce:\n deploy:\n steps:\n - task: DownloadPipelineArtifact@2\n inputs:\n buildType: 'current'\n targetPath: '$(Pipeline.Workspace)'\n - task: ExtractFiles@1\n inputs:\n archiveFilePatterns: '**/*.zip'\n cleanDestinationFolder: true\n destinationFolder: './cpDist/'\n\n# Somehow within a deploy job retrieve the .zip artefact, unzip, copy the ./dist folder into the blob store\n\n - task: AzureCLI@2\n inputs:\n azureSubscription: MYTEST-Development\n scriptLocation: "inlineScript"\n scriptType: "bash"\n inlineScript: |\n az storage blob upload-batch -d \\$web --account-name davey -s dist --connection-string 'DefaultEndpointsProtocol=https;AccountName=davey;AccountKey=xxxxxxx.yyyyyyyyy.zzzzzzzzzz;EndpointSuffix=core.windows.net'\n displayName: "Copy build files to Development blob storage davey"\n\n - script: |\n pwd\n ls\n cd cpDist/\n pwd\n ls -al\n displayName: 'list'\n \n - bash: echo "Done"" ]
[ "azure-devops", "azure-pipelines" ]
[ "Is Spring Repository implemented compile-time or run-time?", "Spring JPA Repositories are some interfaces with convenient functionalities, So when their implementation are generated? I have not seen them generated compile time on IntelliJ, so where can I see or debug the concrete implementation code?" ]
[ "spring", "spring-data-jpa" ]
[ "Promises not working for IndexedDB in angularjs", "I have an app using IndexedDB. Originally I made prolific use of callbacks, and decided to clean it up using angularjs promises $q.\n\nFAIL.\n\nhttp://jsfiddle.net/ed4becky/bumm337e/\n\nangular.module(\"IDBTest\", []);\n\nangular.module(\"IDBTest\")\n.service(\"initSvc\", ['$q', function ($q) {\nvar svc = this;\nsvc.dbVersion = 1;\nsvc.open = open;\nsvc.deleteDB = deleteDB;\nvar idb = window.indexedDB;\n\nfunction deleteDB() {\n return $q(function (resolve, reject) {\n idb.webkitGetDatabaseNames().onsuccess = \n function (sender, args) {\n if (sender.target.result \n && sender.target.result.length > 0) {\n var db = sender.target.result[0];\n console.log(\"deleting \" + db);\n var request = idb.deleteDatabase(db);\n request.onsuccess = function () {\n console.log('database ' + db + ' deleted.');\n resolve();\n };\n request.onerror = function () {\n reject();\n };\n } else {\n console.log(\"Nothing to delete\");\n resolve();\n };\n };\n });\n}\n\nfunction open(dbName) {\n return $q(function (resolve, reject) {\n var request = idb.open(dbName, svc.dbVersion);\n request.onupgradeneeded = function (e) {\n var db = e.target.result;\n console.log(\"creating new \" + db.name);\n e.target.transaction.onerror = function (e) {\n console.log(e);\n };\n db.createObjectStore(\"table1\", {\n keyPath: \"id\"\n });\n db.createObjectStore(\"table2\", {\n keyPath: \"id\"\n });\n db.createObjectStore(\"table3\", {\n keyPath: \"id\"\n });\n };\n\n request.onsuccess = function (e) {\n console.log('database ' + dbName + ' open.');\n svc.db = e.target.result;\n resolve();\n };\n\n request.onerror = function () {\n reject();\n };\n\n });\n}\n}]);\n\nangular.module('IDBTest')\n.factory('$exceptionHandler', ['$log', function ($log) {\nreturn function (exception, cause) {\n throw exception;\n};\n }]);\n\nangular.module('IDBTest')\n.run(['initSvc', function (initSvc) {\ninitSvc.deleteDB()\n .then(initSvc.open('testDatabase'))\n .then(function () {\n console.log(initSvc.db.name + ' initialized');\n });\n}]);\n\n\nThis fiddle shows my expectation that\n\n\nAny databases created are deleted.\nthen\nA database is open triggering an onupgradeneeded\nthen\nThe database is referenced\n\n\nUnfortunately the then statments seem to get called BEFORE the promises are resolved in the onsuccess methods of the IDB calls.\n\nTo recreate, run the jsfiddle with the console open. May have to run it a couple times to get the exception, but it fails most times, because the last then clause is called before the onsuccess on the database open is called.\n\nAny ideas?" ]
[ "javascript", "angularjs", "indexeddb", "angular-promise" ]
[ "Why is the footer not going to the bottom of the page?", "Here is the JSFiddle: http://jsfiddle.net/W2UvH/1/\n\nVery simple implementation of a sticky footer that should stick to the bottom of the screen when there is less content height than the height of the screen. But if the height of the content extends beyond the height of the screen, then the footer should follow along with it. \n\nI don't understand why my footer is stopping half way up the screen.\n\nHTML:\n\n<div id=\"Canvas\">\n <div id=\"Container\">\n <div id=\"Wrapper\"> \n </div>\n </div>\n</div>\n<div id=\"SiteFooter\">\n<p>Copyright © All Rights Reserved.</p>\n</div>\n\n\nCSS:\n\nbody, html {\n height: 100%;\n}\n\n#Canvas {\n position: relative;\n min-height: 100%;\n}\n#Container {\n margin: auto;\n background-color: #CCC;\n max-width: 802px;\n padding: 15px 0;\n}\n#Wrapper {\n margin-right: auto;\n margin-left: auto;\n margin-top: 15px;\n width: 730px;\n background-color: #999;\n border: 1px solid #DEDEDE;\n overflow: hidden;\n height: 1000px;\n}\n#SiteFooter {\n bottom: 0;\n left: 0;\n position: absolute;\n width: 100%;\n z-index: 9000;\n background-color: #FF00FF;\n height: 45px;\n border-top-width: 1px;\n border-top-style: solid;\n border-top-color: #E0E0E0;\n}" ]
[ "css" ]
[ "Missing artifact org.jboss.fuse:jboss-fuse-full:zip:6.2.1.redhat-084 when it does show in local repository", "I have a quickstart project that is failing to build with the following error.\nMissing artifact org.jboss.fuse:jboss-fuse-full:zip:6.2.1.redhat-084\n\nHowever, it does show in my local Maven repository, at least there is an entry.\nHere is a screenshot of my local repository\nHow can I clear this error?" ]
[ "maven", "jbossfuse" ]
[ "Check boxes Value Manipulation", "Below are my static check boxes with values.\n\nWhat I need is when user Checks any of the check boxes and then click submit I need the checked chec kboxes values in php further i want to place them in mysql query like this\n\nselect * from table where \"all check boxes values\"\n\n\nMy search in mysql will be based on all the checked values\n\necho \"<table border='0'>\";\necho \"<p>Make a Selection to view details</p>\";\necho \"<tr><th>Scheme Type</th><th>Scehme Sector</th><th>Area</th><th>Year</th></tr>\";\necho \"<tr><td><input type='checkbox' name='chkSkills' value='ADP' /> District ADP <br/>\";\necho \"<input type='checkbox' name='chkSkills' value='cmd'/> CM Directives <br/>\";\necho \"<input type='checkbox' name='chkSkills' value='tkpp'/> Tameer KPK Program <br/>\";\necho \"<input type='checkbox' name='chkSkills' value='tbcess' /> Tobacco Cess</td>\";\necho \"<td><input type='checkbox' name='chkSkills' value='wss' /> Water Supply & Sanitation <br/>\";\necho \"<input type='checkbox' name='chkSkills' value='road'/> Roads <br/>\";\n echo \"<input type='checkbox' name='chkSkills' value='ccb'/> CCB <br/>\";\necho \"<input type='checkbox' name='chkSkills' value='health'/> Health <br/>\";\necho \"<input type='checkbox' name='chkSkills' value='education'/> Education <br/>\";\necho \"<input type='checkbox' name='chkSkills' value='others' /> Others</td>\";\necho \"<td><input type='checkbox' name='chkSkills' value='pk77'/> PK-77 <br/>\";\necho \"<input type='checkbox' name='chkSkills' value='pk78'/> PK-78 <br/>\";\necho \"<input type='checkbox' name='chkSkills' value='pk79' /> PK-79 </td>\";\necho \"<td><input type='checkbox' name='chkSkills' value='1112'/> 2011-12 <br/>\";\necho \"<input type='checkbox' name='chkSkills' value='1011'/> 2010-11 </td></tr>\";\necho \"<tr><td colspan='4' align='right' style='background-color:white;'><input type='submit' name='devsub' value='Submit' /></td></tr>\";\necho \"</table>\";\n\n\nRegards" ]
[ "php", "mysql", "html" ]
[ "android -best approach to repetitive buttons", "I want to create the following pseudo layout in android and I'd like some help to determine the best approach:\n\n\n\nThe months of the year will all be listed in buttons and when the user clicks on them an action will occur. The day of the month gets stored to storage if you need to know. The size of the circles are all the same and their behavior is identical, just their name is different (and they each store their own name of course). What is the best UI approach I can take in android to do this? I thought of a few things:\n\n\nobvious create 12 buttons for each day of the month and have onclicks that read there text and store it.\ncreate a custom button and programatically add 12 buttons to a linearLayout in code.\ncould I somehow use a plural in android to get this done ?" ]
[ "android" ]
[ "Common gradle settings for subproject subsets", "We have a gradle multiproject setup:\n\nrootproject\n\nmodules\n\nsubmodule1\nsubmodule2\n\n\nservices\n\nservice1\nservice2\n\n\n\n\n\nFor all services I currently have added manually following:\nplugins {\n war\n}\n\ntasks.war {\n archiveFileName.set("ROOT.war")\n}\n\nconfigurations.create("war") {\n extendsFrom(configurations["compile"])\n}\n\nval warArtifact = artifacts.add("war", tasks.named<War>("war"))\n\nIs there a way to create some common gradle.kts file to import for each of the services?" ]
[ "gradle", "gradle-kotlin-dsl" ]
[ "How do I get the view controller that trigger the segue", "How do I get the view controller that trigger the segue without using delegates. And without set it in prepareForSegue. And both view controllers will be embedded in their navigation controllers. \n\nI would like to get that view controller from the view controller that is presented. I know that this is not the iOS way, since the iOS way is using delegates. \n\nBut I would appreciate how to get the reference." ]
[ "ios", "swift", "swift3" ]
[ "Error when executing make", "I am trying to create a makefile for my project, but i seem to run into some errors, as I am testing new things. My file structure is as such: \n\n~/main #root project folder\n ~/main/include #header files (mostly class headers)\n ~/main/src #source files\n ~/main/src/obj #object files\n Makefile\n\n\n(Makefile is in the root project folder)\n\nMakefile:\n\nCC=g++\n\nIDIR=include\nSDIR=src\nODIR=src/obj\n\nDEPS=$(IDIR)/%.h\nOBJS=$(ODIR)/%.o\nSRCS=$(SDIR)/%.cpp\n\nCFLAGS=-Wall -std=c++11 -I$(IDIR)\n\n$(OBJS): $(SRCS) $(DEPS)\n $(CC) -c -o $@ $< $(CFLAGS)\n\nall: $(OBJS)\n gcc -o run $^ $(CFLAGS)\n\n.PHONY: clean\n\nclean:\n rm -f $(OBJS)\n\n\nFor testing purposes I have a single main.cpp in src folder and a random header file in include folder. The error I am getting when running the simple make command is the following:\n\nmake: *** No rule to make target `src/obj/%.o', needed by `all'. Stop.\n\n\nEDIT : With the help of the guys below i came up with the solution\n\nCC=g++\n\nIDIR=include\nSDIR=src\nODIR=src/obj\n\nCFLAGS=-Wall -std=c++11 -I$(IDIR)\n\n_DEPS = yo.h\nDEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))\n\n_OBJ = main.o\nOBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))\n\n_SRC = main.cpp\nSRC = $(patsubst %,$(SDIR)/%,$(_SRC))\n\n\n$(ODIR)/%.o: $(SRC) $(DEPS)\n $(CC) -c -o $@ $< $(CFLAGS)\n\nall: $(OBJ)\n $(CC) -o run $^ $(CFLAGS) $(LIBS)\n\n.PHONY: clean\n\nclean:\n rm -f $(OBJS)" ]
[ "c++", "makefile", "gnu-make" ]
[ "Creating a dataframe from a loop from a scrapper", "My dataframe \"df\" either returns an empty dataframe or just a one or two column dataframe and not all columns related to the amount of days for which i'm running it for.\n\nfrom bs4 import BeautifulSoup\nimport requests\nfrom datetime import datetime, timedelta \nimport pandas as pd\nimport numpy as np\nimport matplotlib as plt\nimport pandas as pd\nimport numpy as np\nimport matplotlib as plt\nfrom matplotlib import pyplot as plt\nfrom matplotlib.pyplot import figure\nfrom matplotlib.patches import Ellipse\nimport numpy as np\nfrom matplotlib.text import OffsetFrom\nimport re\n\ndf=pd.DataFrame()\ntoday=datetime.today().strftime('%Y-%b-%d')\nend_date=datetime.strptime(today,'%Y-%b-%d')\nrun_date=datetime.strptime('2019-Jul-1', '%Y-%b-%d')\nref_date=datetime.strptime('2000-May-25', '%Y-%b-%d')\n\nwhile (run_date-ref_date)<(end_date-ref_date):\n run_date=run_date+timedelta(1)\n url = f'https://www.nasdaq.com/earnings/earnings-calendar.aspx?date={run_date}'\n r =requests.get(url)\n soup = BeautifulSoup(r.text, 'html.parser')\n table = soup.find(\"table\", { \"class\" : \"USMN_EarningsCalendar\" })\n if table is None:\n continue\n else:\n rows = table.find_all(\"tr\")\n for i in rows: \n datas = i.find_all('td') \n if len(datas)>0: \n for j in datas:\n a.append(j.text.strip())\n for k in a:\n b.append(re.findall('\\(.*?\\)',k))\n b = [x for x in b if x != []]\n b_set = set(map(tuple,b)) \n b=list(b_set)\n b.strip('(')\n df[run_date]=b\n\n\nIs this due to the line run_date=run_date+timedelta(1) within the loop?" ]
[ "python", "dataframe", "for-loop" ]
[ "I want the first image width to be window size and others 200 dp of a grid view in android", "The first image is being overlapped by the second image in the grid. I want first image to be bigger than other images.First image should match the width of the device screen.\nThis is my xml\n\n <GridView\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:id=\"@+id/grid\"\n android:layout_alignParentLeft=\"true\"\n android:layout_alignParentStart=\"true\"\n android:numColumns=\"auto_fit\"\n android:columnWidth=\"90dp\"\n android:horizontalSpacing=\"10dp\"\n android:verticalSpacing=\"10dp\"\n android:gravity=\"center\"\n android:stretchMode=\"columnWidth\"\n\n android:paddingTop=\"16dp\"\n\n />\n\n\nThis is my imageadapter code\n\npublic View getView(int position, View convertView, ViewGroup parent) {\n ImageView imageView;\n MainActivity mainActivity=new MainActivity();\n WindowManager wm = (WindowManager) mContext\n .getSystemService(Context.WINDOW_SERVICE);\n Display display = wm.getDefaultDisplay();\n Point size = new Point();\n display.getSize(size);\n int imgSize = 0;\n if (convertView == null) {\n // if it's not recycled, initialize some attributes\n if(position!=0)\n {\n imgSize=200;\n }\n else\n {\n imgSize=size.x;\n }\n imageView = new ImageView(mContext);\n imageView.setLayoutParams(new GridView.LayoutParams(imgSize, 200));\n imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);\n\n imageView.setPadding(8, 8, 8, 8);\n } else {\n imageView = (ImageView) convertView;\n }\n\n imageView.setImageResource(mThumbIds[position]);\n return imageView;\n}\n\n\nScreen Shot of Second image overlapping the first one" ]
[ "android", "image", "gridview" ]
[ "Changing specific row in table from void", "I have a populated TableView where i would like to change the image. When I'm inside cellForRowAtIndexPath I can change it by using:\n\ncell.imageView.image = [UIImage imageNamed:@\"image.png\"];\n\n\nBut I cannot figure out how to do the same thing inside the void, I have tried:\n\n[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row inSection:0]].imageView.image = [UIImage imageNamed:@\"image.png\"];\n\n\nBut it doesn't change the image at all.\n\nThanks,\n/DSDeniso\n\nEDIT:\n\n- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath\n{\nstatic NSString *CellIdentifier = @\"Cell\";\nUITableViewCell *cell = nil;\ncell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];\n\nif (cell == nil)\n{\n cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];\n}\n_row = indexPath.row;\n[self changeImage];\n}\n\n- (void)changeImage{\nUITableViewCell * cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:_row inSection:0]];\nif(cell)\n{\ncell.imageView.image = [UIImage imageNamed:@\"image.png\"];\n\n} else {\nNSLog( @\"why is cell null? Did I set row properly?\");\n}\n}" ]
[ "ios", "uitableview" ]
[ "Why is data getting stored with type as SET in Redis when using Jedis with Spring Data @RedisHash annotation?", "I am using spring data redis and and saving my data in the form of hash using the annotation @RedisHash(\"myKey\") to my entity class. The data is getting inserted but when I see the type of the data I have inserted it shows SET.\nI tried following command :\n\nTYPE myKey \n\n\n\n Result : set\n\n\nwhat changes do I have to make if I want to change type of the data to be saved in hash and not in set ?\n\nThis is the defination I get from that annotation :\n\n\n RedisHash marks Objects as aggregate roots to be stored in a\n Redis hash." ]
[ "redis", "spring-data", "jedis", "spring-data-redis" ]
[ "passing a paramter into a loop perl using a subroutine", "i want to read a file1 that containfor every word a numeric reprsentation, for example:\n\nclinton 279\ncapital 553\nfond|fonds 1410\n\n\nI read a second file, every time i find a number i replace it with the corresponding word. above an example of second file\n\n279 695 696 152 - 574\n553 95 74 96 - 444\n1410 74 95 96 - 447\n\n\nThe problem in my code is that it execute the subroutine only one time. and it only show:\n\n279 clinton\n\n\nnormally in this example it should show 3 words, when i add print $b; in the subrtoutine it show the different numbers.\n\n#!/usr/bin/perl\nuse stricrt;\nuse warnings;\nuse autodie;\n\nmy @a,my $i,my $k;\nmy $j;\n\nmy $fich_in = \"C:\\\\charm\\\\ats\\\\4.con\";\nmy $fich_nom = \"C:\\\\charm\\\\ats\\\\ats_dict.txt\";\n\n\nopen(FICH1, \"<$fich_in\")|| die \"Problème d'ouverture : $!\";\nopen my $fh, '<', $fich_nom;\n\n#here i put the file into a table\n\nwhile (<FICH1>) {\nmy $ligne=$_;\nchomp $ligne; \n\n\nmy @numb=split(/-/,$ligne);\nmy $b=$numb[0];\n $k=$#uniq+1;\n print \"$b\\n\";\n my_handle($fh,$b);\n}\n\nsub my_handle {\n my ($handle,$b) = @_;\n my $content = '';\n#print \"$b\\n\";\n\n ## or line wise\n while (my $line = <$handle>){\n my @liste2=split(/\\s/,$line);\nif($liste2[1]==$b){\n $i=$liste2[0];\n print \"$b $i\";}\n }\nreturn $i;\n}\n\n\n close $fh;\n close(FIC1);" ]
[ "perl", "subroutine" ]
[ "Creating a list and struct arrays using C", "I'm currently starting out with C so I thought I'd try creating my own custom list. Here's the code:\n\n#include <stdio.h>\n\nstruct list {\n char data[10];\n struct list *n;\n};\n\nvoid clist(struct list *a) {\n int j=(sizeof(a)/sizeof(a[0]));\n j--; \n for(int i=0; i<j-1; i++) {\n struct list *next=&a[i+1];\n a[i].n=next; \n }\n}\n\nint main() {\n\n struct list first = {.data=\"one\", .n=NULL};\n struct list second = {.data=\"two\", .n=NULL};\n struct list third = {.data=\"three\", .n=NULL};\n\n struct list arr[] = {first, second, third}; \n struct list *p=&arr[0];\n\n clist(p);\n\n struct list looper = first;\n\n while(looper.n!=NULL) {\n printf(\"%s \", looper.data);\n looper = *looper.n;\n }\n\n return 0;\n}\n\n\nSo basically I have a struct that saves a char array and a pointer. I initialize them and then I try to link them together by giving it to the clist method.\nThere lies the problem: it seems clist isn't getting anything useful as the variable j stays at 0. If I do the whole size calculation before giving the array to the clist method, I'm getting the correct 3 as a result. Why is that?" ]
[ "c", "arrays", "pointers", "struct" ]
[ "Set session variable spring mvc 3", "How can I set a session object which I can use then in any of my views by using ${variable} or ${requestScope.variable}\n\nTo be able to use sessions do I need to set <%@ page session=\"true\" %> ?" ]
[ "java", "spring", "spring-mvc" ]
[ "doxygen - automatically append text for when a page was last edited?", "Is it possible to get doxygen (http://www.doxygen.nl/index.html) to automatically add some text to each generated page that states when the page was last modified due to a code (or comment) change?\n\nThanks." ]
[ "doxygen" ]
[ "How to specify whether the windows is logged in or not in C# service application?", "I've implemented a service application, that works fine all the time, both when the user has logged in and when the windows is in log in mode, but need to know whether the user has been logged or windows is in logged off mode. how can i do that?" ]
[ "c#", ".net", "windows", "windows-services" ]
[ "CSS columns displaying incorrectly", "I have a div with column-count set to 3. Inside are a number of uls. I am seeing the beginnings of a 4th column on the right side - why would this show up when I've specified 3 columns?\n\n\n\nHTML (Fiddle here: http://jsfiddle.net/B6zDR/3/)\n\n<!DOCTYPE html>\n\n<html>\n <head>\n <title></title>\n <style type=\"text/css\">\n div\n {\n height: 150px;\n width: 835px;\n padding: 20px;\n overflow: hidden;\n text-overflow: ellipsis;\n -moz-column-count: 3;\n -webkit-column-count: 3;\n column-count: 3;\n background-color: lightblue;\n }\n\n h2\n {\n margin: 0;\n }\n </style>\n </head>\n <body>\n <div>\n <h2>UL #1</h2>\n <ul>\n <li>1</li>\n <li>2</li>\n </ul>\n <h2>UL #2</h2>\n <ul>\n <li>1</li>\n <li>2</li>\n <li>3</li>\n <li>4</li>\n <li>5</li>\n <li>6</li>\n </ul>\n <h2>UL #3</h2>\n <ul>\n <li>1</li>\n <li>2</li>\n <li>3</li>\n <li>4</li>\n <li>5</li>\n </ul>\n <h2>UL #4</h2>\n <ul>\n <li>1</li>\n <li>2</li>\n <li>3</li>\n <li>4</li>\n <li>5</li>\n </ul>\n <h2>UL #5</h2>\n <ul>\n <li>1</li>\n <li>2</li>\n <li>3</li>\n <li>4</li>\n <li>5</li>\n </ul>\n </div>\n </body>\n</html>" ]
[ "html", "css", "layout" ]
[ "How to open a link with different proxy IP adresses in python?", "I want to click a link over and over again while different proxies are enabled to trick the host into thinking I am doing it on different IP adresses. What is the simples way to do this in python?\n\nThanks!" ]
[ "python", "proxy" ]
[ "Implement a counter which resets in python panda data frame", "Hi I would like to implement a counter which counts the number of successive zero observations in a dataframe (across multiple columns). But I would like to reset it if a non-zero observation is found. I have used a for loop but it is incredibly slow, I am sure there must be far more efficient ways. This is my code:\n\nHere is a snapshot of df\n\ndf.head()\n\n ACL ACT ADH ADR AFE AFH AFT \n2013-02-05 NaN NaN NaN NaN NaN NaN NaN \n2013-02-12 -0.136861 -0.020406 0.046150 0.000000 -0.005321 NaN 0.058195 \n2013-02-19 -0.006632 0.041665 0.007365 0.012738 0.040930 NaN -0.037818 \n2013-02-26 -0.023848 -0.023999 -0.030677 -0.003144 0.050604 NaN -0.047604 \n2013-03-05 0.009771 -0.024589 -0.021073 -0.039432 0.047315 NaN 0.068727 \n\n\nI first initialise an empty data frame which has the same properties of df (dataframe) above\n\ndf1=pd.DataFrame( index= df, columns=df)\ndf1=df1.fillna(0)\n\n\nThen I create my function which iterates over the rows, but this only deals with one column at a time\n\ndef zero_obs(x=df,y=df1):\n for i in range(len(x)):\n if x[i] == 0:\n y[i] = y[i-1] + 1\n else:\n y[i] = 0\n return y \n\nfor col in df.columns:\n df1[col] = zero_obs(x=df[col],y=df1[col])\n\n\nReally appreciate any help!!\n\nThe output i expect is as follows:\n\ndf1.tail()\n BRN AXL TTO AGL ACL\n2017-01-03 3 125 0 0 0\n2017-01-10 0 126 0 0 0\n2017-01-17 1 127 0 0 0\n2017-01-24 0 128 0 0 0\n2017-01-31 0 129 1 0 0" ]
[ "python", "pandas" ]
[ "Less code in case statement PHP", "is there a way to write less code ( factorize) following statement.\nIn my case I have webform_client_form_AKEY where the AKEY var changes and my var passed in the uri ( ?C= = 1...).\nThank you\n\nswitch ($form_id)\n{\ncase 'webform_client_form_9944':\n $form['#action'] = url('section/client-tool-box/appointment?c=1'); \n break;\ncase 'webform_client_form_9883':\n $form['#action'] = url('section/client-tool-box/appointment?c=2'); \n break;\ncase 'webform_client_form_9884':\n $form['#action'] = url('section/client-tool-box/appointment?c=3'); \n break;\n...\n}" ]
[ "php", "switch-statement" ]
[ "Does PHPWord work with zend-escaper 2.5?", "I tried to install PHPWord as part of a Drupal project:\n\n$ composer require phpoffice/phpword\n...\nProblem 1\n- Installation request for phpoffice/phpword ^0.13.0 -> satisfiable by phpoffice/phpword[v0.13.0].\n- Conclusion: remove zendframework/zend-escaper 2.5.2\n- Conclusion: don't install zendframework/zend-escaper 2.5.2\n...\n\n\nDowngrading zendframework/zend-escaper is not an option. Is there a way to get PHPWord to work with the current version?\n\nOddly, the master branch declares \"zendframework/zend-escaper\": \"^2.4\", in composer.json, but the develop branch declares \"zendframework/zend-escaper\": \"^2.2\",." ]
[ "phpword" ]
[ "Stop Browser at any spot", "I have checked many questions and answers regarding how to stop any browser at any time, but I have not found a solution to my problem.\n\nI have a logout button in my application, and when I press it, it adds some classes to an <a> tag. Is there any key/shortcut to stop the Mozilla/Chrome (any browser) to perform the actions or stay the same page?" ]
[ "browser" ]
[ "sendmail(unix) is able to send mail from any sender mail id without asking for sender mail id password authentication", "I am trying to use sendmail on an already setup linux box and have following observation. \n\nFor a certain domain, any valid email address {say : xyz.com, email: [email protected]} on receiver side, sendmail is able to successfully send mail to it with any chosen sender email address.The interesting thing is, Sender email can be anything, I have tried multiple. So, the question is how does sendmail verify Sender email authentication? \n\nFor ex : \n\nSENDER=\"[email protected]\"\nTEXT=\"<html><body><table border=1 cellspacing=0 cellpadding=3>\n<tr><td>Col-1</td></tr>\n<tr><td>Col-1-Val</td></tr>\n</table>\n</body>\n</html>\"\nMAIL_TXT=\"Subject: Demo Table Mail\\nContent-type: text/html\\nFrom: $SENDER\\nTo: [email protected]\\n\\n$TEXT\"\necho -e \"$MAIL_TXT\" | sendmail -t\n\n\nIn this case how does sendmail verify that [email protected] wants to send this mail, as it is successfully able to send mail on his behalf without asking for authentication?" ]
[ "unix", "smtp", "gmail", "sendmail" ]
[ "What is KeyEqual in std::unordered_set for?", "What is the purpose of 3rd parameter KeyEqual in std::unordered_set? Isn't hash uniqueness enough?\n\ntemplate<\n class Key,\n class Hash = std::hash<Key>,\n class KeyEqual = std::equal_to<Key>,\n class Allocator = std::allocator<Key>\n> class unordered_set;\n\n\nSorry if this question sounds naive. Moving to C++ from Python/PHP :)\n\nFor now my implementations of KeyEqual always duplicates Hash impl. So I was wonder if I do it correctly." ]
[ "c++", "std", "c++-standard-library", "unordered-set" ]
[ "Problem with Zend_Db_Abstract in Model", "I've found out that when I extends Zend_Db_Table_Abstract in my model I get\n\nAn Error Ocurred\n\nAplication error\n\nWhen I run this code\n\n<?php\n\nclass Admin_Model_News\n{\n protected $_name = 'news';\n protected $_primary = 'new_id';\n\n public function addNews($data) {\n $this->insert($data);\n }\n}\n\n\nIt works properly, but when I run\n\n<?php\n\nclass Admin_Model_News extends Zend_Db_Table_Abstract\n{\n protected $_name = 'news';\n protected $_primary = 'new_id';\n\n public function addNews($data) {\n $this->insert($data);\n }\n}\n\n\nIt messes up\nWhat could be wrong? You can check some of my files here" ]
[ "php", "zend-framework", "zend-db-table" ]
[ "Sorting an array using Array.sort() without a comparator", "I have to sort an Array of custom objects by one of the object's params using Arrays.sort() , but WITHOUT passing a Comparator. This is a homework assignment and my professor wants us to do it without a comparator.\n\nTo be more specific I have an array[] of object type 'Female', female is made up of params 'name' and 'age'. I have to sort the array by age using Arrays.sort(femaleList), but again I cannot use a Comparator. \n\nI'm trying to use .getAge() or something like that, but it's not working. I'm assuming there's some relatively simple solution that I'm overlooking, any help would be greatly appreciated." ]
[ "java", "arrays", "sorting" ]
[ "UIActivityViewController Change Navigation Bar text color", "I am creating a UIActivityViewController and trying to change its text color after tapping the share messages icon. \n\nBy default, I set my navigation bar text colors to white in the AppDelegate like so\n\nUINavigationBar.appearance().tintColor = whiteColor\nUIBarButtonItem.appearance().tintColor = whiteColor\n\n\nHowever for just the UIActivityViewController I want to make it the default (i.e. black title text, and the blue Cancel button)\n\nI have tried the following to no luck:\n\nlet shareText = \"text to share\"\nlet activityViewController = UIActivityViewController(activityItems: [shareText], applicationActivities: [])\n\nactivityViewController.navigationController?.navigationBar.tintColor = UIColor.black\nactivityViewController.navigationController?.navigationItem.rightBarButtonItem?.tintColor = UIColor.blue\n\npresent(activityViewController, animated: true, completion: nil)\n\n\nThe result is still the same with white text:\n\nIf you look closely in the image, the navigation bar has white text in the title and right bar button items." ]
[ "ios", "swift", "uiactivityviewcontroller" ]
[ "putexcel using R1C1 notation", "As from the official documentation of Stata \"putexcel\" procedure uses standard excel cell notation i.e. D25 instead of R25C4. If I only know column number is it possible to convert it to letters in my script?\n\nOr is it possible to increment column names?" ]
[ "reference", "cell", "export-to-excel", "stata" ]
[ "iOS - Google SignIn fails if a Google App is on the device", "I've integrated Google SignIn (2.2) based on instructions here:\nhttps://developers.google.com/identity/sign-in/ios/start\n\nIt works when there is no Google app on the device. So Google SDK opens a web view where I can sign in a google account, and GIDSignInDelegate method didSignInForUser is called with a valid access token with no error.\n\nBut if I have Google app or Youtube app installed, the SDK will open the Google app, where I can sign in my google account, and when I choose the account and it redirects back, it throws an error: \n\n\n \"A potentially recoverable error occured. You may try again.\" \n\n\nNo matter how many times I retry it never worked.\n\n(Deep link url: \ncom.googleusercontent.apps.<my app id>://api/sso/v1/tokenResponse?ec=-216414001&e=A%20potentially%20recoverable%20error%20occured.%20You%20may%20try%20again)\n\nHas anyone seen the same issue? What could go wrong?" ]
[ "ios", "google-signin" ]
[ "Gorm Golang orm associations", "I'm using Go with the GORM ORM.\nI have the following structs. The relation is simple. One Town has multiple Places and one Place belongs to one Town.\n\ntype Place struct {\n ID int\n Name string\n Town Town\n}\n\ntype Town struct {\n ID int\n Name string\n}\n\n\nNow i want to query all places and get along with all their fields the info of the corresponding town.\nThis is my code:\n\ndb, _ := gorm.Open(\"sqlite3\", \"./data.db\")\ndefer db.Close()\n\nplaces := []Place{}\ndb.Find(&places)\nfmt.Println(places)\n\n\nMy sample database has this data:\n\n/* places table */\nid name town_id\n 1 Place1 1\n 2 Place2 1\n\n/* towns Table */\nid name\n 1 Town1\n 2 Town2\n\n\ni'm receiving this: \n\n[{1 Place1 {0 }} {2 Mares Place2 {0 }}]\n\nBut i'm expecting to receive something like this (both places belongs to the same town): \n\n[{1 Place1 {1 Town1}} {2 Mares Place2 {1 Town1}}]\n\nHow can i do such query ? I tried using Preloads and Related without success (probably the wrong way). I can't get working the expected result." ]
[ "orm", "go", "go-gorm" ]
[ "Does an algorithm exist to convert any number in the Aleph-Null set into the smallest possible computable number?", "Possible Duplicate:\n Programming Logic: Finding the smallest equation to a large number. \n\n\n\n\nI'm looking for an algorithm that will take an arbitrary number from the Aleph-Null set (all positive integers)(likely to be absolutely enormous) and attempt to simplify it into a computable number (if the computable number takes up less space than the integer value it is trying to represent)(specifically not floating point). Involving tetration/hyperoperators would be optimal.\n\nDoes anyone know if anything like this exists? I've looked around quite a bit this morning, but have been unable to find anything.\nC# code would be optimal, but really, it could be in any language\n\nEdit: Programming Logic: Finding the smallest equation to a large number :\nhttp://mrob.com/pub/ries/index.html looks promising, but I wonder how well it will deal with large numbers, and if it's capable of implementing hyperoperators. I'll try it out." ]
[ "algorithm", "math", "data-compression" ]
[ "Modal Popup button click not fired second time", "I have a Modal Popup with dynamic controls. I need to add new text box in Button click.\n\nJQuery:- \n\n<script type=\"text/javascript\">\n $(document).ready(function(){\n if($('#hdnclick').val()==1){ \n $('#modelPopup').dialog({\n autoopen:false, \n title: \"Add New Server\",\n width:650,\n height:450,\n modal:true, \n buttons:{ \n Close:function(){\n $(this).dialog('close'); \n }\n } \n }); \n $('#btnadd').click(function(){\n alert('okay');\n });\n }\n });\n\n </script> \n\n\nAspx Code:-\n\n <asp:GridView ID=\"grdservices\" runat=\"server\" AutoGenerateColumns=\"false\" ShowFooter=\"true\">\n <Columns>\n <asp:BoundField DataField=\"S.No\" HeaderText=\"s.no\" />\n <asp:TemplateField HeaderText=\"service name\">\n <ItemTemplate>\n <asp:TextBox ID=\"txtservicename\" runat=\"server\"></asp:TextBox>\n </ItemTemplate>\n </asp:TemplateField>\n <asp:TemplateField HeaderText=\"description\">\n <ItemTemplate> \n <asp:TextBox ID=\"txtDescription\" runat=\"server\"></asp:TextBox>\n </ItemTemplate>\n <FooterStyle HorizontalAlign=\"right\" />\n <FooterTemplate> \n <asp:Button ID=\"btnadd\" runat=\"server\" Text=\"add new service\" OnClick=\"btnadd_Click\" OnRowCommand=\"ButtonClicked\" />\n </FooterTemplate>\n</asp:TemplateField>\n</Columns>\n/asp:GridView>\n\n\nMy Issue is this \"btnAddNewServic_Click\" button click fired in first click but this \"btnAddNewServic_Click\" function not fired in second click even anything is not fired in second click. Can anyone one help me to recover this issue..\n\nOutput:\n\n\nAdding New Rows:-\n\n protected void grdServices_RowCommand(object sender, GridViewCommandEventArgs e)\n {\n if (e.CommandName == \"ButtonClicked\")\n {\n hdnclick.Value = \"1\";\n AddNewRowToGrid();\n }\n }\n\n\nprivate void AddNewRowToGrid()\n {\n int rowindex = 0;\n if (ViewState[\"CurrentTable\"] != null)\n {\n DataTable dtCurrentTable = (DataTable)ViewState[\"CurrentTable\"];\n DataRow drCurrentRow = null;\n if (dtCurrentTable.Rows.Count > 0)\n {\n for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)\n {\n TextBox Box1 = (TextBox)grdservices.Rows[rowindex].Cells[1].FindControl(\"txtservicename\");\n TextBox Box2 = (TextBox)grdservices.Rows[rowindex].Cells[2].FindControl(\"txtDescription\");\n\n drCurrentRow = dtCurrentTable.NewRow();\n drCurrentRow[\"S.No\"] = i + 1;\n\n dtCurrentTable.Rows[i - 1][\"Column1\"] = Box1.Text;\n dtCurrentTable.Rows[i - 1][\"Column2\"] = Box2.Text;\n\n rowindex++;\n }\n dtCurrentTable.Rows.Add(drCurrentRow);\n ViewState[\"CurrentTable\"] = dtCurrentTable;\n\n grdservices.DataSource = dtCurrentTable;\n grdservices.DataBind();\n }\n }\n }" ]
[ "c#", "jquery", "asp.net" ]
[ "R survey poststratification: struggling with the survey function", "I'm new here and new to R. I'm wondering whether I've used the R survey package correctly to postStratify my data. Below you can see the data structure of my dataframe (df).\n\n\n\n\nutype\ngender\nage\nregzeit\nfinanz\nsfeld\nsindex\n\n\n\n\npri\nfemale\n23\nja\ns\nARG\n5\n\n\nsta\nmale\n23\nnein\nf\nARG\n-7\n\n\nsta\nfemale\n21\nja\n\nARG\n11\n\n\npri\nmale\n28\nja\nt\nARG\n1\n\n\n\n\nI've oversampled females for the "gender" variable and students for the "utype" variable and now want to adjust for the distribution in the population. My n=383 was oversampled to n = 477\nThe intended distributions of my my n=383 sample are:\n\n\n\n\nutype\nmale\nfemale\nSum\n\n\n\n\npri\n54\n68\n122\n\n\nsta\n128\n133\n261\n\n\nSum\n187\n196\n383\n\n\n\n\ndesign <- svydesign(id = ~utype+gender, data = df)\nWarning message:\nIn svydesign.default(id = ~utype + gender, data = df) :\nNo weights or probabilities supplied, assuming equal probability\npop.types <- data.frame(utype=c("sta","pri"), Freq=c(261,122))\ndesignp <- postStratify(design, ~utype, pop.types)\npostStratify(design, ~utype, pop.types)\nsvymean(~sindex, design)\nmean | SE \nsindex 0.48008 | 0.0192\nsvymean(~sindex, designp)\n mean | SE \nsindex 0.47692 | 0\nMy question now is whether the below code is correct and how I can postStratify for both variables utype and gender in my code or whether I have to run the postStratify command twice. I'm especially concerned that the standard error is zero in my weighted sample and because of the warning message. And whether the Freq values are correct for what I'm trying to do here?\nThe last thing I've been trying to figure out is how to get the svymean, svyhist or svyboxplot functions for "sindex", but only for the observations with utype == pri, so by group basically. This should all be applied to the weighted sindex values.\nI hope I'm conforming to all the rules. Many thanks in advance!" ]
[ "r", "statistics", "cluster-analysis", "survey" ]
[ "Jquery offset with % instead of px - possible?", "I have this script were i want it to make an offset for 15% top of the id its scrolling to. I have try many things, so im kinda curious what approach you guys would take. I have stripped it down to what works, since all of my own attempts failed. Hope someone can help me out.\n\n$('a[href*=#]').bind('click', function (e) {\n e.preventDefault();\n\n var target = $(this).attr(\"href\");\n\n $('html, body').stop().animate({ scrollTop: $(target).offset().top }, 800, function () {\n location.hash = target; \n });\n\n return false;\n });\n\n\ni made a fiddle here: http://jsfiddle.net/77rFz/" ]
[ "javascript", "jquery" ]
[ "ruby excercise for name.lenth.t_s", "the excercise in the book says that I should ask for the names individually and then get the name length. I am stuck on the 8th line? Is that what I am supposed to do to get the name?\n\n puts \"What\\'s your first name?\"\n first = gets.chomp\n puts \"What\\'s your middle name?\"\n middle = gets.chomp\n puts \"What\\'s your last name?\"\n last = gets.chomp\n puts \"So, your full name is #{first} #{middle} #{last}.\" \n name = # {first} #{middle} #{last}\n puts \"Did you know that are + #{name.length.t_s} + characters \"\n puts \"in your + name + \"\n\n\nThank you so much for your help!" ]
[ "ruby", "variable-length" ]
[ "How to make virtual time pass in a test in Cats Effect 3?", "I am trying to convert Mules to Cats Effect 3 (CE3). Since it is a caching library, in its tests it needs (virtual) time to pass to test whether items will be expired. It is currently making fairly heavy use of cats.effect.laws.util.TestContext, which allows advancing the virtual clock without actually sleeping via tick. TestContext does not (as far as I have been able to discover) exist in CE3, but I am always loathe to puts sleep calls into a test. Rolling my own IO for this specific case though is a daunting prospect; surely this is a more general problem people have. I was not able to find a reference to TestContext in the migration guide, however.\nIs there a known upgrade path for this case?" ]
[ "scala", "automated-tests", "cats-effect" ]
[ "Circular (or infinite) listview with ArrayAdapter", "I want my listview to repeat all rows after scrolling to the end, and so on. This is called infinite or circular, and you can find ways to implement it but none of these seems to work for my adapter. I tried this approach: How to create a closed (circular) ListView? but my app crashes when i put\n\n @Override\n public int getCount()\n {\n return Integer.MAX_VALUE;\n }\n\n\nAlso, getItem doesent seem to \"play along\" with my adapter\n\n @Override\n public T getItem(int position) \n {\n return objects[position % objects.length];\n }\n\n\nIs there a way to implement something similar for my adapter? here's the code:\n\n public class EntryAdapter extends ArrayAdapter<Item> {\nprivate ArrayList<Item> items;\nprivate Context fontcontext;\nprivate LayoutInflater vi;\n\n\npublic EntryAdapter(Context context, ArrayList<Item> items) {\n super(context,0, items);\n fontcontext = context;\n this.items = items;\n vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n}\n\n@Override\npublic View getView(int position, View convertView, ViewGroup parent) {\n View v = convertView;\n\n final Item i = items.get(position);\n if (i != null) {\n if(i.isSection()){\n SectionItem si = (SectionItem)i;\n v = vi.inflate(R.layout.list_item_section, null);\n\n v.setOnClickListener(null);\n v.setOnLongClickListener(null);\n v.setLongClickable(false);\n\n final TextView sectionView = (TextView) v.findViewById(R.id.list_item_section_text);\n sectionView.setText(si.getTitle());\n Typeface faceT = Typeface.createFromAsset(fontcontext.getAssets(),\"fonts/Walkwayrounded.ttf\");\n sectionView.setTypeface(faceT);\n final TextView conditionView = (TextView) v.findViewById(R.id.textViewn);\n conditionView.setText(si.getCondition());\n Typeface faceC = Typeface.createFromAsset(fontcontext.getAssets(),\"fonts/Walkwayrounded.ttf\");\n conditionView.setTypeface(faceC);\n\n }else{\n EntryItem ei = (EntryItem)i;\n v = vi.inflate(R.layout.list_item_entry, null);\n final TextView title = (TextView)v.findViewById(R.id.list_item_entry_title);\n final TextView subtitle = (TextView)v.findViewById(R.id.list_item_entry_summary);\n\n\n if (title != null) \n title.setText(ei.title);\n if(subtitle != null)\n subtitle.setText(ei.subtitle);\n }\n }\n return v;\n}\n\n }\n\n\nAny kind of approach to solve the problem will be appreciated!" ]
[ "android", "listview", "android-listview" ]
[ "How to load bundle of images in a scrollview with horrizondal scrolling in iphone?", "I have an iPhone application in which i need to load a bulk of images (ie around 50),which has a small rect like (little above thumbnail) containing 3 in each row with 4 columns in one page, and i need to scroll horizontally to load the next 12 images and so on. Also i need to show the page number under it as 1,2 etc. \n\nCan any body guide me in the right direction to achieve this in a scroll view ?i am really in a mess ,how to add imageview to a scrollview like this ,also each image view has its own buttons also." ]
[ "iphone", "ios", "ipad", "uiscrollview" ]
[ "Alternative To Associations with EmberJS/Data", "I've been working on an EmberJS application for about a week now, and have written my own localStorage adapter for EmberJS/Data to allow for data persistence. The app is a small note-taking application. Ideally, I'd like to have a Notebook model that has many Note models associated with it.\n\nHowever, I haven't found a way to do this that results in a mutable array. While you can \"implement\" a hasMany relation...\n\nNoted.Note = DS.Model.extend({\n title: DS.attr('string'),\n note_text: DS.attr('string'),\n});\n\nNoted.Notebook = DS.Model.extend({\n title: DS.attr(\"string\"),\n notes: DS.hasMany(Noted.Note)\n});\n\n\n...the ModelArray created by the hasMany method is immutable in EmberJS. It appears that this is currently being worked on - there is an \"associations\" branch of EmberJS/Data here - but modifying the ModelArray is critical to this application, to i.e. create a new Note:\n\nvar notebook = Noted.store.createResource(Noted.Notebook, {\n title: \"Foo Notebook\"\n});\nnotebook.get(\"notes\").pushObject(Noted.store.createResource(Noted.Note, {\n title: \"Bar Note\",\n note_text: \"Blah blah blah.\"\n}));\nnotebook.get(\"notes\").objectAt(0).get(\"title\") //returns undefined\n\n\nAlthough the very latest commit of EmberJS/Data does include array mutability, it still lacks any sort of observation - the adapter isn't notified when changes are made, and they are not saved.\n\nI'm wondering: what's the best alternative to a hasMany association until this ability is added to EmberJS/Data? I've been looking into different patterns, such as having a note IDs array in the Notebook model with some sort of fetch/retrieve interface to go with it, but I've gotten absolutely nowhere. I've spent quite a good chunk of today trying to figure out the best way to do this, and all I have is a lot of frustration." ]
[ "javascript", "model-view-controller", "ember.js", "local-storage", "ember-data" ]
[ "Swift: Could not cast value of type '__NSCFArray' to 'NSDictionary'", "I have JSON data from website. I made the main dictionary and I can parse every data except one sub dictionary. I get the error \"Swift: Could not cast value of type '__NSCFArray' to 'NSDictionary'\"\n\nThis example of my data. I cannot parse \"weather\" but I can parse all other dictionaries like \"wind\".\n\n [\"name\": Mountain View, \"id\": 5375480, \"weather\": (\n {\n description = \"sky is clear\";\n icon = 01n;\n id = 800;\n main = Clear;\n }\n), \"base\": cmc stations, \"wind\": {\n deg = \"129.502\";\n speed = \"1.41\";\n\n\nSnippet of code\n\n let windDictionary = mainDictionary[\"wind\"] as! [String : AnyObject\n let speed = windDictionary[\"speed\"] as! Double\n print(speed)\n let weather = mainDictionary[\"weather\"] as! [String : AnyObject]\n print(weather)" ]
[ "ios", "swift", "dictionary", "swift2" ]
[ "Undefined reference to foo::bar static ofstream", "I've been trying to compile a program I've spent the past three days building, and I can't figure out how to get it to stop throwing an error. I keep getting the compile error \"undefined reference to Foo::bar\" where \"bar\" is a static ofstream declared in the Foo.h file.\n\nFoo.h\n\nClass Foo\n{\n public:\n <insert methods>\n private:\n static ofstream& bar;\n }\n\n\nFoo.cpp\n\n#include <iostream>\n#include <fstream>\n#include <sstream>\n#include \"EventReport.h\"\nusing namespace std;\n\nFoo::Foo()\n{\n bar.open(\"foobar.txt\");\n}\n\n\nI keep getting the error message on the \"bar\" in Foo.cpp (there are multiple in the file). Any ideas on why?" ]
[ "c++" ]
[ "how to find parent transitive dependencies in Intellij IDEA", "I can see Gradle dependencies of my project having 2 versions of google guice library (com.google.inject:guice:4.0 and com.google.inject:guice:3.0 ) i am trying to find from which parent library these are imported but i failed to find in intelli IDEA. i also tried Dependency Viewer and Analyze dependencies options in Intellij IDEA but not helped.can you please help how to find parent library of this guice lib." ]
[ "java", "intellij-idea" ]
[ "Hello! Is there a way to modify a string from user raw_input in python?", "I am a beginner python programmer and am trying to figure out how to modify input from a user. \n\ny=raw_input(\"Enter the date in this format 'yyyy-mm-dd'\") #user enters \nx=y-2 #I know this isn't how you would do this just trying to show an example of \n#what I am attempting. \n\n\nI am trying to set a second variable x equal whatever date the user enters minus 2 days. I am later trying to pass the second variable in a datetime format in apscheduler. Is there any way to do modify a string like this?" ]
[ "python", "string", "input" ]
[ "How to get the current browser resolution in css?", "Can some one explain me how to get the current browser viewing resolution in css ?.\ni want to make my website fit viwers resolution , how can i do that ?" ]
[ "css", "browser", "web" ]
[ "Why should convert null value to nullable struct", "I have a function which gives back a nullable struct.\nI noticed two similar cases \n\nFirst: works well:\n\npublic static GeometricCircle? CircleBySize(GeometricPoint point, double size)\n{\n if (size >= epsilon)\n return null;\n\n return new GeometricCircle(point.Position, new Vector(1, 0, 0), size, true);\n}\n\n\nSecond: needs to convert the null value to GeometricCircle?\n\npublic static GeometricCircle? CircleBySize(GeometricPoint point, double size)\n{\n return size > epsilon ? new GeometricCircle(point.Position, new Vector(1, 0, 0), size, true) : (GeometricCircle?)null;\n}\n\n\nDoes anybody know what is the difference?" ]
[ "c#", "type-conversion", "nullable" ]
[ "How do I wrap response from node.js API in callback()?", "Here is a sample API from kendo\nhttps://demos.telerik.com/kendo-ui/service/Employees?callback=Callback123&EmployeeId=5\nThe response looks like this:\nCallback123(\n[\n{\n"EmployeeId": 6,\n"FullName": "Michael Suyama",\n"HasEmployees": false,\n"ReportsTo": 5\n},\n{\n"EmployeeId": 7,\n"FullName": "Robert King",\n"HasEmployees": false,\n"ReportsTo": 5\n},\n{\n"EmployeeId": 9,\n"FullName": "Anne Dodsworth",\n"HasEmployees": false,\n"ReportsTo": 5\n}\n]\n)\n\nI need to create an API similar to this using node.js. Please explain how to wrap my JSON object with Callback() to mimic the above response.\nThank you." ]
[ "json", "api", "service", "callback", "kendo-ui" ]
[ "Is it right if I read view on other thread,Android UI", "Android can't update view direct on non-ui thread,but if I just read/get some information for ui?\n\nFor example I have a method updateModel() like \n\nvoid updateModel() {\n dailyReport.log.setValue(editLog.getText().toString());\n dailyReport.plan.setValue(editPlan.getText().toString());\n dailyReport.question.setValue(editQuestion.getText().toString());\n}\n\n\nIs it a problem if I run this method on non-ui thread." ]
[ "android", "multithreading", "view" ]
[ "Is there a django-orm lookup for querying nested jsonfield key?", "My table has a JsonField column named meta_data. One of its entries is:\n\n{'abc':'zyz', 'name':{'pranav':'age', 'john':'age'}}\n\nTo query on Jsonfield i use __has_key lookup:\n\ntable.objects.filter(id__in=id_list, meta_data__has_key='name')\n\nI want to findout if there is some django lookup that helps me check if there is the key 'pranav' inside 'name' like:\n\ntable.objects.filter(id__in=id_list, meta_data__has_key__has_key='pranav')\n\nor something like that\n\nThanks for any input on this...!" ]
[ "python", "django", "django-models", "django-orm", "django-jsonfield" ]
[ "Multiple Constructors for a Class Problem", "I am used to doing this in C++. Is this not allowed in C#?\n\nBasicCtor(int a)\n{\n return BasicCtor(a, \"defaultStringValue\"); \n}\n\nBasicCtor(int a, string b)\n{\n //blah blah\n\n}\n\n\nIn C# I can neither return a calling of the constructor or call it w/o a return.\nDoes C# allow what I want to do? :P" ]
[ "c#", "constructor" ]
[ "ORA-14400: - \"inserted partition key does not map to any partition\"", "I have the table with the following colums: \n\nfoo integer default 0 \n'ID', 'INTEGER'\n'date','DATE'\n'F','VARCHAR2(20 CHAR)'\n\n\nI try to insert the following values:\n\ninsert into table (foo,id,date,F) values('1','4','01.01.2016','aa');\n\n\nand I get the following error: \n\n\n SQL-error: ORA-14400 inserted partition key does not map to any\n partition\n 14400. 00000 - \"inserted partition key does not map to any partition\"\n \n *Cause: An attempt was made to insert a record into, a Range or Composite\n Range object, with a concatenated partition key that is beyond\n the concatenated partition bound list of the last partition -OR-\n An attempt was made to insert a record into a List object with\n a partition key that did not match the literal values specified\n for any of the partitions.\n *Action: Do not insert the key. Or, add a partition capable of accepting\n the key, Or add values matching the key to a partition specification\n\n\nWhat did I do wrong?\n\nUPDATE:\n\ncall meta_ddl.create_table ('table1','create table table1 (foo integer default 0) $#TABLEOPTIONS#$');\ncall meta_ddl.add_column ('table1','ID', 'INTEGER');\ncall meta_ddl.add_column_with_default('table1','DATE','DATE', 'SYSDATE', 1);\ncall meta_ddl.add_column ('table1','F','VARCHAR2(20 CHAR)');" ]
[ "oracle", "oracle12c" ]
[ "Request against localhost relative url \"Cannot assign requested address\"", "I have a visual studio 2017 [ / 2019 ] asp.net core web app project enabled with docker support using FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base and FROM microsoft/dotnet:2.1-sdk AS build images. \n\nWhen my f5 debug instance starts up on http://localhost:44301/ I attempt to make HttpClient.SendAsync() request against relative url /data/some.json to pull in data making localhost debugging able to emulate security state only present in published app case. \n\nWhen I f5 debug using project's IISExpress target this all works fine. When I f5 debug against the Docker target the HttpClient.SendAsync() call against the localhost relative url, or fully qualified https://localhost:44301/data/some.json and http://localhost:8081/data/some.json paths, generates the exception with message Cannot assign requested address. If I change code to load some.json from a remote url, e.g. storage account public blob path, the f5 debug Docker target does not fail on this call.\n\nOne can repro issue using the https://github.com/myusrn/adncauthexploration.git provided AzWebApp1 project which also requires https://github.com/myusrn/KK.AspNetCore.EasyAuthAuthentication.git that is accessed using a project reference, to enable debugging contents of this nuget package. Using localhost f5 iisexpress target the issue doesn't repro. Switching to localhost f5 docker target the issue repros when debug url processing hits KK.AspNetCore.EasyAuthAuthentication\\Services\\EasyAuthWithAuthMeService.cs | line 109 var response = await client.SendAsync(httpRequest);.\n\nI'm wondering if there is some Dockerfile setting I need to be making to enable this f5 debug localhost relative url request by the asp.net core web app startup code." ]
[ "c#", "docker", "dockerfile", "asp.net-core-webapi", "dotnet-httpclient" ]
[ "get/set Accessors the correct scope", "i created a class called ProfileHelper, and I can't seem to get my get/set accessors correct; instead, I'm getting red lines on both get and set. Here is the code I am trying to use:\n\npublic static String UserName(string columnName)\n{ \n get\n {\n using (SqlConnection cn = new SqlConnection(SiteConfig.ConnectionString))\n {\n string sSql = (\"SELECT UserName , LoweredUserName FROM aspnet_Users WHERE UserId = @UserId\");\n\n using (SqlCommand cm = new SqlCommand(sSql, cn))\n {\n cm.Parameters.AddWithValue(\"@UserId\", Membership.GetUser().ProviderUserKey.ToString());\n cn.Open();\n using (SqlDataReader rd = cm.ExecuteReader())\n {\n while (rd.Read())\n {\n return columnName;\n }\n rd.Close();\n }\n cn.Close();\n } \n } \n return columnName;\n }\n set\n {\n using (SqlConnection cn = new SqlConnection(SiteConfig.ConnectionString))\n {\n string sSql = (\"UPDATE [aspnet_ Users] SET UserName = @UserName, LoweredUserName = @LoweredUserName WHERE UserId = @UserId\");\n\n using (SqlCommand cm = new SqlCommand(sSql, cn))\n {\n cm.Parameters.AddWithValue(\"@UserId\", Membership.GetUser ().ProviderUserKey.ToString());\n cn.Open();\n cm.ExecuteNonQuery();\n cn.Close();\n } \n } \n }\n}" ]
[ "c#" ]
[ "How to do static linking in Eclipse CDT?", "I am trying to statically link to a third party C library in C++.\n\nI managed to do this in Visual Studio just by specifying the .lib file in the linker input options. However, when I do the equivalent in CDT (Project Properties -> Settings -> MinGW C++ Linker -> Libraries) I get endless amounts of \"undefined reference to...\" errors when I try to build.\n\nIs there anything else that I need to do to achieve static linking in CDT?\n\nThanks,\nAlan" ]
[ "c++", "c", "eclipse", "visual-studio", "eclipse-cdt" ]
[ "MySQL Selective Show Status", "MySQL provides a neat way to keep tabs on the status of the db server via SHOW STATUS. The only issue is that the information that is returned is too voluminous. For my needs I only need to get hold of a handful of values - say UPTIME, THREADS_RUNNING, THREADS_CREATED etc. I am unable to figure out the right syntax to use to issue such a query.\n\n'SHOW GLOBAL STATUS LIKE \"uptime\"'\n\n\ngives me uptime but I would like to get a few more values in a single query. I'd be most grateful to anyone who might be able to tell me how to do this." ]
[ "php", "mysql" ]
[ "Scroll to top of modal Angular 2", "I've got a form modal that pops up and has 4 sections to complete. Each section has a next button. I would like the next button to trigger a scrollTo(0) function, but I cannot seem to get a working solution. The last thing I have tried is a variation of window.scrollTo(), but it keeps scrolling the whole page to the top, not the modal.\n\nAny thoughts?\n\nHere is my .ts file\n\nimport {WindowRef} from './window-ref';\n...\nconstructor(private winRef: WindowRef) { }\n...\n toggleInfo(){\n this.infoState = this.infoState === 'active' ? 'inactive' : 'active';\n this.toggleInsurance()\n this.winRef.nativeWindow.scrollTo(0)\n }\n//winRef gives me access to the window object\n\n\nAny ideas?" ]
[ "angular", "typescript", "modal-dialog", "window", "scrollto" ]
[ "Bootstrap drop down not working", "All of a sudden after making some change my bootstrap dropdowns are not working. I dont think i even touched the code for it. I am using cdn for my includes but thats not new.\n\nTry clicking the Jobber Nav Button:\nhttp://www.development.johndayers.com/p/#\n\nCSS:\n\n <link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"//cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"css/bootstrap.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"//cdnjs.cloudflare.com/ajax/libs/webfont/1.3.0/webfont.js\" />\n <link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"css/main.css\" />\n\n <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->\n <!--[if lt IE 9]>\n <script type=\"text/javascript\" src=\"//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js\"></script>\n <![endif]-->\n\n\nJavaScript:\n\n <script type=\"text/javascript\" src=\"//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.2/jquery.min.js\"></script>\n <script type=\"text/javascript\" src=\"//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js\"></script>\n <script type=\"text/javascript\" src=\"//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/js/bootstrap.min.js\"></script>\n <script type=\"text/javascript\" src=\"//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js\"></script>\n <script type=\"text/javascript\" src=\"//cdnjs.cloudflare.com/ajax/libs/slidesjs/3.0/jquery.slides.min.js\"></script>" ]
[ "twitter-bootstrap" ]
[ "Sqoop import converting TINYINT to BOOLEAN", "I am attempting to import a MySQL table of NFL play results into HDFS using Sqoop. I issued the following command to achieve this:\n\nsqoop import \\\n--connect jdbc:mysql://127.0.0.1:3306/nfl \\\n--username <username> -P \\\n--table play\n\n\nUnfortunately, there are columns of type TINYINT, which are being converted to booleans upon import. For instance, there is a 'quarter' column for which quarter of the game the play occurred in. The value in this column is converted to 'true' if the play occurred in the first quarter and 'false' otherwise. \n\nIn fact, I did a sqoop import-all-tables, importing the entire NFL database I have, and it behaves like this uniformly. \n\nIs there a way around this, or perhaps some argument for import or import-all-tables that prevents this from happening?" ]
[ "hadoop", "hdfs", "sqoop" ]