Posts

Showing posts from May, 2010

Adding Cordova Plugins to Meteor Project with command line arguments -

in meteor project cordova plugin needs added. while documented in https://github.com/meteor/meteor/wiki/meteor-cordova-phonegap-integration the problem here plugin needs command line argument, meaning in common cordova project added so: cordova plugin add pluginname --variable varname="var_value" so how can add variable in meteor? just adding argument gives back: "--variable: unknown option" without argument error "failed install plugin:error: variable missing.." another way clone project, upload github-account , put in variables hand. meteor add cordova:pluginname@ https://github.com/myname/prjname/tarball/sha-id here error "must declare exact version of dependency". how shoud i? meteor add cordova:pluginname@x.y.z@ https://github.com/myname/prjname/tarball/sha-id doesn't work either? or can 1 add plugin meteor project manually, meaning adding sourcefiles .meteor-directory? any appreciated.

vba - Programatically assign a macro to a combobox in excel -

i've written macro obtain table combobox beside it. when user changes value of combobox value should populated in table cell the macro i've written: sub proc1() cells(2, 1).value = "mat10" cells(2, 2).value = "material id (mid)" cells(2, 3).value = "bulk modulus(b)" cells(2, 4).value = "average density (rho)" cells(2, 5).value = "speed of sound (c)" activesheet.listobjects.add(xlsrcrange, range("$a$2:$e$2"), , xlyes).name = "tab2" 'no go in 2003 activesheet.listobjects("tab2").tablestyle = "tablestylelight2" range("b3:b3") set comb = activesheet.dropdowns.add(.left, .top, .width, .height) end comb .additem "75000000" .additem "75000001" .additem "75000002" .additem "75000003" .additem "75000004" end end sub now when user changes value o

javascript - Copy row doesn't work other ajax function -

i create copy row jquery append function , use add , remove button , there jquery mask phone input inside first row of table. phone mask working first row not working copy row. $(document).ready(function(){ var cnt = 2; $(".addcf").click(function(){ $("#customfields").append('<tr><td><input type="text" name="adsoyad[]" style="width:130px"/></td><td><input type="text" name="gorevi[]" style="width:130px"/></td><td><input type="text" id="phone" name="telefon[]" style="width:130px"/></td><td><input type="text" name="dahili[]" style="width:70px"/></td> <td><input type="email" name="eposta[]" style="width:190px"/></td><td><a href="javascript:void(0);" class="remc

OpenCL template on Visual Studio and how to write code on it -

Image
my laptop hardware information : os: windows 7 professional service pack 1 cpu: intel(r) core(tm) i7-3540m cpu @ 3.00 ghz ram: 16,0 gb graphics: intel(r) hd graphics 4000 visual studio 2012. my question if correct icon image opencl template or missing on installation process. asking whether work writing code or package should reinstalled fix , see opencl icon "cl" on visual studio. thanks help! here screen shots: the way followed included correct steps complete installation. first program tried has worked supposed work.

unix - How To Run Multiple "awk" commands: -

would run multiple "awk" commands in single script .. example master.csv.gz located @ /cygdrive/e/test/master.csv.gz , input files located in different sub directories /cygdrive/f/jan/input_jan.csv.gz & /cygdrive/f/feb/input_feb.csv.gz , on .. input files *.gz extension files. below commands working fine while executing command 1 one: command#1 awk ' begin {fs = ofs = ","} fnr==nr {a[$2] = $0; next} ($2 in a) {print $0}' <(gzip -dc /cygdrive/e/test/master.csv.gz) <(gzip -dc /cygdrive/f/jan/input_jan.csv.gz) >>output.txt output#1: name,age,location abc,20,xxx command#2 awk ' begin {fs = ofs = ","} fnr==nr {a[$2] = $0; next} ($2 in a) {print $0}' <(gzip -dc /cygdrive/e/test/master.csv.gz) <(gzip -dc /cygdrive/f/feb/input_feb.csv.gz) >>output.txt output#2: name,age,location def,40,yyy cat output.txt name,age,location abc,20,xxx def,40,yyy have tried below commands run in via single sc

Camel - How I can define a errorHandler and can use includeRoutes? -

i define routes in subclasses , them in 1 routebuilder includeroutes() . want insert default errorhandler error message: errorhandler must defined before routes in routebuilder this code: public class defaultroutes extends routebuilder { public void configure() throws exception { errorhandler(deadletterchannel("direct:deadletter").maximumredeliveries(3)); from("direct:deadletter").id("deadletter") .errorhandler(defaulterrorhandler().disableredelivery()) .log("${exception.stacktrace}") .setheader("errormessage",simple("${exception}",string.class)) .setheader("errorstacktrace",simple("${exception.stacktrace}",string.class)) .to("activemqwithouttransactions:errors"); ... ... for(string module: globalconfig.getloadedmodules()) { ... includeroutes(routes);

sql server 2012 - SQL query to select records which must have all values from another table as substring -

i have table this rules (rulevalue varchar(50)) it has values a1b1c1 a1b1c0 a1b0c0 there table input (rulepart varchar(2)) it can have values like: a1 b1 c1 i want rulevalues rulepart matches anywhere in rulevalue following example hardcoded ruleparts: select rulevalue rules rules.rulevalue '%a1%' , rules.rulevalue '%b1%' , rules.rulevalue '%c1%' with above examples expected result a1b1c1 or b1a1c1 or c1a1b1 etc.. how can this? i tried use inner join not matches rule parts in every row. i can achive using creating query dynamically don't want go unless affects query performance. one approach is: select r.rulevalue rules r join input on r.rulevalue '%' + i.rulepart + '%' group r.rulevalue having count(distinct i.rulepart) = 3 -- or (select count(*) input ) update more elegant way using not exists represent all select * rules r not exists ( select * input

java - two transaction issue with Hibernate 3 -

in our application using hibernate 3. faced 1 issue in transactions. have code in following manner method1() try{ tx = session.begintransaction(); //new object needs stored session.save(object); // code generates exception tx.commit(); // exception occured before commit processing }catch(exception ex){ e.printstacktrace(); throw e; }finally{ if(tx!=null && tx.wasnotcommited()){ tx.rollback(); } } i have method same this, called after method in case of exception thrown method. session same across both of method. now experiencing if 2nd method executes , commits hibernate transaction, stores data has been saved in 1st method don't want. i can not share exact code, prepared 1 test method similar issue. database server mysql. package com.opshub.jobs.core; import org.hibernate.session; import org.hibernate.transaction; import com.opshub.dao.core.company; import com.opshub.utils.hibernate.hibernatesessi

Google Analytis for visitors -

i woudlike show visitors stats google analytics. in articles found must login before analytics data, yes it's ok, display stats visitors, when havn't google account. how this? maybe api key? you should consider using service account , fetching data site once day. able display data users. reason suggest store data data never change , there (quota) limited number of requests can make each day. if tell language planing in may able tutorials.

Credit / Debit Payment without Payment Gateway -

i developing shopping app. but, credit/debit card payment, i don't want use payment gateway such stripe & authorize.net. possible make payment without gateways . or necessary use gateway? a payment gateway proxy payment processor , works directly acquiring bank access card networks. payment gateways typically offer value added services compared processors, such recurring payments, support, etc. going directly processor possible if don't need these features, although integration can bit more challenging. example, if provide terminal capture, need close , submit transaction batches on daily basis. failure result in higher interchange fees. nowadays, cost of integrating advanced payment gateway (with pass-through pricing, unlike stripe) vs processor comparable, , processors start provide gateway-like apis. first data instance has e4 (gateway api) , compass (processor api).

java - Modification of a private class attribute only with getter -

i read article: combination of getter , list modification in java and wonder if modification on types of class attributes possible access via getter. tried integer object public class someclass { private integer someinteger = 9; public integer getsomeinteger() { return someinteger; // id = 18, value = 9 } } now try modify someinteger in class: someclass someclass = new someclass(); integer someinteger = someclass.getsomeinteger(); // id = 18, value = 9 someinteger += 1; // id = 26, value = 10 integer anotherinteger = someclass.getsomeinteger(); // id = 18, value = 9 with debugger inspect object id. in calling class someinteger first has same id in getter. after adding 1, someinteger new id , original class attribute not edited. okay try adding number failed, there possibility modify object? i asked me difference between linked example list , example integer. idea is, s

Azure webdeployment I/O Error create directory wwwroot -

since morning our azure website went down (http 500 page cannot displayed because internal server error has occurred.) i cannot redeploy azure website due i/o error , cannot access websites log files. there nothing on visual studio project or azure website configuration. anyone encountered same problem , has solution that? webdeploy output: 2>start web deploy publish application/package https://xxx.scm.azurewebsites.net/msdeploy.axd?site=xxx ... 2>sitemanifest (sitemanifest) wird hinzugefügt. 2>der virtuelle pfad (xxx) wird hinzugefügt. 2>das verzeichnis (xxx) wird hinzugefügt. 2>c:\program files (x86)\msbuild\microsoft\visualstudio\v11.0\web\microsoft.web.publishing.targets(4269,5): error : web deployment task failed. ((19.11.2014 11:22:15) error occurred when request processed on remote computer.) 2> 2>(19.11.2014 11:22:15) error occurred when request processed on remote computer. 2>fehler bei der verarbeitung des vorgangs "verzeichnis erstel

java - TreeSet Comparator -

i have treeset , custom comparator. values server according changes in stock ex: if time=0 server send entries on stock (unsorted) if time=200 server send entries added or deleted after time 200(unsorted) in client side sorting entries. question more efficient 1> fetch entries first , call addall method or 2> add 1 one there can millions of entries. /////////updated/////////////////////////////////// private static map<integer, keywordinfo> hashmap = new hashmap<integer, keywordinfo>(); private static set<integer> sortedset = new treeset<integer>(comparator); private static final comparator<integer> comparator = new comparator<integer>() { public int compare(integer o1, integer o2) { int integercomparevalue = o1.compareto(o2); if (integercomparevalue == 0) return integercomparevalue; keywordinfo k1 = hashmap.get(o1); keywordinfo k2 = hashmap.get(o2); if (nul

c# - Is it possible to create a 6400 byte integer? -

i have function can't alter because of protection , abstraction, , declared this: getdevicelonginfo(int, int, ref int); in "ref int" argument passed said give 6400 bytes of information. my question is, how can information in variable if choice have give function int32 ? can allocate more memory int32 ? possible achieve in way? edit: can tell function uses ref int dump values in it, int size (size of information) not fixed, depends on option chosed in second parameter. can't @ function see how uses ref. you can allocate int[] , pass function. hack don't see why should not safe. var array = new int[6400 / sizeof(int)]; getdevice(..., ref array[0]); the array pinned clr duration of call. note, ref called managed pointer clr. marshaled passing pointer , pinning object points to. int[] passed in same way (a pointer first element passed).

javascript - Angularjs ui-grid change row background color -

i have code in plunker cant make work : plunker var app = angular.module('app', ['nganimate', 'ui.grid']); app.controller('mainctrl', ['$scope', '$http', function ($scope, $http) { $scope.mydata = [{sv_name: "moroni", sv_code: 50,count:0}, {sv_name: "tiancum", sv_code: 43,count:1}, {sv_name: "jacob", sv_code: 27,count:0}, {sv_name: "nephi", sv_code: 29,count:7}, {sv_name: "enos", sv_code: 34,count:0}]; $scope.getbkgcolortable = function (savestatus) { switch (savestatus) { case -1: return ""; break; case 0: return "#dff0d8"; break; default:// 0 , -1, alerts return "#f2dede";

Using big numbers in Perl -

i have scenario take 2 big binary strings (having 100 characters) , need add them. the issue getting answer in form 2.000xxxxxxxxxxe+2, whereas need precise answer, 100 character long string. chomp($str1=<stdin>); chomp($str2=<stdin>); print "str 1 $str1\n"; print "str 2 $str2\n"; $t = $str1 + $str2; print "sum $t\n"; sample input 1001101111101011011100101100100110111011111011000100111100111110111101011011011100111001100011111010 1001101111101011011100101100100110111011111011000100111100111110111101011011011100111001100011111010 sample output str1 1001101111101011011100101100100110111011111011000100111100111110111101011011011100111001100011111010 str2 1001101111101011011100101100100110111011111011000100111100111110111101011011011100111001100011111010 sum 2.0022022220202e+099 as suggested, can use math::bigint core module, use math::bigint; # chomp($str1=<stdin>); # chomp($str2=<stdin>)

plot - Nested layouts in R -

Image
i want make plot consisting of multiple plots consisting of multiple plots, 5x2 grid 3 plots in each cell. more precise, need not 1 figure finding way of using plotting function multiple times in single plot. i have written function uses layout stack plots, common axis in outer margin. need seqiplot , seqdplot functions traminer package, far understand problem not related those, here minimal working example barplot. stackedplot <- function(data){ layout(matrix(c(1:3), nrow=3)) par(mar=c(0,0,0,0), oma=c(4,1,1,1), mgp=c(3,0.5,0), cex=1) barplot(data[[1]], axes=f, xlab="", ylab="", horiz=true) barplot(data[[2]], axes=f, xlab="", ylab="", horiz=true) barplot(data[[3]], axes=f, xlab="", ylab="", horiz=true) axis(1, at=c(0:10)/10, outer=true) mtext("label", line=2, side=1) } stackedplot(list(1:10, 10:1, rep(1,10))) what use layout again , use stackedplot grids of layout, i.e. (which,

node.js - NPM permission error while installing -

i trying install yeoman on server reason keep getting permission denied error. $npm install -g yo /root/.node/bin/yo -> /root/.node/lib/node_modules/yo/cli.js > yo@1.3.3 postinstall /root/.node/lib/node_modules/yo > yodoctor sh: 1: yodoctor: permission denied npm err! yo@1.3.3 postinstall: `yodoctor` npm err! exit status 127 npm err! npm err! failed @ yo@1.3.3 postinstall script. npm err! problem yo package, npm err! not npm itself. npm err! tell author fails on system: npm err! yodoctor npm err! can info via: npm err! npm owner ls yo npm err! there additional logging output above. npm err! system linux 3.13.0-37-generic npm err! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "yo" npm err! cwd /root npm err! node -v v0.10.33 npm err! npm -v 1.4.28 npm err! code elifecycle npm err! not ok code 0 i have tried reinstall ubuntu (14.04) nothing works. i think shantaru right, need sudo. try this

c# - Unsure how I can mock an INancyModule.View method? -

Image
i'm trying mock inancymodule.view method. here's code (with intellisense) if compile this, following error compile time error: an expression may not contain dynamic operation notice intellisense? it's asking dynamic model. i'm trying pass in, it's not working. secondly, i'm trying return viewrenderer i'm not sure if setup correctly either. so - how can create mock inancymodule.view property, please? update also, trying replace dynamic object has following designer error... (please open image in tab read error message). unfortunately not possible (with v0.23.2) , require changes nancy in order achieve mocking of view mock returned rather implementation.

php - Google Glass Mirror Service: list timeline items and paging -

i'm trying paginate timeline items can returned in mirror service (i'm using php quickstart example can found here ) from google_mirrorservice.php file, can read: /** * retrieves list of timeline items authenticated user. * (timeline.list) * * @param array $optparams optional parameters. * * @opt_param string bundleid if provided, items given bundleid returned. * @opt_param bool includedeleted if true, tombstone records deleted items returned. * @opt_param string maxresults maximum number of items include in response, used paging. * @opt_param string orderby controls order in timeline items returned. * @opt_param string pagetoken token page of results return. * @opt_param bool pinnedonly if true, pinned items returned. * @opt_param string sourceitemid if provided, items given sourceitemid returned. * @return google_timelinelistresponse */ public function listtimeline($optparams = array()) { $params = array(); $params = array_merge($params, $optparams

asp.net - Is SessionSecurityToken lifeTime the same as sessionTokenRequirement lifetime? -

i'm migrating forms authentication in webforms across microsoft identity. when creating sessionsecuritytoken using claimsprincipal cp object, have code: dim token new sessionsecuritytoken(cp, timespan.fromminutes(30)) however, in web.config see this: <configsections> <section name="system.identitymodel" type="system.identitymodel.configuration.systemidentitymodelsection, system.identitymodel, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" /> <section name="system.identitymodel.services" type="system.identitymodel.services.configuration.systemidentitymodelservicessection, system.identitymodel.services, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" /> </configsections> <system.identitymodel> <identityconfiguration> <securitytokenhandlers> <add type="system.identitymodel.tokens.sessionsecuritytokenhandler, sys

c# - Can [DllImport()] handle static c libraries -

can import static c library .lib extension. i have header files with: extern "c" __declspec(dllexport) i can generate necessary code p/invoke assistant header source code, question remains, can [dllimport()] handle compiled c/c++ lib files ? dllimport works referencing entry defined in module's (.dll) exports table. .lib files not modules nor have exports table per .dlls. from msdn: the dllimportattribute attribute provides information needed call function exported unmanaged dll. minimum requirement, must supply name of dll containing entry point. - tell me more your question of: can [dllimport()] handle static c libraries ? no. but can link .lib .dll (assuming know c/c++) , p-invoke resulting dll indirect solution , not imply "yes" question.

jquery - Make custom/call skitter slideshow navigation -

for of worked skitter slideshow, it's great plugin want make custom next/prev buttons , place them outside of .box_skitter container , call skitter navigation function. i tried creating following: // custom navigation enable_custom_navigation: true, if (self.settings.enable_custom_navigation) { self.enablecustomnavigation(); } enablecustomnavigation: function() { var self = this; $('#custom_next, #prev_button').click(function () { // next if (this.id == 'custom_next') { self.box_skitter.find('.next_button').trigger('click'); } // prev else if (this.id == 'custom_prev') { self.box_skitter.find('.prev_button').trigger('click'); } }); }, well, moment solution create next button , when clicked simulate click on predefined skitter .next_button, so: $(document).on('click', '.next', function(event) { event.preventdefault(); $(".box_skitter .next_button").click(); });

Iron Router / Meteor : Except not working -

i trying login process work. basically, routes should redirected "/login" if user not logged in. except "/signup" , "/reset", because wont logged in if go there. router.configure({ layouttemplate: 'layout' }); router.onbeforeaction(function () { except: ['signup','reset'] if (!meteor.userid()) { // if user not logged in, render login template this.render('login'); } else { this.next(); } }); router.route('/', function (){ this.render('app-main-page'); }); router.route('/signup', function () { this.render('signup');}, { name:'signup' }); router.route('/reset', function () { this.render('reset');}, { name:'reset' }); // , bunch of more routes within app }); in general onbeforeaction working, when not logged in login template rendered. however, "except" part not working, means users cannot

How do I start using Gitlab-CI in Gitlab Omnibus edition? -

i have installed gitlab omnibus gitlab-7.4.3_omnibus.5.1.0.ci-1.el6.x86_64.rpm on centos 6.6. have few projects created , working fine try using continuous integration features. don't know start , documentation/tutorials thin on ground. have found following files not appear in older gitlab omnibus install have: /usr/bin/gitlab-ci-rake /usr/bin/gitlab-ci-rails i presume need these? need configuration file first? in projects (settings > services > gitlab ci) can see there options active, token , project url not know put in these fields. me started on ci appreciated. cheers,jonny we installed omnibus gitlab 7.6.2 release has gitlab ci 5.3 built in. had same question. here's how got working. we're using single secured server on https; single ip both gitlab , gitalb-ci hosts. have dns entries both host names single ip. (done alias ci server think). have 2 ssl certificates 1 each hostname. we have following lines @ top of /etc/gitlab/gitlab.rb script

java - Maven multi-project library dependency -

i have enterprise project (*.ear), packaged maven. ear file have include many files: final.ear |-lib |-meta-inf |--web.war |--bla-bla.jar |--web-bla.war each file (jar, war) packaged maven. 1) how put required libraries files (war, jar) final.ear/lib? 2) how group libraries /lib, example: lib/axis, lib/logging? using maven ear plugin - skinny wars feature has worked me problem.

git - I've renamed directory, commited it and i cant do a push -

sorry, question can bit noob dont have experience git. i've renamed directory "build" "build1", comited changes , cant push, got message: counting objects: 11, done. delta compression using 4 threads. compressing objects: 100% (6/6), done. writing objects: 100% (6/6), 514 bytes | 0 bytes/s, done. total 6 (delta 4), reused 0 (delta 0) remote: /git/rololo remote: 8432750..b53923c master -> origin/master remote: error: local changes following files overwritten merge: remote: build/build.html remote: build/build.unity3d remote: please, commit changes or stash them before can merge. remote: aborting remote: updating 1d2fa90..b53923c what should perform push? you can several things @ point. 1. stash changes -> update branch -> pop stashed changes stash changes by: git stash save <message> then pull git pull origin master and pop stashed changes git stash pop <stash> or 2. commit cha

sqlite - Rails Migration: Determine what is being used as database -

i trying set autoincrement value sqlite database using. in future, switching postgresql because deploying heroku , want postgresql local development. until then, i'm using sqlite. there way can write migration such knows database provider i'm using can have 2 separate execute statements set autoincement ? try calling connection.adapter_name in migration. should return either: "postgresql" or "sqlite".

python skipping '\n' in the replace method -

the below json,this read data-> [ { "name": "abc", "state": "ma", "statements": [ "set x=abc", "use @{domain}", "create table def" ], "parameters": [ {"name": "domanin", "required": true, "description": "this domain name"} ] } ] ======================================================================================= import re; import sys; import json; loc_file=str(sys.argv[1]) ; open_json=open(loc_file); data=json.load(open_json); list1=data[0].get('statements'); json_input_string=""; json_input_string=str(list1); json_input_string=json_input_string.replace(r"text ' ' followed text",r"text '\n'"); # replace works fine replace below fails '\n' f = open("text.txt","w"); m="" c i

internationalization - Liferay - How to i18n model-resources? -

how can translate custom model-resources? given following default.xml : <model-resource> <model-name>de.foo.db.model.foobar</model-name> <portlet-ref> <portlet-name>myportlet</portlet-name> </portlet-ref> <permissions> <supports> <action-key>decline_owner</action-key> <action-key>decline_department</action-key> </supports> <site-member-defaults/> <guest-defaults/> <guest-unsupported> <action-key>decline_owner</action-key> <action-key>decline_department</action-key> </guest-unsupported> <owner-defaults/> </permissions> </model-resource> when want define these permissions role control-panel-> roles-> myrole-> define permissions listed as: model.resource.de.foo.db.model.foobar:action.decline

toolbar - Google+ ios like drop down from action bar in android -

Image
i implement drop down menu toolbar in ios version of google+: but as beginner in android development, don't know component should use, can me ? those question you've mentioned in comments true: should not implement exact copy of ios navigation in android. if choose develop app android better make android app (because users expect). however, not imply android lacks of similar navigation pattern. looking actionbar dropdown navigation , can found on this official docs . link should enough started. :)

hibernate - spring form validation : Unable to print errors in jsp -

i working on spring mvc application, here have form user can change password, here validating form using spring form validation implements "org.springframework.validation.validator" class. please @ code snippets. <%@ taglib uri="http://www.springframework.strong textorg/tags/form" prefix="spring"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title> chang

android - GLSL Circle gets eliptical on Rendering on screen? -

i trying render circle on mobile uisng farment shader. followed this got best answer . vertex shader: attribute vec4 position; attribute vec4 inputtexturecoordinate; varying vec2 texturecoordinate; void main() { gl_position = position; texturecoordinate = inputtexturecoordinate.xy; } fragment shader: varying highp vec2 texturecoordinate; const highp vec2 center = vec2(0.5, 0.5); const highp float radius = 0.5; void main() { highp float distancefromcenter = distance(center, texturecoordinate); lowp float checkforpresencewithincircle = step(distancefromcenter, radius); gl_fragcolor = vec4(1.0, 0.0, 0.0, 1.0) * checkforpresencewithincircle; } attribute vec4 position; passed -1 +1 , attribute vec4 inputtexturecoordinate; passed 0 1. but while rendering ellipse on mobile screen? think might because of screen aspect ratio. how render perfect circle on screen? i think might because of screen aspect ratio. yes, proble

database - iOS app - data across devices -

i'm new ios app development, , planning developing app require devices use data across multiple devices , stored centrally. typically use database such mysql (this store data currently) understand there isn't native support in ios development (is correct) what best way me store data centrally , make accessible multiple ios devices. james there lot of different approaches , depending on kind of data , kinds of devices want target. suggest using coredata local data , using parse.com backend. app push/pull data parse sync data.

ios - UICollectionView for custom, grid-like view -

i need specific collection view app i'm working on , wonder whether uicollectionview custom uicollectionviewlayout task. here's functionality sums i'm trying achieve: i need grid layout doesn't wrap/flow when symbols added. instead rows/columns added automatically hold newly added symbols. the user should able drag'n'drop symbols on grid , symbol drops 'magnetically' position in grid. rows , columns can added or removed to/from grid. when symbol dropped between 2 other symbols grid should automatically insert new column it. the grid needs performant , fluid, can comfortably navigated (i dimly remember custom uicollectionview solutions acted spreadsheet grid overkill need). i'm not familiar programming custom uicollectionviewlayouts yet (getting matter now). i'd ask if uicollectionview fits bill above requirements or whether it's better custom? hints , tips appreciated!

How to create instance of struct in Objective-C that was defined in C file -

in xcode have c classes contains following definition: typedef struct { double x; double y; double z; coordunit unit; } yg #define ygmeterpoint(x,y,z) __ygpointwithunit(x,y,z,meter) this used follows in c: //declares origin point , translated point ygpoint point = ygmeterpoint(994272.661,113467.422); //converts point in lambert zone 1 wgs84 point = ygpointconvertwgs84(point,lambert_i) //convert degree point = ygpointtodegree(point); printf("lat:%.9f - lon:%.9f",point.y,point.x); but call using objecive-c in xcode. how that? like @martin r said, can't see why need/want this article explains how it. @ example 2.

regex - find specific string pattern in text using regular expression in java -

i need find regular expression use argument in string.matches . have text of strings separated space " " , want find type of number it. first of need check pattern this: "[number] e [number] & [number]" . & symbol in string, e . // *word* string tested if (word.matches("\d++ e *\d++ & \d++")) *something that* for example "1001Ε101&2" true , "0114&2" false. so need regular expression in word.matches(" *answer* "); it's project in lexical analysis. must not use ready lexers. your regex right. use way: pattern.matches("\\d++ *e *\\d++ *& *\\d++", word); with word string check. don't forget use double \ in regex string put simple \ .

javascript - Data insertion into database after clicking onto button -

i insert data database using laravel eloquent after pressing button. my controller, controller method, route, js files ready. i don't know how connect these together. should fire event after clicking button, if yes how can using blade ? i have main page , form this. this main page : {{ form::open(array('action'=>'mycontroller@mymethod')) }} <!--some html here !--> <div class="row form-group"> <div class="col-sm-4"> <div class="btn btn-success" id="add" onclick=""> here button </div> </div> </div> {{ form::close() }} i need insert data after clicking button. how can ? said routes controller , function ready this. thanks in advance. since have form set up, have add submit button , go mycontroller@mymethod when submit button called on. // submit button {{ form::submit('submit') }} then in mymeth

asp.net - How to set width and background color of the cell while exporting to excel with multiple sheets in using ExcelHelper class -

i create multiple sheets in excel file not format cells giving proper width columns i need display generated excel like:- column1 column2 dataaaaaaaaaaaaaaaaiaaaaaaa 4 data data ggghjkkllil aaaaaddfdfffgggggggggggggg 5 column1 , column2 should centrally aligned while column column1 , column2 data should wrapper text blue color background this requires columns give proper width , text should wrapper text.unfortunately unable give proper styles.and want apply background color cell.for background color using sb.appendformat(@" <interior ss:color=""#2e2efe""/>{0}", environment.newline); but nt working. here giving code. stringbuilder sb = new stringbuilder(818); sb.appendformat(@"<?xml version=""1.0""?>{0}", environment.newline); sb.appendformat(@"<?mso-application progid=&q

sitecore6 - Stop Sitecore from including <p> and &nbsp in rich text editor -

i want text , hyperlinks, , not <p> tags. have had issue when putting in list, , each <li> gets &nbsp put in front of being recognized new paragraph. is there way stop rich text editor adding these in? the sitecore rich text editor configurable in variety of ways. internally it's instance of telerik rad editor. hence can apply many of same configuration strategies documented on telerik's site it. a while wrote blog post how can stop editor form messing html: http://jermdavis.wordpress.com/2014/04/06/ever-wished-the-rich-text-field-didnt-mess-with-your-html/ while that's not addressing exact issue, general strategy there configuring internal behaviour of editor can used meet requirements. underlying editor has series of filtering behaviours can enable , disable requirements. "fixenclosingp" , "convertcharacterstoentities" options might of here? they're documented on telerik's website: http://www.telerik.co

encryption - Exporting/Import Encrypted Code Java -

i trying export encoded text txt file. somewhere in export , import goes wrong. during same application can export , import fine. encode , decode. when close application , run again import encoded text, input changes wasn't, , throws off decryption. i believe may have cipher being randomly generated every time application run. not know how fix it. warning. application vary big. i'm sorry that. package crypt; import java.awt.borderlayout; import java.awt.flowlayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.io.file; import java.io.filenotfoundexception; import java.io.printwriter; import java.io.unsupportedencodingexception; import java.security.invalidkeyexception; import java.security.key; import java.security.nosuchalgorithmexception; import java.security.securerandom; import java.util.scanner; import javax.crypto.badpaddingexception; import javax.crypto.cipher; import javax.crypto.illegalblocksizeexception; import java

backbone.js - Change event do not catch option chosen selected, Backbone -

having following view: someview = backbone.view.extend({ events : { 'change #selectid' : 'checkselect' }, checkselect : function(e) { console.log(e); } }); i wonder if possible selected option select tag, considering select rendered data injected collection. any help? you can value of select $(e.target).val() in: var myview = backbone.view.extend({ events : { 'change #selectid' : 'checkselect' }, checkselect : function(e) { var selectvalue = $(e.target).val(); console.log(selectvalue); } }); check this fiddle

c# - Parse the received message from the server -

the problem i'm having parsing bytes i'm reading through server client's interface , show them message received. the general idea send message, message goes server , send message clients connected chatroom. but happens when enter chat room message appears ">>ignusername" mark new user has entered chat. and when try send message such "hello" server receives messages correctly when it's time send message users appears on screen ">>ignusername". original message. i'm not sure faulty extract of code fix issue i'm having. conn.server.beginreceive(dat, 0, 1024, socketflags.none, new asynccallback(recibiendof), so); if (//something has been received) { mensajenuevo = msjerecibidof(dat); } this callback public void recibiendof(iasyncresult ar) { try { stateobject = (stateobject)ar.asyncstate; conn.server = so.worksocket; int bytesread = conn.server.endreceive(ar); if

asp.net - SignalR makes IIS hang after rebuild -

windows 8.1. iis 8.5. signalr versions: <package id="microsoft.aspnet.signalr" version="2.1.2" targetframework="net451" /> <package id="microsoft.aspnet.signalr.core" version="2.1.2" targetframework="net451" /> <package id="microsoft.aspnet.signalr.js" version="2.1.2" targetframework="net451" /> <package id="microsoft.aspnet.signalr.systemweb" version="2.1.2" targetframework="net451" /> whenever rebuild project/solution, iis spikes max cpu usage , cannot reload page. checked procmon.exe , reports enormous amount (>20 000/s) of "regopenkey/regquerykey" operations these ones: date & time: 19.11.2014 10:47:20 event class: registry operation: regquerykey result: success path: hklm tid: 23272 duration: 0.0000059 query: handletags handletags: 0x0 date & time: 19.11.2014 10:47:20 event class: regist

c# - How can I get the last folder from a path string? -

i have directory looks this: c:\users\me\projects\ in application, append path given project name: c:\users\me\projects\myproject after, want able pass method. inside method use project name. best way parse path string last folder name? i know work-around pass path , project name function, hoping limit 1 parameter. you can do: string dirname = new directoryinfo(@"c:\users\me\projects\myproject\").name; or use path.getfilename (with bit of hack) : string dirname2 = path.getfilename( @"c:\users\me\projects\myproject".trimend(path.directoryseparatorchar)); path.getfilename returns file name path, if path terminating \ return empty string, why have used trimend(path.directoryseparatorchar)