texts
sequence
tags
sequence
[ "How to create ASP.net identity tables in an already created database using code first?", "My application has been in development for about a month. I now decided to use ASP.NET Identity. I already have the view models for identity but need to create the tables. I was thinking and I am not exactly sure why I do not have the tables already if I have the view models?? I have drop create on in the initializer with my own custom context, I just need to know how to get EF to build the included Identity tables for users and roles? I looked around and none of the posted answers seem to be what I need?" ]
[ "c#", "asp.net", "entity-framework", "asp.net-identity" ]
[ "How do I quickly compute the product of 100bit numbers", "I am trying to calculate the product of two 100-bit numbers. It is supposed to mimic the behavior of multiplication of unsigned integers native to 100-bit CPU architecture. That is, the program must calculate the actual product, modulo 2^100.\n\nTo do this QUICKLY, I have opted to implement 100bit numbers as uint64_t[2], a two element array of 64bit numbers. More precisely, x = 2^64 * a + b. I need to quickly perform arithmetic and logical operations (products, bit shifts, bit rotate, xor etc). I have chosen this representation because it allows me to use the fast, native operations on the 64bit constituents. For example, rotating a 128bit 'number' is only twice as slow as rotating a 64bit int. Boost::128bit is MUCH slower and bitset and valarray don't have arithmetic. I COULD use the arrays for all operations except multiplication, and then convert the arrays to say boost:128bit and then just multiply, but that is a last resort and probably slow as hell.\n\nI have tried to following. Let us have two such pairs of 64bit numbers, say 2^64 a + b and 2^64 x + y. Then the product can be expressed as\n\n2^128 ax + 2^64 (ay + bx) + by\n\nWe may ignore the first term, for it is too large. It would be almost sufficient to take the pair\n\nay + bx, by\n\nto be our answer, but the more significant half is 'missing' the overflow from the b*y operation. I don't know how to calculate this without breaking the numbers b,y into four different 32bits, and using a divide and conquer approach that will ensure the expanded terms of the product each don't overflow.\n\nThis is for a 'chess engine' with magic multiplication hashing on a 10x10 board" ]
[ "c++", "overflow", "multiplication" ]
[ "How can I return a nested subscription?", "I have the following nested subscription that I need the inner subscription returned. How do I go bout doing so?\n\npublic updateProfiles(){\n this.afAuth.idToken.subscribe(idToken=>{\n return this.httpClient.post<any>('https:example.com/getData',{\n \"token\": idToken,\n \"np\":\"hzlNpV1239nOKRTcsVdPG\",\n \"cp\":\"M6nKYrSjsnA9v34vfB8oD\"\n });\n })\n\n }\n\n\nIn the calling module I would like to this.authService.updateProfiles.subscribe(()=>{do something});" ]
[ "angular", "observable" ]
[ "shaperenderer rounded corner triangle", "I would like to create a triangle shape with rounded corners. I can't use a sprite since the shape will change all the time so shaperenderer seems as a good option. I currently do: \n\n shapeRenderer.setProjectionMatrix(camera.combined);\n\n shapeRenderer.begin(ShapeType.Filled);\n shapeRenderer.setColor(0.2f, 0f, 0f, 1f);\n // shapeRenderer.filledTriangle(50f, 50f, 55f, 55f, 60f, 60f);\n shapeRenderer.triangle(0, 0, 5f, 5f, 5f, 4f);\n\n shapeRenderer.end();\n\n\nwhich produce something like: \n\n\n\nbut I need something like:\n\n\n\nAny ideas?" ]
[ "libgdx" ]
[ "How to scrape search results using WebGrude?", "I recently used WebGrude for scrape some content from web pages. Then I tried to scrape some search results from e-bay. Here what tried,\n\n@Page(\"http://www.ebay.com/sch/{0}\")\npublic class PirateBay {\n\n public static void main(String[] args) {\n //Search calls Browser, which loads the page on a PirateBay instance\n PirateBay search = PirateBay.search(\"iPhone\");\n\n while (search != null) {\n search.magnets.forEach(System.out::println);\n search = search.nextPage();\n }\n }\n\n public static PirateBay search(String term) {\n return Browser.get(PirateBay.class, term);\n }\n\n private PirateBay() {\n }\n\n /*\n* This selector matches all magnet links. The result is added to this String list.\n* The default behaviour is to use the rendered html inside the matched tag, but here\n* we want to use the href value instead.\n*/\n @Selector(value = \"#ResultSetItems a[href*=magnet]\", attr = \"href\")\n public List<String> magnets;\n\n/*\n* This selector matches a link to the next page result, wich can be mapped to a PirateBay instance.\n* The Link next gets the page on the href attribute of the link when method visit is called.\n*/\n @Selector(\"a:has(img[alt=Next])\")\n private Link<PirateBay> next;\n\n public PirateBay nextPage() {\n if (next == null)\n return null;\n return next.visit();\n }\n }\n\n\nBut the result is empty. How may I scrape search results using this?" ]
[ "java", "web-scraping" ]
[ "How to define virtual IP programmatically?", "I need to define Virtual IP programmatically (Perl or VB or CMD or java).\nI need it for temporary use, I can't use any actual IP address and I don't care if it will be accessible only from local machine.\n\nAny help will be appreciated.\n\nThanks,\nYan" ]
[ "java", "vb.net", "perl", "cmd" ]
[ "Can JQGrid Form Editing Div Tag Hide and Show?", "JQGrid Form edit input screen, Can u give some idea on how to hide the selected area and also to display it on click of the check box.\n\nfor example \n\nmy form editing window have \n\nshow full details check box and First, Last Name, Age, and Address, Zipcode, City, State and Country\n\nif that check box is checked First, Last Name, Age, and Address, Zipcode, City, State and Country fields are shown else all fields are hidden\n\nIs it possible ?" ]
[ "jqgrid", "expand" ]
[ "Initialise class member in class body or in constructor?", "Is there any difference between these two ways of initialising class members?\n\nIn the class body:\n\npublic class A {\n private mB = new B();\n public A() {\n }\n}\n\n\nOr in the constructor:\n\npublic class A {\n private mB = null;\n public A() {\n mB = new B();\n }\n}" ]
[ "java", "constructor", "initialization" ]
[ "mysqli_real_escape_string returns empty inside function", "I made a function which has to filter the data passed into a $_GET variable. It recently worked, but I began working with mysqli and now it's not anymore. Echoing my $data everytime it went through a PHP function gave the result that the mysqli_real_escape_string causing the variable $data to return empty. But what am I doing wrong here.\n\nMy function which should filter the $_GET variables, but the mysqli_real_escape_string returns an empty variable..\n\n function filter($data) {\n global $link;\n $data = trim(htmlentities(strip_tags($data)));\n if (get_magic_quotes_gpc())\n $data = stripslashes($data);\n $data = mysqli_real_escape_string($link, $data); \n return $data;\n }\n\n\nA loop in order to run all $_GET variables trough the filter.\n\nforeach($_GET as $key => $value) {\n $get[$key] = filter($value);\n} \n\n\nThe connection with the database (the connection does work): ($link)\n\n$link=mysqli_connect(DB_HOST,DB_USER,DB_PASS,DB_NAME);" ]
[ "php", "mysqli" ]
[ "How to set rotation of a view based on other view position", "I know the question doesn't make a lot of sense, but I have two views.\n\nThe first one I set its position X & Y based on touch event on the activity.\n\nThe second one is like an arrow fixed in the middle of the activity and I want it to point exactly where the the first view is positioned.\n\nso is there a way that can convert a view's position coordinates into a angle value based from the center of the screen.?\n\nparentView.setOnTouchListener(new OnTouchListener() {\n @Override\n public boolean onTouch(View view, MotionEvent event) {\n marker.setX(event.getX()); // marker is the first view\n marker.setY(event.getY());\n FixedArrow.setRotation(/* ??? */); //FixedArrow is the second view\n return true;\n }\n });" ]
[ "java", "android", "libgdx" ]
[ "How to create the UIView sub class with xib?", "I want to create UIView commonly. And use that view in all the view controllers. How can create the UIView sub class with xib and use in all the view controllers? \nThanks in advance." ]
[ "iphone", "ios", "xcode", "uiview" ]
[ "Downloading icons from the network to the mini drawer", "I use libraries https://github.com/mikepenz/MaterialDrawer to create a navigation drawer with mini drawer.\nI need to download icons from the network. It turned out to be done for the usual driver, using mikepenz material drawer can not load url for drawer item.\n\nif I replace the line\nImageHolder.applyMultiIconTo(icon, iconColor, selectedIcon, selectedIconColor, isIconTinted, viewHolder.icon), on\nImageHolder.applyTo(icon, viewHolder.icon, \"customUrlItem\"), then the icons are displayed.\n\n\n\nBut if I try to add a selectedIcon, and use\nImageHolder.applyMultiIconTo(icon, iconColor, selectedIcon, selectedIconColor, isIconTinted, viewHolder.icon), then the driver is only shown selectedIcon, and in the miniDrawer does not show the icons.\n\n\n\n\nAn example of how I did it: https://github.com/mikepenz/MaterialDrawer/commit/8deedf8470f19c74ed6b826fd5aadc4eaed506da\nHow to fix it?(" ]
[ "android", "url", "icons", "materialdrawer" ]
[ "JavaFX + FXML progress bar not progressing?", "I am in trouble with my ProgressBar in my JavaFX app fueled with FXML configuration.\n\nOr I'd rather say, I have never programmed a REAL progress bar in JavaFX, just one fake in Swing during my studies.\n\nSo I have a Controller, inside this controller I have:\n\n@FXML\nProgressBar progressBar;\n\n\nthen I have a method:\n\n@FXML\nprivate void handleCommand() {\n if (handlePasswordField()) {\n progressBar.setProgress(0);\n progressBar.setProgress(10);\n handleDocker(CMD + DOCKER_MYSQL_PULL, APPLICATION_NAME);\n progressBar.setProgress(50);\n handleDocker(CMD + DOCKER_MYSQL_RUN + rootPassword + DOCKER_MYSQL_RUN_SUFFIX, APPLICATION_NAME);\n progressBar.setProgress(100);\n Platform.exit();\n }\n}\n\n\nthe handleDocker() method:\n\nprivate void handleDocker(String command, String applicationName) {\n AppUtility.runWindowsCommand(command, applicationName);\n}\n\n\nand AppUtility.runWindowsCommand():\n\npublic static void runWindowsCommand(String command, String applicationName) {\n try {\n Process process = Runtime.getRuntime().exec(command);\n System.out.println(applicationName + process.getOutputStream());\n BufferedReader reader = new BufferedReader( new InputStreamReader(process.getInputStream()));\n String sout;\n while ((sout = reader.readLine()) != null){\n System.out.println(applicationName + sout);\n } \n } catch (IOException e) {\n e.printStackTrace();\n }\n}\n\n\nAnd finally, this may be something that could help building the progress bar, sample console output of runWindowsCommand() method:\n\nDOCKER: java.io.BufferedOutputStream@6fda88a4\nDOCKER: Using default tag: latest\nDOCKER: latest: Pulling from library/mysql\nDOCKER: Digest: sha256:a571337738c9205427c80748e165eca88edc5a1157f8b8d545fa127fc3e29269\nDOCKER: Status: Image is up to date for mysql:latest\nDOCKER: java.io.BufferedOutputStream@227fe897\n\n\nI am assuming that my approach to this is terribly wrong... but I have read many stuff about the ProgressBar, here on StackOverflow and in the internet generally, and I haven't found any answer how should I make the progress bar progress... And how to do it properly..." ]
[ "java", "javafx", "progress-bar", "javafx-8" ]
[ "Find out status of last build in shell script", "I have a job with Shell script which runs every after 30 mins, download and accept changes from source control. Now I want to proceed in my shell script if and only if;\n\n\nThere are new changes in my workspace OR\nThere are NO new changes but my last run for the same job was marked as unstable.\n\n\nI have looked at the Jenkins wiki but from the obvious environment variable it is not possible to find out 'if my last run' was Stable or Unstable without writing code within my build either via using Jenkins XML API or some python script...Is there any easy way to find this information?" ]
[ "jenkins" ]
[ "Tell bytebuddy to \"not care\" about generic information", "So I ran into\n\nException in thread \"Thread-0\" java.lang.IllegalArgumentException: Unknown type: null\n at net.bytebuddy.description.type.TypeDefinition$Sort.describe(TypeDefinition.java:213)\n at net.bytebuddy.description.type.TypeDescription$Generic$OfParameterizedType$ForLoadedType$ParameterArgumentTypeList.get(TypeDescription.java:4595)\n at net.bytebuddy.description.type.TypeDescription$Generic$OfParameterizedType$ForLoadedType$ParameterArgumentTypeList.get(TypeDescription.java:4569)\n at java.util.AbstractList$Itr.next(AbstractList.java:358)\n at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor.onParameterizedType(TypeDescription.java:1556)\n at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor$ForDetachment.onParameterizedType(TypeDescription.java:1709)\n at net.bytebuddy.description.type.TypeDescription$Generic$OfParameterizedType.accept(TypeDescription.java:4407)\n at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor.onParameterizedType(TypeDescription.java:1557)\n at net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor$ForDetachment.onParameterizedType(TypeDescription.java:1709)\n at net.bytebuddy.description.type.TypeDescription$Generic$OfParameterizedType.accept(TypeDescription.java:4407)\n at net.bytebuddy.description.type.TypeDescription$Generic$LazyProjection.accept(TypeDescription.java:5308)\n at net.bytebuddy.description.field.FieldDescription$AbstractBase.asToken(FieldDescription.java:143)\n at net.bytebuddy.description.field.FieldDescription$AbstractBase.asToken(FieldDescription.java:87)\n at net.bytebuddy.description.field.FieldList$AbstractBase.asTokenList(FieldList.java:47)\n at net.bytebuddy.dynamic.scaffold.InstrumentedType$Factory$Default$1.represent(InstrumentedType.java:222)\n at net.bytebuddy.ByteBuddy.redefine(ByteBuddy.java:698)\n at net.bytebuddy.ByteBuddy.redefine(ByteBuddy.java:676)\n at parc.Foo.redefineClass(Foo.java:137)\n\n\nWhen trying to redefine a class that is already loaded with the bytecode the JVM loaded.\n\nThe code was in a preliminary step already transformed by a soot-framework and we suspect that some of the signature attributes might have become outdated or gone missing in that processs and that ByteBuddy simply insists on the correctness of the info it doesn't have.\n\nStrictly speaking, ByteBuddy doesn't need that information, either. (Obviously, seeing how the signature attribute is optional and how the class is loaded and run by the JVM just fine.)\nSo a quick way to check would be to tell byteBuddy to simply not care and see if that changes anything.\n\nIs there a way to configure ByteBuddy in such a way?\n\n(ByteBuddy version is 1.7.9)\n\n(Project requires Java 7)\n\n(class reloading is done\n\nprivate void redefineClass(String classname, byte[] bytecode) {\n ClassFileLocator cfl = ClassFileLocator.Simple.of(classname,bytecode);\n\n Class clazz;\n try{\n clazz = Class.forName(classname);\n }catch(ClassNotFoundException e){\n throw new RuntimeException(e);\n }\n\n Debug._print(\"REDEFINING %s\",clazz.getName());\n\n new ByteBuddy()\n .redefine(clazz,cfl)\n .make()\n .load(clazz.getClassLoader(),ByteBuddyConfig.reloadingStrategy)\n ;\n}\n\n\nwith \n\npublic class ByteBuddyConfig {\n\n static final ClassReloadingStrategy reloadingStrategy;\n static {\n try {\n reloadingStrategy = new ClassReloadingStrategy(\n (Instrumentation) ClassLoader.getSystemClassLoader()\n .loadClass(\"net.bytebuddy.agent.Installer\")\n .getMethod(\"getInstrumentation\")\n .invoke(null),\n ClassReloadingStrategy.Strategy.RETRANSFORMATION);\n }catch(ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e){\n throw new RuntimeException(e);\n }\n }\n}\n\n\nthanks to @kutschkern from how to debug an internal error? )" ]
[ "java", "bytecode", "instrumentation", "byte-buddy" ]
[ "ASP.NET docker-compose app not coming up on assigned PORT", "working my way through tutorials on dockerized the API WeatherForecast web template from ASP.NET core:\n\n\nhttps://code.visualstudio.com/docs/containers/quickstart-aspnet-core\nhttps://code.visualstudio.com/docs/containers/docker-compose\n\n\nI had to start from here, because I wasn't getting a new image to build using the tutorial here: https://docs.docker.com/compose/aspnet-mssql-compose/\n\n\"1\" works, which is great. However, \"2\" will not work on the localhost:5000/WeatherForecast port as advertised, and I'm having some trouble debugging why after many reviews of the available docs.\n\nI should make a note that in creating the templated app from the command line, I did choose the --no-https option.\n\nI then used docker ps to bring up the PORTS . The web app is using 5000/tcp, 0.0.0.0:32779->80/tcp . When I substitute 5000 for 32779 , I get the API string returned instead!\nI know I'm missing something within docker-compose and could use some extra eyes on it. Thank you! \n\nEDIT: For reference, the files below were generated by my VSCode editor.\n1. I ran dotnet new webapi --no-https\n2. I then brought up the VSCode \"command pallete\" and ran Docker: Add Dockerfiles to Workspace and selected 'yes' for the inclusion of docker-compose.yml file and Linux. I also choose to use port 5000. I use Fedora 30.\n4. I run dotnet build from the project root in the terminal.\n5. If I run from docker commands and make the ports explicit it will work as advertised, but if I run docker-compose -f <yml-file> up -d- --build, it will not.\n\nI just re-read this and find it annoying that I'm stuck within VSCode to fix the issue (according to the docs)\n\n\n By default Docker will assign a randomly chosen host port to a port exposed by a container (the container port). In this case the exposed (container) port is 5000, but it will be exposed on the host via a random port, such as 32737.\n \n You can use specific port on the host by changing the Docker run options used by docker-run: debug task (defined in .vscode/tasks.json file). For example, if you want to use the same port (5000) to expose the service, the docker-run: debug task definition would look like this:\n\n\na. Dockerfile\n\n # Please refer https://aka.ms/HTTPSinContainer on how to setup an \n https developer certificate for your ASP .NET Core service.\n version: '3.4'\n\n services:\n aspdotnetdocker2:\n image: aspdotnetdocker2\n build:\n context: .\n dockerfile: Dockerfile\n ports:\n - 5000\n\n\nb. docker-compose.yml\n\nFROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base\nWORKDIR /app\nEXPOSE 5000\n\nFROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build\nWORKDIR /src\nCOPY [\"aspdotnet_docker2.csproj\", \"./\"]\nRUN dotnet restore \"./aspdotnet_docker2.csproj\"\nCOPY . .\nWORKDIR \"/src/.\"\nRUN dotnet build \"aspdotnet_docker2.csproj\" -c Release -o /app/build\n\nFROM build AS publish\nRUN dotnet publish \"aspdotnet_docker2.csproj\" -c Release -o /app/publish\n\nFROM base AS final\nWORKDIR /app\nCOPY --from=publish /app/publish .\nENTRYPOINT [\"dotnet\", \"aspdotnet_docker2.dll\"]" ]
[ "c#", "asp.net", "docker", ".net-core", "docker-compose" ]
[ "Trying to bind the query to the json string for every request in to the api in Vue.js", "I'm trying to get results from an api based on the user search box. When the user enters a value 'en' or 'de'. They should get the result from that search. I need to bind the user input into my query string. This works when I manually code the country into the template, but not when I bind the value into the string after the user inputs a value for the second time. The 'get' request that uses the user input value 'query' works fine. But not when I bind this a second time\n\nI want to be fit to access \nresults[i].query.name\nBut '.query' is not working when I query the data unless I enter the value manually '.en'\n\nI have a json file that looks like the following\n\n [\n {\n \"en\": {\n \"name\": \"testone\",\n \"id\": 5363289,\n \"location\": \"messages_en.properties1\"\n },\n \"de\": {\n \"name\": \"testonede\",\n \"id\": 5363289,\n \"location\": \"messages_en.properties2\"\n }\n },\n {\n \"en\": {\n \"name\": \"test2\",\n \"id\": 5363289,\n \"location\": \"messages_en.properties3\"\n },\n \"de\": {\n \"name\": \"test2de\",\n \"id\": 5363289,\n \"location\": \"messages_en.properties4\"\n }\n }\n ]\n\n\nBelow is my index.html vue.js template\n\n<div id=#app>\n\n<input type=\"text\" v-model=\"query\" placeholder=\"Choose Language\" />\n\n <div class=\"medium-6 columns\">\n <a @click=\"getResult(query)\" class=\"button expanded\">Retrieve</a>\n </div>\n\n<template v-for=\"(result, i) in results\">\n <div class=\"card\" style=\"width: 20rem; display:inline-block;\">\n <div class=\"card-block\"></div>\n\n <p> {{results[i].query}} </p>\n\n <!-- works when I manually code in the 'en' query but when ran with 'query' it returns an error 'Cannot read property 'name' of undefined\"' second time it returns that the value is -->\n <!-- <p> {{results[i].en.name}} </p> -->\n <!-- <p> {{results[i].query.name}} </p> -->\n\n </div> \n </template>\n</div>\n\n\nVue.js\n\nel: '#app',\n data () {\n return {\n search: '',\n query: 'en',\n results: '',\n title: '',\n items: '',\n section: ''\n }\n },\n methods: {\n getResult(query) {\n axios.get('http://localhost:3000/api/country?country=' + query + '&blank=true').then(response => {\n this.results = response.data;\n console.log(this.results);\n });\n }," ]
[ "javascript", "json", "api", "vue.js" ]
[ "how to use state server for session in asp.net 2.0", "I need to know the procedure to use asp.net session state server for session.\n\nPlease help." ]
[ "asp.net", "session" ]
[ "Can someone explain Bootstrap's `_root.scss`?", "Per Bootstrap intro [1], I placed the following in my .html:\n<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">\n\nWhile snooping around my sources (using Chrome Dev Tools) I found the following .scss file https://stackpath.bootstrapcdn.com/bootstrap/scss/_root.scss with the following code which I don't fully understand:\n// Do not forget to update getting-started/theming.md!\n:root {\n // Custom variable values only support SassScript inside `#{}`.\n @each $color, $value in $colors {\n --#{$color}: #{$value};\n }\n\n @each $color, $value in $theme-colors {\n --#{$color}: #{$value};\n }\n\n @each $bp, $value in $grid-breakpoints {\n --breakpoint-#{$bp}: #{$value};\n }\n\n // Use `inspect` for lists so that quoted items keep the quotes.\n // See https://github.com/sass/sass/issues/2383#issuecomment-336349172\n --font-family-sans-serif: #{inspect($font-family-sans-serif)};\n --font-family-monospace: #{inspect($font-family-monospace)};\n}\n\nIt generates the following css:\n:root {\n --blue: #007bff;\n --indigo: #6610f2;\n --purple: #6f42c1;\n --pink: #e83e8c;\n --red: #dc3545;\n --orange: #fd7e14;\n --yellow: #ffc107;\n --green: #28a745;\n --teal: #20c997;\n --cyan: #17a2b8;\n --white: #fff;\n --gray: #6c757d;\n --gray-dark: #343a40;\n --primary: #007bff;\n --secondary: #6c757d;\n --success: #28a745;\n --info: #17a2b8;\n --warning: #ffc107;\n --danger: #dc3545;\n --light: #f8f9fa;\n --dark: #343a40;\n --breakpoint-xs: 0;\n --breakpoint-sm: 576px;\n --breakpoint-md: 768px;\n --breakpoint-lg: 992px;\n --breakpoint-xl: 1200px;\n --font-family-sans-serif: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";\n --font-family-monospace: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;\n}\n\nWhat I understand:\n\n$ indicates a scss variable.\n@each is scss and performs a loop over lists [2]\n-- indicates a css variable\n:root is equivalent to html\n\nWhat I don't understand:\n\nWhere are $colors, $theme-colors, and $grid-breakpoints defined?\nWhat does the scss #{$color} and the like do?\n\ne.g. in --#{$color}: #{$value};" ]
[ "css", "bootstrap-4", "sass", "google-chrome-devtools" ]
[ "Javascript open.window returns null in called function", "I have developed a function that when called should open a window but it returns null. If I do the opening window in the original JavaScript function it works. I suppose its the original function passing control to the other function but for some reason this doesn't work.\n\nHere is my original function, this basically calls a new JavaScript file and loads an HTML file and when \"Ready\" it needs to display the window.open with the HTML file which is now in the form of string.\n\norder.prototype.printMe = function() {\n order_resume.loadthis(\"myTestPage.html\", \"showData\");\n\n // OPENING WINDOW HERE WORKS; but the the html file that is loaded\n // in above line hasn't finsihed loading - so i need to show it form\n // the function below once in \"ready\" state \n\n/* child1 = window.open (\"about:blank\",\"_blank\");\n child1.document.write( myDocument );\n child1.document.close();\n*/ \n}\n\n\nAnd here's is my function that is called from original function:\n\nfunction showResume() {\n this.req = false;\n\n reservaResumen.prototype.showData = function() {\n if (this.req.readyState == 4) {\n child1 = window.open(\"about:blank\", \"_blank\"); /// THIS RETURNS NULL\n child1.document.write(\"test\");\n child1.document.close();\n }\n }\n\n reservaResumen.prototype.loadthis = function(url, myMethod) {\n if (window.XMLHttpRequest && !(window.ActiveXObject)) {\n try {\n this.req = new XMLHttpRequest();\n }\n catch (e) {\n this.req = false;\n }\n }\n else if (window.ActiveXObject) {\n try {\n this.req = new ActiveXObject(\"Msxml2.XMLHTTP\");\n }\n catch (e) {\n try {\n this.req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n catch (e) {\n this.req = false;\n }\n }\n }\n if (this.req) {\n var loader = this;\n this.req.onreadystatechange = function() {\n eval(\"loader.\" + myMethod + \".call(loader)\")\n }\n this.req.open(\"GET\", url, true);\n this.req.send(\"\");\n }\n }​" ]
[ "javascript", "function", "class", "dom-events" ]
[ "Change the shape of the bounding box in html", "Is there a way to change the change the shape of the bounding box of html. By default all the elements are represented and diplayed like box on a webpage. But I want to change the shape of the bounding box. I there a way?" ]
[ "javascript", "html", "css", "bounding-box" ]
[ "Actionscript 2 advanced collision detection", "I'm wondering what the best way to go about advanced collision detection in AS2 would be. I don't mean bounding boxes, because that's fine. Specifically how do I stop the player from moving in one direction when colliding with something.\n\nImagine a top-down shooter. Basically I'm looking for how the collision detections were achieved in a game similar to this: http://ninjakiwi.com/Games/Action/Play/SAS-Zombie-Assault-2.html\n\nI have an array that keeps track of the direction the player is currently moving(up, down, left, right). I also have four variables allowing the player to move in each direction if the corresponding variable is true. When the player collides with a movieclip in the collision array I set the variables relating to the directions he is moving to false, so he can't keep moving in the direction he was going when he collided with the object. The problem arises when the player is moving diagonally(two directions) and collides with something that he should be able to continue moving in one direction in. Example:\n\n\n\nThe play should be able to move in the up direction, but cannot. \n\nAnother problem is that the variables determining wether or not the player can move are set back to true when the opposite direction's key is pressed(ie. able to move right is set to true when left is pressed, since we've moved in the opposite direction). So in the previous example if you were not to move diagonally and simply move right, then hold right down while moving up until you aren't touching the object anymore you wouldn't be able to move right because the left key wasn't pressed.\n\nIt seems like I'm over complicating things, is there any way besides individually placing all walls that stop the player from moving in one direction?(Ie. If the player touches this wall, stop moving right). <--- This way doesn't allow for randomly generated maps when objects are rotated. Or is there some way I can get around this using math depending on the object rotation?\n\nWhat's the easiest way to hitTest? :D" ]
[ "flash", "actionscript", "actionscript-2", "collision", "hittest" ]
[ "How many TCP sockets can I open at once?", "I am going to develop a TCP server application. I am on the \"choose server\" step.\nMy TCP server is going to have 2000+ clients and one socket to each client.\n\nIs there limit for amount of created sockets depending on the operating system? Which operating system permits more open sockets at a given time?" ]
[ "windows", "sockets", "unix", "tcp", "operating-system" ]
[ "Change the name of the editor itunes app store", "How to change the developer name in the appstore. see attached image" ]
[ "iphone", "app-store", "app-store-connect" ]
[ "NewsFeed filtering ( Most Recent / Top Stories ) using the legacy rest apis.", "Is there a way to filter the news feed to just get the \"Most Recent / Top \" stories\nusing REST. I think I can just use the stat/end times to get the most recent. What would be the best way to get the 'Top' stories using REST ( I know this is legacy api's but we already have a system using these and was wondering if its possible to just get the top stories of the news feed using REST ). \n\nFrom the documentation https://developers.facebook.com/docs/reference/rest/stream.get/ , it doesn't seem to mention anything about Top stories. Was wondering if there is any other way. \n\nThanks \n\n--sachi" ]
[ "facebook", "filtering", "facebook-rest-api" ]
[ "Attribute Unavailable Auto-enable Return Key prior ot iOS 7.0", "Hello guys recently i am working on upgrading my application to iOS 8 compatible and i found a warning on XIB file on UISearchBar i.e. Attribut Unavailable Auto-enable Return Key prior to iOS 7.0.\nCan any one have the idea why this warning comes.\n\nAnd one more thing on that screen some time keyboard not shown when click on search bar.\nIs this is due to this warning?\n\nThanks" ]
[ "ios", "objective-c", "xcode", "ios8", "xcode6" ]
[ "Android - Save and recreate instance of fragment", "I'm new to android development, and I have come across this article, that shows how to restore the activity state : http://developer.android.com/training/basics/activity-lifecycle/recreating.html\n\nAnd I was wondering if it is the same about fragments, do I need to implement \n\n\n onSaveInstanceState and onCreate\n\n\nthe way they show, or do I also need to add something to the activity, since it is a fragment, and it doesn't work exactly like an activity." ]
[ "android", "android-fragments", "oncreate" ]
[ "Is it possible to consume more memory than the heap size on Android?", "I left my app running in the foreground on aSamsung Galaxy note 3 for 24 hours. I took a RAM snapshot in the beginning.\n\n{\"AvailableSystemRAM\":1341,\"AvailableAppRAM\":10,\"TotalAppRAM\":49}\n\nalter 12 hours:\n\n{\"AvailableSystemRAM\":1265,\"AvailableAppRAM\":4,\"TotalAppRAM\":52}\n\nafter 24 hours the result is:\n\n{\"AvailableSystemRAM\":992,\"AvailableAppRAM\":0,\"TotalAppRAM\":61}\n\nIs it a sign of memory leak or other apps and services processing in the background? I presume that Android would throw an OutOfMemoryError if I used all the availableAppRam.\n\nUPDATE\n\nThe answer is yes. Some native functions caused a minor memory leak that wasn't visible in Android Studio's memory monitor." ]
[ "android", "memory" ]
[ "Having problems replacing a string...to what i want", "I managed to get a json response back from a request and i convert it to String lets say: \n\nString response = client.execute(get, handler); \n\n\nThe response looks something like: \n\n\"geometry\":{\"rings\":[[[29470.26099999994,40220.076999999583],[29551.560999999754,40324.093000000343],[29597.470999999903,40391.253000000492],[29619.849999999627,40434.842000000179],[29641.708999999799,40471.713999999687],[29701.501000000164,40574.616000000387],[29722.775999999605,40611.230000000447],[29723.673000000417,40613.234999999404]]]} \n\n\nBut I want to have it to look like the following one: \n\n\"Coordinates\":\"29470.26099999994|40220.076999999583,29551.560999999754|40324.093000000343,29597.470999999903|40391.253000000492,45360.235000003|41478.4790000003,45360.2369999997|41478.4729999993,45353.8320000004|41470.7339999992,45372.21|41468.057,45371.8090000004|41467.1390000004\" \n\n\nIn summary i want to change the comma between two coordinates in a [ ] set to be separated by pipes\"|\" instead of comma and to separate a set of two coordinates with , instead of \"],[\" \n\nWhat i tried: \n\nresponse = response.replace(\"],[\",\"\\,\"); \nresponse = response.replace(\"[[[\",\"\\\"\"); \nresponse = response.replace(\"]]]\",\"\\\"\"); \n\n\nHowever it does not give me what i wanted...becuz i have no idea to achieve the replace of pipe...tot of using regex but dont know how to. can someone help me please" ]
[ "java", "string", "replace" ]
[ "md5hash from php to python but false", "I'm try rewrite md5hash function from php to python3.2\nbut it's false:\n\nphp code:\n\nfunction MD5Hash($str) {\n $m = md5($str);\n $s = '';\n foreach(explode(\"\\n\", trim(chunk_split($m, 2))) as $h) {\n $s .= chr(hexdec($h));\n }\n return $s;\n}\n\n\nand python code:\n\ndef md5hash(self, st):\n m = hashlib.md5(st).hexdigest()\n print(str(st) +\" : \"+m)\n s = bytes()\n for i in range(0, len(m), 2):\n s += chr(int(m[i:min(i+2, len(m))], 16)).encode('utf-8')\n return s\n\n\ni'm try with\n\nPHP:\n\necho(base64_encode(MD5Hash(MD5Hash(\"123123\"))));\nresult: KXJU6b/guPOcaC7aMLub4A==\n\n\nPython:\n\nprint(base64.b64encode(self.md5hash(self.md5hash(b\"123123\"))))\nresult: fcOsw6VSwo5iHEvCjz98w7JMW09w\n\n\nI unknown how to fix it,please help me :(" ]
[ "php", "python", "md5" ]
[ "Uncaught exception 'MongoDB\\Driver\\Exception\\RuntimeException' with message 'An object representing an expression must have exactly one field:", "I have written like below lines of code \n\n $cursor = $this->collection->aggregate(array(\n array(\n '$match' => array(\n \"_id\" => new MongoDB\\BSON\\ObjectID($this->id)\n )\n ),\n array(\n '$project' => array(\n 'AllotmentsDetails' => array(\n '$filter' => array(\n 'input' => '$AllotmentsDetails',\n 'as' => 'allot',\n 'cond' => array(\n '$and' => array(\n '$lt' => array('$$allot.ToDate', new MongoDB\\BSON\\UTCDateTime((new DateTime())->getTimestamp() * 1000)),\n '$eq' => array('$$allotment.RoomId', $this->RoomId)\n )\n )\n )\n ),\n )\n )\n ))->toArray();\n\n\nIt is throwing error message \" Uncaught exception 'MongoDB\\Driver\\Exception\\RuntimeException' with message 'An object representing an expression must have exactly one field:\"\n\nPlease help!!!" ]
[ "php", "mongodb", "aggregation-framework", "mongodb-php" ]
[ "Angular Can't resolve template - Conditonal templateUrl", "import { Component } from '@angular/core';\nimport { environment } from '../environments/environment';\n\nconst template = environment.production ? '../dev/dev-app.component.html' : './app.component.html';\n\n@Component({\n selector: 'app-root',\n templateUrl: template,\n styleUrls: ['./app.component.scss']\n})\nexport class AppComponent {\n title = 'app';\n}\n\nIn the above I am trying to write a conditional variable called template which will load the view for the component.\nOnly I'm getting the following error:\n\nERROR in ./src/app/app.component.ts\nModule not found: Error: Can't resolve ' template' in '/src/app'" ]
[ "angular", "typescript" ]
[ "Error using JLayer library and running in command prompt", "I'm using JavaZOOM JLayer library and I built a small program that plays music. Here is the code:\n\nimport javazoom.jl.player.Player;\nimport java.io.FileInputStream;\npublic class Test {\n public static void main(String[] args) {\n try {\n FileInputStream fis = new FileInputStream(/*SONG PATH*/);\n Player player = new Player(fis); //<-- Here is the problem\n\n player.play();\n } catch(Exception e){\n }\n }\n}\n\n\nThe code works when I use Intellij IDEA (I can hear the music), but when I try running on the command prompt, it throws the following error:\n\nException in thread \"main\" java.lang.NoClassDefFoundError: javazoom/jl/player/Player\nat Test.main<Test.java:9>\n\nCaused by: java.lang.ClassNotFoundException: javazoom.jl.player.Player\nat java.net.URLClassLoader.findClass<Unknown Source>\nat java.lang.ClassLoader.loadClass<Unkonwn Source>\nat sun.misc.Launcer$AppClassLoader.loadClass<Unknown Source>\nat java.lang.ClassLoader.loadClass<Unknown Source>\n... 1 more\n\n\nI'm new using external libraries, so I don't know what is the problem...\n\nP.S. I think it is a problem with the CLASSPATH variable, but I don't know to use it." ]
[ "java", "intellij-idea" ]
[ "c# Regular expression problem", "I am trying to filter out some text based on regex like phone* means i want the text \"Phone booth\", \"phone cube\" etc.\n\nBut when I give booth* it selects Phone booth also. It should not select it rite? Here is the code,\n\nstring[] names = { \"phone booth\", \"hall way\", \"parking lot\", \"front door\", \"hotel lobby\" };\n\n string input = \"booth.*, door.*\";\n string[] patterns = input.Split(new char[] { ',' });\n List<string> filtered = new List<string>();\n\n foreach (string pattern in patterns)\n {\n Regex ex = null;\n try\n {\n ex = new Regex(pattern.Trim());\n }\n catch { }\n if (ex == null) continue;\n\n foreach (string name in names)\n {\n if (ex.IsMatch(name) && !filtered.Contains(name)) filtered.Add(name);\n }\n }\n\n foreach (string filteredName in filtered)\n {\n MessageBox.Show(filteredName);\n }\n\n\nIt displays \"Phone booth\" and \"front door\". But as per my criteria, it should not show anything, bcoz no string is starting with booth or door.\n\nIs any problem in my regex?" ]
[ "c#", "regex", "c#-3.0" ]
[ "wrapping a text url with tags via jquery find and replace", "I am pulling in tweets through a getJSON and writing them to a Google map infowindow with javascript. The problem is, these tweets come with text links but no formatting (and no ids/classes/anything for which to narrow a find and replace). This is the mash of code I'm using right now to find the text, but I can't get it to wrap whatever it finds in <a> tags to properly display the links:\n\nfunction wrap( str ) {\n return '<a href=\"' + str + '\">' + str + '<\\/a>';\n};\n\nfunction replaceText() {\n var jthis = $(this);\n $(\"*\").each(function () {\n if (jthis.children().length == 0) {\n jthis.text(jthis.text().replace(/\\bhttp[^ ]+/i, wrap));\n }\n });\n}\n$(document).ready(replaceText);\n$(\"html\").ajaxStop(replaceText);\n\n\nDid I overlook something or does anyone know a better way to do this?" ]
[ "javascript", "jquery", "regex", "replace" ]
[ "Foundation Abide refreshing the page even when I have return false", "this is wrecking my head! So, first of all, I want to say that I love foundation! But I have a problem with Abide and form submittion. This is the code I have for my contact form\n\n $(\"#myForm\").on('valid', function(e){\n e.preventDefault();\n var name = $(\"input#name\").val();\n var email = $(\"input#email\").val();\n var msg = $(\"textarea#message\").val();\n\n var dataString = 'name=' + name +\n '&email=' + email +\n '&msg=' + msg;\n\n $.ajax({\n type:\"POST\",\n url:\"php/mail.php\",\n data: dataString,\n success: function(){\n $(\".contactform\").html(\"<div id = 'thanks'></div>\");\n $('#thanks').html(\"<h2>Thanks</h2>\")\n .append(\"<p> Dear \" + name + \" I will contact you soon </p>\")\n .hide()\n .fadeIn(1500);\n }\n });\n return false;\n });\n\n\nI used an online video tutorial for it. The thing is, that when I hit submit, it refreshes the page even though I have included return false there. But here is where it gets weird... If I take out Jquery from my page, the contact form script works perfectly, however, I need Jquery functionality for plugins in my page. I have also went to the github and made the fix on the page to the abide file, but still no luck. If you want to take a look at my page, to have some context, its here \n\nwww.siddigzeidan.com/app\n\nThank you so much in advance!" ]
[ "javascript", "jquery", "ajax", "forms", "zurb-foundation" ]
[ "How to fix setState warning in ReactJS for login page", "I'm getting a \"Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op.\" on a login page. The first time I sign in there is no warning. If I log out and back in, the warning appears. If I do that again, 2 warnings appear, and then 3 and so on and so on. Upon research this probably due to having a callback function in the component, but I'm not really sure how to fix it. I'm using some old firebase code I copied from something else I wrote a while back, so that could also be the problem.\n\nhandleClick(){\n ...\n firebase.auth().onAuthStateChanged(function(user) {\n if (user) {\n this.setState({redirect: true});\n console.log(user.uid);\n\n } else {\n // No user is signed in.\n }\n }.bind(this));\n\n\n\n\nrender() {\n if(this.state.redirect){\n console.log(\"Log in successful\");\n return <Redirect to=\"/home\" />\n }\n\n return (\n //sign in page\n )}" ]
[ "reactjs", "firebase", "firebase-authentication" ]
[ "How to correctly detect variable types and detect more types than typeof function has to offer?", "Because of the need constantly arising on detecting data types, and I have written the following function that so far has served well, so I would like to share the code with you. However I'm beginning to think that this maybe isn't an efficient way for type detection. How could I enhance this function? Or am I making a mistake, and shouldn't even do this?\n\nBased on cade's answer I reviewed and edited the code:\n\nfunction detectType(data) {\n // analyze data to distinguish object types from primitive types\n var dataType = typeof data;\n var toClass = {}.toString; // this is used to detect object types\n var isPrimitive;\n var isFalsy = false;\n switch(dataType) {\n case 'string':\n isFalsy = !data;\n if(isFalsy) {\n dataType = 'empty string'; // Only if you want to distingush empty strings\n }\n isPrimitive = true;\n break;\n case 'number':\n isFalsy = !data;\n if(isFalsy) {\n if(isNaN(data))\n dataType = 'NaN'; // it is strange that JavaScript considers NaN a number\n else {\n dataType = '0'; // only needed if you want to distinguish zeros\n if(1/data < 1/0)\n dataType = '-0';\n }\n } else if(!isFinite(data)) { // Although infinity is considered a number you might want to distinguish it\n dataType = 'infinity';\n if(data < Infinity)\n dataType = '-infinity';\n }\n isPrimitive = true;\n break;\n case 'boolean':\n isFalsy = !data;\n isPrimitive = true;\n break;\n case 'object':\n isFalsy = !data;\n dataType = toClass.call(data).slice(8, -1).toLowerCase();\n switch(dataType) {\n case 'string':\n dataType = 'object string';\n break;\n case 'number':\n dataType = 'object number';\n break;\n case 'boolean':\n dataType = 'object boolean';\n break;\n }\n isPrimitive = false;\n break;\n case 'function':\n isFalsy = !data;\n isPrimitive = false;\n break;\n case 'undefined':\n isFalsy = !data;\n isPrimitive = false;\n break;\n }\n return [dataType, isPrimitive ,isFalsy];\n}\n\n\nI tried a few things in console and got these results:\n\ndetectType(-0)\n[\"-0\", true, true]\ndetectType(9)\n[\"number\", true, false]\ndetectType(new Number(3))\n[\"object number\", false, false]\ndetectType('')\n[\"empty string\", true, true]\ndetectType('foo')\n[\"string\", true, false]\ndetectType(new String('bar'))\n[\"object string\", false, false]\ndetectType(true)\n[\"boolean\", true, false]\ndetectType(new Boolean(false))\n[\"object boolean\", false, false]\ndetectType(document.body)\n[\"htmlbodyelement\", false, false]\ndetectType(-0)\n[\"-0\", true, true]\ndetectType(-Infinity)\n[\"-infinity\", true, false]\ndetectType(/a-zA-Z/)\n[\"regexp\", false, false]\n\n\nNow It can even detect html elements too, it is possible to check for -0, +0 and -Infinity, +Infinity, although these are considered numbers, one might find it useful to distinguish too large or too small numbers such is infinity or -0." ]
[ "javascript", "variables", "types", "typeof" ]
[ "Amazon MWS Products API XML Parsing with PHP", "I am trying to parse the XML Part of the response with Simplexml without losing the \"role\" informations like \"Komponist\" or \"Künstler\" .\n\n<itemattributes xml:lang=\"de-DE\" xmlns:ns2=\"http://mws.amazonservices.com/schema/Products/2011-10-01/default.xsd\">\n<ns2:binding>Audio CD</ns2:binding>\n<ns2:brand>MEYER,SABINE/VARIOUS</ns2:brand>\n<ns2:creator role=\"Künstler\">Meyer,Sabine</ns2:creator>\n<ns2:creator role=\"Künstler\">Various</ns2:creator>\n<ns2:creator role=\"Komponist\">Mozart</ns2:creator>\n<ns2:creator role=\"Komponist\">Stamitz</ns2:creator>\n<ns2:creator role=\"Komponist\">Weber</ns2:creator>\n<ns2:creator role=\"Komponist\">Krommer</ns2:creator>\n</ns2:itemattributes>\n\n\nI have tried this:\n\n $nodeList = $attributeSets->getAny();\n foreach ($nodeList as $domNode){\n $domDocument = new DOMDocument();\n $domDocument->preserveWhiteSpace = false;\n $domDocument->formatOutput = true;\n $xmlData = $domDocument->saveXML($domDocument->importNode($domNode,true));\n\n }\n //$xmlData = str_replace(\"ns2:\", \"\", $xmlData);\n $xmlData = new SimpleXMLElement($xmlData);\n\n\nBut if I do not replace the ns2 attributes, I can not parse the xml. And with uncommenting the line the role attributes are gone:\n\nSimpleXMLElement Object\n(\n [Binding] => Audio CD\n [Brand] => MEYER,SABINE/VARIOUS\n [Creator] => Array\n (\n [0] => Meyer,Sabine\n [1] => Various\n [2] => Mozart\n [3] => Stamitz\n [4] => Weber\n [5] => Krommer\n )\n)\n\n\nI would like to know, how I can hold these Attributes and maybe in the end how I could get the whole XML to an associative array." ]
[ "php", "xml-parsing", "amazon-web-services" ]
[ "Complex linq: Nested where statements JSON.net and linq", "What I'm trying to accomplish is to select the dateTimeStart inside the ttSheduleDay. The JSON beneath is a node of one employee, the function receives three parameters an empUID, a date and a value of (start / stop or duration). \n\nThe node I want to select is where the dsShedule > ttEmployee > empUID equals the first parameter, where the ttShedule > ttSheduleDay > dat equals the date parameter and the third parameter I will execute with an if statement. Below the JSON\n\nJSON\n\n{\n \"dsShedule\": {\n \"ttEmployee\": [\n {\n \"empUID\": 2649,\n \"empNameFirst\": \"firstname\",\n \"empNameLast\": \"lastname\",\n \"empFunction\": \"employee\",\n \"ttShedule\": [\n {\n \"UID\": 47,\n \"empUID\": 2649,\n \"datStart\": \"2013-05-20\",\n \"datStop\": \"2013-05-20\",\n \"regime\": 1,\n \"state\": \"PLANNED\",\n \"ttSheduleDay\": [\n {\n \"SheduleUID\": 47,\n \"dat\": \"2013-05-20\",\n \"dateTimeStart\": \"2013-05-20T08:00:00.000\",\n \"dateTimeStop\": \"2013-05-20T17:00:00.000\",\n \"duration\": 8\n }\n ]\n },\n {\n \"UID\": 57,\n \"empUID\": 2649,\n \"datStart\": \"2013-05-21\",\n \"datStop\": \"2013-05-21\",\n \"regime\": 1,\n \"state\": \"PLANNED\",\n \"ttSheduleDay\": [\n {\n \"SheduleUID\": 57,\n \"dat\": \"2013-05-21\",\n \"dateTimeStart\": \"2013-05-21T08:00:00.000\",\n \"dateTimeStop\": \"2013-05-21T17:00:00.000\",\n \"duration\": 8\n }\n ]\n }\n ]\n },\n\n\nThe code I already have is to select the ttShedule\n\nJObject jObj = JObject.Parse(json);\nvar linq = jObj[\"dsShedule\"][\"ttEmployee\"]\n // first filter for a single emp by empUID\n .First(emp => emp[\"empUID\"].Value<int>() == Convert.ToInt16(empUID))\n .SelectToken(\"ttShedule\");\n\n\nThe code suggested by someone on Stackoverflow was:\n\nvar linq = jObj[\"dsShedule\"][\"ttEmployee\"]\n // first filter for a single emp by empUID\n .First(emp => emp[\"empUID\"].Value<int>() == firstUID)\n // then select the ttShedule array of that emp\n .Select(emp => emp[\"ttShedule\"])\n // now filter for whatever ttShedule you need\n .Where(shed => shed[\"ttSheduleDay\"]\n .Any(day => day[\"dat\"].Value<DateTime>() \n == new DateTime(2013, 5, 24))\n\n\nBut this failed on the select statement of ttShedule. I was wondering how i can expand my code to select the dateTimeStart node with the second if statement.\n\nThanks in advance" ]
[ "c#", "asp.net", "json", "asp.net-mvc-4", "json.net" ]
[ "Pandas Python - Save dataframe without time part of date", "I have the following dataframe which is imported from a file, into pandas, as part of a data analysis app.\n\ndate,value,cat\n1/6/2000,5,a\n2/6/2000,10,b\n3/6/2000,15,c\n\n\nI need to change the date format\n\nimport pandas.io.date_converters as conv\nimport pandas as pd\ndf = pd.read_csv('temp.csv', index_col=0, parse_dates=True, dayfirst=True)\nprint df\n\n\nAfter running the above commands the dataframe looks like this in ipython\n\n value cat\ndate \n2000-01-06 5 a\n2000-02-06 10 b\n2000-03-06 15 c\n\n\n\ndf.to_csv('test.csv') # write dataframe to disk\n\n\nAfter saving the file to disk and reading it back again, using textwrangler, ipython or any other editor the time format still appears.\n\n value cat\ndate \n2000-01-06 00:00:00 5 a\n2000-02-06 00:00:00 10 b\n2000-03-06 00:00:00 15 c\n\n\nWhat is the most simplest way I can remove the time part of the date permanently.\n\nAny simple solutions welcome. Thanks in advance." ]
[ "python", "pandas" ]
[ "Using /Carbon, why is time difference between New York and Detroit 0", "Using /Carbon I'm not getting any time difference between New York timezone and Detroit (or Chicago for that matter) timezone. I should be getting 60 minutes diff. Here's the code.\n\n $dtNewYork = \\Carbon\\Carbon::create(2012, 1, 1, 0, 0, 0, 'America/New_York');\n $dtDetroit = \\Carbon\\Carbon::create(2012, 1, 1, 0, 0, 0, 'America/Detroit');\n $mins = $dtDetroit->diffInMinutes($dtNewYork); \n echo $mins;\n\n\n$mins is 0." ]
[ "laravel", "php-carbon" ]
[ "How to fix this compile error for Xdebug on Homestead", "I cannot install Xdebug on Homestead because I get some sort of compile error.\n\nI am following the Xdebug Wizard (https://xdebug.org/wizard) and when I input the ./configure command I get this error:\n\n\n configure: error: in /home/vagrant/code/xdebug-2.7.2:\n configure: error: cannot run C compiled programs.\n If you meant to cross compile, use '--host'.\n See 'config.log' for more details" ]
[ "xdebug", "homestead" ]
[ "How to specify a custom folder path in which EF code-first approach create a database?", "By default, EF code first will create a database in \n\nC:\\Program Files\\Microsoft SQL Server\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA\n\n\nIs it possible to change this default path to my own path?" ]
[ "c#", "entity-framework" ]
[ "Count similar entries in SQL", "I have a table where a column for grade of students.\nWe have A+ and A and A- and B+ and B and B-.\nNow we want to treat A+ and A and A- all equal to A. So as B+ and B and B- all equal to B.\n\nHow to write the expression to aggregate this?\nThe question is count how many A and B? A+ and A- also mean A.?" ]
[ "sql", "postgresql", "pattern-matching", "aggregate-functions" ]
[ "Set sprite width or height without scaling it's children", "I am trying to dynamically change the width and height of a Sprite object, which is a container for other similar Sprite objects. The container object automatically changes it's size according to the size of it's children, but when I change the position of the children objects, the size of the container stays the same and it's children appear to be placed outside of the container.\n\nI tried to solve this problem by using something like this:\n\nif (container.width < (child.x + child.width))\n{\n container.width = (child.x + child.width);\n}\n\n\nBut when I use this code, the container object's children are scaled.\nIs there a way to change the container's size without scaling it's children?" ]
[ "actionscript-3", "size", "sprite", "scale" ]
[ "Spark No space left on device", "I have an EMR job which reads around 1TB data, filters it and does repartition on it (there are some joins after repartition), however my job fails at repartition with error \"No space left on device\". I tired to change the \"spark.local.dir\" but its of no use. My job completes only on d2.4xlarge instance but it fails on r3.4xlarge which has similar core and ram. I couldn't find the root cause of this issue. Any help would be appreciated.\n\nThank you for your time." ]
[ "apache-spark", "pyspark" ]
[ "Tkinter: Image not recognised", "I have a simple GUI program I'm building with Tkinter. I want to have a bunch of buttons with app images on them that, when clicked, launch that app. The problem is, Python can't recognise the Skype.gif file.\n\nCode:\n\nfrom tkinter import *\nimport os\n\ndef open_skype():\n os.system('open /Applications/Skype.app')\n\nmaster = Tk()\n\nphoto = PhotoImage(file='/Users/michael/Desktop/Skype.gif')\n\nbut = Button(master, image=photo, command=open_skype)\n\n\n\nobjs = [but]\n\ncolumn = 1\nfor i in objs:\n i.grid(column=column, row=1)\n column += 1\nmainloop()\n\n\nError message:\n\n\n _tkinter.TclError: couldn't recognize data in image file \"/Users/michael/Desktop/Skype.gif\"" ]
[ "python", "tkinter" ]
[ ".Net Binary Deserialization Failure detection/forensics for runtime platform", "I'm looking for insight on how to instrument a runtime platform to expose the source type of a Microsoft .Net binary deserialization failure.\n\nWhen using BinaryFormatter.Deserialize(StreamingContextStates.CrossMachine) and one of the types does not exist in the current binaries; instead of throwing an error, .Net inserts the object [TypeLoadExceptionHolder]. Particularly for collections, this causes no immediate problem.\n\nSubsequently when the collection is serialized for transmission between application tiers; the platform receives a 'serialization failure' because [TypeLoadExceptionHolder] cannot be serialized. So the resulting error is useless for actually providing clues as to the source-type that caused the problem. Now the hunt (time suck) is on to see which developer (of hundreds) added a new type to a million-line platform.\n\nThis problem happens with some frequency because of the serialization stream used to support the platform sessioncache. Code is deployed fairly often and in an incremental fashion. Customer page-requests can bounce between old and new versions of the codebase during the deployment window. Careless introduction of a new type will cause the page-requests on the old version to blow up.\n\nAny thoughts about providing runtime rich error/trap would be appreciated.\n\n\n\n(SerializationException) \nType 'System.Runtime.Serialization.TypeLoadExceptionHolder' in Assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable. \n- at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) \n- at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) \n- at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() \n- at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) \n- at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) \n- at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) \n- at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) \n- at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)" ]
[ ".net", "serialization", "instrumentation" ]
[ "Converting String to JSON", "I am a newbie to javascript, and I am trying to convert the redis-cli INFO command output to JSON. The string, I am trying to convert to JSON is something like this\n\n \"redis_version:2.4.8\\r\\nredis_git_sha1:b85ba5fb\\r\\nredis_git_dirty:0\\r\\narch_bits:64\\r\\nmultiplexing_api:kqueue\\r\\ngcc_version:4.2.1\\r\\nprocess_id:6403\\r\\nuptime_in_seconds:963411\\r\\nuptime_in_days:11\\r\\nlru_clock:815387\\r\\nused_cpu_sys:67.32\\r\\nused_cpu_user:91.89\\r\\nused_cpu_sys_children:42.23\\r\\nused_cpu_user_children:132.57\\r\\nconnected_clients:2\\r\\nconnected_slaves:1\\r\\nclient_longest_output_list:0\\r\\nclient_biggest_input_buf:0\\r\\nblocked_clients:0\\r\\nused_memory:162549360\\r\\nused_memory_human:155.02M\\r\\nused_memory_rss:147972096\\r\\nused_memory_peak:191943360\\r\\nused_memory_peak_human:183.05M\\r\\nmem_fragmentation_ratio:0.91\\r\\nmem_allocator:libc\\r\\nloading:0\\r\\naof_enabled:1\\r\\nchanges_since_last_save:1\\r\\nbgsave_in_progress:1\\r\\nlast_save_time:1350325258\\r\\nbgrewriteaof_in_progress:0\\r\\ntotal_connections_received:187\\r\\ntotal_commands_processed:269264\\r\\nexpired_keys:180\\r\\nevicted_keys:0\\r\\nkeyspace_hits:202518\\r\\nkeyspace_misses:11675\\r\\npubsub_channels:0\\r\\npubsub_patterns:0\\r\\nlatest_fork_usec:2198\\r\\nvm_enabled:0\\r\\nrole:master\\r\\naof_current_size:159904546\\r\\naof_base_size:158667118\\r\\naof_pending_rewrite:0\\r\\naof_buffer_length:0\\r\\naof_pending_bio_fsync:0\\r\\nslave0:127.0.0.1,62716,online\\r\\ndb0:keys=356937,expires=0\\r\\n\"\n\n\nAny pointers on how to convert this to a JSON object is highly appreciated. Thanks!" ]
[ "javascript", "json", "serialization", "redis" ]
[ "Swift Apple Pay - No Payment Networks Available", "I'm integrating Apple Pay in my app, trying both directly and with the Stripe SDK, but there are no available PKPaymentNetworks available. This is on both the simulator and a real device with Apple Pay set up. I can't figure out why there are no networks, when I'm trying just the big four (in the US) - Amex, Visa, MC, and Discover.\nlet paymentNetworks: [PKPaymentNetwork] = [.amex, .discover, .masterCard, .visa]\n\n// returns false\nprint("Supports Stripe", Stripe.deviceSupportsApplePay())\n\n// returns true\nprint("Supports Apple: ", PKPaymentAuthorizationController.canMakePayments())\n\n// returns false\nprint("Supports Apple with networks: ", PKPaymentAuthorizationController.canMakePayments(usingNetworks: paymentNetworks))\n\nMy understanding is that Stripe.deviceSupportsApplePay() calls PKPaymentAuthorizationController.canMakePayments(usingNetworks: paymentNetworks) so it makes sense that they're the same. What I can't figure out is why no networks are available.\nI've set up (twice now) the certificates, profiles, etc, Apple Pay with the correct Merchant ID is enabled in the project. I've unchecked, refresh, and rechecked. Restarted the project. Cleared Derived Data. Google is turning up nothing for me.\nAny ideas or thoughts on where to look next?" ]
[ "ios", "swift", "stripe-payments", "applepay" ]
[ "WPF Textbox - How to save text without the wrapping-paragraph", "I load some texts from a database with different lengths into a textbox. (From 1 character to 1000 words...)\n\nI use TextWrapping=\"Wrap\", so if the text is to big for the width of the textbox, it will create a new line....\n\nBy saving the text, the added paragraph from TextWrapping=\"Wrap\" will also be saved. But I don't want this. The original text shouldn't be changed in any way...\n\nHow can I display the text on a new line in the textbox without adding a \"real\" paragraph?\n\nIs there a way I can determine if the paragraph was added from TextWrapping=\"Wrap\" or if it belong to the original text?\n\nThanks" ]
[ "c#", "sql", "wpf", "textbox", "word-wrap" ]
[ "Django nameing conventions", "I have tried to find best practice for naming conventions but I can't find a site that explains it. I would like to correct my project so it is up to standard and before deployment. I know that can take alot of time, but I think it is best to correct it now then later.\nI can tell what I have done and I hope some one tell me what I need to change.\nthe project name: MyToolsProject\napps name: myapp_ap, pages_app, to_do_list_app\nClass: Asset, AssetType\nfunctions: do_this(), happy()\nvariables: var, this_variable\nobjects: obj. this_obj\nModule: my_app_asset, my_app_asset_type\nModule fields: last_updated, notes\ntemplates: asset.html, asset_type.html\nurl: path("asset_app/asset/", views.AssetListView.as_view(), name="asset_app_asset_list")," ]
[ "django", "naming-conventions", "naming" ]
[ "Multiple Upload File JSP servlet always failed", "As a title, I want to doing multiple upload files in my jsp project using servlet. I'm testing it in new project, and it's done without problems. Then I'm trying to implement it to my project which has code:\n\nboolean isMultipart = ServletFileUpload.isMultipartContent(request);\n if (!isMultipart) {\n } else {\n FileItemFactory factory = new DiskFileItemFactory();\n ServletFileUpload upload = new ServletFileUpload(factory);\n List items = null;\n try {\n items = upload.parseRequest(request);\n } catch (FileUploadException e) {\n e.printStackTrace();\n }\n Iterator itr = items.iterator();\n while (itr.hasNext()) {\n FileItem item = (FileItem) itr.next();\n if (item.isFormField()) {\n } else {\n try {\n String itemName = item.getName();;\n File savedFile = new File(\"D://uploadedFiles\");\n item.write(savedFile);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n }\n\n }\n\n\nBut I always getting error like this:\n\nHTTP Status 500 -\n\ntype Exception report\n\nmessage\n\ndescriptionThe server encountered an internal error () that prevented it from fulfilling this request.\n\nexception\n\njavax.servlet.ServletException: PWC1392: Error instantiating servlet class servlet.ManagementProdukServlet\n\nroot cause\n\njava.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileUploadException\n\nroot cause\n\njava.lang.ClassNotFoundException: org.apache.commons.fileupload.FileUploadException\n\nnote The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.1.2 logs.\n\n\nBut I have import this at my servlet:\n\nimport controller.Produk;\nimport dao.DataAksesAdmin;\nimport java.io.File;\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.Iterator;\nimport java.util.List;\nimport javax.servlet.RequestDispatcher;\nimport javax.servlet.ServletException;\nimport javax.servlet.annotation.MultipartConfig;\nimport javax.servlet.http.HttpServlet;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport org.apache.commons.fileupload.FileItem;\nimport org.apache.commons.fileupload.FileItemFactory;\nimport org.apache.commons.fileupload.FileUploadException;\nimport org.apache.commons.fileupload.disk.DiskFileItemFactory;\nimport org.apache.commons.fileupload.servlet.ServletFileUpload;\n\n\nCould anybody tell me what's wrong with my code that made my upload form doesn't work in my project, but it's work in new project?\nAnd sometimes I don't get the error code but I have error: \"Connection reset\" on my browser. Is it affect my project? And what cause the problem with that 2 my problems?\n\nsorry for bad English." ]
[ "jsp", "servlets", "file-upload" ]
[ "How to post image and array together with react native to backend?", "I am trying to send an image file and data (object or array) to a backend with react native. I tried using fetch and the code below and got it to send an image to backend. But my target is to send the image and data together. How can I achieve this?\n\nuploadPhoto = async (response) => {\n\n\n \n\n const formData = new FormData();\n formData.append('fileToUpload', {\n uri: response.path,\n name: 'image',\n type: response.mime,\n imgPath: response.path\n });\n\n const infos={ad:'onur',soyad:'cicek'};\n\n\n\n try {\n\n const rest = await fetch('https://www.birdpx.com/mobile/fotografyukle/'+this.state.user.Id, {\n method: 'POST',\n headers: { 'Accept': 'application/json', 'Content-type': 'multipart/form-data' },\n body: formData\n });\n\n const gelenVeri = await rest.text();\n let convertedVeri=JSON.parse(gelenVeri);\n\n console.log(convertedVeri);\n return false\n\n\n \n } catch (err) {\n console.log(err)\n }\n\n };\n\nI need to post const infos={ad:'onur',soyad:'cicek'}; and the image." ]
[ "javascript", "reactjs", "react-native", "post", "fetch" ]
[ "Why is the last object in the array showing up?", "I am trying to pass info across views, which works, but the program does not pick up the right information. I have buttons in an array, in this case 3 buttons, and when I click that button I want the buttons information i.e. the image to be transferred to the next view. The problem is that no matter which button I click the last button of the array will always transfer its data to the next view. How do I fix this? \n\n\n\n var userbutton = [UIButton]()\n\n var userbutton = UIButton()\n userbutton.addTarget(self, action: \"buttonAction:\", forControlEvents: .TouchUpInside)\n userbutton.frame = CGRectMake(100, 100, 50, 50)\n userbutton.layer.cornerRadius = userbutton.frame.size.width/2\n userbutton.clipsToBounds = true\n userbutton.setImage(users, forState: .Normal)\n\n\n func buttonAction(sender: UIButton){\n\n for (index, users) in upimage.enumerate(){\n self.dicSelected = [\"text\" : usernamearray[index] , \"image\" : upimage[index]]\n print(dicSelected)\n\n self.selectedData.text = usernamearray[index] as? String\n self.selectedData.image = upimage[index] as? UIImage\n\n self.performSegueWithIdentifier(\"nearmeprofile\", sender: self)\n }\n}\n override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {\n if (segue.identifier == \"nearmeprofile\"){ \n let nextViewOBJ = segue.destinationViewController as! NearMeProfile\n nextViewOBJ.neardataModel = self.selectedData;\n }\n}" ]
[ "ios", "swift" ]
[ "How to detect sprite's edges are close. Cocos 2d for ios", "I am developing a jig-so puzzle like app using cocos2d. I have put some sprites into the scene and particular two sprites are matching. If i have put rectangle shaped sprites, i can determine their positions. If they are close enough, therefore re arrange two of them. \n\n float distanceFromCorrectPos = ccpDistance(selectedSprite.position, sda.position);\n\n if( distanceFromCorrectPos <= 70 ){\n\n if(selectedSprite == [movableSprites objectAtIndex:0]){\n [selectedSprite setPosition:ccp(sda.position.x+75, sda.position.y)];\n\n }\n }\n\n\nMy problem is if i using asymmetric images for sprites. How can i detect matching sprites are close enough." ]
[ "cocos2d-iphone", "sprite" ]
[ "bcp Utility write to remote server?", "According to some recommendations i use bcp Utility to write SQL server Table to .cvs file so i could later transfer the data to informix table with the same structure .\n\n\n My SQLServer Stored Procedure :\n\n\nALTER PROCEDURE [dbo].[TestCVS]\nAS\nBEGIN\ndeclare @sql nvarchar(4000)\n\nselect @sql = 'bcp \"select * from ML..gmp4vacationbalance\" queryout c:\\ss\\Tom.cvs -c -t, -T -S' + @@servername\nexec master..xp_cmdshell @sql\nEND\n\n\n\n\nI have four questions concerning this procedure :\n\n1- How to allow this procedure to write to remote server instead of local server @@servername,because it's not secure to allow specific server to access my sql server ?\n\n2-How to allow to filter the query under specific condition :\nsay i want to write query like this :\n\nselect * from ML..gmp4vacationbalance where balance_date = @date AND emp_num = @empNum\n\n\n3-when i execute the procedure i get data like this:\n\n \n\nWhy the third column appear corrupted like this , it's varchar desc written in arabic ?\n\n4-When i want to delimit by pipe | instead of comma , like this \n\nselect @sql = 'bcp \"select * from ML..gmp4vacationbalance\" queryout c:\\ss\\Tom.cvs -c -t| -T -S' + @@servername\n\n\nI get the following error :" ]
[ "sql", "sql-server", "informix", "bcp", "windows-server" ]
[ "How can i change another program icon?", "How can i change another program icon(not mine) in C++ ? I want to do this on Windows. One of my friend is programming in VB and he made a program that can change another .exe icon. So how can i do that in C++ ?" ]
[ "c++", "windows", "icons" ]
[ "c# unknown input parameter type?", "I have a generic function static Log<T>(T Log). I would like to check type of T and decide what to do next. \n\nThis is what I got so far:\n\npublic static void Log<T>(T log)\n{\n switch (typeof(log))\n { ... }\n}\n\n\nWhat am I doing wrong? My error is that typeof(log) doesnt work." ]
[ "c#", "generics" ]
[ "Character spacing in RichEdit control", "How can I change the character spacing in RichEdit control? \n\nI have tried to use the CHARFORMAT structure, but as MSDN says, the sSpacing is useless in RichEdit control. Moreover, SetTextExtra function is useless in that control's hdc, too. \n\nAnd I also tried to use the ole interface of that control, the SetSpace function of ITextFont interface, ineffective.\n\nDoes anybody could help me?\n\nThanks!" ]
[ "visual-c++", "mfc", "controls", "richedit" ]
[ "Why JSON object printed as String in JSP?", "In my Servlet a JSONObject is created with the value:\n\n{'alerts':true}\n\n\nWhen I am trying to print its value on JSP page using , it is printing the JSON object as String . It is printed as \n\n \"{'alerts':true}\"\n\n\nHow do I print in JSON format rather than String?\n\nIn Servlet:\n\npublic JSONObject getAudioAlerts() {\n JSONObject val = new JSONObject(\"{'alerts':true}\");\n return val;\n}\n\n\nIn JSP:\n\n<br><br><json:property name=\"audioAlerts\" value=\"${myBean.audioAlerts\"}\" />;\n <br> Expected output: {'alerts':true}\n <br>Acutal output: \"{'alerts':true}\"" ]
[ "json", "jsp", "jsp-tags", "json-lib" ]
[ "Datatables: column search with stripped HTML", "Referencing to the Datatables API.\n\nI implemented individual column searching and need to extend it:\nThere is a column which is displaying a button with HTML-Attributes/Classes applied. The Problem: I need to strip HTML in order to search the button's caption only. Any ideas how can I do that?\n\nHere's my code:\n\ntable().every(function () {\n var that = this;\n $('input', this.footer()).on('keyup change', function (e) {\n if (e.which == 27) {\n $(this).val('');\n }\n if (that.search() !== this.value) {\n that.search(this.value).draw();\n }\n });\n});" ]
[ "javascript", "jquery", "datatables" ]
[ "MYSQL Select with joins and where", "I got two tables:\n\ndevice\n\ndeviceID\n\ndeviceName\n\ncategoryID\n\n\ncategory\n\ncategoryID\n\ncategoryName\n\n\nIt seems that I am really to stupid to solve my problem; I need a select query that brings me this as a result:\n\nresultTable\n\ndeviceID\n\ncategoryID\n\ncategoryName\n\n\nI tried something like this, but no success:\n\nSELECT deviceID\n , categoryID\n , categoryName\nFROM category\nLEFT JOIN device ON (category.categoryID = device.categoryID)\nWHERE deviceID = '1';\n\n\nIn short, I need a table which shows me the categorie's ID and name, of the category a certain device is in.\n\nHope you get me, since my English is not good." ]
[ "mysql", "select", "join", "where" ]
[ "All properties are set to last loop iteration value [why?]", "Sample code:\n\nvar functions = {\n testFunction: function(){\n console.log('test');\n } \n};\nvar functionsClones = [];\nfor(i in [1,2,3]){\n var functionsClone = $.extend({}, functions);\n functionsClone.testFunction.i = i;\n functionsClones.push(functionsClone);\n}\n\n\n$.extend is jQuery function which allows to clone object instead of reffering to it.\n\nNow let's print set properties:\n\n$.each(functionsClones, function(key, functionsClone){\n console.log(functionsClone.testFunction.i);\n});\n\n\nIt outputs 3 times '2' instead of 0, 1, 2. What's wrong with this code?" ]
[ "javascript", "jquery", "arrays", "loops", "object" ]
[ "Having trouble installing libxml-ruby on windows", "First of all thank you for your time.\n\nI've been having some trouble installing libxml-ruby on my windows 8 OS. I have ruby installed and want to use libxml specifically to modify xmls because other members of my team have already started with libxml. The problem is that they were using linux and I'm on windows. I could try to put everything on a vm but I don't think I should need to. \n\nThey had issues installing on linux too but their solution and problem was different from mine.\n\nC:\\dev\\school\\ece450\\MyBPM>gem install libxml-ruby\nTemporarily enhancing PATH to include DevKit...\nBuilding native extensions. This could take a while...\nERROR: Error installing libxml-ruby:\n ERROR: Failed to build gem native extension.\n\n C:/Ruby200/bin/ruby.exe extconf.rb\nchecking for socket() in -lsocket... no\nchecking for gethostbyname() in -lnsl... no\nchecking for atan() in -lm... yes\nchecking for inflate() in -lz... no\nchecking for inflate() in -lzlib... no\nchecking for inflate() in -lzlib1... no\nchecking for inflate() in -llibz... no\n*** extconf.rb failed ***\nCould not create Makefile due to some reason, probably lack of necessary\nlibraries and/or headers. Check the mkmf.log file for more details. You may\nneed configuration options.\n\nProvided configuration options:\n --with-opt-dir\n --without-opt-dir\n --with-opt-include\n --without-opt-include=${opt-dir}/include\n --with-opt-lib\n --without-opt-lib=${opt-dir}/lib\n --with-make-prog\n --without-make-prog\n --srcdir=.\n --curdir\n --ruby=C:/Ruby200/bin/ruby\n --with-iconv-dir\n --without-iconv-dir\n --with-iconv-include\n --without-iconv-include=${iconv-dir}/include\n --with-iconv-lib\n --without-iconv-lib=${iconv-dir}/\n --with-zlib-dir\n --without-zlib-dir\n --with-zlib-include\n --without-zlib-include=${zlib-dir}/include\n --with-zlib-lib\n --without-zlib-lib=${zlib-dir}/\n --with-socketlib\n --without-socketlib\n --with-nsllib\n --without-nsllib\n --with-mlib\n --without-mlib\n --with-zlib\n --without-zlib\n --with-zliblib\n --without-zliblib\n --with-zlib1lib\n --without-zlib1lib\n --with-libzlib\n --without-libzlib\n extconf failure: need zlib\n\nextconf failed, exit code 1\n\nGem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/libxml-ru\nby-2.7.0 for inspection.\nResults logged to C:/Ruby200/lib/ruby/gems/2.0.0/extensions/x86-mingw32/2.0.0/li\nbxml-ruby-2.7.0/gem_make.out\n\n\nI have tried installing zlib (binaries) and pointing to the zlib binary.\nThat didn't really help.\n\nSo now I'm googling :)" ]
[ "ruby-on-rails", "ruby", "windows" ]
[ "How to set up a java program in IDEone", "i am pretty new to coding and to date have only been using bluej to code java. I want to switch to using IDEone to code so i can switch from the computers i use at school in my programming class to my home computer without having to copy the code from one to the other using a usb or something. The problem is i do not know how to write a program in IDEone. I have a couple of programs that i have made in bluej that compile and execute fine but when pasted into IDEone to see if it would work and i keep getting errors. Here is an example of one of the codes \n\nimport java.util.Scanner;\npublic class IncomeTaxCalculator{\n\n public static void main(String [] args){\n\n // Constants\n final double TAX_RATE = 0.20;\n final double STANDARD_DEDUCTION = 10000.0;\n final double DEPENDENT_DEDUCTION = 2000.0;\n\n Scanner reader = new Scanner(System.in);\n\n double grossIncome;\n int numDependents;\n double taxableIncome;\n double incomeTax;\n\n // Request the inputs\n System.out.print(\"Enter the gross income: \");\n grossIncome = reader.nextDouble();\n System.out.print(\"Enter the number of dependents: \");\n numDependents = reader.nextInt();\n\n //Compute the income tax\n taxableIncome = grossIncome - STANDARD_DEDUCTION - DEPENDENT_DEDUCTION * numDependents;\n incomeTax = taxableIncome * TAX_RATE;\n\n //Display the income tax\n System.out.println(\"The income TAX IS $\" + incomeTax);\n }\n}\n\n\nin IDEone this gives me the error: Main.java:3: error: class IncomeTaxCalculator is public, should be declared in a file named IncomeTaxCalculator.java\npublic class IncomeTaxCalculator{\n\nWhat is the appropriate way for me to start a program in IDEone? how would i change this program so it will compile corectly" ]
[ "java" ]
[ "slider pulls to the left as window size decreases to 500px", "Trying to build a wordpress site for our town. Having some problem with the responsive design. The page works well until we size the window down to 596px in width. At that point the text on the right starts to take up more vertical space and the slider starts taking up less horizontal space.\n\nUnable to create a working snippet as this is using wordpress plugins but here's a link to the page in question:\n\nhttps://www.sustainablewestonma.org/our-story-2/\n\nany help or suggestions as to how to go about fixing this greatly appreciated." ]
[ "css", "wordpress", "responsive-design" ]
[ "How can azure devops build pipeline be triggered when a new image is available on different container registries?", "Let's assume that we have 3 different container registries. Is there any available azure devops jobs/tasks that can provide a way to trigger my build pipeline when a new image is pushed on any of these 3 registries? \n\nI have some insights with MS Flow but i want to limit the scope on azure devops.\n\nFind a way or recommendation to trigger the build pipeline using devops jobs/tasks." ]
[ "azure", "azure-devops" ]
[ "Elasticsearch: Autocomplete on the available buckets in an aggregation", "boiled down to its essence the problem is that\n\n\nI have a multi-valued field of unanalysed strings (consider them as tags)\nI have an aggregation, which collects these tags\n\n\nNow the requirement is to be able to filter these aggregations by tags (which is the easy part) and provide prefix search on the set of available tags (the hard part) to have a neat drill-down feature.\n\nIf I do a naive filter on the prefix (e.g. \"Ge\") of a tag\n\n \"aggregations\": {\n \"tags\": {\n \"filter\": {\n \"prefix\": {\n \"tags\": \"Ge\"\n }\n },\n \"aggregations\": {\n \"tags\": {\n \"terms\": {\n \"field\": \"tags\"\n }\n }\n }\n }\n\n\nit returns all tags that occur in a field where at least one tag starts with \"G\".\n\nIs there a way to fix that other than retrieve to many tags and then prefix-filter them \"by hand\". btw if think scripting like in Elasticsearch: Possible to process aggregation results? should not be necessary.\n\nthanks\nmarkus" ]
[ "elasticsearch", "aggregate" ]
[ "Why is sprintf giving asterisks instead of my formatted string?", "This code:\n\n function atest(){\n $test = array(\n \"StartDate\" => \"08/01/2013\", \n \"StartTime\" =>\"08:00:00\", \n \"DepartmentID\" => \"75275\", \n \"# Contacts Offered\" => \"3\", \n \"# Contacts Handled\" => \"4\", \n \"Average Talk Time\" => \"491.250000\", \n \"Average Delay\" => \"5.666667\", \n \"Percent SLA\" => \"1.333333\");\n\n $formatted = sprintf(\"%s %s TCSDATA %d %d %d %01.2f 0 %01.2f %01.2f 0\\r\\n\", \n $test[\"StartDate\"],\n $test[\"StartTime\"],\n $test['DepartmentID'],\n $test['# Contacts Offered'],\n $test['# Contacts Handled'],\n $test['Average Talk Time'],\n $test['Average Delay'],\n $test['Percent SLA']\n );\n\n echo('<pre>');\n echo( var_dump($test) );\n echo('</pre>'); \n\n echo $formatted;\n}\n\n\nPrints this:\n\n08/01/2013 08:00:00 TCSDATA 75275 ************************\n\n\nHowever, if I modify the sprintf format to remove the last 0 as such:\n\n\"%s %s TCSDATA %d %d %d %01.2f 0 %01.2f %01.2f \\r\\n\"\n\n\nI get this:\n\n08/01/2013 08:00:00 TCSDATA 75275 3 4 491.25 0 5.67 1.33\n\n\nWhat in the world?" ]
[ "php", "printf" ]
[ "Pyinstaller with Tensorflow takes incorrect path for _checkpoint_ops.so file", "I am trying to make an executable of my Python code which uses Tensorflow with Pyinstaller. The executable gets generated correctly but when I try to run it, I get the following error:\n\nTraceback (most recent call last):\n File \"detection_init.py\", line 14, in <module>\n import lib.tensorboxDetector as tensorboxDetector\n File \"/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyimod03_importers.py\", line 396, in load_module\n exec(bytecode, module.__dict__)\n File \"lib/tensorboxDetector.py\", line 26, in <module>\n from lib.train import build_forward\n File \"/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyimod03_importers.py\", line 396, in load_module\n exec(bytecode, module.__dict__)\n File \"lib/train.py\", line 4, in <module>\n import tensorflow.contrib.slim as slim\n File \"/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyimod03_importers.py\", line 396, in load_module\n exec(bytecode, module.__dict__)\n File \"tensorflow/contrib/__init__.py\", line 22, in <module>\n File \"/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyimod03_importers.py\", line 396, in load_module\n exec(bytecode, module.__dict__)\n File \"tensorflow/contrib/bayesflow/__init__.py\", line 24, in <module>\n File \"/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyimod03_importers.py\", line 396, in load_module\n exec(bytecode, module.__dict__)\n File \"tensorflow/contrib/bayesflow/python/ops/csiszar_divergence.py\", line 26, in <module>\n File \"/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyimod03_importers.py\", line 396, in load_module\n exec(bytecode, module.__dict__)\n File \"tensorflow/contrib/bayesflow/python/ops/csiszar_divergence_impl.py\", line 42, in <module>\n File \"/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyimod03_importers.py\", line 396, in load_module\n exec(bytecode, module.__dict__)\n File \"tensorflow/contrib/framework/__init__.py\", line 89, in <module>\n File \"/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyimod03_importers.py\", line 396, in load_module\n exec(bytecode, module.__dict__)\n File \"tensorflow/contrib/framework/python/ops/__init__.py\", line 24, in <module>\n File \"/usr/local/lib/python2.7/dist-packages/PyInstaller/loader/pyimod03_importers.py\", line 396, in load_module\n exec(bytecode, module.__dict__)\n File \"tensorflow/contrib/framework/python/ops/checkpoint_ops.py\", line 32, in <module>\n File \"tensorflow/contrib/util/loader.py\", line 55, in load_op_library\n File \"tensorflow/python/framework/load_library.py\", line 64, in load_op_library\ntensorflow.python.framework.errors_impl.NotFoundError: tensorflow/contrib/util/tensorflow/contrib/framework/python/ops/_checkpoint_ops.so: cannot open shared object file: No such file or directory\n[11241] Failed to execute script detection_init\n\n\nIf we look carefully, Pyinstaller is expecting the file _checkpoint_ops.so in directory tensorflow/contrib/util/tensorflow/contrib/framework/python/ops/ but there's no directory like this. _checkpoint_ops.so is located at tensorflow/contrib/framework/python/ops/. How can this error be corrected?" ]
[ "python", "tensorflow", "pyinstaller" ]
[ "How to populate remote JSON values in Select in angular 7?", "Problem :\nPopulating JSON values (which is gathered over the REST api) into Select statement?\n\nteam.component.html\n\n<mat-select placeholder=\"Select Name\" [(ngModel)]=\"name\">\n <mat-option *ngFor=\"let currentName of nameValuesArray\" [value]='currentName.name'>\n {{currentName.name}}\n </mat-option>\n</mat-select>\n\n\nteam.component.ts \n\nexport class UpdateTeamRosterComponent implements OnInit {\n\n nameValuesArray;\n name;\n\n constructor(private fetchData : FetchdataService) { }\n\n ngOnInit() {\n console.log('ngOnIt called');\n this.nameValuesArray = this.fetchData.getAllEmployeeNames('DCP').subscribe(data=>{\n this.nameValuesArray = JSON.stringify(data);\n });\n\n }\n}\n\n\nERROR\n\n UpdateTeamRosterComponent.html:1 ERROR Error: Cannot find a differ supporting object '[{\"name\":\"Ajith\"},{\"name\":\"Anand\"},{\"name\":\"Bharath\"}]' of type 'string'. NgFor only supports binding to Iterables such as Arrays.\n at NgForOf.push../node_modules/@angular/common/fesm5/common.js.NgForOf.ngDoCheck (common.js:3161)\n at checkAndUpdateDirectiveInline (core.js:18623)\n at checkAndUpdateNodeInline (core.js:19884)\n at checkAndUpdateNode (core.js:19846)\n at debugCheckAndUpdateNode (core.js:20480)\n at debugCheckDirectivesFn (core.js:20440)\n at Object.eval [as updateDirectives] (UpdateTeamRosterComponent.html:2)\n at Object.debugUpdateDirectives [as updateDirectives] (core.js:20432)\n at checkAndUpdateView (core.js:19828)\n at callViewAction (core.js:20069)\n\n\nData is fetching properly from the server\nProblem is rendering the data on to select" ]
[ "angular", "typescript" ]
[ "how to bind nested json data into angularjs dropdown?", "I have some json data related to timzone below i need to bind particular nested value into dropdown, in using angularjs, in timezone array its coming as string format i need to bind those into dropdown.\n\ntimezone.json --\n\n {\n \"countries\": {\n \"US\": {\n \"id\": \"US\",\n \"name\": \"United States\",\n \"timezones\": [\n \"America/New_York\",\n \"America/Detroit\",\n ]\n },\n \"CA\": {\n \"id\": \"CA\",\n \"name\": \"Canada\",\n \"timezones\": [\n \"America/St_Johns\",\n \"America/Halifax\",\n ]\n },\n \"IN\": {\n \"id\": \"IN\",\n \"name\": \"India\",\n \"timezones\": [\n \"Asia/Kolkata\"\n ]\n },\n }\n }\n\n\nScript--\n\n$http({\n method: \"GET\",\n url: 'timezon.json'\n}).then(function mySuccess(response) {\n $scope.timeZones = response.data;\n}, function myError(response) {\n $scope.timeZones = response.statusText;\n});\n\n\nHTML Content\n\n <select class=\"form-control\">\n <option value=\"0\">--Select Time Zones></option>\n </select>" ]
[ "javascript", "jquery", "html", "angularjs" ]
[ "Issues Closing Dropdown Menu", "When I click outside the dropdown menu then dropdown menu must close. How can I close the dropdown menu? Here is my code:\n<div class="pull-right srch-box">\n <button onclick="search_function()" class="dropbtn"><i class="fa fa-search" aria-hidden="true"></i></button>\n <div id="myDropdown" class="dropdown-content">\n <form>\n <div class="input-group search-box form-group">\n <input type="text" id="search" class="form-control" placeholder="Search here...">\n <button type="button" class="btn btn-primary ">Search</i></button>\n </div>\n </form>\n </div>\n</div>\n\njs script for the open dropdown menu:\nfunction search_function() {\n document.getElementById("myDropdown").classList.toggle("show");\n}\n \n\nWhat would be the js script to close the dropdown menu?" ]
[ "javascript", "html", "css", "navbar" ]
[ "Accessing shared modules from child packages", "I'm having difficulties with using internal imports inside my projects. This is a partial tree structure of my project:\n\napp\n |- Gui.py\n |- Main.py\n |- logger.py\n |- config.py\n |- WebParser (package)\n |- __init__.py\n |- LinksGrabber.py\n |- LyricsGrabber.py\n |- ImagesGrabber.py\n |- (Many other packages...)\n\n\nthe logger.py and config.py modules are required in every package's modules, and are independent (uses only bulit-in modules). It is tricky to access these modules from inside packages.\n\nThis is how I tried to achieve it, for enabling configuration access and logging feature in WebParser\\LinksGrabber.py:\n\n# WebParser\\__init__.py:\nsys.path.append('..') # for outside-package modules\nimport config\nfrom logger import log\n\n# WebParser\\LinksGrabber.py:\nimport WebParser\nconfig = WebParser.config\nlog = WebParser.log\n\n\nThe Problems:\n\n\nThis has code smell. I bet there is a better way to achieve this behaviour.\nI want to call import WebParser and use WebParser.LinksGrabber and WebParser.LyricsGrabber right away, without implicitly importing them. This can be done with importing the modules inside __init__.py, but it isn't possible because every package's module imports the package itself, and it will issue recursive imports.\n\n\nCan you suggest a better implemention, or a different code design?" ]
[ "python", "code-design", "package-structuring" ]
[ "how to use mahout java api to convert lucene index to vector?", "When i try to convert lucene index to vector, I use command line\n/bin/mahout lucene.vector to convert to sequence file. Is there a Java API for this kind of task?" ]
[ "lucene", "indexing", "mahout" ]
[ "Custom confirm dialog style", "I have been trying to use the confirm dialog with a custom size but I haven't found a way to do it. \n\nIs there any way or could it be implemented easily?" ]
[ "angular", "material-design-lite", "angular-mdl" ]
[ "a java library for manipulating *.properties files", "I plan to write a utility for commenting/uncommenting/editing properties inside *.properties files. i know i can read/modify/write those using the Properties class, but im looking for a library that will let me access things like commented lines, preserve formatting and line order when writing back etc.\n\ndoes such a library exist?" ]
[ "java" ]
[ "How to conditionally initialize a static array", "I am working with some code that I would prefer not to change more than necessary. But I've run into a problem. I want to change the contents of arrayOfStrings depending on a condition isConditionMet(). I cannot do this in a static initialization block.\nclass Scratch {\n static final String[] arrayOfStrings = {"one", "two", "three"};\n //...\n}\n\nHow might I set the contents of the array conditionally without using a constructor or changing the data structure?" ]
[ "java", "spring" ]
[ "DatagramPacket getData vs getLength", "I am using a DatagramSocket to receive a DatagramPacket like so s.receive(p) and I am doing this in a loop. I have however found two unintended behaviors.\n\n1) the getData()(typo was getBytes) always returns 500 bytes(the byte buffer I set) even though the packet may only contain 10 or 20 bytes. Should I just trim this or is there a cleaner way to handle this?\n\nand the real problem...\n\n2) the getLength() is always updated for each new packet but the getBytes() is only updated if the next packet is larger than the previous packet... is this a glitch in the DatagramPacket class or some feature that someone would care to explain to me...?\n\nThe only solution I can think of right now is to just create a new DatagramPacket for each receive but why would it update the Length and not the Bytes(Except it does update the Bytes when it is larger than the previous packet)?\n\nEdit: I seem to have solved the problem, here is my code below per request that dynamically updates the packet automatically...\n\ns= new DatagramSocket(port, InetAddress.getByName(\"0.0.0.0\"));\np= new DatagramPacket(new byte[500], 500);\n\n\nthen I loop this code below\n\ns.receive(p);\nSystem.out.println(\"Port: \" + p.getPort() + \"\\nLength: \" + p.getLength() + \"\\nReceived: \" + new String(p.getData(), p.getOffset(), p.getLength()) + \"\\n from: \" + p.getAddress().toString());" ]
[ "java", "networking" ]
[ "What type of thread method should I use for continuous work?", "My application is currently using ordinary threads to produce servers, clients and even a thread which swaps WiFi networks and starts the previous. Those threads run in the background and dont have any impact on the UI so it is something I was looking for, but the problem is that when I reenter the application all those threads are recreated. Is it possible to create a singleton thread which will be possible to control when we reopen the application?\n\nAndroid offers some classes also:\n\nService: but it uses the UI thread...\n\nAsyncTask: probably a better candidate\n\nIntentService: has a worker thread which could be manipulated? Probably best option from above.\n\nAny thoughts/opinions will be highly appreciated. :)\n\nEDIT:\n\nAlso why I would want to change my ordinary threads into some other method is because Android will prioritize ordinary threads to get killed.\n\nThread call hierarchy:\n\nMainActivity -> NetworkSwap(infinite process which is scanning, connecting and swaping WiFi networks), ServerTCP(infinitely listening for connections) , ServerUDP(infininetely listening for connections)\n\nNetworkswap -> ClientUDP (sends broadcast request to serverUDP and ends)\n\nServerUDP -> ClientTCP (sends request to serverTCP and ends)" ]
[ "java", "android", "multithreading", "service", "android-asynctask" ]
[ "Document version support in Cosmos DB. Does UNION work?", "Given these two document versions:\n\n{\n \"id\": \"1\",\n \"tags\": [\"first\",\"second\"],\n \"version\": 1,\n}\n\n\nAnd:\n\n{\n \"id\": \"2\",\n \"tags\": [\n {\"name\": \"third\"},\n {\"name\": \"forth\"}\n ],\n \"version\": 2,\n}\n\n\nMy first attempt to normalize them on reading was:\n\nSELECT VALUE t\nFROM c\nJOIN t IN c.tags\nWHERE c.version = 1\n\nUNION ALL\n\nSELECT VALUE t.name\nFROM c\nJOIN t IN c.tags\nWHERE c.version = 2\n\n\nIt looks like that UNION is not supported. What is the best way to deal with versioning then? I would prefer a single aggregated query to deal with all versions in a unified way if possible." ]
[ "azure", "azure-cosmosdb" ]
[ "Missing tag in xmla to deploy assembly", "I am trying to deploy a custom .NET assembly to my SSAS database. While doing so, I am facing Clr Assembly must have main file specified error and changing the target framework as given in the marked answer didn't solve it.\n\nI also checked whether the dll was blocked as given here but as it has been compiled by the same system I am working on, it doesn't need to be unblocked and so the option doesn't even come up in properties of the assembly file.\n\nI tried deploying with both SQL Server Data Tools 2012 as well as SQL Server Management Studio 2012, I get the same error. I checked the XMLA script that SSMS was using to deploy it and as it turns out the <Files> tag (which usually has the binary data of the assembly file) is missing. This might mean that SSMS and VS are unable to read the binary contents of the assembly.\n\nAlthough the dll is not on network but local machine, I tried the workaround given here but it didn't work either as I am not able to deploy a dll in the first place that I can ALTER later.\n\nIs there something I am missing out?" ]
[ "dll", "ssas", "clr", ".net-assembly", "cube" ]
[ "Sendgrid SMTP templates", "I've been reading over the sendgrid-ruby documentation and having a hard time. Looking at this page, how do I pass in a template to use?\n\nI've tried passing various parameters into the mail method, but it's not been working.\n\nhttps://sendgrid.com/docs/Integrate/Code_Examples/v3_Mail/ruby.html\n\nI just need enough to get started with templating!" ]
[ "ruby-on-rails", "sendgrid" ]
[ "jenkins Multibranch pipeline plan runs with bitbucket merge event", "I need to run jenkin plan branch from bitbucket merge event.I have configure the jenkin plan branch source behaviours to discover merging pull request and identified when the time i have save that configs the plan get activated. Then the second code merge happen plan will not invoke.\n\nJenkin can not identify branch indexing for Multibranch pipeline plans.Can some one help me with this issue.I do not need to config webhooks from bitbucket server." ]
[ "jenkins", "jenkins-pipeline" ]
[ "Adding a dynamic sublist to a task manager with Javascript (JQuery) or CSS", "I have an app that is a little like this (although also fairly different). In the app, you can add lists. I want to add a button with which you can add a \"subtask\" to one of these tasks; this subtask(s) would be indented, and the indentation would be accessible via some sort of small button or something of the sort to the left of the parent class. How do you achieve something like this? \n\nI use this to add elements into the list: \n\n// Add todo\n $form.submit(function(e) {\n e.preventDefault();\n $.publish('/add/', []);\n });\n\n\nand I want to be able to add nested lists under it. I've tried using tags, but that doesn't seem to work; additionally, I'm not sure how to make said nested list accessible via button." ]
[ "javascript", "jquery", "html", "css" ]
[ "Can I use babel with firebase functions?", "Is it possible to use es6 with firebase functions? \n\nThere are some es6 classes that I need to import from my react native app into firebase functions.\n\nAny pointers on how to do this will be helpful :)" ]
[ "firebase", "google-cloud-functions" ]
[ "How do I get textbox to fill the column and autoscroll?", "I have the following code in my DataGridTemplateColumn:\n\n<Controls:DataGridTemplateColumn.CellEditingTemplate>\n<DataTemplate>\n <StackPanel Orientation=\"Horizontal\">\n <TextBox Text=\"{Binding AlternateTeacherName, Mode=TwoWay}\" Style=\"{StaticResource InputTextBox}\"/>\n </StackPanel>\n</DataTemplate>\n\n\n\n\nStyle is:\n\n<Style x:Key=\"InputTextBox\" TargetType=\"TextBox\" >\n<Setter Property=\"Margin\" Value=\"1\" />\n<Setter Property=\"MinWidth\" Value=\"30\" />\n<Setter Property=\"BorderThickness\" Value=\"0\" />\n<Setter Property=\"Background\" Value=\"Transparent\" />\n<Setter Property=\"VerticalAlignment\" Value=\"Center\" />\n<Setter Property=\"TextAlignment\" Value=\"Left\" />\n<Setter Property=\"HorizontalAlignment\" Value=\"Stretch\" />\n\n\n\n\nProblem I'm getting is that the textbox fills the column width correctly (including when you resize it) but if I type into the textbox the cursor is not visible when it reaches the end of the line. I'd like the text to scroll off the left so that the current text is still visible. \n\nthanks" ]
[ "silverlight", "silverlight-3.0" ]
[ "Last date is not getting printed in org.joda.time.LocalDate?", "This is what is my code to print between two dates and it excludes the saturday and sunday but this one does not print the last date of the given month.\n\nimport org.joda.time.DateTimeConstants;\nimport org.joda.time.LocalDate;\n\npublic class DatesexcludingWeekend {\n public static void main(String[] args) {\n final LocalDate start = new LocalDate(2012, 05, 1);\n final LocalDate end = new LocalDate(2012, 05, 31);\n LocalDate weekday = start;\n if (start.getDayOfWeek() == DateTimeConstants.SATURDAY|| start.getDayOfWeek() == DateTimeConstants.SUNDAY) {\n weekday = weekday.plusWeeks(1).withDayOfWeek(DateTimeConstants.MONDAY);\n }\n\n while (weekday.isBefore(end)) {\n String dateValues[] = weekday.toString().split(\"-\");\n //System.out.println(dateValues[2]+\"/\"+dateValues[1]+\"/\"+dateValues[0]);\n String date=dateValues[2]+\"/\"+dateValues[1]+\"/\"+dateValues[0];\n System.out.println(\"date : \"+date);\n if (weekday.getDayOfWeek() == DateTimeConstants.FRIDAY)\n weekday = weekday.plusDays(3);\n else\n weekday = weekday.plusDays(1);\n }\n }\n}\n\n\nHere is the out put of the above code : \n\ndate : 01/05/2012\ndate : 02/05/2012\ndate : 03/05/2012\ndate : 04/05/2012\ndate : 07/05/2012\ndate : 08/05/2012\ndate : 09/05/2012\ndate : 10/05/2012\ndate : 11/05/2012\ndate : 14/05/2012\ndate : 15/05/2012\ndate : 16/05/2012\ndate : 17/05/2012\ndate : 18/05/2012\ndate : 21/05/2012\ndate : 22/05/2012\ndate : 23/05/2012\ndate : 24/05/2012\ndate : 25/05/2012\ndate : 28/05/2012\ndate : 29/05/2012\ndate : 30/05/2012\n\n\nif you see this 31-05/2012 is not getting printed\n\nPlease help me to get this solved.\n\nRegards\nTony" ]
[ "java", "jodatime" ]
[ "How to find whether value is integer", "I want to perform some task based on some ifs\n\nmy (uncomplete) code is\n\nSub checkif()\n Dim s\n With ActiveDocument.Range\n s = Val(ActiveDocument.Paragraphs.Count)\n s = s / 5\n If s = Integer then\n perform some task\n Else\n Exit Sub\n End If\n End With\nEnd Sub\n\n\nI am completely new to VBA and there are so many answers. I have tried several.\none is\n\nSub checkif2()\n Dim s\n With ActiveDocument.Range\n s = Val(ActiveDocument.Paragraphs.Count)\n s = s / 5\n If IsNumeric(s) Then\n MsgBox \"is integer\"\n Else\n MsgBox \"not integer\"\n Exit Sub\n End If\n End With\nEnd Sub\n\n\nThis always give integer.\n\nchecked another one\n\nSub checkif2()\n Dim s\n With ActiveDocument.Range\n s = Val(ActiveDocument.Paragraphs.Count)\n s = s / 5\n If TypeName(s) = \"Integer\" Then\n MsgBox \"is integer\"\n Else\n MsgBox \"not integer\"\n Exit Sub\n End If\n End With\nEnd Sub\n\n\nAlways give not integer.\nIs there any method for Word VBA?" ]
[ "vba", "ms-word" ]
[ "View Completed Elasticsearch Tasks", "I am trying to run daily tasks using Elasticsearch's update by query API. I can find currently running tasks but need a way to view all tasks, including completed.\n\nI've reviewed the ES docs for the Update By Query API:\n\nhttps://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html#docs-update-by-query\n\nAnd the Task API:\nhttps://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html#tasks\n\nTask API shows how to get the status of a currently running task with GET _tasks/[taskId], or all running tasks - GET _tasks. But I need to see a history of all tasks ran. \n\nHow do I see a list of all completed tasks?" ]
[ "elasticsearch" ]
[ "requests via a SOCKs proxy", "How can I make an HTTP request via a SOCKs proxy (simply using ssh -D as the proxy)? I've tried using requests with SOCK proxies but it doesn't appear to work (I saw this pull request). For example:\n\nproxies = { \"http\": \"socks5://localhost:9999/\" }\nr = requests.post( endpoint, data=request, proxies=proxies )\n\n\nIt'd be convenient to keep using the requests library, but I can also switch to urllib2 if that is known to work." ]
[ "python", "python-requests" ]
[ "Call to a templated member function that takes as arguments an object and one of its member function in C++", "I am having problems using this declaration.\nobject1.function1<Object2, void (Object2::*)()>(object2, &Object2::function2)\n\nThis is what the compiler tells me.\nerror LNK2001: unresolved external symbol "public: void __cdecl Object1::function1<class Object2,void (__cdecl Object2::*)(void)>(class Object2 &,void (__cdecl Object2::*)(void))" (??$function1@VObject2@@P81@EAA_NXZ@Object1@@QEAA_NAEAVObject2@@P81@EAA_NXZ@Z)\n\nHere the struct of the code:\nclass Object1{\npublic:\n template <typename O, typename F>\n void function1(O& object, F function){\n object.function();\n }\n};\n\nclass Object2{\npublic:\n void function2(){\n std::cout << "Doing something..." << std::endl;\n };\n};\n\nclass Object3 {\nprivate:\n\n Object1 object1;\n Object2 object2;\n\n void function3() {\n object1.function1<Object2, void (Object2::*)()>(object2, &Object2::function2);\n };\n};\n\nI can not see the error. Someone could help me?" ]
[ "c++", "templates", "member-function-pointers" ]
[ "keras:expected dense_1_input to have 2 dimensions", "from keras import optimizers\nfrom keras.models import load_model\nfrom keras.preprocessing import image\nimport numpy as np\nimport scipy.misc\nfrom keras.wrappers.scikit_learn import KerasClassifier\n# dimensions of our images\nimg_width, img_height = 313, 220\n\n# load the model we saved\nmodel = load_model('hmodel.h5')\nsgd = optimizers.SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True)\nmodel.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy','mse'])\n\ntest_image= image.load_img('/Images/1.jpg',target_size = (img_width, img_height))\nx= scipy.misc.imread('/Images/1.jpg').shape\nprint x\ntest_image = image.img_to_array(test_image)\ntest_image = np.expand_dims(test_image, axis = 0)\ntest_image = test_image.reshape(img_width, img_height,3)\nresult = model.predict(test_image)\n\nprint result\n\n\n\n\nWhen I run this code i get this error:\n\n\n /keras/engine/training.py\", line 113, in _standardize_input_data\n 'with shape ' + str(data_shape)) ValueError: Error when checking : expected dense_1_input to have 2 dimensions, but got array with shape\n (313, 220, 3).\n\n\nMy first print displays: (313, 220, 3).\n\nHow can I fix this error." ]
[ "python", "keras" ]
[ "Change the Ribbon of a RTE field in the Send Mail action for Webforms for Marketeers", "I want to change to Ribbon of the RTE Field which is shown in the send mail action on a webforms form. I found an item in the core database /sitecore/system/Settings/Html Editor Profiles/Rich Text Mail, but this profile doesn't seem to be used for the send mail action. I also found (using fiddler) that the following xml control is used: Sendmail.Editor but don't know if this has something to do with the ribbon.\nBasicly I want to be able to offer our customer more functionality in the RTE field of the send mail action and don't know how this is done.\n\nusing: \n\n[assembly: AssemblyDescription(\"Sitecore Web Forms for Marketers Library\")]\n[assembly: AssemblyFileVersion(\"2.1.0.3458\")]\n[assembly: AssemblyInformationalVersion(\"2.1.0 rev. 100920\")]" ]
[ "sitecore", "web-forms-for-marketers" ]
[ "server side events (for dummies:) )", "i read the specification and few examples/tutorials about Server Side Events, but i do now fully understand the entire process. \n\nIf when using ajax the request->response cycle is simple to understand, here it seems to be a little bit complicated. As described here : http://dsheiko.com/weblog/html5-and-server-sent-events ,i do not understand who/what generates the events on server. It's like someone keeps calling the server script and this is generating the random numbers. \n\nMore than that, the author says: \"Moreover, you don’t need to apply a loop-cycle in the event source script. That will seem as repeat of pushing messages to the client automatically.\".\nHow is this happening? \n\nThanks," ]
[ "javascript", "javascript-events" ]
[ "Handsontable 7.4 dropdown cell with falsy value (0) shows placeholder", "I am looking for a way to display the numeric value 0 in a dropdown list that also includes placeholder text when the cell is empty. Currently, if 0 is selected the placeholder text shows through. I'm hoping for a built-in option and I'd like to avoid casting the number to string and back if I can (that would tear up my current validation scheme). The following example is modified from the HandsOnTable dropdown docs. The 'Chassis Color' column contains the issue.\njsfiddle:\nhttps://jsfiddle.net/y3pL0vjq/\nsnippet:\n function getCarData() {\n return [\n ["Tesla", 2017, "black", "black"],\n ["Nissan", 2018, "blue", "blue"],\n ["Chrysler", 2019, "yellow", "black"],\n ["Volvo", 2020, "white", "gray"]\n ];\n }\n var\n container = document.getElementById('example1'),\n hot;\n hot = new Handsontable(container, {\n data: getCarData(),\n colHeaders: ['Car', 'Year', 'Chassis color', 'Bumper color'],\n columns: [\n {},\n {type: 'numeric'},\n {\n type: 'dropdown',\n placeholder: "blah",\n source: [null, 0, 1, 2, 3]\n },\n {\n type: 'dropdown',\n source: ['yellow', 'red', 'orange', 'green', 'blue', 'gray', 'black', 'white']\n }\n ]\n });" ]
[ "handsontable", "falsy" ]
[ "python appengine form-posted utf8 file issue", "i am trying to form-post a sql file that consists on many INSERTS, eg.\n\nINSERT INTO `TABLE` VALUES ('abcdé', 2759);\n\n\nthen i use re.search to parse it and extract the fields to put into my own datastore. The problem is that, although the file contains accented characters (see the e is a é), once uploaded it loses it and either errors or stores a bytestring representation of it.\n\nHeres what i am currently using (and I have tried loads of alternatives):\n\nform = cgi.FieldStorage()\nuFile = form['sql']\nuSql = uFile.file.read()\nlineX = uSql.split(\"\\n\") # to get each line\n\n\nand so on. \n\nhas anyone got a robust way of making this work? remember i am on appengine so access to some libraries is restricted/forbidden" ]
[ "python", "google-app-engine", "forms", "utf-8" ]
[ "Changing mutables inside Socketserver.handle() - Python 3.3", "I have a problem to change the data variable in the class NetworkManagerData. Everytime a request with 'SIT' comes to the server the variable 'master_ip' and 'time_updated' are updated. I have chosen a dictionary for my values as a container because it is mutable. But everytime i get a new request it has it old values in it.\n\nLike:\n\nFirst Request: \n>>False\n>>True\n\nSecond Request:\n>>False\n>>True\n\nThird Request without 'SIT':\n>>False\n>>False\n\n\nDo I have some missunderstanding with these mutables. Or are there some special issues with using dictionarys in multiprocessing?\n\nCode to start the server:\n\nHOST, PORT = \"100.0.0.1\", 11880\nnetwork_manager = NetworkManagerServer((HOST, PORT), NetworkManagerHandler)\n\nnetwork_manager_process = \n multiprocessing.Process(target=network_manager.serve_forever)\n\nnetwork_manager_process.daemon = True\nnetwork_manager_process.start()\n\nwhile True:\n if '!quit' in input():\n network_manager_process.terminate()\n sys.exit()\n\n\nServer: \n\nfrom multiprocessing import Lock\nimport os\nimport socketserver\n\nclass NetworkManagerData():\n def __init__(self):\n self.lock = Lock()\n self.data = {'master_ip': '0.0.0.0', 'time_updated': False}\n\n\nclass NetworkManagerServer(socketserver.ForkingMixIn, socketserver.TCPServer):\n def __init__(self, nmw_server, RequestHandlerClass):\n socketserver.TCPServer.__init__(self, nmw_server, RequestHandlerClass)\n self.nmd = NetworkManagerData()\n\n def finish_request(self, request, client_address):\n self.RequestHandlerClass(request, client_address, self, self.nmd)\n\n\nclass NetworkManagerHandler(socketserver.StreamRequestHandler):\n def __init__(self, request, client_address, server, nmd):\n self.request = request\n self.client_address = client_address\n self.server = server\n self.setup()\n self.nmd = nmd\n try:\n self.handle(self.nmd)\n finally:\n self.finish()\n\n def handle(self, nmd):\n\n print(nmd.data.get('time_updated')) # <<<- False ->>>\n\n while True:\n self.data = self.rfile.readline()\n\n if self.data:\n ds = self.data.strip().decode('ASCII')\n header = ds[0:3]\n body = ds[4:]\n\n if 'SIT' in header:\n\n # ... \n\n nmd.lock.acquire()\n nmd.data['master_ip'] = self.client_address[0] # <-\n nmd.data['time_updated'] = True # <-\n nmd.lock.release()\n\n # ...\n\n print(nmd.data.get('time_updated')) # <<<- True ->>>\n\n else:\n print(\"Connection closed: \" + self.client_address[0] + \":\" +\n str(self.client_address[1]))\n return\n\n\nThanks!" ]
[ "python", "multiprocessing", "immutability", "serversocket" ]