Menu
  • HOME
  • TAGS

cursor changes to pointer for only portion of an image

html,css

The margin-top seems to be causing the issue Change .profile-buttons { margin-right: 15px; margin-top: 110px; } to .profile-buttons { margin-right: 15px; margin-top: 0px; } http://jsfiddle.net/53rqnyx6/2/...

SQL Request from several tables in Yii2

mysql,activerecord,yii2

You should have the following relation in your A model, e.g. : public function getB() { return $this->hasOne(B::className(), ['id' => 'B_id']); } And your code could be : $A_data = A::find()->where(['id'=>$id])->one(); echo $A_data->B->name; PS: there will be two sql requests for this (lazy or eager)....

parse text file into a data frame

r

rex has a vignette for parsing server logs. While the format is not exactly the same as your log you should be able to adapt it to your case fairly easily. As far as reading the log in assuming the file fits in memory your best bet is to read...

Sum of elements based on grouping an element using scala?

scala

Here you can use the groupBy function in Scala. You do, in your input data however have some issues, the ip numbers or whatever that is must be Strings and the numbers Longs. Here is an example of the groupBy function: val data = ??? // Your list val sumList...

Left join to get a single row in Laravel

php,sql,laravel-4,eloquent,query-builder

I have used DB::raw() in order to achieve this $album = Albums::select( 'albums.*', DB::raw('(select photo from photos where albums_id = albums.id and status = 1 order by id asc limit 1) as photo') ) ->where('users_id',$user_id) ->where('albums.status',1)->get(); @JarekTkaczyk 's coding was similar and displayed the same result as I needed, so...

Find X-value position of a label inside a view in Swift

swift,uiview,frame,difference,xvalue

difference = Double(redSquare.frame.origin.x - blueSquare.frame.origin.x) ...

remove copy struct member from std::vector

c++,boost,vector,struct

You can use this algorithm: Collect all nums where has is true in a set<int> Go through your vector<pnt> again, and remove all entries where has is false and num is present in the set<int> Here is a sample implementation: struct filter { set<int> seen; bool operator()(const pnt& p) {...

JQuery AJAX PUT method return 404 error (not found) in asp.net mvc

jquery,ajax,asp.net-mvc

Did you set it to be a accept put on the .NET side? [HttpPut] public JsonResult Update(int id) { return Json("Your Response"); } ...

How to include headers from a third party package in Go?

go,header,include

Use CGO CFLAGS directive to reference additional include path. //#cgo CFLAGS: -I $GOPATH/src/github.com/yada/yada/ ... //#include "yoda.go.h" import "C" CORRECTION: The go tool does not expand $GOPATH variable during build. Instead, the full path should be used there. Corrected code: //#cgo CFLAGS: -I /full/path/to/src/github.com/yada/yada/ //#include "yoda.go.h" ...

Desktop shortcut with Default database for SQL Server Management Studio

ssms,sql-server-2008

With some help, I was able to figure out how to make this work. I tested it, and it looks fine, I love it ! Pic 1: see the parameters, the ssms.exe can get Pic 2: see my shortcut on the desktop, and in the "Target" field, see my parameters...

How to Maven - Spring project put online?

java,spring,maven,web-applications,web-hosting

You only have to build the applicaton: "mvn install". This creates the war file. You only have to put this war file into your tomcat. The war contains all dependencies and everything you need. The tomcat automatically deploys your application. To create a valid build, you have to use a...

Make division by zero equal to zero

python,division,zero

I think try except (as in Cyber's answer) is usually the best way (and more pythonic: better to ask forgiveness than to ask permission!), but here's another: def safe_div(x,y): if y == 0: return 0 return x / y One argument in favor of doing it this way, though, is...

Switching from custom Spring's CommonsHttpInvokerRequestExecutor to HttpComponentsHttpInvokerRequestExecutor

java,spring,authentication,apache-httpclient-4.x,apache-commons-httpclient

So, after discussing the problem from a more global point of view (How to update the settings of an HttpClient in httpclient 4.3+?), here is what I came up with (not totally finished, but the missing interceptor should not be that hard to implement, thanks to Preemptive Basic authentication with...

How to send email when user is created from BCC ATG?

atg,oracle-commerce

It is not a good idea to override getPropertyValue of an item for this implementation. The right way to do this is to work with the formhandler that is responsible for saving the user. It is a bit tricky to find this formhandler. It will be in the atg/web/viewmapping/ViewMappingRepository/ of...

context in visitor method returns null for sub expressions

c#,compiler-construction,antlr,bnf

The .+ is greedy, i.e. '[' .+ ']' grabs the first '[' and the last ']' (and everything in between, of course). Try either '[' .+? ']' or '[' ~[\]]+ ']'...

JavaScript generate an HTML
    list with
  • content in a for loop

javascript,loops,iteration,modulo

I would be more inclined to build a string with the HTML, then post it one time. Try ... var max = 100; var HTML = ["<ul class='list'>"]; for (var i=0,len=max; i<len; i++) { HTML.push("<li>" + i + "</li>"); if (i%10===0 && (i!==0) { HTML.push("</ul>"); HTML.push("<ul class='list'>"); } } HTML.push("</ul>");...

Script, save all $input into 1 variable

bash,variables

You can refer to all the positional arguments with $* and [email protected] From 3.4.2 Special Parameters * Expands to the positional parameters, starting from one. When the expansion occurs within double quotes, it expands to a single word with the value of each parameter separated by the first character of...

Magento add custom options with programmatically importing products

php,magento

I know it's silly, but you could try cleaning up your cache and then saving the custom attributes in question. If that doesn't work, try forcing the saving with: $product->setMyCustomAttr('My Custom Attr'); $product->getResource()->saveAttribute($product, 'my_custom_attr'); Just make sure that you have already saved the product and loaded it again with its...

Use same REST representations using Graphaware Neo4j Framework as the ones we get from the Neo4j REST API

spring-mvc,neo4j,jackson,graphaware

There is (yet) no capability of easily returning nodes in the same format as Neo4j does. This is mainly because the Neo4j REST API is very generic and thus too chatty and verbose for many use-cases. I would suggest looking at com.graphaware.api.JsonNode to which you can pass a Neo4j node...

What's the solid way to process and send the errors to NewRelic using Slim PHP Framework?

php,newrelic,slim

You might be able to add the PHP agents newrelic_notice_error() call with a custom error handler in the slim framework; http://docs.slimframework.com/#Error-Handler https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-api#api-notice-error...

Webview glitches in shared element transition on lollipop

android,android-webview,android-support-library,shared-element-transition,activity-transition

The reason why this glitch occurs is because WebView extends AbsoluteLayout. By default ViewGroups that are not "transition group"s and that have no background drawable will not be animated by the activity's window content transition. In order to fix the glitch with the WebView, you will need to call webView.setTransitionGroup(true)...

NodeJS/Express app.use sequence and usage

javascript,node.js,express,use

1) It is possible to build multiple routers this way. Because you are using this: app.use('/api/rest/', restRouter); your route calls in rest.js will be relative to /api/rest/ which means your code should be modified in rest.js to look like this: router.get('*', function(req, res) { res.send('REST API'); }); I would also...

Modify C-array in objective-c function

ios,c,arrays,pointers,parameters

Not sure if I understand your question, but it seems to be trivial one: - (void) callMethod:(NSObject*) object withCArray:(NSInteger*) cArray { // modify these integers internally so that the C-array passed in is also modified cArray[0] = 10; cArray[1] = 20; cArray[2] = 30; } - (void) myMethod:(NSString *) myConstString...

Check if a URL has anything after the domain name in Perl

regex,perl

/^(?:https?://)?[^/]*(/)?$/i Try this. See demo...

Google Calendar API using refresh token

php,google-calendar,google-oauth,google-api-php-client

You should consider doing this with a service account. A service account will allow your application to access your Google Calendar data without prompting a user for access. When you create the service account take the email address it gives you and add it like you would any other user...

Create view on h2 database

sql,h2

It's a bug on this version of h2 (1.4.182). When running a CREATE VIEW from a RUNSCRIPT command, it doesn't handle well the line-breaks (\n) on the file. I resolved adding a comment (--) before each line break....

Handle onDisconnected() method of 1.x to SignalR 2.1.2

c#,asp.net-mvc-4,json.net,signalr,signalr-hub

In version 2.x, Connection events return Task taking an input parameter of bool stopCalled. You simply need to update your method to return task, which is returned by base.OnDisconnected(stopCalled). Documentation public override Task OnDisconnected(bool stopCalled) { // Add your own code here. // For example: in a chat application, mark...

SCRIPT5022: The collection has not been initialized. It has not been requested or the request has not been executed

javascript,sharepoint,office365

Update Solved! The set_viewXml camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name='Author' /><Value Type='Integer'><UserID Type='Integer'/></Value></Eq></Query></Where></View>"); had to be extend with <Query><Where> ...

How to enable/disable bootstrap selectpicker by ickeck checkbox

jquery,bootstrap-select,icheck

You should refresh the selectpicker once the change is done here is a working fiddle Code to refresh the UI is $('.selectpicker').selectpicker('refresh'); for more information refer the DOCS One more mistake i have found is, to disable you have to use attr('disabled',true) not attr('disabled') ...

Executing two separate codes on the basis of conditions

r,if-statement

COW = data.frame(tcode1=c(5,7,18,9),tcode2=c(4,15,8,10)) head(COW) tcode1 tcode2 5 4 7 15 18 8 9 10 id = ifelse(COW$tcode1<COW$tcode2, COW$tcode1*1000 + COW$tcode2, COW$tcode2*1000 + COW$tcode1) COW = data.frame(id=id,COW) head(COW) id tcode1 tcode2 4005 5 4 7015 7 15 8018 18 8 9010 9 10 ...

Update query schemaRDD

sql,scala,apache-spark,rdd

Since the underlying implementation (data structure) of a SchemaRDD is an RDD which is immutable, I don't think it supports an UPDATE. If you want to update something, one way is to create a copy and do the transformation there and save the updated set to your datastore.

How to display a MFC dialog from a console application in C++?

c++,mfc,console-application

It is possible; here is how I did it: For your console application have it be simply this: #include <Windows.h> typedef void (*EntryFunc)(); int main() { HMODULE hMod = LoadLibrary(L"MFCDll.dll"); EntryFunc func = (EntryFunc)GetProcAddress(hMod, "entrypoint"); func(); } The name of the DLL is MFCDll.dll and there is an exported function...

Generic Graph Lib in Delphi, Speed of ObjectList

c++,algorithm,delphi,graph

Is TObjectList<T>.Contains() really O(n2)? No, it is O(n). The implementation of Contains() is simply a linear search. The graph you show is not linear, but then we don't know how you generated it. Presumably your code doesn't test purely the performance of Contains(). My guess is that you are...

Cannot connect to amazon AWS EMR via the command line interface

hadoop,amazon-web-services,configuration,amazon-s3,emr

try to install AWS CLI v1.6.6 or later

Moment.js parsing text as date doesn't seem to match locale

javascript,momentjs

Momen't locale sets the desired output of moment. Not the input. You will need to supply the input format like this: moment('12.01.2015', 'DD.MM.YYYY') See this github page for more explanation specifically on how this behaviour will change in the future. You can wrap this in a function so that you...

Retrofit - @Body parameters cannot be used with form or multi-part encoding

android,api,retrofit,square

This post pointed me to the right direction http://stackoverflow.com/a/21423093/1446856. I attached everything in the body and send it as a TypedInput. So the interface looks something like this @POST("/api/register") @Headers({ "Content-Type: application/json;charset=UTF-8"}) Observable<RegisterResponse> register( @Header("Authorization") String authorization, @Body TypedInput body ); and the body looks something like this String bodyString...

cases for SocketTimeoutException in android

java,android,http,httpurlconnection

According to documentation - "This exception is thrown when a timeout expired on a socket read or accept operation." You can catch both SocketTimeOutException and ConnectionTimeOutException separately.

Error loading PHP 5.5 Module into Apache 1.3 (OpenBSD version) on OpenBSD 5.6 platform

php,apache,openbsd

I found the issue and the solution. After investigating my configuration further I noticed I had the Apache 2 version of PHP installed (php-5.5.14p0-ap2) instead of the correct 1.x one (php-5.5.14p0). APR in the 1.x versions of Apache uses "ap_" instead of "apr_" in their method signatures which was the...

Type inference against type defined in unreferenced namespace

c#,namespaces,type-inference

The reason for var foo = new FooFactory().GetFoo(); compile is simple. The compiler infer that foo is Models.Foo type not only Foo. Is symilar to push Models.Foo foo2 = new FooFactory().GetFoo();. Notice that Foo foo2 = new FooFactory().GetFoo(); is diferent.

C++ pointer vs array notation

c++,arrays,pointers

No, 'foo' is an array type in both cases but when a pointer is expected in expression with 'foo', it's implicitly converted to one (which points to the array first element). All arrays have this behavior. In the case, as addition can be done via pointer types, but not with...

Why this small page look different in Chrome and Firefox, is this a bug?

html,css,google-chrome,firefox

You can work around the issue by using non-breaking spaces, as in <li><a class="buggy" href="https://www.example.com/">A&nbsp;ABC&nbsp;DEFGHIJ</a></li> ...

Express JS routes issue. Returns 404 when accessing resource with subpaths and params in the middle

node.js,express,mean-stack,meanjs

I found the problem here. I dig into express' code and checked how it handle its routes. Express handles the routes callbacks based on the number of arguments the function has. If the function for the route has four(4), like the one I have: exports.teamParticipants = function(req, res, next, id)...

Using Spring-Security PasswordEncoder with default authentication provider?

java,spring,spring-security

The combination of HTTP Digest authentication and BCrypt password encoder is not possible. This is because the HTTP Digest algorithm requires that the password is stored in cleartext. You must either change authentication method or remove password encoding.

android change datetime format

java,android,datetime-format

Change to SimpleDateFormat srcDf = new SimpleDateFormat( "dd.MM.yyyy HH:mm:ss"); So that is match your String. The symbols are explained here http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html Letter Date or Time Component Presentation ExamplesG Era designator Text AD y Year Year 1996; 96 Y Week year Year 2009; 09 M Month in year Month July; Jul;...

AddThis toolbox multiple items

javascript,php,addthis

The addthis:title, addthis:description, and addthis:url parameters are for use with our older advanced configuration tools - the ones with the button code inside. For this to work with the addthis_sharing_toolbox you'll need to use this code: <!-- Go to www.addthis.com/dashboard to customize your tools --> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-535e7a2916e104ff" async="async"></script> <!--...

How to pass a serializeArray as json to MVC controller

jquery,asp.net-mvc,json

I took some hint from above answer and was able to frame a solution which works perfectly for me. I am now recieving a json in the format of formname: formvalue instead of name: formname, value: formvalue format. Here it is - var json = {}; // converting to formname:formvalue...

saltstack template with grains - bad replacement

salt-stack

Solution: Address {{ grains['fqdn_ip4'][0] }} Result: Address 111.111.111.111 ...

Give bigquery subquery an alias to shorten query

google-bigquery

As the comments say, a view is what you want: An alias for a query you can reuse in other queries. https://cloud.google.com/bigquery/querying-data#views Note that views are [currently] not compatible with TABLE_DATE_RANGE, so you would need to rewrite your query/view to explicitly call out the tables....

nth-child selecting wrong element from a multi-class div

html,css,css3,css-selectors,pseudo-class

nth-child() don´t care which class you want to check. It always count all siblings in a DOM element. Maybe you want to give :nth-of-type a chance: developer.mozilla.org Maybe the best solution is to use some jQuery and add another class to append the underline style...

Not reading from the file correctly in Java

java,readline

Your string comparison implementation is not OK. Replace this line if (userData[0] == username && userData[1] == password){ with this one: if (userData[0].trim().equals(username.trim()) && userData[1].trim().equals(password.trim())){ ...

Symfony2 Custom Field Type and Form Events on Submit

php,forms,validation,symfony2

Complete Solution: <?php namespace CS\CommonBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormError; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormEvents; use Symfony\Component\Form\FormEvent; class CaptchaType extends AbstractType { private $session; public function __construct(Session $session) { $this->session = $session; } public...

submenu in one line with css

html,css3,drop-down-menu

try this code: #menu { position: relative; background-color: black; text-decoration:none; } #menu li { background-color: green; padding: 10px; height: 30px; list-style: none; line-height:30px; float:left; } #menu li > ul { display: none; } #menu > ul > li { border: 2px solid white; } #menu > ul > li:hover {...

R: Building a loop function to aggregate variables based on variablename /index

r,loops,for-loop,indexing,apply

First, some test data: set.seed(123) df <- data.frame(ID = rep(1:3, each = 3), w1_panas1 = runif(9), w1_panas2 = runif(9), w1_panas3 = runif(9), w2_panas1 = runif(9), w2_panas2 = runif(9), w2_panas3 = runif(9), w3_panas1 = runif(9), w3_panas2 = runif(9), w3_panas3 = runif(9)) df # ID w1_panas1 w1_panas2 w1_panas3 w2_panas1 w2_panas2 w2_panas3 w3_panas1...

concatenate and print each array element with a suffix

perl

You might try, chomp(@dir_list_initial); and later print $dir_list_initial[$i] . "$suffix\n"; as every element of @dir_list_initial array has newline at the end of string. Even better it would be to skip shell altogether, and use only perl, my @dir_list_initial = map { s|\.txt||; $_ } glob("*.txt"); ...

How to get DOM node in Ext.view.View by Record?

dom,extjs,dataview

Use Ext.view.View.getNode method to get the selected HTML Element, from selected Record object Ext.view.View...

How to distinguish Python strings and docstrings in an emacs buffer?

python,emacs,font-lock

python-mode.el uses font-lock-doc-face, given py-use-font-lock-doc-face-p is t. You can customize that variable....

Perl File::Fetch Failed HTTP response: 500 Internal Server Error

perl,fetch

Could not open socket to 'www.londonstockexchange.com', 'Connection refused Any ideas how i can get past this? Direct connection to this site is blocked somewhere. If you are inside a company there is probably a firewall and some proxy you are required to use. Ask your system administrator....

Perl Expect spawn limit

bash,perl,ssh,expect

It appears that it's not a process limitation, but the opened-file limitation. Adding these line : restools soft nproc 2048 restools soft nofile 2048 to /etc/security/limits.conf file solved the issue ! The first line limits the number of active process to 2048 And the second, the number of opened files...

How can I set data-row value in javascript

jquery,asp.net-mvc

$(that).data("state","changed"); I have fixed with this line......

unable to echo multiple images with multiple variable

php,image-processing

I think the " = $row[0];" on line 42 might not do what you want it to do. Because of the double quotes, the value of the variable $row[0] will be printed in the code. The code running through the eval will look something like this: $file0 = FILENAME.png; Instead...

Get all combinations

excel,vba,excel-vba,combinatorics

If I understand it right, then I would call your "sets" dimensions and your combinations possible addresses in those dimensions. For example in two dimensions x and y where x is in length 2 and y is in length 3 there are 6 possible points(x,y) if x and y elements...

call to AsyncTask method from fragment's onCreateView, fails

android,android-fragments,android-asynctask

You trying to use AsyncTask in onCreateView before view created. Try to call AsyncTask in onActivityCreated: @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); new Title().execute(); } ...

How to get the actual quota for CloudKit?

cloudkit,quota

There isn't currently a way to get the remaining quota for a user in the private database at this time, so your best option is to just try to upload the data you want and watch for a CKErrorQuotaExceeded error.

Call MainActivity function outside the class

java,android,call

This is because the main thread is the UI thread. (Keep in mind this is only for android - For more reference see this). As per the Android documentation, you should avoid updating the UI outside the UI thread. Additionally, the Andoid UI toolkit is not thread-safe. So, you must...

Add objects to NSMutable array with grouping

objective-c,parse.com,nsmutablearray,nsdictionary,pfquery

Okay, so you have an array of items, and you want to group them into sections based on a particular key. NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"MM/dd/yyyy"]; // Sparse dictionary, containing keys for "days with posts" NSMutableDictionary *daysWithPosts = [NSMutableDictionary dictionary]; [myPosts enumerateObjectsUsingBlock:^(PFObject *object, NSUInteger idx, BOOL *stop)...

How to create search shortcut in vim

vim

you are looking for map not command. try this: nnoremap <F3> /def<space> I didn't map #, instead I used <F3>, since # is very useful in normal mode. you can use # if you like....

check for a word in a file, then add a word at the end of the same line

linux,unix,nagios

sed '/allowed_host/s/$/ 1.2.3.4 5.6.7.8/'

Polymer binding data to element loaded with innerHTML

javascript,data-binding,polymer

Yes, use injectBoundHTML. From https://github.com/Polymer/docs/issues/607: /** * Inject HTML which contains markup bound to this element into * a target element (replacing target element content). * @param String html to inject * @param Element target element */ injectBoundHTML: function(html, element) In the polymer element, instead of el.innerHTML = html; do...

Assembling a Haar-like filter for edge detection

image-processing,computer-vision,convolution,edge-detection

Based on the information given in the paper Vehicle Detection Method using Haar-like Feature on Real Time System I can't tell how the group has done it exactly. However I can suggest a way on how this could be implemented. The main difference between a haar-like feature and a convolution...

Remove out all text that are under “(” and “)”

php

By using the method mysql_num_fields you're getting the rows in a numbered array. This means the index you specify when you access to the $row array will determine which column you are accessing. To achieve this you have two solutions: You can generate a static correspondence column_name -> index according...

Liquibase VARCHAR2 length in chars

database,oracle,rdbms,database-migration,liquibase

There isn't a built in way in liquibase to define a datatype as "varchar 255, char type" and have it output VARCHAR(255) on postgresql and VARCHAR2(255 CHAR) on oracle. Liquibase is designed to be extendable (liquibase.org/extensions) and you should be able to override how the string "VARCHAR(255)" in the changelog...

Key navigation, event on press Enter on keyboard

extjs,keyboard

If it's a textfield or combobox or trigger or something you can try adding a listener for specialkey: listeners:{ specialkey: function(f,e){ if(e.getKey()==e.ENTER){ console.log("I hit enter!"); } } }, If it's just hitting Enter anywhere on the window then I'm not as sure. Something similar might work....

Resize superview while adding subviews dynamically with autolayout

ios,interface-builder,autolayout

You can outlet height constraint of the view, and then set value accordingly to elements.

How to create a class dynamicaly

c#,reflection

You have defined the setter method incorrectly. You seem to have copy/pasted from the getter, without correctly modifying the return type and argument list. While the getter returns a value and has no arguments, a setter returns no value (i.e. is void) and takes one argument. Instead of what you...

How to interrupt userspace application in Linux

linux,driver,interrupt,dma,userspace

The normal approach is to implement a poll function for your device driver. This function should add the task to one or more wait queues. Your interrupt handler can then wake up the task(s) waiting on the queue(s). Your driver's poll implementation is invoked when a userspace task invokes poll...

Always get Nil Returned When Querying Customers with Shopify_API Gem

ruby-on-rails,ruby,shopify

My customer finder always works... I use a slightly different one from you. Use this as an example to get you going. ShopifyAPI::Customer.find(:first, :from => :search, :params => { :q => "email:#{customer['email']}" }) ...

Calling functions with maps using @

powershell,powershell-v2.0,powershell-v3.0

It's a technique known as splatting. It lets you pass a set of parameters as a hashtable or array instead of specifying them all with the cmdlet. If you're asking a more basic question, then @( ) identifies an array, and @{ } identifies a hashtable....

Pointer arithmetic with multidimensional Array Notation

c++,arrays,multidimensional-array,pointer-arithmetic

Myptr is a pointer to double, so *(Myptr + i) is a double, and while you can add j to that, you cannot dereference the result. Had you declared Myptr like this: double (*Myptr)[6] = MyArray; then Myptr would be a pointer to an array of 6 doubles. Consequently *(Myptr...

Rails 3 how to get the current record ID in after_create

ruby-on-rails,ruby-on-rails-3,activerecord,after-create

The id is only assigned on save, on create you are just creating the skeleton object and giving some values. To get the id of the object just call object.id If for some reason you want to get the id in the after_* methods, you need to use the after_save:...

WPF bind image via WCF to TileLayoutControl from ViewModel

wpf,image,wcf,xaml,binding

Hi recently I learn this solution: In .NET 4.5 dynamic image path should be like this. <Image Source="pack://application:,,,/TileExample;component/MenuPhotos/restaurant1.jpg"></Image> This solution working for me....

Collect all “minimum” solutions from a backtrackable predicate

prolog,backtracking,aggregates,prolog-setof,meta-predicate

What is the idiomatic approach to this class of problems? Is there a way to simplify the problem? Many of the following remarks could be added to many programs here on SO. Imperative names Every time, you write an imperative name for something that is a relation you will...

How to check if one date is before another date using JavaScript\JQuery?

javascript,jquery,javascript-events

Assuming your dates are currently strings, use getDate() to get the date part of a Date/Time and simply compare those: function compareDates(date1, date2) { return new Date(date1).getDate() > new Date(date2).getDate(); } alert(compareDates("1/1/2003", "1/2/2003")); // returns false alert(compareDates("1/3/2003", "1/2/2003")); // returns true JSFiddle: http://jsfiddle.net/TrueBlueAussie/nex9m8np/1/ The problem with answers using getTime(), or...

F# clarification on creating labels for a pie chart

winforms,f#,trigonometry,pie-chart

Giving this a go by adding comments, not necessarily worked out in this order: // startAngle is the angle in degrees of this segment, angle is the angle of // the segment itself. let drawLabel (gr: Graphics) title startAngle angle = // So this is the angle of the centre...

IE 10 will not open my web page image on top left of screen

html,image,internet-explorer

This might or might not be the reason (as UnknownFury said, a jsfiddle reproducing the issue would help), but it looks like you're missing a = between width and its value. You have: <img src= "images/han.jpg" height = "196" width "304"> It should be: <img src= "images/han.jpg" height = "196"...

JQUERY validation

javascript,jquery,validation

This worked for me: <!DOCTYPE html> <html> <head> <title>Untitled Document</title> <meta charset="UTF-8"> <meta name="description" content="" /> <meta name="keywords" content="" /> <link rel="stylesheet" href="http://jqueryvalidation.org/files/demo/site-demos.css"> </head> <body> <form id="myform"> <div class="form-group"> <label for="exampleInputEmail1">Meno (email)</label> <input class="form-control" id="disabledInput" type="text"...

WebMethod returning class object as JSON automatically

c#,asp.net,json

How did ASP.NET do this automatically? Basically there's some code sitting between the web and the WebMethod that takes the request, figures out what it's requesting, finds your WebMethod and obtains the result, then serializes it back to the client based on the acceptable formats in the request header....

How to run macro when data changes in sheet in Excel

vba,excel-vba

how about stopping auto refresh from web and put it as part of the macro? or try adding the macro for worksheet change, explained here - How to run a macro when certain cells change in Excel...

How to show and hide a nodes text with button click and mouseover/mouseout ? D3/JS

javascript,d3.js

Should be as simple as: d3.selectAll(".node text").remove(); ...

Need explanation on creating utf-8 encoded files on linux using c++

c++,linux,encoding,utf-8

Your file may appear to be in ISO-8859-1, but it's actually not. It's simply broken. Your file contains byte A9, which is the lower byte of UTF-8 representation of é. When you wrote 'é', the compiler should have warned you: aaa.c:4:38: warning: multi-character character constant [-Wmultichar] char buffer[] = {...

How to find the entry point(or base address) of a process - take care of ASLR

dll-injection

You are creating the process suspended. While the key kernel data structures will be created, no modules will be loaded (that would involve executing code in module entry points (dllmain)). Thus the error makes sense: the data structures to track modules loaded will be empty, and quite possibly not allocated...

Print out 2D array

ruby,arrays,printing,puts

Suppose: arr = Array.new(10) { (0..20).to_a.sample(10) } Then puts arr.map { |x| x.join(' ') } 1 9 6 15 7 19 18 3 0 12 13 20 18 15 0 3 19 1 14 16 7 16 5 3 12 19 4 9 20 10 6 10 9 1 18...

Tic Tac Toe Checking winner

java,tic-tac-toe,jcreator

Two things to do (generally speaking): 1) change your main class - you are checking winner before first move and after last move... So game for should looks like this: for (i = 0; i < 9; i++) { if (KollaVinst(spelplan)) { break; } else { CheckMove(spelplan, rad, kolumn); }...

Why do CodeIgniter projects sometimes include composer.phar package?

php,twitter-bootstrap,codeigniter,doctrine,composer-php

The composer.phar file is an executable and it should not be committed. What it actually does is that it looks in your composer.json file and there you can declare some more dependencies (libraries for example) and their version: { "require": { "doctrine/orm": "*" } } The version in this case...

Difference between urbanairship and parse and push for push notification in ios [closed]

ios,push-notification

Urban Airship is doing away with free notifications. I work for XtremePush who do push notifications to the same standard as Urban Airship and have a free tier if you want to check that out.

Pthreads doesnt know $_SERVER['DOCUMENT_ROOT']

pthreads,server,document-root

You can use the following anywhere in a script file to figure out your base path: realpath(dirname(__FILE__)) Example: put this in /srv/www/domain.com/app/config.php will output: /srv/www/domain.com/app Make sure to use 'DIRECTORY_SEPARATOR' to add directory slashes: realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR ...

Div is not centered properly, why?

html,css

Change width: 100%; to width: 90%; so you aren't extending the page by adding margin-right/left:5% and set padding:15px; to padding: 15px 0; so only top and bottom gets padding: #contentholder { background-color: #eeeeee; margin-left: 5%; margin-right: 5%; min-height: calc(100vh - 210px); width: 90%; } Then: Get rid of float:left on...

Finding the minimum value of int numbers in an array (Java)

java,arrays,min

There's no need for the outer loop, it only runs once and you don't use i anyway. why do you have it? For the inner loop, you need to compare against the minimum value. Right now you are comparing it against the first element in the array, which is not...

virtual inheritance and base class of base class

c++

Why does this work? According to the standard (10.1.4 in the FIDS), "for each distinct baseclass that is specified virtual, the most derived object shall contain a single base class subobject of that type". Virtual base is shared between all classes that derive from it for the instance of the...

Android application without an actual process running the app

android

To "present" an application to the user, we need a least one of its activities to be in resumed state, and for this we need the underlying Linux process up and running, right? There are a few ways in which the user can see an app's UI without the...

Laravel get more data in select list

php,mysql,forms,list,laravel

You can do this by using a custom DB expression and concatenate lastname + id. This because the Form helper only likes 1 column for the text (option text) and 1 column for the id (option value attribute). $users = User::select(DB::raw('CONCAT(lastname, id) AS userselect, id'))->lists('userselect', 'id'); I find this the...

All Database Tags

.a , .app , .bash-profile , .class-file , .doc , .git-info-grafts , .htaccess , .htpasswd , .ico , .lib , .mov , .net , .net-2.0 , .net-3.0 , .net-3.5 , .net-4.0 , .net-4.5 , .net-4.5.2 , .net-4.5.3 , .net-4.6 , .net-5.0 , .net-assembly , .net-attributes , .net-core , .net-framework-source , .net-framework-version , .net-micro-framework , .net-remoting , .netrc , .obj , .post , .profile , .slugignore , .war , .when , 128bit , 16-bit , 2-3-4-tree , 2-way-object-databinding , 24bit , 2checkout , 2d , 2d-3d-conversion , 2d-games , 2d-vector , 2dsphere , 2to3 , 3-tier , 32-bit , 32bit-64bit , 32feet , 3d , 3d-model , 3d-modelling , 3d-reconstruction , 3d-secure , 3des , 3ds , 3dsmax , 3g , 3g-network , 3nf , 3rd-party , 3scale , 4d , 4g , 4gl , 4store , 64bit , 6502 , 6510 , 68000 , 6nf , 7bit , 7zip , 8-puzzle , 802.11 , 80286 , 8051 , 8085 , 8086 , 8bit , 960.gs , a-records , a-star , a2lix-translation , a2x , aabb , aac , aapt , aar , aasm , ab-initio , ab-testing , abac , abaddressbook , abap , abaqus , abbreviation , abbyy , abc , abcl , abcpdf , abcpdf9 , abi , ableton-live , abnf , abort , about-box , abpeoplepickerview , abperson , abrecord , abrecordref , absolute , absolute-path , absolute-value , absolutelayout , abstract , abstract-action , abstract-algebra , abstract-base-class , abstract-class , abstract-data-type , abstract-factory , abstract-factory-pattern , abstract-methods , abstract-syntax-tree , abstract-type , abstraction , abstracttablemodel , abtest , abuse , acaccount , acaccountstore , acceleo , accelerate-framework , accelerated-c++ , acceleration , accelerator , accelerometer , accent-insensitive , accented-strings , acceptance-testing , acceptbutton , access-control , access-denied , access-levels , access-log , access-modifiers , access-point , access-rights , access-rules , access-specifier , access-token , access-vba , access-violation , accessdatasource , accessibility , accessibility-api , accessibilityservice , accessible , accessor , accessory , accessorytype , accessoryview , accord.net , accordion , account , account-management , accountmanager , accounts , accumarray , accumulate , accumulator , accumulo , accurev , ace , ace-editor , aceoledb , acf , achartengine , achievements , acid , acid-state , acitree , ack , ackermann , acl , acm , acm-java-libraries , acoustics , acquia , acr122 , acra , acralyzer , acrobat , acrobat-sdk , acrofields , acronym , acs , action , action-filter , action-menu , actionbardrawertoggle , actionbarsherlock , actionbuilder , actioncontroller , actiondispatch , actionevent , actionfilterattribute , actionform , actionhero , actionlink , actionlistener , actionmailer , actionmethod , actionmode , actionpack , actionresult , actionscript , actionscript-2 , actionscript-3 , actionview , actionviewhelper , activation , activator , active , active-directory , active-directory-group , active-form , active-model-serializers , active-pattern , active-record-query , active-window , activeadmin , activeandroid , activedirectorymembership , activejdbc , activemerchant , activemessaging , activemodel , activemq , activeperl , activepivot , activerecord , activerecord-fb-adapter , activereports , activeresource , activestate , activesupport , activesupport-concern , activesync , activex , activexobject , activiti , activity-diagram , activity-indicator , activity-lifecycle , activity-manager , activity-recognition , activity-stack , activity-state , activity-transition , activitynotfoundexception , activityunittestcase , actor , acts-as-audited , acts-as-commentable , acts-as-ferret , acts-as-paranoid , acts-as-taggable-on , actualheight , actuate , acumatica , ad-hoc-distribution , ada , ada2012 , adaboost , adal , adam , adapter , adapter-pattern , adaptive-bitrate , adaptive-compression , adaptive-design , adaptive-layout , adaptive-threshold , adaptive-ui , adaptor , adb , adbannerview , adblock , adc , adcolony , add , add-custom-command , add-in , add-on , add-type , addattribute , addchild , addclass , adddays , addeventlistener , addhandler , addition , addobserver , addon-domain , addr2line , addrange , address-operator , address-sanitizer , addressbook , addressbookui , addressing , addressing-mode , addressof , addslashes , addsubview , addtarget , addthis , adduplex , adf , adfs , adfs2.0 , adfs2.1 , adfs3.0 , adgroup , adhoc , adhoc-queries , adjacency-list , adjacency-matrix , adjustment , adjustviewbounds , adk , adlds , admin , adminer , adminhtml , administration , administrator , admob , ado , ado.net , ado.net-entity-data-model , adobe , adobe-analytics , adobe-brackets , adobe-dps , adobe-edge , adobe-illustrator , adobe-indesign , adobe-javascript , adobe-media-server , adobe-premiere , adobe-reader , adoconnection , adodb , adomd.net , adonetappender , adorner , adox , adp , adrotator , ads , adsense , adsense-api , adserver , adsi , adt , advanced-custom-fields , advanced-installer , advanced-search , advanceddatagrid , advantage-database-server , adventure , adventureworks , advertisement , advertising , adview , adwords-apiv201402 , aem , aero , aero-glass , aerogear , aerospike , aes , aes-gcm , aes-ni , aeson , aesthetics , aether , afbedsheet , affiliate , affinetransform , affinity , affix , afhttprequestoperation , afnetworking , afnetworking-2 , afoauth2client , aforge , afp , after-effects , ag , agda , agent , agent-based-modeling , agents , agents-jade , aggregate , aggregate-filter , aggregate-framework , aggregate-functions , aggregate-initialization , aggregateexception , aggregateroot , aggregates , aggregation , aggregation-framework , aggregator , agi , agile , agile-processes , agile-project-management , aglio , agpl , agrep , aho-corasick , aida , aide-ide , aidl , aif , aiff , aiml , aio , aiohttp , air , air-native-extension , airbrake , aircrack-ng , airplane , airplay , airport , airprint , airserver , airwatch , aix , ajax , ajax-forms , ajax-polling , ajax-request , ajax-success , ajax-upload , ajax.beginform , ajax.net , ajax4jsf , ajaxcontroltoolkit , ajaxform , ajaxhelper , ajaxmin , ajaxsubmit , ajdt , ajp , akamai , akavache , akka , akka-camel , akka-cluster , akka-http , akka-io , akka-kafka , akka-monitoring , akka-persistence , akka-remote-actor , akka-stream , akka-supervision , akka-testkit , akka.net , alamofire , alarm , alarmmanager , alarms , alasql , alasset , alassetlibrary , alassetsgroup , alassetslibrary , albacore , albumart , alchemy , alchemyapi , alembic , alert , alertdialog , alertdialogpro , alertifyjs , alerts , alertview , alex , alfa , alfresco , alfresco-share , algebra , algebraic-data-types , alglib , algorithm , algorithmic-trading , alias , aliases , aliasing , alice-fixtures , alignment , alipay , alive , alivepdf , allegro , allegro-cl , allegro5 , alljoyn , alloc , alloca , allocation , allocator , allow-same-origin , alloy , alloy-ui , allure , alm , almond , alpha , alpha-beta-pruning , alpha-transparency , alphabet , alphabetical , alphabetical-sort , alphablending , alphanumeric , alsa , alt , alt-tab , altbeacon , alter , alter-column , alter-table , altera , alternate , alternate-access-mappings , alternating , alternation , altitude , altova , alu , always-on-top , alwayson , amazon , amazon-appstore , amazon-cloudformation , amazon-cloudfront , amazon-cloudsearch , amazon-cloudtrail , amazon-cloudwatch , amazon-cognito , amazon-data-pipeline , amazon-dynamodb , amazon-ebs , amazon-ec2 , amazon-ec2-windows , amazon-elastic-beanstalk , amazon-elasticache , amazon-elb , amazon-emr , amazon-fire-tv , amazon-glacier , amazon-iam , amazon-javascript-sdk , amazon-kinesis , amazon-lambda , amazon-mechanical-turk , amazon-mobile-analytics , amazon-mws , amazon-payments , amazon-product-api , amazon-rds , amazon-redshift , amazon-route53 , amazon-s3 , amazon-ses , amazon-simpledb , amazon-sns , amazon-sqs , amazon-store , amazon-swf , amazon-vpc , amazon-web-services , ambari , amber-smalltalk , ambient , ambiguity , ambiguous , ambiguous-call , ambiguous-grammar , amcharts , amd , amd-processor , amdatu , amdefine , amend , ami , amortization , amortized-analysis , amos , ampersand , ampersand.js , ampl , amplifyjs , amplitude , ampps , ampscript , amqp , amr , amserver , amslidemenu , anaconda , anagram , analog-digital-converter , analysis , analytic-functions , analytics , analytics.js , analyzer , ancestor , ancestry , anchor , anchor-modeling , anchor-scroll , anchorpoint , ancs , and-operator , andengine , android , android-2.2-froyo , android-2.3-gingerbread , android-4.0 , android-4.1-jelly-bean , android-4.2-jelly-bean , android-4.3-jelly-bean , android-4.4-kitkat , android-5.0-lollipop , android-5.1.1-lollipop , android-actionbar , android-actionbar-compat , android-actionbar-tabs , android-actionbaractivity , android-actionmode , android-activity , android-adapter , android-adapterview , android-alarms , android-alertdialog , android-animation , android-annotations , android-anr-dialog , android-app-indexing , android-applicationinfo , android-applicationrecord , android-appwidget , android-arrayadapter , android-assertj , android-assets , android-async-http , android-asynctask , android-attributes , android-audiomanager , android-audiorecord , android-authenticator , android-auto , android-avd , android-background , android-backup-service , android-beam , android-billing , android-bitmap , android-ble , android-bluetooth , android-broadcast , android-browser , android-build , android-build-type , android-bundle , android-button , android-c2dm , android-calendar , android-camera , android-camera-intent , android-canvas , android-capture , android-cardview , android-checkbox , android-compatibility , android-configchanges , android-contacts , android-contentprovider , android-contentresolver , android-context , android-contextmenu , android-cookiemanager , android-coordinatorlayout , android-cts , android-cursor , android-cursoradapter , android-cursorloader , android-custom-attributes , android-custom-view , android-database , android-date , android-datepicker , android-dateutils , android-debug , android-design-library , android-developer-api , android-dialog , android-dialogfragment , android-download-manager , android-drawable , android-edittext , android-elevation , android-emulator , android-emulator-plugin , android-espresso , android-event , android-expansion-files , android-externalstorage , android-facebook , android-file , android-fileprovider , android-filterable , android-fonts , android-fragmentactivity , android-fragmentmanager , android-fragments , android-framework , android-fullscreen , android-fusedlocation , android-gallery , android-gcm , android-geofence , android-gesture , android-glide , android-googleapiclient , android-gpuimageview , android-gradle , android-graphview , android-gridlayout , android-gridview , android-guava , android-gui , android-handler , android-handlerthread , android-hardware , android-homebutton , android-ibeacon , android-icons , android-ide , android-identifiers , android-image , android-imagebutton , android-imageview , android-implicit-intent , android-inflate , android-input-filter , android-input-method , android-inputtype , android-install-apk , android-instrumentation , android-intent , android-intentservice , android-internet , android-jobscheduler , android-jsinterface , android-json , android-json-rpc , android-kenburnsview , android-kernel , android-keypad , android-keystore , android-ksoap2 , android-launcher , android-layout , android-layout-weight , android-library , android-lifecycle , android-linearlayout , android-lint , android-listfragment , android-listview , android-loader , android-loadermanager , android-location , android-log , android-logcat , android-looper , android-lru-cache , android-lvl , android-m , android-managed-profile , android-manifest , android-maps , android-maps-extensions , android-maps-utils , android-maps-v2 , android-mapview , android-market-filtering , android-maven-plugin , android-mediaplayer , android-mediarecorder , android-mediascanner , android-memory , android-menu , android-multidex , android-music-player , android-navigation , android-ndk , android-nested-fragment , android-networking , android-notification-bar , android-notifications , android-open-accessory , android-optionsmenu , android-orientation , android-overlay , android-package-managers , android-pageradapter , android-pagetransformer , android-palette , android-parsequeryadapter , android-pendingintent , android-permissions , android-photos , android-popupwindow , android-preferences , android-print-framework , android-productflavors , android-progaurd , android-progressbar , android-proguard , android-query , android-radiobutton , android-radiogroup , android-reboot , android-recents , android-recyclerview , android-relativelayout , android-resolution , android-resources , android-runonuithread , android-runtime , android-savedstate , android-screen , android-screen-pinning , android-screen-support , android-scroll , android-scrollable-tabs , android-scrollview , android-sdcard , android-sdk-2.1 , android-sdk-2.3 , android-sdk-manager , android-sdk-plugin , android-sdk-tools , android-search , android-searchmanager , android-securityexception , android-seekbar , android-selector , android-sensors , android-service , android-service-binding , android-settings , android-shape , android-sharing , android-shell , android-simple-facebook , android-sliding , android-snackbar , android-softkeyboard , android-source , android-spinner , android-sqlite , android-standout , android-statusbar , android-studio , android-styles , android-support-design , android-support-library , android-switch , android-syncadapter , android-tabactivity , android-tabhost , android-tablelayout , android-tabs , android-task , android-testing , android-textattributes , android-textureview , android-textview , android-theme , android-time-square , android-timepicker , android-titlebar , android-toast , android-togglebutton , android-toolbar , android-traceview , android-transitions , android-tv , android-twitter , android-typeface , android-ui , android-uiautomator , android-usb , android-version , android-vibration , android-video-player , android-videoview , android-view , android-view-invalidate , android-viewbinder , android-viewgroup , android-viewholder , android-viewpager , android-virtual-keyboard , android-volley , android-wake-lock , android-wallpaper , android-wear , android-wear-data-api , android-wear-notification , android-webservice , android-websettings , android-webview , android-widget , android-wifi , android-windowmanager , android-wireless , android-x86 , android-xml , android-xmlpullparser , android-youtube-api , android.mk , android4.0.3 , androidasync-koush , androiddesignsupport , androidhttpclient , androidplot , androidviewclient , ane , angelscript , angle , angles , angstrom-linux , anguarjs-digest-cycle , angular-amd , angular-bootstrap , angular-broadcast , angular-cache , angular-carousel , angular-chart , angular-chartist.js , angular-chosen , angular-cookies , angular-dart , angular-data , angular-decorator , angular-digest , angular-directive , angular-dragdrop , angular-file-upload , angular-filters , angular-formly , angular-fullstack , angular-google-maps , angular-http , angular-http-auth , angular-http-interceptors , angular-kendo , angular-leaflet-directive , angular-local-storage , angular-material , angular-meteor , angular-mock , angular-moment , angular-new-router , angular-ng-class , angular-ng-else , angular-ng-if , angular-nglist , angular-ngmodel , angular-promise , angular-require ,