_id
stringlengths
2
6
text
stringlengths
4
46k
title
stringclasses
1 value
d2801
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 :...
d2802
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, ...
d2803
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...
d2804
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....
d2805
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...
d2806
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...
d2807
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...
d2808
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...
d2809
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...
d2810
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.
d2811
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
d2812
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 ...
d2813
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...
d2814
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> ...
d2815
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...
d2816
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...
d2817
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" ...
d2818
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() ...
d2819
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...
d2820
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...
d2821
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.
d2822
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 ...
d2823
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...
d2824
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...
d2825
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...
d2826
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...
d2827
If you allocate memory on the heap (with new) then it is valid until you explicitly delete it.
d2828
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);...
d2829
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...
d2830
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__.'/....
d2831
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...
d2832
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...
d2833
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...
d2834
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...
d2835
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...
d2836
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: ...
d2837
"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)
d2838
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()) { ...
d2839
<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()...
d2840
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...
d2841
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...
d2842
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, ); }
d2843
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...
d2844
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...
d2845
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...
d2846
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, ...
d2847
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...
d2848
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...
d2849
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 ...
d2850
".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})) });
d2851
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 ...
d2852
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...
d2853
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!
d2854
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 ...
d2855
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'...
d2856
* *Brackets (free) *VBSEdit (paid) *Systemscripter (paid)
d2857
* *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...
d2858
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...
d2859
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...
d2860
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...
d2861
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....
d2862
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...
d2863
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...
d2864
<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...
d2865
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...
d2866
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 ...
d2867
In this line request_uri: 'locations/show' in place of 'locations/show' try using '/locations/show.json' instead. Hope this one helps!
d2868
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...
d2869
for all statements you should do: ... if(event.target.currentFrame == 1 || event.target.currentFrame == 30) { gotoAndPlay(31); } ....
d2870
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...
d2871
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...
d2872
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...
d2873
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...
d2874
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 ...
d2875
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...
d2876
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...
d2877
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 ...
d2878
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...
d2879
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...
d2880
Fixed the problem. I needed to set the Label's AutoSize property to true.
d2881
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...
d2882
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...
d2883
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...
d2884
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 ...
d2885
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.
d2886
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...
d2887
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...
d2888
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...
d2889
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...
d2890
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...
d2891
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); } ...
d2892
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 ...
d2893
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...
d2894
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> ...
d2895
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...
d2896
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/
d2897
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...
d2898
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}...
d2899
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 =...
d2900
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...