Posts

pandas - alternative to recursive sql / dedupe columns -

hi have data set 1 many relations. want reduce 1-1 concatenating distinct values each column here example: i have data set called customer , product affiliation (pa) . 1 customer can have multiple pa different times. here input: ╔════════╦═══════╦══════╦══════╗ ║ cust ║pa1 ║ pa2 ║ pa3 ║ ╠════════╬═══════╬══════╬══════╣ ║ ║ h ║ m ║ l ║ ║ ║ h ║ l ║ m ║ ║ ║ h ║ m ║ h ║ ╚════════╩═══════╩══════╩══════╝ desired output: ╔════════╦══════╦══════════╦═══════╗ ║ cust ║ pa1 ║ pa2 ║ pa3 ║ ╠════════╬══════╬══════════╬═══════╣ ║ ║ h ║ m&l ║ l&m&h ║ ╚════════╩══════╩══════════╩═══════╝ i have multiple pa columns. want know if there generic python panda code can apply thank minc here's expanded version of sample data make more clear how code operates on groups rather whole dataframe: df = pd.dataframe({ 'cust':list('aaabbb'),'pa1':list('hhhmmh'), ...

CDaoRecordset If a field Exists in MFC C++ -

how check if given field name exists in access database table using vc++ daorecordset. tried google , msdn documentation find useful. i tried following code: bool isfieldexixts(cdaorecordset *rs, cstring fieldname) { colevariant ov; try { rs->getfieldvalue(fieldname,ov); } catch(cdaoexception e) { return false; } return true } but instead of raising exception when not found, displays messagebox stating item not found. i need c++ solution, can find on google vb solutions getfieldvalue not display messagebox. catch block not correct, need catch(cdaoexception *e) { e->delete(); return false; } so in program exception not handled in code. in mfc top level function default handler exceptions invoked , 1 displaying messagebox. btw, check if entry exists in recordset can call cdaorecordset::iseof .

xcode - Dependency between APNS certificate and distribution provisioning profile? -

i have app in app store apns. now, distribution profile broken , can't add device distribution profile. generated profile apple prefix xc:. so 1 solution create new distribution profile new version of app , submit app store. but need create new apns certificate? or work new distribution profile? perhaps actual question is: there relationship between distribution profile , apns certificate? or app id important let apns work? as outlined in push notification guide , ssl certificate used push notifications independent distribution provisioning profile used app. however, need ensure new provisioning profile provides correct entitlements using push notifications , production/development environment, described here . luck.

c# - Pausing in unity -

i trying pause game in unity using timescale , setting 0 when pause panel comes , setting 1 when panel disabled. problem having when pause, buttons on panel not showing animation time scale 0. there anyway around this? or should find way pause without using timescale. appreciated, thanks. a possibility maintain state of game using enum . e.g., define enum as: enum gamestate { started, loading, playing, paused, completed } declare variable of type gamestate in session or place access easy you, compare: if(currentgamestate == gamestate.playing) { // play logic here }

input - Fortran non advancing reading of a text file -

i have text file header of information followed lines numbers, data read. i don't know how many lines there in header, , variable number. here example: filehandle: 65536 total # scientific data sets: 1 file description: file contains northern hemisphere polar stereographic map of snow , ice coverage @ 1024x1024 resolution. map produced using noaa/nesdis interactive multisensorsnow , ice mapping system (ims) developed under directionof interactive processing branch (ipb) of satellite services division (ssd). more information, contact: mr. bruce ramsay @ bramsay@ssd.wwb.noaa.gov. data set # 1 data label: northern hemisphere 1024x1024 snow & ice chart coordinate system: polar stereographic data type: byte format: i3 dimensions: 1024 1024 min/max values: 0 165 units: ...

svn - Cherry picking features -

i've inherited legacy project must remain in svn. originally branch created new release , several bug fixes made , deployed staging server. several times client asks bug 1 , 3 go production server causing lot of headaches. what best branch strategy allow cherry picking of bugs? i have 2 branches: "trunk" , "production". trunk contain latest version bugs fixed. production contain fixes requested production. the development goes in trunk. periodically trunk selectively merged production (you select revisions merge every time).

bash - Env variables not persisting in parent shell -

i have following bash script attempts automate assuming of aws role (i've removed various private settings): #! /bin/bash # # dependencies: # brew install jq # # execute: # source aws-cli-assumerole.sh unset aws_session_token export aws_access_key_id=<user_access_key> export aws_secret_access_key=<user_secret_key> temp_role=$(aws sts assume-role \ --role-arn "arn:aws:iam::<aws_account_number>:role/<role_name>" \ --role-session-name "<some_session_name>") export aws_access_key_id=$(echo $temp_role | jq .credentials.accesskeyid) export aws_secret_access_key=$(echo $temp_role | jq .credentials.secretaccesskey) export aws_session_token=$(echo $temp_role | jq .credentials.sessiontoken) env | grep -i aws_ i have execute script using source because otherwise if use standard bash or sh exported environment variables not available within parent shell executing script. the problem i...