Posts

Showing posts from February, 2013

Excel VBA reference a macro variable inside quotes -

Excel VBA reference a macro variable inside quotes - i'm trying reference string macro variable insude quotes. here's have. why couldn't &state. arrrggg! thanks dim state string state = "ak" workbooks.open filename:= _ "\\sac-psas-02\pm\ma\scott\ow\hpi trend pci outlier removal\lr_hpi_""" & state & """ .csv" simply: "\\sac-psas-02\pm\ma\scott\ow\hpi trend pci outlier removal\lr_hpi_" & state & ".csv" (you need multiple " within string when want " character) excel-vba

angularjs - What sense does have a new child scope inaccessible from parent controller? (created by ng- directives) -

angularjs - What sense does have a new child scope inaccessible from parent controller? (created by ng- directives) - in angular.js directives create kid scopes. (ng-include, ng-if, etc) i know there ways solve it, illustration declaring variable in scope of controller. uncomment //$scope.inner = '1234' , remove ng-init="inner='1234' and work. solution utilize object in parent scope containing variable. still not create sense me. what sense have scope without controller? practical utilize have these new kid scope? this example. class="snippet-code-js lang-js prettyprint-override"> var app = angular.module('app', []); app.controller('ctrl', ['$scope', function($scope) { $scope.result = "result"; $scope.outer = "outer"; //$scope.inner = "1234"; $scope.test1 = function() { if ($scope.inner) { $scope.result = $scope.inner; }

firefox - Referenceerror: data is undefined -

firefox - Referenceerror: data is undefined - i'm trying create firefox addon uses contentscript inject .js file in page. of works maintain getting weird error. main.js var pagemod = require("sdk/page-mod"); var self = require("sdk/self"); var info = require('sdk/self').data; pagemod.pagemod({ include: ["http://www.google.com", "https://ww.google.com" ], contentscriptfile: data.url("contentscript.js") }); contentscript.js var s = document.createelement('script'); s.src = data.url('jquery.js'); s.onload = function() { this.parentnode.removechild(this); }; (document.head||document.documentelement).appendchild(s); settimeout(function(){ var d = document.createelement('script'); d.src = data.url('script.js'); d.onload = function() { this.parentnode.removechild(this); }; (document.head||document.documentelement).appendchild(d); },

opencl - Serialize work group items in kernel -

opencl - Serialize work group items in kernel - i have kernel performs 2 tasks, followed b. a parallelized on work items, , b sequential, first work item performs it. each work item perform part of b if create them execute in sequence. 2d kernel, , create work items execute in raster pattern. is possible? 1 thought local variable work items can read, , unique work item matches variable execute , modify variable trigger next work item execute. any ideas/patterns on how this? thanks! edit: here pseudo code how kernel works: void mykernel(void) { // perform task (all work items active) barrier(clk_local_memory_fence); if (get_local_id(0) == 0 && get_local_id(1) == 0) { //perform task b } } and here how work: // 10 x 10 2d kernel void mykernel(void) { // perform task (all work items active) barrier(clk_local_memory_fence); local activeindex =0; while (activeindex < 100) { if ( get_local_id(0) + 10*

Is there a one line way I can find the length of the longest of two C# strings? -

Is there a one line way I can find the length of the longest of two C# strings? - i have 2 strings input parameters method: public list<answerrow> makeanswers(string c, string r) on first line of method have code check status both null , return: if (c == null && r == null) { homecoming null; } is there safe (one of 2 might null), 1 line way can find length of longest string? note homecoming type used later on in method after know length of longest string. math.max(c==null?0:c.length, r==null?0:r.length) c#

python - How to get a value from a dict in a list of dicts -

python - How to get a value from a dict in a list of dicts - in list of dicts: lst = [{'fruit': 'apple', 'qty':'4', 'color': 'green'}, {'fruit': 'orange', 'qty':'6', 'color': 'orange'}, {'fruit': 'melon', 'qty':'2', 'color': 'yellow'}] i want value of 'fruit' key 'color' key's value 'yellow' . i tried: any(fruits['color'] == 'yellow' fruits in lst) my colors unique , when returns true want set value of fruitchosen selected fruit, 'melon' in instance. you utilize next() function generator expression: fruit_chosen = next((fruit['fruit'] fruit in lst if fruit['color'] == 'yellow'), none) this assign first fruit dictionary match fruit_chosen , or none if there no match. alternatively, if leave out default value, nex

python - Why is there showing a 'None' in the Output? -

python - Why is there showing a 'None' in the Output? - my programm shell show grid , programm has lot of functions calling each other. problem there 3 nones showing in output. can imagine it's because in bracket after funtionname written no argument in instead of do_twice , do_fourth. don't need argument because have written function execute function do_quater in end. don't know if should declare in function variable hint none. def do_twice(f): f() f() def do_fourth(f): do_twice(f) do_twice(f) def do_row(): print '+----', print '+' def do_worms(): print '| |' print '| |' print '| |' print '| |' def do_wormsr(): print '| |' print '| |' print '| |' print '| |' def do_row(): print '+----', print '+' def do_worms(): print '| |' prin

Android disable divider in Custom adapter -

Android disable divider in Custom adapter - i can not disable divider in custom adpater. xml layout : <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#464646" android:showdividers="none"> </linearlayout> i'm seek disable programical not work me. updated post: custom adapter: public class receivedadapter extends baseadapter { private layoutinflater inflater; private list<receiveditemstructure> row; private textview tv_smsbody; private textview tv_smssender; private textview tv_smsdate; public receivedadapter(context context, list<receiveditemstructure> row) { this.row

java - Whats the difference between vs -

java - Whats the difference between <[]> vs <null> - <[]> vs <null> the first empty set containing no objects. can created code: set<node> expected =new hashset<>(); the sec set containing 1 null element. if not, can null have type set ? not sure how code sec item. <[]> means object include no elements. null not element. after u phone call construction method new hashset<>(); , set point real memory. null point nowhere. java collections junit set

java - Play Framework 2.3.4 - How to call Results.badRequest() on a POST request and direct to method in controller not mapped by routes? -

java - Play Framework 2.3.4 - How to call Results.badRequest() on a POST request and direct to method in controller not mapped by routes? - ok title bit hard understand. what trying accomplish following. my controller: public static result addsomething() { homecoming getsomething(some_form); } public static result addsomething(form<someformdetails> someform) { // complicated stuff someobject , someotherobject homecoming ok(com.me.views.html.pages.addsomething .render(someobject, someotherobject, someform)); } public static result postfromsomeform() { form<someformdetails> filledform = some_form.bindfromrequest(); someformdetails details = filledform.get(); // checks if (database.addstuff(details)) { homecoming redirect(com.me.controllers.routes.get.index()); } else { // #### of import bit #### // next line not possible not have // method addsomething(form<someformdetails> s

unit testing - Mocking Directory Structure in Python -

unit testing - Mocking Directory Structure in Python - i have code below i'm using take input of files, open , process, , output data. i've gotten functionality working , i'm unit testing now, below illustration of code. def foo(dir): path_to_search = join(dir, "/baz/foo") if isdir(path_to_search): #path exists stuff... fname in listdir(path_to_search): do_stuff() else: print "path doesn't exist" i've been able create test past doesn't exist enough, can see above assert "/baz/foo" portion of directory construction exists (in production directory construction must have file, in cases won't , won't need process it.) i've tried create temporary directory construction using tempdir , join, code kicks out saying path doesn't exists. is possible mock output of os.listdir such won't need create temporary directory construction follows needed /baz/foo conven

Use $.ajax() in JSF -

Use $.ajax() in JSF - is there way phone call method in java using $.ajax() without using f:ajax tag? i've seen many tutorials uses f:ajax tag i'd utilize pure ajax because need dynamically create dom , phone call ajax after that. jquery var url = "insert.jsf"; // assuming insert() action called. var info = {}; $.ajax({ url: url, data: data, success: function() { console.log("success"); }, error: function() { console.log("error"); } }); personcontroller.java // think annotation should placed here. public void insert() { // something. } ajax jsf

multithreading - C++: Fetch_add on memory mapped file -

multithreading - C++: Fetch_add on memory mapped file - i openend file using boost mapped-file library. possible utilize "fetch_add" (value read @ position added , written same position atomically) on mapped file? if multiple threads write in parallel there problems without atomicity involved the file in binary format , contains ints or doubles (depends on specific file). i tried locks/mutexes slow programme downwards when using multiple threads. time spent in locked regions big compared rest of algorithm , threads block each other. are there improve ways multiple threads can write mapped file high performance? thanks. laz are there multiple processes mapping file, or multiple threads? if multiple processes accessing memory mapped file concurrently, you'll have own (inter-process) synchronization. if it's multiple threads, can atomically update memory same way you'd other word of memory, caveat can't utilize std::atomic (because

javascript - Fastest way to search string for substring using jQuery -

javascript - Fastest way to search string for substring using jQuery - i using datatables plugin jquery. within datatable have approximately 16 tr rows 4 td columns each. datatables plugin provides api extension allows searching string in cells of table or in cells of specified column. the search extension returns array of row indices match found. example, [3, 7, 10, 11]. search extension supported exact match search had modify from: if (val == ssearch) to: if (val.indexof(ssearch) > 0) my customization cause of performance issues i'm having, necessary since contents of cells updated dynamically , hence unpredictable performing exact match search. an illustration haystack: <input id="_heatofrejection" class="form-control text-right text-box single-line" type="text" name="heatofrejection" measureid="heatload" value="5000.0" uomid="mbh"> an illustration needle: ' measur

loops - End a program after meeting user entered sum in Python -

loops - End a program after meeting user entered sum in Python - total = 0 not_total = true sum_of_square = int(input("enter desired sum: ")) while (not_total == true): n in range (2): total = total + n**2 print("the sum of squares 1^2 {0}^2 equal {1}.".format(n,total)) this provide infinite amount of sums want stop total sum before user input you can compare 2 values in conditional statement of while loop so: total = 0 sum_of_square = int(input("enter desired sum: ")) while (sum_of_squares <= total): n in range (2): total = total + n**2 print("the sum of squares 1^2 {0}^2 equal {1}.".format(n,total)) python loops while-loop sum

PostgreSQL 9.0 issues with function -

PostgreSQL 9.0 issues with function - here function working with: create or replace function f_multiply_row(_tbl regclass , _idname text , _minid int , _maxid int) returns void $func$ begin execute ( select format('insert %1$s (%2$i, %3$s) select g.g, %3$s (select * %1$s limit 1) t ,generate_series($1, $2) g(g)'::text , _tbl , _idname , string_agg(quote_ident(attname), ', ') ) pg_attribute attrelid = _tbl , attname <> _idname -- exclude id column , not attisdropped -- no dropped (dead) columns , attnum > 0 -- no scheme columns ) using _minid, _maxid; end $func$ language plpgsql; select f_multiply_row('campaign

Django 1.7 installation using pyvenv with python 3.4 in Ubuntu Trusty 14.04 -

Django 1.7 installation using pyvenv with python 3.4 in Ubuntu Trusty 14.04 - just wanted share since used day figure out in many threads. i wanted utilize pyvenv instead virtualenv since ships python 3.3 , above. called virtualenvironment "pisara" first of ubuntu 14.04 ships broken pyvenv. need install with: pyvenv-3.4 --without-pip pisara if seek install django 1.7 after it, , error point python 2.7 folder: >(pisara) vagrant@vagrant-ubuntu-trusty-64:/vagrant/projects$ pip install django downloading/unpacking django downloading django-1.7.1-py2.py3-none-any.whl (7.4mb): 7.4mb downloaded installing collected packages: django cleaning up... exception: traceback (most recent phone call last): file "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main status = self.run(options, args) file "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 283, in run requirement_set.install(install_optio

java - Cannot throw exception in hive udf -

java - Cannot throw exception in hive udf - i trying larn writing udfs. code works fine when not throw exception. moment throw exception not work. if comment out else part , homecoming null, works. public final class findpattern extends udf { private static final string strpattern= "^(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"; public static string evaluate(string targetstring) throws udfargumentexception { // pattern matching on input pattern pattern p = pattern.compile(strpattern); matcher m = p.matcher(targetstring); string res=null; // if find match, grouping if (m.find()) { // first grouping matches res= m.group(1).concat("."+m.group(2).concat("."+m.group(3))); return("*********"+res); } else throw new udfargumentexception("ip address not valid"); } }

Normalize whitespace with strtok in C -

Normalize whitespace with strtok in C - i trying utilize strtok normalize whitespace in string after have removed substring. when remove substring there 2 spaces between 2 words , want cut down 1, illustration deleting substring "rise and" string "the rising , fall of rome" leaves 2 spaces between , fall. this have far have no experience strtok: char *strdel(char *string, const char *substring) { int mainlen, sublen; // finds first occurrence of substring char *del_sub = strstr(string, substring); char *wspc, *df; while (del_sub != null) { // finds length of string origin of substring // found in main string mainlen = strlen(del_sub); // finds length of substring sublen = strlen(substring); // removes number of bytes needed after // first instance of substring memmove(del_sub, del_sub + sublen, strlen(del_sub)); wspc = strtok(string, " ");

Android three activities, pass data from third activity to parent activity -

Android three activities, pass data from third activity to parent activity - i have 3 activities. let's a, b, c. main activity a. i'd start b start c b, close b when c opens. upon closing of c pass info a. how's possible intent , startactivityforresult? @ possible 2 latter methods? thanks. supose using button, when click button start activity c, can finish activity b, , action in activity a. use onactivityresult() on activity a. on pont, can start activity c using startactivityforresult(). this way, when finish c, can pass info a, 1 time again using onactivityresult(). android android-intent start-activity pass-data

How can i make directory listing possible in my prestashop website? -

How can i make directory listing possible in my prestashop website? - how show files in directory listing in prestashop website. want create directory listing possible in prestashop website. example: www.chakras-music.com/prestashop/modules/ you have redirect folder folder should not contain index file (index.html 0r index.php) prestashop directory-listing

sparql - Filter language only if the type is literal -

sparql - Filter language only if the type is literal - this same quetion as: filter language if object literal problem reply there doesn't work in case. i have query: select ?property ?value { <http://dbpedia.org/resource/facebook> ?property ?value filter(strstarts(str(?property), "http://dbpedia.org/property") || strstarts(str(?property), "http://dbpedia.org/ontology"))} result in virtuoso there see list of properties including "alexa rating 2" , "abstract" in many languages. if seek suggested solution in mentioned question above: select ?property ?value { <http://dbpedia.org/resource/facebook> ?property ?value filter(strstarts(str(?property), "http://dbpedia.org/property") || strstarts(str(?property), "http://dbpedia.org/ontology")) filter(!isliteral(?value) || langmatches(lang(?value), "en"))} result in virtuoso now see english language version of "abstract"

c++ - Link Error with MIC.o file -

c++ - Link Error with MIC.o file - while linking sources of application mic intel c++ (icpc) compiler got error. intel-icc/2013-64 version: somethingmic.o: relocation r_x86_64_pc32 against undefined symbol `_zn9__gnu_cxx21__atomic_add_dispatchepii' can not used when making shared object; recompile -fpic x86_64-k1om-linux-ld: final link failed: bad value intel-icc/2015-64 version: somethingmic.o: in function `std::locale::facet::_m_add_reference() const': /usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0 bits/locale_classes.h:402: undefined reference `__gnu_cxx::__atomic_add_dispatch(int*, int)' somethingmic.o: in function `std::locale::facet::_m_remove_reference() const': /usr/linux-k1om-4.7/linux-k1om/../x86_64-k1om-linux/include/c++/4.7.0 bits/locale_classes.h:409: undefined reference __gnu_cxx::__exchange_and_add_dispatch(int*, int)' somethingmic.o: in function `std::locale::_impl::_m_add_reference()': /usr/linux-k1om-4.

javascript - jQuery set dropdown value on checkbox change -

javascript - jQuery set dropdown value on checkbox change - i have grouping of dynamic rows each dropdown , checkboxes , need alter individual dropdown value of row if checkboxes selected. currently can work if select checkboxes in rows. how can create row's dropdown changes when checkboxes belongs selected? i setup fiddle markup of works right now. help! http://jsfiddle.net/uyv3mk7b/ <!--first row eventregistrations[1]--> <select class="regselect" name="eventregistrations[1].eventregistrationstatustypeid" id="registrationstatusselect"> <option value="1">pending</option> <option value="2">attended</option> </select> <input type="checkbox" class="regchecked" name="eventregistrations[1].markattendance[1].attendancedate" value="1">9/21/14 <input type="checkbox" class="regchecked" name="eventregi

php - Manage a dynamic site with FTP acess only -

php - Manage a dynamic site with FTP acess only - can manage dynamic website (contains php scripts) ftp account, because admin of site can't provide access cpanel interface. yes, sure can. won't able perform admin tasks, managing php files won't problem. php web cpanel

c++ - How to find all keys in map in C++11 which are equal or higher than KEY_1 and lower than KEY_2? -

c++ - How to find all keys in map in C++11 which are equal or higher than KEY_1 and lower than KEY_2? - how find keys in map in c++11 equal or higher key_1 , lower key_2? i programme in java , don't have much experience in c++. try following auto minmax = std::minmax( key_1, key_2, m.key_comp() ); auto first = m.lower_bound( minmax.first ); auto lastly = m.upper_bound( minmax.second ); here demonstrative program: #include <iostream> #include <map> #include <algorithm> int main() { std::map<int, int> m = { { 1, 10 }, { 2, 20 }, { 3, 30 }, {4, 40 }, { 5, 50 }, { 6, 60 }, { 7, 70 } }; int key1 = 5; int key2 = 3; auto minmax = std::minmax( key1, key2, m.key_comp() ); auto first = m.lower_bound( minmax.first ); auto lastly = m.upper_bound( minmax.second ); ( auto current = first; current != last; ++current ) { std::cout << "{ " << current->first

java - A universal match pattern ('/**') is defined... error when trying to add spring security to project -

java - A universal match pattern ('/**') is defined... error when trying to add spring security to project - i'm trying add together spring security project , i've tried utilize solutions found on internet, nil worked. have ideas?? stack trace: caused by: java.lang.illegalargumentexception: universal match pattern ('/**') defined before other patterns in filter chain, causing them ignored. please check ordering in <security:http> namespace or filterchainproxy bean configuration @ org.springframework.security.config.http.defaultfilterchainvalidator.checkpathorder(defaultfilterchainvalidator.java:51) @ org.springframework.security.config.http.defaultfilterchainvalidator.validate(defaultfilterchainvalidator.java:40) ... web.xml <?xml version="1.0" encoding="iso-8859-1" ?> <web-app ..> <display-name>archetype created web application</display-name> <servlet> <servle

regex - How to preg_replace_all in the large amount of data -

regex - How to preg_replace_all in the large amount of data - i making upgrade script replacing modx snippet tags newer format: old one: [~123~] new one: [[~123]] (of course, 123 - illustration — there lot of different numbers) also wanted replace custom old snippets newer ones: old snippet format: [!mysnippetname? &param1=`value1` &param2=`value2` !] new one: [[!mysnippetname? &param1=`value1` &param2=`value2` ]] (of course, &param1=value1 &param2=value2 illustration , different in real snippets) how utilize preg_replace function create global replacements? supposed create this: $doc[ 'content' ] = $this->preg_replace_all( array( '/\[~([0-9]+)~\]/', '\[!latestupdates(.*)!\]', '\[!articlesummary(.*)!\]', ), array( '[[~\1]]', '[[!latestupdates\1]]', '[[!artic

java - Why is sql command not properly ended being thrown? -

java - Why is sql command not properly ended being thrown? - i running query using sql embedded in java. have 3 tables in database, query, g1, , g2. of them have same schema of (setid, geneid). the query running follows: select q.setid, count(q.setid), g1.setid, count(g1.setid) query q inner bring together g1 g1 on q.geneid = g1.geneid grouping q.setid, g1.setid partial code execution: drivermanager.registerdriver(new oracle.jdbc.oracledriver()); con = drivermanager.getconnection(url, user, password); stmt = con.createstatement(); string sql = "select q.setid, count(q.setid) qsize, g1.setid, count(g1.setid) gsize query q inner bring together g1 g1 on q.geneid = g1.geneid grouping q.setid, g1.setid"; rs = stmt.executequery(sql); rsmd = rs.getmetadata(); when run this, throws next error: ora-00933: sql command not ended. please help me error? thanks! try to: escape table name query - looks reserved word add aliases count() columns - illu

C - Combine las three bits of a byte with a byte -

C - Combine las three bits of a byte with a byte - lets have byte in binary: f= 01010111, i'll this: f<<3 im expecting: 10111000, @ point im going have byte, lets other 1 10111001 , want attach them result 1011110111001. basiclly, want lastly 3 bits first byte swap sec byte. i have no thought how can this, can help me please? thanks! how this? uint8_t f = 0x57; // 0b01010111 f <<= 3; // 10111000 uint8_t g = 0xb9; // 0b10111001 uint16_t out = (f << 5) | g; printf("0x%04x\n", out); > 0x17b9 // 0b1011110111001 i don't understand intermediate << 3 i'm assuming it's part of application. c byte bit

javascript - Reading d3js interactive graph data from mysql -

javascript - Reading d3js interactive graph data from mysql - im trying create interactive network in d3js ive used php fetch info in json format within d3js. this ive written :- my_code <!doctype html> <meta charset="utf-8"> <title>test</title> <style> .node circle { cursor: pointer; stroke: #3182bd; stroke-width: 1.5px; } .node text { font: 10px sans-serif; pointer-events: none; text-anchor: middle; } line.link { fill: none; stroke: #9ecae1; stroke-width: 1.5px; } </style> <body> <script src="http://d3js.org/d3.v3.min.js"></script> <script> d3.json("data.php.php", function(error, links) { var nodes = {}; root=json; console.log(root) // compute distinct nodes links. links.foreach(function(link) { link.source = nodes[link.source] || (nodes[link.source] = {name: link.source}); link.target = nodes[link.target] || (nodes[link.target] = {n

How to structure a Python module to limit exported symbols? -

How to structure a Python module to limit exported symbols? - i writing python module purpose export single info structure. believe means module should export single symbol (e.g. foo ), other symbols beingness underscore-prefixed. generating info construction takes fair amount of code - how should construction module ensure no symbols within code exported without prefix? 2 possible approaches are: put generation code @ top-level, beingness careful utilize underscores throughout, e.g.: _bar = ... _i in ...: _bar.append(...) foo = [_bar, ...] put generation code within function returns info structure. requires function name utilize underscore. example: def _generate_foo(): bar = ... in ...: bar.append(...) homecoming [bar, ...] foo = _generate_foo() is either of these approaches considered better? or, there way construction module preferred? note using underscore prevents name beingness imported from module import * (

sql - Insert in Oracle table if rows size is under 300 -

sql - Insert in Oracle table if rows size is under 300 - i have table in want have maximum 300 rows of data: create table "admin"."sessions" ( "sessionid" varchar2(30 byte), "sessiontype" number(*,0), "userid" varchar2(30 byte), "activitystart" timestamp (6), "activityend" timestamp (6), "activity" clob, "username" varchar2(30 byte), "ipaddress" varchar2(30 byte), "logintime" timestamp (6), "logouttime" timestamp (6) ) segment creation immediate can tell me how can insert table if maximum number not reached? want using prepared statement. i close question duplicate of creating table max number of rows (oracle). basically, it's impossible , if need you're doing wrong. don't want calculating number of records in table prior inserting - lot of excess work. however, given names of colu

ios - Reduce dot size or padding to fit all page indicators on screen with UIPageControl -

ios - Reduce dot size or padding to fit all page indicators on screen with UIPageControl - i have uipagecontrol has 22 pages, hence 22 page indicator dots. in landscape on iphone they're visible plenty of space on left , right, in portrait there's not plenty horizontal space display of dots (at to the lowest degree on iphone 4 , 5), 2 aren't visible , outer 2 cutting in half. i looking way cut down size of dots or cut down amount of padding between dots ensure dots fit on screen in portrait. how can accomplished? if have many dots, consider different control. if want stick uipagecontrol, scale downwards fit on screen, like: pagecontrol.transform = cgaffinetransformmakescale(0.7, 0.7); this scales downwards 70% of initial size - leave determine best scale screen size/number of pages. ios uipagecontrol

c++ - What is an undefined reference/unresolved external symbol error and how do I fix it? -

c++ - What is an undefined reference/unresolved external symbol error and how do I fix it? - what undefined reference/unresolved external symbol errors? mutual causes , how fix/prevent them? feel free edit/add own. compiling c++ programme takes place in several steps, specified 2.2 (credits keith thompson reference): the precedence among syntax rules of translation specified next phases [see footnote]. physical source file characters mapped, in implementation-defined manner, basic source character set (introducing new-line characters end-of-line indicators) if necessary. [snip] each instance of backslash character (\) followed new-line character deleted, splicing physical source lines form logical source lines. [snip] the source file decomposed preprocessing tokens (2.5) , sequences of white-space characters (including comments). [snip] preprocessing directives executed, macro invocations expanded, , _pragma unary operator expressions executed

Querying for tasks in a private project using Asana API -

Querying for tasks in a private project using Asana API - do have api query tasks in private project? or private projects/tasks invisible apis? they visible api, if api operating on behalf of user can see them. depends on user authorized api. api asana

objective c - iOS MkMapView blank after moving to Xcode 6 -

objective c - iOS MkMapView blank after moving to Xcode 6 - i have apps created in xcode 5 mkmapview working well. created new app in xcode 6.1 , dragged old storyboard scenes , view controllers new app. map view shows blank screen , no annotations on ios 7 worked on ios 8. added button , map view blank on ios 8 well. deleted , recreated view in storyboard map view within view within view controller dragging object templates. map still blank. after debugging see regionwillchangeanimated , regiondidchangeanimated show repeated setregion events set part 0.0 coordinates (before , after set right region). finally removed mkmapview storyboard view , created using code. //create map view _mkmapview = [[mkmapview alloc] initwithframe:self.view.frame]; _mkmapview.maptype = mkmaptypesatellite; _mkmapview.delegate = self; [self.view addsubview:_mkmapview]; [self.view setautoresizingmask:uiviewautoresizingflexiblewidth|uiviewautoresizingflexibleheight]; self.view.alpha = 1.0; _mkma

javascript - JSIL and DllImport -

javascript - JSIL and DllImport - i seek convert sample .net application p/invoke javascript jsil. c# code: [dllimport("jstestlib", entrypoint = "get42", callingconvention = callingconvention.cdecl)] public unsafe static extern int get42(); generated javascript: $.externalmethod({static:true , public:true }, "get42", jsil.methodsignature.return($.int32) ); where should add together implementation of get42 method in javascript? should register method manually in jsil? i have error now: the external method 'system.int32 get42()' of type 'test.program' has not been implemented. just utilize jsil.implementexternals - take @ jsil.core.js examples javascript c# pinvoke jsil

background disables android:padding setting -

<layer-list> background disables android:padding setting - i have listview custom items layout , custom background. problem android:padding value seems ignored after switched background drawable <shape> <layer-list> . layout/list_item.xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_list_item_bill" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="12dp"> . . . </linearlayout> drawable/list_item_background.xml <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/white" /> <corners android:radius="@dimen/corner_radius" /> <stroke android:width="1dp" android:color

ruby - Why does this stylesheet get included in Rails development and not production? -

ruby - Why does this stylesheet get included in Rails development and not production? - in layout application.html.haml have - if featureswitch.where(name: 'display_demo', status: 'on').count > 0 = stylesheet_link_tag 'on_off_switch' when have record, stylesheet gets included expected. however, in production, on heroku, stylesheet doesn't included. even though featureswitch.where(name: 'display_demo', status: 'on') => #<activerecord::relation [#<featureswitch id: 2, status: "on", name: "display_demo", description: "", conditions: "", created_at: "2014-10-04 17:17:18", updated_at: "2014-10-05 14:44:29">]> irb(main):002:0> featureswitch.where(name: 'display_demo', status: 'on').count => 1 i tried having conditional in app/assets/stylesheets/application.css.erb (added .erb extension) no format used accepted. right f

html - alligning an image and label in a div -

html - alligning an image and label in a div - i have label , image in div acts navbar in mobile app. need text centred , image on right. can't manage right combination. code here: <div data-role="header"> <div class="centered"> <img src="../images/culogo50x40.png" alt="logo" height="25px" class="c1"> <h3>login</h3> </div> </div> in class centred, have: .centered { width: 100%; height: auto; position: fixed; top: 20%; background-color: red; text-align:center; -webkit-backface-visibility: hidden; } and in class c1, have: img.c1 { float: right; display: inline; } any help appreciated. i'm pretty new this you can position img absolute , create right:0; float right. create vertical middle create next changes style img.c1 { position: absolute; right: 0; top: 0; bottom: 0; margin: auto

php - how to restrict maximum number of files for a folder -

php - how to restrict maximum number of files for a folder - actually iam dumping database file through php in export folder created. here want maintain latest 10 sql files in export folder kind of fifo way. not want on populate folder , want restrict 10 latest files. how ? first grab files using glob instance, determine if there 10 or more files in directory. after check mtime (modified time) each , delete oldest one. $file_pattern = '/path/to/directory/and/files/*'; $filenames = glob( $file_pattern ); if ( count( $filenames ) > 9 ) { // while there 10 or more files. while ( count( glob( $file_pattern ) ) > 9 ) { $oldest_file = null; // grab unix timestamp of *now*, filemtime returns unix timestamp too. $current_oldest_time = time(); foreach ( $filenames $filename ) { $filetime = filemtime( $filename ); if ( $filetime < $current_oldest_time ) { $current_oldest = $file

java - File processing design suggesstion -

java - File processing design suggesstion - i developing application process multiple csv files using apache camel. processing involves multiple transformation , validations. the format of files can dynamic csv header before arrives. don't want add together new model every time new format arrives, instead want create map key value pairs. simple validations , complex rules, had convert bean (since using drools , bean validation). if create lots of models incoming files, camel processor has have lots of conditional statements choosing right strategy process. instanceof (bad idea) or type based strategy selection. can suggest me design approach tackle this. use camel csv component list maps holding key value pairs: final csvdataformat format = new csvdataformat(); format.setusemaps(true); format.setdelimiter(","); from("direct:start") .unmarshal(format) .process(new processor() { @override public void process(final e

google apps script - uiInstance.close() has no effect -

google apps script - uiInstance.close() has no effect - i have next code within script google spreadsheet: var uiinstance; function displaydialog() { uiinstance = uiapp.createapplication() .setwidth(130) .setheight(130); uiinstance.add(uiinstance.createlabel("foo")); spreadsheetapp.getui().showmodaldialog(uiinstance, 'bar'); } this dialog intended inform user script calculating , want close dialog 1 time again 1 time script has finished work. if utilize uiinstance.close(); inside or outside function nil seems happen though; dialog remains opened until user closes it. there solution problem? you have "return" close uiinstance, return needed reflect alter made ui, including closing it. try return uiinstance.close(); edit next comment : uiapp instances can closed handler function, thought how using (but might have been wrong). below little code illustration : function displaydialog() { var uiinstanc

sql - Trying to create a simple cumulative addition script in PHP (or JS): -

sql - Trying to create a simple cumulative addition script in PHP (or JS): - trying create simple cumulative add-on script in php (or js): 1) come in integer(4 digits or less), click submit, number entered displayed , saved on same web page 2) come in number, click submit, number entered added previous number , total saved , displayed on web page repeat ……. example: mantra counter @ garchen.net below code have far in index.php: <form method="post" action= "process-mantra-form-ami.php" > <p><strong>amitabha 1000000 mantra accumulation: </strong><br></p> <div style="margin-left: 20px;"> <p>om ami dewa hri</p> <input type="text" name="accumulation" size="10" maxlength="6"> <input type="submit" value="submit mantra" name="b1"><br> <span id="ma

Array size in Visual C++ -

Array size in Visual C++ - using visual studio 2012, if type following: char bytes[ 2*1024*1024*1024 ]; i error: "matrix size must greater zero". same occurs if declare size dynamically, i.e.: char* bytes = new char[ 2*1024*1024*1024 ]; if remove first "2", fine. seems there's hard limit on amount of memory can request either stack or heap, beingness limit 1 gb. however, given size_t 4 bytes in worst case (it 8 bytes sure), there not problem in index not beingness able address space of array. problem limit imposed stack , heap 1mb default? (http://msdn.microsoft.com/en-us/library/f90ybzkh(v=vs.110).aspx). if case, why can allocate 1 gb? you need take care not overflow 32 bit int look - 2*1024*1024*1024 2^31 , 1 larger int_max . try: char bytes[ 2ull*1024*1024*1024 ]; note compile error has nil stack or heap size. whether can allocate amount of memory separate problem. c++ visual-c++

php - Cannot authenticate in custom Laravel test environment (codeception) -

php - Cannot authenticate in custom Laravel test environment (codeception) - i running vagrant (homestead), php 5.5.12, , laravel 4.2. i'm trying configure codeception utilize testing environment acceptance tests (running on phantomjs). on homestead box have 2 environments: local , test. careful not double on default 'testing' environment, reserved phpunit tests. my issue while can utilize eloquent instantiate user (and retrieve it), cannot authenticate user of tests. preventing me running test suite, 90% of requires user authentication. i have 2 sites defined in /etc/nginx/sites-available: myapp.app , myapp.test. define fastcgi_param app_env local , test (respectively). have specified app_env in ~/.bashrc, echo $app_env returns 'local'. have created corresponding config/test folder database.php credentials point test database. below default codeception.yml settings, , overridden acceptance.suite.yml settings (which suite running). i cannot authenticat