Posts

objective c - Deep Linking for iOS Apps which are not installed yet? -

i want use deep linking specific place in app using lib like: https://github.com/usebutton/ios-deeplink-sdk i know how make deep linking when app installed on device. how can deep link app not installed on device, i.e., link refers appstore , after installing app deep link token should present? you use uiapplications canopenurl method check if app exists. see example: -(void)openotherapp { uiapplication * myapplication = uiapplication.sharedapplication; nsstring * urlencodedstring = [@"somesortofaction" stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]; nsstring * completepath = [@"otherappsurlscheme://" stringbyappendingstring:urlencodedstring]; nsurl * theurl = [nsurl urlwithstring:completepath]; if ([myapplication canopenurl:theurl]) { // app installed, launch [myapplication openurl:theurl]; } else { // app not installed open app store // replace appstore web ur...

ios - Reload Table view cell with animation (Swift) -

is there way reload specific uitableview cells multiple sections animations? i've been using: self.thetableview.reloadsections(nsindexset(index: 1), withrowanimation: uitableviewrowanimation.right) this animates cells in section though. other option use: self.thetableview.reloadrowsatindexpaths(<#indexpaths: [anyobject]#>, withrowanimation: <#uitableviewrowanimation#>) edit: after using reloadrowsatindexpaths terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'invalid update: invalid number of rows in section 1. number of rows contained in existing section after update (5) must equal number of rows contained in section before update (4), plus or minus number of rows inserted or deleted section (0 inserted, 0 deleted) , plus or minus number of rows moved or out of section (0 moved in, 0 moved out).' trying find smooth way of reloading tableview appending objec...

How to copy data from an excel sheet to another excel sheet uploaded in sharepoint using VBA? -

i ask if it's possible copy or transfer data excel sheet worksheet uploaded in sharepoint without need of opening file sharepoint. done vba? you're prompt response appreciated. lot! if have access sharepoint can use code: excel vba up-/download multiple sharepoint folders in order open sharepoint folders network drive , access files using filesystemobject or dir on local hard disk. i recommend method if you've enough drive letters available. 1 letter 1 folder. can connect root folder on sharepoint , browse subfolders in explorer. i hope you. if have question, ask.

c++ - Error while parsing xml file in cpp using Rapidxml -

i trying read , xml file , parsing using below code can suggest mistake making. it shows error error: (e549) uncaught exception: configexception: expected < void parsercnffile::read(void) { ifstream file(m_file.m_name.c_str(), ios::in | ios::binary | ios::ate); if (file.is_open()) { file.seekg(0, ios::end); int size = file.tellg(); m_file.m_contents = new char[size]; file.seekg(0, ios::beg); file.read(m_file.m_contents, size); file.close(); } else { throw configexception("configexpection: not open \"" + m_file.m_name + "\""); } } void parsercnffile::parse(void) { xml_document<> doc; // character type defaults char try { doc.parse<0>(m_file.m_contents); flags } catch (rapidxml::parse_error& e) { cout << m_file.m_contents << endl; throw configexception(string() + "...

python - Pandas, groupby where column value is greater than x -

i have table this timestamp avg_hr hr_quality avg_rr rr_quality activity sleep_summary_id 1422404668 66 229 0 0 13 78 1422404670 64 223 0 0 20 78 1422404672 64 216 0 0 11 78 1422404674 66 198 0 40 9 78 1422404676 65 184 0 30 3 78 1422404678 64 173 0 10 17 78 1422404680 66 199 0 20 118 78 i'm trying group data timestamp , sleep id , rr_quality , rr_quality > 0 i've tried following , none of them seems work df3 = df2.groupby([df2.index.hour,'sleep_summary_id',df2['rr_quality']>0]) df3 = df2.groupby([df2.index.hour,'sleep_summary_id','rr_quality'>0]) df3 = df2....

c++ - Why doesn't this program run properly under Clang or GCC? -

i'm trying run cppreference's regex_search example : #include <iostream> #include <string> #include <regex> int main() { std::string lines[] = {"roses #ff0000", "violets #0000ff", "all of base belong you"}; std::regex color_regex("#([a-f0-9]{2})" "([a-f0-9]{2})" "([a-f0-9]{2})"); (const auto &line : lines) { std::cout << line << ": " << std::regex_search(line, color_regex) << '\n'; } std::smatch color_match; (const auto &line : lines) { std::regex_search(line, color_match, color_regex); std::cout << "matches '" << line << "'\n"; (size_t = 0; < color_match.size(); ++i) std::cout << << ": ...

javascript - How to center a scrollable image that is larger than the screen -

i'd make image viewer centers image regardless of how big , allows scrolling view entire image. the problem i'm running that, while centering images smaller container easy, when they're larger tranform i'm doing positions image off right , top of screen. here fiddle has fixup javascript make work: http://jsfiddle.net/d3y0b8bd/ the code below work smaller images (e.g. https://upload.wikimedia.org/wikipedia/meta/0/08/wikipedia-logo-v2_1x.png ) but larger, translate(-50%, -50%) transform translate image past left , top margins of parent. .lightboxroot { position: fixed; width: 100%; height: 100%; overflow: auto; /*aesthetic*/ background-color: red; } .lightboximg { position: absolute; top: 50%; left: 50%; margin-right: -50%; transform: translate(-50%, -50%); /*aesthetic*/ background-color: blue; } html: <div class="lightboxroot"> <div class="lightboximg"> <i...

javascript - SignalR sharing connection between 2 apps -

i have 2 projects in solution, 1 mvc app , second 1 simple windows forms app. i'm trying do, testing purposes, control content on mvc app through windows forms app. simplify further, have button on app, should, when clicked, update html on connected clients. mvc should manage client connections, , forms app should dedicated content administration. what did - mvc hub setup public class connectionhub : hub { public void update() { clients.all.updatesequence(" "); } } mvc startup setup: [assembly: owinstartup(typeof(web.startup))] namespace web { public class startup { public void configuration(iappbuilder app) { globalhost.dependencyresolver.usesqlserver( configurationmanager.connectionstrings["signalr"].connectionstring); app.mapsignalr(); } } } forms app - on button clicked event: private void button1_click(object sender, eventargs e) { var co...

excel - INDEX MATCH using "configuration" strings in separate cells -

my attempt use value in particular cell configure index argument has not been panning out point. i have attempted create configuration sheet define index ranges used throughout working data sheet formula this: index(config!r1c2,match(rc1,config!r1c3,0),config!r1c4) in config!r1c2 cell example i'd put rawdata!r1c1:r100000c100 index range, in config!r1c3 i'd define match lookup range rawdata!r1c5:r100000c5 . this attempt @ allowing me populate report using index match, while avoiding having reconfiguring every formula each time raw data's format changes (which changes , have 0 control over). configuration sheet i'd able redefine index range, , match range in 1 cell. in formula need wrap cell reference indirect() function in order evaluate contents of cell config!r1c2 range. indirect volatile, though , may slow down workbook. consider using named formulas (named ranges) instead. create 3 range names (formula ribbon > name manager > new ). ...

osx - NSVisualEffectView with Tab View Controller using storyboard -

im using storyboard in app , tabviewcontroller 3 tabs. when put nsvisualeffectview in views works fine, when move window, visualeffectview starting disappear. settings visual effects are: behind window, dark active. use ib put them in views. if use 1 view without tabviewcontroller nsvisualeffectview works fine, tabviewcontroller cause troubles. can please help?

vbscript - Inserting Lines into a Non-Text File -

i trying insert lines middle of non-text file (the extension of file "dxf"). using vbscript this. everywhere have look, come across filesystemobject.opentextfile. however, when try use on dxf file, causing error: exception 80070057 (i believe invalid file) . here code: dim file dim fso set fso = createobject("scripting.filesystemobject") if fileexists(dxffile$) set file = fso.opentextfile(dxfpath, forappending, true) file.writeline("<portlist testing>asdflkj") file.close end if dxffile$ not valid vbscript variable name; use dxffile , file or dfxpath (consistently) fileexists method of filesystemobject; need call fso.fileexists neither dxffile , nor dfxpath , nor forappending defined calling .opentextfile undefined/empty first/filespec parameter throws error 5 - invalid procedure call or argument you can't insert lines appending them; modifying files 'in middle' clumsy in vbscript; loading who...

sql server - SQL Case statement returns wrong value -

i have following sql statement designed give field t1.dwposteddatekey value if t2.inventorystatuscode changes 'p'. starting value of t1.dwposteddatekey null, , if t2.inventorystatuscode doesn't change, want stay null. select t1.datekey, t1.dwposteddatekey, (case when t2.inventorystatuscode = 'p' , (t1.inventorystatuskey != t2.inventorystatuskey) convert(int, getdate(), 112) else t1.dwposteddatekey end) table1 t1 inner join table2 t2 on t1.key = t2.key the problem don't null ? here example of results: datekey dwposteddatekey (no column name) 20150413 null 42106 20150413 null 42106 20150413 null 42106 20150413 20150414 20150414 20150413 20150414 20150414 20150413 20150414 20150414 what 42106 doing in there? want remain null value. the problem line convert(int, getdate(), 112) , in int . it converting datetime int , sql...

How to show/draw the spectrum frequency from line into bar shape (android)? -

i learning how make spectrum analyzer. learn tutorial , here's code package com.example.prasetyo.spectrumanalyzer; import android.app.activity; import android.graphics.bitmap; import android.graphics.canvas; import android.graphics.color; import android.graphics.paint; import android.media.audioformat; import android.media.audiorecord; import android.media.mediarecorder; import android.os.asynctask; import android.os.bundle; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.imageview; import ca.uol.aig.fftpack.realdoublefft; /*public class spectrumactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_spectrum); }*/ public class spectrumactivity extends activity implements onclicklistener { public void onclick(view v) { if (...

css - CORS policy for S3 bucket referencing itself -

in css files have relative paths: .css-emoticon.smile{ background: url('../../images/sprites.png'); background-position: -16px -18px ; } but forbidden 403 error sprite.png file when pulling s3 load on site. css file loads fine s3 onto site. my s3 located on subdomain: http://media.example.com , site loads in files s3 http://example.com here cors file: <?xml version="1.0" encoding="utf-8"?> <corsconfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <corsrule> <allowedorigin>*</allowedorigin> <allowedmethod>get</allowedmethod> <maxageseconds>3000</maxageseconds> <allowedheader>content-*</allowedheader> <allowedheader>host</allowedheader> </corsrule> </corsconfiguration> any ideas on how set cors policy allow relative urls in css? thanks much looks didn't set bu...

python - PYMC MAP Fit problems -

i use pymc implement multinomial-dirichlet pair. want map model instances have. issue face once map.fit() prior distribution changed. thus, every new instance, need have new prior distribution, should fine. however, keep seeing error: traceback (most recent call last): file "/users/xingweiy/project/starrating/timeplot/bayesianprediction/diricheletmultinomialstarrating.py", line 41, in <module> prediction = predict.predict(input,prior) file "/users/xingweiy/project/starrating/timeplot/bayesianprediction/predict.py", line 12, in predict likelihood = pm.categorical('rating',prior,value = exp_data,observed = true) file "/library/python/2.7/site-packages/pymc-2.3.4-py2.7-macosx-10.9-intel.egg/pymc/distributions.py", line 3170, in __init__ verbose=verbose, **kwds) file "/library/python/2.7/site-packages/pymc-2.3.4-py2.7-macosx-10.9-intel.egg/pymc/pymcobjects.py", line 772, in __init__ if not isinstance(self....

javascript - How to override default functionality in Ember-addons -

in ember-cli documentation describes bridging addon within host application overriding app/component/[addon-name.js] yourself. however, documentation doesn't explicitly state how this. with trial , error i've noticed creating component file in [host app]/app/component/[name of addon.js] , copy/paste addon code there provides venue customize addon. however, terrible approach, imagine override functions in question...and in cases call this.super().functionname in order keep over-rides simple , trim. however, can't work. ideas? extensibility why addons have both addon/ , app/ trees. in app tree component, component should import , export, example: import xselect 'emberx-select/components/x-select'; export default xselect; source: https://github.com/thefrontside/emberx-select/blob/master/app/components/x-select.js in kind of case want create component in [host app]/app/component/[name-of-addons-component.js] in component do: import xselect ...

security - Writing a buffer overflow exploit -

i understand there quite few tutorials on how write buffer overflow, still can't write own. the following c code want hack: #include <stdio.h> #include <stdlib.h> static int x = 8; void prompt(){ char buf[100]; gets(buf); printf("you entered: %s\n", buf); } int main(){ prompt(); return 0; } void target(){ printf("haha! made it!\n"); exit(0); } my goal execute target () function via buffer overflow exploit. through trial , error, i've discovered minimum number of characters required obtain segmentation fault 108. (therefore 107 characters not cause seg fault) i've disassembled binary, , found target executable @ address 0x08048e7f i've flipped byte order compensate endian-ness. --> 0x7f8e0408 converted hexadecimal binary, ascii, obtaining: & # 3 8 1 ; (ignore spaces, stackoverflow doesn't show originally) afterwards, inserted first 107 characters, , Ž thus, attack string is: iii...

r - Errors in tsoutliers: non-finite value supplied by optim -

my objective remove outliers time series, forecast adjusted series. should happen automatically using tso() function in tsoutliers package. however, receiving errors appear related xreg produced automatic outlier detection. can please explain errors , advise how avoid them when using tso() function. in both examples 1 data point appears cause error. library(tsoutliers) <- c(0.0006803534,0.0008086988,0.0010701362,0.0028385699,0.0009526675,0.0011191115,0.0008059368,0.0008332677, 0.0012494373, 0.0005474622, 0.0012861884, 0.0013055677, 0.0026272806, 0.0009219052, 0.0012265391, 0.0011404776, 0.0012051921, 0.0011466459, 0.0009422736, 0.0011882251, 0.0016061762, 0.0017002298, 0.0010543345, 0.0014305019, 0.0009765448, 0.0016551414, 0.0015071106, 0.0009334908, 0.0011783813, 0.0025809926, 0.0024930899, 0.0021169154, 0.0014262570, 0.0017019384, 0.0014512346, 0.0012913704, 0.0020135812, 0.0025037096, 0.0030477309, 0.0014514058, 0.0016321700, 0.00085879...

ruby - What SHOULD I be seeing to know this code has done what it was supposed to? -

i doing eventmanager tutorial jumpstart labs. not .rb file read .erb file, , think may have solved that, not sure not know should seeing if running correctly , unfortunately tutorial doesn't tell you. here original question now after simple change, no longer getting error - not getting indication code working expected. tutorial says code should creating new directory , storing copy of each 'thank you' letter file called 'output' in new directory. when run see => eventmanager initialized terminal, tells me .rb being read , (i think) .erb being read...but not see new directories/files in file structure, nor indication created - can't tell if doing anything. i kind of expecting see kind of message telling me directory has been created, perhaps file path or something. i have never done , i'm not sure should seeing...can tell me how know code preforming expected? , if not, why? require "csv" require "sunlight/congress" requi...

ios - Call function when SwipeGestureRecognizer swipe speed passes threshold -

i'm programming app, contains uiview uiswipegesturerecognizer i want recognizer recognize how fast user dragging in recognizer's direction. when speed high enough (past specific threshold) custom action should occur. it's same in this post , need written in swift. how translate swift or there better way it? current code, xcode errors marked comments. touches began: override func touchesbegan(touches: set<nsobject>, withevent event: uievent) { //avoid multi-touch gesture if(touches.count > 1){ return; } if let touch:uitouch = touches.first as? uitouch{ let locator:cgpoint = touch.locationinview(self.view!) start = locator starttime = touch.timestamp } touches ended: override func touchesended(touches: set<nsobject>, withevent event: uievent) { if let touch:uitouch = touches.first as? uitouch{ let locator:cgpoint = touch.locationinview(...