Menu
  • HOME
  • TAGS

Set post classes to wordpress

php,wordpress

Replace following code: <?php $ccfit_img_big = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_id() ), 'ccfit_big', false ); echo '<div id="blogpost" HERE SOULD THE CODE BE><a href="'. get_permalink( $id ) .'"><h2>'. get_the_title() .'</h2></a><img src="'. $ccfit_img_big[0] .'"></div>'; ?> WIth this: <?php $ccfit_img_big = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_id()), 'ccfit_big', false ); ?> <div id="blogpost" <?php post_class(); ?>> <a...

crossbrowsing ie8 under windows xp

html,css,internet-explorer-8,cross-browser,windows-xp

I own (and use) a Windows XP machine in addition to something more modern and I actually still have IE6 on the XP machine so as a web designer, I am way too familiar about coding for something as quirky as IE. One of the biggest and continuing quirks with...

recv() not receiving the number of bytes expected

c++,sockets,tcp,winsock,recv

send() returns the number of bytes transferred to the socket send buffer. If it returns 50,000, then 50,000 bytes were transferred. If you didn't receive them all, the problem is at the receiver, or in the network. You would have to post some code before any further analysis is possible....

BASH: SQLite3 .backup command

sqlite,backup

The .backup command uses SQLite's backup API, which is designed for online backups. As long as you do not do have broken hardware or software (which has nothing to with backups and would affect any writes), this will work fine....

jquery next button not working

javascript,jquery,html,css

You're going up one too many levels in your parent() steps when you hide and show. Also, you're hiding and showing the wrong elements -- when the quiz starts, you hide the div.quizitem, but you're targeting the li when you hide and show. It's simpler to use closest() to find...

kineticjs user input to change text size

javascript,html5,canvas,kineticjs

There are two decent options I can think of: adjusting the font size and adjusting the scale of the text element. Very similar in either case. Font size: document.getElementById("textSize").addEventListener("change", function() { var size = this.value; text.fontSize(size); layer.draw(); }, true); Fiddle: http://jsfiddle.net/pDW34/8/ Scale: document.getElementById("textSize").addEventListener("change", function() { var scale = this.value/100*4; text.scale({x:...

Extract all tokens from string using regex in Scala

regex,scala

Scala Regex, which is just a wrapper around Java Regex, will never return multiple subgroups for repetitions. The only way about it is to have a regex for the token, and then find it multiple times. You pretty much already have everything you want: "__[a-zA-Z0-9]+__".r findAllIn "httpx://__URL__/__STUFF__?param=value" That returns an...

Formatting python dictionary

python,string,dictionary,formatting

x is a list, not a dictionary. You can iterate over list items and unpack tuples this way: >>> x = [('the', 709), ('of',342), ('to',305)] >>> for a, b in x: ... print '%s:%s' % (a, b) ... the:709 of:342 to:305 If you want to make a dictionary from x,...

RPG Inventory Item Stacking C# Unity 3d

c#,unity3d,inventory

I got a little lost with the code (Not your fault), but I think the problem is a pass by reference / value error. (You can google it if you want, but I'll try to explain) Passing by reference is what C# does by default. It means this code: MyClass...

undefined method `questions' for nil:NilClass

ruby-on-rails,mailboxer

Your @conversation variable is never set to anything, so it is nil. You need to initialize it to something, either by setting it to Converation.new or retrieving a conversation from the database (which appears to be what you want to do in this case).

python graph-tool cuts off edges

python,graph,graph-tool

You pass the fit_view = False option to graph_draw(), it will not attempt to scale the drawing to fit the output size. You can then choose your view by changing the posions of the nodes, such that it does not exclude any part of the graph: g = random_graph(10, lambda:...

Update a sprite's height in cocos2d

cocos2d-iphone

Each CCSprite object has properties for the scale, scaleX and scaleY. In your case, you should use the scaleY property and do some simple maths : sprite.scaleY = DESIRED_HEIGHT/sprite.contentSize.height; But you have to make sure that your desired height is in float, otherwise you might get some issues, like always...

Why lists:filter doesn't work well?

erlang

I am not sure of what you are expecting as result, if you simply want to skip those special characters, you can use a list comprehension: quote(Value) -> "'" ++ [X || X <- Value , X =/= $', X =/= $;, X =/= $<, X =/= $>, X =/=...

Getting Intellij IDEA (13+) to recognize Gradle module interdependencies

intellij-idea,gradle

Discovered the following workaround: After importing Green's build.gradle, open Module Settings for the Green module (or select it under Project Structure). Then, on the Dependencies tab, manually add the 'live' dependencies and move them above the Gradle versions in the list: This will persist even through a "Refresh external project"...

How to set Count function field of select query in crystal report detail section?

c#,asp.net,sql-server,crystal-reports,select-query

You just put a field whose count you need in detail section. Then either use runningtotal factility or use a formula Count ({Table.Value}) Please check below link. In Crystal Reports, How do I count all the rows in the Details section and place that count in the header? http://www.crystalreportsbook.com/Forum/forum_posts.asp?TID=11297 ...

Has the Apps Script GUI Builder been discontinued?

user-interface,google-apps-script

GUI builder was discontinued - in September 2013 if I remember correctly.

VC++: Insert text in textBox without repeat

c++,visual-c++

if(lastwindow==currentwindow) does not compare the strings, it compares the addresses of the arrays, so they will never be equal. Use wcscmp to compare wchar_t arrays. Since these are wchar_t arrays, it is also invalid to be copying them with strcpy, which is only used with char arrays. Use wcscpy instead.

Angularjs removing dynamically generated rows

javascript,jquery,angularjs

Take a look here: http://plnkr.co/edit/zxjHLzqiAQnZzcaUwgBL?p=preview I added the "contact" class to the div container so I could identify it in the CSS: <div ng-repeat="(i,cont) in form.contacts" class="contact"> I added the remove button inside the container and gave it the "remove" class: <button type="button" class="remove" ng-click="form.contacts.splice(i, 1);">Remove</button> (Note: You may wish...

android setText doesn't work with scrollview

android,scrollview,settext

Replace FrameLayout with LinearLayout and try it. Try to understand the where and why FrameLayout is used. FrameLayout is designed to block out an area on the screen to display a single item. Generally, FrameLayout should be used to hold a single child view, because it can be difficult to...

Print cvMat channels

c++,opencv

You need to know the number of channels input image has. cvtColor is expecting it to have 3 or 4 channels. Use channels() to determine what you have. The following information is taken directly from the answer in: Can I determin the number of channels in cv::Mat Opencv cv::Mat img(1,1,CV_8U,cvScalar(0));...

displaying answers to division problems in java

java,swing

You are doing integer calculation. That will result in int. It doesn't matter, in what data type you are storing the result. For example double d = 10/3; result will be 3.0 not 3.3333333 you can solve it by making any one to float or double double d = (float)10/3;...

Time complexity of 2 for loops with a O(n) operation

big-o,time-complexity

As mentioned by @Mohamed above in mathematical terms, the complexity for the code in question is O(n^3). Quick explanation(worst case i.e. looping through the entire loop): Outer FOR loop complexity = O(n) Inner FOR loop complexity = O(n) Total complexity so far = O(n^2) Now, in my question I had...

Clone repository as background process with &

linux,git,process,background,clone

This should work just fine. However, you should be aware that "in the background" doesn't mean "where I can't see it". The command may still output data to the screen (which git certainly does), overwriting whatever you're currently doing. This is purely cosmetic. To run it in the background without...

MongoDB and MongoHQ Live Logs

node.js,mongodb,express,mongohq

I am not quite sure about the number of connections, but it could have something to do with default connection pool settings for Mongoose. The pool size, by default, is probably 5. Check the documentation here: http://mongoosejs.com/docs/connections.html Also, on the additional members, you are using MongoHQ Elastic Deployments. These are...

Construct object (Rectangle) without arguments when __init__ of class requires parameters

python,python-2.7

Read on python's support for default arguments for "constructors"... Something like def __init__(self, width = 0, height = 0) ...

Problems counting letters in perl hash

perl,hash,count

In your code: foreach my $aa ($string) { $counter{$aa}++; } ($string) is a list consisting of a single element, so the loop runs just once and is equivalent to $counter{ $string }++. You need to iterate over individual characters in a string. You can do that by splitting the string...

Why does Python's `requests` reject my SSL certificate, which browsers accept

python,ssl,certificate,python-requests

You are using a requests library without support for SNI (server name indication), but you have multiple SSL certificates behind the same IP address which requires SNI. You can verify this with openssl s_client. Without given a name for SNI the server just gives the default certificate for this IP,...

Drawing points on a canvas with Math.PI calculations

javascript,math,canvas

Your spacing value is based on 360 degrees (or Math.PI*2 radians). Your starting value (see the angle calculation) is Math.PI (or 180 degrees). Your span is therefore 180 degrees to 540 degrees (Math.PI to 3*Math.PI radians). You likely need to change your angle calculation (which should probably be renamed to...

try catch messes up return of method

methods,return,try-catch

Should be: public static double average() { double avg; try{ and further down: System.out.println("The sum is: " + sum); avg = sum / tnum; System.out.println("The average is: " + avg); That will do it. As others said, the way avg is defined it is only local to the try scope...

d3.js flare.json using my created Json w/ collapsible tree

json,d3.js

When you load a file with d3.json, it uses an http request. If the file is local, most modern browsers will refuse to GET the file, because that would be a security risk to users of their browsers (GET c:\allmypasswords.txt) Firefox is more permissive with requesting local files from locally...

Java how to use TreeMap

java,map

First point - Map cannot have two different values associated with the same key. If you really need to do this, you can create a map of lists, like this: Map<Integer, List<Integer>> map = new TreeMap<Integer, List<Integer>>(); The following code traverses the keys of the map and puts related values...

Model associations for CakePHP

php,mysql,cakephp

Payment.php add containable behavior as- public $actsAs = array('Containable'); PaymentsController.php $payments = $this->Payment->find('all', array( 'conditions' => array( 'Payment.guest_id' => '1' ), 'contain' => array( 'Reservation' => array( 'ReservationDetail' ) ) )); debug($payments); ...

Extract specific XML element in CDATA taken from SOAP::Lite Response Hash

perl,soap,cdata

I solved this by using the following, hope it helps someone... use XML::Simple; %keyhash = %{ $soap->call($method => @params)->body->{'GetCheckXmlResponse'}->{'GetCheckXmlResult'}}; $getxml= %keyhash->{Xml}; $parsexml = XMLin($getxml); print Dumper($parsexml); # Use this to point to your data and then grab it as per the line below $frontside = $parsexml->{Images}->{Front}; ...

Folding a list with accumulating into an array

arrays,haskell

Compile with -Wall, then you'll see the problem: runhaskell -Wall /tmp/wtmpf-file15704.hs /tmp/wtmpf-file15704.hs:2:1: Warning:     The import of `Data.List' is redundant       except perhaps to import instances from `Data.List'     To import instances alone, use: import Data.List() /tmp/wtmpf-file15704.hs:7:1: Warning:     Top-level binding with no type signature:...

Spring 4 and Hibernate 4 - GenericJDBCException: could not prepare statement

java,spring,hibernate

I'd try with a newer version of hsqldb. The version you have is quite outdated. As the error is raised from the database (function not supported), but the insert statement causing the issue looks fine, I think an update to the new version will do the trick.

android listview change height after animation

android,android-layout,listview,layoutparams

Thanks for the answer, I solved the problem with remove the view from the linearlayout like this: public void onAnimationEnd(Animator animation) { parent.removeView(this.v); lv.setTranslationY(0); } ...

Error npm install [email protected] Ubuntu 12.04.4 x64

ubuntu,meteor,meteorite,fibers

So after a bit of googeling i came to this. Node-fibers doesn't support intermediary releases, therefore you need to use 0.10.x branch or supported 11.x release! ...

Java effectively deleting object

java

public void despawn( Body body ) { body = null; } Here, you are merely setting the value of body, passed in as parameter, to null. What you could do is call: public void despawn( Body body ) { if(body != null && !bodies.isEmpty()){ bodies.remove(body); } } Which will remove...

Fetching items from a Meteor collection on the server throws “Can't wait without Fiber”

javascript,node.js,meteor,node-fibers

Answering my own question in case anyone needs the answer: Got it working with How to insert in Collection within a Fiber? Code is as follows: Fiber = Npm.require('fibers'); var repos = ['my-repo', 'my-repo-1',]; var pollGit = function() { repos.forEach(function(repo) { github.issues.repoIssues({ user: 'user', repo: repo }, function(err, stuff) {...

Rails Gem install fails after Rbenv

ruby-on-rails,rbenv

Based on the comments to the original question, the answer was that the system-installed rails executable was being used instead of the rbenv version. The fix was to run: gem install rails ...

Rails Spring/Rspec/Guard giving errors when there were none before Spring

ruby-on-rails,ruby,rspec,guard,spring-gem

Really strange. I wasn't notified of this problem before, but the application no longer was able to determine the HABTM relationship between Wines and Recipes. I updated my models to include the join_table argument and I no longer get the 'undefined constant' errors. I only found this out because I...

Setting a flag in C as elegantly as in assemby language

c,clear,c-preprocessor,flags

Personally, I prefer the bit-field syntax, and without macros since my flags are almost always inside structs anyway. However, if you insist on writing assembler in C, here's how: /* We need to indirect the macro call so that the pair of arguments get expanded */ #define BITSET_(f,i) do{f|= 1<<(i);}while(0)...

Get Function Not Working

python,python-2.7,tkinter

The method .get() of the Entry object does not accept any parameter. It is used to get the value in the Entry object. (Gets the current contents of the entry field). Do not confuse this .get() with the built-in get() of Python. Font: http://effbot.org/tkinterbook/entry.htm...

C fscanf reports EOF if parsed for a digit but not for a string

c,formatting,printf,scanf,fscanf

If you want to scan digit by digit, you need to use "%1d" as the format. Otherwise, it reads the whole line (apart from the newline) as the number and invokes undefined behaviour when it converts the large decimal number into a 32-bit int. Note that the mnemonic for d...

Passing data from a link-stack to a sorting array, then adding it back

java,sorting,stack

*assuming your variable numbers is the same as numbers2 and you have a typo Array size must be declared to initialize an array in java. int[] numbers = new int[size-1]; for(int i = size ; i > 1; i--) { int temphead = head; numbers[i] = stack.getpeople(temphead); temphead = stack.getBLink(temphead);...

Hadoop results confusion

java,hadoop,mapreduce

The issue here is that the logic of your two examples is actually different. In the first case, you're only counting the number of key/value pairs passed to the reducer. To be logically equivalent, you need to change count = count + 1 to count = count + iter.next().get() in...

How to detect numeric overflow/underflow in JavaScript arithmetic operations?

javascript

Actually, integers in Javascript are 53 bits of information due to the way floating point math works. The last time I needed to do something similar I did... var MAX_INT = Math.pow(2, 53); var MIN_INT = -MAX_INT; var value = MAX_INT * 5; if (value >= MAX_INT) { alert("Overflow"); }...

I'm very new to programming. Is this acceptable? [closed]

python,function

It seems you have two unrelated questions here. The first is whether your calculateTutitionIncrease function does the right thing to create an list of cost values over time. It is not bad, exactly, but it could be better. To start with, you could use a for loop over a range,...

How to insert a static Card to the timelime?

google-glass

You must use the Authentication API and then call Mirror from your GDK app via Account info to insert the card. Based on the documentation the static card feature in the GDK have gone away and you have to use mirror.

Why my DataTable rows are cleared after a bind to a GridView?

c#,asp.net,gridview,datatable

The server doesn't retain the value because each request is handled by a new instance of the page class. The variable holding the data table is not the same as the variable in the previous request. You can avoid the database call if you store the data table somewhere between...

DateTime conversion in SSIS

sql-server,date,datetime,ssis,data-type-conversion

Read about conversion of data types here ("Converting Between Strings and Date/Time Data Types"). It has a chart that shows what format your date needs to be in. Use string functions to make your date match one of these, then convert to the data type you want. http://technet.microsoft.com/en-us/library/ms141036.aspx...

Javascript issues *New to programming*

javascript,node.js

prompt() (actually window.prompt()), is not availabe in the Node.js environment. Use Node's "readline" module instead. var readline = require('readline'); var rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.question("Do you choose rock, paper or scissors?", function(answer) { // code to handle the answer goes here rl.close(); }); ...

How to use the nth selector for all items after n?

css,sass,css-selectors

King King gave the answer, for example: ul > li:nth-child(n+5) { color: blue; } See demo at: http://jsfiddle.net/audetwebdesign/7yVKS/ Reference: http://www.w3.org/TR/css3-selectors/#nth-child-pseudo...

Stripe validation error not showing

jquery,ruby-on-rails-4,stripe-payments

Try changing your jQuery in your head from this: jQuery(function($) { $('#new_student').submit(function(event) { var $form = $(this); $form.find('button').prop('disabled', true); Stripe.card.createToken({ name: $('#cardholder-name').val(), number: $('#card-number').val(), cvc: $('#card-cvc').val(), exp_month: $('#card-expiry-month').val(), exp_year: $('#card-expiry-year').val() }, stripeResponseHandler); return false; }); }); To this: jQuery(function($){ $('#new_student').submit(function(e) { var $form = $(this);...

How do I save and load a std::string with object serialization in C++?

c++,serialization

std::string holds a pointer internally to the actual string data which is malloced on the heap. write(char*, size_t) doesn't consider internal types (and associated copy constructors) AT ALL. This means that you were writing a pointer to a file, which never works. to fix it properly you would need actual...

Redis Hyperloglog - PFCOUNT side effect

data-structures,redis,hyperloglog

The header of the HyperLogLog object is as follows: struct hllhdr { char magic[4]; /* "HYLL" */ uint8_t encoding; /* HLL_DENSE or HLL_SPARSE. */ uint8_t notused[3]; /* Reserved for future use, must be zero. */ uint8_t card[8]; /* Cached cardinality, little endian. */ uint8_t registers[]; /* Data bytes. */ };...

My C++ functions with Rcpp::List inputs are very slow

r,rcpp

First, note that copying semantics for lists have changed in recent versions of R (definitely in latest R-devel, not sure if it made it into R 3.1.0), whereby shallow copies of lists are made, and elements within are later copied if they are modified. There is a big chance that...

constructor issues for java

java,eclipse

You are trying to print the object without overriding toString you get the default value of classname suffixed with the object's hashcode. You can override your toString as mentioned below. Another issue is your try to print the entire array instead of the indexed element it currently refers to: System.out.println(gerbil);....

Error with no information when installing SQL SERVER 2012 on Vmware Virtual Server 2008R2

sql-server,virtual-machine,windows-server-2008-r2

This is most likely a damaged ISO file. Try downloading it again.

java reset counter and close program with JOption pane

java

b1.addActionListener(new ActionListener() { public void actionPerformed (ActionEvent e) { clicked++; if (clicked >= 5) { Object[] options = { "No, thanks", "Yes, please" }; int response = JOptionPane.showOptionDialog(frame, "Would you like more math questions? ", "Math Questions", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options , options[1]); if (response == 1) clicked = 0;...

Message Box Becomes Unresponsive in Sencha Touch 2.3.1

javascript,extjs,sencha-touch

This is fixed. See in the sencha forum see fix here:...

run method after CreateView

java,android,multithreading,android-fragments

You should call it inside onActivityCreated() because it is called after onCreatView() example: @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); checkRow(); } here the lifecycle of fragment http://developer.android.com/guide/components/fragments.html...

Cannot convert type 'Android.Support.V4.App.Fragment' to 'Android.Gms.Maps.MapFragment'

android,google-maps,android-fragments,android-viewpager,xamarin

Since you are using Android.Support.V4.App.Fragments instead of using MapFragment at _mapFragment = MapFragment.NewInstance(mapOptions); use SupportMapFragment _mapFragment = SupportMapFragment.NewInstance(mapOptions); Hope that helps! You should have android.support.v4.jar in your libs folder and in the project build path...

Not printing the body of blog post?

php,mysql

Notice: Undefined variable: gp in /home/induadmi/public_html/por/blog.php on line 8 $gp doesn't exist. However $gP exists. Could they actually be the same ? :)...

Created a PyPI package and it installs, but when run it returns an import error

python,pypi

This is due to the difference between the three ways of invoking a python package: python daysgrounded python daysgrounded/__main__.py python -m daysgrounded If you try each of these on your project you'll notice that the third method doesn't work, which is exactly the one runpy uses. The reason it doesn't...

MongoDB and composite primary keys

mongodb,composite-primary-key,primary-key-design

You should go with option 1. The main reason is that you say you are worried about performance - using the _id index which is always there and already unique will allow you to save having to maintain a second unique index. For option 1, I'm worried about the insert...

Error with implementing Parcelable object

android,parcelable

Your SipService class must implement parcelabe and modify how SipService object is read and written from/to pracel. check this tutorial it might help you http://shri.blog.kraya.co.uk/2010/04/26/android-parcel-data-to-pass-between-activities-using-parcelable-classes/ You can use serialisable too… But parcelable is faster and better NOTE: all properties of an object (if the properties are objects) that implements parcelable,...

How do you add all the values of a particular column from mysql DB using php?

php,mysql

Why not do it from within the DB SELECT SUM(_balance) FROM A WHERE .... // whatever your where clause needs to be ...

how many threads do scala's parallel collections use by default?

multithreading,scala,parallel-processing

Assuming there are no concurrently running processes and/or threads, meaning that all the CPU and cores are idle, this will be 1 thread per logical processor on the CPU. For example, if you have an Intel processor with 4 cores, but those cores have hyperthreading, then there will be 8...

Run perl script through Java using ProcessBuilder

java

Runtime.exec() traps: http://www.javaworld.com/article/2071275/core-java/when-runtime-exec---won-t.html?page=3 2 problems with the code: Command should be broken down into a String[] such as: String[] command = {"perl", "/home/projects/bumble/script.pl", "--input", "/home/input/input.txt"} Output needs to be handled seperately without the redirect ">". To do this, ProcessBuilder has Redirect. http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.Redirect.html Programmatically the function is: public static void runCommand(final...

How to list products by category in a view with cakephp?

php,cakephp,category

Use Containable Containable is a behavior which allows you to limit/expand query results to the scope you define. For example, this will give you a list of Categories: // Pseudo controller code $categories = $this->Category->find('all'); array( array( 'Category' => array(...) ), array( 'Category' => array(...) ) ) Whereas this will...

kinetics user upload an image

javascript,html5,kineticjs

Just adapting the code from that "imageLoader" fiddle to create a new Kinetic.Image and add it to the layer instead of drawing straight to a canvas context. //image loader var imageLoader = document.getElementById('imageLoader'); imageLoader.addEventListener('change', handleImage, false); function handleImage(e){ var reader = new FileReader(); reader.onload = function(event){ var img = new...

requrejs module always undefined with knockout.bindings

jquery,knockout.js,requirejs

At the very least you need a shim for bootDatepicker because it depends on jQuery: bootDatepicker: ["jquery"] Without this shim you'd get exactly what you've reported in your question. Sometimes it works, sometimes it does not work, and when it does not work $(...).datepicker is undefined. I looked at the...

SSAS Tabular - Data is stale

reporting-services,ssas

I would suggest a few steps. Ensure you are connecting to the correct tabular model. Expand the tables in the tabular model, and right click one of the tables and click "Process". Check all the additional tables in the model. Change "Process Default" to "Process Full" (Process default does not...

Haskell: Specify list type for input

haskell

You can't hope to write something like this which will detect the type of x at run time -- what kind of thing you're reading must be known at compile time. That's why @Sibi's answer uses [Int]. If it can't be deduced, you get a compile time error. If you...

Initiating directive from controller

javascript,angularjs,angularjs-directive,angularjs-ng-repeat,angularjs-controller

Solved this by changing the directive for dataTables: scope.$watch( function() {return $rootScope.ReportReady}, function (newValue, oldValue){ if(newValue){ console.log('calling dataTables'); var dTable = element.dataTable(scope.options); new $.fn.dataTable.FixedColumns( dTable ); $rootScope.ReportVisible = true; } }) In the controller: $scope.$on('ngRepeatFinished', function(ngRepeatFinishedEvent) { //set a variable to true which datatables directive is watching //when that variable...

1 big Hadoop and Hbase cluster vs 1 Hadoop cluster + 1 Hbase cluster

design,hadoop,hbase

I would say option 2 is better.My reasoning - even though your requirement is mostly of running lots of mapreduce jobs to read and write data out of hbase, there are a lot of things going behind scene for hbase to optimise those reads and write for your submitted jobs....

Set control text for WPF application

c#,wpf,windows,winapi,findwindowex

Solution is to use Microsoft UI Automation AutomationElement rootElement = AutomationElement.RootElement; if (rootElement != null) { Condition condition = new PropertyCondition(AutomationElement.NameProperty, "WindowSplash"); AutomationElement appElement = rootElement.FindFirst(TreeScope.Children, condition); if (appElement != null) { Condition condition = new PropertyCondition( AutomationElement.AutomationIdProperty, "element1"); AutomationElement element = parentElement.FindFirst(TreeScope.Descendants, condition); if (element != null) {...

Powershell Array Export not equal operator not working

arrays,powershell,export-to-csv,logical-operators

If i understand this correct, you want the values in $msaArray, where $billingList contains customerIDs which are present in $msaClients but their corresponding Accounted time should not be eual to $idzero( 0 in this case) PS C:\> $msaArray = ($billingList | where {(($msaclients -contains $_.customerid)) -and ($_.'accounted time' -ne $idzero)})...

Adding two integers together using only 1's

java

The Java idiomatic for loops to perform an action a certain number of times are: for(int i=1; i <= [numTimes]; i=i+1){ and for(int i=0; i < [numTimes]; i=i+1){ The former has the correct starting condition, so your loop condition would be: i <= b....

Selection Sort using an Array of Struct, sorting using strcmp

c,arrays,sorting,pointers,strcmp

You have the problems that Jonathan mentions but the problems that really keep this from working are that the test condition is for the wrong strings and the wrong condition. The correct test is: if (strcmp((asciiArt+j)->artistName, (asciiArt+pos_min)->artistName) < 0) Note that the comparison is between pos_min and j and that...

preparing string to be passed to curlPerform

r

I like to use sprintf: SOAPAction <- sprintf('"http://www.soaplite.com/%s"', call) ...

ModX revo 2.2x: How to use a TV value to set tpl?

php,content-management-system,modx-revolution,getresource

If you need to do major changes to the html you could still probably solve it with css if you have a nice markup. However if thats not enough i would solve it by using one tpl for the getresources call, and letting that tpl handle the switching. If you...

Having trouble pulling data from Joomla array

php,arrays,database,joomla

What about loadResult() ? According to http://docs.joomla.org/Selecting_data_using_JDatabase : Use loadResult() when you expect just a single value back from your database query. $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('field_name'); $query->from($db->quoteName('#__my_table')); $query->where($db->quoteName('some_name')." = ".$db->quote($some_value)); $db->setQuery($query); $result = $db->loadResult(); ...

Create a results table from lists

python,dataset

Use zip function and csv module: import csv names = ['control', 'control', 'control', 'vinc', 'vinc', 'vinc'] area = [20.3, 23.4, 24.5, 65.45, 76.45, 34.65] mean = [123, 232, 132, 65, 34, 65] op_file = open('output', 'w') csv_writer = csv.writer(op_file, delimiter=',') csv_writer.writerow(['names', 'area', 'mean']) #print the header for row in zip(names,...

How to encode text to base64 in python

python,python-3.x,encoding,base64

Remember to import base64 and that b64encode takes bytes as an argument. import base64 base64.b64encode(bytes('your string', 'utf-8')) ...

CSS placing HTML elements

html,css

Like this, maybe? ul { list-style-type: none; display: table-cell; width: 1px; padding:0 0 0 5px; } form { display:table-cell; width:100%; } li { display:table-cell; white-space: nowrap; padding:0 5px } input { width:100%; } ...

C++ | How to format and export a simple binary file consisting of a 2-D matrix

c++,matlab,file,binary,format

So I finally made the output to satisfy my needs. The result is very similar to what iavr wrote (thank you for your quick response!), however I will copy my full (working) codes so it can be beneficial for someone else too. This is mine function of class file_io that...

foreach loop not starting console output at expected value

c#,loops,for-loop,foreach

Selman22's answer is the correct reason for what you're seeing - the console by default has a buffer of 300 lines. Everything earlier than the last 300 lines is scrolled off the console window and lost. You can change the buffer, increasing it to whatever size you need: Console.BufferHeight =...

Disable dialog for host to accept connection in WiFiP2PManager

java,android,p2p,wifi-direct

There is currently no way to do this though from Android 4.2.2 it is possible to remember previous groups. Look at this issue(it deals with this exact problem):https://code.google.com/p/android/issues/detail?id=30880...

Why can't my script find the files?

batch-file,cmd

Try this: forfiles /m *.txt /c "cmd /c echo @PATH" The problem is that echo is not a program in itself, but is a built-in command of the cmd program. So you have to execute cmd to use echo....

Can I have a UIButton's action method take a second parameter?

ios,objective-c,uibutton

You can do this two ways. Subclassing UIButton The first would be to subclass UIButton and create a property for the idNumber. So you would first set the property like so: cell.deleteButton.idNumber = /* set id here */ [cell.deleteButton addTarget:friendController action:@selector(deleteFriend:) forControlEvents:UIControlEventTouchUpInside]; and then access it inside your deleteFriend: method:...

Google Authentication not giving access to YouTube API [images]?

oauth,youtube-api,google-oauth

This looks like a case of your app not passing the proper scope when doing the oAuth authentication. In your code, where your client sets the oAuth scopes, make sure that this is one of the ones you're passing: https://www.googleapis.com/auth/youtube...

JQuery SlideToggle Sliding Down, then back up to cover content

javascript,jquery,html,css

Fixed it! I had my dt and dd set to float: left so when the toggle went do, the header tried to take its place next to the content and covered it?

How can I detect if there is input waiting on stdin on windows?

c++,c,windows

As stated in the ReadConsoleInput() documentation: A process can specify a console input buffer handle in one of the wait functions to determine when there is unread console input. When the input buffer is not empty, the state of a console input buffer handle is signaled. To determine the number...

Bmp to same dimensions pdf

pdf,dimensions,bmp

I tend to use this online converter : Link to a pdf converter I tried it with an image and it did not give me a A4 size. With LaTeX you can create a document containing : \documentclass{standalone} \usepackage{graphicx} \begin{document} \includegraphics[scale=1]{file.png} \end{document} and compile it with PDFLaTeX....

C++ Can't access dynamically allocated array of cards after construction

c++,arrays,dynamic

Hand::deck is a pointer that is never initialized. The call Deck(); in your Hand constructor creates an anonymous instance of Deck that is immediately destroyed again while deck still points to nothing. Try deck=new Deck; instead of Deck();

Create an array from a mysqli prepared statment

php,mysql,mysqli

Please check mysqli_result::fetch_assoc method on PHP.net for better understanding. Below is a quick example require_once ('lib/constants.php'); $mysqli = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or die('Error connecting to Database.'); $query = "SELECT * FROM employees LIMIT 0, 20"; if ($result = $mysqli->query($query)) { /* fetch associative array */ while ($row =...

Return Facebook profile picture

ios,objective-c,facebook-graph-api

You should not need to do either. Request it again. The URL loading subsystem will check it's cached version and send Facebook an If-Modified-Since (conditional GET) request to check for a newer version. You do not have to do anything special, the system does this for you. If there is...

Implementing multiple overlays using Mapkit

ios,objective-c,mapkit

First of all, I would like to point out that you are using deprecated methods. MKOverlayView as deprecated in iOS7. That aside though, what you need to do is determine which type of overlay to return based on the overlay parameter passed to the delegate. So, if I were to...

How to Build Software

Getting started tutorials how to be a good programmer, develop software with:

sticky-footer , vb.net , p-value , private-inheritance , objectinstantiation , appdomain , gitblit , gretty , password-protection , lcc-win32 , jdi , fiddler-dev , onepage , spynner , ember.js , visual-paradigm , physx , or-operator , prims-algorithm , odp.net , secure-gateway , staruml , bifunctor , h5py , sockjs , out , quicktype , rootscope , telerik-grid , audiotoolbox , ogr , backgroundworker , managed-property , lustre , remote-server , undefined-behavior , modular-design , repr , javah , octopress , screen-capture , page-object-gem , cuda , validating , jstilemap , liquid-layout , sails.js , cmsamplebufferref , render-to-string , cordova-plugins , copy-constructor , immutant , gradlew , clique-problem , wheel , jarsigner , internet-connection , zombie-process , multiviews , adb , r5rs , global , html-datalist , lubuntu , scgi , twitter4j , kinvey , yii-booster , editor , orphan , java-8 , strong-parameters , classloader , resharper-7.1 , general-purpose-registers , negative-number , voicexml , mysqli , scp , social-framework , sna , scatter-plot , group-policy , jquery-ui-datepicker , jquery-ui-button , quincykit , mongrel , postdelayed , cakephp-3.0 , watchman , aura.js , htmldatatable , check-constraints , webfaction , largenumber , valueconverter , redis , void , unicode , cwac-camera , local-database , defaulttablemodel , ocamlbuild , bitstuffing , computer-architecture , apk-expansion-files , cefsharp , jvmti , core-services , microsoft-ui-automation , colorbar , javascript-framework , optaplanner , genetic-programming , intel-fortran , android-wallpaper , bigfloat , uno , eventemitter , google-groups , paypal , refactoring-databases , uistackview , berksfile , grunt-init , crystal-reports-10 , r.js , yagmail , linkbutton , job-scheduling , high-load , truncation , flickr-api , zfcuser , yowsup , delphi-xe3 , js-of-ocaml , panoramio , symfony-routing , nscopying , cfhttp , bing-maps-api , marquee , yeoman , insertion-sort , propertysheet , non-member-functions , akka-testkit , packaging , websocket++ , missing-template , algebra , minify , zend-form-element , output-parameter , togaf , build-system , rtmfp , implode , callback , qtreewidgetitem , polymer , p2 , prebuild , jsr303 , pkzip , microsoft , spline , kendo-panelbar , javafx-1 , type-theory , boost-locale , acumatica , qlpreviewcontroller , command-line-interface , nth-element , current-working-directory , visual-studio-team-system , google-reseller-api , textinput , spring-data , privileges , bitronix , fsharpchart , git-describe , acl , opengl , physijs , jetpack , ccc , windows-server-2008 , linkedin-gem , python-unicode , enter , adobe-brackets , mention , plpython , jquery-ui-map , hibernate-criteria , nscell , soomla , dbdatareader , bpmn , maven-sdk-deployer , coordinate-transformation , latitude-longitude , unity3d-editor , versioninfo , uiinputviewcontroller , lsf , compareto , packet-capture , datarowview , first-chance-exception , twitter-follow , microblaze , binomial-cdf , kendo-combobox , reader , text-alignment , iwconfig , amortization , android-sdk-2.1 , jquery-chosen , tkinter-canvas , oracle-analytics , jpgraph , android-file , chocolatey , category-theory , arcgis-js-api , android-contentresolver , animated , generic-handler , before-save , numactl , modelica , extract-method , anko , non-thread-safe , csla , xtext , sqlexception , xp-mode , cgaffinetransform , bootstrap-datepicker , spotlight , appcrash , smart-listing , netstream , passphrase , avassetexportsession , solr4j , qheaderview , symbols , py2app , githooks , datawindow , heightforrowatindexpath , saml-2.0 , information-extraction , reformatting , right-join , openmp , msvc12 , regions , regexp-replace , uitabbar , jquery-deferred , format-specifiers , harp , turbogears2 , scalaxb , fabric8 , response-headers , nhibernate-3 , bison , controlcollection , pymongo , word-cloud , bho , jwrapper , azure-webjobssdk , set-returning-functions , col , datatemplateselector , tsc , report , libpqxx , phishing , azure-servicebus-queues , ultragrid , avcapture , vnc , skype-for-business , shrink , software-release , memory-mapped-files , jsr330 , lilypond , uploader , webrequest , sudoku , camera-flash , gitx , form-data , statistics , grunt-contrib-copy , saiku , mongolab , sqlpackage , dependency-resolver , translation , symbolic-math , bsd-license , restsharp , visual-studio-cordova , parsec , ditto , vectorization , lnk , edmx , office-2007 , median , extjs4.1 , mysql-5.6 , member-initialization , realurl , equality , nmea , datatable.select , gnu-arm , gvisgeomap , ldap-query , uglifyjs2 , jenkins-plugins , calabash , pointcuts , haskell-mode , cglib , imagekit , redux-framework , mkv , office365 , strict-aliasing , protractor-net , camera-overlay , ios7.1 , preflight , sales-tax , cudd , named-scope , ambiguous-call , mixed-mode , dojox.grid , and-operator , gwt-super-dev-mode , let , django-comments , baseless-merge , optional-chaining , scalar-subquery , binding , jasig , kill-process , tolower , iis-6 , scala-template , accumarray , shiro , gst , clpq , ansi-colors , idris , qwt , drone , commandparameter , struts-1 , jquery-countdown , declare , const-iterator , cvx , famous-engine , html.beginform , child-actions , badimageformatexception , tint , egit , toad , ta-lib , drop-database , g1gc , prolog-dif , etiquette , codelite , lenskit , sparse-checkout , yarn , short-circuiting , android-logcat , avcodec , codeigniter-restserver , pointer-to-member , magento-rules , 3nf , pryr , sql-function , glm , windows-themes , mcclim , device-emulation , horizontallist , google-talk , ibm-datapower , mongodb-java , swagger-php , unlock , sikuli , topojson , byte-buddy , interactivepopgesture , compilation , nexus-s , mutated , survival-analysis , ruby-development-kit , arrows , uploadcare , bssid , opnet , bundletransformer , catalog , time-t , serverside-javascript , excel-2011 , poco-libraries , pdfviewer , ecmascript-6 , impresspages , typo3 , sha512 , tesseract , mean-stack , netstat , nsxmlparser , history , access-violation , xmllite , dreamhost , deflate , frame , imagelist , mp3 , dunn.test , angularjs-nvd3-directives , asp.net-web-api-odata , getfiles , pyephem , kineticjs , microphone , temporary-objects , computation , adobe-indesign , onresume , rubygems , ssas-2012 , path-finding , sse , email-headers , esql , prettify , google-custom-search , yahoo-weather-api , objectid , resx , obex , everlive , dllexport , goroutine , jtextpane , gembox-spreadsheet , efm , ipad , scalamock , qjsonobject , mkmaprect , plane , oxygene , dropbear , spring-jpa , ttreenodes , gradle-plugin , liferay-6 , google-api-python-client , calendarview , fparsec , rails-for-zombies , wysihtml5 , nsstring , ormlite-servicestack , srcset , python-webbrowser , android-tabactivity , photoviewer , htmlcontrols , diophantine , threadabortexception , session-replay , nullptr , jsmovie , samsung-mobile , pydio , activejdbc , aop , targettype , android-maps-v2 , bnf , force-layout , tel , named-query , oncreateoptionsmenu , nsdateformatter , mkpolygon , processwire , publish-actions , rtcdatachannel , qstyleditemdelegate , qsys , max-heap , facebook-oauth , sql-server-triggers , connect-flash , pysqlite , atg-droplet , yield , bartintcolor , css-position , writable , bulkinsert , websharper , codewarrior , lumia-imaging-sdk , google-oauth-java-client , firebase , arraycollection , winscp , gradle , code-snippets , cluster-computing , drawing , revisions , robot , jspresso , bigbluebutton , minitab , tween , datagridrowheader , fromhtml , httpurlconnection , socket.io-1.0 , theorem-proving , mlton , r-within , autocad , flask-testing , addrange , codesign , servicemix , hover-over , shapesheet , monit , nosql-aggregation , android-context , vpn , parquet , variable-names , sahi , repopulation , teamcity , pushpin , albumart , pyopengl , economics , tfs-web-access , prefetch , ldjson , jsonreststore , prototypejs , imeoptions , thread-safety , asynchronously , registerclass , god , gmock , optimistic-locking , launchd , garrys-mod , sshj , require-once , .mov , nhibernate-criteria , ofed , tic-tac-toe , qt4.7 , node.js-stream , angstrom-linux , dotq , delimiter , va-arg , explicit-instantiation , image-extraction , csplit , httpwatch , control , graph-theory , zigbee , binaryfiles , qtnetwork , viewstate , languageservice , kubernetes , linq-expressions , degrees , twitter-rest-api , mutable , xhtml , igraph , gamecontroller , ramdisk , io , dynamic-invoke , apktool , nstoolbar , infinite-scroll , figaro , nsdocument , pheatmap , eject , file-put-contents , expresso , mutagen , gforth , jtableheader , leanback , event-driven , codepro , flixel , named-entity-recognition , synthesis , kaazing , shebang , building , usability , windows-media-player , stormpath , bluej , pan , gwt-celltable , lalr , mobile , configparser , ef-migrations , android-mediaplayer , homekit , line-plot , greasemonkey , kcfinder , unreachable-statement , android-mediarecorder , facebook-messenger , doctrine , orleans , lens , jasmine-node , black-box-testing , cfquery , android-wear-notification , digital , onload , mpkg , outline , remote-execution , jqlite , validationsummary , public-key , credit-card , facebook-login , ocmockito , rich-text-editor , psexec , icomparable , contactpicker , auto-value , double , resource-loading , modbus-tcp , nsinputstream , openstack-swift , ext3 , r.net , vxworks , tracesource , bootloader , deb , hebrew , credentials , spry , magento-1.9 , scipy , subtract , compojure , arguments , mathdotnet , cakephp-2.4 , gulp-compass , mbr , reveal.js , android-traceview , alt , mgwt , integrate , flashlight , scrimage , ellipse , rpm-maven-plugin , php-5.6 , corpus , icollectionview , out-gridview , bencoding , irssi , freetds , jquery-backstretch , resource-contracts , grunt-svgstore , heap-dump , soft-keyboard , csg , google-client-login , private-methods , stringtemplate-4 , pyinstaller , sql , runtime , libtiff.net , lzo , pocketsphinx-android , url-redirection , fetched-properties , psr-0 , typedescriptor , hierarchy , azure-vpn , netlink , battery-saver , ivalidatableobject , parser-generator , lz77 , integer-arithmetic , taskkill , backgrid , 32bit-64bit , form-processing , artifacts , demoscene , temp , iso-15693 , flip , jbuilder , isnullorempty , ios8 , working-set , cassandra-cli , dbconnection , alasset , isqlquery , aggregation , installshield-2013 , netcat , levelplot , dawg , responsibility , swingworker , nutch , rvm , recurring , wcm , groebner-basis , rerender , spring-4 , .net-attributes , credential-providers , php-5.2 , rostering , dih , anonymity , dom-manipulation , salt-contrib , sqldf , info-hash , timer , systemtime , rtf , uiscrollviewdelegate , yii-chtml , non-relational-database , taglib-sharp , javafx-webengine , axon , type-conversion , completion , intuit , meekro , silverlight-4.0 , exploit , air , libsodium , datamodule , ostringstream , fileutils , typeinfo , sevenzipsharp , rufus-scheduler , full-outer-join , edit-and-continue , utf-16 , qx , overloading , infopath2010 , cassandra-2.0 , dynamic-parallelism , getlasterror , up-button , local-class , mssqlft , unzip , operands , jdatechooser , hex-pm , heapsort , node.js , telephony , initwithcoder , web.xml , amazon-appstore , pac , type-level-computation , trading , hapijs , schannel , federated-table , visio , rescue , automatic-variable , dlopen , nexmo , thread-sanitizer , continuations , workload , xcdatamodel , for-else , service-worker , msflexgrid , keylogger , community-translations , nsd , shrinkresources , hough-transform , mod-pagespeed , cyclic-dependency , hoisting , addhandler , nstrackingarea , presentviewcontroller , backbone-relational , bltoolkit , floating-action-button , mismatch , toarray , bounds , annyang , array-reduce , blur , router , actionlink , gradle-eclipse , unit-conversion , clamp , nsarraycontroller , remoting , custom-event , dandelion , ember-addon , gitignore , overflow , google-cse , winrt-component , visual-c#-express-2010 , vmware-fusion , ember-cli-addons , subdocument , longlistselector , intermediate-language , pyv8 , runjettyrun , wicket-1.5 , zabbix , mallet , django-pagination , broadcastreceiver , mosek , wordsearch , pfbc , app-store , rx-java , playmaker , wininet , custom-cell , jsduck , dialyzer , query-plans , chgrp , gdal , primality-test , datajs , empythoned , continuous-delivery , sanity-check , revolution-slider , treetop , tms , ng-idle , dapper , np , javax.xml , jnlua , c++-cx , timespan , printer-control-language , linear-programming , wice-grid , analog-digital-converter , pathname , jsqlparser , windows-10-mobile , stagefright , unmodifiable , task-t , kindle , rasterizing , vundle , cursor-position , mps , xpages , extjs2 , key-value-coding , boolean-logic , multisampling , nibble , optionbutton , inform7 , deciphering , matrix-math , xctest , dhis-2 , skybox , python-plyplus , enterprise-miner , hi-tech-c , long-press , android-progaurd , livechat , apply-templates , sharding , cfinput , polyline , composite-literals , sharepoint-2007 , object-model , function-object , cognos , dojox.charting , rabin-karp , jekejeke , domain-events , joincolumn , test-kitchen , mp4parser , subgrid , editview , jasidepanels , reference-wrapper , libpd , gzip , vim , shared-resource , javascript-automation , cdata , sicp , install.packages ,