input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
How to get the return value of the start rule <p>How to get the 'return' value (<code>$$</code> variable) of the start rule of a grammar with Yacc/Bison?</p>
<p><code>yyparse</code> return the error code of the parser.</p>
| <p>The easiest solution is to store the value in an additional argument to <code>yyparse</code>. Normally you will store this value in the action for your start rule; sometimes it is useful to define an extra start non-terminal with a unit production to hold the action.</p>
<p>If you're using bison, you can use the <a... |
Moving a Team Project from one Collection to another - TFS 2015 Update 3 <p>I'm trying to move a Team Project from one Team Collection to another, including check-in history, user stories and source code. </p>
<p>I'm running a TFS 2015 Update 3 setup, but the tools I found do not support this version.</p>
<p>Tools:</... | <p>As @Daniel mentioned in comment, there's no way to move team projects between collections other than by using third party tools. But this feature is under planned, you can track this <a href="https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/2037613-make-it-possible-to-move-a-team-project-be... |
SignalR performance counters in Azure Web App <p>I've been trying to load test SignalR on my Azure Web App service (E.g. how many connections it can handle before subscribe calls to the hub start failing). I found that SignalR perfomance counters (<a href="https://www.asp.net/signalr/overview/performance/signalr-perfor... | <p>Performance Counters <a href="http://stackify.com/top-3-azure-web-app-limitations/" rel="nofollow">can't be installed on Azure Web App</a>, as it is provided as a managed container and <strong>not</strong> a full fledged IIS on which you can do everything.</p>
<p>To be able to use these performance counters you can... |
An application says Microsoft.jet.Oledb 4.0 provider is not registered on the local machine <p>I'm.not the developer of that application. I'm the user , I downloaded an application 64bit as they directed . When I try to open the application it says the error Microsoft.Jet.OLEDB4.0 provider not registered on the local m... | <p>Try downloading Microsoft Access Database Engine.</p>
|
Perfect Square function that doesn't return <p>I'm a beginner working with Python and I was given this task: <em>write a function which returns the highest perfect square which is less or equal to its parameter (a positive integer).</em></p>
<pre><code>def perfsq(n):
x = 0
xy = x * x
if n >= 0:
... | <p>Like Patrick Haugh says, try examining when the while loop exits. It can be helpful to put print() statements throughout your method to figure out how your method executes. In order to figure out when your loop exits, look at the exit condition of your while loop: xy < n. </p>
<p>Remember, a variable isn't updat... |
Javascript .onclick function to redirect to other page <p>Hi i'm trying to validate user typing some data and then redirect the user to other web page, the alerts works nice but the location.href is doing nothing, please help.</p>
<pre><code>window.onload = function(){
var send = document.getElementById('send');
... | <p>I changed your code to this and got it working just fine:</p>
<pre><code>window.onload = function(){
var send = document.getElementById('send');
var email = document.getElementById('email');
var pass = document.getElementById('pass');
send.onclick = function(){
var data1 = email... |
Windows10 .exe ICON is missing <p>I'm trying to fix Windows context menu slow issue, right click menu is very slow.</p>
<p>I've done below steps:</p>
<ol>
<li><p>Using ShellExView to disable some external items, no Microsoft item is disabled.</p></li>
<li><p>Remove HKEY_CLASSES_ROOT\Directory\Background\shellex\Conte... | <p>Manually fixed the issue by extracting icon from exe file then use extracted icon.
Seems like icon cache is broken.</p>
|
How does wpf raise mouseDown event? <p>How does wpf raise mouseDown event? As I understand, wpf should perform some kind of hit test method, which should call specified mouse down handler. Unfortunately, I cannot find this piece of code in source of WPF. Can anybody point me to right place? </p>
<p>As I understood, Vi... | <p>Start here: <a href="https://msdn.microsoft.com/en-us/library/ms752097(v=vs.110).aspx" rel="nofollow">Hit Testing in the Visual Layer</a>.
And in particular check this: <a href="https://msdn.microsoft.com/en-us/library/system.windows.uielement.inputhittest(v=vs.110).aspx" rel="nofollow">UIElement.InputHitTest</a>.</... |
Convert character dates with NA into date format - Something Strange? <p>As I can not share my data due to restriction . Please try to provide solution using the information below
I have a dataframe called data. There are variable which I want to convert into date and time format.</p>
<p>[![enter image description her... | <p>Two things, one good, one (likely) bad:</p>
<ul>
<li><p>your data is in a sane format as far as the time string goes: <a href="https://en.wikipedia.org/wiki/ISO_8601" rel="nofollow">ISO 8601</a> -- this makes parsing easier</p></li>
<li><p>your data is very likely in factor form and you forgot the required <code>as... |
Datagrip added value compared to IntelliJ <p>So, I was wondering if there is really some new features coming from Jetbrains Datagrip software.</p>
<p>So far, I didn't find anything that is not already there in IntelliJ Idea (Ultimate). I didn't spend much time using it though.</p>
| <p>From FAQ part from this <a href="https://blog.jetbrains.com/datagrip/2015/12/16/datagrip-1-0-formerly-0xdbe-a-new-ide-for-dbs-and-sql/" rel="nofollow">blog</a>.</p>
<blockquote>
<p><em>Does DataGrip repeat the functionality of the database tools in other JetBrains IDEs?</em></p>
<p>Yes, the first version foc... |
Spring: Apache POI Excel file download "Current policy properties" error in build log <p>I have a very simple Controller method that downloads an excel file using Apache POI library which is generated in a Service class like so:</p>
<pre><code>XSSFWorkbook workbook = new XSSFWorkbook();
// Excel sheet populated and a... | <p>There is lots of relative question in here, such as <a href="http://stackoverflow.com/questions/4667357/java-policy-error-applet-alert">this</a> and <a href="http://stackoverflow.com/questions/15609836/maven-getting-a-popup-asking-for-permission-while-building">that</a>
It seems it cause by some firewall/proxy/antiv... |
What's the difference between EDI, AS2 and GS1 and how do they work together? <p>I'm learning about EDI and there are many acronyms and standards that seem to overlap.
What is the difference between EDI (and a EDI translator) and AS2 (which seem to be EDI over HTTP)? Then there is GS1, whith it's own subsets (GS1 EANCO... | <p>From Walmart Getting Started with EDI
Implementation Guide ( <a href="http://cdn.corporate.walmart.com/5d/8d/897b4bb84a95bb05214bf897cee3/edi-getting-started-guide.pdf" rel="nofollow">http://cdn.corporate.walmart.com/5d/8d/897b4bb84a95bb05214bf897cee3/edi-getting-started-guide.pdf</a> )</p>
<ol>
<li><p>What is EDI?... |
Firing event on disabled button <p>I want to fire a event on a disabled button</p>
<pre><code> <button ion-button icon-only [disabled]="!isConnected" (click)="openModal()" (disabledClick)="showErrMsg()" shortVibrateOnTap>
<ion-icon ios="ios-swap" md="ios-swap"></ion-icon>
</button>
</cod... | <p>The disabled class of ionic sets <code>opacity: 0.4;</code> on the disabled buttons that gives the visual effect and <code>pointer-events: none;</code> that prevents any events from firing.</p>
<p>So if you want to make a button to look like disabled you should create a class </p>
<pre><code>.disabled {opacity: 0.... |
Google Fonts looks different at google.com and at my web site <p>I just tried to use Google Fonts and have noticed the following disturbing effect:<br> The result of using the font at my custom html file is different from what's present on Google site.<br> At least the font size is definitely different (color is also d... | <p>I honestly don't see a difference. Apart from the color and size.</p>
<p>Yours looks a bit sharper. But I wouldn't complain about that.</p>
|
How to convert between a C# String and C Char pointer <p>I have a large library written in C that I would like to use as a DLL in a C# program. Most of the C code will be used by the libraries own functions, but I do need one function to be able to be called from the C# project.</p>
<p>So there's an example C function... | <p>You're looking for a MarshalAs attribute:</p>
<pre><code> [DllImport("mydll.dll")]
static public int test([MarshalAs(UnmanagedType.LPStr)]String a);
</code></pre>
<p>As for returning a dynamically allocated C string, bad idea. How will you reliably de-allocate the string? It's a recipe for a memory leak. Allo... |
Do I have to include third party frameworks separately with my app? <p>I am building an iOS cocoa touch static library. It depends on a third party framework. Would I have to ship the framework with my app or not? </p>
<p>I am guessing that the definition of static library means that the output .a file should already ... | <p>Are you making something like a cocoapod? Because then, you can specify it as a proper dependency in the podspec. Otherwise, you can include instructions on including the third party framework or bundle it in yourself.</p>
|
DynamoDB Geo Object Mapper Class Not Found <p>I have been trying to use the <a href="https://github.com/awslabs/dynamodb-geo" rel="nofollow">dynamodb-geo</a> library in my project (Android). After reading everything possible around the interent I noticed that the lib jars are not included in the classpath, I did it and... | <p>I've been struggling with this about 7 months ago. The dynamodb-geo jar has a dependency with an old version of the java aws-sdk (1.5.5). This 1.5.5 version uses org.codehaus package names for the Jackson libs. </p>
<p>Later Jackson has modified it's packages names from org.codehaus to com.fasterxml. More recent v... |
convert different string types in dates R data frame <p>I have a messy data frame with two columns:</p>
<pre><code>DF<-data.frame(x=seq(100,105,1),y=c("3/25/2014 12:56","3/25/2014 14:18","3/25/2014 14:18","3/25/2014 14:18","3/25/2014 14:18","2014-03-25 14:19:08.043"))
x y
1 100 3/... | <p>I'd use package anytime:</p>
<pre><code>library(anytime)
anydate(DF$y)
#[1] "2014-03-25" "2014-03-25" "2014-03-25" "2014-03-25" "2014-03-25" "2014-03-25"
</code></pre>
|
Write php code inside a html string <p>im trying to insert some php that controll my session inside a html, the thing is that i cant concat the php with the html and i have no idea how to do it basicly i have the session <code>$_SESSION["nome"]</code> and want to put it <strong>here:</strong></p>
<pre><code><?php
... | <p>Your example was not very specific. You said you want to insert the name "here", but then included about 44 lines of code.</p>
<p>Being that you're in a code-block, you can concatenate your HTML and sessions like so:</p>
<pre><code><?php
return "<div>" . $_SESSION["nome"] . "</div>";
?>
</code... |
Determine whether eigen has optimized code for SSE instructions or not <p>I am having a code which is using Eigen::vectors, I want to confirm that Eigen has optimized this code for SSE or not.</p>
<p>I am using Visual Studio 2012 Express, in which i can set the command line option <em>"/Qvec-report:2"</em> which gives... | <p>Look at the asm output.</p>
<p>If you see SUBPD (packed double) inside the inner loop, it vectorized. If you only see SUBSD (scalar double) and no SUBPD anywhere, it didn't.</p>
|
Spring + Angular Http Cache Not Clearing <p>From what I've researched, both Spring and Angular do not enable http caching by default. ie, you have to explicitly add in the option if you need that functionality. However, for some reason my http requests just pile up as I navigate from page to page, whereas on a normal w... | <p>You need to configure your server to disable caching of files. For development, you can just select the <em>Disable Cache</em> option and keep the development console open to disable caching.</p>
<p><a href="https://i.stack.imgur.com/e5uLf.png" rel="nofollow"><img src="https://i.stack.imgur.com/e5uLf.png" alt="ente... |
JavaFX: display text instead of boolean value (true/false) <p>I'm using tableview in <code>JavaFX</code> to display <code>List<Contact></code>.</p>
<p>For initialize function of the controller, the tableview columns are binded to <code>List<Contact></code> as follow:</p>
<pre><code>sprintName.setCellValue... | <p>Use a cell factory (in addition to the cell value factory):</p>
<pre><code>importStatus.setCellFactory(tc -> new TableCell<Contact, Boolean>() {
@Override
protected void updateItem(Boolean item, boolean empty) {
super.updateItem(item, empty);
setText(empty ? null :
item.... |
Java lambda filter and map, can I avoid these repetitive calls? <p>I'm learning lambdas and I am wondering about the following code:</p>
<pre><code> ArrayList<String> lines = new ArrayList<>();
lines.add("#ignored");
lines.add(" #ignored2");
lines.add("Not Ignored");
lines.add("also no... | <p>You can use the <code>map</code> method at the beginning to trim the lines:</p>
<pre><code>lines.stream()
.map(String::trim) // Trim the spaces
.filter(line -> !line.startsWith("#"))
.map(String::toLowerCase)
.forEach(System.out::println);
</code></pre>
|
Python type checking not working as expected <p>I'm sure I'm missing something obvious here, but why does the following script actually work?</p>
<pre><code>import enum
import typing
class States(enum.Enum):
a = 1
b = 2
states = typing.NewType('states', States)
def f(x: states) -> states:
return x
p... | <p>No checking is performed by Python itself. This is specified in the <a href="https://www.python.org/dev/peps/pep-0484/#non-goals" rel="nofollow">"Non- Goals" section</a> of PEP 484. When executed (i.e during run-time), Python completely ignores the annotations you provided and evaluates your statements as it usually... |
AngularJS UI Router and search <p>I've built a small search app using AngularJS, UI Router and Elasticsearch. I have 2 templates that share 1 controller. Everything works correctly ... except for for when I try to implement query parameters.</p>
<p>The one template is a simple hp to enter search query or select from a... | <p>You should use a $stateParams as follows:</p>
<pre><code>.state('search', {//results
url: '/search/:q',
templateUrl: 'search/search.html',
controller: 'searchCtrl as vm'
});
</code></pre>
<p>Then in your controller you can inject <code>$stateParams</code> and access the value of that parameter with <co... |
Using d3-tip with npm: "Uncaught TypeError: Cannot read property 'node' of undefined"? <p>I've installed <code>d3": "^3.5.17"</code> and <code>"d3-tip": "^0.7.1"</code> using npm (<a href="https://www.npmjs.com/package/d3-tip" rel="nofollow">d3-tip documentation</a>). Then in my <code>index.js</code> file I have this c... | <p>Your line</p>
<pre><code>var tip = d3tip().attr('class', 'd3-tip').html(function(d) { return "hello world"; })
</code></pre>
<p>must be</p>
<pre><code>var tip = d3.tip().attr('class', 'd3-tip').html(function(d) { return "hello world"; })
</code></pre>
<p>You can check my implementation @:</p>
<p><a href="https:... |
How to remove file while installation/uninstallation? <p>I have created a MSI installer using InstallShield. I want to remove some files while upgrade/installation/uninstallation. How can I achieve this ?</p>
| <p>There is one in-built CustomAction in InstallShield, RemoveFiles. This CA removes all files while uninstallation. But if we want to remove some files while fresh installation or while upgrade installation then we can use FileRemove table. <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa371201(v=v... |
Node http.request () : the relationship with var ClientRequest and callbackFn <p>I am a newbie to Node.js . </p>
<p>And I am trying to further explore Node.js API .</p>
<p>I referred and wrote a crawler and the code works. </p>
<p>I have successfully post the comment to the website.</p>
<p>But I am confused with th... | <p>It seems the asynchronous nature of http.request may be causing your confusion. </p>
<p>Basically, the request call will be made - this takes some time. Meanwhile JS will move onto req.write() etc.</p>
<p>You should look into EventEmitters, you are already using them technically inside of the request callback (eg.... |
How can i read and modify a json file in scala spark play <p>I want to read a JSON file and create a class/object that saved all label and value from every JSON's vector/record. Then I want to modify some values (or the JSON structure) and get this modified JSON file to Http request with play/spark/scala.</p>
<p>So ho... | <p>Assuming you have this class</p>
<pre><code>case class Book(ser: Int, city: String, gen: Int)
</code></pre>
<p>you can perform the JSON conversion using Play's JSON serialization/deserialization by implementing a formatter: </p>
<pre><code>implicit val bookFormat: Format[Book] = {
((JsPath \ "ser").format[Int] ... |
How to Store Array Data Using Laravel foreach with ORM <p>create_team_social_icons_table.php</p>
<pre><code> $table->increments('id');
$table->integer('order_id');
$table->integer('team_id');
$table->integer('social_class');
$table->string('link');
</code></pre>
<... | <p>Try converting the array into string using explode method. You should also change the column data type to string or varchar for the data to be successfully saved. While retrieving the data you can convert the string back into array using implode method.</p>
|
VS2015 indentation inside line <p>I am using Visual Studio 2015 and develop in C++.<br>
I need VS2015 autoformatting so I can not turn it off, but there is a problem.<br>
I usually write like this:</p>
<pre><code> LPSTR lpszOneLongLine = NULL;
DWORD dwShort = 0;
</code></pre>
<p>But VS2015 ... | <p>You can disable this behavior from settings:</p>
<p>Tools >> Options >> Text Editor >> C/C++ >> Formatting >> Spacing >> Assignment Operator >> Check Don't change spacing around assignment operators</p>
<p><a href="https://i.stack.imgur.com/MKTIb.png" rel="nofollow"><img src="https://i.stack.imgur.com/MKTIb.png" a... |
Query filter object only working once - extbase 6.2 <p>In my extbase repository I've built a similar query function as described in this tutorial: <a href="https://docs.typo3.org/typo3cms/ExtbaseFluidBook/6-Persistence/3-implement-individual-database-queries.html" rel="nofollow">this</a> and it was using a filter objec... | <p>According to your description this is a caching problem. You can set your action to be noncachable by adding it in the second array in the plugin configuration in the localconf.php. Example:</p>
<pre><code>\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
$_EXTKEY,
'Pi1',
array(
'Con... |
Simulate click event on react element <p>I'm trying to simulate a <code>.click()</code> <code>event</code> on a <a href="https://facebook.github.io/react/" rel="nofollow">React</a> element but I can't figure out why it is not working (It's not reacting when I'm firing the <code>event</code>).</p>
<p>I would like to po... | <p>Use <code>refs</code> to get the element in the callback function and trigger a click using <code>click()</code> function.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>... |
IdentityServer4 Password Grant <p>I've stood up an instance of identityserver4, an API project, and a UI. </p>
<p>The workflow is as follows: </p>
<ol>
<li>User visits the UI.</li>
<li>User provides user name and password to UI.</li>
<li>UI sends credentials to back of web app, which uses a password grant to authen... | <p>You can request identity scopes using the password grant type and use the userinfo endpoint to resolve them to claims - like in this sample:</p>
<p><a href="https://github.com/IdentityServer/IdentityServer4.Samples/tree/dev/Clients/src/ConsoleResourceOwnerFlowUserInfo" rel="nofollow">https://github.com/IdentityServ... |
Need help restricting a js function(that restricts invalid chars) to a particular input type <p>Hi i would like to restrict a function that allows only, numbers, back space and left & right arrow keys to inputs with number type, because when i implement it, it also affects my text inputs.</p>
<pre><code><script... | <p>Assign an <strong>id</strong> to your <code><input></code>. Add an <a href="https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener" rel="nofollow">event listener</a> to it, like :</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div ... |
How can I extend an abstract class with an optional member in Scala? <p>I have an abstract base class, Foo, whose constructor I'd like to have an optional parameter. If none is provided, I'll just give it a <code>None</code> value.</p>
<p>A source Foo will not have parents, so I'd just like to construct them without a... | <p>I managed to fix this after reading the <a href="http://docs.scala-lang.org/tutorials/tour/case-classes.html" rel="nofollow">documentation</a>:</p>
<blockquote>
<p>The constructor parameters of case classes are treated as public values and can be accessed directly.</p>
</blockquote>
<p>Since my base class is abs... |
Custom JFR Java mission control events <p>I would like to emit custom events in jmc -I've came across the blog post about jfr custom events - <a href="http://hirt.se/blog/?p=444" rel="nofollow">http://hirt.se/blog/?p=444</a> . The author however stressed that this feature may be depracted in the future. Since the jmc i... | <p>At JavaOne September 2016, the blog poster mentioned that there will be a supported Flight Recorder API in JDK 9, and that the unsupported API now available in JDK 8 will be removed. He also showed a slide with this text before his presentation:</p>
<p>"The following is intended to outline our general product direc... |
Return Label Text From Form Field <p>I've been trying to have my eventLabel value equal my Gravity Form label. Currently my code is pulling the 'name' attribute from the input field of my form. However, I'm looking to pull the label text prior to the span element.</p>
<pre><code><li id="field_38_1" class="gfield gf... | <p>Modify </p>
<pre><code>$(this).parents('li').find('label')
</code></pre>
<p>to</p>
<pre><code>$(this).parents('li').find('label').text()
</code></pre>
|
resolve NLog instance with unity container <p>I have the following class:</p>
<pre><code> public class TestInjection
{
private ILogger logger;
public TestInjection(ILogger logger)
{
this.logger = logger;
}
public void Process()
{
try
... | <p>Here is how I've done:</p>
<pre><code> IUnityContainer container = new UnityContainer();
container.RegisterType<ILogger>( new InjectionFactory(l => LogManager.GetCurrentClassLogger()));
container.RegisterType<TestInjection>();
var myTestClass = containe... |
joining two tables and avoid duplicate rows <p>I am stuck with below logic in sql server.</p>
<p>Table 1:</p>
<pre><code>ID Requestid
1 0001
2 0004
3 0004
1 0005
</code></pre>
<p>Table 2 </p>
<pre><code>parentID Requestid Age
1 0001 29
2 0004 30
3 ... | <pre><code>select ID, requestid, age from table1 t1
inner join table t2
on t2.parentid =t1.id AND t2.requestId = t1.requestId
ORDER BY ID
</code></pre>
<p>OR</p>
<pre><code>select ID, requestid, age from table1 t1,table t2
where t2.parentid =t1.id AND t2.requestId = t1.requestId
ORDER BY ID
</code></pre>
|
Docusign api php add signer on the fly to template <p>when i add new recepient and sent the document in template using below code</p>
<pre><code>$templateRole = new \DocuSign\eSign\Model\TemplateRole();
$templateRole->setEmail("user@email.com");
$templateRole->setName("User Name");
$templateRole->setRoleName... | <p>I have read some of the documentation. As far as I can see you should do the following:</p>
<pre><code>//first signer
$templateRole1 = new \DocuSign\eSign\Model\TemplateRole();
$templateRole1->setEmail("user1@email.com");
$templateRole1->setName("User1 Name");
$templateRole1->setRoleName("Admin");
//seco... |
Cannot debug tensorflow using gdb on macOS <p>I am trying to debug TensorFlow using GDB on macOS Sierra. I followed the instructions on the <a href="https://gist.github.com/Mistobaan/738e76c3a5bb1f9bcc52e2809a23a7a1#run-python-test" rel="nofollow">post</a>.After I installed developer version of tensorflow for debug I t... | <p>Well, after I change to use <code>lldb</code> on macOS, everything works fine. So I guess the solution to this problem is "USING LLDB INSTEAD OF GDB".</p>
|
Show current location in google map programmatically android <p>I can get current location manually but I want to get it programmatically in android app. I am using <code>LocationListener</code> and <code>LocationManager</code> but I am not getting current location on map. My code is given below, anybody can guide me h... | <p>I have solved my problem by connecting <code>LocationServices</code>through <code>GoogleApiClient()</code> as you can see in below code.</p>
<pre><code>public class FindNearbyMosque extends FragmentActivity implements OnMapReadyCallback,
GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnect... |
Enhancements for text classification using word vectors <p>I am using word vectors for text classification solution. I am using word vectors mainly to address the case of synonyms which are not there in the training set but will be present in the actual use-cases. By simply using word vectors, I am not getting a good e... | <ul>
<li><p>Debug your bad prediction cases. Will good quality of embedding of synonyms (of those in the training dataset) help at all?</p></li>
<li><p>Use a different embedding that is trained with larger vocabulary, with similar content as your application, etc.</p></li>
<li><p>Get more training data (labeled dataset... |
VBA userform to execute selections only after hitting command button <p>I am having a hard time to make vba to execute my selection only after pressing the command button (The GO button in this case). Attached are the picture of the userform, which is not made by activeX control, and the code I am working on. Thanks!</... | <p>Like this, using a "Go" button's <code>_Click</code> event procedure (presumably <code>GO_Click()</code>, but modify if needed) to check against each of the checkboxes and do the deletion accordingly.</p>
<pre><code>Private Sub GO_Click()
If MR.Value = True Then
Rows(6).Delete
End If
If PMS.Value = True Then
... |
Login with twitter in android studio using Fragment activity <p>I have not found any tutorials or links for login with twitter in the android studio. Please give me any reference to for the twitter login using the fragment.</p>
| <p>Integrate <a href="http://fabric.io" rel="nofollow">Fabric</a> in your Android Studio and twitter kit which will help you login via Twitter in your app</p>
|
SQL Query to get a substring between [ ] in a string with multiple parentheses <p>I have a column with text string named "Formula", where variables are coded with IDs and set into parentheses, text in parentheses can vary in length, the number of such parentheses is virtually unlimited. Data examples:</p>
<ul>
<li><co... | <p>A simple Parse/Split function can help here</p>
<pre><code>Declare @YourTable table (ID int, Formula varchar(max))
Insert Into @YourTable values
(1,'[a=5;b=1;c=15]'),
(2,'[x=1;a=5;b=1;c=15]*[a=4;c=2]'),
(3,'=IF([a=10232937;c=227634]=1;[a=2;b=51;d=14]*[a=1;b=51;d=14];0')
Select Distinct A.*
From @YourTable A
Cro... |
Adding Image to Sqlite -android- <p><strong>How can i add image to sqlite database and then retrieve ? using Content Provider</strong>
<a href="https://i.stack.imgur.com/3HItU.png" rel="nofollow"><img src="https://i.stack.imgur.com/3HItU.png" alt="enter image description here"></a></p>
<p>*i want to get this image th... | <p>You could save the path to the image in the databse. Then in next activity, retrieve it and if the file exists display it...</p>
<p>When user selected image from gallery, i guess you get the URI from <code>onActivityResult()</code>. You just need to get the path to it using a code like this one : </p>
<pre><code... |
php.net manual not make sense of class Scope Resolution Operator :: <p>trying to learn php and caught on another snagg</p>
<p><strong>Ok this is what they are saying on php.net below about the ::</strong></p>
<p>The Scope Resolution Operator (also called Paamayim Nekudotayim) or in simpler terms, the double colon, is... | <p>In this case these two lines are basically the same. </p>
<pre><code>echo $classname::CONST_VALUE;
echo MyClass::CONST_VALUE;
</code></pre>
<p>PHP tries to "cast" the string <code>"MyClass"</code> to a Class. If the class exists everything works like a charm.</p>
<p>Other example could be:</p>
<pre><code>$ins... |
Python HTML source code <p>I would like to write a script that picks a special point from the source code and returns it. (print it)</p>
<pre><code>import urllib.request
Webseite = "http://myip.is/"
html_code = urllib.request.urlopen(Webseite)
print(html_code.read().dec... | <p>You could use <a href="http://jsonip.com" rel="nofollow">jsonip</a> which returns a JSON object that you can easily parse using standard Python library</p>
<pre><code>import json
from urllib2 import urlopen
my_ip = json.load(urlopen('http://jsonip.com'))['ip']
</code></pre>
|
Overwrite VS Code snippet with user defined snippet <p>I have configured the following TypeScript snippet in Visual Studio Code</p>
<p><code>
"console.log": {
"prefix": "cl",
"body": [
"console.log();"
],
"description": "console.log()"
}
</code></p>
<p>It doesn't work h... | <p>When you type <code>cl</code> a list of all the possible expansions of the cl snippet is shown and your snippet is probably around the bottom of the list. In order to access the snippet at the top of the list you can added the following to your <code>settings.json</code></p>
<pre><code>// Place your settings in thi... |
TCP Server doesn't receive data correctly <p>The below code has a TCP client in C and TCP Server in Qt C++. My problem is that I am using TCP for reliability, but it has data losses (not packet). In my main code, if I run tcp client to send data, TCP server receives only one packet. if I add <code>sleep(1);</code> to t... | <pre><code>int n = write(*sockfd, message, msgLength);
if (n < 0){
</code></pre>
<p>You are only checking that <code>write()</code> did not return a negative value, indicating an error.</p>
<p>However, a <code>write()</code> to a socket does not guarantee that all requested bytes will be written. <code>write()</c... |
How can I resolve this build error when adding facebook sdk <p>I keep getting the BUILD FAILED in Android studio and I have resolved other similar error before but this one is hard. Basically what i do is adding the <a href="https://github.com/firebase/quickstart-android/tree/master/auth/app/src/main/java/com/google/fi... | <p>As the error says, your minSDK is 14 but the latest FacebookSDK requires mins SDK 15. Increasing your minSDK should resolve your issue</p>
|
python os.walk and unicode error <p>two questions:
1. why does </p>
<pre><code>In [21]:
....: for root, dir, file in os.walk(spath):
....: print(root)
</code></pre>
<p>print the whole tree but</p>
<pre><code>In [6]: ... | <p>Here's a test case:</p>
<pre><code>C:\TEST
ââââdir1
â file1â¢
â
ââââdir2
file2
</code></pre>
<p>Here's a script (Python 3.x):</p>
<pre><code>import os
spath = r'c:\test'
for root,dirs,files in os.walk(spath):
print(root)
for dirs in os.walk(spath): ... |
Deserialize XML dateTime to UTC <p>I am consuming an XML webservice with XSD elements such as:</p>
<pre><code><xs:element nillable="true" type="xs:dateTime" name="ENDDATE"/>
</code></pre>
<p>XML might look like the following:</p>
<pre><code><ENDDATE>2016-08-01T18:35:49+04:00</ENDDATE>
</code></pre>... | <p>I think that you can't tune this behavior using XSD (see <a href="http://www.w3schools.com/xml/schema_dtypes_date.asp" rel="nofollow">here</a>).
So you should update(hack) auto-generated classes and do something like described <a href="http://stackoverflow.com/questions/3188933/prevent-timezone-conversion-on-deseria... |
The type or namespace name 'MovieTexture' could not be found.Are you missing a using directive or an assembly reference? <p>During this cause of executing my application, i'm encountering the </p>
<blockquote>
<p>error(CS0246)
error</p>
</blockquote>
<p>when i'm trying to build my game on unity using WebGL.Here'... | <p>Okay I got the problem. Basically, the <code>movie</code> is declared and not assigned any value.That is why it is null.<br>
I think you have missed the name of the object whose texture property is used here</p>
<p><code>GetComponent<RawImage>().texture = movie as MovieTexture;</code>.</p>
<p>It should be li... |
Shared preference value not reflecting in app <p>I am getting the saved value in shared preference but not being able to update TextView or ImageView on basis of the value in shared preference.</p>
<p>Here is my code for Shared Pref's class :</p>
<pre><code>public class SharedPref {
public SharedPref(Context context... | <p>String comparison the way you are working right now. You need to change equals statement into this</p>
<pre><code> if(local.equals("3") || local.equals(""))
{
icon_tick_3.setImageResource(R.drawable.tick);
}
</code></pre>
|
Loading videoclips in background layer with Actionscript 2 <p>I am trying to load videoclips (or images) into the background layer, based on the frame number, using the Actionscript 2 below, on Macromedia Flash 8 pro.</p>
<p>There are two layers; background and text layer. The script loads clips alright but it put... | <p>I've found the solution to this. In the second line in the script:-</p>
<pre><code> this.createEmptyMovieClip("image_mc",1);
</code></pre>
<p>change 1 to -16384, like so:- </p>
<pre><code> this.createEmptyMovieClip("image_mc",-16384);
</code></pre>
<p>This might help someone still working ... |
How do you import ngTagsInput into your project with AngularJS and Bootstrap? <p>How do you prevent this message while trying to use ngTagsInput? I tried to go to the module and put in:</p>
<pre><code>var app = angular.module("SinglePageApplication", [ "ngRoute", 'ui.bootstrap', 'ngTagsInput']);
</code></pre>
<p>How... | <p>I remember running into an issue with this and the fix/workaround I came up with was to copy the <code>ng-tags-input.js</code> locally and keep it within .git.</p>
<p>I had totally forgotten to check up on this, at the time there was a bug with any Angular >= 1.5. Can't recall the bug exactly but I think my issue w... |
How do I stop comments of a exe script executing from a .bat fie <p>I have a <code>.bat</code> file that runs a number of <code>.exe</code> scripts used recursively for a number of files and produces different result files.</p>
<p>But each <code>.exe</code> has some useless comments and processes running messages that... | <p>You can redirect the messages of your batch file to a text file if you don't want to see them on cmd
For ex:</p>
<pre><code>C:\\>run.bat > d:\myfile.txt
</code></pre>
|
How to get dynamic content with script tag working in AngularJS? <p>I'm trying to integrate AngularJS to existing web application. Some of data in application is loaded dynamically via <code>$.ajax()</code> and <code>element.html(data)</code>. <code>data</code> can contain html code with javascript code in tag <code>&l... | <p>Ok, the problem, is that after your AngularJS application has been bootstrapped you can't define new controllers. <a href="https://www.bennadel.com/blog/2553-loading-angularjs-components-after-your-application-has-been-bootstrapped.htm" rel="nofollow">Description and solution</a>.</p>
<p>I fixed my example <a href=... |
Mongoose select result based on value of items in database array <p>I have a schema field (prices) which is an array, usually with just 1 price but sometimes with a sale price listed as the second item in the array. </p>
<p>I'd like to be able to query this field and return the all the products, sorted from lowest to ... | <pre><code>Model.find({$or :[{"price.1": {$exists: false}}, {"price.1": {$gt : 10}}]}) //get all documents where either second element of the price array doesn't exist OR if it does it's greater than 10
.sort("price.1") // asc. Docs without second element will come first. Use -price for desc
.exec(function(err,... |
how to add image on plane using script unity <p>Here is my code to add a plane in unity but the problem is the octopus.jpg seems like not to work.</p>
<pre><code> GameObject my_plane;
my_plane = GameObject.CreatePrimitive (PrimitiveType.Plane);
my_plane.transform.Rotate (-90, 0, 0);
Texture my_img = (Te... | <p>It would be easier to create a public field in your class :</p>
<p>public Texture my_img;</p>
<p>and just drag the texture that you want to use.</p>
<p>In case you are not running that code in a monobehaviour, you need to have your image inside a folder called "Resources" inside the "Assets" folder.
<a href="http... |
jQuery - setTimeout does not work <p>There is my script: <a href="https://jsfiddle.net/hcsofjaa/1/" rel="nofollow">https://jsfiddle.net/hcsofjaa/1/</a>
I want to change color of these cells every 2000ms one by one, but It seems the setTimeout function does not work properly. Does anybody know, where is the problem?</p>... | <p>1) <strong>$(function)</strong> is important - bind click event to element after it rendered.</p>
<p>2) <strong>2000 * i</strong> : button colors change in the gap of 2000 </p>
<pre><code>$(function(){
$("#button").click(function(){
$("span").each(function(i){
var e = this;
setTimeout(function(){
$(... |
Printing from an OrderedCollection in Smalltalk <p>I am fairly new to Smalltalk and I'm stuck on how to print elements from a stack. I have two classes, one which creates the stack using OrderedCollection, which works, and a second class (Object subclass). For the second class I have two instance variables name and wei... | <p>Both your <code>print</code> and <code>printSpecial</code> methods enclose their bodies in squared brackets. You should remove them. Try:</p>
<pre><code>print
Transcript
show: weight;
show: name;
cr
printSpecial
weight <= 100 ifTrue: [
Transcript
show: weight;
show: name;
c... |
Python - Creating a text file converting Fahrenheit to Degrees <p>I'm new to Python and I've been given the task to create a program which uses a text file which contains figures in Fahrenheit, and then I need to change them into a text file which gives the figures in Degrees... Only problem is, I have no idea where to... | <p>First you need to create a Python function to read from a text file.</p>
<p>Second, create a method to convert the degrees.
Third, you will create a method to write to the file the results.</p>
<p>This is a very broad question, and you can't expect to get the full working code.
So start your way from the first mi... |
is there a way to add new feature to orientdb studio <p>is there a way i can add a new feature to the orientdb studio? I mean, I need to display a popup window with a timeline of events that each user has made in a frame of time, for now when we click on a node a set of features appeared to modify, see connections to t... | <p>You can make a feature request on <a href="https://github.com/orientechnologies/orientdb/issues" rel="nofollow">github</a>.</p>
|
Having Trouble Testing App On iPhone <p>Having a bit trouble testing my app on the iPhone. I just downloaded Xcode 8/Swift 3. I have already researched online various ways to test my app, since this is my first app to be tested on any device.</p>
<p>To my understanding, setting up a free account to test is doable. I h... | <p>Just build and run your app with your phone plugged into your computer, and your phone selected as the build target in Xcode. Command-R is the keyboard command that should do that. You don't have to manually install the app, as build and run will do that for you.</p>
|
How to copy AND add clipboard contents to text area <pre><code>var content = clipboardData.getData("Text");
document.forms["test"].elements["clipboard"].value = content;
}
</code></pre>
<p>I would like to copy the clipboard contents to a textarea and add it each time instead of replacing the text. I have no issues... | <p>try this script <a href="https://github.com/zenorocha/clipboard.js" rel="nofollow">clipboard.js</a></p>
<p>You can copy, cut, paste, use different settings ;)</p>
|
Read .json in template Ionic 2 and Angular 2 <p>Template cant read *ngFor="let git of user.ball" whats problem ???
how get array ball from json?? I am traing but its not works </p>
<p>my template</p>
<pre><code><div *ngSwitchCase="'userpage'">
<ion-card>
<ion-card-content>``
... | <p><strong>NOTE</strong> : The answer is regarding to this shown object only. answer may vary according to your json.</p>
<p>Let's say </p>
<pre><code>this.users = [
{
"id": 1,
"name": "It Developer",
"img": "/assets/img/1_kanal.png",
"email": "example@example.ru",
"surname": "IT app",
"ball... |
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? <p>so I'm on Python 3.5.2, I'm trying to install scrapy, it throws an error saying</p>
<blockquote>
<p>Failed building wheel for lxml <br> Could not find function
xmlCheckVersion in library libxml2. Is libxml2 installed?</p>
</blockq... | <p>try this first</p>
<p>pip install lxml==3.6.0</p>
|
javascript arrays change together <p>Created second array = to first array and then performed 'shift' on second array and first array was affected also. See code below. I am expecting the secondArray to contain Larry and Moe after the shift and the firstArray to have the original three elements. After the shift, bot... | <p>Here <code>secondArray</code> & <code>thirdArray</code> refers to the same array as <code>firstArray</code> instead of a new independent array.</p>
<p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice" rel="nofollow"><strong>slice</strong></a> whic... |
How do I set the scope in the Facebook ionic authentication provider? <p>I am using the facebook ionic authentication provider; <strong><em>where and how do I set my scope to ask the user for consent on the data my ionic app will be retrieving from his or her facebook profile?</em></strong></p>
<p>I am using this on t... | <p>Try with <a href="http://coenraets.org/blog/2014/04/sociogram-angularjs-ionic-facebook/" rel="nofollow">OpenFb Angular JS</a></p>
<pre><code> OpenFB.login('email,public_profile,user_friends,user_website,user_work_history,user_about_me,user_education_history,publish_actions,user_posts,user_photos,user_birthday')... |
How to List Executable File Names In Powershell <p>I need to list all installed applications in windows. Using <code>powershell</code> and the following command, I can find out the name and some other details of the installed applications. </p>
<pre><code>Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\C... | <p>The installed program are located in other registry key:</p>
<pre><code> HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
</code></pre>
<p>The following script get all programs and the their commandline:</p>
<pre><code> $q="`""
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App ... |
Hi, I cant seem to print the results of a program that will compare three circles size using DrawingPanel <p>Hi beginner programer here I need help with printing the results for this program. I have already created a method to compare the circles radius, however I would like to include the color of the circles compared... | <p>Create a class circle, like</p>
<pre><code>public class MyCircle {
int radius;
Color color;
public MyCircle(int radius, Color color) {
this.radius = radius;
this.color = color;
}
//Getter Setter...
public int getRadius() {
return radius;
}
public void setRa... |
How are "Web Components" different from "jQueryUI"? <p>While developing our own UI component libraries for Web and Mobile which one is more preferable - web component or jQueryUI?</p>
| <blockquote>
<p>How are âWeb Componentsâ different from âjQueryUIâ?</p>
</blockquote>
<p>They are very different by nature:</p>
<ul>
<li><p>Web Components are a set of HTML and DOM standards implemented in modern browsers.</p></li>
<li><p>jQueryUI is a JS library which proposes some advanced UI controls.</p... |
Cannot pass bound value of select box to second polymer element <p>I'm very new to Polymer and am having quite a time making this work. I've spent a few days scanning the docs at Google and other questions posed here on SE. My problem is similar to this one:</p>
<p><a href="http://stackoverflow.com/questions/39918908/... | <p>I don't see any issue with your code except for the one's mentioned in comments(unbalanced div tag and missing iron-ajax). The only thing that i see is that you have not used/printed <code>selected</code> anywhere in your <code>my-solution</code>.
Below snippet contains your code where i've printed <code>selected</c... |
how to use rubyxl to access the first row <pre><code>workbook = RubyXL::Parser.parse(params[:file].path)
worksheet = workbook[0]
puts worksheet.sheet_data[0][0]
</code></pre>
<p>But I am getting this as output </p>
<pre><code><RubyXL::Cell(0,0): "0", datatype="s", style_index=1>
</code></pre>
<p>My excel she... | <p><pre>worksheet.sheet_data[0]</pre> gives you a Ruby object representing the first row.</p>
<p><pre>worksheet.sheet_data[0][0]</pre> gives you a Ruby object representing the first cell on the first row. But to get the actual contents of that cell, you need <pre>worksheet.sheet_data[0][0].value</pre></p>
<p>The wor... |
Csharp with node.js and socket.io <p>I wanted to send data from csharp to a webpage live without having to reload or anything annoying like that so I decided to use Node.JS and socket.io</p>
<p>I am totally new to socket.io and node.js so correct me if this isnt how it works...<br><br>
1) I sent data from my Csharp ap... | <p>on the client you should be listening for the message on the socket. </p>
<pre><code>io.on('connection', function(socket){
console.log('a user connected');
socket.on('emu_msg', function(msg){
console.log('emu message received?');
});
});
</code></pre>
<p>see: <a href="http://socket.io/docs/server-api/#so... |
How do I make the combobox update? <pre><code># IMPORT MODULES -----------------------------------------------------------
from tkinter import *
from tkinter import Tk, StringVar, ttk
#---------------------------------------------------------------------------
# LISTS
</code></pre>
<p><strong>Here are the lists which... | <p>You have to add function name to bind</p>
<pre><code>CarBrandBox.bind("<<ComboboxSelected>>", ModelSelectionFunction)
</code></pre>
<p>and tkinter executes it when you select in combobox.</p>
<p>Because <code>tkinter</code> sends extra argument to binded function so you need to receive it in your func... |
How can I center <ul> in nav <p>I have this code and I want center the buttons of nav, especifically Page1,2 and 3.
I use boostrap 3.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-overr... | <pre><code>.navbar .navbar-nav {
display: inline-block;
float: none;
vertical-align: top;
}
.navbar .navbar-collapse {
text-align: center;
}
</code></pre>
<p><a href="http://codepen.io/anon/pen/VKGONw" rel="nofollow">http://codepen.io/anon/pen/VKGONw</a></p>
|
iOS - Accessibility for images <p>I am building out an app in iOS. I am working on accessibility and there is a logo on multiple screens that are cumbersome to go through continuously with VoiceOver. Is there a way for VoiceOver to not pick up the logo?</p>
| <p>Depending on how its used, a logo can be very valuable for a screen reader user. They're often linked back to the home page or they're accompanied with the title of the site (which sometimes isn't represented elsewhere). If it provides this information or functionality, it's important not to remove it. </p>
<p>Inst... |
Redirecting Azure logs to a particular log service <p>I have some VMs running on Azure Service. I'd like to redirect logs from them (Windows Event Logs and MS SQL server logs) to a specific log concentrator (like Graylog). For Windows logs, I'm using Nxlog (<a href="https://nxlog.co/docs/nxlog-ce/nxlog-reference-manual... | <p>Most services keep their logs in a Storage Account so you can tap into that source and forward logs to your own centralized log database. You generally define the storage account at the place you enable diagnostics for the service.</p>
<p>Don't know what king of logs you are looking for in SQL DB, but for example t... |
Changes to app.rb don't seem to go into effect <p>I need to test a GET request in sendRequest.js:</p>
<pre><code>$.get( '/test/test2', {name: 'Larry', time: '2pm'} );
</code></pre>
<p>This sends the request fine and everything works on the JavaScript end, but obviously returns a 404 (route not found) so I added in ap... | <p>Have you tried stopping and restarting the server?</p>
<p>By default Sinatra won't know its code has changed, and Ruby will have loaded all the script into memory and won't look at the file.</p>
<p>Stopping the server, by using <kbd>Cntrl</kbd>+<kbd>C</kbd> then restarting the server will refresh Ruby's idea of wh... |
Service reference not defined <p>I have added a wcf service (SifService) reference to my Kentico web application in VS. I didn't select any of the advanced options. I just provided the wsdl address, provide a namespace (SifService) and click OK. The service reference seems to have added successfully. However, when I at... | <p>Sometimes it's an error of visual studio, clean the solution, build, so close the visual studio and build again, for me it worked a few times!</p>
|
Switching scenes error <p>I'm trying to create a little game but when the app switches to the game scene (when pressing the restart button), than this game scene won't load correctly. It'll give an error: thread 1 exc_bad_instruction (code=exc_i386_invop subcode=0x0). The whole game works fine in the beginning (if I di... | <p>My personal impression is that you get the error from the previous (disposed scene.), but I might be wrong...</p>
<pre><code>let nextScene = GameScene(size: self.scene.size)
nextScene.scaleMode = SKSceneScaleMode.AspectFill
self.view?.presentScene(nextScene, transition: transition)
</code></pre>
<... |
Xcode Autolayout How to centre uitextfield with fixed width that can adjust for smaller screens <p>I can't seem to form how the constraints will work, so in Descriptive terms:</p>
<ul>
<li>the textfield is horizontally center to the container</li>
<li>the textfield is 100 points offset from the top layout guide</li>
<... | <p>This should do it:</p>
<pre><code>let textField = UITextField()
view.addSubview(textField)
textField.translatesAutoresizingMaskIntoConstraints = false
// center horizontally
textField.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
// 100 from top layout guide
textField.topAnchor.constraint(e... |
Spark K-Mean Retrieve Cluster Members <p>Can you please provide me sample code snippet to retrieve the cluster members of K mean?</p>
<p>The below code prints cluster centers. I needed cluster members belonging to each center.</p>
<pre><code>val clusters = KMeans.train(parsedData, numClusters, numIterations)
cluste... | <pre><code> parsedData.foreach(
new VoidFunction<Vector>() {
@Override
public void call(Vector vector) throws Exception {
System.out.println(clusters.predict(vector));
}
}
);
</code></pre>
|
Crop a trapezoidal portion from a bitmap and create a rectangular resulting bitmap <p>I want to crop a trapezoidal part from a bitmap using four coordinate points that I have. And then get this cropped bitmap as an rectangular image as the resulting bitmap.</p>
<p>I want to do this with Android JAVA as I am not famili... | <pre><code> // Set up a source polygon.
// X and Y values are "flattened" into the array.
float[] src = new float[8];
src[0] = x1; // from your diagram
src[1] = y1;
src[2] = x2;
src[3] = y2;
src[4] = x3;
src[5] = y3;
src[6] = x4;
src[7] = y4;
// set up a dest polygon ... |
Get all products which have both product category <p>I need all products which have both categories. I am using a query below:</p>
<pre><code>$args = array(
'post_type' => array('product', 'product_variation'),
'paged' => $paged,
... | <p>Add include children in your arguments.</p>
<p>Make sure your products have both categories. </p>
<p>In case you want to filter by multiple categories operator could be 'IN' instead of 'AND'.</p>
<pre><code>$args = array(
'post_type' => array('product', 'product_variation'),
'paged' => $paged,
'tax_query' =... |
c# MongoDB Repo reference for Delete(string id) function won't accept being passed string DAO parameter <p>I'm trying to create a Delete function in a DAL EmployeeDAO, as seen here:</p>
<pre><code>public long Delete(string Id)
{
HelpdeskRepository repo = new HelpdeskRepository(new DbContext());
lon... | <p>So firstly, you are referencing GetIsAsString() as if it is an extension method here:</p>
<pre><code>repo.Delete(Id.GetIdAsString());
</code></pre>
<p>If you want it to be a extension method it should look something like this (within a static class)</p>
<pre><code>public static string GetIdAsString(this ObjectId ... |
find a number is between which range in a list of list <p>Need some python help, I have a list: </p>
<pre><code>[[sql1, 1, 10], [sql2, 12, 16]...]
</code></pre>
<p>I want to know if 15 is in the sql2, please let me know in python the easy way. </p>
<p>I have tried in the loop. </p>
| <p>You're going to have to give a few more details about your desired implementation, but this was too fun not to answer. </p>
<p>My answer assumes:</p>
<ol>
<li>You want a list of the beginning strings (<code>index == 0</code>) of the sublists whose:</li>
<li>2nd and 3rd elements contain <code>15</code> in the range... |
What is gcc compiler option "-unsigned" meant for? <p>I am compiling legacy code using gcc compiler 4.8.5 on RHEL7. All C and C++ files have "-unsigned" as one of the default flags for both gcc and g++ compilation. The compiler accepts this option and compiles successfully. However, I cannot find any documentation of t... | <p>I suspect it was just a mistake in the Makefile, or whatever is used to compile the code.</p>
<p>gcc does not support a <code>-unsigned</code> option. However, it does pass options to the linker, and GNU ld has a <code>-u</code> option:</p>
<blockquote>
<p>'-u SYMBOL'<br>
'--undefined=SYMBOL'<br>
Force... |
XCode 8.0, Building for Store Submission, Errors <p>Getting the following errors with XCODE 8.0. This was working fine with Xcode 7.x as far as we can remember.</p>
<pre><code>ERROR ITMS-90087: "Unsupported Architectures. The executable for xxx.framework contains unsupported architectures '[x86_64, i386]'."
</code></... | <blockquote>
<p>ERROR ITMS-90087: "Unsupported Architectures. The executable for xxx.framework contains unsupported architectures '[x86_64, i386]'."</p>
</blockquote>
<p>This is a <a href="http://www.openradar.me/radar?id=6409498411401216" rel="nofollow">known Apple bug</a>. </p>
<p>Your other errors are resulting ... |
How to display color in two parts of a ggplot legend? <p>I'm trying to plot line plots of several different series, where each series will be drawn with a different line width, and each belongs to one of several groups which will determine the color. </p>
<p>What I'm struggling to do is to create a legend which shows ... | <p>You are <em>incredibly</em> close (and thank you for the well researched and attempted question). You just need to add <code>override.aes</code> in the legend, like so:</p>
<pre><code>ggplot(df, aes_string(x="x", y="y", group="name")) +
geom_line(aes(size=name, color=group)) +
scale_size_manual(values=line.widt... |
Tooltip element with absolute positioning being clipped by container with overflow: auto <p>I have a tooltip in a modal. Is there a way that I can avoid the tooltip from being clipped? I need the modal-dialog to handle content overflow and so I cannot remove the <code>overflow: auto</code> from it.</p>
<p><div class="... | <p>The <code>overflow: auto</code> will clip any content outside the container, as you have indicated. You would get a similar result with <code>overflow: hidden</code>.</p>
<p>Because your tooltip pop-up (hover state) is absolutely positioned, and the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position... |
Initialise class and having problems with undefined offset <p>Im recently moving across from procedural to oop with my php, im studying from a book and as well as doing the exercises and projects in the book i am also giving myself a real life project to do for my own website.</p>
<p>I want to implement an sms feature... | <p>Because reset() returns a Boolean. Move the reset() call to its own line:</p>
<pre><code>reset($retval);
list(, $response) = array_values($retval); // line 282
</code></pre>
<p>I should say it returns the first value, however in your case its returning FALSE</p>
<p>From the <a href="http://php.net/manual/en/func... |
iOS Change every cell colour (section + row) <p>I would like to change cell color in every cell (4 colours % 4) :</p>
<p><strong>1. Section 1</strong></p>
<p>Cell 1 : RED</p>
<p>Cell 2 : BLUE</p>
<p><strong>2. Section 2</strong></p>
<p>Cell 3 : BLACK</p>
<p><strong>3. Section 3</strong></p>
<p>Cell 4 : WHITE</p>... | <p>I'm assuming you have an array of arrays that stores your section and row data. I would create a function that takes a section and row number as arguments and returns a position that ignores the section:</p>
<pre><code>- (Int) getPosition:(Int) section rowNumber:(Int) row {
int position = 0;
for (int i = 0;... |
java synchronized Thread clarification <p>The answer for this program will have to be "Changing done" after 5 secs, but I get "Changing done" and "DONE". I do not have the getDone method as synchronized. Any ideas what am I doing for the thread to finish processing. </p>
<pre><code>public class Main {
private stat... | <p>If you don't synchronize access to <code>done</code> properly, it means your code <em>may</em> fail, i.e. the thread <em>may</em> not see the updated value. </p>
<p>It does not mean the value is guaranteed not visible unless synchronizing correctly. So, in many cases the write to <code>done</code> is still visible ... |
Oracle - From WebFocus to Oracle - Sum with case <p>I have an ETL that was created in WebFocus, and will migrate it to Oracle.</p>
<p>I would like an alternative to the following situations. In WebFocus, he can use a previous calculated column, as a parameter to calculate another value.</p>
<p>Example:</p>
<pre><co... | <p>I am totally unfamiliar with the construct you listed above, but I'm going to take a stab anyway since you can validate results from one system to the other. My guess (and it's just a guess) is that you can achieve this result by using a CTE to get the first sum (<code>TAX_L</code>) and then use that value in the m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.