Posts

Showing posts from March, 2013

formatting - LaTeX formal letter: signature align left -

Image
for life of me, can't seem figure out how fix signature. right now, right-hand justified, , want make left-hand justified. still pretty green when comes latex , formatting documents in it. simple. right now, suspect "\raggedright" command have it. not sure where. \documentclass[10pt,stdletter,dateno]{newlfm} \usepackage{kpfonts, sans} \usepackage{url} \title{title} \widowpenalty=1000 \clubpenalty=1000 \newlfmp{headermarginskip=20pt} \newlfmp{sigsize=50pt} \newlfmp{dateskipafter=20pt} \newlfmp{addrfromphone} \newlfmp{addrfromemail} \phrphone{phone} \phremail{email} \namefrom{first \ last} \addrfrom{% \today\\[10pt] \\ street \\ city, state } \phonefrom{(123) 456-7890} \emailfrom{email@mail.com} \addrto{% division\\ organization\\ street\\ city, state} \greetto{to whom may concern,} \closeline{sincerely,} \begin{document} \begin{newlfm} *letter content* \end{newlfm} \end{document} bonus points if know how rid of black bars @ top , bottom, or reduce hea

compilation - This FORTRAN code shouldn't compile. Is there a reason why it does? -

the following code compiles, not think should. can see, output garbage. this minimal failing example of bit me hard in large project work on. my question - why compiler not complain? compiler limitation, or somehow "expected behaviour", , i've missed something? i'm using gfortran 4.6.3. module datamodule integer :: datum1 = int(1) integer :: datum2 = int(2) end module datamodule program moduletest use datamodule, only: datum1 write(*,*) "datum 1 is", datum1 write(*,*) "datum 2 is", datum2 end program moduletest example output: datum 1 1 datum 2 4.58322689e-41 your code @ fault, not compiler. if datum2 use associated despite only clause , if explicit initialization of datum2 ignored, yes, naughty compiler. the answer more mundane, though. datum2 not use associated: in absence of implicit none implicitly typed variable in main program. "garbage" comes fact not defin

formula - Excel Sum(s) possibly? Trying conditional sums -

i have potentially simple problem cannot figure out in excel. want use formula sum cells if meet 2 criteria. if cells less 100 , s1 100 want add 300 total sum. however, if cells greater or equal 100, sum cells regardless of in cell s1. a1 a2 a3 x x s1 s2 1 1 1 100 100 if sum of a2:c2 less 100 , s2 equals 100 add 300 if sum of a2:c2 greater 100 , s2 equals 100 show original sum have tried following: =if(sum(d2:h2)+sum(p2:s2)=0,0,if(sum(d2:h2)+sum(p2:s2)<100,if(r2=100,sum(d2:h2)+sum(p2:s2)+sum(300)),sum(d2:h2)+sum(p2:s2))) try like: =if(and(sum(d2:h2)<100,s2=100),sum(d2:h2)+300,sum(d2:h2)) will following: if both sum of d2 h2 < 100 , s2 = 100, sum d2 h2 , add 300 if both conditions not true return sum of d2 h2 think i've got logic right here if not/you can't take , make work correct me , i'll figure out. (ps @ risk of being of nerd don't state happens if sum of d

httpwebrequest - How can i post a message into yammer group from c# -

i trying post message yammer group c# restapi. tried many links available not working. can provide exact code that. all codes partially available , stuck proceed. thanks this quick draft of how it; public static string postmessage(string data, int groupid, string accesstoken) { // build request-uri var endpoint = "https://www.yammer.com/api/v1/messages.json"; var sb = new stringbuilder(endpoint); if (endpoint.contains("?")) sb.append("&access_token=" + accesstoken); else sb.append("?access_token=" + accesstoken); var uri = new uri(sb.tostring()); var request = webrequest.create(uri) httpwebrequest; // create request if (request == null) result = "it failed."; // add request properties request.headers.add("authorization", "bearer " + accesstoken); request.method = "post"; request.contenttype = "applicat

wordpress - (jQuery Autocomplete) Disable keyboard commands? -

i'm building custom jquery-ui autocomplete wordpress. entering searchterm (in input id="s")lists suggestions, sorted/filed under categories , clicking on list-item, links respective page. (the page loaded via .load) so far works, autocomplete has built-in keyboard function. need remove keyboard functionalities. default, pressing up/down-arrow keys, previous/next list-item focused , input field gets value of focused list-item. for example: entering "searchterm" give list: suggestion-item 1 suggestion-item 2 suggestion-item 3 suggestion-item 4 pressing down-key replace "searchterm" "suggestion-item-1", etc. pressing enter select focused item , close menu. can me on how remove these keyboard-functionalities (see on jquery autocomple -> keyboard interactions )? basically want take user own search-results page entered "searchterm", if enter pressed. default behaviour of search-input. here's js: (functi

boost - C++ compare strings up to "%" char -

i implement string comparison in c++ comparing strings "%" sign. i this: std::equal(str1.begin(), std::find(str1.begin(), str1.end(), l'%'), str2.begin()); since i'm doing in loop on many strings, wonder if there method without 2 distinct string traversals find , equal (maybe predicate can abort comparison @ point). boost ok. you can try std::mismatch . the following code run c++14 (it requires template overload 2 iterator pairs), works quite similar in c++11 (or 03, without lambdas though): auto iters = std::mismatch( str1.begin(), str1.end(), str2.begin(), str2.end(), [] (char lhs, char rhs) {return lhs != '%' && lhs == rhs;}); if (iters.first == str1.end() || iters.second == str2.end() || *iters.first == '%') // success […] demo .

json - function json_each does not exist -

i getting error json_each function not exist. using postgresql 9.3. dont know whats wrong. please assist me here. select * json_each(( select ed.result externaldata ed inner join application on a.id = ed.application_id )) limit 1; the inside looped query returns : " { "respuestasvc89":{ "header":{ "transaccion":"expe", "servicio":"92", "codigoretorno":"00", "numerooperacion":"201409147001616", "codigomodelo":"13852901" }, "meta":{ "billa":"expe", "numo":"52", "retorno":"01", "operacion":"2014091470", } } }" so should work somehow not work exact error message : error: function json_each(text) not exist line 2: json_each(( ^ hint: no function match

java - Get what was removed by String.replaceAll() -

so, let's got regular expression string regex = "\d*"; for finding digits. now got inputted string, example string input = "we got 34 apples , do"; now want replace digits "", doing that: input = input.replaceall(regex, ""); when printing input got "we got apples , do". works, replaced 3 , 4 "". now question: there way - maybe existing lib? - replaced? the example here simple, understand how works. want use complexer inputs , regex. thanks help. you can use matcher append-and-replace procedure: string regex = "\\d*"; pattern pattern = pattern.compile(regex); matcher matcher = pattern.matcher(input); stringbuffer sb = new stringbuffer(); stringbuffer replaced = new stringbuffer(); while(matcher.find()) { replaced.append(matcher.group()); matcher.appendreplacement(sb, ""); } matcher.appendtail(sb); system.out.println(sb.tostring()); // prints replacement re

Remove Windows Firewall Rule (Exception) using Delphi -

i trying manage firewall rules (exceptions) on windows 7 using delphi xe3. found interesting code adding rule windows firewall, nothing deleting (removing) it. please, can help? here code adding rule: procedure addexcepttofirewall(const caption, apppath: string); // uses comobj const net_fw_profile2_private = 2; net_fw_profile2_public = 4; net_fw_ip_protocol_tcp = 6; net_fw_action_allow = 1; var profile: integer; policy2: olevariant; robject: olevariant; newrule: olevariant; begin profile := net_fw_profile2_private or net_fw_profile2_public; policy2 := createoleobject('hnetcfg.fwpolicy2'); robject := policy2.rules; newrule := createoleobject('hnetcfg.fwrule'); newrule.name := caption; newrule.description := caption; newrule.applicationname := apppath; newrule.protocol := net_fw_ip_protocol_tcp; newrule.enabled := true; newrule.grouping := ''; newrule.profiles := profile; newrule.action := net_fw_action

Setting image path in sql developer to get the image in c# application -

i working on project school , have store image paths in our database in sqldeveloper , use path show image in our c# application. i'm having problem knowing path write in databse application can them computers. have images in document in project called /images, path have enter in db? help. you can give image unique identifier. when save image in /images folder have name 5a864a4e-23d8-4c08-867a-16e52a4b94be.jpg. application access image /images/5a864a4e-23d8-4c08-867a-16e52a4b94be.jpg. can give little more details if need more specific. hope helps.

symfony - Symfony2 - send email Warning: mkdir(): No such file or directory in -

after configuration smtp in prameters.yml trying send email have type of warning: contexterrorexception: warning: mkdir(): no such file or directory in /home/crashend/domains/tombax.com/public_html/gbuy/vendor/swiftmailer/swiftmailer/lib/classes/swift/keycache/diskkeycache.php line 273 on localhost worked fine problem appeared after transfer project server. emails not deliver. code controller send emails: $message = \swift_message::newinstance() ->setsubject('hello email') ->setfrom(array('exapmle@abc.net' => 'tom')) ->setto(array('exapmle2@abc.net' => 'jan')) ->setbody('abcd') ; $this->get('mailer')->send($message); code parameters.yml: mailer_transport: smtp mailer_host: smtp.myserver.com mailer_user: exapmle@abc.net mailer_password: pass please help. after comment this: if (is_writable($tmpdir = sys_get_temp_dir())) {

mysql - Best way to export DB data in PHP, modify it, and import it -

i need export data in selected tables mysql database , import mysql database different structure. iow, need modify data between export , import (and not field names). i've tried using json_encode , json_decode , works, if data not pure utf8, json_encode falls on , utf8_encode doesn't solve this. i'm considering csv, serialize, , generating sql in php. of options give me reliable transfer? you use pdo query , create array of objects can directly modified in code. use data import other database. the better question why utf-8 isn't working you. make sure using recent version of php. make sure using mb_ prefixed functions maintain utf-8 (or other multibyte) encoding. list of php multibyte string functions

oracle - reuse results from sql functions -

take @ beginning of query: select sum(decode(regexp_count(tpdd.domain, 'thedomain.com'), 1, tpdd.size, 0, 0)) sizeclient, sum(decode(regexp_count(tpdd.domain, 'thedomain.com'), 1, 0, 0, tpdd.size)) sizethirdparty, ... is there way reuse results of "regexp_count(tpdd.domain, 'thedomain.com')" function? should hope oracle server smart enough can't guarantee it, , besides, code better without repeated code. you can use cte this: domain_regex ( select tpdd.domain, regexp_count(tpdd.domain,'thedomain.com') regex_res ... ) select sum(decode(d.regex_res, 1, tpdd.size, 0, 0)) sizeclient, sum(decode(d.regex_res, 1, 0, 0, tpdd.size)) sizethirdparty, ... join domain_regex d on tpdd.domain = d.domain

sql - sqlite insert with default values for default fields -

the docs specify 2 alternatives: insert values or insert default values ( https://www.sqlite.org/lang_insert.html ) the trouble if 1 example has table: create table address_book values( rowid integer primary key, first_name, last_name, address, phone_number, email, notes, country text default 'usa' ) one can no longer write insert values(?, ?, ?, ?, ?, ?) since expects rowid , country specified. there shortcut specifying insert values default values populating default fields? or impossible without explicitly naming non-default fields? yes, impossible. in event practice explicitly name columns insert ing anyway -- leaving columns out leads more fragile code , more "silent failure" possibilities in you're not inserting data column think inserting into.

javascript - How can I permit external edits of a Map Engine DataTable? -

the flow of data here circuitous, i'm not aware of other way accomplish want do. ultimate desire have web page displaying route i've mapped out in google map engine current location being shown , updated periodically. updating google spreadsheet location data via ifttt android app. i've figured out how data via javascript on google sites website (the spreadsheet's permissions set allow url access it). additionally, have figured out correct api call make via api explorer update datatable ( batchpatch ). however, have not figured out how allow script update these values in datatable when activated other people visiting site (these people people permit, via google's permissions system, access site, possibly expanded share link with). ultimately, seems google's permissions system intended people accessing , modifying own data in way. there way allow other people (or rather javascript on site) access , modify data? maps engine doesn't have &q

url redirection - How to redirect and keep the original url unchanged? -

i have domain name created subdomain. subdomain need redirected cloud service hosted on diferent server, not want subdomain name under url changed. have activated domain redirection when try, url changes cloud server url/ip. for instance: - domain: www.abcd.com - subdomain: cloud.abcd.com - cloud server: 123.456.789.0 the ideia when user accesses cloud.abcd.com, redirected 123.456.789.0, , keep url cloud.abcd.com. thank much a parked domain want. when park domain , access parked domain in browser, parked domain displayed in browser's address bar, content main domain displayed. the following section of our documentation should helpful: parked domains

c++ - initializate template object -

i'm having little question... have template class, make bidimensional array: template <typename t, unsigned p> class mapa { private: t **mat; unsigned tam; public: mapa(t &dato); mapa(const mapa& orig); virtual ~mapa(); mapa<t, p> &operator=(const mapa<t, p> &orig); t &operator()(unsigned i, unsigned j); }; template <class t, unsigned p> mapa<t, p>::mapa(t &dato) { tam = p; mat = new t**[tam]; (unsigned = 0; < p; i++) { mat[i] = new t*[tam]; (unsigned j = 0; j < p; j++) { mat[i][j] = dato; } } } template <class t, unsigned p> mapa<t, p>::~mapa() { (unsigned = 0; < tam; i++) { delete mat[i]; } delete mat; } template <typename t, unsigned p> t &mapa<t, p>::operator ()(unsigned i, unsigned j) { /*if (i < 0 || >= tam) { throw errorderango("posición de memoria inexi

ios - centralManager method not being called -

i android developer, moving on ios, please bear me regarding basics of ios development. i have following code: here .m file: #import "bluetoothlemanager.h" #import "constants.h" @implementation bluetoothlemanager @synthesize mbtcentralmanager; -(void)initializecbcentralmanager{ nslog(@"initializing cbcentral manager"); <--- being logged mbtcentralmanager = [[cbcentralmanager alloc] initwithdelegate:self queue:nil]; } #pragma mark - cbcentralmanagerdelegate // method called whenever have connected ble peripheral - (void)centralmanager:(cbcentralmanager *)central didconnectperipheral:(cbperipheral *)peripheral { } // cbcentralmanagerdelegate - called cbperipheral class main input parameter. contains of information there know ble peripheral. - (void)centralmanager:(cbcentralmanager *)central diddiscoverperipheral:(cbperipheral *)peripheral advertisementdata:(nsdictionary *)advertisementdata rssi:(nsnumber *)rssi { nslog(@&quo

MASM Assembly jump instructions printing issue -

.386 .model flat exitprocess proto near32 stdcall, dwexitcode:dword include io.h cr equ 0dh lf equ 0ah .stack 4096 .data string byte 40 dup (?) number dword ? runningsum dword 0 rejected byte " , rejected", 0 positive byte cr, lf, "positive",0 negative byte cr, lf, "negative",0 numaschar byte 11 dup(?),0 newline byte cr,lf,0 .code _start: forever: input string, 40 atod string mov number, eax cmp number,0 jne processing je finish processing: cmp number,10 jg message cmp number,-10 jl message cmp number,10 jle not_rejected1 cmp number,-10 jge not_rejected2 jmp jumptotop message: dtoa numaschar,number output numaschar output rejected output newline not_rejected1: cmp number, -10 jge processing2 not_rejected2: cmp number,10 jle processing2 processing2:

templates - Ways to generalize C++ code with different similar types -

currently have following code: static void markpoolsfree(const tnetgrouppools &group_info, tobjectid netiface) { (size_t = 0; i<group_info.public_pools.length();i ++ ) { sdk::revokeippoolfromnetworkinterface(group_info.public_pools[i],netiface); } (size_t =0 ; i<group_info.private_pool.length(); i++) { sdk::revokeippoolfromnetworkinterface(group_info.private_pool[i].pool_id, netiface); } } which has same logic, differents in types group_info.public_pools[i] , group_info.private_pool[i] , that's why in second loop have add .pool_id member call. these types different , don't have relationships. i want rewrite code make more general, example (sketch): // template function template <typename container, typename predargs> static void revokeippool(const container &pool, tobjectid netiface, bool (*pred)(predargs pool_id, predargs netiface_id)) {

c# - format datetime object inside ajax.actionlink -

i have view there ajax.actionlinks, of these action links need display date property of model , have date property follows: [display(name = "date")] [datatype(datatype.date)] [displayformat(dataformatstring = "{0:mm-dd-yyyy}", applyformatineditmode = true)] public datetime? date { get; set; } however, because ajax.actionlink accepts string first argument, can't use lambda expression : m => m.date rather i'm using model.date.tostring() but isn't showing formatting want. i've tried doing model.date.tostring("mm-dd-yyyy"); but i'm getting red underline because not recognizing tostring overload 1 argument... ideas on how can work? since model.date nullable, need access value of datetime? before using version of tostring : model.date.hasvalue ? model.date.value.tostring("mm-dd-yyyy") : null;

javascript - How to convert a select dropdown into an ul dropdown? -

i'm trying convert select dropdown ul can create bootstrap button display ul allowing list items act options. <select id="sortfield" onchange="refreshpage('{$pagebase}','{$searchterm}', '{$pagenumber}', '{$currentfacet}')"> <option value="default"> sort </option> <option value="relevance">relevance</option> <option value="highest rated">highest rated</option> <option value="best sellers">best sellers</option> <option value="new arrivals">new arrivals</option> <option value="lowest price">lowest price</option> <option value="highest price">highest price</option> </select> the jquery function convert select is: var ul = $('<ul/>'); $("#sortfield option").each(function() { $('<li/>

iphone - Does iOS Multipeer connectivity work with non-smartphone devices? -

our guys in field use equipment have wifi , bluetooth connectivity. 1 of our users has been using non-iphone (i guess android) transfer files between phone , equipment through bluetooth. however, in switching our users iphones use other enterprise apps have discovered of know: ios's bluetooth connectivity severely limited (i.e. no spp protocol). the equipment communicates via wifi, wondering if it's possible create app using ios multipeer connectivity solve bluetooth problem. finding this, though, doesn't show phone-to-phone multipeer connections, , not phone-to-machine multipeer connections. at point know nothing how field equipment works; that's i'll have learn if decide pursue this. assuming capable of discovering wifi networks, able see iphone's network without needing special software? or wasting time trying figure out? thanks! if equipment using bluetooth spp unless mfi certified can pretty forget connecting ios. multipeer connectivi

c# - Why is my app setting not being retained? -

i'm trying save simple app setting ("languagepairid") way: if (rdbtnenglishpersian.ischecked == true) // because "ischecked" nullable bool, "== true" necessary { langpairid = 1; } else if (rdbtnenglishgerman.ischecked == true) { langpairid = 2; } else if (rdbtnenglishspanish.ischecked == true) { langpairid = 3; } else if (rdbtngermanspanish.ischecked == true) { langpairid = 4; } else if (rdbtngermanpersian.ischecked == true) { langpairid = 5; } else if (rdbtnspanishpersian.ischecked == true) { langpairid = 6; } appsettings.default.languagepairid = langpairid; languagepairid being assigned expected value (if rdbtnenglishspanish checked, assigned 3, etc.) but trying read app setting value on app startup: int langpairid; public mainwindow() { initializecomponent(); recheckthelastselectedradbtn(); } private void recheckthelastselectedradbtn() { langpairid = appsettings.default.languagepairid; switch (lan

Regex Match "words" That Contain Periods perl -

i going through tcpdump file (in .txt format) , trying pull out line contains use of "word" v.i.d.c.a.m. embedded between bunch of periods , includes periods screwing me up, here example: e..)..@.@.8q...obr.f...$[......tp..p<........smbs......................................ntlmssp.........0.........`b.m..........l.l.<...v.i.d.c.a.m.....v.i.d.c.a.m.....v.i.d.c.a.m.....v.i.d.c.a.m.....v.i.d.c.a.m..............w.i.n.d.o.w.s. .5...1...w.i.n.d.o.w.s. .2.0.0.0. .l.a.n. .m.a.n.a.g.e.r.. how handle that? you need escape periods: if ($string =~ m{v\.i\.d\.c\.a\.m\.}) { ... } or if string entirely quoted, use \q escapes metacharacters follow. if ($string =~ m{\qv.i.d.c.a.m.})

angularjs - trouble with angular and flask - error message vauge -

not able angular read in object fetched via service. error message in brower vauge, doesn't reference of code lines. checked via chrome developer tools , api call getting made. ideas? error message: typeerror: undefined not function @ copy (http://127.0.0.1:5000/static/lib/angular/angular.js:593:21) @ http://127.0.0.1:5000/static/lib/angular/angular-resource.js:410:19 @ wrappedcallback (http://127.0.0.1:5000/static/lib/angular/angular.js:6846:59) @ http://127.0.0.1:5000/static/lib/angular/angular.js:6883:26 @ object.scope.$eval (http://127.0.0.1:5000/static/lib/angular/angular.js:8057:28) @ object.scope.$digest (http://127.0.0.1:5000/static/lib/angular/angular.js:7922:25) @ object.scope.$apply (http://127.0.0.1:5000/static/lib/angular/angular.js:8143:24) @ done (http://127.0.0.1:5000/static/lib/angular/angular.js:9170:20) @ completerequest (http://127.0.0.1:5000/static/lib/angular/angular.js:9333:7) @ xmlhttprequest.xhr.onreadystatech

Stacked / Nested / Overlapping pie chart and donut chart with javascript -

i not sure if has come across scenario or has made solution able create simple pie , donut charts using flot charts. looking though scenario there pie chart in center , surrounded donut chart. similar this question question 3 years old , never answered. i tried creating 2 charts using same div 1 overwrites other. thought of creating 2 different charts on 2 different divs , having them overlap doesnt seem clean approach accommodate responsive behavior. any thoughts / suggestions welcome. thanks in advance the answer not simple of comments have indicated did find comes pretty close - highcharts. have con-centric donut chart gives , feel desired - infact linkedin uses them display dashboard statistics. downside highcharts is paid library , not cheap if planning deploy on commercial web application the alternative use morrischarts - http://morrisjs.github.io/morris.js/donuts.html they have donut charts come pretty close need.

c# - File.Encrypt() causes IOException The parameter is incorrect -

i have web application when prompted check if there file encryption keys in particular location. if file not present, keys auto-generated , stored within file. afterwards, file supposed encrypted itself. when run file.encrypt(keyfilepath); it runs ioexception message being "the parameter incorrect" . the operation running impersonation of limited account. when run under own elevated credentials, works perfectly. have checked certificates, created 1 limited account, added account possible roles (cryptography operators, etc.) , tested. nothing worked. in test environment elevated account unreasonable level , perform encrypt operation. afterwards set account usual level , read file perfectly. the problem cannot ask performed in production once solution final. test environment windows server 2008 data center edition , solution being developed on asp .net mvc 5. please let me know wrong.

scala - how to ignore Play Framework WS SSL certs without making my entire application insecure? -

newb alert! i'll try describe clear , concise. scala 2.10.3, play 2.2.1. i have play application gets used on https. have setting in conf/application.conf file making sure play app uses ssl (and it's been tested , it's fine): session.secure=true but now, want play app connect webservice, using ws library. webservice on https self-signed ssl certificate. can set following setting in conf/application.conf file don't have deal webservice certificates - i'd prefer that. (the webservice flavor of special, prefer not deal certificates @ all): ws.acceptanycertificate=true when set both of these true appears compile , run. dow these 2 different settings interact, overlap, and/or interfere? more secure app if use asynchttpclient, , set sslcontext ? i tried setting keymanager , keystore in conf/application.conf ws call results in sslengine error - think due me using play 2.2.1 , ssl support ws available on play 2.3.x + note: make following kind of call

sockets - Communicating Between Java SE and Java EE Applications -

i have 2 applications: java se application , java ee application. java ee application being run on glassfish server. want send data in form of json java se application java ee application. want both programs running on same computer. json sent identify student_id, student_name, instructor_name, school_name, course_name, absent_days, tardy_days, , total_grade. on top of want java ee application parse json received , send java db (derby) database table called reports. have never done before , confused in regard how go it. have been trying figure out general problem on month. can please me. 1. first of all, use socket, http post request, or combination of two? 2. in java ee program place code receives socket or post request? json object sent java se application: {“student_id”: “123456789”, “student_name: “bart simpson”, “instructor_name”: “professor xavier”, “school_name”: “xavier high school”, “course_name”: “eng12per1”, “absent_days_num”: “0”, “tardy_days_nu

c# - BlackJack deck class not displaying properly -

this question has answer here: what nullreferenceexception, , how fix it? 32 answers i creating blackjack game , far have made card class , deck class far. card class works deck class isn't displaying when go test it. deck class supose use nested loop set cards values taken arrays , getcard suppose allow user card deck (when shuffling , dealing) , setcard class suppose set card in deck (when shuffling) when go test deck class says object reference not set instance of object. not sure on how fix this. any appricated here have deck class class deck { private const int32 maxcards = 52; private card[] _cards = new card[maxcards]; public deck() { card.suit[] suits = { card.suit.spades, card.suit.hearts, card.suit.diamonds, card.suit.clubs }; string[] values = { "a", "2", "3", "4", "5

java - Launching app outside of sender using Intent Filter -

so i'm trying capture geo addresses outside app, , i've set code follows in manifest: <intent-filter android:priority="0"> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.browsable" /> <data android:scheme="geo" /> </intent-filter> that works great, when click postal address or lat/lng pair in browser, has app in picker pops up. the issue have when selecting app said popup picker, starts intent in browser. want start app outside of browser, google maps app does, monopolizing browser wouldn't nice thing users. thanks in advance suggestions, , apologies if question, couldn't find similar searching around.

oauth 2.0 - How to access domain users' calendar using service account in .net? -

i using service account key.p12 cert access google calendar api. however, cannot access user's calendar in domain. did follow steps delegating domain-wide authority service account https://developers.google.com/accounts/docs/oauth2serviceaccount it not have code sample .net. , seems serviceaccountcredential in google .net client library. here code static void main(string[] args) { string serviceaccountemail = "xxxx@developer.gserviceaccount.com"; var certificate = new x509certificate2(@"clientprivatekey.p12", "notasecret", x509keystorageflags.exportable); console.writeline("service account: {0}", serviceaccountemail); serviceaccountcredential credential = new serviceaccountcredential(new serviceaccountcredential.initializer(serviceaccountemail) { scopes = new[] { calendarservice.scope.calendar } }.fromcertificate(certificate)); baseclientservice.in

.htaccess - Wordpress Permalinks does not redirect links in my new theme -

i hope can me. i'm using /%postname%/ permalink structure, , .htaccess this: <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> in default theme working fine in theme need use, default link '?p=123' not redirect 'post name' link, , both links working @ same time, i'm not sure should do! please me. all please try flush rewrite rules. /* flush rewrite rules custom post types. */ add_action( 'after_switch_theme', 'bt_flush_rewrite_rules' ); /* flush rewrite rules */ function bt_flush_rewrite_rules() { flush_rewrite_rules(); } if doesn't work, means there function prevent redirection on theme.

android - Is it possible to change the context of a WebView after it has been instantiated? -

i have webview i'm loading in activity in order have preloaded pops in different activity (launched first). the problem in order instantiate webview , have pass in context , in case it's first mentioned above. so works great, , second activity shows webview fine. problem if click <select> dropdown in webview , selector dialog shows under webview. feels select doesn't work @ until hit button , briefly see selection dialog before return parent activity. it seems though when append webview layout in second activity, it's modals attached activity's window, webview attached parent activity's window, shows in higher point in hierarchy. how can possibly change context of webview after it's been instantiated? this difficult problem solve -- have create webviews before activity started, need selection dialogs work. please if can give me insights here i'd appreciate it. this sdk project, not have access parent activity. also, sav

ios - Making HTTP request with AlamoFire causes EXC_BAD_ACCESS -

i'm working on simple project learn swift , i'm running problem think has deeper implications / learning opportunities (trying on bright side). the high-level problem when post json-encoded parameters using alamofire, exc_bad_access error appears in separate line of code set 1 of parameters (specifically corelocation manager's "didupdatelocations") ... here's code: in viewcontroller, create mutable dictionary: var parameters = [string:anyobject]() and, didupdatelocations event, assign updated latitude / longitude values respective keys in mutable dictionary. class viewcontroller: uiviewcontroller, cllocationmanagerdelegate { let appdelegate = uiapplication.sharedapplication().delegate appdelegate ... func locationmanager(locmanager: cllocationmanager!, didupdatelocations locations: [anyobject]!) { appdelegate.parameters["longitude"] = locmanager.location.coordinate.longitude appdelegate.parameters["lat

Visual Studio '13 (Access Violation) -

when compile , run program via gcc(g++)/cygwin compiles , acts expected. #include <iostream> using namespace std; int main(int argc, char* argv[]) { (int arg = 1; arg <= argc; arg++) { cout << argv[arg] << endl; } return 0; } however, when compiling visual studio 13, program compiles given access violation upon execution. gives? unhandled exception @ 0x000b5781 in demo.exe: 0xc0000005: access violation reading location 0x00000000. argv pointer first element of array containing argc+1 elements. first argc elements of array contain pointers first elements of null terminated strings representing arguments given program environment (commonly first of these strings name of program, followed command line arguments). the last element of array (the argc+1th element, argv[argc] refers to) null pointer. code dereferences null pointer, leading undefined behaviour. the important thing note here array indexing in c++ zero based,

How to start at x = 0 with given xrange in gnuplot? -

in gnuplot, possible start graph @ x = 0 in given x range? let have code: set xrange [100:500] plot "input.txt" using 2:1:(1.0) notitle lines lw 1 consequently, graph start @ x = 100 , end @ x = 500. want graph start @ x = 0 , end @ x = 400 given range [100:500]. how can this? thanks! just use xrange of [0:400] , subtract 100 data values: set xrange [0:400] plot "input.txt" using ($2-100):1 lines

javascript - working jsfiddle code not working in jsf 2.2 -

i facing unusual issue javascript.(i relatively new this). have code snippet of html5 css , javascript works fine in jsfiddle. here link : jsfiddle link code : html-->>> <div class="form-group"> <div class="input-group"> <div class="btn-group btn-group-justified basu-radio"> <a class="btn btn-info btn-sm active" data-toggle="sex" data-title="m">male</a> <a class="btn btn-info btn-sm basu-radio-notactive" data-toggle="sex" data-title="f">female</a> </div> <input type="hidden" name="sex" id="sex" /> </div> </div> css -->>> .basu-radio .basu-radio-notactive { color: #3276b1; background-color: #fff; } js-->>> $('.basu-radio a').on('click', function () { var sel = $(this).data(

java - Is it possible to get the current database state with Hibernate? -

basically, want current database state in every client each time database state changes. let's suppose have 2 computers, each 1 running same java application, , postgresql in server. when client connected server , operation persists object (let's person) database, persisted object fields (let's id, name, surname) appear in client's main window executed operation, named fields doesn't appear in other client's window. my 2 clients can connect server perfectly. if think piece of code help, let me know. by way, i've heard called "server push", can want do? albert. ps: sorry mistakes, english isn't :p you'll want make use of postgresql's listen/notify capability. here's example using jdbc ( http://wiki.postgresql.org/wiki/pgnotificationpoller ) likewise, how make database listener java? has more hibernate-y resources provided. essentially, @ highest level, you'll use background thread poll server see

How to change the order of the attributes of an XML element using Perl and XML::Twig -

i new xml::twig . want change order of attributes of <product> elements shown below. input.xml <?xml version="1.0" encoding="utf-8"?> <root> <product markup="xml" type="books" id="book1"> <name>analysis</name> <prize>$203</prize> <subject>construct</subject> </product> <product markup="xml" type="books" id="book2"> <name>analysis</name> <prize>$203</prize> <subject>bio</subject> </product> </root> i need this <?xml version="1.0" encoding="utf-8"?> <root> <product id="book1" markup="xml" type="books"> <name>analysis</name> <prize>$203</prize> <subject>construct</subject> </product> <product id="book2" markup

sqlite - Why am I getting "Unable to load DLL 'sqlite3'" in my WPF app? -

Image
i added thought necessary sqlite (and sqlite-net) packages app. on running it, though, exception: system.dllnotfoundexception unhandled user code hresult=-2146233052 message=unable load dll 'sqlite3': specified module not found. (exception from i have following sqlite packages installed: what missing? update i tried ajawad987's suggestion, still same runtime error, though i've got this: ...and this: update 2 where runtime exception takes place (in sqlite.cs) seems odd me: if silverlight || use_csharp_sqlite var r = sqlite3.open (databasepath, out handle, (int)openflags, intptr.zero); else // open using byte[] // in case path may include unicode // force open using utf-8 using sqlite3_open_v2 var databasepathasbytes = getnullterminatedutf8 (databasepath); var r = sqlite3.open (databasepathasbytes, out handle, (int) openflags, intptr.zero); endif but am using c#, why line that'

html - Opened added mailto:sales@abc.com in anchor tag. in new tab -

i have added mailto:sales@abc.com in anchor tag. when user click on link mail application opened in current tab . want mail tab should opened in new tab. please suggest me solution thanks in advance you can use target . <a href="mailto:sales@abc.com" target = "_blank">click me</a>

html - How do I align a Logo next to navigation links that are horizontally centered? -

Image
i've been struggling last several hours positioning logo right of centered navigation links in responsive navbar. tried dozens of ways work without luck. left of css navbar intact; bootstrap 3. assistance appreciated! link site is: many thanks! <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet"/> <!-- fixed navbar --> <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span c

ruby - Rails: Add attribute values to several new records in a join table in a has_many :through association -

i have form creates new exercise showing muscle groups worked. here's example of want enter db: new exercise: name => pull-up, primary => back, secondary => [biceps, forearms, chest] how should set up? don't want store primary , secondary arrays in muscle_groups_exercised table because have future queries search exercises based on muscle_group primary exercise. here schema part of app: create_table "exercises", force: true |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end create_table "muscle_groups", force: true |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end create_table "muscle_groups_exercised", force: true |t| t.integer "muscle_group_id" t.integer "exercise_id" t.binary "primary" t.binary "secondary" end add_index "muscle_gro

java - I am unable to uncheck radio buttons in listview -

public view getview(final int position, view convertview, viewgroup parent) { final constructor row = buttonlist.get(position); layoutinflater inflater = layoutinflater.from( context ); view v = inflater.inflate( r.layout.breakfastitems_view, parent, false ); relativelayout relative1 = (relativelayout)v.findviewbyid(r.id.relative1); final radiobutton chbox=(radiobutton)v.findviewbyid(r.id.rb1); final radiobutton rb2=(radiobutton)v.findviewbyid(r.id.rb2); chbox.setonclicklistener(new view.onclicklistener(){ public void onclick(view v) { radiobutton chbox = (radiobutton)v; if(chbox.ischecked()){ boolean value=false; rb2.setchecked(value); rb3.setchecked(false); rb4.setchecked(false); rb5.setchecked(false); rb6.setchecked(false); }