FAQ Database Discussion Community


Appending outputs to existing text file

powershell,append,powershell-v2.0,system.io.file
I have this piece of powershell code below which creates an individual text file in the folder C:\Users\XX\Desktop\info\ from each individual zip file in the folder C:\Users\XX\Desktop\Powershell\Zip, with the name of the text files being the name of the zip files. Get-ChildItem -Path "C:\Users\XX\Desktop\Powershell\Zip" -Recurse -exclude '*.info' | ForEach {...

Same SQL Server 2012 tolerates backward SQL syntax depending on which database is in use?

sql,sql-server,datetime
I have encountered a situation where an SQL Server 2012 seems to tolerate SQL syntax e.g. for adding DATETIMEs to DATEs (see here) depending on which database is in use. Could this be the case, and if so what determines the amount of backward compatibility that is tolerated by the...

Image file to PDF Conversion in Windows Phone Silverlight 8.1

c#,pdf,windows-phone-8.1
I am writing Windows Phone 8.1 Silverlight app, I have to convert Image File to PDF. Is there any way, how to do it and which Libraries are available freely? Thanks!!...

Can't save sound from microphone

c#,audio,save,microphone
I use the part of code below to enable the microphone to record and then i save it and play it with 2 buttons. But if in savedialog i save my .wav in desktop folder everything is fine and it create the test.wav(example) but if i will try to save...

SSRS report parameter

c#,.net,sql-server,reporting-services
I have a problem with rendering report with correct parameter. We have RDL report that has date parameter with default value which is an expression "=today()". In project i have the following code in c# for(int i = 0; i < 15; i++) { serverReport.SetParameters(new ReportParameter("dt1",date.ToString())); File.WriteAllBytes(path, serverReport.Render("PDF")); } For...

Scroll XAML ListView line-wise instead of item-wise

c#,xaml
Is it possible to configure ListView so that it scrolls line by line, instead of scrolling an item at once, which is the default behavior even if the item is multiline?

count all raw values in mysql

php,mysql,mysqli
All i am doing is saving user ratings and reviews to table and then calling it from database. Now what I want to do is add all the ratings (like: 5+4+3= 12) and then divide them by count of the ratings (12/3 = 4) and get average rating or aggregate...

Sorting CSV with record delimiter that is not a newline or zero byte

sorting,csv,awk
My CSV looks something like this: "212314334","a sentence with new line in it \n this is the next line","kajdfad","213",ENDOFLINE\r\n "212314333","another sentence with new line in it \r\n this is the next line","kawad","21453",ENDOFLINE\r\n So there could be newlines in the middle of a record. There could also be non-printable characters in...

How does a Bootstrap modal change the page's opacity?

twitter-bootstrap-3,bootstrap-modal
When opening a Bootstrap modal (eg the GetBootstrap modal sample), the rest of the page is subtly faded out to draw attention to the modal: How is Bootstrap accomplishing this? It seems that the class .modal-open is added to the body, but this only sets overflow: hidden. What else is...

Node js Mongodb collection.find() query result outside scope

node.js,mongodb
I wane collection.find() query result outside the queryfunctin var fol; Folder .find({'parentid':id,'stats.archive':'0'}) .lean() .exec(function(err, f_folder) { if(!err) { fol = f_folder; } }); console.log(fol); // I want query result here Please, give me solutions why query does not return result outside function...

RelativeSource binding can't find Frame ancestor

c#,wpf,xaml,binding,navigation
I'm trying to pass as a CommandParameter the actual Frame object to which I'm applying the Command XAML <Frame NavigationUIVisibility="Hidden" Source="{Binding TargetContentPage}"> <i:Interaction.Triggers> <i:EventTrigger EventName="ContentRendered"> <command:EventToCommand Command="{Binding ContentRendered}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Frame}}"/> </i:EventTrigger> </i:Interaction.Triggers> </Frame> C# public RelayCommand<Frame>...

PHP - prevent overwriting data in a file

php,file,overwrite
I have created a simple databaseless CMS. When saving a file, the PHP opens the corresponding file, adds the new data, and closes the file (using file_put_contents). This all works well - until the same file is saved twice (or more) simultaneously. By which I mean when a file_put_contents function...

Edit Regular Expression from Java to JavaScript

java,javascript,regex
Hi i have a problem with RegEx i have my expression in Java for split input to arrays, but this expression don't work in JavaScript: (?<=</d[12]>)\\d*(?=<d[12]>) I have some dialogue <d1>bla bla bla</d1><d2>bla bla bla</d2><d1>bla bla bla</d1> And i want to output split into array [<d1>bla bla bla</d1>,<d2>bla bla bla</d2>,<d1>bla...

Drag div inside div (child > parent)

jquery,jquery-ui,containers,drag
I tried a lot of things, but I can't get it work: I have a div inside a div, and want the child (= inner div) be draggable only within the parent. The thing is: The child is bigger than the parent and everytime I want to drag the child...

Multi-threading, consumers and producers

c,linux,multithreading,unix
I have a problem with multithreading, since I'm new to this topic. Code below is code I've been given from my University. It was in few versions, and I understood most of them. But I don't really understand the nready.nready variable and all this thread condition. Can anyone describe how...

jquery menu slide and change button text

javascript,jquery,css3,drop-down-menu,jquery-animate
ok so im using the slide menu from here slide menu and i want to change the button text when its clicked to say show or hide for example,this is the code i have for only top menu so far on my offline install <button id="showTop" class="menubtn" data-text-swap="Show">Show</button> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>...

MySQL - Searching From 3 tables with one query

mysql
I have 3 table Table news: id_post | news | id_user 3 | IT news | 1 4 | game news | 2 Table user: id_user | username 1 | bocah 2 | gundul And Table vote id_vote | id_post | id_user | LIKE 10 | 3 | 2 |...

How to pass arguments from vimscript functions to python interface?

python,vim
For example, processing positional arguments: function! Example(arg) python <<_EOF_ # do something with a:arg _EOF_ endfunction or the ... list: function! Example(...) python <<_EOF_ # do something with a:000, a:1, a:2, etc. _EOF_ endfunction Is there anyway I can do this?...

AngularJs $watch issue

angularjs,controller,directive,watch
in my application i have a controller and a directive which i use to draw a chart. so my model is like this: $scope.d3DataGraph ={"selected":{"node":"","impiega":[],"impiegato": []} , "nodes":[],"links":[]}; in the controller i've set up a function that adds some data to the model: $scope.d3DataGraph.nodes.push(articolo); then i have the directive which...

How do I perform Aggregation over the column qualifier field in Accumulo?

java,hadoop,accumulo
Suppose I have a Table like this in Accumulo: a cf1:cq1 [ ] 1 b cf1:cq1 [ ] 3 c cf1:cq1 [ ] 2 And if i apply the SummingCombiner on this table and insert a row "a cf1 cq1 2" then I would get the result as: a cf1:cq1...

Send image from one UIViewController to another

ios,objective-c,iphone
I want to pass one Image that i take from gallery or camera and i want it to pass on next view. I do it by the code. PhotoDocumentViewController *objectPhotoDocument = [[PhotoDocumentViewController alloc]initWithNibName:@"PhotoDocumentViewController" bundle:nil]; [objectPhotoDocument.imgSelectedPhoto setImage:finalImage]; [self.navigationController pushViewController:objectPhotoDocument animated:YES]; Here imgSelectedPhoto is the UIImageView that i declared on next view(PhotoDocumentViewController)....

why ViewStates instead of Sessions

asp.net
why we use to store data in ViewState? even we have Sessions to do the same job? Session["Data"] vs. ViewState["Data"] What's the difference?...

Method definition and naming conventions in Ruby

ruby-on-rails,ruby,railstutorial.org
I come mainly from a C# background, and currently I am learning Ruby on Rails. Reading through railstutorial.org, I see a lot of code like this (this one is Listing 10.49): class PasswordResetsController < ApplicationController before_action :get_user, only: [:edit, :update] before_action :valid_user, only: [:edit, :update] . . . def edit...

RSACryptoServiceProvider decrypt using only private key

c#,.net,encryption
I need to generate a license key for an application. I thought about using RSACryptoServiceProvider, but I noticed that the private key generated using ToXmlString(true) also contains the public key. The problem is that the application will be stored on the clients servers and I don't want them to be...

Bootstrap dropdown in Kendo table?

html5,css3,twitter-bootstrap-3,kendo-grid
I am having problem with z-index of bootstrap dropdown in kendo table here is working fiddle http://jsfiddle.net/DTcHh/3142/ The dropdwon goes under table body, i dont know where is issues? HTML <table class="table"> <thead> <tr> <th><span>Row</span> <li class="dropdown"> <a href="#" data-toggle="dropdown" class="dropdown-toggle">Messages <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="#">Inbox</a></li> <li><a...

Get Index of 2D array in Python

python,arrays,numpy
I use osgeo from gdal module for processing geographic raster data. #Get size of input raster (cols, rows) cols = ds.RasterXSize #3531 rows = ds.RasterYSize #3314 So to read all the data, I create an array: data = band.ReadAsArray(0, 0, cols, rows).astype(float) Result of ReadAsArray is a 2D numpy array....

How to stop from appeding the the value to just updating the value in jQuery?

javascript,jquery,dom
I am trying to prevent the player from getting added again with the new value, rather I would like to just update the quantity.. HTML <div class="playerTypeBlock" data-player-type-id="1" data-player-value="10.00"> <div class="heading">Ninja</div> <div class="price">$10</div> <a class="addToTeam" href="#">Add player</a> </div> <hr> <div class="playerTypeBlock" data-player-type-id="2" data-player-value="20.25"> <div class="heading">Samurai</div> <div...

Google Analytics demographics For Android App

android,google-analytics,google-analytics-api,universal-analytics,tracker
I used Google Analytics Demographics on android app using Google play service library. i have updated my android code using enableAdvertisingIdCollection(). its working fine with screens and data. But its demographics info isn't working? Please suggest how do i handle demographics. thanking you. Code : Application code : ... synchronized...

SSRS, SQL - Select multiple email addresses as [CC] in Data Driven Subscription

sql,reporting-services
I'm looking to CC 2 people in a Data Driven Subscription Here's what I currently have CC'ing one person I've provided little detail I know, let me know if you need anything else SELECT eUserName as UserName, er_EMailAddress as [TO], er_FullName as FullName, CONVERT(VARCHAR(10),GETDATE(),103) + ' - Outstanding Calls for...

Linking Error while integrating PayPal MPL in IOS

ios,paypal,linking-errors
I am integrating PayPalMPL in my IOS app. After integration, it is working fine in IOS simulator but when i tried to run in external device i.e; in I-pad, then it shows an error which says ld: file is universal (4 slices) but does not contain a(n) armv7s slice: /Users/.../Library/libPayPalMPL.a...

Assign variable value to div

javascript,jquery,html
This is my JavaScript code: $("#rate").live('blur', function(){ var rate=$(this).val(); var qty =$('#quantity').val(); var amt=rate*qty; alert(amt); document.getElementById("amount").innerHTML = amt; }); Here I am getting the correct amount in amt variable . Now I just want to assign it to amount div. So how do I do that?...

Round up numbers in gvisTable

shiny
I am new to googleVis and I simply cannot get it to round up my numbers in my table to upto 2 places of decimal. Any help will be greatly appreciated. Currently I am using the code gvisTable(round(data_frame),2) I have tried gvisTable(data_frame, formats=list(data_frame="##.##")) but has not helped...

What methods should be contained in the DAO? [closed]

java,dao
The question is about the pattern understanding itself, not about a specific implementation. I've read about the DAO pattern and the question that arised was what methods should be neccessary included in the DAO? For instance, public interface UserDAO{ public User getUserById(Integer id); public void deleteUser(Integer id); public void updateUser(Integer...

how to overcome CString error

objective-c,swift
how to overcome this error func selectFunc(){ var selectQuery="select * from EmployeInfo" var cSql:CString = selectQuery.bridgeToObjectiveC().cStringUsingEncoding(NSUTF8StringEncoding) var result:CInt=0 var stmt:COpaquePointer = nil result = sqlite3_prepare_v2(appDelegate.database, cSql, -1, &stmt, nil); if result != SQLITE_OK error occurred use of undeclared CString.how to overcome this error ...

Security on hashing passwords with CryptoJS and then use php password_hash()

javascript,php,security,hash,cryptojs
So I got my own little project that I work on and I have a login for my friends to login and post news and update another thing. This site will never hold any personal information, it's just for my own education. So my question is: Do I need to...

Hibernate @Filter on @OneToMany relationship has no effect

hibernate,filter,querydsl
i'm using Hibernate to map my entities and QueryDSL for the queries. My entity Sector has many Familia and I want to filter only those that FMODIFICACION column is null. This is my Sector entity: @FilterDef(name = "FAMILIA_FILTRO_FECHA") @Entity public class Sector { ... private List<Familia> familiasList; @OneToMany(mappedBy = "sector")...

Can I configure Vagrant to setup a synced folder only if it exists on the host?

vagrant
For our developers ~/Development/framework_repo is normally available on the host, but for our designers it wouldn't be. Is it possible to conditionally configure a synced folder depending on it's availability on the host?

bind parameter from a collection [closed]

angularjs
Below I have function called setProject() inside this function I have to send Id but value is not binding. <tr ng-repeat="Project in Projects"> <td> <div> <input type="radio" ng-click="setProject({{Project.Id}})"/> {{Project.Nm}} </div> </td> </tr> ...

How to add back the “loading” Element after removed it from Parent?

gwt
Ok, in war/MyProject.html, I have: <body> <div id="loading"> <div id="waitingForLoading"></div> <BR/> <img src="../images/loading.gif" /> </div> ... </body> in MyProject.java public class OfflineMatching implements EntryPoint { @Override public void onModuleLoad() { // this code works fine if(DOM.getElementById("loading")!=null){ DOM.getElementById("loading").removeFromParent(); } Button myButton=new Button("Enter Main Page"); RootPanel.get().add(myButton); myButton.addClickHandler(new...

how to switch between left and right css rules using Jquery?

jquery,css,css3
I have used css class, for example .dropdown-menu{right:0;} Now I just need to replace css property at client side, that is .dropdown-menu{left:0;} ...

Select and insert multiple row values from a listview to a database [closed]

vb.net,sqlite,listview,visual-studio-2013,sqlite3
I'm having a dilemma about my code, I want to select multiple values from a ListView, example table: Number-|Name------|Surname 1---------|Travis------|Stever 2---------|Claudio----|Sanchez 3---------|Wes--------|Styles Like so. I want my ListView to be able to select multiple rows, so in my example I'll select Travis and Wes only, and when I click a...

Script that changes content of a div throught a select doesn't work in Firefox

javascript,jquery,internet-explorer,firefox
The purpose of my code is to make visible a div that has the same id that the select option I've chosen. But there is more stuff. The div to make visible has an iframe that has to be resized fitting the content. Each iframe contains an Excel sheet (in...

Wildfly cluster and Apache2

apache,wildfly-8,mod-cluster
I browse a lot, I see this question is similar to other already posted but solutions seem not working in my case. I built a Wildfly.8.2.0.Final cluster and I want to put it behind httpd, cluster is running correctly. On my host I run three Debian Wheezy guests, two of...

Different color per dataset

colors,indexing,gnuplot
After 2 days of trials and errors, I ask for help here since I am totally lost with gnuplot. All I want is to display a few datasets in different colors, with named columns. Here is the result: First problem: lines on the graph have different colors but in the...

Pass pimpl argument to a pimpl object

c++,argument-passing,pimpl-idiom
I've two classes that implement PIMPL: State and StateMachine. They implement Private::State and Private::StateMachine. Private::StateMachine has an "addState(Private::State &)" method. I want to write the addState() method into its PIMPL class, in order to do StateMachine machine; State state; machine.addState(state); How can I pass to Private::StateMachine inside StateMachine the object...

Fields based dynamic mapping elasticsearch

elasticsearch
Can I use wildcard pattern to determine index analyzer for elasticsearch? For example: "properties": { "0_*" : {"type": "string", "index_analyzer": "standard" } , "1_*" : {"type": "string", "index_analyzer": "my_analyzer"} } So now if there is a new field when I index the document like { "0_title" : "some string", //...

Reliably and definitively detect end of socket stream

c#,sockets,serialization
I'm fixing to use sockets to stream a sequence of bytes across a network. I'm using a binaryformatter to serialize the objects I wish to send, then just beam them between machines and deserialize them when the reach their destination. The question has been asked before "how do I detect...

NSDateFormatter gives back totally wrong value [duplicate]

ios,objective-c,nsdate,nsdateformatter
This question already has an answer here: NSDateFormatter wrong string after formatting 4 answers if (component != kDayComponent) { NSInteger i_d = [_datePicker selectedRowInComponent:kDayComponent], i_m = [_datePicker selectedRowInComponent:kMonthComponent], i_y = [_datePicker selectedRowInComponent:kYearComponent]; NSString *d = _days[i_d]; // NSString *m = [_months[i_m] length] == 1 ? [NSString stringWithFormat:@"0%@", _months[i_m]] :...

Instruments > Automation - Script and Editor Log open simultaneously

instruments,ui-automation,ios-ui-automation
In the Instruments Automation tool, is it possible to have the Script and Editor Log panes open simultaneously (e.g. vertically split)?

Column delimiters in responsive design

css,twitter-bootstrap,twitter-bootstrap-3,responsive-design
Let's say I have 4 icons that I want to lay out responsively so that they are horizontal if there is space and vertical otherwise: Desktop: □ | □ | □ | □ Tablet: □ | □ □ | □ Mobile: □ □ □ □ In Bootstrap this can be...

Create a batch file to run an .exe with an additional parameter

batch-file,cmd
I need a batch file which will do the following: 1. Open CMD and navigate to a location C:/Users/...../program.exe 2. Run the program.exe with an additional command to point it to a config file: e.g. "program.exe C:/Users/..../configFile.bgi" How can I do this? I tried this but with no luck: start...

Adding message in a block of Specs2 test

scala,unit-testing,specs2
I am new in Specs2. I read the specs2 documentation but it's kinda confusing. I don't know if it's possible or not. So I have Specs2 test code roughly like this: "DataServiceTest" should { "InsertNewData" in { val name = "some name here" val description = "some description here" //...

What will happen if two processes modify data in two transactions at the same time and there is a unique constraint on the table?

postgresql,triggers,transactions,race-condition,unique-constraint
I am thinking about a race condition in a production system I am working on. Database is PostgreSQL. Application is written in Java, but this is not relevant. There is a table called "versions", which contains columns "entity_ID" and "version" (and some other fields). This table contains versions of a...

415 Unsupported Media Type Using JQuery/FormData and Web Api

javascript,c#,jquery,web-api
I'm getting a Error : "POST {URL} 415 (Unsupported Media Type)" error And cannot figure out why it's happening. I'm trying to upload an excel file in JQuery using FormData. Here is the code: var formdata = new FormData(); var file = input.get(0).files[0]; formdata.append('content', file); var url = "/Phrase/Import/" +...

Rails4 Mongoid inheritance + Strong Paramters +Nested attributes

inheritance,ruby-on-rails-4,mongoid,nested-attributes,strong-parameters
I have the following code skeleton where a Column embeds_many Contents of types Image and Map: class Column include Mongoid::Document embeds_many: contents accepts_nested_attributes_for :contents, allow_destroy: true end class content include Mongoid::Document field :description end class Image < Content field :src, type: String end class Map < Content field :latitude, type:...

How to flip a sprite among X or Y axis in cocos2d-python

sprite,cocos2d-python
I´m starting with cocos2d for python and would like to flip a sprite among its x (or y) axis. From what I gather this should be possible with the underlying pyglet lib but I couldn´t figure out how. I tried it like this: class Ninja(cocos.sprite.Sprite): def __init__(self): super(Ninja, self).__init__("Idle__000.png") self.flip_x...

Missing something in my C# count for integers code

c#,arrays,for-loop,character,counting
I'm doing some excercises for school and ran into a problem. When I try to count the characters in a array it just gives back the array itself. Can anyone tell me what I'm missing? The code is in C#. public static int CountFor(int n) { int count = 0;...

Unable to 'check' datagridview checkboxes

vb.net,checkbox,datagridview
I've added a checkbox column to my datagridview. Problem is I cannot check the checkboxes. I have removed all read only from columns. I add this column using the Designer.

Media is not playing from raw folder

android
i have the following code: animalGallery.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { // TODO Auto-generated method stub animalView.setImageResource(symbolIds[arg2]); String imageName = getResources().getResourceEntryName( symbolIds[arg2]); Toast.makeText(getApplicationContext(), imageName, Toast.LENGTH_LONG).show(); int audioId = getResources().getIdentifier( imageName, null, getPackageName()); try { MediaPlayer mp =...

Is angularjs recommended for large scale authentication based applications?

javascript,ajax,angularjs,security,authentication
It has been some time now that i am learning and using angularjs framework, and although some of it's features are truly awesome, it seems to me as if it's key features are a bit problematic for authentication based applications. Let's look at an example. Let's say i have a...

Nexmo - how to send messages to US/Canada based mobile numbers

nexmo
I am trying to send SMS to the people all over the world using a non-registered short codes, but the sms cannot be delivered to US or Canada. How do I achieve this? Is there an API to get information of the country using a phone number, so that I...

Serializing map using @JsonProperty

java,json,serialization,jackson
I try to serialize an object that contains a Map using the @JsonProperty annotation, but when I tested it I saw that only the keys of the map are serialized. I looked it up but found no solution, what am I doing wrong? public class People { private final Map<Long,String>...

log4js-node in nodejs not logging to file

javascript,express,error-handling,log4js-node
Not a node expert, and this is the first time I'm using log4js-node. I am trying to get my ERROR logs and any of my console logs to write to a log_file.log file with log4js on a nodejs server running Express. Here is my config file:` { "replaceConsole": true, "appenders":...

Pycups on Bitnami Odoo Stack

python,odoo,cups
Hi I am trying to install pycups in my Windows 8 PC. But don't Know how to do it. I am getting an error : C:\Users\Manish>pip install pycups Collecting pycups Using cached pycups-1.9.70.tar.bz2 Installing collected packages: pycups Running setup.py install for pycups building 'cups' extension C:\Users\Manish\AppData\Local\Programs\Common\Microsoft\Visual C++ for Pytho n\9.0\VC\Bin\amd64\cl.exe...

Jquery move every third row (before dom-manipulation) up one row

jquery,css,dom-manipulation
I have a table which I want to reorganize. The table looks like this: <table border=1> <tr> <td>image 1</td> <td>image 2</td> <td>image 3</td> <td>image 4</td> </tr> <tr> <td>text 1</td> <td>text 2</td> <td>text 3</td> <td>text 4</td> </tr> <tr> <td>image 5</td> <td>image 6</td> <td>image 7</td> <td>image 8</td> </tr> <tr> <td>text 5</td>...

Semantic versioning of REST apis?

api,rest,versioning,semantic-versioning
I've evaluated a number of versioning schemas for REST apis (header, url, …). So far, the most reliable approach seems to be the url option: It works with proxies, and does not rely on obscure schemas such as dates for versioning. Now, when I look around, everybody who uses the...

Ember template renders function as string

ember.js,handlebars.js
I'm new to ember and got a problem with a template. My route import Ember from 'ember'; import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin'; export default Ember.Route.extend(AuthenticatedRouteMixin, { model: function(params) { var pageNum = params.page || 1, pageRows = 8; return this.store.find('account', { page: pageNum, rows: pageRows }); }, setupController: function(controller, model) {...

SQL Server deleted records even though there was an error in the subquery which located in where clause with IN tag [duplicate]

sql-server,tsql
This question already has an answer here: sql server 2008 management studio not checking the syntax of my query 2 answers As you see from these images, the ROSHEADERID column is invalid and when I execute the first one it returns a meaningful message. But when I use this...

how to read ntfs master file table using c++

c++,ntfs,ntfs-mft
I want to enumerate all the files on a disk. I am using WinAPI FindFirst/FindNext for enumeration. But this method is taking a alot of time. I read somewhere that we can enumerate very fast by reading the ntfs master file table which contains all the information regarding every file...

Comparing 2 text files with different content in java (for each lines in text1 need to compare to each line in text2) [duplicate]

java,file,loops
This question already has an answer here: comparing two collections for comparing two text files for additions, deletions, modifications 4 answers I am trying to compare two .txt files (their contents), but when I execute this code my application goes into one time loop. I want to compare line...

Sortable.js is not working: List items are not draggable

javascript,twitter-bootstrap,sortables
I have tried a very simple example with Sortable.js: Two lists: One is currently empty, and will store item copies from the other list (which is static). I tried defining pull and put values for each list, defining the same group name, but it does not work. In fact the...

Pusher on route not sending event in Laravel

laravel,websocket,push-notification,real-time,pusher
I am creating a test app using Pusher for real-time notification on Laravel 4. As I am testing the said API, I am having difficulties on making it work. I have this on my routes.php: Route::get('pusher-test', function(){ return View::make('pages.test'); }); Route::any('test', function(){ $pusher = new Pusher('key','sect','app_key'); //my keys are correct....

Why System.arraycopy() function is not creating copy but returning reference to the same array?

java,arrays,clone,arraycopy
I have written following piece of code to check the behavior of System.arraycopy and clone functions. I expect these functions to return a copy of the array but all they are doing is returning a reference to the original array, which is evident from the later part of program where...

What is the best way to storage a custom class in Android?

android
On my android app I'm using a custom class, that extends from application, to share persistent data between activities and what I want to know is the best way to store that class ? With this I mean; what is the best storage option for my custom class so, if...

applying specific css to added edges in cytoscape edgehandles

cytoscape.js,edges
I want to add specific CSS (for instance a specific line-color) to certain, but all, edges added with cytoscape.js-edgehandles.js. I used to cy.edges(selector) command to apply a specific line-color (red) to the edges with source ('I'). But this only works for already existing edges, but not for added edges. $('#cy').cytoscape({...

How to get DropDownList SelectedValue in Controller in MVC4

c#,asp.net,asp.net-mvc,asp.net-mvc-4
I have dropdownlist, which i have filled from database. Now i need to get the selected value in Controller do some manipulation. But not getting the idea. Code which i have tried. Model.. public class MobileViewModel { public List<tbInsertMobile> MobileList; public SelectList Vendor { get; set; } } Contriller... public...

LinearGradientBrush does not render correctly

c#,winforms,gdi+,gdi
Consider the following code from a standard System.Windows.Forms.Form protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Rectangle test = new Rectangle(50, 50, 100, 100); using (LinearGradientBrush brush = new LinearGradientBrush(test, Color.Red, Color.Blue, 0f)) { e.Graphics.DrawRectangle(new Pen(brush, 8), test); } } It produces this result: Why are the red and blue lines...

Webkit animation-iteration-count bug in Chrome

javascript,css3,animation
I have been struggling how to make my slideshow working again in Chrome after i adjusted my CSS3 animation properties heavily for some design flexibility reasons. After a long trial and error process, i found out that the CSS3 animation-iteration-count in Webkit is stopping my whole animation when it is...

3D interpolation with irregular values of x,y and z

matlab
I have few values X, Y and Z. And corresponding to these values I have a value B. Now I have file with Xi, Yi and Zi values. But the values corresponding to this is what I need to fill. My question looks similar to many examples of interpolation. But...

Using 4 16bit timers for 400hz PWM

c++,timer,arduino,pwm,motordriver
I'm dealing with arduino mega based quadcopter and trying to make PWM frequency for 4 motors - 400hz each. I've found an interesting solution where 4 ATmega2560 16bit timers are used to control 4 ESCs with PWM so it could reach 400hz frequency. 700 to 2000µs are normal pulse widths...

How to fetch data from servlet using ajax?

java,javascript,jquery,ajax,servlets
First of all, this might seem like a duplicate but I assure you I have tried many questions and still hasn't got a proper answer. So I'm asking this here. I have an HTML form from which I would like to submit a query to a servlet and show the...

Play java project with Deadbolt, having private Assets

playframework,deadbolt,deadbolt-2
I've been looking around to try and find an example of how to configure a folder of assets, have it being accessed through the @routes.Assets notation but only returning the asset if a user is authenticated. I've got deadbolt configured and working perfectly using google accounts, the application is working...

MYSQL to order before grouping by

mysql,sql,greatest-n-per-group
I have the following: user_id date_created project_id 3 10/10/2013 1 3 09/10/2013 1 5 10/10/2013 1 8 10/10/2013 1 10 10/10/2013 1 3 08/10/2013 1 The end result i want is: user_id date_created project_id 3 10/10/2013 1 5 10/10/2013 1 8 10/10/2013 1 10 10/10/2013 1 Context: I have this...

Change grid dropshadow color over time in WPF

c#,wpf,xaml
Kinda new to WPF, all in all i wanted to make a bordeless main window with a dropshadow border that changes its color after i do something. I think i got most of it i just dont know how to access the DropShadowEffect inside the Grid. Anyways here is the...

how to call inline asm which returns 2 values in LLVM 3.2

assembly,llvm
In C++, we can let a inline asm to return 2 values, like: ulonglong2 ThreadLoad<cub_modifier, ulonglong2*>(ulonglong2* ptr) { ulonglong2 retval; asm volatile ("ld."#ptx_modifier".v2.u64 {%0, %1}, [%2];" "=l"(retval.x), "=l"(retval.y) : _CUB_ASM_PTR_(ptr)); return retval; } how can we create LLVM IR for this usage? I have tried: %3 = alloca { i32,...

php/mysql ignore input if null

php,mysql,sql
Is there anyway to ignore the inputs if they are null and still succeed to update the values that are entered? For example if I only give itemID1 an value and itemID2 is null. $upd = "UPDATE booking SET status='$status', CalDate='$CalDate', DueDate='$DueDate' WHERE itemID IN ('$itemID1', '$itemID2')"; ...

C++ assign dereference pointer object to a variable and use that

c++
Hea everyone! First of all, I am a completely new to C++ coming from a basic C background so it might be a little weird why I ask this. The use scenario is that I want to change a map inside a different function by passing the map as a...

Priority of ActiveMQ configuration via URI

java,activemq
I have a few questions here regarding similar area of the ActiveMQ configuration and priority. I am currently configuring an ActiveMQ broker to turn off the message persistence. Based on the documentation I know it can be achieved via broker config in: xml configuration file () URI on the client...

PHP convert echo into a variable for re-use

php,wordpress,if-statement
I know this is basic PHP but I can't find an answer to my conundrum. I have the following IF statement: <?php if ( in_category(7)) { echo 'f' } elseif ( in_category(6)) { echo 'e' } elseif ( in_category(3)) { echo 'b' } elseif ( in_category(1)) { echo 'a' }...

Differences when tuning neural network with two output variables using caret and neuralnet packages

r,neural-network,regression,r-caret
I'm using caret package and 'neuralnet' model so as to find the best tuning parameters for a neural network based on a data set which contains several predictors transformed by PCA. This data set also contains two output numeric variables, so I want to model these two variables against the...

Onmouseout event is not working

javascript,jquery,html,css
I have this html: <div class="baloon_signup" onmouseover="pinkImg(this)" onmouseout="whiteImg(this)"> <img src="images/prijavi.png" class="imageResponsive" /> </div> and this javascript functions: <script> function pinkImg(x) { x.innerHTML = '<img src="images/prijaviH.png" class="imageResponsive" />'; } function whiteImg(x) { x.innerHTML = '<img src="images/prijavi.png" class="imageResponsive" />'; } </script> Function pinkImg which is triggered on onmouseover event is working properly,...

New lines in word definition using interpreter directives of Gforth

forth,gforth
I am using the interpreter directives (non ANS standard) control structures of Gforth as described in the manual section 5.13.4 Interpreter Directives. I basically want to use the loop words to create a dynamically sized word containing literals. I came up with this definition for example: : foo [ 10...

deleting a specific set of characters in a php string

php,string,url,strpos
ahoy, below i've got a tiny bit of all my coding, this is the thing i need. $linkurl is just a regular url. I want this code so the possible ht tp:// or ht tps:// won't be in the link before i put it in my database. It's a fault...

Location and instances of mscoree.dll on Windows 7

.net,debugging,windows-7
Couple of books (Inside Windows Debugging [2012] by T. Soulami, Pro C# with .NET 3.0 by A. Troelsen) specify the location of mscoree.dll as being the system32 folder. However, on my 32 bit Windows 7 system, there are two instances of the mscoree.dll file, in the following locations: C:\Windows\winsxs\x86_netfx-mscoree_dll_31bf3856ad364e35_6.2.7600.16513_none_7daed23956119a9f C:\Windows\winsxs\x86_netfx-mscoree_dll_31bf3856ad364e35_6.2.7601.17514_none_7f96335553371a30...

Rails load from activation token does not load

ruby-on-rails,sorcery
I try to load a user from an activation token in order to activate him but somehow it fails: us = User.find(7) us.activation_token => "BqgLeANnMj9jCCsTp2hy" @user = User.load_from_activation_token(us.activation_token) User Load (0.4ms) SELECT "users".* FROM "users" WHERE (activation_token = 'BqgLeANnMj9jCCsTp2hy') LIMIT 1 => nil Although user exists and is opening and...

EditText hide when type a text?

android,android-layout,android-fragments,android-edittext
I have a Fragment with an EditText. When I try type a text the EditText hides and keyboard go to front of EditText and I can't type the text. I tried android:windowSoftInputMode="adjustPan|adjustResize" but I think this doesn't works with Fragments. How can I solve it ? <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:background="@drawable/fundo_telas"...

Space between text but not after and before text

javascript,jquery
I have the following sample text: hello,Good Morning,Nice to meet you,awesome How do I allow allow spaces to be typed only between text and not before or after special characters. For example I do not want to allow spaces before and after a comma? Code jQuery(document).ready(function() { jQuery('#s').bind('keyup blur', function()...

Exception when parsing date [duplicate]

java,parsing,date
This question already has an answer here: Unable to parse date String to Date 2 answers I am trying to parse a date in Java, Date example: Mon, 12 Jan 2015 11:46:05 GMT String format: EEE, dd MMM yyyy HH:mm:ss z But I get an exception: java.text.ParseException: Unparseable date:...

HTTP Status 500 - javax.servlet.ServletException: java.lang.ClassNotFoundException: com.mysql.jdbc.driver

mysql,jsp,servlets
Hi I'm new to jsp servlets I am writing a simple login and registration application I am trying to connect with MySQL through java code, but I am getting HTTP Status 500 - javax.servlet.ServletException: java.lang.ClassNotFoundException: com.mysql.jdbc.driver <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.sql.*" %> <!DOCTYPE html PUBLIC "-//W3C//DTD...

Joomla! 2.5: set value into protected variable

php,session,joomla
i am trying to set a new variable into the protected object 'data' within a JRegistry object (within the $_SESSION variable): ["registry"]=> object(JRegistry)#22 (1) { ["data":protected]=> object(stdClass)#23 (3) { ["users"]=> object(stdClass)#24 (1) { … } // here is my new variable supposed to be } } I tried using JRegistry::set($_SESSION['__default']['registry']->data,...