_id
stringlengths
2
6
partition
stringclasses
3 values
text
stringlengths
4
46k
language
stringclasses
1 value
title
stringclasses
1 value
d2801
train
To catch the focused input when clicking a button, you have to listen to the mousedown event as it fires before the input loses focus. The click event is too late, the input has already lost focused by that time. To get the currently focused (active) element, one can use document.activeElement. So something like this :...
unknown
d2802
train
You can't return a cfform, because tags can't be used inside of a CFScript based component. You're far better off doing something like this with a custom tag, which then references your component to get pieces to build out the form. I would avoid (if at all possible) putting any cfform related pieces into a component, ...
unknown
d2803
train
You are using three params instead of two, use it like this. //Handle post register req. at '/register' app.post("/register", function(req, res) { User.register(new User({ username: req.body.username, password: req.body.password }), function(err, user) { if(err) { con...
unknown
d2804
train
I'd suggest you wrapping what you have used to get the update in a function then do the function call after you hit the success method after submitting the form... In your js for example: $(document).ready(function(){ $("#contactForm").submit(function(e){ // prevent from normal form behaviour e....
unknown
d2805
train
You can use the following functions to sanitize user inputs. Custom regex functions might have some corner cases. sanitize --------- htmlspecialchars(filter_var($string, FILTER_SANITIZE_STRING), ENT_QUOTES, 'UTF-8'); wordsanitize ------------ $string = preg_replace('~\W+~', '', $string); htmlspecialchars(filter_v...
unknown
d2806
train
Fixed it by using a shiny server version of the docker - not sure why but this sorted out some connection issue. Dockerfile: FROM rocker/r-ver:3.6.3 RUN apt-get update --allow-releaseinfo-change && apt-get install -y \ lbzip2 \ libfftw3-dev \ libgdal-dev \ libgeos-dev \ libgsl0-dev \ libgl1-me...
unknown
d2807
train
There is another way to create your custom AWS resources when localstack freshly starts up. Since you already have a bash script for your resources, you can simply volume mount your script to /docker-entrypoint-initaws.d/. So my docker-compose file would be: localstack: image: localstack/localstack:latest conta...
unknown
d2808
train
It works for me: "no-underscore-dangle": ["error", { allow: ["_id"] }] If you are using the @typescript-eslint/naming-convention rule, you may also need to add this: "@typescript-eslint/naming-convention": [ "error", { selector: ["variable"], format: ["strictCamelCase", "PascalCase", "UPPER_CASE"], fil...
unknown
d2809
train
You should looks to Celery project. It allows to schedule delayed function calls (after response generated). So you can read that file to a variable and schedule task to remove that file. # views.py def some_view(request): zipdir = condown(idx)#condown creates zip file in zipdir logging.info(os.path.basename(zi...
unknown
d2810
train
myAudio.source = "Sounds/Impact_1.mp3"; This is incorrect. You want the src property: myAudio.src = 'Sounds/Impact_1.mp3'; Additionally, you don't need .load() before .play() like that. And, ensure that you're calling .play() on a user action so that you don't run afoul of autoplay policies.
unknown
d2811
train
It looks like valid json. Use jq. Replace my echo with your curl: $ echo '{"@odata.context":"h...","value":"_tlCijtcSZG0CNTl_cnFxmkz2rjbQtSJQ"}' \ | jq -r .value _tlCijtcSZG0CNTl_cnFxmkz2rjbQtSJQ In other words, just do curl ... | jq -r .value > /output/path
unknown
d2812
train
Even though you are developing locally, the assets still need to be delivered securely and pass the CORS policy to load in a-frame. Your scene is most likely throwing some errors related to not being able to load that file securely, timing out in the process. Ideally you would want to load that gltf file via the asset ...
unknown
d2813
train
The following code will present the UIImagePickerController in a way that resembles the screenshot given. UIImagePickerController *eImagePickerController = [[UIImagePickerController alloc] init]; eImagePickerController.delegate = self; eImagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; eImag...
unknown
d2814
train
If you can guarantee that the input XML will only have single digits, you could achieve this with simple look-up tables, which return the name of either the cardinal number (one, two, three, etc) or the ordinal form of the number (Half, Third, Fourth, etc) <ref:cardinals> <ref:cardinal>One</ref:cardinal> ...
unknown
d2815
train
Cake means the result of the successfully called promise, in this example they probably want to mean the cake result, and the cake result is a "black forest". You could write it like this jeffBuysCake3('black forest') .then(result => console.log(result)) .catch(error => console.log(error)) and the result is going to b...
unknown
d2816
train
You cannot browse any files on iOS device. You have to update your app to say what type of files it can edit/read. Then another app would have to share that file. When that source app shares a file type tht your app accept, it would listed as a destination the user can select. A: Asper my knowledge because of the sec...
unknown
d2817
train
I'm not quite sure what you're looking for, but I think sweep function fits well for your goal. Try: result <- sweep(test, c(2,3,4), colSums(test), FUN='/') Where test is the array created by @user2068776. dimnames are preserved. dimnames(result) $a [1] "a1" "a2" $b [1] "b1" "b2" $c [1] "c1" "c2" $d [1] "d1" "d2" ...
unknown
d2818
train
Here should be a complete code public static String[][] CPUship(String[][]board3){ int rowGenerate; int colGenerate; for (int CPUships = 0; CPUships < 6; CPUships++) { boolean valid2=false; while (!valid2){ //instead of valid = false " rowGenerate = (int) ( 9* Math.random() ...
unknown
d2819
train
There might be different reasons for OOM exception. One reason readily comes to my mind is is setting AUTO_READ option on the channel. The default value is true. you can get more information about this in stack overflow posts here and here If setting AUTO_READ option doesn't help, netty provides an option to check if a...
unknown
d2820
train
server.js const express = require('express') const mongoose = require('mongoose') const Shipment= require('./models/shipment') const app = express() mongoose.connect('mongodb://localhost/myFirstDatabase ', { useNewUrlParser: true, useUnifiedTopology: true }) app.set('view engine', 'ejs') app.use(express.urlencode...
unknown
d2821
train
The expression mentioned in the question works. Just make sure that you have included the "example.nzb" file within your project and also make sure that you restart the REPL.
unknown
d2822
train
CS = Case Sensitive CI= Case Insensitive you need to have one or the other. AS = Accent sensitive, AI = Accent Insensitive. These codes specify how to sort. You need to select CI or CS and AS or AI https://msdn.microsoft.com/en-us/library/ms143726.aspx A: You can use the SQL replace function to remove instances of ...
unknown
d2823
train
Shell expansion does not happen in Dockerfile ENV. Then workaround that you can try is to pass the name during Docker build. Grab the filename during build name and discard the file or you can try --spider for wget to just get the filename. ARG FULLNAME ENV FULLNAME=${FULLNAME} Then pass the full name dynamically duri...
unknown
d2824
train
Microsoft has answered this question on this thread as follows: Hi All · Thank you for reaching out. There seems to be an issue with the UI. I will report the issue to the product team and get it addressed. However, as of now, you can follow below steps and use PowerShell to add application to the User Administrator ro...
unknown
d2825
train
You need to have access to cellid to lat/lng db from mobile network operator to get lat/long of your device. Other way of getting this is by using location apis provided by android, iphone etc. A: Signal Strength could possibly give you an indication of how far from a tower you are, thus improving accuracy What platfo...
unknown
d2826
train
You have to rethink the design. addition.py: import Main def addStock(): # The 2 last lines Main.choices() return shipCost A module is a library of reusable components, so they can not depend on some "Main", they must work anyhere, specially on unit tests. Also, you call addition.addStock() in Main.choices...
unknown
d2827
train
If you allocate memory on the heap (with new) then it is valid until you explicitly delete it.
unknown
d2828
train
Refer to previous answer, ng-click = "alert('Hello World!')" will work only if $scope points to window.alert i.e $scope.alert = window.alert; But even it creates eval problem so correct syntax must be: HTML <div ng-click = "alert('Hello World!')">Click me</div> Controller $scope.alert = function(arg){ alert(arg);...
unknown
d2829
train
My preffered method is to upload the video to YouTube and place it on your site using their embed code which is an iframe tag. This provides the benefit of your users using YouTube's bandwidth when they are watching the video rather than yours. Alternatively you could look at using the HTML5 VIDEO tag. http://www.w3sch...
unknown
d2830
train
You should use relative includes from their own file, otherwise, it will run from the current path. To force this you can use __DIR__ and start with a slash plugin.php function process(){ include_once(__DIR__.'/processes/process.php' ); } add_action('wp_ajax_process', 'process' ); process.php include_once(__DIR__.'/....
unknown
d2831
train
Since the modules and dependencies (AMD) are working fine on browser I assume the shims config are correct . That's an incorrect assumption. The problem is that Node.js operates with a set of basic assumptions that are very different from how browsers work. Consider this statement: var foo = "something"; If you execu...
unknown
d2832
train
This type of formatting is tricky. You need to pay attention to the white spaces when the parse=TRUE is used. To format the text you need proceed in two steps of pasting. Let's create a simple reproducible example: ggData <- data.frame(x=rnorm(100), y=rnorm(100) ) I recommend you to store the text AND the correlation...
unknown
d2833
train
You just pass the function as a value. E.g.: let apply_twice f x = f (f x) should do what you expect. We can try it out by testing on the command line: utop # apply_twice ((+) 1) 100 - : int = 102 The (+) 1 term is the function that adds one to a number (you could also write it as (fun x -> 1 + x)). Also remember tha...
unknown
d2834
train
The error was caused that capacity was 0 value (which might not allow from math divide), if your expected result is 0 when capacity is 0 from occupancy/capacity AVG((COALESCE(occupancy / NULLIF(capacity,0), 0) * 100)) Edit You can try to use CASE WHEN expression to judge the value whether zero then return NULL AVG(CAS...
unknown
d2835
train
I have only made some improvements in regards to the views, I haven't looked at the models. * *First you should change from the generic generic.View to generic.CreateView since you are creating stuff. *When deriving from generic.CreateView you can move out the template_name and context from the functions and put th...
unknown
d2836
train
Here you can find pre-release builds using MinGW 4.7. http://releases.qt-project.org/digia/5.0.1/latest/ They work well with the MinGW builds distributed here: http://sourceforge.net/projects/mingwbuilds/ The Qt builds come with Qt Creator, so you can install it and should be good to go after setting up your kits. A: ...
unknown
d2837
train
"Z" is kind of a unique case for DateTimes. The literal "Z" is actually part of the ISO 8601 DateTime standard for UTC times. let x = new Date(); let gmtZone = x.toGMTString(); console.log(gmtZone)
unknown
d2838
train
On real device, you can't see these folders if it's not rooted. see this question. If you want to write files in your app directory, then your code is OK. You can check that it is there in the same way you created it - from your application: File myFile = new File(getFilesDir() + "/test1.txt"); if (myFile.exists()) { ...
unknown
d2839
train
<script type="text/javascript"> window.fbAsyncInit = function() { FB.init({appId: 'your apikey', status: true, cookie: true, xfbml: true}); FB_RequireFeatures(["CanvasUtil"], function(){ FB.XdComm.Server.init("xd_receiver.htm"); FB.CanvasClient.startTimerToSizeToContent()...
unknown
d2840
train
See here or here on how to delete by query. In Elasticsearch 2.*, you might find the Delete by Query plugin useful. A: Deleting "types" is no longer directly supported in ES 2.x A better plan is to have rolling indexes, that way deleting indexes older than 7 days becomes very easy. Take the example of logstash, it cr...
unknown
d2841
train
For starters, the difference between static and instance variables is that, only ONE static variable exists for all the instances of the class, whereas an instance variable exists for EVERY instance of the class. Now, when you are talking about methods, in most cases you need to make a method static when you are trying...
unknown
d2842
train
Since last two years I have been using this divider code below. It working well for all platforms. To fix your issue, provide your code. Widget commonDividerWidget(Color color) { return Divider( thickness: 1.0, color: color, ); }
unknown
d2843
train
Try this code setInterval(function(){ reloadIFrame2(); }, 5000); function reloadIFrame2() { var elements = document.getElementsByClassName("idcw"); for (var i = 0, len = elements.length; i < len; i++) { elements[i].src = elements[i].src; } } <iframe class="idcw" src="http://web.ubercounter.com/ch...
unknown
d2844
train
When you do Debug->Attach to Process you'll see that VS displays a list of processes and along with them it displays the types of code that you can debug which are running in those processes. To get this information VS queries the various installed debug engines. So when we get queried we go and inspect a bunch of pr...
unknown
d2845
train
Use filter_var functions. // url filter_var($url, FILTER_VALIDATE_URL) // email filter_var('me@example.com', FILTER_VALIDATE_EMAIL) A: Except in some very particular cases you should never 'sanitize' input - only ever validate it. (Except in the very particular cases) the only time you change the representation o...
unknown
d2846
train
I can't figure out what you think is wrong with your approach, but here is the code I was using to test with: class Program { static void Main(string[] args) { RAMDirectory dir = new RAMDirectory(); IndexWriter writer = new IndexWriter(dir, new StandardAnalyzer()); AddDocument(writer, ...
unknown
d2847
train
This sounds like a problem that can be solved using a writable store. Stores (if you don't know) are essentially storage for things such as variables and other data which apply across all your components (if imported from your stores file). The documentation can be found here: https://svelte.dev/tutorial/writable-store...
unknown
d2848
train
In the ctor: Populating m_w: up to (m_N-1) for (int i(0); i < m_N; ++i) { m_pt.push_back(QPointF(mesureList[i]->getX(), mesureList[i]->getY())); m_w.push_back(mesureList[i]->getAngle()); } Later: accessing m_w[m_N], beyond the end of the vector for (i = m_N; i >= 0; --i) { sum = m_w[i]; for (j = i+1; j...
unknown
d2849
train
My recommendation would be to use an MSI based installer instead of trying to roll your own using Windows Forms. Look into using the Windows Installer XML (WiX) toolset which is a popular free open source toolset for creating installers. Using MSI has many advantages, in particular it makes it fairly difficult to mix ...
unknown
d2850
train
".pipe(cmq())" should be before ".pipe(gulp.dest())" gulp.task('sass', function() { return gulp.src("./*.scss") .pipe(sass()) .pipe(cmq()) .pipe(gulp.dest(".css/")) .pipe(reload({stream: true})) });
unknown
d2851
train
It sounds like you're talking about a library that will be used by other applications. You can't (thankfully!) modify the standard library this way - otherwise just importing a package could have incredibly broad and potentially disastrous side-effects. If you want to apply some special hardware-specific optimizations ...
unknown
d2852
train
I was able to devise a sort of hacky solution since the import system throws an ImportError if something is imported and sys.modules has a None in it: class hide_module_2: def __enter__(self): self.module_2 = sys.modules.get('module_2') sys.modules['module_2'] = None def __exit__(self, exc_t...
unknown
d2853
train
Thanks @molbdnilo I made a stupid mistake that I forgot to include the SFML header in "block.h" #include <SFML/Graphics.hpp> Now problem solved! Thanks for all advices. I am new to C++ projects, please feel free to speak out all my bad practices in the code. Very helpful!
unknown
d2854
train
This is why the warning exists: When the value is specified as undefined, React has no way of knowing if you intended to render a component with an empty value or if you intended for the component to be uncontrolled. It is a source of bugs. You could do a null/undefined check, before passing the value to the input. a ...
unknown
d2855
train
Before calling the view, print_r($report['savings']); With above code are you getting any result?? A: just try it <?php if(isset($savings) && count($savings) > 0) { foreach($savings as $vs) { echo $vs['username']; echo $vs['stype']; echo $vs['inst_name']; echo $vs['acc_name'...
unknown
d2856
train
* *Brackets (free) *VBSEdit (paid) *Systemscripter (paid)
unknown
d2857
train
* *1.0 / (pow(x,2) + pow(y,2)) *sqrt(pow(b,2) - 4*a*c) See pow() and sqrt() functions manual. You can also write x*x instead of pow(x, 2). Both will have the exact same result and performance (the compiler knows what the pow function does and how to optimize it). (For commenters) GCC outputs the exact same assembler...
unknown
d2858
train
Try: df = df1.merge(df2, on='ID', how='left') df[['NAME', 'EMAIL', 'ROLE-ID']] It gives the following: Screenshot A: You did not exactly state what should happen if id is not found or is avail multiple times this may not be 100% what you want. It will leave the id untouched then.B ut guess otherwise its what you want...
unknown
d2859
train
CPython implementation detail: In CPython, due to the Global Interpreter Lock, only one thread can execute Python code at once (even though certain performance-oriented libraries might overcome this limitation). If you want your application to make better use of the computational resources of multi-core machines, you a...
unknown
d2860
train
You are really close my friend. Just a little tweak and you will get what you are looking for Category.select('parents_categories.name as parent_category, categories.name as category').joins(:parent).as_json(except: :id) Note if you have belongs_to :parent, parent cannot be named as selected key so we need to change i...
unknown
d2861
train
To add to other answers, consider that any function exposed through a shared object or DLL (depending on platform) can be overridden at run-time. Linux provides the LD_PRELOAD environment variable, which can specify a shared object to load after all others, which can be used to override arbitrary function definitions....
unknown
d2862
train
EclEmma - is Eclipse plugin based on Java Code Coverage Library called JaCoCo that performs analysis of Java bytecode. Description of coverage counters provided by JaCoCo can be found in its documentation. As you can see in it - JaCoCo and hence EclEmma provide * *instructions coverage *branch coverage *line cover...
unknown
d2863
train
SELECT * FROM Playlist WHERE NOT EXISTS ( SELECT NULL FROM PlaylistTrack INNER JOIN Track USING (TrackId) INNER JOIN Genre USING (GenreId) WHERE Playlist.PlaylistId = PlaylistTrack.PlaylistId AND Genre.Name IN ('Latin', 'R...
unknown
d2864
train
<video autoplay loop> <source src="movie.mp4" type="video/mp4" /> <source src="movie.ogg" type="video/ogg" /> </video> You mean this? A: You’ll need to mute the video (adding the muted attribute on the <video> tag) as videos with sound don’t autoplay in all browsers. Then also add the attributes autoplay and play...
unknown
d2865
train
I've found you just need to pipe echo "no" into avdmanager create then start the emulator. Something like this: echo "y" | sdkmanager "system-images;android-31;google_apis_playstore;x86_64" echo "no" | avdmanager create avd -n MyEmulator -k "system-images;android-31;google_apis_playstore;x86_64" emulator64-arm -avd MyE...
unknown
d2866
train
It redirects you to outlook mostly because you click on mailto: link. You can connect to smtp server to send e-mail via php. Here you will find how to do it You don't need FTP which is file transfer protocol you need connection to SMTP which is Simple Mail Transfer Protocol. Also check PHP manual If you doesn't want ...
unknown
d2867
train
In this line request_uri: 'locations/show' in place of 'locations/show' try using '/locations/show.json' instead. Hope this one helps!
unknown
d2868
train
Here: void add(std::vector<T> new_vec) { vv.push_back(&new_vec); } You store a pointer to the local argument new_vec in vv. That local copy will only live till the method returns. Hence the pointers in the vector are useless. Dereferencing them later invokes undefined behavior. If you really want t...
unknown
d2869
train
for all statements you should do: ... if(event.target.currentFrame == 1 || event.target.currentFrame == 30) { gotoAndPlay(31); } ....
unknown
d2870
train
When you call via callSIP, you make a call to a 3rd-party PBX. If the PBX allows calling to phone numbers, yes, you can do it, but you need to find out what format the PBX accepts. In most cases, you can specify the number in the To field in the username part of the SIP address, for example: number_to_call@domain. Alte...
unknown
d2871
train
Hope this will help you! Paste the following code in your activity. ArrayList<Object> imagearraylist = (ArrayList<Object>) getIntent().getSerializableExtra("Arraylist"); Reference: How to pass ArrayList<CustomeObject> from one activity to another? A: Use Interface Like Mentioned In Link Passing Data Between Fragment...
unknown
d2872
train
You can find everything you need to know in the Asset Pipeline Rails Guide. A: Caching is a related, but separate topic. The purpose of compiling assets includes the combining and minimizing of assets, e.g. javascript that is all on 1 line with 1 letter variables, as opposed to the originals which are used in developm...
unknown
d2873
train
Try the following, using regex_search the if/else can be written in shorter and cleaner format. "{{ developmenthosts if ( ansible_hostname|regex_search('dev|tst|test|eng') ) else productionhosts }}" Example: --- - name: Sample playbook connection: local # gather_facts: false hosts: localhost vars: develo...
unknown
d2874
train
Your setup is complete with a wsdl file and a couple of xsd files. The reason you're having that problem is because the link 'http://localhost/DService/AllService.svc?xsd=xsd0'. is broken. The solution is to search the folder that has the xsd files for AllService . To make it easier, place all the files in a single ...
unknown
d2875
train
Can you try this? SELECT [id] ,[timestamp] ,[current load count] ,LAG([current load count]) OVER (ORDER BY [timestamp] ASC, [id]) AS [previous load count] FROM [table] The LAG function can be used to access data from a previous row in the same result set without the use of a self-join. It is availa...
unknown
d2876
train
In the default style of Button, there is a ContentPresenter control to display the content of Button, it uses HorizontalContentAlignment property to control the horizontal alignment of the control's content. The default value is Center. So if you want to put the image in the right of Button, you can change the Horizont...
unknown
d2877
train
I dont claim to be an expert on REST but here is what I would probably do. In your domain model, if a resource cannot exist without a user then its perfectly OK to model URL calls such as GET /user/{userId}/resource //Gets all resources of a user On the other hand if resources can exist without users then this link ...
unknown
d2878
train
You can use awk or vim macro. awk is really great for such text manipulation awk '{count++; print count " " $2 " "$3;}' data.stat > /tmp/data.stat && mv /tmp/data.stat data.stat A: in Vim: :let i=1 | g/^[^/\t]*\t/s//\= i. "\t"/ | let i=i+1 Reference Update For splitting the first two columns and saving into another...
unknown
d2879
train
If you aim to manipulate your actions before handle them you can use beforeAction in your controller/component, with something like this: protected function beforeAction($action) { #check a preg_match on a url sanitization pattern, like "[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]", for instance return parent...
unknown
d2880
train
Fixed the problem. I needed to set the Label's AutoSize property to true.
unknown
d2881
train
According to the documentation you can use options to define the type of loading you want. I believe it will override your default value defined in your relationship Useful links Joined Loads Select Loads Lazy Load A: So, basically, if you are using lazy=' select', lazy load, and want to switch to joinedload to optimi...
unknown
d2882
train
Loosely speaking, if the purpose of your method is to retrieve data from the server use GET. e.g. getting information to display on the client. If you are sending data to the server use POST. e.g. sending information to the server to be saved on a database somewhere. There is a limit to the size of data you can send to...
unknown
d2883
train
No, you send the data however you like but keep in mind how you send it will affect how you can retrieve it. Also you aren't sending JSON in your request as .serialize() does not return JSON it returns a text string in standard URL-encoded notation. A: No, you don't need to send it as JSON. You can send it in any oth...
unknown
d2884
train
Git's merge operation considers exactly three points when doing a merge: the two heads (usually branches) that you want to merge, and the merge base, which is usually the point at which one was forked from the other. When a merge occurs, Git considers the changes computed between each head and the merge base. It then ...
unknown
d2885
train
Of course jewelsea already answered that question here. Just the topic of the question was little misleading, but it works the same way for TreeTableView.
unknown
d2886
train
To answer your question: To use that code you've got to download the Managed Task Scheduler Wrapper first. Then to make it run with administrative privileges you've got to set the RunLevel to TaskRunLevel.Highest on your TaskDefinition: td.Principal.RunLevel = TaskRunLevel.Highest However like Plutonix says you shoul...
unknown
d2887
train
You are making things too complex for yourself. Why do you first find then again find and then update? Simply go with the following flow Update using filter Code Sample: exports.updateToken = async (id, forgotToken) => {//function return User.updateOne({ _id: id }, { resetPasswordToken: forgotToken });//_id:id is a fi...
unknown
d2888
train
This isn't really a problem - the different renderers are rendering the report appropriately for their output. The web viewer is optimised for screen-based reading and generally allows more content per page than the PDF viewer does as the PDF viewer is constrained by the paper size that it formats to. Thus you get more...
unknown
d2889
train
From the $http documentation you can clearly see request parameters: https://docs.angularjs.org/api/ng/service/$http var req = { method: 'POST', url: 'http://example.com', headers: { 'Content-Type': undefined }, data: { test: 'test' } } $http(req).then(function(){...}, function(){...}); So, in your case you n...
unknown
d2890
train
Get a tool like Firebug for Firefox and learn to use it. It makes finding issues like this simple. The answer is clear, once you have the right tool: the gradient, which is applied to the body element, does not extend all the way down because the body element does not go the full height of the browser. Add: html, body...
unknown
d2891
train
Generics are made for this: class Foo { bar = this.createDynamicFunction((param: string) => { return "string" + param; }); baz = this.createDynamicFunction((param: number) => { return 1 + param; }); createDynamicFunction<Type>(fn: (param: Type) => Type) { return (param : Type) => fn(param); } ...
unknown
d2892
train
My first thought would be to profile the application on the machines you're seeing the leak with something like Red Gate's Memory Profiler. It'll be a lot more reliable than attempting to guess what the leak might be. As for chosing the right technology, if all your machines will have .NET 3.5 installed you might want ...
unknown
d2893
train
my problem is an error 415, i don´t know why is saying the payload is not supported In your Angular client side code, we can find that you set {headers: new HttpHeaders({'Content-Type': 'json'})}, which cause the issue. You can set Content-Type with application/json, like below. this.httpClient .post( config.Url...
unknown
d2894
train
So I just have to create them in a certain order so at the moment they are created, the PID of the process they will send a signal is already created? Right - in particular H4 has to be forked before H3/N3, so that H4 is known to N3. Demo: #include <signal.h> #include <stdlib.h> #include <stdio.h> #include <errno.h> ...
unknown
d2895
train
By default Express Checkout is for PayPal accountholder payments; originally you would pair this with some other product for credit card payments (such as collecting the card information on your site and calling PayPal DirectPay or some other card processing partner). PayPal also has several somewhat-similar products t...
unknown
d2896
train
No, afraid not. You can either try to find a library / sample code in C/C++/ObjC that will generate a vCard from provided information, or attempt to roll your own. You can find more information about vCard including the specs here; http://www.imc.org/pdi/
unknown
d2897
train
I was able to replicate your problem like this: mysql> create table `index` (url varchar(50)); Query OK, 0 rows affected (0.05 sec) mysql> insert into index(url) values ('http://www.google.com'); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version fo...
unknown
d2898
train
I think the following regexp fit the job. Howevever you don't have to have nested curly bracket (nested curly bracket can't be parsed using regular expression as far as I know) >>> s= "{abc, xyz}, 123, {def, lmn, ijk}, {uvw}, opq" >>> re.findall(r",?\s*(\{.*?\}|[^,]+)",s) ['{abc, xyz}', '123', '{def, lmn, ijk}', '{uvw}...
unknown
d2899
train
Here's the full code Sub test() ' Open the text file Workbooks.OpenText Filename:="C:\Excel\test.txt" ' Select the range to copy and copy Range("A1", ActiveCell.SpecialCells(xlLastCell)).Select Selection.Copy ' Assign the text to a variable Set my_object = CreateObject("htmlfile") my_var =...
unknown
d2900
train
DateTime.Now itself may take too much time being calculated, you'll be better off using a System.Diagnostics.Stopwatch. Something like this: Stopwatch stopwatch = new Stopwatch(); int counter = 0; public void OnSensorChanged(SensorEvent e) { if (!stopwatch.IsRunning) { // start the stopwatch st...
unknown