Tuesday, October 31, 2017

How to add C/C++ language service to a Visual Studio-based application?

Leave a Comment
I am trying to create a domain specific IDE based on Visual Studio shell. I followed the walk-through to create a basic Isolated Visual Studio Shell Application. Then I started the basic shell application and drag a C file into it. There's no syntax highlighting because no language service is included yet. I found the GUIDs for various Visual Studio feature packages. I was expecting some kind of language feature package for C/C++ listed there so I can just add it into my IDE's feature list. But there's not. So how can...
Read More

How to convert a file to UTF-8 in php?

Leave a Comment
Is it possible to convert a file into UTF-8 on my end? If I have an access on the file after the submission with $_FILES['file']['tmp_name'] Note: The user can upload a CSV file with any kind of charset, I usually encounter an unknown 8-bit charset. I try $row = array(); $datas = file($_FILES['file']['tmp_name']); foreach($datas as $data) { $data = mb_convert_encoding($data, 'UTF-8'); $row[] = explode(',', $data); } But the problem is, this code remove special characters like single quote. My first question...
Read More

Flexdashboard/plotly interaction results in odd scroll bar behavior

Leave a Comment
I have a bizarre and very frustrating problem. When I build plotly graphs within storyboards (from the flexdashboard package), I get a very annoying and totally unnecessary scroll bar in my legend. When someone tries to click one of the dots on or off, the scroll bar twitches and its practically impossible to click the thing. This scroll bar only appears when the tab with the plotly graph is not immediately visible during the load of the page - i.e. if the page loads with some other tab selected. I can make the same graph...
Read More

RequireJS effecting an embedded jquery-ui widget

Leave a Comment
I have a jQuery widget that are partner is trying to embed. The problem we are getting is the partner is using requireJS and its effecting the widget. The widget is in an anonymous function and requires jquery-ui within. After debugging we have found that jQuery UI is being removed after the noConflict call. Here is the code from the widget. (function () { // Localize jQuery variable var jQueryWidget; /******** Load jQuery if not present *********/ if (window.jQuery === undefined || window.jQuery.fn.jquery...
Read More

Starting Kivy service on bootup (Android)

Leave a Comment
I'm trying to start my kivy app's service on bootup. I'm sure that my service is ok because it works when I start my app. But on bootup I have a problem. I've read this article and tried to make it: package net.saband.myapp; import android.content.BroadcastReceiver; import android.content.Intent; import android.content.Context; import org.kivy.android.PythonActivity; public class MyBroadcastReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { Intent ix = new Intent(context,...
Read More

Swift websockets not accepting client certificate

Leave a Comment
I am working on a project that requires client certificate support with websockets. I am currently using Starscream, however unfortunately from reading the documentation, it does not seem to have any information regarding support for this. I have looked around at few other swift web socket libraries, but none of them mention support for this Does anyone know of any libraries that support such functionality? Any information would be much appreciated!! Edit: So I am currently using Starscream to try this. I have got the...
Read More

Lost context in object

Leave a Comment
I have this code: /// global context function Outer(){ /// Outer context this.print = function(){ console.log("1: "+this) inside(); /// "this" is bound to the global object. Why not bound to the Outer object? function inside(){ console.log("2: "+this) } }; } function print(){ console.log("3: "+this); } var obj = new Outer; obj.print(); /// "this" is bound to the Outer object. print(); /// "this" is bound to the global object. Why inside the method call,...
Read More

Cannot build for android using react-native

Leave a Comment
I'm trying to run react-native run-android but I continuously get this error.I am running on emulator . I started the app using react-native init. PS: I am running on proxy. When I am trying to run react-native run-android I get: FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'AwesomeProject'. > Could not resolve all dependencies for configuration ':classpath'. > Could not resolve com.android.tools.build:gradle:2.2.3. Required by: :AwesomeProject:unspecified...
Read More

Monday, October 30, 2017

What is the difference between isset() and __isset()?

Leave a Comment
I need to know about magic function __isset() and normal function isset(). Actually what is the real difference between php language construct isset() and php magic method __isset() ? When I google it they told that __isset() is a magic function. What are difference between common php functions and magic functions in php? 7 AnswersAnswers 1 isset() It is a language construct that checks the initialization of variables or class properties: $a = 10; isset($a); // true isset($a, $b); // false class Test { ...
Read More

GLSL: Can I combine MRT, ssbo and imageAtomic operations in the same shader (pass)?

Leave a Comment
A 2-pass rendering system in OpenGL is using an MRT shader that is bound to 2 framebuffer textures tex1 and tex2. The goal of the mrt pass is to compute the overdraw in the scene and render it out in a gather pass. I use the framebuffer textures to pass on the result. It also has a working ssbo buffer that is quite large (and using a fixed screen resolution) and takes ages to link, but I can use it to do atomicAdds. What I am trying to accomplish is to replace this with imageAtomicAdd operations on a uiimage2D, just like...
Read More

Unable to select Bootstrap dropdown in Java Selenium

Leave a Comment
I'm having a very difficult time selecting bootstrap dropdown in Selenium. I'm new to Selenium so any suggestion and guidance would be very helpful, as what I'd love to do is just select the dropdown, type "email", and press enter during the instance. I've gone through dozens of solutions, but none of them have worked for this specific issue. What can I do? Please help. Salenium package newPackage; import org.openqa.selenium.By;...
Read More

Running TensorFlow on multicore devices

Leave a Comment
I have a basic Android TensorFlowInference example that runs fine in a single thread. public class InferenceExample { private static final String MODEL_FILE = "file:///android_asset/model.pb"; private static final String INPUT_NODE = "intput_node0"; private static final String OUTPUT_NODE = "output_node0"; private static final int[] INPUT_SIZE = {1, 8000, 1}; public static final int CHUNK_SIZE = 8000; public static final int STRIDE = 4; private static final int NUM_OUTPUT_STATES = 5; ...
Read More