Posts

Showing posts from May, 2014

python rq - How to clear Django RQ jobs from a queue? -

i feel bit stupid asking, doesn't appear in documentation rq . have 'failed' queue thousands of items in , want clear using django admin interface. admin interface lists them , allows me delete , re-queue them individually can't believe have dive django shell in bulk. what have missed? the queue class has empty() method can accessed like: import django_rq q = django_rq.get_failed_queue() q.empty() however, in tests, cleared failed list key in redis, not job keys itself. thousands of jobs still occupy redis memory. prevent happening, must remove jobs individually: import django_rq q = django_rq.get_failed_queue() while true: job = q.dequeue() if not job: break job.delete() # delete key redis as having button in admin interface, you'd have change django-rq/templates/django-rq/jobs.html template, extends admin/base_site.html , , doesn't seem give room customizing.

Memory management scenario with MongoDB & Node.JS -

i'm implementing medium scale marketing e-commerce affiliation site, has following estimates, total size of data: 5 - 10 gb indexes on data: 1 gb approx (which wanted in memory) disk size (fast i/o): 20-25 gb memory: 2 gb app development: node.js working set estimation of query: average 1-2 kb, maximum 20-30 kb of text base article i'm trying understand whether mongodb right choice database or not. index going downsize of memory have noticed after querying mongodb, has occupied memory (size of result set) caching query. in 8 hours i'm expecting queries' depth cover 95% of data, in scenario how mongodb manage limited memory scenario app instance of node.js running on same server. would mongodb right choice scenario or should go other json based no-sql databases.

XML dynamic validation with Java -

infrastructure: i'm using java 1.5 , mandatory. can load external lib no problem. problem: i have xml file recived via "an external channel" , can use inputstream if need same, use: inputstream = new fileinputstream(file); i need validate xml against xsd has neasted xsd <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:body="urn:cbi:xsd:cbibdysddreq.00.00.06" xmlns:htrt="urn:cbi:xsd:cbihdrtrt.001.07" xmlns:he2e="urn:cbi:xsd:cbihdrsrv.001.07" xmlns:sgnt="urn:cbi:xsd:cbisgninf.001.04" xmlns:lmsg="urn:cbi:xsd:cbisddreqlogmsg.00.00.06" xmlns="urn:cbi:xsd:cbisddreqphymsg.00.00.06" targetnamespace="urn:cbi:xsd:cbisddreqphymsg.00.00.06" elementformdefault="qualified"> <xs:import namespace="

linq - OrderBy multiple properties in Razor and Umbraco 4.11.8 -

during update of our website umbraco, upgraded 4.7.2 4.11.8. in cshtml-file had code: foreach(var item in model.ancestororself("master") .items.first() .publicationfolder.first() .children.where("visible") .orderby("publicationtype, date desc")) it worked fine , sorted collection first publicationtype , newest date . in new version (4.11.8) doesn't work anymore. gives me exception: at least 1 object must implement icomparable. and if write .orderby("publicationtype", "date desc") , doesn't affect collection. so bug or doing wrong? there workaround? i found solution need cast collection list<dynamicnode> works. foreach (var item in ((list<dynamicnode>)@model.ancestororself("master") .items.first() .publicationfolder.first() .children.where("visible").items)

xslt 1.0 - Sorting from multiple nodes by alphanumeric format -

<?xml version="1.0" encoding="utf-8"?> <accountlist> <previousaccount> <account> <lastname>nash</lastname> <accountstatus>removed</accountstatus> <accno>8d</accno> </account> <account> <lastname>adoga</lastname> <accountstatus>removed</accountstatus> <accno>8a</accno> </account> <account> <lastname>lucas</lastname> <accountstatus>hold</accountstatus> <accno>9a</accno> </account> <account> <lastname>donald</lastname> <accountstatus>hold</accountstatus> <accno>10d</accno> </account> <account> <accountstatus>hol

mongodb - Retrieving document from collection by id -

my object have in collection: type room struct { id bson.objectid `json:"id" bson:"_id"` name string `json:"name" bson:"name"` } inserting collection: room = &room{id: bson.newobjectid(), name: "test"} roomcollection.insert(room) retrieving collection (any): roomx := &room{} if err := roomcollection.find(bson.m{}).one(roomx); err != nil { panic(err) } fmt.printf("roomx %s:\n%+v\n\n", roomx.id, roomx) this outputs: roomx objectidhex("52024f457a7ea6334d000001"): &{id:objectidhex("52024f457a7ea6334d000001") name:test} retrieving collection (by id): roomz := &room{} if err := roomcollection.find(bson.m{"_id": room.id}).one(roomz); err != nil { panic(err) // throws "not found" } this throws "not found" , can't figure out why. the different key-value tags fi

visual studio - Using c# property DHCPLeaseLifetime -

i looking way find out , use how lifetime left in dhcp lease , ms has documentation here, guess not sure how use property. haven't been able find much. here's link you might want consider the msdn example . illustrates how lease lifetime. the (condensed) version of example future reference: each adapter in net.networkinformation.networkinterface.getallnetworkinterfaces() each uni in adapter.getipproperties().unicastaddresses console.writeline(" unicast address ......................... : {0}", uni.address) console.writeline(" dhcp leased life time ................ : {0}", uni.dhcpleaselifetime) next uni next adapter

r - adding labels to 2D scatter plot (kmeans clustering) -

Image
i calculated pca on samples of dataset , retained first 2 components vectors .i calculated k-means clustering on these first 2 components k=3. need plot 2d scatter plot first 2 eigenfunctions (from pca) , color based on cluster group. accomplished scatter plot when @ plot cannot differentiate samples clustered want add sample labels points in scatter plot. can suggest me how go this? tdata<-t(subdata) pca <- prcomp((tdata),cor=f) dat.loadings <-pca$x[,1:2] cl <- kmeans(dat.loadings, centers=3) pca1 <-pca$x[,1] pca2 <-pca$x[,2] plot(pca1, pca2,xlab="pca-1",ylab="pca-2",col=cl$cluster) thank you this can done using ggplot. use mtcars data since don't have access dataset using. idea should pretty clear anyway. library(ggplot2) pca <- prcomp((mtcars),cor=f) dat.loadings <-pca$x[,1:2] cl <- kmeans(dat.loadings, centers=3) pca1 <-pca$x[,1] pca2 <-pca$x[,2] #plot(pca1, pca2,xlab="pca-1",ylab="pca-2"

templates - Reuse form in actions "New" and "Edit" -

i have actions "new" , "edit". want reuse same template in both actions. problem is, when i'm creating new entity, want show "new entity" in page title. when i'm editing entity want "editing entity title". i pass variable in each action indicating action don't feel right doing ... there way detect if it's creation or edition in twig? how solve common issue? you can pass entity view , create variable in twig {% set isnew = not entity.id > 0 %} easy? if want pass form view can entity directly form {% set entity = form.get('value') %}

c# - Observing NotifyPropertyChanged and responding to it -

i have collection of field objects , each field object implements inotifypropertychanged . field object has various properties inside it, have 1 property called isapproved need listen changes. interest if boolean flag set or unset, need notified or need respond event(the property set or unset ui via wpf binding). can use reactive extensions this, or overkill? if not recommend? code: public class field : inotifypropertychanged { private bool _isapproved; public bool isapproved { { return _isapproved; } set { if (_isapproved == value) return; _isapproved = value; raisepropertychanged(() => isapproved); } } ///has lots of other properties. } in viewmodel, have collection of field s, , need observe on see when isapproved property set or unset on or of them. how can that? edit: have fields collection an observable collection, boun

clojure: how to get values from lazy seq? -

iam new clojure , need value out of lazy sequence. you can have @ full data structure here: http://pastebin.com/ynljalap need content of title: {: _content albumtitel2} i managed list of _content values: (def albumtitle (map #(str (get % :title)) photosets)) (println albumtitle) and result is: ({:_content albumtitel2} {:_content test} {:_content albumtitel} {:_content album123} {:_content speciale} {:_content neues b5 album} {:_content album nr 2}) but how can value of every :_content? any appreciated! thanks! you this (map (comp :_content :title) photosets) keywords work functions, composition comp first retrieve :title value of each photoset , further retrieve :_content value of value. alternatively written as (map #(get-in % [:title :_content]) photosets)

mysql query to move unique rows to temp table -

i want create query move every unique entry 1 table temporary table. created following query unique entrys: select date, messagetype, zcampaignid, issenderpolicy, sender, recipient, policy, operator, country, znumber topcampaigns_hour group date, messagetype, zcampaignid, issenderpolicy, sender, recipient, policy, operator, country, znumber having count(*) = 1; and returns lots of results: /* affected rows: 0 found rows: 473 warnings: 0 duration 1 query: 0.000 sec. (+ 0.016 sec. network) */ however when put update cant seem tmp table updated: update topcampaigns_hour_tmp b inner join ( select date, messagetype, zcampaignid, issenderpolicy, sender, recipient, policy, operator, country, znumber topcampaigns_hour group date, messagetype, zcampaignid, issenderpolicy, sender, recipient, policy, operator, country, znumber having count(*) = 1) set b.date=a.date, b.messagetype=a.messagetype, b.zcampaignid=a.zcampaignid, b.issenderpolicy=a.issenderpolicy

Sitecore Event Queue - Can I delay events? -

sitecore has nice event queueing system persisted database. can define custom events . i need able raise event has delay before it's processed. possible? i use other queueing system ( apachemq ?), nice use built in sitecore 1 if possible. as far know not possible delay event directly. there way custom code want executed delay. you create custom event. in custom event handler use sitecore jobmanager execute specific method want start delay. using sitecore jobmanager able delay execution of method passing additional parameter "initialdelay". var options = new joboptions("jobname", "category", "sitename", "object instance contains method execute", "methodname") { initialdelay = timespan.fromminutes(5.0) }; jobmanager.start(options); you can use execute method on cd server delay, after triggering cms server using remote events. see this link more info sitecore jobs.

getPrice() fatal error in magento customs product -

when try price attribute customs product, fatal error being thrown. $_product->getprice(); fatal error: call member function getprice() on non-object in /opt/lampp/htdocs/sve279/app/code/core/mage/catalog/model/product.php on line 211 when checked in core file, found this: public function getpricemodel() { return mage::getsingleton(‘catalog/product_type’)->pricefactory($this->gettypeid()); } so problem out customs product. know solution problem? you got error when $_product object not loaded. example: load product "sku" $product = mage::getmodel('catalog/product')->loadbyattribute('sku',$row['sku']); echo $product->getprice();

windows server 2008 - Remote PowerShell script doesn't apply Hyper-V Snapshot -

i'm attempting remotely apply hyper-v snapshot through powershell. i'm following ben armstrong's guide this. i'm in server 2008 r2, way. in nutshell: connecting remote server: $password = convertto-securestring "password" -asplaintext -force $cred = new-object system.management.automation.pscredential ("domain\user", $password) enter-pssession -computer computername -credential $cred this works fine. i've tested remote connection creating folder on machine. applying snapshot: $hypervserver = read-host "specify hyper-v server use (enter '.' local computer)" # prompt virtual machine use $vmname = read-host "specify name of virtual machine" # prompt name of snapshot apply $snapshotname = read-host "specify name of snapshot apply" # management service $vmms = gwmi -namespace root\virtualization msvm_virtualsystemmanagementservice -computername $hypervserver # virtual machine object $vm = gw

c# - SQL Server XPath Query to Extract ArrayOfString -

how write xpath query return object that'll have array of string? can't seem value or string work. <info> <emailaddresses> <string>email1</string> <string>email2</string> <string>email3</string> </emailaddresses> </info> select table.[object].value('(//info/emailaddresses)[1]','nvarchar(max)') 'emailaddresses' table ... leads cannot implicitly atomize or apply 'fn:data()' complex content elements, found type 'arrayofstring' within inferred type 'element( select table.[object].query('(/info/emailaddresses)[1]') 'emailaddresses' table ... will return whole <emailaddresses> <string>email1</string> <string>email2</string> <string>email3</string> </emailaddresses> which makes odd parse in code since it'll have transferred object instead of list of string in c#

python - Foreign Key to get many instances of a class -

Image
so, code looks right now: and when click on products ideally this: so, right code allowing me 1 product, option of adding unlimited amount of products. here's code: class purchaseorder(models.model): product = models.foreignkey('product') vendor = models.foreignkey('vendorprofile') dollar_amount = models.floatfield(verbose_name='price') class product(models.model): products = models.charfield(max_length=256) def __unicode__(self): return self.products how can this? or, rather, possible? use manytomanyfield instead of foreignkey.

MYSQL Stored Procedure Issues -

i writing mysql stored procedure first time, , running issue - think handler code. basically, want code update rows in pps_users table, reason hitting 'finished condition' handler after 2 rows fetched. i tried same thing repeat syntax , got same result. if run cursor query correctly 10,000 records expect, when run whole thing is, hit finished code after 1 or 2 records. delimiter $$ create definer=`root`@`localhost` procedure `changenflfavteams`() begin declare favnflteam varchar(100) default ""; declare favncaateam varchar(100) default ""; declare v_finished integer default 0; declare user_id bigint(20); declare fullnameofteam varchar(100) default ""; declare update_favs cursor select id, favorite_nfl_team pps_users favorite_nfl_team not null; declare continue handler not found set v_finished = 1; open update_favs; updaterecord: loop fetch update_favs user_id, favnflteam; se

javascript - What is the difference between `this` and `var` in a function. -

this question has answer here: difference between var , in javascript functions? 2 answers i have following javascript code project @ school. (this code provided me.) can explain difference between var setdatarequest , this.setdatarequest understand happening in functions, not why functions created in fashion. similar overloading? tele.forms.controller = new function () { var _requestdata; this.setrequestdata = function (requestdata) { _requestdata = requestdata; }; var setrequestdata = function () { var fields = $('.formsmaintable'); var reqdata = ['request_record_id', 'date_submitted', 'requester_id']; .... .... }; .... .... }; this.setrequestdata available @ tele.forms.controller.setrequestdata , while var setrequestdata available internals of function. think of this.set

javascript - Accessing elements in a Hash Table -

i'm going in circles , confused how access elements in hash table. have returned data json successfully. object object contains 2 columns fips , corresponding value. want access first row. i've tried using raw.fips / raw[fips] , raw[0] returned undefined there data in raw don't know access it. here ajax if helps $.ajax({ type: "get", url: webroot + "ws/gis.asmx/censusdata", data: d, contenttype: "application/json; charset=utf-8", datatype: "json", success: function (data) { fipsdata = data.d; console.log("json object returned data : " + fipsdata); init(regtype, varid); } //ends success function }); //ends ajax call the ajax returns data , in log there 3141 rows / elements i'm not sure. var raw = fipsdata; var valmin = infinity; var valmax = -infinity; (var index in raw) { fipscode =

c# - How to add navigation property in the Entity Framework -

Image
i trying add new repository class table called personfieldgroupdomain how looks like: so have 2 fields table. went entity framework model designer , couldn't add table designer using update model database, not visible. when see other tables have dependency on it, can see navigational property. so, need add new record since cannot reach context directly others, tried adding using "attach" method this: var fieldgroupset = fieldgroupsets.single(t=>t.fieldgroupsetid == 1); fieldgroupset.personfieldgroupdomainreference.attach(domains.single(t=>t.domainid == 2)); and code didn't work. @ least tested on linqpad using same context assembly using in actual project. this article seems talking of ways can use http://msdn.microsoft.com/en-us/data/jj592676.aspx none of them seemed working me. any working idea appreciated. it looks table join table. ef hide these in designer view. notice if add surrogate key or table, you'll start seeing in

Splitting math sums with python -

this simple question has been bothering me while now. i attempting rewrite code parallel, , in process need split sum done on multiple nodes , add small sums together. piece working this: def pia(n, i): k = 0 lsum = 0 while k < n: p = (n-k) ld = (8.0*k+i) ln = pow(16.0, p, ld) lsum += (ln/ld) k += 1 return lsum where n limit , i integer. have hints on how split , same result in end? edit: asking, i'm not using pow() custom version efficiently floating point: def ssp(b, n, m): ssp = 1 while n>0: if n % 2 == 1: ssp = (b*ssp) % m b = (b**2) % m n = n // 2 return ssp since variable that's used 1 pass next k , , k increments 1 each time, it's easy split calculation. if pass k pia , you'll have both definable starting , ending points, , can split many pieces want

What string should be used to specify encoding in Perl POD, "utf8", "UTF-8" or "utf-8"? -

it possible write perl documentation in utf-8. should write in pod: =encoding nnn but should write instead nnn ? different sources gives different answers. perlpod says that should =encoding utf8 this stackoverflow answer states should =encoding utf-8 and this answer tells me write =encoding utf-8 what correct answer? correct string written in pod? =encoding utf-8 according iana, charset names case-insensitive , utf-8 same. utf8 perl's lax variant of utf-8. however, safety, want strict pod processors.

hadoop - Creating Impala external table from a partitioned file structure -

provided partitioned fs structure following: logs └── log_type └── 2013 ├── 07 │   ├── 28 │   │   ├── host1 │   │   │   └── log_file_1.csv │   │   └── host2 │   │   ├── log_file_1.csv │   │   └── log_file_2.csv │   └── 29 │   ├── host1 │   │   └── log_file_1.csv │   └── host2 │   └── log_file_1.csv └── 08 i've been trying create external table in impala: create external table log_type ( field1 string, field2 string, ... ) row format delimited fields terminated '|' location '/logs/log_type/2013/08'; i wish impala recurse subdirs , load csv files; no cigar. no errors thrown no data loaded table. different globs /logs/log_type/2013/08/*/* or /logs/log_type/2013/08/*/*/* did not work either. is there way this? or should restructure fs - advice on that? in case still searching answer. need r

linq - How to perform Sum of a column dynamically in C#? -

Image
i using system.linq.dynamic group columns using linq dynamically , need perform how can sum column i.e.(sum(deposits)). user select table , columns @ runtime. ex: above table has territory, state, bankname, year, quarterfrommaint assume user has selected these columns grouping (territory, state, bankname) , wants sum column ex:deposits. how can this? because asenumerable , asqueryable has sum. need perform groupby , sum click here further clarification , code is: here t1 table , qfields list contains grouping columns. how can use linq sum column after groupby? do mean this? if not, please disregard... var query = rows .groupby(row => new { row.territory, row.state, row.bankname }) .select(group => new { group.key.territory, group.key.state, group.key.bankname, deposits = group.sum(row => row.deposits) });

swing - JAVA putting text in JTextfield -

i'm writing program i'm going info multidimensional array jtextfields, info depend on user inputs in "item2". problem cannot kind of data "thehandler" class jtextfields. try use "settext" tells me cannot change void string. use value in thehandler class "piezas" , use on gui, can't return value piezas gui. not sure here. have array ready, need values on same class write switch can info in jtextfields. so basically, need "piezas" value thehandler class gui class (or able input text in jtextfields thehandler class). thnx help! i'm creating jtextfield this: jtextfield item1 = new jtextfield(10); and here tried set text it: string setvalue = item1.settext("text"); this doesn't work. why? about edit: full code commented out, not deleted. --mightypork settext() right choice, used in strange way. string setvalue = item1.settext("text"); settext() has no return val

html - javascript for loop with dynamic div id -

this works create second pull down menu dynamically based on result of first pull down menu: for (var = 0; < 1; i++) { $('#wdiv' + i).change(function() { var wdiv = $(this).val(); $.ajax({ type: "post", url: "populate_classes.php", data: 'theoption=' + wdiv, success: function(whatigot) { $('#class_list' + i).html(whatigot); } }); //end $.ajax }); //end dropdown change event } why input drop down select #wdiv0 change drop down menu #class_list1? want #wdiv selection set #classlist0 drop down select. here portion of form: <fieldset><legend>select divisions</legend> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td><div align="center"><u><strong>name</strong></u>

ruby - Error While Importing CSV Document - 0 Records Get Added -

i getting output 0 records added when trying import csv file database. controller code :- def add if request.post? @parsed_file=csv::reader.parse(params[:dump][:file], :headers => true) n=0 @parsed_file.each |row| c=student.new c.admission_no=row[0] c.class_roll_no=row[1] c.admission_date=row[2] c.first_name= row[3] if c.save n=n+1 gc.start if n%50==0 end end flash[:notice]="csv import successful, #{n} new records added data base" redirect_to :controller=>"data_import", :action=>"index" end end end my ruby version 1.8.7 student table inserting data. can 1 me out.

Php move upload file with ftp_put -

move_uploaded_file(); ftp_put(); i have input type file, let user upload image. i try save user's image different server or sub domain. so if uploads malicious file server wont execute on main server. my questions are how can use move_uploaded_file ftp_put ? should server or sub domain enough? using different subdomain not isolate server: need put on different machine. however, saving file server not put in danger. problem comes when tries interact file in unsafe way. instance, particular image viewing program may have flaw in malicious image take advantage of. in case, opening uploaded image program put @ risk. checking file extension not legitimate way determine file type. instance, write malicious executable file , name my_vacation_pic.jpeg . once again, not problem save on filesystem. if want figure out file type, want unix file command, though i'm not sure of kind of risks involved in opening possibly malicious files command. however, fil

asp.net mvc - my pro just shows client side validation errors -

i use @html.validationmessage("username") check duplicate username. , working. when have serverside validation error & clientside validation error , shows clientside error .i wanna both errors can appear. @html.validationmessage("username") alone works , when have forexample email required error , @html.validationmessage("username") doesn't show , email error shows. //client @html.textboxfor(m => m.email, new { @class = "group", @placeholder = "* enter email" }) @html.validationmessagefor(model => model.email) //server @html.validationmessage("username") @html.textboxfor(m => m.username, new {@id="group" , @class = "input-block-level", @placeholder = "* enter username" }) this expected behavior client-side validation: prevents form post on error, because can determine input invalid. if don't want client-side validation run, can disable

tsql - How do I UPDATE a field from another table -

i have 2 tables have same data , fields except one. want update table missing field 'sbcmp'. here definition of table want add field , data to: [dbo].[salesdata]( [sbloc] [varchar](3) null, [sbcust] [varchar](7) null, [rmname] [varchar](30) null, [ifprvn] [varchar](6) null, [sbitem] [varchar](25) null, [sbitd1] [varchar](50) null, [sbdiv] [smallint] null, [sbcls] [smallint] null, [sbqshp] [smallint] null, [avc] [real] null, [sbeprc] [real] null, [sbinv] [int] null, [sbord] [int] null, [sbtype] [varchar](1) null, [sbindt] [datetime] null, [rmstat] [varchar](2) null the other table has exact same table definitions except has field [sbcmp] [smallint] null i use new table, old table has other older data new 1 not. i want know best method of update table add field , data. first of design table , add new field. or run alter table salesdata add sbcmp smallint null then may use merge in order data.

sonarqube - Configure sonar and maven to analyze Webapp -

we need analyze webapp using sonar the webapp has been developed using java, ejb's , adf. structure below - root directory main workspace .jws subdirectories individual project .jpr's, each having own pom.xml a | | a.jws | pom.xml | | - b | - b/b.jpr | - b/pom.xml | - b/src | | - c | - c/c.jpr | - c/pom.xml | - c/src | we build ear webapp maven root directory containing main .jws , main pom.xml a/sonar-project.properties has entries below # required metadata sonar.projectkey=a sonar.projectname=a sonar.projectversion=v1 # set modules ids sonar.modules=b,c # path source directories (required) sonar.sources=src sonar.sourceencoding=utf-8 sonar.language=java b.sonar.projectbasedir=b b.sonar.projectname=b c.sonar.projectbasedir=c c.sonar.projectname=c when execute mvn sonar:sonar /a, build output shows sucess, , skipped b, c sonar dashboard shows 0 loc covered , no issues reported our objective mvn sonar:sonar build a, b, c , report data in sonar dashboard

math - Formula to determine the range of signed and unsigned data types C++ -

i'm starting out in c++ (literally second day) , i've been assigned calculate ranges of varying data types, signed , unsigned. problem is, way school works won't math portion teaches formula couple months. said information has done math course of them said they're going work on home have notes. i'm left in dark google , inconclusive answers, ask you, wise folk of stackoverflow. what formulas getting range of data types? have found 1 int has worked not apply others, ones wants calculate are: char, short, long, , long long. wants unsigned versions of 4 int. we have size in bits , bytes of each of these data types. here how have int range laid out: printf ("\nthe range of int is: %f\n", pow(2, (sizeof(int) * char_bit) -1)); std::numeric_limits<t> you can actual values of these limits using these functions: t std::numeric_limits<t>::min() t std::numeric_limits<t>::max() you substitute appropriate type in plac

xcode - Possible issue while uploading new app code to app store -

ill keep short need quick confirmation didn't ruin upload request. i got version update ready via itunes connect. went xcode, archived project, went organizer - archives , validated archive, uploaded , succesffuly sent off itunes. in itunes connect, see project's status @ "waiting review" this fine, accidentally deleted archive in organizer- archives window in xcode... screw upload? i'm asking question out of paranoia, , love if confirm / deny adverse affects comes deletion of archive used update app in app store via xcode. thanks read. that's no problem. archive uploaded apple , waiting review. deleted archive mac.

php - Wordpress: <script src="?ver=1.10.2"></script> being loaded out of nowhere -

website: http://ramprate.com/design1/ you'll find script tag inside <head> <script type="text/javascript" src="http://ramprate.com/design1?ver=1.10.2"></script> i don't know coming from. deactivated plugins 1 @ time, , tag still being loaded after every deactivation. removed wp_head() header file, tag still being loaded inside <body> i spent lot of time trying figure out it's being queued couldn't. found version of jquery on wordpress installation 1.10.2 ( wp version 3.6 ) - guess it's related loading jquery. grep 1.10.2 inside wp-content yields no result either. any thoughts on coming from? i noticed bug in 'better wordpress minify' can cause this. see official support thread: http://wordpress.org/support/topic/wp-36-jquery-enqueued-but-wrong-script-written-after

Realtime Updates from Facebook in Windows Phone -

i new fb api , windows phone 7.1/8. in need of immediate assistance get real time update of pics posted on specific page on windows phone app . have show count of new pics posted in page on tile. went through fb's realtime api , wherever see notice callback url going url in windows app? should easy task many. so, please point me right direction. it not possible wp app receive such updates facebook. because don't have such api purpose. what realtime api ? well, possible realtime updates facebook using api, requires specify callback url . in other words, require have web server web application can accept get , post requests server. after receiving such updates, your webapp can broadcast updates device using push notification service . any workaround ? yes ane workaround can use periodic task runs , fetch data after regular intervals. beware of: amount of data send in periodic task (battery + data consideration). reliability factor of periodic task

php - Instantiate an object with only some of its members -

i'm working in php application, , i'd able instantiate object, need instantiated of it's properties, not of them. eg. class user { public function __construct() { $this->user_id = 0; $this->name = ''; $this->profile = array(); //...many other members here } } every time instantiate object brings many collections of data, (for example, brings it's "profile" properties , on). , not wanted behavior because, let's need use name of user, why having in memory rest of properties? in other cases, need them right away. some ideas: i create class extends user, , in constructor method unset unwanted properties. however, i'm looking more reusable way, can same other objects in application. i take properties out of constructor method, force me change core of application (classes above user class), , alter many things in application. is there more reusable way using standard intermediary clas

r - What makes rollmean faster than rollapply (code-wise)? -

i regularly find rolling things of time series (particularly means), , surprised find rollmean notably faster rollapply , , align = 'right' methods faster rollmeanr wrappers. how have achieved speed up? , why 1 lose of when using rollmeanr() wrapper? some background: had been using rollapplyr(x, n, function(x) mean(x)) , happened upon few examples using rollmean . documents suggest rollapplyr(x, n, mean) (note without function part of argument) uses rollmean didn't think there difference in performance, rbenchmark revealed notable differences. require(zoo) require(rbenchmark) x <- rnorm(1e4) r1 <- function() rollapplyr(x, 3, mean) # uses rollmean r2 <- function() rollapplyr(x, 3, function(x) mean(x)) r3 <- function() rollmean(x, 3, na.pad = true, align = 'right') r4 <- function() rollmeanr(x, 3, align = "right") bb <- benchmark(r1(), r2(), r3(), r4(), columns = c('test', 'elapsed', 'rela

c++ - Combine multiple variables to send as a udp packet -

i need send packet of data on udp connection in c++. first message need send built of 2 32 bit integers , 64 bit integer. best way combine multiple variable types 1 block of data ready sending on udp connection? it depends on requirements network. care endianness? if do, should use not serialisatioin, safe 1 in regards endianness. generally, each class/struct sendable through network should have special methods or overloaded operators stream them in , out. you'll have use macros/functions hton/ntoh streaming primitive types eg int, int64, float, double etc. upd: if network endpoint applications run on different platforms/compilers, may have different sizes of int, long, short etc. when serialising, you'll have convert integers predefined types sizes guaranteed same on supported platforms.

vb.net - SQL Reporting Services, controlling possible word wrap issue in tablecell -

Image
first of all, extremely new sql reporting services, guess causing issue off. basically, first page of reports spit out fine, when 2nd+ pages hit, width of table greater 8.5 (which interactivewidth set to) inches because clips off page, , creates whole other page looks blank, if closely see edge of table previous page on left side so: i suspect might have possible word wrapping issue on particular tablecell: because on 2nd+ pages, same tablecell displays as: which seems width coming making table wide page width. help. ssrs doesn't allow column width change dynamically, don't have worry that. settings need adjust page size , margins. if default margin on each side 1 inch, left 6.5 inches width work with. try reducing margin first, should fix it.

asp.net mvc - sending long strings to the controller -

the page in question setup page software. want user paste license key textarea . have option validate (validation done on controller) , can 'apply' ( saved in reg key on server' however seem have hit maximum length can sent controller. key being passed string fails error longer 2142 characters . ( keys 2500 ish) so thought i'd clever , use slice split long license key 2 or 3 parts, seem hit shorter 'overall' length restriction. so here code slitting 2 strings , works fine if leave overall length @ 1800 if try adding 3rd or increase overall length on 2000 (roughly) error , break point @ controller never reached. controller function updatelicense(params configparams, newlicensekeya string, newlicensekeyb string) emptyresult dim lickey string = newlicensekeya + newlicensekeyb 'just testing return nothing end function and here view $(document).ready(function () { $("#checklicense").bind("click", function

android - How to add file to Eclipse project that already exists -

the team using android studio develop android projects. researching unit tests, looks support junit test cases in eclipse. after exporting test project eclipse , importing android studio under mistaken impression go , forth. when added java class project in android studio, new java class not show in eclipse project. i import new class if wanted move different location first. so, there way eclipse project recognize file on disk should included in project?

ruby on rails - SQLite3::SQLException: unrecognized token: ":": -

i'm having trouble running pg_search. think it's set correctly, reason when trying run search, comes up: sqlite3::sqlexception: unrecognized token: ":": select "courses".*, ((ts_rank((to_tsvector('simple', coalesce("courses"."title"::text, ''))), (to_tsquery('simple', ''' ' || 'finance' || ' ''')), 0))) pg_search_rank "courses" (((to_tsvector('simple', coalesce("courses"."title"::text, ''))) @@ (to_tsquery('simple', ''' ' || 'finance' || ' ''')))) order pg_search_rank desc, "courses"."id" asc course model: include pgsearch scope :by_course_title, lambda { |ttl| _by_course_title(ttl) if ttl.present? } pg_search_scope :_by_course_title, against: :title search controller: def index @course = course.by_course_title(params[:fname]) end in html:

Create mysql compatible Date from variables in PHP -

i have field set type date in mysql table. day, month , year user , @ moment have values returned this: [start_datemonth] => 08 //$stardmonth [start_dateday] => 7 //$startday [start_dateyear] => 2013 //$startyear how can convert valid date can insert in database? this own code, reasons browser shows blank screen no source code inside: $format = 'y-m-d h:i:s'; $start = datetime::createfromformat($format, "$startyear-$startmonth-$startday $starthour:$startminutes:00"); echo $start; from manual although mysql tries interpret values in several formats, date parts must given in year-month-day order (for example, '98-09-04'), rather in month-day-year or day-month-year orders commonly used elsewhere (for example, '09-04-98', '04-09-98') .dates containing two-digit year values ambiguous because century unknown. mysql interprets two-digit year values using these rules:year values in range 70-99 are converted to1970-19

Windows SDK environment and powershell -

the windows v7.1 sdk has setenv.cmd script in binary folder correctly setup environment. problem script works cmd.exe , can't find equivalent powershell anywhere. so forced use cmd.exe or there way use powershell (apart manually rewriting setenv.cmd script - if work?). someone wrote ps1 script parses out sdk's setenv can avoid processes: http://www.tavaresstudios.com/blog/post/the-last-vsvars32ps1-ill-ever-need.aspx

android - How does the "Google Play Games" app by Google, Inc avoid requiring permissions? -

Image
this odd me. downloaded google play games app (distributed google, inc.) , shown on device required no special permissions (on device): this peculiar because using application there quite few things should require permissions. network access, accounts access, etc. also, other apps google, inc. i've checked still require permissions expected... another oddity looking @ app on play store via computer shows require permission, although access accounts , not other permissions 1 expect: my question, how possible application not require necessary permissions , how can discrepancy between viewing store on device , through web browser explained? how possible application not require necessary permissions it may not doing operations itself. may having third-party perform actions it. example, might use custom signature -level permission have play services framework app things on behalf. how can discrepancy between viewing store on device , through web browse

How do I get the soft keyboard identifier in android -

i'd soft keyboard identifier in android purpose of determining keyboard height. end goal want reposition view on screen vertically centered between top of keyboard , bottom of status bar. can status bar height following code: int statusbarheight = 0; int resourceid = resources.getidentifier("status_bar_height", "dimen", "android"); if(resourceid > 0) { statusbarheight = resources.getdimensionpixelsize(resourceid); } can height of soft keyboard in similar way? using xamarin because sharing backend between ios app , android app, code seems pretty similar android. creating views entirely in code prefer; question how can keyboard height in code in order position view in code? you can using viewtree observer . root view, you'll able calculate new size when keyboard appears. the question below may you, helped me: is there way in android height of virtual keyboard of device

docpad - Sending simple email from static page -

i'm new docpad. idea of static page generation , had in mind time, great there's mature project out there! however, while rough picture of how docpad works, recommend best way of creating simple contact me page, email input text specific address? there still requirement server side code this. how see doing right now, having html form doing post nodejs server handle sending email. is correct docpad way of doing it, or i'm missing something? check out contactform plugin :)

iOS 7 MapKit MKAnnotationView's image property type encoding weirdness -

these results of method_gettypeencoding(class_getinstancemethod(mkannotationview.class, @selector(setimage:))) method_gettypeencoding(class_getinstancemethod(mkannotationview.class, @selector(image))) 7.0: v12@0:4^{uiimage=#^vf{?=b1b3b1b1b1b16b2}}8 ^{uiimage=#^vf{?=b1b3b1b1b1b16b2}}8@0:4 and 6.1: v12@0:4@8 @8@0:4 i don't understand why it's ^{... instead of @ . it's causing me problems in rubymotion . thanks in advance! you might want check out promotion , it's mapkit support (that wrote). makes easy draw map screen , put annotations on map (and customize look). https://github.com/clearsightstudio/promotion

goroutine - Go concurrent access to pointers methods -

i'm trying understand happens when make concurrent access pointers methods? i have map of pointers , spawn off few go routines. pass map each go routine , each go routine use 1 of values in map. nothing being written map being read from. the map small, 4 keys it's possible more 1 go routine using same value map. question is, happens when 2 go routines call method of same pointer? unpredictable results? edit example: i'm taking out map portion that's not question i'm after. i have foo pointer of type mystruct , structure has method dosomething takes arguments. in main function i'm creating 2 go routines , both of them make calls foo.dosomething passing different values. in example first go routine has larger calculation preform second 1 (just using sleep times here simulate calculations). again nothing in structure changing i'm making call structures method. have worry second go routine making call foo.dosomething when first go r

java - create class from array of classnames -

in java how create array of class definitions , create class array? list<class> blockarray = new array<class>(); blockarray.add(ltetrino.class); i stuck when comes this, how create class classname? public tetrino getblock(int x, int y) { // return new ltetrino(x, y); old code return new blockarray.get(blah); } i'm pretty sure i'm doing wrong here. in advance. see class.newinstance() . for example: list<class> blockarray = new arraylist<class>(); blockarray.add(ltetrino.class); // instantiate object of class added ltetrino block = blockarray.get(0).newinstance(); if class constructor takes parameters, can use getconstructor() method of class retrieve appropriate constructor, , invoke instead (it's linked in docs above), e.g. (assuming ltetrino static / top level class , constructor takes 2 int parameters): class<? extends ltetrino> cls = blockarray.get(0); // constructor constructor<? extends ltetrino>