Posts

Showing posts from July, 2010

order - Ordering the third column in excel according to first column (and fill blanks) -

i have 3 columns, 2 first columns have identical values, third 1 has values missing (below nr. 2 & 4 missing). so how can "order" these: +---+---+---+ | | b | c | +---+---+---+ | 1 | 1 | 1 | | 2 | 2 | 3 | | 3 | 3 | 5 | | 4 | 4 | | | 5 | 5 | | +---+---+---+ to become: +---+---+---+ | | b | c | +---+---+---+ | 1 | 1 | 1 | | 2 | 2 | 0 | | 3 | 3 | 3 | | 4 | 4 | 0 | | 5 | 5 | 5 | +---+---+---+ as can see, values missing being (i.e. should be ) filled zero. numbers above unique (i.e. can't have 2 4's in same column). how can same values column c right next column b (and can fill empty fields zero). assuming have row 1 headers... create new column d formula in d2= =iferror(vlookup(a2,c:c,1,false),0) drag down , copy/paste special values columns d , delete column c

Json not decoded if string contains ENTER newline -

i have form has fields name , description . when form submitted store these values json object in database. though when retrieve value database , try decode error if string value contains several lines: { "smtpmailaccountid":"7", "isactive":"1", "templateemailname":"cache topup alert email template ", "systemserviceid":"2", "body":" {-topup_request_date-} {-topup_response_date-} " } when parse json give error.could not validate json multiline not supported json grammar. other question can hep you: multiline strings in json

ios - Swift: Why all my optional variable looks like "Optional(305.502)" -

this question has answer here: printing optional variable 9 answers i've start learning swift. , little confused optional types. have variable var theoptvar: float? can nil make optional ? . when i'd somewhere @ ui see optional(305.502) . there way have optional var on uilabel without "optional" word? it displaying “optional” because have changed datatype float optional float . due whatever value there automatically wrapped optional text. so if don’t want display optional word extract value out of it. to add ! mark . this forced unwrapping. for eg. var temp : float? temp = 60.5 println(value \(temp!))

symfony - Symfony2: How to restrict / deny access to certain routes by IP address? -

i'd disallow access /login , /register if client's ip address has been banned. the (black-) list of banned ips stored in database. how can solve this? since symfony 2.4 can use expression language component in config-files. now implementing simple ip check easy: create service (i.e. access_manager ) method (i.e. getbannedips() ) fetches list of banned ips storage layer add expression security configuration compares returned array against client's ip address that's it. example # app/config/security.yml security: # ... access_control: - path: ^/(login|register)$ allow_if: "request.getclientip() not in @=service('access_manager').getbannedips()"

osx - tmux select panel under mac yosemite -

yesterday installed tmux (great piece of software), have annoying problem: while mouse support seems work (i can scroll text using it), i'm unable select 1 of multiple opened panels clicking on them. in ~/.tmux.conf file have following parameters: set -g mode-mouse on set -g mouse-resize-pane on set -g mouse-select-pane on set -g mouse-select-window on but still, when have multiple panels opened in terminal.app window i'm unable select 1 of them clicking them (as said, scrolling mouse works). tried different variants of options (like using setw) still no success. use yosemite , standard terminal app. tmux last version available on homebrew. any help? it seems terminal.app doesn't support xterm mouse reporting. for reason use iterm.app replacement.

machine learning - Scanning the Articles on Web -

i want make app function summly mobile app. can please tell me: how scan web (a set of online resources) extract text which tools have use? recommend few practical sources (please without theory - have found type of books well) the reason fo doing - delve more practical aspect field of machine learning. thx! data acquisition in such apps trivial - 1 have (fixed) list of source urls, , retrieve data them using standard functions implement web-requests, http (they language specific avaliable in languages nowdays). 1 parse html html parsing library agility pack .net , retrieve requried articles using hand-designed xpath queries. not require machine learning @ all. the number of possible tools , approaches use enormous, 1 can create summly-like stacking simple data downloader above , open-source summarization tool (these can found googling "automatic summarization" , "automatic summarization libraries") or calling online summarization api, with

twitter - How to display Tweets of a particular user in an Android app -

i have twitter account. have android app. if want obtain recent tweets, 15, still have add application dev.twitter page , obtain 2 twitter keys? you can use following method this, screen name parameter , count. according document need authorization also. https://api.twitter.com/1.1/lists/statuses.json for more information read here doc

neo4j - How to limit parsing depth using Tinkerpop Frames -

hi have interface , corresponding implementation class like: public interface iactor extends vertexframe { @property(actorprops.nodeclass) public string getnodeclass(); @property(actorprops.nodeclass) public void setnodeclass(string str); @property(actorprops.id) public string getid(); @property(actorprops.id) public void setid(string id); @property(actorprops.name) public string getname(); @property(actorprops.name) public void settext(string text); @property(actorprops.uuid) public string getuuid(); @property(actorprops.uuid) public void setuuid(string uuid); @adjacency(label = relclasses.coactors, direction = direction.out) public iterable<iactor> getcoactors(); } and use orientdb looks that. had similar implementation neo4j well: graph graph = new orientgraph("remote:localhost/actordb"); framedgraph<graph> manager = new framedgraphfactory().create(graph); iactor actor =

osx - git fatal: multiple stage entries for merged file -

git throws error: fatal: multiple stage entries merged file i've been on side ( getting fatal error in git multiple stage entries ) , read workaround: cd /path/to/second/cloned/repo git --work-tree=/path/to/first/repo add . now, changes can queried via status, after have now? when use git add, last version. changes gone. changes removed , new repo has old status again. how can put change new repository? use git version 2.2.0 on os x 10.10. i resolved problem: in terminal, type this: rm .git/index (press enter key) git add -a (press enter key) git commit -m "your commit instruction"

Android Studio doesn't recognize Facebook imports -

i'm begginer , trying create app facebook integration. i have done steps(importing facebook sdk in module structure,adding missing depedencies in gradle files,adding dependencies module app project in structure again). seemed fine,i added simple loginbutton in main_activity.xml) , no error showed up. since tried facebook imports needed in mainactivity.java, turned red. imports like: import com.facebook.session; import com.facebook.sessionstate; import com.facebook.uilifecyclehelper; import com.facebook.widget.loginbutton; import com.facebook.widget.loginbutton.userinfochangedcallback; and messages "symbol session cannot resolved". googled as could,couldn't find solution worked me. @ opposite, didn't seem have problem: import com.facebook.login.widget.loginbutton; here android manifest file xml: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.c

c# - Foreign key referencing identityuser -

i want know if practice. i building application more 1 model entities; profile.cs , social.cs , skill.cs etc , want each user have profile, have social link, have special skill , on. i want know if practice reference entities in identityuser.cs , if yes, saying identityuser can have more 1 foreign key? public class profile{ public int id {get;set;} public string name{get;set} public string phone{get;set} } //other properties , entities

android - MediaPlayer keeps freezing on pre L devices -

i developing mediaplayer in android , far have tested application on lollipop, lg g3, s5 etc. found problem when runned app on pre l device ( s4 mini running 4.4.2 ). when music starts, because play url it's start playing 2-3 seconds , stop short time , after it's playing again , on. reading again main tutorial android.developers, found can block main ui need run media player in service. public class myservice extends service implements mediaplayer.onpreparedlistener { private static final string action_play = "com.example.action.play"; mediaplayer mmediaplayer = null; public int onstartcommand(intent intent, int flags, int startid) { ... if (intent.getaction().equals(action_play)) { mmediaplayer = ... // initialize here mmediaplayer.setonpreparedlistener(this); mmediaplayer.prepareasync(); // prepare async not block main thread } } /** called when mediaplayer ready */ public

ios - Add PFObject from an NSMutableArray to a new NSMutableDictionary -

my problem following: i run for-loop in nsmutablearray created nsmutabledicitonary , add nsmutabledictionary. how initialize arrays , dictionaries: activitespermonth = [[nsmutabledictionary alloc] init]; activitesseperateddate = [[nsmutabledictionary alloc] init]; self.activityobjects = [nsmutablearray array]; self.gatherandholdobjects = [nsmutablearray array]; what do: nsstring *stringdayonly = [dayonly stringfromdate:selecteddate]; nslog(@"%d, %d, %d aaand stringdayonly %@", day, month, year, stringdayonly); (pfobject *activity in self.gatherandholdobjects){ activitesseperateddate[activity[@"day"]] = activity; } nsmutablearray *storefromdiction = activitesseperateddate[stringdayonly]; self.activityobjects = [nsmutablearray arraywitharray:storefromdiction]; //self.activityobjects = [nsmutablearray arraywitharray:self.gatherandholdobjects]; [self.activitytableview reloaddata]; self.gatherandholdobjects populated this: pfquery *activitesfor

apache - RewriteRule for nicer URL -

i want redirect queries www.example.com/mysite/post/3/title-of-the-post to www.example.com/mysite/display.php?id=3 by setting .htaccess file @ root of www.example.com/mysite/ . tried : .htaccess file --------------- rewriteengine on rewriterule ^post/([0-9]+)/* index.php?id=$1 [l] why doesn't work? how set rewriterule in situation? need add more lines single line in .htaccess ? you don't need * (which should .* ) @ end because you're not ending expression $ . can instead: rewriterule ^post/([0-9]+)/ index.php?id=$1 [l] if want close expression, use this: rewriterule ^post/([0-9]+)/.*$ index.php?id=$1 [l]

javascript - Is it technically possible to remove some parts of the page UI without owning it? -

i wondering if there page many advertisements, possible create own simple ui , feed input website ? lets site send sms: http://www.afreesms.com/intl/singapore now can create webpage mobile number, sms text input, display verification code, , click send without having see other contents (ads , stuffs). is possible @ ? you can strip parts of site out yes, depends on server setup wether can post directly or not though. if not there lot of sms api's available cost few pence per send.

How does PHP manage session? -

i thought php stores session id cookie , identifies user based on cookie. cookie expires browser closed. i implementing remember me feature, , logged in remember me. closed browser , opened again, did not login through cookie stored, instead, session variables still holding login information. seems strange. so question is, how these session variables still hold values though php session id cookie wasn't there? that of time browser dependent. browsers latest version of ie, no such problems seen. after browser closed, session variables destroyed. in google chrome doesn't happen. moreover, session variables url sensitive. if created session , using url http://www.example.com these session variables limited specific address only. if again open page url http://example.com see there no session variables time though destination same both pages. keep in mind redirect page according url used store session variables. more related information on session variable

jquery - Datatables change options individually -

i'm working datatables , ran problem. i have multi tables in 1 page (as in system), of them have commom options, datasource, responsive, etc.. of tables have unique options, bsort, aocolumns , on... so question is: can initialize of them commom options , change options separate? right now, how i'm doing: var tabclientefisico_01 = $('#cfisico').datatable({ responsive: true, bprocessing: true, bserverside: false, aocolumns : [ { "mdata": "id" }, { "mdata": "nm_cliente" }, { "mdata": "cpf" }, { "mdata": "tel" }, { "mdata": "cidade" } ], "ajax": { "url": "data/c_fisico.json", }, "datatype": "json" }); var tabclientefisico_02 = $('#cfisico2').datatable({ responsive: true, bprocessing: true, bserverside: false, b

python - Kivy: change layout when I change orientation -

i want create changes general layout when orientation, or size, of window changed. in below example, trying 3 buttons. fails, , complains buttons have parent when try add them layout. why have parent? never added them adaptwidget... more importantly, how should achieve want achieve? code below: from kivy.app import app kivy.uix.widget import widget kivy.uix.button import button kivy.uix.boxlayout import boxlayout class adaptwidget(boxlayoutwrite failed: broken pipe def __init__(self, **kw): super(adaptwidget, self).__init__(**kw) self.but1 = button(text='but1') self.but2 = button(text='but2') self.but3 = button(text='but3') self.layout = none def on_size(self, *args): self.clear_widgets() if self.size[0] > self.size[1]: self.layout = boxlayout(orientation='horizontal') self.but1.size_hint = 0.7, 1 self.layout.add_widget(self.but1)

c++ - Computing Nth triangular number that is also a square number -

this problem came out in practice contest: compute n th triangular number square number, modulo 10006699. (1 ≤ n ≤ 10^18) there 10^5 test cases. i found out can compute recurrence relation t i = 6t i-1 - t i-2 + 2 , t 0 = 0 , t 1 = 1 . i'm using matrix exponentiation approximately o(log n) performance per test case, it's apparently slow, since there 10^5 test cases. in fact, code slow when constraints (1 ≤ n ≤ 10^6) , o(n) preprocessing , o(1) query. should change approach problem, or should optimize parts of code? #include <ios> #include <iostream> #include <vector> #define mod 10006699 /* transformation matrix: 0 1 0 t[i] t[i+1] -1 6 1 * t[i+1] = t[i+2] 0 0 1 2 2 */ std::vector<std::vector<long long int> > multi(std::vector<std::vector<long long int> > a, std::vector<std::vector<long long int> > b) { std::vector<std::vector<long long int> > c(3, std::vector<long

statistics - drawing confidence interval graphs (especially in minitab or e-view) -

Image
i've made regression model 4 variables. , have gotten following regression equation $$ y= 0.0761 - 0687x_1 - 3.46x_2 - 1.937 x_3$$ i calculated confidence intervals these 4 beta values using bonferroni methods. got these beta values; $-0.123461 \le \beta_0 \le 0.27596$ $-3.18842 \le \beta_1 \le 1.81442$ $-8.96 \le \beta_2 \le 2.04036$ $-3.435 \le \beta_3 \le -0.4389$ and then,i calculated confidence intervals these 4 beta values using scheffé methods. got these beta values; $-0.1685 \le \beta_0 \le 0.3207$ $-3.75314 \le \beta_1 \le 2.379$ $-10.20212 \beta_2 \le 3.28212$ $-3.773 \le \beta_3 \le -0.100704$ now, want plot graphs these beta values that but cannot draw such graph each beta value. please show me way using minitab or hand. note dont know how use r. know minitab , e-view it can done r , ggplot2 follows: > x = 1:20 > y = x*5 + sample(1:10, 20, replace=t) > ggplot(data.frame(x,y), aes(x,y))+geom_smooth(method='lm'

java - Running javacode with MySQL connectivity does not fetch proper results -

iam new java , wrote below code fetch mysql workbench table using java code: package filereader; import java.sql.*; public class dbconnection { public static void main(string[] args) { connection con = null; statement st = null; try { class.forname("com.mysql.jdbc.driver"); con = drivermanager.getconnection("jdbc:mysql://localhost:3306/world","root","password"); st = con.createstatement(); string sql = "select * city id = 1;"; resultset rs = st.executequery(sql); while(rs.next()) { int id = rs.getint("id"); string name = rs.getstring("name"); string countrycode = rs.getstring("countrycode"); string district = rs.getstring("district"); int population = rs.getint("population"); system.out.println(id); system.ou

r - Converting factor to numeric -

i have 3 million row, 500 column dataset. although columns numeric, when importing csv file, treated factor, not numeric. trying convert them numeric command wikifixedn<-as.numeric(as.character(wikifixed)) wikifixed dataframe. it's taking forever... macbook pro, 16gb ram , 2.3ghz core i7 has been churning @ more hour. can see somewhere how far along in process or if process moving along? here another, faster method deal conversation problem? btw: tried, when importing csv file, force columns treated numeric using > wikifixed<-read.csv('~/onedrive/kredible/finaldata/wutao/wikipediausers.csv', header = true, stringsasfactors=f) yet, when checking get > is.numeric(wikifixed) [1] false see here https://stat.ethz.ch/r-manual/r-devel/library/utils/html/read.table.html you should create vector colclasses read.table(file, header = false, sep = "", quote = "\"'", dec = ".", numerals = c("

PHP search mysql database with categories using GET -

Image
as new project tried creating webshop see how works. display new items on sale in main div using php , select tag. , i'm able display items category when user clicks on category in sidebar. when user clicks sidebar page reloaded url adds ?category=car or other category. after use $_get[' if(isset($_get['category'])){ $testsearch = htmlspecialchars($_get['category']); $sqlselect = "select * items_sale inner join item_list on items_sale.item_id = item_list.item_id inner join user_list on items_sale.user_id = user_list.user_id inner join categories on items_sale.categorie_id = categories.category_id category = '$testsearch'"; }else{ $sqlselect = "select * items_sale inner join item_list on items_sale.item_id = item_list.item_id inner join user_list on items_sale.user_id = user_list.user_id inner join categories on items_sale.categorie_id = categories.category_id"; } what can't seem work add search bar user c

meteor - How to ask extra information after login with facebook? -

i have set-up basic meteor application able login facebook. ask valid phone number before creating user. how accomplish in meteor? login workflow : login-page => click 'login facebook' => user gives permission app => redirect app , ask phone number => create user i using accounts-facebook , related packages. thanks since facebook api doesn't support access user phone , can't extend requestpermission array, ask user_phone. lets have simple, login facebook button meteor.loginwithfacebook({ requestpermissions: ['email']}, function (error) { if (error) { return console.log("there error : " error.reason); }else{ //if there no error, lets redirect new user new template router.go('/registerform') } }); now if login successful can redirect user registerform . register form html <template name="registerform"> <!-- simple register form ask

python - How to get vertical slider in enaml? -

is possible vertical slider in enaml? not find among examples or documentation. layout.api seems order different elements, not change orientation of given element. documentation link: http://nucleic.github.io/enaml/docs/api_ref/widgets/slider.html#enaml.widgets.slider.slider.orientation source link: https://github.com/nucleic/enaml/blob/master/enaml/widgets/slider.py#l104

c++ - Visual Studio 2013. Program cannot find an entry for __cxa_throw_bad_array_new_length method in libstdc++-6.dll when starting from .exe file -

i doing program in c++ in visual studio 2013 ide. program uses qt5 , opengl in qt5. everything works when building , starting program in ide (both debug , release modes). when trying run program double clicking generated .exe file, following error occurs: cannot find entry point procedure __cxa_throw_bad_array_new_length in library libstdc++-6.dll do have clues may doing wrong?

android - Is Equalizer.getNumberOfBands() always the same? -

im developing audio app should include equalizer. want save presets albums. i ask myself if equalizer.getnumberofbands() same on single device, can have presets generated without fetching (and instantiating) audiotrack first. i not find useful information on internet that. the number of supported bands vary depending on device. empirically, can remember seeing device 3 bands, many 5 bands, , few more. cannot answer if across many devices same amount of supported bands, each band @ same exact frequency.

c - Memory Management for Mapped Data in Shared Memory Segments -

i'm working on project in c uses shared memory ipc on linux system. however, i'm little bit confused memory management in these segments. i'm using posix api project. i understand how create shared segments, , these persist until reboot if fail remove them shm_unlink() . additionally, understand how mapping & unmapping mmap , munmap respectively. however, usage of these operations , how affects stored data in these shared segments confusing me. here i'm trying understand: lets create segment using shm_open() o_creat flag. gives me file descriptor i've named msfd in below example. have struct map address space following: mystruct* ms = (mystruct*)mmap(null, sizeof(mystruct), prot_read | prot_write, map_shared, msfd, 0); //set elements of struct here using ms->element = x usual part 1) here's confusion beings. lets process done accessing location since setting data process read. still call munmap() ? i want other process still

Adding parallel capabilities to a FOR task -

i want execute following command: for in {0-months,3-months,6-months,9-months,12-months,ec1,ec2_cz,ec2,ec3}; freebayes --fasta-reference ../genome/eciii_lemming_assembly_masked.fasta --pooled-continuous --min-coverage 10 -f 0.01 -c 2 --vcf vcf/${i}.vcf ${i}.sort.grp.bam; done but these task independent of each other, , can run in parallel. wondering if there way gnu parallel. usually when using parallel, have file listing commands needed run, in case this: freebayes --fasta-reference ../genome/eciii_lemming_assembly_masked.fasta --pooled-continuous --min-coverage 10 -f 0.01 -c 2 --vcf vcf/0-months.vcf 0-months.sort.grp.bam freebayes --fasta-reference ../genome/eciii_lemming_assembly_masked.fasta --pooled-continuous --min-coverage 10 -f 0.01 -c 2 --vcf vcf/3-months.vcf 3-months.sort.grp.bam freebayes --fasta-reference ../genome/eciii_lemming_assembly_masked.fasta --pooled-continuous --min-coverage 10 -f 0.01 -c 2 --vcf vcf/6-months.vcf 6-months.sort.grp.bam freebayes --fasta

javascript - Which data structure i should use to define and store users actions? -

my chrome extension uses drag , drop feature, works in way: you grab object source page , drop target page, event corresponded set of predefined instructions (let's 3 async functions). after while drag again object , drop same area, popup message asks whether substitute or merge 2 objects (to commit operation need read done in past). i wonder, data structure(perhaps stack), approach use in order set logical interpretation of instructions.

javascript - all valid combinations of n-pair of parenthesis -

i learning js now.. i trying write simple js programme.. what trying print valid combinations of n-pair of parenthesis(properly opened , closed) eg (), (()()),(()) i have written logic can tell me whether correct or not https://jsfiddle.net/e7mcp6xb/ module.exports = parentheses = (function() { var _isparenthesesmatch = function(str) { var parentheses = str.length; var rightparentheses = '('; var leftparentheses = ')'; var rightcount = 0; var leftcount = 0; for(i=0;i<=str.length;i++){ if(rightparentheses == str.charat(i)) { rightcount++; } else if(leftparentheses == str.charat(i)) { leftcount++; } } if(rightcount == leftcount){ return true; } else(rightcount != leftcount){ return false; } } }()); the check wrong, can fix easily: in each step of for loop number of opening parenthesis cannot smaller number of closing one

Keep the order of tabbar tabs in Emacs after restart -

tabbar great. adds tabs on emacs. loaded with (require 'tabbar) (tabbar-mode t) the issue have when emacs reloads desktop on restart, tabs reordered. please tell me if there way have desktop save process save order of tabs well? have tried , didn't work. (desktop-save-mode 1) (require 'saveplace) (setq-default save-place t) ;(setq history-length 5500) (add-to-list 'desktop-globals-to-save 'tabbar-drag-tab) ;(add-to-list 'desktop-globals-to-save 'tabbar-current-tabset) ;(add-to-list 'desktop-globals-to-save 'tabbar-tabsets) ;(add-to-list 'desktop-globals-to-save 'tabbar-tabs) ;(add-to-list 'desktop-globals-to-save 'tabbar-buffer-tabs) ;(add-to-list 'desktop-globals-to-save 'tabbar--buffers) ;(add-to-list 'desktop-globals-to-save 'tabbar--buffer-show-groups) ;(add-to-list 'desktop-globals-to-save 'tabbar-current-tabset) ;(add-to-list 'desktop-globals-to-save 'tabbar-tab-label) ;(add-to-list &#

loopbackjs - Loopback Filter Based On Related Model Properties -

i want able filter based on properties of related models. example, have class object building object. want list of classes take place in building. this filter { "include":"building", "scope":{ "where":{ "name":"warehouse" } } } returns all classes, includes building if name "warehouse". want clause on building name apply whole filter class if it's building has name. is there way want? thanks! you can in code, see include filters in docs. i'm not sure json think should more this: include: { relation: 'building', scope: { where: {name: 'warehouse'} } }

matlab - Matrix main diagonal change -

i have matrix below: a= 1 2 1 2 i transform to: b= 1 1 2 2 i have tried use output of diag(a) , don't know how concatenate same output twice. it looks you're swapping anti-diagonal elements. way instead of using transpose indexing: a([2 3]) = a([3 2]); how above code works can access elements in matrix using column-major linear indices. means traverse matrix top bottom, left right. therefore, want access second row first column index 2, first row second column index 3. have swap 2 values, left-side indices reverse of right-side indices.

Largest Palindrome value made from the product of 2 3-digit numbers -

public static boolean ispal(int value) { string temp = string.valueof(value); int begin=0; int end=(temp.length())-1; int middle=(begin+end)/2; for(int count=begin; count<=middle; count++) { if(temp.charat(count)!=temp.charat(end)) { return false; } else if(temp.charat(count)==temp.charat(end)) { end--; } } return true; } public static int largestpalindromenumber() { int largestnumber=0; int num1=999; int num2=999; while(num1>=100 && num2>=100) { if(ispal(num1*num2)) { largestnumber=num1*num2; break; } else { if(num1==num2-1) { num2--; } else { num1--; } } } return largestnumber; } when run this, returns palindrome 698896, palindrome, not highest palindrome ma

json - Postman sending raw data -

im trying send raw data web service have. service waiting object named viaje has next data: * iddestino numeric id * idlanta numeric id * idpeticion array of numeric ids * idvehiculo numeric id heres im trying out, wont detect index viaje. { "viaje" : [{ "iddestino" : 7, "idllanta" : 7, "idpeticiones" : [{2,12]], "idvehiculo" : 1, }] } im using laravel web services , here how im reciving data. $object = input::all(); $object = $object["viaje"]; //variables de login inputs $iddestino = $object['iddestino']; $fechainicio = date('y-m-d h:i:s'); $idllanta = $object['idllanta']; $idpeticiones = $object['idpeticiones']; $idvehiculo = $object['idvehiculo']; what want know how structure raw data im sending fit description gave. if doing in form-data possible how this? ok found out how format json array: { "viaje" : {

ios - Include pods in main target and not in WatchKit extension -

i added watchkit extension current project. project uses cocoapods 0.36.1 add frameworks, want exclude pods watchkit extension project. the watchkit extension project doesn't need lot of frameworks use in normal target, can't cocoapods work correct after altering podfile. i use use_frameworks! in podfile, after running pod install following messages: [!] cocoapods did not set base configuration of project because project has custom config set. in order cocoapods integration work @ all, please either set base configurations of target `homehandler` `pods/target support files/pods-homehandler/pods-homehandler.debug.xcconfig` or include `pods/target support files/pods-homehandler/pods-homehandler.debug.xcconfig` in build configuration. [!] cocoapods did not set base configuration of project because project has custom config set. in order cocoapods integration work @ all, please either set base configurations of target `homehandler` `pods/target support files/pods-homeh

How to add windows store-style interface to desktop app, similar to Google Chrome? -

Image
i found new feature of google chrome on windows 8.1: "windows 8 mode" available menu in top-right corner of window: this opens windows store-style interface, if own app: does know how google this, without sideloading app using auto-generated "add-appdevpackage.ps1" powershell script visual studio generates when create app package? thanks in advance, magikm18

javascript - jQuery click function not working after get request -

i have been tackling code while now, , cannot click function work in jquery. want sidebar go away when click close image. when enter click function in console seem work. if put click function in complete function of request seems work. javascript (doesn’t work): 'use strict'; $.get('http://api.ipify.org?format=text&callback=?', function(text) { $('input[name="user_ip"]').val(text); } ); $('.close-trigger').click(function() { $('aside.open').removeclass('open'); return false; }); javascript (works isn’t neat): 'use strict'; $.get('http://api.ipify.org?format=text&callback=?', function(text) { $('input[name="user_ip"]').val(text); $('.close-trigger').click(function() { $('aside.open').removeclass('open'); return false; }); } ); sidebar html want hide: <aside id="sidebar"> <h2>new proposal</h2&

php - "file_get_contents()" returns only the first chunk (WebDAV) -

This summary is not available. Please click here to view the post.

javascript - jquery animate in loop not working -

i've looked @ seemingly similar animate issues none of them seems quite me solution. trying animate bubble sort loop show moving numbers somehow not work. loop, not animated, works is: var locations = [ '1', '2', '3', '4', '5', '6', '7']; function bubblesort2 () { { swapped = false; (var = 0; < locations.length-1; i++) { if (parseint($('#' + locations[i]).text()) > parseint($('#' + locations[i+1]).text())) { $('#' + locations[i] + '>p').appendto($('#setaside')); $('#' + locations[i+1] + '>p').appendto($('#' + locations[i] )); $('#setaside>p').appendto($('#' + locations[i+1])); swapped = true; } } } while(swapped); } when try use animation features, botching things. various tweaks, can single pass animate c

rust - Modifying structure while iterating - any elegant solution? -

i've started rust , i'm trying build vector of points changed while iterating on them: struct point { x: i16, y: i16 } fn main() { let mut points: vec<point> = vec![]; // unsure if point mutable points.push(point {x:10, y:10}); // trying explicitly let mut p1 = point {x:20, y:20}; points.push(p1); in points.iter() { println!("{}", i.x); i.x = i.x + 10; } } when compiling, error: error: cannot assign immutable field `i.x` i.x = i.x + 10; as learned here , rust doesn't allow modify structure while iterating on it, error. ok, how modify in elegant way? if read this answer , right following comes mind: pop item (point) item vector, modify , push back. create temporary structure push changed items (points) , replace original structure temporary 1 outside loop (how?). while think can (1) working, i'm not happy pop's , push's (is high-performance anyhow?). concerning (2), have no idea how working - if

web services - How to display result from Meteor.HTTP.Get -

edit : got working now. trick move http.get server-side , use simple:reactive-method package result method. i use figuring out how display result of meteor.http.get . docs sketchy , there's no topics here relates case. i'm searching foursquare find local farmers & markets around you. display result in map (no map yet). here's code: the start page: <template name="locator"> <a class="button" href="{{pathfor route='locatormap' query='group=farmers'}}">farmers</a> <a class="button" href="{{pathfor route='locatormap' query='group=markets'}}">markets</a> </template> the soon-to-be map page. edited: mar 31, 2015 <template name="locatormap"> <div class="list"> {{#each venues}} <p>{{name}}. {{location.lat}}, {{location.lng}}</p> {{/each}} </div> &

linux - How do I shorten this grep command? -

i want grep command shorter, e.g., able type g on command line execute grep options -pei . i've tried alias in bash, piping doesn't work. alias g='grep --color auto -pei' gives me history |g qemu grep: auto: no such file or directory grep: qemu: no such file or directory i tried in .bashrc function g () { /bin/grep -pei "$@" ;} it still outputs history |g qemu grep: qemu: no such file or directory there 2 separate problems alias: long-form gnu options (those starting -- rather - ) require = between option name , value (argument): i.e., should --color=auto , not --color auto you're using option -e incorrectly: purpose accept multiple search patterns, each -e instance requiring argument - in case, [-]e directly followed i , therefore mistakenly serves -e 's argument, i.e., pattern , causing true search pattern misinterpreted filename operand. thus, redefine alias follows: alias g='grep --co

iOS Swift: Check string suffix -

i have array of strings filenames in app bundle. pngs others movs. there method checking string suffix in swift? use hassuffix , filter methods, this: let files : [string] = ["quick.txt", "brown.mov", "fox.exe", "jumps.mov", "over.jpg", "the.txt", "lazy.mov", "dog.opt"] let movs = files.filter{$0.hassuffix(".mov")} println(movs) // prints [brown.mov, jumps.mov, lazy.mov]

android - Why TextView color change to blue when parsing it a string value from Html.fromHtml() -

i have html string being fetch server. i'm showing in textview this: detailtext.settext(html.fromhtml(offer.getdetaildesc())); now activity in textview place has black background , have set textview color white in xml. when set text of textview, color changes blue. why happening? also, there no links or color attributes in html tags string , want show text in white. thanks a workaround: download html text. use string class methods or matcher android class find patterns <font color.*> remember take shortest match always. crop string , pass html.fromhtml() method apply textview.

go - Gorilla websocket with cookie authentication -

here's setup: i'm building service (using negroni , gorilla) user login, upon login, user gets session cookie server uses authorize protected endpoints. 1 of protected endpoints allows user/client open websocket server, so: app := negroni.new() r := mux.newrouter() r.handlefunc("/auth/connection", func(rw http.responsewriter, req *http.request) { // authorize request using req.cookie("session_id") // create websocket conn, err := upgrader.upgrade(rw, req, nil) if err != nil { panic(err) } defer conn.close() // stuff... }) app.usehandler(r) app.run(":3000") however, req.cookies() empty, meaning can't authorize requests "/auth/connection" -- , i'm positive not problem websocket client (if you're curious, i'm testing using python package: https://github.com/liris/websocket-client ). approaching authentication of websocket correctly? any help/advice appreciated! th

python - Switching from db.ReferenceProperty to ndb with Google App Engine? -

today read article here on how make 1 many relationship use in gae rest api. https://cloud.google.com/appengine/articles/modeling i thought pretty straightforward, realized using ndb , not db, cannot use db.referenceproperty. here have model route class route(ndb.model): driver_id = ndb.integerproperty() requester_id = ndb.integerproperty() startpoint = ndb.geoptproperty(required=true) endpoint = ndb.geoptproperty(required=true) regular = ndb.booleanproperty(required=true) date_and_time = ndb.datetimeproperty(required=true) places_available = ndb.integerproperty() val_lift = ndb.integerproperty() and here have model regulardays used if regular in json received true class regulardays(ndb.model): route = db.referenceproperty(route, collection_name='regular_days') monday = ndb.booleanproperty(required=true) tuesday = ndb.booleanproperty(required=true) wednesday = ndb.booleanproperty(required=true) thurs

c# - Why does the object get duplicated multiple times? -

i want know understand way object creation/referencing happening. have piece of code employee objects in list duplicated. top code has issue overrides previous entries list contains duplicated objects whereas bottom fix. want understand why creating new object inside while.read() loop worked whereas having employee object creation outside of while loop did not. public ienumerable<employee> employees { { list<employee> employees = new list<employee>(); using (sqlconnection connection = new sqlconnection(connectionstring)) { employee _employee = new employee(); //<issue here, enties in employees duplicated values of single record sqlcommand sqlcmd = new sqlcommand("spgetallemployees", connection); sqlcmd.commandtype = system.data.commandtype.storedprocedure; connection.open(); sqldatareader reader = sqlcmd.executereader(); while (reader.read())