Posts

Showing posts from May, 2015

Is there any free C++ and/or C# compiler that runs on an Android-enabled Tablet PC? -

Is there any free C++ and/or C# compiler that runs on an Android-enabled Tablet PC? - the question not writing c++ android, it's writing c++ on android. i have android-enabled tablet pc , need both c++ , c# programming. is there free c++ and/or c# compiler runs on android-enabled tablet pc? i not want develop android apps on pc. i want programming on ide runs on android. it exists in form, @ least. have managed find application compiles c , delphi without dependencies (i assume comes gcc , freepascal.) can't find @ moment, maintain searching. in meantime, touchqode @ to the lowest degree give scripting support. c#, you'll need mono. the runtime mono available on android , see absolutely no reason there can't compiler on android well. edit: commonwares mentions, there no freely available mono port android, none of applies. pity. c# android c++ ide

c++ - Statfs return strange values -

c++ - Statfs return strange values - i'm trying disk space in byte en used space in byte statfs(). made little function unusual values. (i'm working on ubuntu 32bit system) here code: bool checkdiskspace( const clstring &devpath, ulonglong &disksize, ulonglong &totalfreebytes ) { bool retval = false; struct statfs fs; if( ( statfs( devpath.c_str(), &fs ) ) < 0 ) { printf( "failed stat %s: %s\n", devpath.c_str() ,strerror( errno ) ); homecoming false; } else { disksize = fs.f_blocks * fs.f_bsize; totalfreebytes = fs.f_bfree * fs.f_bsize; retval = true; } homecoming retval; } int main() { ulonglong disksize, totalfreebytes; checkdiskspace( "/dev/sda5", disksize, totalfreebytes ); printf( "disk size: %llu byte\n", disksize ); printf( "free size: %llu byte\n", totalfreebytes ); } and get: disk size: 1798447104 byte free size: 1798443008 byte i not understand result because...

c++ - Retrieving pointers from a vector -

c++ - Retrieving pointers from a vector - i've been working on project uses graph-based api. have need of beingness able traverse graph , force pointers existing nodes list (in case, std::vector). of course, 1 time i'm done traversing graph, want take pointers , assign them fellow member variables of class. problem, of course, trying re-create pointers vector class variables. issue results having store nodes in vector cast pointers base of operations class, cast them actual type when passed class fellow member variables. roughly speaking, want is: std::vector<smart_pointer<node_base> > nodes; nodes.push_back( node ); //"node" smart pointer of derived type node_base ( ... ) { myclass::member_node_ref = static_cast<node_type>( ( *vector_node_iterator )); //member_node_ref smart pointer of derived node type //vector_node_iterator iterator of vector<node_base> object } all works fine until re-create construct...

browser - Is server-side useragent detection bad? -

browser - Is server-side useragent detection bad? - clientside useragent detection is known bad, bad react differently based on incoming useragent in http request an illustration sniffing types of browsers out of img requests , sending smaller or larger images based on whether incoming useragent mobile or desktop. i think depends motivation is. example, in mobile web sector attempting provide user looks sensible on platform. why concerned user-agent user reporting, when purely own benefit? if go effort of tricking different user-agent, person suffers. main problem of course of study false positives; it's not exclusively reliable. i follow argument should not rely on such, mobile developers under attack generic broad statements this. yes there alternatives, across every browser can imagine, info can useful @ point certainty begins degrade. what don't ever plain-text header utilize facilitate access control. user agent detection considered bad when there...

html - Resizing iframe between two static-width panels - using jQuery -

html - Resizing iframe between two static-width panels - using jQuery - i have setup 2 side panels, 1 float:left , 1 float:right, , iframe in between them. want 2 side panels have width of 150px, , iframe fill rest of page. attempting using jquery create functions alter iframe width dynamically when window resized, yet not working. here have far: <body> ... <script src="jquery.js"> function setframesize() { $("#ifrm").width($(window).width() - $("#leftpanel").width() - $("#rightpanel").width()); } $(window).resize(function() { setframesize(); }); $(document).ready(function() { setframesize(); }); </script> ... </body> can tell me why not working? thanks! it's much improve css: http://jsfiddle.net/7pbjb/ html: <div id="left"></div> <div id="center"></div> <div id="right"></...

sql server 2008 - Compare two dates with existing date and Get values from Table -

sql server 2008 - Compare two dates with existing date and Get values from Table - i'm using sql2008 create sps. in procedure want compare 3 date values , between 2 dates info table. i'm getting 2 dates ui @date1 , @date2 , have date3 column in table based on @date1 , @date2 , date3 want select info table. how can this? i think want this: select col1, col2, col3, ... table date3 between @date1 , @date2 this rows table date3 date >= @date1 , <= @date2 . sql-server-2008

python - QDialog not opening from Main window (pyQt) -

python - QDialog not opening from Main window (pyQt) - i'm trying launch dialog clicking button in main window: here's (qtdesigner generated) code modified test .. i've set showdial function show dial when button clicked. doesn't work : from pyqt4 import qtcore, qtgui try: _fromutf8 = qtcore.qstring.fromutf8 except attributeerror: _fromutf8 = lambda s: s class ui_dialog(object): def setupui(self, dialog): dialog.setobjectname(_fromutf8("dialog")) dialog.setwindowmodality(qtcore.qt.windowmodal) dialog.resize(400, 300) dialog.setwindowtitle(qtgui.qapplication.translate("dialog", "dialog", none, qtgui.qapplication.unicodeutf8)) self.retranslateui(dialog) qtcore.qmetaobject.connectslotsbyname(dialog) def retranslateui(self, dialog): pass class ui_mainwindow(object): def setupui(self, mainwindow): mainwindow.setobjectname(_fromutf8("mainwind...

reduce - Why does Clojure's apply treat vectors differently from lists? -

reduce - Why does Clojure's apply treat vectors differently from lists? - i curious why first argument apply (and reduce) affects function's behavior shown in next code snippet. user=> (apply conj '() [1 2 3]) (3 2 1) user=> (apply conj [] [1 2 3]) [1 2 3] user=> (apply conj '() '(1 2 3)) (3 2 1) user=> (apply conj [] '(1 2 3)) [1 2 3] it's not apply or reduce modifying behaviour of conj . conj polymorphic. adds elements in efficient way of given info structure. clojure reduce apply

How to display math in LaTeX font using Visual Studio 2010 C# -

How to display math in LaTeX font using Visual Studio 2010 C# - i display mathematical symbols in conventional latex font using c# in visual studio 2010. not want utilize latex equation editing machinery, want utilize traditional latex font family, believe called computer modern. using mathematical symbols in font, build own equation editor. i have downloaded , installed computer modern font, , indeed can select font list in visual studio. however, result text characters indeed displayed in computer modern font, mathematical symbols not; latter seem unaffected changing font family property. for example, have label content property text string contains formula, integral on x of function f(x) . display formula in conventional latex font style. utilize unicode \u222b refer integral sign. text string reads \u222b f(x)dx . now, when alter font family property, text f(x)dx affected, integral sign remains same! find unicode integral sign extremely ugly, , traditional latex in...

Where is the C/C++ iTunes API? (not COM!) -

Where is the C/C++ iTunes API? (not COM!) - i'm searching itunes c/c++ api creating plugins using dynamic libraries, can't find it. not asking com interface. open-source plugins vizkit , itunes toaster utilize it, , source files search (itunesapi.h/.c, itunesvisualapi.h) included, i'd rather source official repository instead of kind of "workaround". also, documentation nice. i'd guess both of utilize visualizer plugin sdk. c++ c windows sdk itunes

django-social-auth on google app engine -

django-social-auth on google app engine - i'm having problem getting django-social-auth work django app i'm deploying on google's app engine using djangoappengine , django-nonrel. i'm noob @ , quite complex me ! started django-nonrel template using video , though login page, gives me error - incorrect authentication service . if not define consumer key , secret google-oauth2, invalid client error on google's page. when run test social_auth, getting failed(errors=9) issue ensure backend testcase gets cached. , self.asserttrue(self.user) assertionerror: none not true errors . could please tell direct me should next work? ton! i fell problem , think if have solved problem, helpful others if reply exists. go httplib2 homepage , download latest version. extract archive , move inner httplib2 folder (found within python2 sub-folder), in projects main folder. add together 'httplib2', in installed_apps section, on top of social_auth'...

Platform neutral unit testing? -

Platform neutral unit testing? - i'm curious if there platform neutral way of defining unit tests. consider task of defining unit tests new set implementation code bases in both java , c#. example, might want test {3, 4, 5} intersect {4} {4}. instead of writing unit test twice (once in our java project , 1 time in our c# project) nice define test 1 time (maybe in xml?) , have each runtime read , execute test automatically. work need done in each language define how set should instantiated , populated, seems have configure detail 1 time seems reasonable when payoff not duplicating n unit tests. does know of language or framework goal? i have developed along lines describe enables define tests @ high level , generates test harness source code in either c or c++. http://www.apollo-systems.co.uk/dev/products/ whether extend generate c# , java depends on demand. aimed @ embedded systems market c , c++ preferred languages. the test specification stored in xml ,...

Adding info to day numbers in jquery datepicker calendar -

Adding info to day numbers in jquery datepicker calendar - i want add together additional info calendar in jquery datepicker. calendar comes showing month days listed in view of calendar. want add together number in parenthesis next day number. writing form scheduler , want show user how many events scheduled day using calendar. i don't have sufficient privileges add together pictures post seek best demonstrate looking below. regular datepicker calendar: su m t w th f sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 what looking for: su m t w th f sa 1(2) 2(1) 3(1) 4(1) 5(1) 6(1) 7(8) 9(1) 10(2) 11(5) 12(4) 13(3) 14(6) 15(2) **the numbers in parenthesis () number of appointments scheduled day.** i required info entered parenthesis mysql query. returns date , count. can format date match solution requires. i had thought of creating variables named after specific date definition b...

xcode - UIWebView Swipe-Gesture -

xcode - UIWebView Swipe-Gesture - everything works in code, warning "swipeleft.delegate = self;" the "self" marked warning. the warning : passing 'uiwebview *' parameter of incompatible type and passing 'viewcont *const __strong' parameter of incompatible type "id uigesturerecognizerdelegate what can do?? my code: #import "viewcont.h" @implementation viewcont @synthesize webview = webview_; - (void)viewdidload { //...code // add together left uiswipegesturerecognizer *swipeleft = [[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(swipeleftaction:)]; swipeleft.direction = uiswipegesturerecognizerdirectionleft; swipeleft.delegate = self; [webview_ addgesturerecognizer:swipeleft]; //code.... } regarding line: swipeleft.delegate = self; your controller needs implement uigesturerecognizerdelegate follows: @interface viewcont : uiviewcontroller<uigesturerec...

table - Expected number of hash collisions -

table - Expected number of hash collisions - i sense i'm way overthinking problem, here goes anyway... i have hash table m slots in internal array. need insert n elements hash table. assuming have hash function randomly inserts element slot equal probability each slot, what's expected value of total number of hash collisions? (sorry more of math question programming question). edit: here's code have simulate using python. i'm getting numerical answers, having problem generalizing formula , explaining it. import random import pdb n = 5 m = 8 num_iter = 100000 def get_collisions(table): col = 0 item in table: if item > 1: col += (item-1) homecoming col def run(): table = [0 x in range(m)] in range(n): table[int(random.random() * m)] += 1 #print table homecoming get_collisions(table) # main total = 0 in range(num_iter): total += run() print float(total)/num_iter you'll ...

python - list of wx.ICON_ options in wxpython -

python - list of wx.ICON_ options in wxpython - i having difficulty finding list of of inbuilt icons in wxpython. so far have found wx.icon_information wx.icon_exclamation if knew of such list, much appreciated. alternatively please leave have not been included. thank you how beautiful python introspection: >>> import wx >>> mod = dir(wx) >>> [item item in mod if item.startswith('icon_')] ['icon_asterisk', 'icon_error', 'icon_exclamation', 'icon_hand', 'icon_information', 'icon_mask', 'icon_question', 'icon_stop', 'icon_warning'] >>> python icons wxpython

Android NDK app building failure "arguments list too long" with Cygwin -

Android NDK app building failure "arguments list too long" with Cygwin - i'm trying build irrlicht android port on windows xp sp3 android ndk r5 on cygwin, fail error "arguments list long". i googled, , got solution this post tries add together makefile script utilize separate .linkargs file linker. followed instruction still failed(i replied post error info there). so, valid way handle problem? check out sg57's reply @ http://irrlicht.sourceforge.net/forum/viewtopic.php?t=43449#p260385 it solves problem using temporary file , indirecting args through it. android command-line-arguments irrlicht

c# - Date format pattern -

c# - Date format pattern - setting format date @string.format("{0:d}", model.date) code above shows date in next format: (13 jan 2012) the required output: (friday 13 jan 2012) is there format pattern? yep, here go. string.format("{0:dddd d mmmm yyyy}", model.date) full msdn documentation the general rule utilize remember these formats this: one character means number alone; 2 characters means add together leading 0 if necessary 3 characters means utilize 3 letters if day or month, 4 numbers year 4 letters means utilize total word day or month stuff (not special characters) gets set in string e.g. consider 1st jan 2001 string.format("{0:(d;dd;ddd;dddd),(m;mm;mmm;mmmm),(y,yy,yyy,yyyy)}", datetime.parse("2001/01/01")) will return (1;01;mon;monday),(1;01;jan;january),(1,01,2001,2001) similar rules times, this: string.format("{0:(h;hh):(m;mm):(s,ss) (t,tt)}", datetime.now) to give...

asp.net mvc 3 - jQuery UI Accordion: start page without a selected section -

asp.net mvc 3 - jQuery UI Accordion: start page without a selected section - i have accordion style of navigation section on website @ work , i'm trying figure out if there way set there isn't selected section when page loads...basically see headings none of content. also not sure it's relevant, site built on mvc3 using c# code... <script type="text/javascript"> $(window).load(function () { $('#accordion').accordion({ collapsible: true }); }); </script> <div id="accordion"> <h3> <a href="#">employee stock ownership plan announcement</a></h3> <div> @html.partial("_esop") </div> <h3> <a href="#">tag transport purchase</a></h3> <div> @html.partial("_tagpurchase") </div> <h3> <a href="#"...

request - How to properly call JSON-RPC in Go? -

request - How to properly call JSON-RPC in Go? - i've been trying various configurations in order phone call a simple json-rpc server bitcoin in go, didn't manage anywhere. in python, entire code looks like: from jsonrpc import serviceproxy access = serviceproxy("http://user:pass@127.0.0.1:8332") print access.getinfo() but in go, seem bumping erros "too many colons in address", or "no such host". i've tried using both of packages rpc , rpc/jsonrpc, using methods dial , dialhttp, using various network parameters , still can't anywhere. so, how phone call json-rpc server in go? the jsonrpc bundle doesn't back upwards json-rpc on http @ moment. so, can't utilize that, sorry. but jsonrpc specification quite simple , it's quite easy write own jsonrpchttp (oh, hope know improve name) package. i able phone call "getinfo" succesfully using next (horrible) code: package main import ( ...

c++ - AST from PDB (e.g. via DIA) -

c++ - AST from PDB (e.g. via DIA) - i'm using dia sdk useful info pdb file... now, basic question is: how deep can go that? optimum able right downwards abstract syntax tree... remotely possible? if not, how far can go using analysis of debug data? dia sdk gives access debug info available in pdb through com interface. give general idea, similar whatever available visual studio debugger (symbols, line numbers, etc). means, in general, if debugger appears know something, info should available through dia sdk. specific details, need refer online documentation in msdn. to specific, abstract syntax tree intenal visual studio not available through api - not dia sdk. local variable type symbols cannot enumerated through dia sdk. getting list of symbols used vc++ code c++ debug-symbols pdb-files dia-sdk

javascript - three.js textures working with CanvasRenderer, but show up as black with WebGLRenderer -

javascript - three.js textures working with CanvasRenderer, but show up as black with WebGLRenderer - i'm drawing image canvas (using citytexture method in http://haldean.github.com/citycanvas/city.js) , using texture. works when utilize three.js's canvasrenderer, textures show black when using webglrenderer. i'm generating textures squares side lengths of 256. demo , code here, canvasrenderer on top, , webglrenderer on bottom: http://haldean.github.com/citycanvas/3d.html this wouldn't issue, except performance of canvasrenderer pretty poor when there's lots of geometry beingness rendered, , webgl seems perform lot better. (with in mind, if has suggestions create canvasrenderer more efficient, great too). thanks! problem solved: needed add together mesh.dynamic = true mesh, , texture.needsupdate = true texture. javascript rendering webgl three.js

.net - how can i get the data from dotnet web-services in android? -

.net - how can i get the data from dotnet web-services in android? - i new web-services. have save info in web-services doesn't know how info web-services. web-services in .net in web-services have utilize soap parsing. please help me how can info url.i have search in google didn't find solution. i have utilize next code save info webservice.. package com.soap; import org.ksoap2.soapenvelope; import org.ksoap2.serialization.soapobject; import org.ksoap2.serialization.soapserializationenvelope; import org.ksoap2.transport.httptransportse; import android.app.*; import android.os.*; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; import android.widget.textview; public class myworldactivity extends activity { edittext name,uname,pass,num,mail,img; button save,back; private static final string soap_action = "http://localhost/service1...

ruby on rails - rails_admin dashboard/secondary_navigation customization -

ruby on rails - rails_admin dashboard/secondary_navigation customization - any chance customize dashboard or secondary navigation? yes can create app/view/rails_admin/main/dashboard.html.haml , redesign whole page scratch. should if want add together simple partial before , safe current content? in case secondary navigation tried replace _secondary_navigation.html.haml in places partials - nil happens. app/views/layouts/rails_admin/_secondary_navigation.html.haml here place should live. ruby-on-rails rails-admin

bash - Single command to remove files that have a '3' in them -

bash - Single command to remove files that have a '3' in them - say have list of files numbered 1-50 , want remove ones have number '3' in them. how that? perhaps you're looking globbing: rm *3* make sure check first harmless (like ls ). can't imagine why need though. bash command-line for-loop

jquery - Global variable in javascript doesn't changed -

jquery - Global variable in javascript doesn't changed - $check = ""; $.ajax({ url: "check.php", type: "post", cache: false, data: $name + "=" + $value, success: function(data){ $check = data; alert($check); } }); alert($check); the first msg "hello" the sec msg "" why ? $.ajax asynchronous function, returns , calls success callback when success response received. therefore, when alert($check) @ bottom of code executed, value of $check not yet modified callback of ajax . that's why see empty string. javascript jquery variables global-variables

java - Close file in finally block doesn't work -

java - Close file in finally block doesn't work - try { filereader fr = new filereader(file); bufferedreader br = new bufferedreader(fr); string line = null; } grab (filenotfoundexception fnf) { fnf.printstacktrace(); } { fr.close(); } the fr.close() shows error: fr cannot resolved i had read closing file in block practice. doing wrong? the variable fr has scope within try block. out of scope in block. need declare before try block: filereader fr = null; seek { fr = new filereader(file); bufferedreader br = new bufferedreader(fr); string line = null; } grab (filenotfoundexception e) { e.printstacktrace(); } { if (fr != null) { seek { fr.close(); } grab (ioexception e) { // unrecoverable. study , move on e.printstacktrace(); } } } this quite mutual pattern of code, it's remember future similar situations. consider throwing ioexception...

Salesforce Custom Object Relationship Creation -

Salesforce Custom Object Relationship Creation - i have posted on over sales forcefulness development boards... hi guys... i want create 2 objects , link them via parent kid relationship in c# using metadata api. i can create objects , 'custom' fields objects via metadata, service ignores field def relationship. by snipet fields follows : customfield[] fields = new customfield[] { new customfield() { type = fieldtype.text, label = "firstname", length = 50, lengthspecified = true, fullname = "ljutestobject__c.firstname__c" }, new customfield() { type = fieldtype.text, label = "lastname", length = 50, lengthspecified = true, fullname = "ljutestobject__c.lastname__c" }, new customfield() { type = fieldtype.text, label = "postcode", length = 50, lengthspecified = true, fullname = "ljutestchildobject__c.postcode__c" }, new customfield() { type = fieldtype.masterdetail...

.net - Why does COM Interop treat a VB6 Boolean as C# Short? -

.net - Why does COM Interop treat a VB6 Boolean as C# Short? - i have legacy vb6 application has next construction defined: public type drawdown date date amount currency capitaliseinterest boolean end type an interop assembly generated using tlbimp.exe construction ends following: [structlayout(layoutkind.sequential, pack = 4)] public struct drawdown { public datetime date; [marshalas(unmanagedtype.currency)] public decimal amount; public short capitaliseinterest; } i'm using .net 4.0. why vb6 boolean translated c# short instead of bool ? vb6 uses variant_bool type, find info , history here: bool vs. variant_bool vs. boolean vs. boo off side came variant_bool. typedef short variant_bool; define variant_true ((variant_bool)-1) define variant_false ((variant_bool)0) developed visual basic folks. basic uses -1 represent "true" , 0 represent "false", , variant_bool designed preserve be...

Not able to update PostgreSQL database table from PHP -

Not able to update PostgreSQL database table from PHP - the next query works in postgresql when run through php, doesn't update. thought might doing wrong? it's first time postgresql. <?php $connection = pg_connect("host=localhost port=5432 dbname=mydb user=myuser password=mypw"); $sql = "update forum set views = floor(80 + random() * 61) views < 10"; pg_close($connection); // close connection ?> you need add together $result = pg_query($connection, $sql); if doesn't work, adding begin messages. in case add: pg_query($connection, 'commit'); before disconnecting.... php postgresql

hibernate - Play! JPA @ManyToMany bug -

hibernate - Play! JPA @ManyToMany bug - i have 3 entities: user, team, , teaminvite. each user has 1 team. each user can invite other users team creating teaminvite. when teaminvite accepted, each user's *team* updated. teaminvites not impact users, teams. @entity public class team extends model { @onetoone public user user; @manytomany(cascade=cascadetype.all) //i've tried cascadetype.persist public list<user> team = new arraylist<user>(); } @entity public class teaminvite extends model { @manytoone public user inviter; @manytoone public user invitee; public void fulfill() { team team = team.foruser(inviter); team.team.add(invitee); team.save(); //error gets thrown here team = team.foruser(invitee); team.team.add(inviter); team.save(); delete(); } } when teaminvite.fulfill() gets called, next error: persistenceexception occured : org.hiber...

javascript - Ensure jQuery event handler execution order -

javascript - Ensure jQuery event handler execution order - i think event handlers processed in order registered. (is correct?) if case if attach event handler @ origin of script, can absolutely fire before subsequent handlers attached same event? event namespaces have effect on this? event handlers fired in series (one finishes before next) or in parallel? i want because script relies on viewport size, changes on resize event, , need it. rather calling $(window).width() repeatedly in each of handler functions, i'd set handler @ top of script saves $(window).width() object property on each resize. in subsequent handlers can access property , recent measurement. i know create custom event triggers calculation done , attach subsequent handlers custom event. but, i'd don't want because need maintain interoperability plugins come after mine may attaching resize event. if attach event handler before other script has run (even plugin), callback fire first. yo...

face recognition - Generalized eigenvalue for two matrices in OpenCV -

face recognition - Generalized eigenvalue for two matrices in OpenCV - hello working on project involving in face recognition using linear discriminant analysis(lda). lda demands find generalized eigen vectors between class scatter matrix , in class scatter matrix , struck. using opencv devc++ coding. problem looks a*v=lambda*b*v where , b matrices generalized eigen vectors should found lambda eigen values , v vectors upon searching problem many people suggested go calculating inverse of b , multiplying a*v (inv(b)*a)*v=lambda*v and calculate eigen vectors inv(b)*a. it seems solution in case scatter matrix b sigular. found determinant in order of 10^-36 .so cant find inverse , proceed above solution. can 1 suggest me way out of problem except saying code generalized eigen value problem separately. i providing fisherfaces implementation in github repository @ https://github.com/bytefish/opencv/tree/master/lda. includes implementation of eigenvalue solv...

CSS percentage with decimals only working correctly in Chrome (Firefox and Opera are just rounding up) -

CSS percentage with decimals only working correctly in Chrome (Firefox and Opera are just rounding up) - i'm having issue applying css width percentage , decimal (e.g 33.33) div. it seems work fine in chrome plays in opera , firefox. http://jsfiddle.net/nhkz9/1/ opera , firefox both round percentage up, , because of insufficient width in container, 3rd div moves new line. when percentages not rounded up, there plenty space 3 fit in 1 line. any ideas on how prepare issue? thanks the demo posted adds 1px border 2 of <div> s. default not included in 33.33% calculation, <div> s never fit. alter this, utilize box-sizing: border-box; . css firefox cross-browser opera

Silverlight listbox or pathlistbox -

Silverlight listbox or pathlistbox - i want show list of items database. number of items between 10 1000; not 1000 @ to the lowest degree more 20 or cards have texual details , little thumbnail image. want them displayed similar list of folders in windows explorer when view slider in "large icons" position. think can accomplish using this example while using traditional listbox. makes listbox scroll motion boring. using pathlistbox, have little more command on list motion path. however, in online samples have seen, there few items can shown using pathlistbox. don't suppose can show more 20 cards in circle or other shape aforementioned details. hard scroll through them. pathlistbox gimmicks or can utilize show many more handful of items? tips or pitfalls in pathlistbox should aware of before begin using or improve off using simple listbox? would have thoughts on same. time... silverlight listbox

android - TimePicker-like widget -

android - TimePicker-like widget - is possibility spin box ones used in time or datepickers? want set own info using those. thanks in advance more precisely, think looking this: http://developer.android.com/reference/android/widget/numberpicker.html. edit: or if you're looking other options, has been discussed here: android number picker dialog. hope helps! android datepicker timepicker

request - is there an open source commenting system available? -

request - is there an open source commenting system available? - i'd enable commenting mechanism through system, i've done googling , found saas disqus , gentlesource i'm looking more self-hosted / open source apps. , understand architecture of such systems in case wanted implement myself. consider juvia https://github.com/phusion/juvia ;) juvia open source commenting system. allows outsource commenting needs external scheme don't have build own commenting scheme each website or each web app. embedding juvia commenting page involves pasting javascript snippet web page. request commenting

php - Display image with URL from MySQL -

php - Display image with URL from MySQL - i using code display image url, not working, <?php echo 'me'.'<br/>'; $sql= 'select url_imgsrch p_url_imgsrch'; $result = mysql_query($sql); echo $result; $row = mysql_fetch_row($result); ($i=0; $i<6; $i++){ //calling rows echo '<td>'; //calling rows value debugging purpose can larn process , check output echo $row[$i].'<br/>'; echo '<img name="myimage" src="<?php echo $row[$i]; ?>" width="60" height="60" alt="word" />'; echo '</td>'; } ?> the result is, alt text only, , image not displayed. also, error notice: undefined offset: 1 in d:\wamp\www\demo\login\flashcard.php on line 31 in file trying is, 5 img url database , display them in columns of table..and guess get...

swing - Smooth animation in a snake game (java)? -

swing - Smooth animation in a snake game (java)? - i have made basic snake game in java , need help getting smoother animation. each segment of snake 20x20 square, made snake move @ step of 20 pixels per tick. makes snake move seemingly on grid, means line nutrient spawns on "grid". problem is, when seek , move step of 3, not aligned "grid" anymore. more serious problem have snake moves moving first square, settings of others next position in array (see code). problem is, when moves step of 3, snake shrink there gap of 3 between each origin, instead of 20. can help these problems? can add together entire source code if needed. import java.awt.*; import java.awt.event.*; import java.awt.image.bufferstrategy; import java.io.bufferedreader; import java.io.bufferedwriter; import java.io.filereader; import java.io.filewriter; import java.io.ioexception; import java.util.random; import javax.swing.timer; public class player1 extends canvas implements runnable ...

php - How is the best way to check iteration between two hours? -

php - How is the best way to check iteration between two hours? - i check how iteration between 2 dates interval 30 minutes. i have example: $one = new datetime('2012-01-20 06:00'); $two = new datetime('2012-01-20 17:30'); $first = $one->format('h:i'); $second = $two->format('h:i'); $interval = 30; in illustration $iteration = 23, how can calculate this? you split amount of minutes between datetimes desired interval. $one = strtotime('2012-01-20 06:00'); $two = strtotime('2012-01-20 17:30'); $interval = 30; echo round(($two - $one) / ($interval * 60)); (i've taken shortcut , divided amount of seconds amount of seconds in 30 minutes) http://codepad.org/yhv0hdwl php datetime

Where is the restlet guice integration download or maven artifact? -

Where is the restlet guice integration download or maven artifact? - does know restlet guice integration mentioned on restlet.org here http://wiki.restlet.org/developers/172-restlet/257-restlet/284-restlet.html can found? apparently exists in svn, have build yourself. http://restlet.tigris.org/source/browse/restlet/trunk/incubator/org.restlet.ext.guice/src/org/restlet/ext/guice/ luckily 2 classes. maven guice restlet

How to get back to a git branch after a git revert -

How to get back to a git branch after a git revert - so, ended having alter whole directory tree of project because of fundamental problem code - or thought. made commit before big changes, realized after making changes did not need to. performed git checkout ##sha## i able create whole project working way should, have different problem. no longer checked-out in branch working in. how maintain code have , working within branch? git branch -a says in * (no branch) anyone know can without making new branch , deleting old one? never git checkout <hash> . meant temporarily examine commit (and hence no branch see). wanted was, while in branch, git reset --hard <hash> ( remove --hard if have changes need in working directory.) to recover: git checkout the_branch git reset --hard <hash> note <hash> above going same 1 used git checkout while trying "revert" changes. git

Rails: How to Create a New Associated Model From a Collection of Templates -

Rails: How to Create a New Associated Model From a Collection of Templates - i want have series of workout templates user can select when making booking. booking version of workout template can edited without changing original template. context i have personal trainer makes bookings clients. the personal trainer has many workouts. each booking has associated workout can edited booking. question how create new workout each booking and: associate new workout's id booking keep template workouts in collection displayed @ new booking form guess current guess on doing have hidden field workout params in form passed bookings_controller, create method @booking.save && @workout.save i'm stuck on details execute. it hard understand trying looks want use: http://api.rubyonrails.org/classes/activerecord/nestedattributes/classmethods.html ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.1

linux - C++ map adds new element -

linux - C++ map adds new element - i have basic query in c++ maps, map<char,string> mymap; mymap['a']="an element"; mymap['b']="another element"; mymap['c']=mymap['b']; cout << "mymap['a'] " << mymap['a'] << endl; cout << "mymap['b'] " << mymap['b'] << endl; cout << "mymap['c'] " << mymap['c'] << endl; cout << "mymap['d'] " << mymap['d'] << endl; when seek access mymap['d'], default value because operator inserts new element in map key , initialized default value, though accessed retrieve value. next time when utilize iterator, see null value key 'd'. there way restrict map inserting default values. you should utilize map.find instead of operator [] if not want default insertion. map::find iterat...

objective c - NSTableview selection jerking -

objective c - NSTableview selection jerking - i have created desktop based application in mac os x 10.6. app uses nstableview listing files. utilize mouse click table selection. code used [tableview selectrowindexes:ind byextendingselection:no]; ind indexset . when select files 1 1 using mouse click, find little jerking effect each time when click row of table. can suggest method avoid jerking effect. here code - (void) clickedit:(id)sender{ id indexsett = [[nsindexset alloc] initwithindexset: [subviewtableview selectedrowindexes]]; if([indexsett count] <=1) { if ([self isvaliddelegateforselector:@selector(tableview:shouldclickedrow:)]) { [delegate tableview:subviewtableview shouldclickedrow:(int)[subviewtableview selectedrow]]; } }else { [indexsett enumerateindexesusingblock:^(nsuinteger idx, bool *stop) { nslog(@"tracing index:%ld",idx); [delegate tableview:s...

c# - Accessing a decrypted Rijndael encrypted file with a StreamReader without writing to disk -

c# - Accessing a decrypted Rijndael encrypted file with a StreamReader without writing to disk - i'm working on encryption/decryption of plain text files embedded in .dll file. plain text files scripts, , beingness parsed , when they're needed. at minute, how (plain text) script files beingness loaded : string runlocation = path.getdirectoryname(system.reflection.assembly.getexecutingassembly().location); assembly _assembly = assembly.loadfrom(runlocation + "\\<name of dll>.dll"); s = new streamreader(_assembly.getmanifestresourcestream(file)); runscript(s); the runscript method reads single line of script string, parses it. looks through each line in turn, , performs each of actions define in script found. since out dll files aren't encrypted in anyway, we've decided should encrypt each of script files before embedded dll. decided on rijndael algorithm because of ease of can implemented in c#/.net. currently encryption runs this: f...

ruby on rails 3.1 - Files added to config.assets.precompile are not served in development -

ruby on rails 3.1 - Files added to config.assets.precompile are not served in development - i using activeadmin gem proposes little weird way of including additional assets automatically generated gem: https://github.com/gregbell/active_admin/issues/492 my problem though in config/application.rb set config.assets.precompile += ['active_admin.css', 'active_admin.js', 'my.css', 'my.js'] my_file.css , my_file.js not served in development mode, it's routing error. i have registered them activeadmin's own config.require_javascript , config.require_stylesheet, seems work, since generated html contains respective script tags. however /assets/my.css , /assets/my.css not responsive. what cause problem, how think? it turned out files trying add together corrupted somehow since creating new ones , copying content within made trick. i including .js , .css files of plugin: http://loopj.com/jquery-tokeninput/ fine not taking i...

java - Why does getGeneratedKeys() return "GENERATED_KEY" as column name? -

java - Why does getGeneratedKeys() return "GENERATED_KEY" as column name? - i'm playing jdbc/mysql 5.1. created insert query insert info table , want homecoming generated key newly created row. however, when go reference column "id" pk , auto-increment column. preparedstatement ps = st0rm.getinstance().getdatabase("main") .prepare("insert quests (name,minlevel,start_npc,end_npc) values(?,?,?,?)", true); // creates prepared statement flag return_generated_keys // ... int affected = ps.executeupdate(); resultset keys = ps.getgeneratedkeys(); if (affected > 0 && keys.next()) { st0rm.getinstance().getlogger().warning(string.format("id column name: %s", keys.getmetadata().getcolumnname(1))); // says column name is: generated_key q = new quest(keys.getint(1)); // column index generated key, no error thrown. q = new quest(keys.getint("id")); // actual column name, line throws sqlexcepti...

Facebook App, Posting to Users' Wall Concept -

Facebook App, Posting to Users' Wall Concept - i created little facebook app posts people's walls when have birthday coming up. good, there's concept i'm not quite understanding. i'm using cron job run script searches through users , posts ones have birthdays on day. i've created facebook business relationship app post should under apps account. i'm confused on how script going know post app's facebook account? need log in through script somehow? if so, how go doing that? you close answer! yes - correct, application needs utilize access_token performa actions "on-behalf" of application. should read facebook authentication documentation under header - "app login" larn how obtain app access token. after have token methods utilize publish post identical regular posts. facebook facebook-graph-api

In IOS, how to know whether the UIWebView's scroller is at the top? -

In IOS, how to know whether the UIWebView's scroller is at the top? - i making ios application has action this. http://www.flickr.com/photos/71607441@n07/6721920809/ total screen web view. when scroller on top, if touch webview, goes downwards , cover half of screen. (if scroller not on top, action won't do) http://www.flickr.com/photos/71607441@n07/6721847313/ this. i confused how know scroller position is. uiwebview has few properties, , guess need embed uiwebview in uiscrollview, or have utilize javascript? not sure you're trying exactly, if you're trying move uiwebview downwards whole i'd add together uiview , set uiview uiscrollview. maintain in fixed position relative other elements add together uiview. may wind odd behaviors though uiwebview contains uiscrollview , touch events have handled between 2 correctly. if you're trying find out how far web view scrolled downwards "inside" itself, can utilize little hac...

regex to find function arguments inside php files -

regex to find function arguments inside php files - can help valid regex ? i have files containing functions 1 $variable1 = tr ('this written in % s . ', array ( $year )); or tr ('this written in % s % s . ' ,array ( $month , $year )); or tr('some string ') strings in single quotes. i need text of source fopen fundtion extract strings passed tr() function. utilize php parse php files. help? update works: $filecontents=file_get_contents($file); preg_match_all("/tr\('(.*?)'/", $filecontents, $matches); //preg_match_all('/(?<=tr\s?\(\s?\')(?:\\\\.|[^\\\\\'])*(?=\')/i', $filecontents, $matches, preg_pattern_order); exit(json_encode($matches)); if understand question correctly, want regex match strings passed function called tr() . the next regex should do: /tr\('(.*?)'/ so: <?php preg_match("/tr\(...

c# - How truncate a decimal part? -

c# - How truncate a decimal part? - i'm trying truncate decimal part. i mean create function this. 1/9 ~ 0.11111111111111 so, if in function set wants pick 5 decimals, must returns 0.11111 i doing using strings, guess not idea. possible using math operations? you can utilize math.truncate http://msdn.microsoft.com/en-us/library/7d101hyf.aspx edit: version of suitable method (though gary has shared 1 below) public static double truncate(double number, int digits) { double conversionfactor = (math.pow(10.0, digits)); homecoming math.truncate(number * conversionfactor) / conversionfactor; } c# algorithm class

python: stateless function library design -

python: stateless function library design - i building library of various functions reused in project. each function stateless (doesn't require parameters @ creation, , doesn't have memory). functions utilize others. these functions passed around arguments in rest of project. which of next approaches better? 1.define functions global functions in module: def f1(x): # utilize x def f2(x): # utilize x , f1 2.define functions methods in classes, , arrange classes in hierarchy based on use: class f1: def __call__(x): # utilize x f1 = f1() class f2(f1): def __call__(x): # utilize x , f1 f2 = f2() the reason considered alternative 2 of functions have in common. e.g., functions f2 , f3 , f11 start calling f1 . thinking might want this: class f1: def __call__(self, x): self.f1(x) self.calc(x) def f1(self, x): # # don't define calc here; f1 abstract base of operations class class f2(f1): def calc(self, x...

vb.net - Why DSLR Pro can access my Canon 500D on Windows 64bit system? -

vb.net - Why DSLR Pro can access my Canon 500D on Windows 64bit system? - hello dearest community, currently building canon edsdk application using vb.net access canon 500d camera. it's dlsr system. i've read edsdk working on 32 bit system, application capable of running on 32 bit system. but, installed dlsr pro (http://www.breezesys.com/dslrremotepro/support.htm), can access camera, regardless of operating scheme : 32bit/64bit. how able it? is there new edskd can access photographic camera in 64 bit os? using 2.6 edsdk. thanks 64-bit windows supports 32-bit applications. vb.net edsdk

How to terminate process with Lucene NRT Reader/ Writer gracefully? -

How to terminate process with Lucene NRT Reader/ Writer gracefully? - we using lucene's near real-time search feature full-text search in our application. since commits costly, commit index after every 10 documents added (we expect around 150 200 documents per hr indexing). now, if want terminate process, how create sure documents in memory committed disk before process killed? there approach recommended here? or document volume less bother , should commit on every addition? should track uncommitted documents? , if process gets killed before committed disk, should index these uncommitted ones 1 time again when process start up? lucene nrt used in process runs embedded jetty. right approach send shutdown command (invoke servlet) jetty , wait till documents committed , terminate using system.exit()? you add together hook commit buffered documents in destroy method of servlet , create sure embedded servlet container shut downwards before calling system.exit (may...

c++ - Temporary object not destroyed correctly? -

c++ - Temporary object not destroyed correctly? - see code here: class test { int n; int *j; public: test(int m) { n = 12; j = new int; cin >> *j; } void show() { cout << n << ' ' << *j << endl; } ~test() { delete j; } }; int main() { test var = 123; var.show(); homecoming 0; } in programme compiler should complain double deleting of j . first delete done when temporary object temporary(123) destroyed. sec delete done when var object destroyed. working fine? does mean temporary object not phone call destructor? the contentious line this: test var = 123; the relevant standard text (that pundits in comments referencing), believe, (8.5, "declarators"): the function selected called initializer look argument; if function constructor, phone call initializes temporary of cv-unqualified version of destination ...

asp.net - put textbox and button in mvc razor app -

asp.net - put textbox and button in mvc razor app - i working on test mvc project , since it's 1st time working in mvc environment lost , different compared asp.net web forms. trying set textbox , button on form, when using <%= html.textbox("name") %> textbox example, code displays text on screen , not rendered textbox. when using html markup textbox , button can see textbox shouldn't <%= html.textbox("name") %> right way that? here have here: @{ layout = "~/_sitelayout.cshtml"; page.title = "welcome web site!"; } <p> asp.net web pages create easy build powerful .net based applications web. come in name: <%= html.textbox("name") %> <input id="text1" type="text" /> <input id="button1" type="button" value="button" /> </p> which way should go, can go standard html format or doing wrong textbox...

android - How to stop service itself? -

android - How to stop service itself? - i have illustration int myint in service , if myint = 1 i'd stop service itself. service should stop automatically. @override public void oncreate() { super.oncreate(); if(myint==1){ // need code stopping service here } } update apparently cannot stop service due nature of service life cycle. if can check status in onstartcommand, can seek calling stopself() there ? update 2 for sample code : can seek running stopself() on seperate thread in post : how can stop receive_boot_completed service android service int

asp.net - convert string to datatable -

asp.net - convert string to datatable - i getting error cannot convert string datatable the code dt = ctype(session("result"), datatable) i trying store session value in dt datatable. session result contains string values. can suggest how convert session datatable , store session value in datatable. i'll take guess here: dt.rows(whichrow)(whichcolumn) = session("result") you need know cell in datatable want store session variable in. asp.net vb.net

jquery - Catching a click event on a SELECT in IE prevents from selection -

jquery - Catching a click event on a SELECT in IE prevents from selection - i want enlight select , td container when click on this: $("#fordelegation").on("click", "td", function (evt) { $(".ui-state-focus").removeclass("ui-state-focus"); $(this).addclass("ui-state-focus"); $(evt.target).addclass("ui-state-focus"); }); you can test on fiddle: http://jsfiddle.net/sinsedrix/9sudt/ with ie, unusual behaviour, cannot select alternative anymore. people not trick here behaviour videos: good on ff: https://docs.google.com/open?id=0b503huuz979cmgi2ntrjytetnty0os00mtvhlwe5mzktnty0yjk1mmnizge3 bad on ie: https://docs.google.com/open?id=0b503huuz979czwnjowy2ytqtzdbjzc00mgqylwi2mdgtyzg1n2q1zwi0n2uy the question : should dig prepare bad behaviour ? i stuck on trick :( every thought welcome. edit 1 setting style straight works though http://jsfiddle.net/9sudt/37/ it boils downward...

ruby - Running thin server in production mode isn't loading my assets -

ruby - Running thin server in production mode isn't loading my assets - when load thin so: thin start -e production and seek access 1 of pages, in log output: cache: [get /] miss cache: [get /assets/main-bd1ef4b153740fb69fd615304b87ad0d.css] miss cache: [get /assets/jqmodal-8fa734bf4f58524b2799abd73ab7d34f.css] miss cache: [get /assets/jquery-544665ba1d5b4f793290421aafed85c9.js] miss cache: [get /assets/application-00b97aa2429046c0c43802f07b756b46.js] miss these files exist in assets directory under public . i've run command also: rals_env=production rake assets:precompile i've tried accessing file /public/assets/application.js in browser this: http://localhost:3000/application.js which gives me 404 error (even though file exists in /public/assets file can read when create request file when server in development mode. anyone have ideas? rails serving static files turned off in production ( config/environments/production.rb ) def...

java - Nested loops for specific numbers -

java - Nested loops for specific numbers - i have method takes in 2 ints method(int ii, int xx) . want loop through range of values cant think of way without hard coding each value. when ii = 21, want xx = 19 through 9 when ii = 20, want xx = 18 through 12 so hard coded be: method(21,19) method(21,18) ... method(21,10) method(21,9) method(20,18) method(20,17) ... method(20,13) method(20,12) this have far doesnt handle spcific cases dont want method(4,19) for(int ii = 9;ii<21;ii++){ for(int xx = 4;xx<19;xx++){ method(ii,xx); } } as suggested edd, you'll want utilize map. suggest creating range class represent integer range xx values, can build map of integer --> range (ii --> xx): static class range { public final int start; public final int end; public range(int start, int end) { this.start = start; this.end = end; } } static ...

python - pysqlite: Placeholder substitution for column or table names? -

python - pysqlite: Placeholder substitution for column or table names? - using pysqlite making procedure data. same kind of operation done on similar fields in multiple tables , columns, thought parameterize sql statement shown below: def foo(): column = 'c' table = 't' row = 1 # preferred approach, gives syntax error c.execute('select ? ? id=?', (column, table, row)) # sanity check, works fine c.execute('select c t id=?', (row)) # workaround, works, right way? c.execute('select % % id=?' % (column, table), row)) the error not helpful ( sqlite3.operationalerror: near "?": syntax error ), point: pysqlite not appreciate placeholders beingness used in way. can point out going on here along proper way of doing above? you can not utilize placeholders column or table names. don't have authoritative citation -- "know" having tried , failing. makes sense though: if columns , table paramet...

android - Why is my app not available to some devices via Market? -

android - Why is my app not available to some devices via Market? - as specific example, app not available htc wildfire s. device listed in android market publisher console 1 of devices available to, web market shows app , wildfire incompatible. confusing. app not available whole range of devices including galaxy s, galaxy s2, galaxy ace, though these showing in market console compatible. here's relevant manifest settings shown in market: screen layouts: little normal big xlarge required device features android.hardware.wifi android.hardware.screen.landscape android.hardware.touchscreen the app paid, , available countries not think country issue. what missing? android market says app available these devices, why not? struggling understand why 1 side of android market says it's compatible, public-facing side says it's not. what's going on? afaik, if app target version not compatible device os version, app won't show download. andro...

objective c - iPhone wheel (of fortune) rotation momentum -

objective c - iPhone wheel (of fortune) rotation momentum - i'm having difficulties adding momentum spinning wheel. have wheel (something this) , i'm rotating around it's center using single touch event. no problems here, when touch (aka drag) ends; want wheel maintain it's momentum , ease out it's movement. can give me pointers, doesn't have in objective-c. as3, javascript or java sufficient. * update (code rotating wheel) * -(void)touchesbegan:(nsset *)touches withevent:(uievent *)event { rotation = _startangle = atan2(384 - touchpoint.y, 512 - touchpoint.x); }; -(void)touchesmoved:(nsset *)touches withevent:(uievent *)event { cgpoint touchpoint = [[touches anyobject] locationinview:self.view]; rotation = atan2(384 - touchpoint.y, 512 - touchpoint.x); rotation = fmod(rotation - _startangle, m_pi * 2.0f); [wheel settransform:cgaffinetransformmakerotation(_circlerotationoffset + rotation)]; }...