FAQ Database Discussion Community


Using sql function on CHECK constraint for newly inserted row

sql,database,sql-function,check-constraints,sql-server-2008r2-express
First of all i need help with this for my bachelor thesis. I'm doing the whole database on sql server 2008 Release 2. The problem is with check constraint that is using a function that is working on her own but not with the use in the constraint. The result...

Is there a way to get the name a Verilog module was instantiated with?

verilog
I'd like to do some simulation debugging in Verilog and want to add $display to some modules but want to be able to track the output a single module provides. I'd like to be able to get the name that the current module was instantiated with to add to the...

how can I filter before contact form 7 (wordpress) send email and later go back to my normal flow?

php,wordpress,email
I am trying to do this: Using Contact Form 7, I want to filter depending on a selectbox and send mail to one or other , I would do this sending with phpmail function... So far I have this.. add_action( 'wpcf7_before_send_mail', 'process_form' ); function process_form( $cf7 ) { $submission =...

Alternatives to SQLite in VS2013 with EF6 and designer support

entity-framework,sqlite,visual-studio-2013
I have previously used System.Data.Sqlite 1.0.85 with EF5 in VS2010 and it worked well and I came to really like the designer. On my new machine, I've switched to VS2013 Community and tried to get Sqlite 1.0.94 and EF6 running, but it's such a hassle and I'm starting to get...

Getting item from ListView

android,database,listview
I'm working on a android project and a got stuck. I'm trying to get an item from a ListView but all I get is info about the item's position in the database I created and not the item itself. this is my code : public class Map extends Activity {...

How to get the function result from Symbolic Regression with R

r
First, please excuse my ignorance because I've just started learning R today. I have a data frame of two variables (x, y) as follows: (1,0), (2,26), (3,88), (4,186), (5,320), (6,490), (7,541). I want to use Symbolic Regression to find a function f such that y = f(x). Following the tutorial...

Compiled program with py2app, now unable to handle sys.argv[1] argument

python,py2app
I have a program that I can run as > python transactions.py file.csv That processes the provided CSV file. I want to compile it to an executable so my friends can use it without having to install all the packages it requres. py2app compiles the app, and in 'Alias' mode...

Get response of url in nodejs (express/http)

javascript,node.js,http,express
I'm trying to get the response of two URLs in nodejs but there's a problem with http.request. Here's what I have so far: var url = "https://www.google.com/pretend/this/exists.xml"; var opt = { host: url.split(".com/")[0] + ".com", path: "/" + url.split(".com/")[1] }; callback = function(response){ var str = ""; response.on('data', function(chunk){ str...

Reflection in C++. How to pass a func as a parameter in c++

c++,function,reflection,methods
I am new to c++. So I'm trying to do something that is trivial but cannot figure out how. Your help is appreciated. I have a Class called Method: class Method{ private: std::string nameMethod; Func f; public: Method(std::string name,Func fun){ nameMethod=name; f=fun; }; I want to create an Object of...

Passing Incorrect Value to Javascript Function

javascript,php,pass-by-reference,truncation
I am attempting to pass a string '0541210022-0' to a popup window through a Javascript method. When I view the number in my popup window it shows up as 11575826. Can someone please help me determine why this value is changing? I will add code as well as screen shots....

making a:hover shrink the img

css,button,hover
My button links are just links in the html with a background image in css. In the CSS I also have the dimensions of the image so that the whole thing is displayed. I want the image to shrink to 95% whenever the mouse hovers over the image. I have...

Injecting Generics in Dagger

android,mvp,dagger
Is it possible in Dagger to do something like the following: public abstract class Presenter<T extends BaseView> { @Inject T mView; public void showLoadingIndicator() { mView.showLoading(); } } (example module) public class MyModule { private MyView mView; //extends BaseView public MyModule(MyView view) { mView = view; } @Provides public BaseView...

Restricting Time access for AWS Cloudfront

amazon-cloudfront
I'm not sure if this is possible, but can I set up a "time limit" on Amazon CloudFront w/ RTMP? For example, if a movie is 10 mins, I want to show the first two mins only. Can this be done through CloudFront or do I need to create a...

Multiple PhoneStateListeners being called

android,service,phone-state-listener
I have an app where I have a PhoneStateListener listening for calls. I am using an IntentService to upload call information to a database. I make a new PhoneStateListener in the onCreate() in my MainActivity.java callStateListener = new CallStateListener(this.getApplicationContext(), false); telephonyManager.listen(callStateListener, PhoneStateListener.LISTEN_CALL_STATE); I ideally want the PhoneStateListener to run all...

FacebookSDK Request.newMeRequest onCompleted called on JELLYBEAN but not KITKAT or LOLLYPOP

android,facebook,request,facebook-android-sdk
This code results in the onCompleted method being called on Samsung JELLYBEAN but not on Motorola KITKAT or LG LOLLYPOP devices. The log returns: W/Facebook test(20699): Facebook session status changed - OPENED - Exception: null on all devices. private class SessionStatusCallback implements Session.StatusCallback { @Override public void call(Session session, SessionState...

Can I create global variables in q promises in node? [duplicate]

javascript,node.js,promise
This question already has an answer here: How do I access previous promise results in a .then() chain? 6 answers Before (trying) to switch to promises, I could have variables that were in the whole scope of the nested functions. For example, I could get a user from a...

MonoTouch Convert UTC time to American Eastern Standard Time

monotouch
How to convert UTC time to American Eastern Standard Time zone. TimeZoneInfo easternZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"); DateTime easternTime = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, easternZone); I am getting exception at first line - TimeZoneNotFoundException...

Can't call a public method c# [closed]

c#,class,methods,private,public
namespace ConsoleApplication3 { public class EncapulationTest { public static void publicMethod() { Console.WriteLine("This is the public method from the EncapsulationTest class!"); } private static void privateMethod() { Console.WriteLine("This is the private method from the EncapsulationTest class!"); } } public class Main { public static void Main() { publicMethod(); Console.ReadLine(); }...

How can I log into a simple web access login using Python?

python,web,browser,login,mechanize
I'm trying to create a little Python script that'll log into a web access authentication page for me automatically for the purposes of convenience (the login appears each time the computer is disconnected from the network). My attempt so far has been to use the module mechanize, but running this...

Django - How to create updating progress bars?

javascript,jquery,ajax,django,progress-bar
I'm wondering how should I go on and implement an updating progress bar. Basically the server should periodically send a confirmation on what is the current progress to the user. I know how to do an Ajax call with Django and jQuery, which is similar to figure 1. On my...

Layering Canvas elements

javascript,jquery,html5,canvas
I'm working on a pototype HMTL5 canvas animation that will export to quicktime. I'm having a dynamically generated background with dynamically masked elements on top of it. I can get the background to be made, and have it export to the server as a frame by frame animation (png sequence)...

iOS - Why does this NSString comparison blow-up? [duplicate]

ios,objective-c,json,response
This question already has an answer here: Unrecognized selector error for isEqualToString: when setting text of a label 1 answer I have looked at SO for similar questions, but am open to being pointed to a duplicate. I am receiving some JSON from a site, and I want to...

Trying to switch from Xunit.KRunner to xunit.runner.kre?

unit-testing,xunit.net,asp.net-5
Today after updating our projects it seems Xunit.KRunner is no longer available on NuGet. We checked the Microsoft projects and it looks like they are using the xunit.runner.kre package. When trying to install this the xunit.assert assemly is failing to download from Nuget. Any suggestions to get this working? I...

shell command line to modify a configuration file

shell
I searched this but did not find answer for my problem. I have a configuration file, which has a line like server_ip=xxx.xxx.xxx.xxx This file is in every node in a cluster. The server_ip is just an IP address which sometimes needs to change. I understand that it is easy to...

How can I get a MEF exported value by a class name?

c#,mef
I have a window called MainWindow and a viewmodel called MainWindowViewModel. I want to look into MEF's container to see if I can find <WindowName>ViewModel. The code I have is: CompositionContainer container; var catalog = new AssemblyCatalog(typeof(App).Assembly); container = new CompositionContainer(catalog); container.ComposeParts(this); container.SatisfyImportsOnce(this); I saw the method container.GetExports(Type, Type, String)...

Python and the zipfile module

python,python-2.7,zipfile
According to Python documentation: ZipFile.extract(member[, path[, pwd]]) Extract a member from the archive to the current working directory; member must be its full name or a ZipInfo object). Its file information is extracted as accurately as possible. path specifies a different directory to extract to. member can be a filename...

Plot power series gnuplot

function,gnuplot,power-series
I'd like to know how to plot power series (whose variable is x), but I don't even know where to start with. I know it might not be possible plot infinite series, but it'd do as well plotting the sum of the first n terms.

converting list of list to list of dictionaries with a special case in it

list,python-3.x,dictionary
I have list consisting of elements like this: [ [', , PropertyName, com.bs.ConsoleLogLevel, ', ', , Type, Integer, ', ', , Default, 3, ', ', , Description, "The logging level for outputting to console. (1 - Critical, 2 - Warning, 3 - Info, 4 - Debug, 5 - Trace)", ',...

Javascript / What I'm typing is what I'm seeing

javascript,html
I have an input field and a destination < span >. So, I want the typed data to appear simultaneously within my destination < span >...< /span>. button.onclick = function() { var newEvent = document.getElementById('event');//it's my input field var spanNewEvent = document.querySelector('dataEvent');//it's my destination place <span>...</span> newEvent.innerHTML = spanNewEvent.innerHTML;//does not...

Redirect all subfolder's home to index using 301

php,.htaccess,redirect,subfolder
My website structure is like Main (Root directory) index.php home.php Sub-folder index.php home.php There are many sub-folder under root directory. I am able to redirect main root home page to index by using following code Redirect 301 /home / Redirect 301 /home.php / But, I want to redirect all sub-folder's...

select result by IN LIST clause

sql-server,tsql
This is my Group table : +------+----------+------------------------+----------------+ | Id | IdParent | DateEdit | seeds | +------+----------+------------------------+----------------+ | 1000 | NULL | 2015-01-29 17:37:31.74 | 1001,1002,1003 | +------+----------+------------------------+----------------+ This is products table: +----+--------+-------------+---------+-----------+ | Id | IdKala | IdGroupChar | IdGroup | Matn | +----+--------+-------------+---------+-----------+ | 1 | 101 |...

Python: Freeze arguments into a class __init__ function

python
Suppose I have a class that looks like this: class MyClass(object): def __init__(self, some_arg, param=None): self.some_arg = some_arg self.param = param In most instances I initialize my class like this: obj = MyClass(1, param='some_string') But I'll occasionally have a code path which sets the param keyword argument based on some...

How come every class in Ruby inherits from Object?

ruby
How come every class in Ruby inherits from Object even though you never have to specify that behavior? You would expect something like: class Foo < Object; end but class Foo; end is enough. How does Ruby do this internally?...

When killing a process in C#, how can I be sure I'm killing the right one?

c#,process,wmi
Overall Goal I'm attempting to kill all of the processes by a certain name (notepad.exe below) that I currently own. Generally speaking, it's along the lines of: Get all of the applications with a certain name that I'm the owner of In this case, "I" will usually be a service...

Using Perl LibXML to read textContent that contains html tags

html,xml,perl,libxml2
If I have the following XML: <File id="MyTestApp/app/src/main/res/values/strings.xml"> <Identifier id="page_title" isArray="0" isPlural="0"> <EngTranslation eng_indx="0" goesWith="-1" index="0">My First App</EngTranslation> <Description index="0">Home page title</Description> <LangTranslation index="0">My First App</LangTranslation> </Identifier> <Identifier id="count" isArray="0" isPlural="0"> <EngTranslation eng_indx="0" goesWith="-1" index="0">You have...

Setting the background color of JFrame isn't working

java,swing,background,jframe
I've spent a fair bit of time researching how to change the background color of JFrame, but haven't managed to make anything work. My code in its current state looks like this: final ImageIcon cardIcon = new ImageIcon("cardImages/aceSpades.gif"); JPanel panel = new JPanel() { public void paintComponent(Graphics g) { super.paintComponent(g);...

css position relativ differentiates from absolute

css,position,absolute,relative
I got troubles using relative positions. Following code in css: #background { background-color: gray; position: absolute; left: 100px; top: 100px; width: 500px; height: 500px; } #p1 { position: relative; left: 100px; top: 100px; width: 10px; height: 10px; background-color: green; } In my opinion, the upper-left corner from background and p1...

How to display sql rows until next number is lower than the one before?

php,mysql,pdo
This is going to be hard to explain properly but i'll try to be clear and I hope someone will understand me and will be able to help. I have a sql table with something kinda like this: Year Weeks Trimester Weeks Unimportant Info 33 1 bla 34 2 bla...

Event handler executing but not showing effect

javascript,drop-down-menu,javascript-events
I'm working on a Javascript-based painting application, where I'm now making a menu, as if the client area was a desktop window. In this menu of course, I have some main tabs, their dropdowns with all the items and sometimes subtabs leading to child dropdowns. For my question, let's focus...

using sesions to post data into input using what if

php,session,session-variables
Im trying to create my first if else statement using a 2 page form. At the end of page 1 it uses sessions to save all the post data and automatically insert it into page2 form. Im trying to get it were if someone leaves the field blank it will...

Unable to resolve class field in django form

python,django,django-forms
I'm using some forms to retrieve some data from a checkbox with some choices that are dynamically generated. Here is my code: class PostForm(forms.Form): text = forms.CharField(label='text', max_length=1000) products = forms.MultipleChoiceField( label='product', widget=forms.CheckboxSelectMultiple) def __init__(self, choices, *args, **kwargs): super(PostForm, self).__init__(*args, **kwargs) self.products.choices = choices And when I call the object...

Allow only specific value range in DataGridView Columns' cells

vb.net,datagridview
I am moving along, albeit slowly, with this project. I have my DataGridView almost set to where I can proceed to the next section of the project. But one last thing that I have found that I need to fix: Problem I need to limit the range of values that...

Who updates pip package versions?

python,pip,package-managers
I was having problems with one package not doing what I read in it's documentation, until I noticed that pip installed a outdated version. On the pip package page it would seem like it was last update 2014, but when I installed, the package files were versioned mid 2013. How...

Only half of the shared memory array is assigned

cuda,shared-memory,nsight
I see only half of the shared memory array is assigned, when I use Nsight stepped after s_f[sidx] = 5; __global__ void BackProjectPixel(double* val, double* projection, double* focalPtPos, double* pxlPos, double* pxlGrid, double* detPos, double *detGridPos, unsigned int nN, unsigned int nS, double perModDetAngle, double perModSpaceAngle, double perModAngle) { const...

How do I instruct artisan to save model to specific directory?

laravel,laravel-5
I'm using Laravel 5. I have created a /Models directory under the /App directory, but when generating the models using Artisan it's storing them under the App directory. I have searched the documentation to try and find how to specify a different path name, but to no avail: php artisan...

block a direct call to a controller

java,spring-mvc
I'm working on a website using JAVA Spring mvc. I have a functionality that requires two controllers. First of all, the request is handled by controller1 who redirect it to controller2 using a return new ModelAndView ("redirect:controller2.htm"). All is working fine. However,I would like to block the direct access to...

Failed to generate resource table for split ''

android
I am trying to create an Android application. Currently it won't run and it will give me 2 errors. I am unsure on how to get the first error to go away as well as the second one. When I check the console this is what I get. [2015-01-29 16:16:48...

How can I add a button to MKPointAnnotation?

ios,objective-c,swift,mapkit
I just wrote few lines of code and got stuck trying add a detail button to my annotation point, I don't know how. Does anyone know how to do that? The image below shows what I want to achieve. Thanks! import UIKit import MapKit import CoreLocation class MapKitViewController: UIViewController, MKMapViewDelegate...

Writing Mat elements (uchar) to .csv

c++,string,opencv,csv
I want to output the content of a Mat object (OpenCV uchar) to a .csv file. Right now, I am able to write ints and doubles and even (it seems) the uchars but when opening the csv in Excel, the uchar are interpreted as characters so I can't inspect the...

Animation doesn't start after reopening the app?

animation,swift
Objective I need my app to scale a UIImage. Code To do so, I use this method: func animateStuff() { println("Animate stuff called!") let optionsAnimateStuff = UIViewAnimationOptions.Repeat | UIViewAnimationOptions.Autoreverse | UIViewAnimationOptions.AllowUserInteraction let value : CGFloat = 1.045 UIView.animateWithDuration(0.9, delay: 0.0, options: optionsAnimateStuff, animations: { println("Let's scale this image!") self.image.transform =...

CSS Adjust height of background-color while hovering on weblink ( tag)

html,css3
I'm currently designing a Nav menu that includes ul, li and a elements. I'm trying to produce an effect where hovering over an a tag will only change the background color near the text for the link itself instead of the whole li area around it. HTML: <nav> <div class="full_menu">...

How to Parse a JSON string with dynamic date in vb.net?

.net,vb.net,json.net
I am trying to parse this JSON string below so I can loop thru each show and episode from trakt tv site irrespective of the DATE. The json string is a sample from the actual and has only one date 2015-01-01 but the actual stream will have more dates. So...

google.maps.MapTypeId button size for signed-in maps

google-maps,google-maps-api-3
How do I change the size of map type switch button in API v3? Left image shows Google Map API v3 and right image shows normal Google Map, I want to change the size of this button in API to roughly the same as in normal maps. ...

jQuery blur event fires only once

jquery,ajax,onblur
I'm making a script to manage a shopping cart and I wanted to attach a blur event to the input field where you can change the quantity of a product. The problem is the event only fires once. After that I have to refresh the page to enable it again....

How do I use the code duplicate feature?

java,intellij-idea
I found this official topic about this feature in general, but strangely enough, it does not tell me how to use the feature, only that it exists somewhere. How do I use this feature?

How to subtract 1 day (calculate day before) in XSLT 2.0?

xml,xslt,xslt-2.0
Could someone please help calculate one day ago from a given date of type xsd:dateTime using XSLT 2.0? Sample Input: <?xml version="1.0" encoding="UTF-8"?> <objects> <LastRunTime__c> <Last_Run_Time__c>2015-01-29T19:55:15.846Z</Last_Run_Time__c> </LastRunTime__c> </objects> Sample Output: <?xml version="1.0" encoding="UTF-8"?> <objects> <LastRunTime__c> <Last_Run_Time__c>2015-01-28T19:55:15.846Z</Last_Run_Time__c> </LastRunTime__c> </objects> I was...

Registering an event handler for an entire class using jQuery?

javascript,jquery,html
I'm trying to find a simple, elegant way to create a "delete" button for a user's comments on a site I'm working on. Ideally, I'd like to register an event handler for a class called something like "delcomment" and then assign a unique id to individual comments' delete buttons. Soemthing...

Determine size of HTTP POST

android,http
I am writing an app that will send an id, latitude, and longitude to a server using an HTTP POST. The app will be using user data. Is there a way to determine the size in bytes of the post before I send it? @Override protected void onCreate(Bundle savedInstanceState) {...

Small query with Bootstrap

html,css,twitter-bootstrap-3
I'm helping a friend with a website and need some advice. We asked here before, and were told to update all the necessary jQuery files on the server, done that, but still broken. Website: 3six-d.co.uk If you go to the portfolio, you will see all the pictures are out of...

Passing TABLE type as parameter to PLSQL Procedure

oracle,plsql
I have a plsql block like so that basically sets bunch of flags in a collection to run procedures in a package: declare TYPE tRunFlagRec IS RECORD(tRunFlag BOOLEAN); TYPE tRunFlagTab IS TABLE OF tRunFlagRec INDEX BY VARCHAR2(64); vValidationsTab tRunFlagTab; begin vValidationsTab('some_validation_1').tRunFlag := true; vValidationsTab('some_validation_2').tRunFlag := true; vValidationsTab('some_validation_3').tRunFlag := true; vValidationsTab('some_validation_4').tRunFlag...

Twilio iOS unrecognized selector sent to Class

xcode,ios8,twilio,voip
I'm new to using Twilio and I'm hoping someone can help me debug my app. I am making a call to get a capability token and it is returned just fine. I print it in the console to check then it appears when I make the call to initWithCapabilityToken that's...

REST backend vs REST API (or API Backend)

angularjs,api,rest
I'm working on an application running on Google App engine (python) with the frontend in AngularJS framework. The backend of this app simply returns the relevant data as JSON upon a GET for example, the URL routes for which are configured in the frontend (as services etc). That is, the...

How to add “IF NOT EXISTS” to create trigger statement

sql,sql-server,tsql,if-statement,triggers
I am using sql server 2008 R2. More specifically, Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010 15:48:46 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1) (Hypervisor). I am new to sql server and procedures/triggers. I have the...

Prevent locking after process submission - PHP

php,jquery,mysql
I have a page where a user can select from multiple processes to run. The short version of what I want to accomplish is: Select a process, click Execute, and go about the rest of your work on the site while it runs in the background. The problem I face...

Add Reference Projects Blank Visual Studio 2013

c++,visual-studio,lnk2019
I'm using an SDK that I downloaded to develop an app in MSVS 2013. When I try to build my project I get error LNK2019: unresolved external symbol [email protected] referenced in function _main D:\Documents\Visual Studio 2013\Projects\Lola\Lola\Main.obj Lola After searching Google and the MDN I've narrowed down that I'm either using...

Python 2 - printing raw input into an array, formatting output

python-2.7
I'd like to take raw input from a user and then re-arranging the output in a different order. I have the code working, but the output has single quotes around each number. Here is the really simple code: CodeNumber=(raw_input("Please enter 4 digit number: ")) print "Code_A: %r%r%r" %(CodeNumber[3], CodeNumber[1], CodeNumber[0])...

Python position of a character in a string in a list

python,list,loops
So, say I have a list with 5 strings. The strings are seven characters long. list = ["000000A", "000001A", "000002B", "000003C", "000004C"] Now, with this list, I want to find what position the string is in the list which the 7th character is equal to A. Then I want to...

What does this mean? *** “Delete” argument “:destroy,” needs to be a number (Rails)

ruby-on-rails
I'm trying to run the following tests for destroying a model object. Here is one of the tests: it 'admin destroy' do login_as(admin) assert_difference('Topic.count', -1) do debugger; delete :destroy, id: topic.id end must_redirect_to forums_path end This test fails to destroy a Topic model object. Placing a debugger; in the cod...

Unable to find explicit activity class {}; have you declared this activity in your AndroidManifest.xml

java,android,android-manifest,android-intentservice
I'm trying unzip some files in background, so I use IntentService like in google's tutorial. My service class declared in AndroidManifest like this: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.osmdroid"> <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="21" /> <application android:configChanges="orientation|screenSize|keyboardHidden" android:hardwareAccelerated="true" android:icon="@drawable/ecn_icon" android:label="@string/app_name" android:theme="@style/AppTheme"...

Input Mismatch Exception Reading from a Scanner

java
This code is supposed to store all the values into an array of doubles called scores which I will use later. I am getting an exception. import java.io.*; import java.util.*; public class readFile { public static void main(String[] args) throws IOException{ double [] scores = new double[40]; Scanner input =...

Cognos - List report (Relational database) - Summary limitations

cognos
I have a Cognos report with Data like so. User Units TimeInHours UnitsPerHour Smith 10 1 10 Smith 30 2 15 In my report I group by user. I can do a total on Units and Hours, but how can i summarize units per hour? Its not the average 10+15/2...

Python3 ValueError: too many values to unpack with for loop

python-3.x
I've seen this same question asked around, but it's always with something like: val1, val2 = input("Enter 2 numbers") My problem is different. I have two strings, str1 and str2. I want to compare them byte-by-byte such that the output would look something like this: str1 str2 0A 0A 20...

Ember.js - Index route vs. “top-level” resource route?

ember.js
When creating a "standard" crud resource in Ember.js, what is the difference between the index route and the "main" route? For example, a users resource: // app.router.js Router.map(function() { this.resource('users', function() { this.route('new'); this.route('show', { path: '/:user_id'}); this.route('edit', { path: '/:user_id/edit'}); }); }); Which route should contain the following "main"...

Sitecore How to Use Insert Rule

sitecore
I'd like to get the parent value in its child item. Parent and child are using same template (I mean it is the same standard values) and if parent updates the one of field value in content (not in __standard values), the same field in child item also changes. I...

sql sp_sqlexec dealing with single quotes in statement

sql,sql-server,tsql
I'm using sp_sqlexec and was wondering how you deal with single quotes within the statement string 'problem' declare @id int =1 declare @sql nvarchar(200) set @sql = ' insert into mytable (col1,col2) values (1, 'problem') ' exec sp_sqlexec @sql ...

Is it not possible to use PHP and grab an XML file?

php,xml
Why can't I use PHP in an .xml file at the same time grab it with SimpleXMLElement? When one works, the other doesn't. Example: If I use PHP in the .xml file like file.xml.php <?php require('db.php'); header('Content-Type: application/xml; charset=utf-8'); $updated_date = date('l', filemtime('file.xml.php')); ?> <?xml version="1.0" encoding="UTF-8" ?> <content> <value...

Symfony2 Redirect user after succesfull register with FosUserBundle

symfony2,fosuserbundle
I have tried a lot of method to resolv this problem, but it's still not working. What i want, is than after the user success to register he is redirecting to the wanted page. So, i have a UserBundle with : in UserBundle/EventListener namespace MDB\UserBundle\EventListener; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use...

MethodType transformation for MethodHandle to accept Array Object paramters

java,invokedynamic,methodhandle
I want to adapt String.startsWith from (String, String)boolean to (String[])boolean, so that it can accepts String[] parameters, in which first two parameters will be mapped to the (String, String). Therefore, I wrote below sample code: MethodHandle test =MethodHandles.publicLookup().findVirtual(String.class, "startsWith", MethodType.methodType(boolean.class, String.class)); String[] myArgs = {"result", "data", "sijie"}; MethodHandle adapt =...

MySQL Syntax Issue combining to working queries

mysql,sql,syntax
I'm just starting to learn SQL, and managed to cobble together a couple of working queries, but then when I combine them I am getting a syntax error. The query throwing the error: SELECT sca_ticket_status.name As Status, AVG(QueueTime) FROM (SELECT DateDiff (created, now()) as 'QueueTime' FROM sca_ticket as SubQuery LEFT...

How would I get the html of a page that contains dynamic content?

javascript,jquery
I need to get the html of a page whose content is generated dynamically via Ajax. * From a different page. I know I can use Ajax to get the html of a page, but since the content is dynamic it wont be there yet. $.get( "ajax/test.html", function( data )...

Building firmware Patch for embedded applications

c,linker,embedded,firmware,iar
I have a library stack that is not going to change, and an firmware that is going to use only this stack. Firmware will change alot along the way. I don't want to every time release the whole image(including library stack) because of limited memory and resources issue(This is an...

ColdFusion Multi Check isDefined(session) and is not blank

coldfusion
I am trying to say if this isDefined and is not blank show this.. <cfif (isDefined("session.checkout.info.Certificate_2")) is not ""> I also tried: <cfif (isDefined("session.checkout.info.Certificate_2")) neq ""> Will someone please tell me why this still shows when the string is empty?...

What is the new way of creating sql lite open helper class in android

android,sql,sqliteopenhelper
I am new in android developer I used to use in sql lite open helper but lately I heard about a new way of creating sql lite database (maybe it's not true, I don't know ) I will be glad to hear if you guys know something about it. Thanks...

Is the error: “make: *** No rule to make target `SpecProj_scd.mk'. Stop.” causing my app to crash?

eclipse,android-ndk,make
My 1st clean & build gives this error: make: *** No rule to make target `SpecProj_scd.mk'. Stop. Building a second time, the error is removed. Note that ndk-build, builds fine. So I run the project on my actual device, a Tablet, and the app crashes. LogCat: 01-29 16:48:48.081: E/Trace(3766): error...

Pass HTML Table to Google Spreadsheet. Get Cell Values out of a Dynamic Table

javascript,html,dom,google-apps-script,google-spreadsheet
I have a table within a form that looks like this: The HTML and JavaScript <form> <table border="1" id="tblSample"> <tr> <th>Col_one</th> <th>Col_two</th> <th>Col_three</th> </tr> <tr> <td><input type="text" name="txtRowa1" id="txtRowa1" size="5" /></td> <td> <input type="text" name="txtRowb1" id="txtRowb1" size="15" /> </td> <td> <input type="text" name="txtRowc1" id="txtRowc1" size="15" /> </td> </tr> <tr>...

Over 4,000 Redirect 301 lines in .htaccess file

.htaccess,cpanel
I have a re-design of my site happening shortly where all the URLs are changing. Here's what I have put together so far http://cricketweb.net/new-design%20htaccess Some research I've done has shown that this many lines within the .htaccess file is going to slow performance quite a lot. I asked my hosting...

Javadoc for a New java maven project in eclipse

java,eclipse,maven,javadoc
I created a new Maven project and generated Javadocs through eclipse. It created a lot of html files in the project directory inside a folder called "doc". Now I want to distribute this project as a dependency to my colleague and he does not have the source of the project...

Setting ColorField does not change colour of ScatterLineSeries in Telerik UI for ASP.NET AJAX

c#,asp.net,ajax,telerik,radhtmlchart
I am trying to make a ScatterLineSeries to show up as a desired colour but they never set to the correct colour and Telerik just always uses its default colors to draw the markers and lines. I've rewritten my code in two styles and neither have worked in getting the...

Dynamic variable creation using eval javascript

javascript,jquery
I need something like an associative array that contains pairings of variable name / element ID. Looping through this array/object, assign the element ID to the variable name that is its counterpart. Something like this: jsFiddle HTML: <input id="fld_1" class="input" type="text" value="bob" /><br> <input id="fld_2" class="input" type="text" value="fred" /><br> <input...

Filter Ruby array of objects for any of multiple criteria?

ruby-on-rails,ruby,arrays
How can I filter a Ruby array for objects that meet any of several criteria? For example, if I have an array of blog posts (each with a title, content, and zero or more tags), and I have a search term of "vacation", how do I return a list of...

initialize C++ array based on input arguments

c++,arrays
I need to build 2D array of bitset, and I want to get the size of the array and size of bitset from user. Since its template and the value must be const how can I do that? int main(int argc, char* argv[]) { int const LEN ; int const...

pandas display results grouped by column

python-3.x,pandas
I'm trying to essentially do the same as a pivot table in Excel would do but using pandas. Here is some of my data: First_Name Last_Name Country Prize_Money Roger Federer SUI 88691538 Novak Djokovic SRB 72444493 Rafael Nadal ESP 71421511 Andy Murray GBR 34190085 David Ferrer ESP 24928109 The output...

Adding own annotation to dynamic skip test in TestNG

java,testng
I would like to provide elegant mechanism to skip chosen tests when value of some environmental variable is not admissible. I chose adding my own annotation @RunCondition to define which value are allowed for particular tests. Then I created my own listener for TestNG that marks tests as disabled when...

My javascript stops working after ajax response

javascript,css,ajax
For some reason my javascript stops working after I have submitted a POST request. Here is what is happening. I load my webpage, fill out the form and click 'Click me' : Next I click ok in the alert popup and the expected result appears: I fill out the form,...

Is there a Netbeans “tag” for line number

java,annotations,netbeans-8
Are there any Netbeans "tags" (ala @...) that will (upon compiling) insert the line number that the tag is on? So, if the tag is on line 50, Netbeans will replace the tag with "50"? I thought when throwing an exception, it might be a good idea to reference the...

Apache Storm application fails at run

java,maven,classpath
I am encountering a problem at runtime, when my application can't find classes listed in maven as dependencies at compile. The application compiles without issue. The application is as follows package com.ender.storm; import backtype.storm.Config; import backtype.storm.LocalCluster; import backtype.storm.topology.TopologyBuilder; public class HelloStorm { public static void main(String[] args) throws Exception{ Config...

Getting a Chrome app window to open at the bottom right of screen

javascript,google-chrome,google-chrome-app
I would like my Chrome app to open so it's touching the task bar and just offset from the right of the screen. My current code: chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('window.html', { 'bounds': { 'width': 300, 'height': 325 }, 'resizable': false, frame: 'none' }); }); ...

Get objects from list in Linq to new list [closed]

c#,linq,list
I am trying to test if a question exists in a control and then selecting the question text to add to a list. I have a list of 20 questions. Only 7 are visible on the screen. I want to get the objects from a list that correspond to the...

condition inside numpy index bracket?

numpy
I'm looking for numpy documentation stating this following operation can be done. Could someone tell where I should refer to? image = np.arange(12).reshape((4, 3)) image[image < 10] = 0 >> image [[ 0 0 0] [ 0 0 0] [ 0 0 0] [ 0 10 11]] ...

Add words referenced in a cell to the end of a new word in a separate cell

excel,vba,excel-vba
Alright for this project I am trying to take columns headers and combine them in row headers in one column. For instance There a column header plant store it has rows with corresponding data tr1, tr2, tr3. I want to make one full column with the data so it appears...