Posts

Showing posts from February, 2014

c# - How to set control x:Uid attribute programmatically for a metro app control? -

i need set x:uid attribute of control programmatically? attribute used localization. i not strong on subject if talking same thing, can see here: bamllocalizableresourcekey.uid property the public property has get, can't change c# code. public string uid { get; } see more x:uid directive find out property set directive , not other attributes in xaml.

c - fread into array of structs segmentation fault -

i've been working on code awhile , i've run seg fault can't seem debug. here's relevant code: typedef struct halo* halo; struct halo { float x, y, z; float vx, vy, vz; int n200a; float m200a; float r200a; int n200c; float m200c; float r200c; int n500a; float m500a; float r500a; int n500c; float m500c; float r500c; }; global variable: halo *halo_catalog; the function fails: int loadhalocatalog(char *filename) { file *catalog_file; long long halo_num; catalog_file = fopen(filename, "rb"); if (catalog_file == null) { printf("could not open halo catalog: %s\n", filename); return -1; } if (fread(&halo_num, sizeof(long long), 1, catalog_file) < 0) { printf("could not read number of halos\n"); return -1; } halo_catalog = (halo *)calloc(halo_num, sizeof(struct

java - Maven error while assembling hadoop in stand alone mode -

i new hadoop , maven. compile hadoop 2.0.3 source , install it. following instructions http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/singlecluster.html so far, have managed download hadoop source code , source directory issued "mvn clean install -pnative" next tried execute mvn assembly:assembly, following error: failed execute goal org.apache.maven.plugins:maven-assembly-plugin:2.3:assembly (default-cli) on project hadoop-main: error reading assemblies: no assembly descriptors found. -> [help 1] please can move forward. also, above mentioned install link, not mention should value of "$hadoop_common_home/$hadoop_hdfs_home" i compiled 1.0.4 academic exercise. not sure if valid 2.0.3 this should done (on ubuntu) before start compilation make sure needed stuff there: sudo apt-get -y install maven build-essential protobuf-compiler autoconf automake libtool cmake zlib1g-dev pkg-config libssl-dev

urbanairship.com - Unable to push notifications via urbanairship to APNS -

i using apns app in development mode. integrated urban airship per getting started document provided on portal: created certificate in apple provisioning portal. imported .p12 file urban airship app(in dev mode debug enabled) now when open application, shows me alert , asks me permission enable notification. once done , try test push message urban airship portal device using device token generated, common error: apple push service rejected device token "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" i searched on google , found common problem; no solution. answers mention prod , dev environment conflict cause, not case in case did not create prod app in urban airship nor in apns dev certificate. settings in airshipconfig.plist are: app_store_or_ad_hoc_build : no development_app_key: xxxxxxxxxxx development_app_secret: xxxxxxxxxx (not master secret, dev app secret.) nowhere did find response user asked question , later got resolved. so, not sure how people resolved

aop - How to easily remove Rails engines? -

my hope was, engines enable me add or remove features in app. however, whenever see how engines used, noone talks disabling/uninstalling/unmounting them cleanly. how can this? the case product line of apps pretty similar. start developing variant features , work backwards disabling features other variants of app. i work bit aspects in aop, can declare dependencies (in both directions), when want remove aspect/engine, code connected engine removed/disabled. whenever try rails engines, there has lot of entangled, customized code (e.g. when using parts of engine in views).

random - Select data based on a distribution in matlab -

i have set of data in vector. if plot histogram of data see (by clever inspection) data distributed sum of 3 distributions; one normal distribution centered around x_1 variance s_1; 1 normal distribution centered around x_2 variance s_2; once lognormal distribution. my data subset of 'real' data. what take random subset of data away data ensuring resulting subset reasonable representative sample of original data. i possible in matlab new both statistics , matlab , unsure start. thank :) if can identify each of 3 distributions (in sense can estimate parameters), 1 approach select random subset of data , try estimate parameters each distribution , see whether close enough (according own definition of "close") parameters of original distributions. should repeat process several time , @ average difference given random subset size.

php - Using AJAX rather than sending a form -

this question has answer here: jquery ajax submit form 14 answers what equivalent of using ajax rather sending form in case <form action="" method="post"> <div style="padding-left: 10 px:"></div> <input id ="datetime" style="display:none;" type="text" name="datetime" value="yyyy/mm/dd hh:mm:ss" size="5" > <a href="#" onclick="cal.select(document.forms[0].datetime,'anchor','mm/dd/yyyy'); return false;" title="cal.select(document.forms['example'].datetime,'anchor','mm/dd/yyyy'); return false;" name="anchor" id="anchor"><i class="icon-calendar"></i> </a> <input style="font-size: bold 8pt;"

java - Issue running CXF JAX WS Service -

i have exposed web service using cxf jaxws service via http outbound. given below syntax of end-point declaration mule config. <http:inbound-endpoint address="http://localhost:8080/helloservice" exchange-pattern="request-response"> <cxf:jaxws-service serviceclass="com.example.service.helloserviceimpl" wsdllocation="wsdl/helloservice.wsdl" namespace="http://example.org/helloservice" port="helloserviceport" service="helloservice" > but no working. gives below error when tried run on mule server. 2013-04-08 16:34:35,252 error [main] mule.muleserver (muleserver.java:474) - ******************************************************************************** * fatal error has occurred while server running: * * not find definition port * * {http://service.example.com/}helloserviceimplport.

javascript - Dynamically resize a div using jQuery -

i have div ( id="maindiv" ) need dynamically resize if user changes size of browser window. have written following code try , work doesn't seem setting height of div : <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script> var height = $(window).height(); $("#maindiv").height(height); </script> <body> <div id="maindiv"></div> </body> i don't know jquery, making obvious mistake? there few things going wrong here: your code execute straight away before document has finished loading. your code execute on load of the script, not on resize you're not setting height of maindiv - you're setting height of element id: accordianmain (but i'm guessing know that). you need handle browser resize event wait browser resize dimensions of window , apply accordingly. you'd handling window.resize event liks this: var $win = $(window); $

android - updating notification progress failed why? -

my issue cannot update notification information, such progress bar or text, asynctask . i've spent quite time on issue, found no solution. aim able change dialog progress bar , text. how can make notification progress bar work? here code: private class excuteuploadfile extends asynctask<httpresponse, integer, httpresponse> { long totalsize; int notification_id; string filepath, filename; string serverresponse = null; string urlserver = "http://myurl"; notificationmanager mnotifymanager; builder mbuilder; progressdialog pd; boolean nofti_appended = false; jsonobject jsonfile = null; public excuteuploadfile(string filepath, string filename) { this.filepath = filepath; this.filename = filename; log.i("uploader", "selected file name : " + filename); log.i("uploader", "selected file path : " + filepath); } @override prot

security - How can I prefill a PDF form with iTextSharp while still having it be editable and saveable in Adobe Reader by other users? -

right have form template has fields prefilled database using itextsharp library. users fill in rest of fields , save filled out forms. i'll extract data , put in database. currently able create pdfs , pre-filling fine. i'm able edit , save them in adobe reader on computer. i'm finding when else opens same files, they're not allowed save forms. what need allow forms saved users using adobe reader? here's code have create pdf: dim pdfreader pdfreader = new pdfreader(formpath) pdfreader.removeusagerights() dim pdfstamper pdfstamper = new pdfstamper(pdfreader, new filestream(outputpath, filemode.create)) dim pdfformfields acrofields = pdfstamper.acrofields dim xfdfreader xfdfreader = new xfdfreader(xfdfpath) pdfformfields.setfields(xfdfreader) pdfstamper.close() i used have problem couldn't save forms in reader, , that's why added line: pdfreader.removeusagerights() that made i can edit pdf creates, made me think resolved. nobody else can.

MySQL left join filter -

i have 2 related tables shown below need join new , updated records. these representative examples simplified table structure. the first table table of items e.g. 'notes' contains existing notes 'new' notes , updates existing notes. the second table contains details of pending changes/updates note. example, if note has been modified, row cloned modifications , row added pendingupdates table id of original note, id of row updates , user made update. if new note added workflow similar expect original id , modified id refer same row. notes: +----+---------------------+----------------------------+ | id | title | text | +----+---------------------+----------------------------+ | 1 | test note | blah blah blah | | 2 | note 2 | sdfsadfasdf | | 3 | note 3 | jklhjklhjklhjk | | 4 | note 3 | update note3 | | 5 | note 3 | update

ios - If statement with dates -

what trying make if statement dates using greater less signs. reason greater sign works. here code: nsdate *currdate = [nsdate date]; nsdateformatter *dateformatter = [[nsdateformatter alloc]init]; [dateformatter setdateformat:@"hhmm"]; nsstring *datestring = [dateformatter stringfromdate:currdate]; nslog(@"%@",datestring); if (datestring < @"0810" && datestring > @"0800") { nslog(@"homeroom"); } else { nslog(@"no"); } the output code if time 8:03: 2013-04-08 08:03:47.956 schedule2.0[13200:c07] 0803 2013-04-08 08:03:47.957 schedule2.0[13200:c07] no if make greater sign this: if (datestring > @"0800") { nslog(@"homeroom"); } else { nslog(@"no"); } the output this: 2013-04-08 08:03:29.748 schedule2.0[14994:c07] 0803 2013-04-08 08:03:29.749 schedule2.0[14994:c07] homeroom create nsdate object time 8:10 , 1 8:00. can compare given date both

Where can I find the URL for a Facebook (App on Facebook) Canvas Page App? -

Image
after creating "app on facebook", how can find url view within facebook chrome? in image below (from facebook's documentation ), top line shows url canvas page withing facebook. however, "edit app" page not have field, otherwise identical. the url doesn't appear listed anywhere in https://developers.facebook.com/apps/ , , don't know else look. ideas? i figured out after reading documentation more ;-) to url appear, need set app "namespace" in settings.

ios - How can you tell if a MagicalRecord operation was successful? -

i make heavy use of magicalrecord fetching, deleting, updating , saving data. have noticed in testing don't expected results because went wrong operation attempting, such bad predicate resulting in no record being updated or deleted, etc. i have looked @ available docs (such are) , can find nothing give method examining return code, etc. anyone know of place lists all of available mr methods with explanations (other mr categories , core)? i'm not sure you're looking in way of documentation. primary reason sparse documentation project core data docs cover vast majority of features. magical record merely set of convenience methods make standard operations in core data more manageable. the parts 'non standard' core data functionality may need explanation in how things work, source available read , understand. if have specific question, please ask it.

winapi - Windows 8 protocol activation of Desktop app from a Modern App -

i have 2 versions of custom software. modern/metro app (appm) , legacy desktop application (appd). have created custom protocol appm using manifest understood. i've edited registry make custom protocol handler appd , have tested can indeed launch appd using protocol activation run dialog (win+r) supplying protocol , hitting enter, "appd://" in case. i'd able launch appm appd , appd appm. i've added handlers each. in appd i'm using process.start(uri) , in appm i'm using launcher.launchuriasync(uri). can appm launch appd never appd launch appm. i've googled , can't find references this. i'm assuming it's not possible , might have permissions. assignment has fallen me on project, need either prove it's not possible or find solution. i've tested out using c#/xaml html/js , it's interesting find launcher.launchuriasync(uri).when() success function called, success flag false. there no error (or @ least err function neve

c - output of a function which has passByName parameter passing paradigm -

this question has answer here: output of c code call reference [closed] 1 answer i've tried figure out output of code .by way ,it not real question, kind of therical question, mean not original c code, kind of pl having c-code syntax , passed name parameter paradigm. int x=12,y=10; void tswap(int pa, int pb) { int tmp; tmp=pa; pa=pb; pb=tmp; x=x+pa; x=x-pb; y++; printf("%d %d %d %d\n",pa,pb,x,y); } int main() { int a=4; tswap(x,a); printf("%d %d %d\n",x,y,a); tswap(++x,++y); printf("%d %d %d\n",x,y,a); return 0; } i think output of first part should : -4 12 -4 11 -4 11 12 but find logical solution part tswap (++x, ++y) there can know how can handle part ? thanks in advance ! tswap(++x,++y) is same as: ++x; ++y; tswap(x,y); making output: 4 12 4 11 4 11 4 12 5 12 13 12 13 4

"Sparse" Rank in Business Objects XI Web Intelligence? -

in business objects xi web intelligence rank function returns dense results. example when ranking "amount" want return top ten records only. 3 records tie 5th place on "amount". result total of 12 records: 1 each places 1 4 , 6 10 , 3 records 5th place. desired result "sparse" top ten drops 2 lowest ranked records (places 9 , 10). i tried , rank customers amount. i have 2 objects: [amount] , [customernumber]. [customernumber] numeric. i created new variable: [varforsorting]=[amount]*10000000+tonumber([customernumber]) then rank new variable [varforsorting]. customers same amount sorted in alphabetic order customer number. hope helps.

c++ - Template class woes; Proper template signature? -

i implementing template class , not sure if have signatures correct. below i've included sample of code, showing couple of situations concerned about: mymap.h: #ifndef map_h #define map_h #include <iostream> #include <string> using namespace std; template <typename key, typename t> class map{ private: struct elem { }; public: map(); // constructs empty map map(const map &rhs); ~map(); map& operator=(const map &rhs); bool insert(key, t); t& operator[](key); }; template<typename key, typename t> ostream& operator<< (ostream&, const map<key, t>&); #include "mymap.cpp" #endif and .cpp file: #include mymap.h #include <iostream> #include <string> using namespace std; //assingment operator template < typename key , typename t > map< key , t >& map< key , t >::operator=(const map &rhs){ //avoid self assign

ios - UITableViewRowAnimation is ignored -

i'm using nsfetchedresultscontroller populate table. data in table sorted according timestamp in ascending order (latest message @ bottom). more data loaded via "infinite scroll" top: e.g. when user scrolls past top, more messages loaded. nsfetchedresultscontrollerdelegate defined usual, recommended in apple documentation: new rows inserted via - (void)controller:(nsfetchedresultscontroller*)controller didchangeobject:(id)anobject atindexpath:(nsindexpath*)indexpath forchangetype:(nsfetchedresultschangetype)type newindexpath:(nsindexpath*)newindexpath { switch(type) { case nsfetchedresultschangeinsert: nslog(@"insertion @ row %d", newindexpath.row); [self.table insertrowsatindexpaths:@[newindexpath] withrowanimation:uitableviewrowanimationnone]; break; now here problem: when new rows inserted, animated sliding "down". on infinite scroll upward

c - Minor version checks for ELF shared libraries -

short version: how can emulate mach-o's compatibility version feature elf shared libraries? long version: want create elf shared libraries "major.minor.patchlevel" versions. shared library should loaded executables linked against the same major version and a lower or equal minor version. otherwise dynamic linker should throw error without running executable. i know use linker version scripts seems tedious , error-prone specify versions every symbol in library. 1 idea had use version script single symbol every user of library must use, example initialization function. if function called lib_init , i'd write version script following version 1.2.x of library: vers_1.0 { }; vers_1.1 { } vers_1.0; vers_1.2 { global: lib_init; } vers_1.1; would have desired effect? another idea put explicit version check in lib_init , like: void lib_init(int minor_version) { if (minor_version > 2) abort(); } or there better solution?

c# - Global CBT Hook in Windows 7 fails eventually -

i using global cbt hook setup stop new windows stealing focus. injecting c++ dll c# app. functions fine while , stops working. thought might timing out, changed lowlevelhookstimeout in registry , rebooted. didn't help. i not great c++. so, perhaps error in code. causing fail? also, there way deal name mangling , clean code bit? windowmonitor.cpp #include <map> #include "stdafx.h" #include "header.h" using namespace std; #pragma data_seg(".test") hhook hook=0; #pragma data_seg() #pragma comment(linker, "/section:.test,rws") extern "c" { __declspec(dllexport) lresult callback cbtproc(int ncode, wparam wparam, lparam lparam) { if (ncode<=0) return callnexthookex(hook, ncode, wparam, lparam); if (ncode==hcbt_activate) { try { cbtactivatestruct* stuff=(cbtactivatestruct*) lparam; if (stuff!=0) { if (stuff-&

text - NEWBIE — Renumbering line numbers in .txt file -

i have simple text file has been edited looks this: 1,47:26:23n,121:15:10w,1641m,t,3 queens mtn, 2,48:01:19n,119:56:12w,367m,t,alta lake, 4,48:40:19n,121:35:35w,1705m,t,anderson butte, 5,48:36:52n,122:15:58w,736m,t,anderson mtn, 6,48:55:13n,120:13:41w,2518m,t,andrew peak, 8,47:58:06n,119:55:15w,907m,t,arbuckle mtn, 11,48:39:49n,121:31:14w,2138m,t,bacon peak, 12,48:46:38n,121:48:48w,3176m,t,baker mtn, 13,48:57:12n,120:15:34w,2419m,t,bald mtn, i re-edit file reads: 1,47:26:23n,121:15:10w,1641m,t,3 queens mtn, 2,48:01:19n,119:56:12w,367m,t,alta lake, 3,48:40:19n,121:35:35w,1705m,t,anderson butte, 4,48:36:52n,122:15:58w,736m,t,anderson mtn, 5,48:55:13n,120:13:41w,2518m,t,andrew peak, 6,47:58:06n,119:55:15w,907m,t,arbuckle mtn, 7,48:39:49n,121:31:14w,2138m,t,bacon peak, 8,48:46:38n,121:48:48w,3176m,t,baker mtn, 9,48:57:12n,120:15:34w,2419m,t,bald mtn, any appreciated (and sorry if obvious question, after several attempts i'm not making progress). thanks chris # so

ruby - Radiant CMS and MySQL -

i'm trying install radiant cms, having problem trying configure mysql... i follow next tut , install radiant https://github.com/radiant/radiant/wiki/installing-on-ubuntu and in last step: rake db:bootstrap note: gem.source_index deprecated, use specification. removed on or after 2011-11-01. gem.source_index called /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rails-2.3.18/lib/rails/gem_dependency.rb:21. rake aborted! **adapter:mysql database:dev_earth0 username:root password:dbpass host:localhost database not configured** /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection' /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activerecord-2.3.18/lib/active_record/connection_adapters/abstract/connection_

python - how to find strings within two markers -

i using python text processing.basically want extract contents between 2 landmarks. specific contents following. how can design regular expression text between "find intent vulnerabilities" , "print intent summary". thanks find component vulnerabilities ****************************************************************************************** !!!@methods_for_class[org.apache.cordova.batterylistener$1*org/apache/cordova/batterylistener/execute(ljava/lang/string;lorg/json/jsonarray;lorg/apache/cordova/api/callbackcontext;)@70!] nil !!!@methods_for_class[org.apache.cordova.cordovawebview$1*org/apache/cordova/cordovawebview/setup()@124!] nil !!!@methods_for_class[org.apache.cordova.networkmanager$1*org/apache/cordova/networkmanager/initialize(lorg/apache/cordova/api/cordovainterface;lorg/apache/cordova/cordovawebview;)@57!] nil !!!@methods_for_class[org.apache.cordova.device$1*org/apache/cordova/device/inittelephonyreceiver()@29!] nil p

c++ - How Can I Make This Open GL Program Rotate Without Terminating -

so have opengl program displays cube using glulookat(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); and allows users modify/rotate along x, y , z axis using input. right looks works pretty well, however, terminates once image displayed according users input (on wether rotate along x, y or z axis). how can modify program can rotate without terminating? in, displaying first rotation during first input. or put simply, how can let users rotae cube along x,y , z axis in real time? //cube.cpp #include <gl/gl.h> #include <gl/glu.h> #include <gl/glut.h> #include <iostream> using namespace std; void init(void) { glclearcolor (0.0, 0.0, 0.0, 0.0); glshademodel (gl_flat); } void display(void) { glclear (gl_color_buffer_bit); glcolor3f (1.0, 1.0, 1.0); glloadidentity (); /* clear matrix */ /* viewing transformation */ /* move x, y , z axis*/ cout << "type x, y or z rotatate cube respective axis 5 degrees."

pdflatex - how to have latexmk work with emacs and okular -

i started using emacs don't know if doing correctly. c-c c-c prompt says command [pdflatex]: type in latexmk . expecting? giving following error: latexmk: initialization file '/home/dustin/.latexmkrc' gave error: substitution pattern not terminated @ (eval 10) line 1, <gen0> chunk 1. latexmk: stopping because of problem rc file here .latexmk file: $pdflatex = 'pdflatex -interaction=nonstopmode -file-line-error -synctex=1' -pdf %s; and here .emacs file: (add-to-list 'load-path "~/.emacs.d/plugins") (setq py-install-directory "~/.emacs.d/plugins") (require 'python-mode) ;; ========== prevent emacs making backup files ========== (setq make-backup-files nil) ;; ========== enable line numbering ========== (line-number-mode 1) ;; ========== set fill column ========== (setq default-fill-column 80) ;; =

java - JideTabbedPane inside JideTabbedPane in javaswing? -

i using jidetabbedpane. has 5 tabs.now requirement is-i have add 1 tab @ end of jidetabbedpane ,which acts "parent tab" button.on click of tabbed pane should open below child window.and on click of child tabbed pane tab corresponding panel should opened. i new swing.kindly help. thanks.

ajax - Rendering updated components from backing bean after Save -

i have been working on creating dynamic table captures cells have been updated (for quicker save) , refresh/rerender cells after save. so far, have table being created, of items updated being captured nicely via ajax listener, stuck on not being able refresh/rerender updated components after save. code snippet page: <h:form id="formmain" prependid="false"> <div id="contentwrapper"> <p:messages id="messages" severity="warn, error" autoupdate="true" closable="true" /> <div style="float:right; position:relative; top: -3px;"> <h:commandbutton id="btnsaveupdates" styleclass="save_updates_button"> <f:ajax execute="@this" listener="#{remediationdetail.processupdates}"/> </h:commandbutton> </div> <h:panelgroup id="detailedit" styleclass="clear_left" layout=&

cplex - C++ valgrid error: Invalid read of size 8, Address 0x8 is not stack'd, malloc'd or (recently) free'd? -

i compiled code , ran it, gave me segmentation error. so tested executable program using valgrid. got following message: ==7932== invalid read of size 8 ==7932== @ 0x491840: iloexpr::operator+=(ilonumlinexprterm) (in /home/hna/g) ==7932== 0x43f261: main (in /home/hna/g) ==7932== address 0x8 not stack'd, malloc'd or (recently) free'd ==7932== ==7932== ==7932== process terminating default action of signal 11 (sigsegv) ==7932== access not within mapped region @ address 0x8 ==7932== @ 0x491840: iloexpr::operator+=(ilonumlinexprterm) (in /home/hna/g) ==7932== 0x43f261: main (in /home/hna/g) ==7932== if believe happened result of stack ==7932== overflow in program's main thread (unlikely ==7932== possible), can try increase size of ==7932== main thread stack using --main-stacksize= flag. ==7932== main thread stack size used in run 8388608. ==7932== ==7932== heap summary: ==7932== in use @ exit: 88,192 bytes in 55 blocks ==7932== total heap

MySQL Multiple Select, Multiple Where Clauses -

instead of running hundreds of select queries 1 operation, want run 1 big query, i'm hoping ease load on server. select ( (select link_type_id connections (node_to_id = '0' , node_from_id = '1') or (node_from_id = '1' , node_to_id = '0')), (select link_type_id connections (node_to_id = '0' , node_from_id = '2') or (node_from_id = '2' , node_to_id = '0')) ) there many more selects in query, 2 aren't working. when run code error: operand should contain 1 column(s). any suggestions? thanks! you can try below may may need union select link_type_id connections (node_to_id = '0' , node_from_id = '1') or (node_from_id = '1' , node_to_id = '0') union select link_type_id connections (node_to_id = '0' , node_from_id = '2') or (node_from_id = '2' , node_to_id = '0')

java - Apache Mina Exception -

i have followed link example program using apache mina. these lib files used code. mina-core-2.0.7.jar slf4j-api-1.7.5.jar slf4j-jdk14-1.7.5.jar i getting following error: exception in thread "main" java.lang.classcastexception: org.slf4j.impl.jdk14loggeradapter cannot cast java.util.logging.logger @ minafiletrans.minaserverhandler.<init>(minaserverhandler.java:12) @ minafiletrans.minafiletrans.main(minafiletrans.java:23) java result: 1 here code: package minafiletrans; import java.util.logging.logger; import org.apache.mina.core.service.iohandleradapter; import org.apache.mina.core.session.idlestatus; import org.apache.mina.core.session.iosession; import org.slf4j.loggerfactory; public class minaserverhandler extends iohandleradapter { @suppresswarnings("nonconstantlogger") private final logger logger = (logger) loggerfactory.getlogger(getclass()); @override public void sessionopened(iosession session) { // set idle

Restricting forged access to remote PHP page which is usually accessed through AJAX -

i'm building drupal site has little voting system. have php page takes in parameters , updates voting database accordingly. how allow page accessed through ajax on drupal site otherwise restrict access outside users going url prevent forged voting? ajax == regular http request. cannot distinguish ajax request "normal access". there no way prevent this. to prevent wrong votes, need build such security voting system. require registration, use sessions , nonces or whatever necessary. trying "block non-ajax requests" not solution.

windows phone 8 - SRGS lexicon not loading (or being used) in WP8 -

i'm trying use windows phone 8 speech recognition recognize custom pronunciation of words. i'm try use samples provided on msdn, coming short. first of all, i'm using lexicon file (.pls) because "sapi" namespace inline pronunciations failing (for both pron , display attributes) - maybe i'll save different question. anyway, here's have: <?xml version="1.0" encoding="utf-8" ?> <grammar version="1.0" xml:lang="en-us" tag-format="semantics/1.0" root="thecolor" xmlns="http://www.w3.org/2001/06/grammar" > <lexicon uri="ms-appx:///srgslexicon.pls" /> <rule id="thecolor"> <item>blue</item> </rule> </grammar> that's srgs grammar. load this: dim srgsgrammar uri = new uri("ms-appx:///srgsgrammar.xml", urikind.absolute) _myrecognizer.grammars.addgrammarfromuri("srgsgrammar&q

ruby - is it ok to deploy an older version of your rails app to heroku not doing a rollback? -

if deploy v.15 heroku inside c:/app folder, causing unforeseen issues. can go through typical deploy using git add . git add -u git commit -m "older" etc on older version deploy v.13 backed few days ago? in v.15 deploy, there new table creation - > heroku rake db:migrate well i'm trying app working again want cautious yes. long normal commit in history of repo, should fine. said, better method accomplish you're trying might use git's cherry-pick functionality. if you're unsure, may wish create second application. can use new heroku fork feature (new of v2.36 of toolbelt - use heroku fork more info it) in order clone app new app. great way creating staging environment existing app. you use see how deploying new (old?) changes work. hope helps!

qt4 - How to transfer executable made of Qt 4.8.3 and OpenCV 2.4.3 from Ubuntu 12.10 to Fedora 14? -

i compiled qt-gui project using qt 4.8.3 & opencv 2.4.3 in ubuntu 12.10. need transfer executable fedora 14 run. but, 1st time, gave me error can't open file & asked me install pypar2. don't know installed & no longer gives me error. however, there no response @ when double-click executable. before did these, installed runtime libraries of qt(qt-devel-4.7.4-7.fc14.i686 & qt-x11-4.7.4-7.fc14.i686) , opencv(opencv-devel-2.1.0-6.fc14.i686) in fedora 14, version seems not match version in ubuntu. i tried build dependencies of project , save them in folder project's release folder contains executable, think it's kind of dynamic linking, , no responses well. looked through of static linking solutions not sure of them, wondering affect original configurations in ubuntu. can please show me steps or solutions on how run ubuntu compiled executable in fedora 14? thanks.

css - Vertical centering of text in div not working -

i have turned this guide solve problem of vertically centering text within div. , believe understand says, still doesn't work. .number { position: relative; height:50px; margin: -25px 0 0 0; top: 50%; background-color: #00ff00; } here fiddle , recreates problem. want green area (.number) centered vertically within button (.numberelement) where problem? reckon jquery mobile complicating things , creating structures not foreseeing... thank you! sandro you need make changes css so: .numberelement { position: absolute; width:30%; height:200px; margin:0px; display:table; } .numberelement .ui-btn-inner { display:table-cell; vertical-align:middle; } working demo

ios - How to add these three files properly?"Default.png, Default-568h@2x.png, Default@2x.png" for universal app for iPhone/iPad? -

Image
i added "default.png, default-568h@2x.png, default@2x.png" these 3 files in universal project splash image, have 3 diffrent image , resolution same mention in apple docs, ipad 768 * 1024 , iphone-4s -> 320 * 480 , iphone 5-> 640 * 1136. but problem when rum on iphone4s- iphone5 splash rum properly, when run on ipad deafault.png splash not showing instead of takes reference default-568h@2x.png. default-568h@2x.png showing on ipad instead of deafault.png , image got blur , shrink on ipad also, beacuse deafault.png not showing. how slove problem. any idea or suggestion experts highly welcome. first suggest that, preapre images, select project project navigator , go summary , scroll down screen appears, right click on , choose file computer automatically copied project , entered in plist file also.. if application universal have set iphone , ipad both. `

node.js - Disabling warning about "require" function in JSHint -

i'm writing code node.js , i'm using jshint check on code. however, when use require function import modules, says "'require' not defined". how can suppress warning? "use strict"; var express = require('express'); var register = require('./routes/register'); jshint not aware of node.js globals default need inform it. add comment top: /* jshint node: true */

html - prevent div getting pushed down on toggle with jquery -

i have 2 divs that's open on-click. function works pretty smooth except first div keeps pushing down second div. want them stay on each others side. i created js fiddle, http://jsfiddle.net/qskxa/1/ i think problem in html file ? thanks <div id="artistsbox"> <div class="artist"> <ul class="ulartists"> <li> <span class="toggle">artist 1</span> <div class="toggle_hide"> <p> hello world</p> </div> </li> <li> <span class="toggle">artist 2</span> <div class="toggle_hide"> <p> hello world</p> </div> </li> </ul> </div> </div> i'm not 100% sure you're looking (is buttons want side-by-side?) if use css positioning, can remove hidden images flow of document,