Posts

Showing posts from July, 2011

api - Send data quickly to google app engine from android -

i'm looking way fast communication between android phone , google app engine. normal http request taking 1 second or more. there api can use faster communication. your app engine application experiencing loading requests . if application receiving infrequent traffic or encountering large traffic spikes new instances need initialized (i.e. code need loaded first time). makes requests take longer. to resolve issue, set number of minimum idle instances (do not alter pending latency or maximum idle instances). if application experiencing traffic spikes, consider enabling warmup requests .

sql - How to insert data into mysql with order -

if insert sql without "order by", records in sql arranged insert time. i have table: authorization( pin, code) however, run insert authorization(pin, code) values ('12', 'abcd'). after insert few records, query data , find these records have no order. how can insert data insert time order. thank you tables in sql have no inherent ordering. definition of language. want add autoincrement id column data: create table authorization ( authorizationid int auto_increment primary key, pin . . . code . . . . . . ); then when insert as: insert authorization(pin, code) . . .; a new id generated automatically. id remember insert order. way, might want timestamp column, if want remember exact time of insert well.

javascript - Passing Session Variable from php to JS -

good day community. using jquery gets content within td cell. passing content via variable file. i'm trying figure out best way grab session variable , seem have hit rut. below brief pseudo code along js/jquery. edit/update correction post below well. here manageusers.inc.php <?php // load 404 page if file accessed directly if(!defined('include_check')) die(header("http/1.0 404 not found")); // load 404 page if page accessed users or qa agents if($_session['role_id']<2 or $_session['role_id']==5) die(header("http/1.0 404 not found")); ?> <script src="/resources/js/getbusinessunit.js"></script> <script type="text/javascript" src="../../resources/js/user.js"></script> <div id="main"> <div class="container"> <h1>manage users</h1> <h2>this page allows add , update authorized users</h2> </div&g

cocos2d, too many variables? -

this difficult explain, i'll best, thank in advance help... have cocos2d game, working should, weirdest thing happens when add integer or other variable top of .m file, removechild processes stop working. i define integer, int endgame; when run game label "round 1" comes up, removechild process doesn't work. if removed defined integer, int endgame; removechild works. why happen?

javascript - How to close autocomplete dropdown on side click -

i user jquery autocomplete fetch results , results displayed when click on side can't close dropdown returned results. $(function () { $("#search").autocomplete({ source: function (request, response) { $.ajax({ url: '@url.action("testautocomplete", "home")', type: "post", datatype: "json", data: { query: request.term }, success: function (data) { response($.map(data, function (item) { return { label: item.title }; })); } }); }, minlength: 1, select: function (event, ui) { onitemselect(ui.item); }, open: f

linux - bash: check if multiple files in a directory contain strings from a list -

folks, i have text file contains multiple lines 1 string per line : str1 str2 str3 etc.. i read every line of file , search strings inside multiple files located in different directory. i not quite sure how proceed. thanks help. awk 'nr==fnr{a[$0];next} { (word in a) if ($0 ~ word) print filename, $0 }' fileofwords /wherever/dir/*

ruby on rails - Disable or toggle Action Mailer -

what best way go adding in function toggling mailer in rails? user able perhaps click button , mails being sent out disabled/enabled. if have kind of queue system, i.e, resque , sidekick believe in moment there jobs enqueued mailing, can kill queue , dump these mails , whatever. research rails , queues. it's pretty basic stuff.

websphere mq fte - Need to know about the best Managed File Transfer tools available in market considering all the major constraints -

need know best managed file transfer tools available (open source or licensed) in market considering major constraints. importantly should used enterprise integration high availability. have worked mft tools each has own advantages , disadvantages. i'm sure you've done google research on mft solutions, assume you're looking personal opinions validate direction you're headed. i've evaluated linoma, ipswitch, townsend, globalscape, liaison, , axway. i've got comparison table somewhere put our analysis outlined needed in solution , found linoma best fit bill. i've used linoma's goanywhere mft solution few years , still pleased it. company keeps changing technologies, has powerful scripting capabilities yet keeps simple manage , administer. key management, scheduling, alerts, logging, role management, ha integration, data manipulation, multi-platform, mobile app, , more of many functions. 1 of best things linoma dedicated support team.

Errors when trying NetSuite's Restlet interface: datain is null -

i'm trying out restlets first time , having trouble returning data. i've built basic restlet , deployed in netsuite. code follows: function getrestlet(datain) { return nlapiloadrecord(datain.recordtype, datain.id); // e.g recordtype="customer", id="769" } using chromes' rest console application i've set following: request uri: https://rest.netsuite.com/app/site/hosting/restlet.nl?script=123&deploy=1&recordtype=customer&id=2409 request headers: nlauth nlauth_account=123456,nlauth_email=email@emailaddy.com,nlauth_signature=password running get operation return following error: error code: js_exception error message:type followed following email: date & time: 8/19/2013 2:48 pm execution time: 0.06s script usage: 0 script: getrecord type: restlet function: getrestlet error: sss_missing_reqd_argument type stack trace: getrestlet(getcustomer.js:14) restletwrapper(null$lib:3) the customer record exists, restlet

Custom Sorting of Solr Facet Values - Rails & Sunspot Solr -

i using sunspot solr drilldown faceted searching. having issue when trying display facet values sorted in order need be. products have sizes either (s, m, l, xl, xxl) , products have sizes ranging such shoe sizes (8, 9, 10, 11, 12, 13). when setting facet.sort method 'index' puts string values alphabetical order, results in [l, m, s, xl, xxl] , [10, 11, 12, 8, 9] respectively. method achieving custom sort method achieve these goals? my contoller: @search = product.search fulltext params[:search] facet(:size, :sort => :index) with(:size, params[:size]) if params[:size].present? end my view: <% row in @search.facet(:brand).rows %> <li> <% if params[:brand].blank? %> <%= link_to link_to "#{row.value} (#{row.count})", params.merge({:brand => row.value}) %> <% else %> <strong><%= row.value %></strong> (<%= link_to "remove", params.merge

c# - Bind two pages in wpf -

i need populate combobox in page1 address details of selected name contained in combobox held in mainwindow page. have tried code below, combobox name in mainwindow not recognised. mainwindow: private void displayparts() { try { sc.open(); string query = "select * parts"; sqlcommand createcommand = new sqlcommand(query, sc); sqldatareader dr = createcommand.executereader(); while (dr.read()) { string name = dr.getstring(1); cbparts.items.add(name);//displaying list in combo box } sc.close(); } catch (exception ex) { messagebox.show(ex.message); } } page1: private void combobox_selectionchanged_1(object sender, selectionchangedeventargs e) { string constring = "data source=.;initial catalog=**.mdf;integrated security=true"; dataco

elasticsearch - Elastic Search dynamic field stored as both analyzed and not_analyzed -

i trying index json documents in elasticsearch. don't have schema of document, dynamic. i need store fields both analyzed , not analyzed. need dynamic. can use dynamic templates achieve ? also possible keep field names same both analyzed , not analyzed ? do need special handling while searching fields ? you accomplish using dynamic templates yes, creating dynamic mapping fields (or pattern of fields, e.g strings) this: "dynamic_templates":[ { "template_mystringfields":{ "match":"somepattern", "mapping":{ "type":"multi_field", "fields":{ "{name}":{ "type":"string", "index":"not_analyzed", }, "_tokenized":{

javascript - Is there any way to use the JQuery GetJSON method to get HTML from an external page? -

so let's you're trying jquery ajax request, like: $.ajax({ ... url: http://other-website.com ... }) i understand because of same-origin principle, request fail because url external domain. however i've heard getjson() not obey principle , can send asynchronous requests external servers using jsonp , appended url. my question is: possible use getjson() retrieve html external name single string within json object? if doesn't default, there way can force / trick doing so? yes, can request html remote location, must use proxy so. 1 publicly available proxy yql. http://jsfiddle.net/bkjwu/ var query = 'select * html url="http://mattgemmell.com/2008/12/08/what-have-you-tried/" , xpath="//h1" , class="entry-title"'; var url = "http://query.yahooapis.com/v1/public/yql?q=" + query + "&format=json&callback=??"; $.getjson(url,function(data){ alert(data.query.results.h1.con

sql server - php pdo with mssql and a dns -

trying see if can make pdo open mssql database on server. vbscript call connection looks this: set myconn = server.createobject("adodb.connection") myconn.open("dsn=mydsn;uid=myuid;pwd=mypwd;database=mydatabase;app=asp script") then when trying port on php using pdo unable find information on using dsn pdo. here have far: try { $conn = new pdo('mssql:server=localhost;database=mydsn','myuid','mypwd') or die('error'); $conn->setattribute( pdo::attr_errmode, pdo::errmode_exception ); $sql = "select name people"; $qresult = $conn->prepare($sql); $qresult->execute(); foreach ($qresult->fetch(pdo::fetch_assoc) $row){ echo $row['name'].'<br/>'; } } catch (pdoexception $e) { print "error!: ".$e->getmessage()."<br/>"; die(); } but get error!: sqlstate[hy000]: general error: 10007 invalid object name 'name'

php - XML Parsing/division issue -

i messing below code, , can not seem work correctly... gather of code working fine, bar division $distance1 variable. <?php $start = 'ec1v 0es'; $end = 'ec4r 3tn'; $url = 'http://maps.googleapis.com/maps/api/directions/xml?origin='.$start.'&destination='.$end.'&sensor=false'; $xml = simplexml_load_file($url); $distance = $xml->route->leg->distance->text; $distance1 = $distance/1.609; // divided 1.609 convert km miles echo $distance; echo '<br />'; echo $distance1; ?> does 1 have ideas ever causing this? have tested online , taken googleapis url ( http://maps.googleapis.com/maps/api/directions/xml?origin=ec1v+0es&destination=ec4r+3tn&sensor=false ) , seems if code pulling correct values, isn't dividing or something... ahh confused , bit of noob go nicely please :) you should cast $distance float $start = 'ec1v 0es'; $end = 'ec4r 3tn'; $url = 'http://map

ruby - NoMethodError at / undefined method `include?' for nil:NilClass -

i'm trying build sinatra ruby app. having trouble undefined method error. keep trying utilize method_missing i'm afraid keep messing syntax. write if else statement specifying if @x returns nil? i'm kinda of new , use help. thanks! my rb file '/' @x = params[:body] session[:a] = (params[:body].partition(' ').last.to_f / 2.2) * 0.58 if @x.include?("weight") session[:b] = params[:body].partition(' ').last.to_f * 0.9672 if @x.include?("drinks") session[:c] = params[:body].partition(' ').last.to_f * 0.015 if @x.include?("time") session[:d] = params[:body].partition(' ').last if @x.include?("tweet") bac = round_to_precision(session[:b]/session[:a]-session[:c],3) timeleft = 40*(bac-0.08)/0.01 hoursleft = (timeleft / 60).floor minutesleft = (timeleft - (hoursleft.floor * 60)).floor subliml = twilio::twiml::response.new |r| if bac >= 0.08 r.sms "

css - Menu slide up leaving a gap in IE -

Image
the code here. chrome , firefox work well: http://jsfiddle.net/cau9t/4/ it happens in ie. versions of ie... idea? this ie glitch on rendering shadows. work around have element below shadowed element, force shadow area redrawn suggested on answer: ie 9 , 10 box-shadow on resizing element your ul absolute positioned, nothing gets pushed when height change. can fix problem adding pseudo element ul itself: ul.division:after { content: " "; display:block; height:15px; width:100%;} updated fiddle - http://jsfiddle.net/cau9t/5/

emacs - How do I edit the system definition files for quicklisp -

i'm trying install fuf/surge on windows computer, , got stuck on step. instruct quicklisp find system definition files load fuf , dependent modules. create file in folder: ~/.config/common-lisp/source-registry.conf.d content: (:source-registry (:tree (:home "fuf")) :inherit-configuration) i wondering how file listed above , how edit it? have emacs installed quicklisp/slime. ok need make these subfolders in home directory. i'm guessing installed under windows saw comment on video! remember part of install created home folder , setting it's path in environment variables. ~ symbol home directory need create directories path ~/.config/common-lisp/source-registry.conf.d\ setup c:\home.config\common-lisp\source-registry.conf.d\ inside create directory creare fuf.conf file , paste lines instructions. i haven’t got windows machine hand that's enough going!

jsf 2 - What is difference in JSF between component.getAttributeName() vs. component.getAttributes().get("name") -

what difference in jsf between uicomponent component; component.get *attributename*() , component.getattributes().get("attibute name") ? component.set *attributename*(value) component.getattributes().put("attibute name", value) ? make difference if example set disabled=true attribute in invoke phase in getattributes() hashmap ? functionally, doesn't make difference. technically, uicomponent#getattributes() allows developer not worry exact component type while getting/setting attributes. look @ particular example disabled="true" . uicomponent superclass doesn't have isdisabled() method @ all. you'd need perform instanceof check on e.g. htmlinputtext before can cast , invoke isdisabled() on it. getattributes() easier in order independent that. lot of uicomponent related methods in standard jsf api take or return uicomponent superclass instead of specific type. in designed components, both delegate under c

facebook - Store user account information on a Windows Azure Table -

is there quick way store user account information, extracted facebook or other providers, in window azure table? using authentication on mvc 4, can let users log in website , extract info store on sql database. wondering if there's similar using windows azure storage. there is/was table storage membership provider floating around while ago. believe may have been part of samples in windows azure training kit. may provide membership provider similar sql provider referenced. as facebook data, that's going application (get auth token, retrieve user profile data facebook, store in data store, etc.)

vb.net - VB Application Opening on Development Computer, Not on ANY other PC -

i created simple vb application in visual studio. works fine on development computer, not on desktop. both have .net 4.5 installed. what's happening here? happens, when app run on non-development computer, mouse wheel spins, spinnning away after few seconds. no idea. also, note, shows in task manager few moments, dissapears too. edit: here's event logs if wants take , me figure out. http://www.mediafire.com/download/rsrp1w6yyz1eoat/eventlogs.evtx

c# array multidimensional or jagged -

i'm drawing 3x3 grid of squares 2d game map. i want create array has row , column position , each row , column position, has 4 0's or 1's representing if wall drawn on edge of square. i want create array: int [,][,,,] boxes = {{0,0}, {1,0,0,1}, {1,0}, {1,0,1,0}, {0,1}, {0,0,0,1}, {1,1}, {1,1,1,0}, {2,0}, {1,1,0,0}, {2,1}, {0,0,0,1}, {3,1}, {1,0,1,0}, {0,2}, {0,0,1,1}, {1,2}, {1,0,1,0}, {2,2}, {0,1,1,0}}; however, seems not correct. i have tried this: int [][] boxes = new int [2][4] boxes = {{0,0}, {1,0,0,1}, {1,0}, {1,0,1,0}, {0,1}, {0,0,0,1}, {1,1}, {1,1,1,0}, {2,0}, {1,1,0,0}, {2,1}, {0,0,0,1}, {3,1}, {1,0,1,0}, {0,2}, {0,0,1,1}, {1,2}, {1,0,1,0}, {2,2}, {0,1,1,0}}; is clear, type of array trying make? how this? thanks a problem

.htaccess - Htacces Apache END Flag alternative -

i wrote small framework (php) small projects, in should redirected index.php?path=$1, except defined paths. end flag not problematic. end flag exists still since apache 2.3 , script should work on apache 2.2 servers. has idea how can realize without end flag? rewriteengine on # define static redicts rewriterule ^image/(.+)$ public/image/$1 [end,qsa] rewriterule ^css/(.+)$ public/css/$1 [end,qsa] rewriterule ^js/(.+)$ public/js/$1 [end,qsa] rewriterule ^lib/js/core/(.+)$ core/lib/js/$1 [end,qsa] rewriterule ^lib/js/(.+)$ public/lib/js/$1 [end,qsa] rewriterule ^cache/(.+)$ public/cache/$1 [end,qsa] rewriterule ^download/(.+)$ public/download/$1 [end,qsa] # define custom redicts rewriterule ^page/([0-9]+)$ index.php?path=index.php&page=$1 [end,qsa] # define other redicts rewriterule ^(.+)$ index.php?path=$1 [l,qsa] since of rules end end flag, more or less want prevent looping of rewrite engine @ all. accomplish same thing without using end flag, replace them l

javascript - Client Location Detection Works on Safari Desktop But Not Safari Mobile -

i'm trying set client location detection mobile web site using code below: <html> <head> </head> <body> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=geometry"></script> <script> var geocoder = new google.maps.geocoder(); var loc = {}; if(google.loader.clientlocation) { loc.lat = google.loader.clientlocation.latitude; loc.lng = google.loader.clientlocation.longitude; } var clientlocation = new google.maps.latlng(loc.lat, loc.lng); alert(clientlocation); </script> </body> </html> this works fine on safari on desktop returns (nan,nan) when run on safari mobile browser. can suggest might going wrong? i believe above code works.

actionscript 3 - How to Flash CS5 AS3 Random Elastic? -

i made photo gallery, every photo start come in with: new tween(uiloader,"rotationx",elastic.easeout,90,0,4,true); and it's cool if photos come in same way, it's little bit tiered @ it. want ask here code make random fade, blinds, iris, fly, dissolve, squeeze, wipe, zoom, rotationx, elastic.easeout???? here code: function completehandler(event:event):void { uiloader.x = (back.width - uiloader.content.width) >> 1; uiloader.y = (back.height - uiloader.content.height) >> 1; new tween(uiloader,"rotationx",elastic.easeout,90,0,4,true); } something ? var properties:array = ['rotationx', 'rotationy', 'rotationz', 'rotation']; var eases:array = [elastic.easein, elastic.easeinout, elastic.easeout, bounce.easein, back.easeout]; function completehandler(event:event):void { uiloader.x = (back.width - uiloader.content.width) >> 1; uiloader.y = (back.height - uiloader.c

javascript - Get last inserted id from Sequelize.js "query" (MySQL) -

i'm using sequelize in 1 of projects , having trouble custom non-model query. for example: var query = "insert table (name) values ("bob");"; sqlcon.query(query) .on('success', function(result) { console.log(result); // no inserted record or last insert id }); i have inserted record returned me in case or @ least record id. missing make sure "result" gets populated? try this: var sequelize = new sequelize('testa', 'testa', 'testa', { dialect: 'mysql', dialectoptions: { flags: '-found_rows' } });

c# - XCopy commands to archive files with original date stamp -

i trying write .net console app use xcopy copy on files newer x days, while maintaining original date created timestamp. have command: /// <summary> /// performs copy , verification using xcopy /// </summary> /// <returns>true if success, false otherwise</returns> internal bool copyandverify() { string date = @"d:" + time.tostring("mm/dd/yyyy"); date = date.replace('/', '-'); date = date.insert(0, "/"); process exeprocess = new process(); processstartinfo startinfo = new processstartinfo(); startinfo.createnowindow = false; startinfo.useshellexecute = false; startinfo.redirectstandarderror = true; startinfo.redirectstandardinput = true; startinfo.redirectstandardoutput = true; startinfo.filename = "xcopy.exe"; startinfo.windowstyle = processwindowstyle.hidden; startinfo.argu

vba - Is it possible to click buttons in the toolbar with macros in Excel 2010? -

is there anyway make macro can click buttons in tool bars of excel? i'm using excel 2010. here's how can record macro, capture actions. for excel 2010: http://www.dummies.com/how-to/content/how-to-record-a-macro-to-automate-tasks-in-excel-2.html for excel 2013: http://www.dummies.com/how-to/content/how-to-record-new-macros-in-excel-2013.html in case, take further, can coded ui testing right visual studio . trying do, better trying automate button-click fire custom add-in.

jquery - Backbone model change event not firing after setting model -

i took non kosher approach , used $.ajax() ajax file upload because @ moment can't figure out "backbone" way. picture has been uploaded , ajax request sends new backbone model in json, populated filename of new photo. model not firing change event can't populate profile picture. see success function below. getfile:function(e){ e.preventdefault(); = this; var file = e.target.files[0]; name = file.name; size = file.size; type = file.type; var formdata = new formdata($('#upload-child-pic-form')[0]); console.log(this,'currentuploadu',this.currentupload); formdata.append('child_id',this.currentupload); $.ajax({ url: '/children/upload/', type: 'post', xhr: function() { var myxhr = $.ajaxsettings.xhr(); if(myxhr.upload){ myxhr.upload.addeventlistener('prog

ruby on rails - What URL should I use to PUT an update? -

i have rails app picked has following command in "rake routes": put /testclass/:id(.:format) testclass#update i want send put update testclass id 18445 , change finished false: /18445&finished=false for example. my understanding should able done http request in browser, example, can it? or need use ruby command? guidance? you not need use ruby command access route make update. basic html (you can edit action relevant route): <form action='testclass/18445' method="post"> <input type="hidden" name="_method" value="put"> <input name="authenticity_token" value="<%= form_authenticity_token %>" type="hidden"> <input type="hidden" name="testclass[id]" value="18445" > <input type="hidden" name="testclass[finished]" value="false" &g

ruby on rails - If statement on input select -

in form have <!-- allow custom orders field --> <div class="control-group"> <label class="control-label">allow custom orders?</label> <div class="controls"> <%= f.select :allow_custom_orders, [["yes", 1], ["no", 2]], label: false %> </div> </div> on show want check if "yes" or "no" selected , show button. <% if @shop.allow_custom_orders = "1" %> <div> <small>need custom order?</small> <%= link_to "request custom order", "#", class: "btn btn-small btn-embossed btn-block btn-info" %> </div> <% end %> but seems not work, suggestions ? i'm new rails bear me :) ok found out :) pretty simple <% unless @shop.allow_custom_orders == 2 %>

how can i add values from a loop in java -

i've been given question uni in regards credit card statement says have string of numbers, convert these numbers separate integers increment them power of 10 depending on position in string using horners method have add values loop make 1 whole integer. know odd way convert string int assignment states have use horners method convert string rather use inbuilt java classes/methods my question is, how can add separate weighted numbers , concatenate them 1 single number. if helps example be, given card number 1234, number weighted according position , length so: 1 - 1000 2 - 200 3 - 30 4 - 4 then these added create whole number 1, 2, 3,4 ---> 1234 here code far public static long toint(string digitstring) { long answer = 0; long val = 0; string s = ""; (int j = 0; j < digitstring.length(); j++) { val = digitstring.charat(j) - '0'; val = (long) (val * math.pow(10, (digitstring.length() - 1) - j)); syst

c++ - Translating a camera along a quaternion using glm -

i trying translate camera's position along orientation defined in glm::quat. void camera::translatecameraalongz(float distance) { glm::vec3 direction = glm::normalize(rotation * glm::vec3(0.0f, 0.0f, 1.0f)); position += direction * distance; } this works fine when rotation identity quaternion. x , z translations not work when rotation else. when camera rotated 45 degrees left , call translatecameraalongz(-0.1f) translated backwards , left when should going backwards , right. translations not @ perfect 90 degree increments messed up. doing wrong here, , simplest way fix it? in case might relevant, here function generates view matrix , function rotates camera: glm::mat4 camera::getview() { view = glm::tomat4(rotation) * glm::translate(glm::mat4(), position); return view; } void camera::rotatecameradeg(float x, float y, float z) { rotation = glm::normalize(glm::angleaxis(x,glm::vec3(1.0f, 0.0f, 0.0f)) * rotation); rotation = glm::normalize(glm::angl

c - How to count 1 in a int variable -

this question has answer here: how count number of set bits in 32-bit integer? 48 answers if have int = 15; know 0x00 00 00 0f in binary 0000 0000 0000 0000 0000 0000 0000 1111 has 4 1 in binary. i want count sum of 1 in int variable. i write this: int count1(int i) { int j = 0,num = 0; for(;j<32;j++) if((i<<j )&0x80000000) num++; return num; } it can work, think slow,i mean maybe have millions int data. dose 1 have more effective way this? int main() { int number = 15; int sum; // total bits set in number (sum = 0; number; sum++) { number &= number - 1; } cout<<sum<<endl; }

ios - Fetch location from carrier not lat/lon -

most people remember old nokia phones, showed current district (cell tower) connected to. is information available on ios? if so, how fetch info? so mean when in new york example return "fulton" district... you don't access cell tower information described on ios, can use corelocation framework (mapkit if want backward compatibility ios 5.0 reason) reverse geocode , detail available. for ios 7.0, use clgeocoder object. clgeocoder *geocoder = [[clgeocoder alloc] init]; [geocoder reversegeocodelocation:location completionhandler:^(nsarray *placemarks, nserror *error) { // iterate through available placemarks }]; the location parameter cllocation object have received or created user's location. reverse geocode requests array in completion handler contain single placemark. various properties , corresponding real-world relations placemark object can found here

html - How to use bootstrap-theme.css with bootstrap 3? -

after downloading complete pack of bootstrap 3 http://getbootstrap.com , noticed there separate css file theme. how make use of it? please explain? i included bootstrap-theme.css in existing bootstrap project, there no difference in output. first, bootstrap-theme.css nothing else equivalent of bootstrap 2.x style in bootstrap 3. if want use it, add along bootstrap.css (minified version work too).

Get Data Change Values in Java Server Application from Java Client Application -

i want read opc tags in java client program , want send data change values tags ( tags values getting changed ) java server application on tcp / ip network . how can achieve aim ? please ! thanks sarabjot singh manku you need create subscription client on tags want new value. the server able send each time new value tags have been updated.

c# - The state-preserving dictionary isn't preserving state -

i have followed tutorial here preserve state between pages. however, state dictionary empty, when programatically navigate page! seems problem here? i have tested behaviour on emulator 8.0.10322 720p. this do: protected override void onnavigatedfrom(navigationeventargs e) { base.onnavigatedfrom(e); if (e.navigationmode != navigationmode.back) { state["is"] = resultslist.itemssource; state["si"] = resultslist.selecteditem; state["dgtest"] = new data(); state["test"] = "gi2"; } } protected override void onnavigatedto(navigationeventargs e) { base.onnavigatedto(e); if (e.isnavigationinitiator && e.navigationmode != navigationmode.back) { resultslist.itemssource = (system.collections.ilist) state["is"]; resultslist.selecteditem = state["si"];

Installing a local package on Meteor -

i'm trying run local package on meteor. i've got correct package.js, have smart.json, , it's inside /packages directory in meteor project. smart.json @ project looks this: { "packages": { "router": {}, "usererrors": { "path": "/home/user/documents/project/packages/usererrors" } } } and using api.add_files , correctly. code runs fine when take out of packages folder. there i'm missing in order make package run? i'm running meteor mrt command. try put files in 'packages' directory of app , execute : meteor add [package-name]

ios - How to record Piano? -

i have piano app touch based tones , want put recording feature in it. can guide me this. need record , send stream. -(void) viewdidload { [super viewdidload]; [keyboardview setvisiblekeyrange: nsmakerange(48, 5)]; if (audio == nil) { [self setaudio:[nsmutablearray arraywithcapacity:0]]; } [drawingview setshowoutsideledger:yes]; nsstring* plistpath = [[nsbundle mainbundle] pathforresource:@"keyboardlayout" oftype:@"plist"]; nsarray* names = [nsarray arraywithcontentsoffile:plistpath]; // load audio (int = 0; < [names count]; i++) { systemsoundid soundid; audioservicescreatesystemsoundid((__bridge cfurlref)[nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:names[i] oftype:@"aif"]], &soundid); nsnumber* audioid = @(soundid); [audio addobject:audioid]; } [[self keyboardview] setdelegate:self]; [[self octaveselectionview] setdelegate:self];

ibm midrange - Can't convert Spooled file data - Java (JT400) -

i'm tried convert (read) *scs spooled file using java (jt400) when trying convert , got error message "com.ibm.as400.access.as400exception: cpf3394 cannot convert spooled file data." anyone know how fix ? as400 sys = new as400(); spooledfile sf = new spooledfile( sys, // as400 "cusr_r1", // splf name 2, // splf number "qpadev003h", // job name "user", // job user "096018" ); // job number printobjectinputstream inputstream = sf.getinputacifmergedstream(true); system.out.println ("size " + inputstream.available()); bufferedreader d = new bufferedreader(new inputstreamreader(inputstream)); string data =""; while((data = d.readline()

android - Define layout content area -

Image
i want define contentarea of frame/linear/relative layout when layout.addview(view); added within boundries , rest of view clipped away. picture of shirt, if want define boundries of shirt area of content...how can that. suggestions/help? thanks ps: cannot in 9-patch (right , bottom) defines in rectangular shape, in case shape can of shirt. want omit white/transparent part contentarea. try below code :- in case trying solve same problem, there better solution: bitmap.createbitmap(bitmap, int x, int y, int width, int height). example, if need crop 10 pixels each side of bitmap use this: bitmap croppedbitmap = bitmap.createbitmap(originalbitmap, 10, 10, originalbitmap.get

c# - Unexpected behavior Outlook Redemption on Windows 7 -

i'm in process of migrating development pc windows xp (professional, sp3, x86) windows 7 (professional, sp1, x86). source of application i'm working on same on both machines, fails on windows 7 machine when initiating rdosession. // initialize session. _session = new rdosession(); // throws exception... _session.logonexchangemailbox("mailbox@mydomain.com", "mail.mydomain.com"); this piece of code results in following exception: system.runtime.interopservices.comexception caught message=creating instance of com component clsid {29ab7a12-b531-450e-8f7a-ea94c2f3c05f} iclassfactory failed due following error: 8004010e. source=mscorlib errorcode=-2147221234 stacktrace: @ system.runtimetypehandle.createinstance(runtimetype type, boolean publiconly, boolean nocheck, boolean& canbecached, runtimemethodhandleinternal& ctor, boolean& bneedsecuritycheck) @ system.runtimetype.createinstanceslow(boolean publiconly, boolean skip

c - How to access members of a structure in an array? -

this must simple issue, have structure 4 elements in it, 1 structure variable initialized array, problem can access first row of array don't know how access remaining rows...please guide me! //structure defined follows typedef struct{ char first_name[100]; char second_name[100]; int x_position; int y_position; } names; int main(void) { int i=0; //here have initilized structure variable names my_data[] = { {"first", "row", 20, 12}, {"second", "row", 55, 30}, {"third", "row", 80, 47}, {"fourth", "row", 27, 34} }; //trying acess diffrent row elements ....but dont know how?? for(i=0; i<=3; i++) { printf("%s\n",my_data->first_name); printf("%s\n",my_data->second_name); printf("%d\n

Rails Paperclip result array index -

i try method avatar assets. user.rb code: def get_avatar(size) if self.assets.length != 0 self.assets.each |asset| if asset.avatar asset.photo.url(size) end end else default_avatar(size) end end in view: user.get_avatar(:small) it should work in view have this: <img alt="jpeg&quot;, photo file size: 121649, photo updated at: &quot;2013 08 20 07:51:42&quot;, user id: 109, active: false, avatar: true&gt;]" src="/images/[#&lt;asset id: 176, created_at: &quot;2013-08-20 07:51:43&quot;, updated_at: &quot;2013-08-20 07:51:43&quot;, photo_file_name: &quot;user_2.jpg&quot;, photo_content_type: &quot;image/jpeg&quot;, photo_file_size: 121649, photo_updated_at: &quot;2013-08-20 07:51:42&quot;, user_id: 109, active: false, avatar: true&gt;]"> it doesn't take photo.url(size) whole array index. when do: rails.logger.fatal "check_me #{asset.photo.url(size)}&qu

php - delete string date in mysql -

i have table on datebase: id, mark, date. the date format this: dd.mm.yyyy (dd: 01-31, mm: 01-12, yyyy: 0000-9999) i need write query mysql on php, delete line has difference between record , present time more 7 days. this: mysql_connect($this->hostname, $this->username, $this->password) or die('could not select database.'); mysql_select_db($this->dbname) or die(mysql_error()); $query = "delete result date-".date('d.m.y')">7";//? mysql_query($query) or die(mysql_error()); how write correct query? you can this: delete result now()>`date` + interval 7 day tip: not use function names , reserved words column or table names. tip: not use mysql_* functions since officially deprecated

jquery - Align division at the bottom of page -

is there way can align division @ bottom of actual html page, , not of screen, if page height larger of screen, meaning there scroll, division should stay fixed @ bottom. .contact_us{ display: none; position: absolute; bottom: 0; right: 0; width: 500px; height: 500px; background-color: green; z-index: 500; } with set in css, seems uses bottom of screen , not page it's self as mentionned in comments, need have somewhere refer when using css positioning or automatically refer window. absolute refers first parent non static (default) positioning. common trick use relative positioning handy because has no effect if don't set offsets (top, left ...) beside changing type of positioning becoming reference positioning children you can see effects here : http://jsfiddle.net/techunter/m4ksq/ shorthand answer make 1 parent non-static position like #some_parent{ position:relative; }

c - bzero() & bcopy() versus memset() & memcpy() -

is there reason use non-standard bzero() , bcopy() instead of memset() , memcpy() in linux environment? i've heard many they're better linux compilers, haven't seen advantages on standard functions. are more optimized standard ones, or have behavioral particularity they're preferred? the bzero , bcopy functions aren't standard (iso) c, posix thing (in terms of official standards - in actuality pre-dated both iso , posix). and note word "were" - deprecated in posix.1-2001 , removed in posix.1-2008 in deference memset , memcpy , memmove , you're better off using standard c functions. if have lot of code uses them , don't want have go , change (though should @ point), can use following quick substitutions: // void bzero(void *s, size_t n); #define bzero(s, n) memset((s), 0, (n)) // void bcopy(const void *s1, void *s2, size_t n); #define bcopy(s1, s2, n) memmove((s2), (s1), (n))

java - Javafx webview integration spagobi -

i try integrate spagobi in javafx application load url directly spagobi can see legend not displayed. can run code below see problem. configuration : javafx 2.2.x , java 7. have idea ? workaround ? need work on java 7 can't use java 8. thanks in advance ! best regards, florian package javafxapplication3; import java.io.ioexception; import java.util.logging.level; import java.util.logging.logger; import javafx.application.application; import static javafx.application.application.launch; import javafx.geometry.hpos; import javafx.geometry.vpos; import javafx.scene.node; import javafx.scene.scene; import javafx.scene.layout.hbox; import javafx.scene.layout.priority; import javafx.scene.layout.region; import javafx.scene.paint.color; import javafx.scene.web.webengine; import javafx.scene.web.webview; import javafx.stage.stage; import javax.script.scriptexception; import org.apache.axis.axisfault.*; public class javafxapplication3 extends application { private scene scene;

url rewriting - Rewrite PHP URL for Node.js -

i need rewrite url node: /single.php?articleid=123 to this: /article/123 this because company work printed out qr codes said url old software. software got rewritten in node, no qr code works anymore. how can support old url node? tried setting route it: app.get('/single.php?articleid=:id', log.logrequest, auth.checkauth, function (request, reponse) { response.send(request.params.id); }); but responds this: cannot /single.php?articleid=12 any ideas? thanks. express routes paths, should able route single.php , articleid req.query . app.get('/single.php', log.logrequest, auth.checkauth, function (request, reponse) { response.send(request.query.articleid); }); if want require query parameter route, can create custom middleware it: function requirearticleid(req, res, next) { if ('articleid' in req.query) { next(); } else { next('route'); } } app.get('/single.php', requirearticlei

css - Chrome wrapping text when using multiple languages and web fonts on windows -

Image
i have site has content in arabic , english, i'm using web font styling headers , buttons source sans pro english , droid arabic kufi arabic, css this: .header { font-family: 'droid arabic kufi', 'source sans pro', sans-serif; } the problem happens in chrome on windows when element has float style or displayed inline-block , reason wraps text it's not necessary, here example: this sample on mac, shows on 1 line, 156px width. this sample on windows, shows on 2 lines 154px width. if add white-space: nowrap; element windows show right, , makes weird uses same width 154px. i don't want apply white-space: nowrap; because need wrap text, , it's not easy job places need use custom font , not wrap text. i think problem has white spaces, because faced issue whitespace replaced rectangle on chrome this issue shows in chrome on windows. i have similar problem, , using white-space: nowrap; not option. we have wait chrom

javascript - MVC : Is there any way to create bundles in view? -

i'm developing simple cms theme support. i'm trying find way create css , js bundles each theme. i don't want create bundles in app_start. something put code in _viewstart.html : @{ layout = "~/views/shared/_layout.cshtml"; add(new scriptbundle("~/bundles/myscripts").include( "~/scripts/myscript1.js", "~/scripts/myscript2.js")); //and on... } is there way this...? eventually found answer: system.web.optimization.bundletable.bundles .add(new scriptbundle("~/bundles/myscripts").include(...)); just note : if don't need create bundles in controller/view, performance manners best place create bundles in app_start.

render - ExtJS How to override onRender so that I can get correct component? -

i'm trying size of div rendered component. ext.define('eds.view.selector.container', { extend: 'ext.panel.panel', alias : 'widget.selectorcontainer', layout: 'fit', initcomponent: function(){ this.items = [ { xtype: 'tabpanel', defaults: { bodypadding: 10 }, layout: 'fit', items:[ { title: 'organization', id: 'selector-organization', tag: 'div', html: 'div here', height: '100%', onrender: function(){ //// render d3 // selector

sql - GROUP BY syntax is causing "missing expression" error -

please explain why following query: select in.status "no_installments" , count(in.id) "installment" instalsched.instalment in group in.status; returns ora-00936: missing expression 00936. 00000 - "missing expression" *cause: *action: error @ line: 1 column: 12 in key word in sql. used part of clause, such where person_id in (1,2,3,4) . remedy, change alias. select in1.status "no_installments", count(in1.id) "installment" instalsched.instalment in1 group in1.status;

c# - Pass data in a .getJSON. Possible? How? -

i'm doing app , got select user can choose different teams. each team contains couple of patients. save chosen team data-bind selectedoptions , stores option observable called 'selectedteam'. i'm receiving list of patients calling self.searchpatients = function () { $.getjson("/api/api/getpatients", function (data) { ko.mapping.fromjs(data, {}, self.patients); }); }; self.searchpatients(); back @ apicontroller got method asks db patients. calls takes different arguments, 1 of them being team search from. my question how pass observable 'selectedteam' apicontroller, convert string pass db call. thx assuming server method looks follow : [httpget] public object getpatients(string team) { // return patients } you should use javascript : self.searchpatients = function () { $.getjson("/api/api/getpatients", { team: self.selectedteam() }, function (data) { ko.mapping.fromjs(data, {}, sel

google map v3 OVER_QUERY_LIMIT - Geocoding with PHP MYSQL -

i having error of over_query_limit in using google maps api v3. want add markers database geocoding. if use limit in sql query markers shown, if increase limit greater 10 showing error. <?php mysql_connect('localhost','root','') or die(mysql_error()); mysql_select_db('dbname') or die(mysql_error()); $result = mysql_query("select * deal cityid=44 limit 10") or die(mysql_error()); $count = 0; echo mysql_num_rows($result); $row = mysql_fetch_array($result); ?> <script type="text/javascript"> var geocoder; var map; //var address; function initialize() { geocoder = new google.maps.geocoder(); var latlng = new google.maps.latlng(34.052234,-118.243685); var address = "<?php echo $row['address']; ?>"; //address = '3655 south durango, las vegas, nv 89147'; //alert(address);

java - Using the library JUNG graphs -

i use jung java library manage graphs , want know how color connected nodes same color distinguish connected components. for example, want nodes 2 , 3 , 4 have same color , node 1 to have color, knowing adjacency matrix is: 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 code create graph (nodes have same color): graph<integer, string> g; /** creates new instance of simplegraphview */ public readfile(int nbsommet,int [] [] nodemat) { // graph<v, e> v type of vertices , e type of edges // note showing use of sparsegraph rather sparsemultigraph g = new sparsegraph<integer, string>(); // add vertices. above defined these type integer. /*for (int = 1; <=nbsommet; i++) { g.addvertex((integer)i); }*/ (int = 1; <=nbsommet; i++) { g.addvertex((integer)i); (int j = 1; j<=nbsommet; j++) { if((nodemat[i][j]==1)&& (j>i)) { if(!(g.getvertices().contains(j)))

css - jQuery click on li item but NOT a class in it -

i have cart has many items, of <li> element set thru php: <li class="cart-product" data-id="<?= $product->id ?>" data-rowid="" data-ison="0"> <span class="product-lightup"><img src="<?= base_url('img/site_basics/product_lightup.png') ?>" /></span> <img src="<?= base_url('img/products/'.$product->image) ?>" class="product-img"/> <!-- plus/minus --> <div class="text-center product-click"><br> <span class="cart-plus"><img src="<?= base_url('img/site_basics/plus_sign.png') ?>" /><br>aggiungi</span> <span class="cart-minus"><img src="<?= base_url('img/site_basics/minus_sign.png') ?>" /><br>rimuovi</span> </div> <!-- findout button -->

iphone - startDownloadingUbiquitousItemAtURL local file path? -

where startdownloadingubiquitousitematurl:error method save downloaded file in local? same given url ? yes , same url the file in place before downloads icloud device placeholder of sorts. you can check status of url key nsurlubiquitousitemisdownloadedkey nsurl *foo = file://cloud/container/reference/tofile; nsnumber *isdownloadedvalue = null; bool success = [foo getresourcevalue:&isdownloadedvalue forkey: nsurlubiquitousitemisdownloadedkey error:null]; if (success && ![isdownloadedvalue boolvalue]) { [[nsfilemanager defaultmanager] startdownloadingubiquitousitematurl:foo error:null]; } theres no error handling in snippet want in production code.

c# - Assert one exception OR the other -

let's i've got test methods a, b, c. when launch them all, test method b throws sqliteexception , green , ok. assert.throws<sqliteexception>(() => sql.select(selectfrom + "table_name")); but, when i'm launching test method b throws argumentexception before sqliteexception , test fails. the question is: how assert 1 or other exception thrown? i'm talking this assert.throws<sqliteexception>(() => sql.select(selectfrom + "table_name")).or.throws<argumentexception>() try { somethingthatshouldthrowanacception(); assert.fail(); // if gets line, no exception thrown } catch (goodexception) { } you should able adapt approach whatever like, including specific exceptions want catch. if expect types, finish catch blocks off with: } catch (goodexception) { } catch (exception) { // don't want exception assert.fail(); } remember can't this try { somethingthatshouldthrowanacception();

mysql - Using an IF() based on a query result -

i'm trying use if() mysql structure looks this: if( phone_number '%992%' (select phone_number db.phonebook country='uk'), select xxx xxx xxx, select xxx xxx xxx ) i'm trying achieve: if (if manage find phone number in 'uk' phonebook looks '992'), (run following xxx query), else (run following yyy query) this doesn't work, syntax wrong. appreciate advice. you can't via query - can using procedure - can't return resultset query (you can return string might contain query). but it's not clear 'phone_number' somes before you've selected database. perhaps if told explicitly queries wanted run on 2 possible scenarios , phone_number comes when might able help.