Posts

Showing posts from February, 2010

ruby - Rails website documentation for an older version -

ruby - Rails website documentation for an older version - rails has beautiful documentation on guides , website: http://guides.rubyonrails.org/association_basics.html i taking on application uses rails 2.2.2 documentation on rails site latest version. how find 2.2.2 documentation? in other words check out how django it: https://docs.djangoproject.com/en/dev// can click version , documentation adjust accordingly? i see railsbrain.com has previous release docs, display api , looking nice site(ie. how current release site looks 2.2.2) thanks. http://apidock.com/rails/ has version scale see documentation different versions. also official guides have branches older versions, e.g. rails 2.3: http://guides.rubyonrails.org/v2.3.11/, rails 3.2: http://guides.rubyonrails.org/v3.2.13/ ruby-on-rails ruby

python - Where is pyside-uic? -

python - Where is pyside-uic? - i'm trying utilize qt designer , pyside-uic mydesign.ui > design.py however, programme doesn't exist. looked in site packages under python 2.7, , see: pyside-lupdate.exe pyside-rcc.exe and bunch of other programs, there no such thing pyside-uic.exe ... why ?? why missing installation package? it? you should see /python27/scripts/pyside-uic.exe. i'm wondering why it's not visible (not executable). maybe it's packaging problem (permissions, etc). seek phone call using finish path. python qt pyside

Trying to get some useful data from a log file with regex in Java -

Trying to get some useful data from a log file with regex in Java - i'm having problem regex, because can match of goals. i have log file , must match of items , write txt file. wrote java code short illustration of code when set whole file, gets messed up. *052511 074217 0065 02242806000 unknown u g *052511 074217 0065 4874 02242806000 unknown u *052511 074218 0065 4874 02242806000 unknown u r -------- 05/25/11 07:42:17 line = 0065 stn = 4874 calling number 02242806000 name unknown unknown bc = speech 00:00:00 incoming phone call ringing 0:02 00:00:11 phone call released i have find these results file: incomming,05/25/11,07:42:17,0065,4874,02242806000,00:00:09,2 in look 00:00:09 means [00:00:11-00:00:00]-0:02 for every incoming , outgoing calls, must create conversation above. here code here log file you utilize regex...

wpf - How to thread a viewlist custom view binding so that the UI doesn't freeze -

wpf - How to thread a viewlist custom view binding so that the UI doesn't freeze - i new wpf, though have tried read much can, newbie in need of wisdom wpf sages here. i have viewlist custom view display tileview of linecharts. user selects item in separate listbox, sets datasource used in listview. problem ui freezes while listivew generating view. here how layout looks: ((sorry, new @ site can not post images, yet, here link: screenshot)) the datasource consist of class contains descriptive properties , list of list of datapoints (x,y). tileview takes list of list of datapoints , generates 1 line chart each listitem using list of datapoints draw line. currently have datasource list holding 200 items , each item has 200 datapoints (x,y). when select item in listbox of left, utilize selectionchanged event set itemssource property listview new dataset. problem ui freezes until charts generated. i have been trying different approaches without success. tried s...

nsarray - Sorting NSDate then associating it with its original unique ID -

nsarray - Sorting NSDate then associating it with its original unique ID - i have 2 arrays, 1 made of nsdates , 1 that's made of ints utilize unique identifier. i sort nsdate array using sortedarrayusingselector:@selector(compare:) sorts them perfectly, problem need associate dates original uid (the other nsarray). is there simple way or have for/if statements? couldn't associate 2 arrays in 1 nsdictionary? ok sort them way want. sorting nsarray nsdate uid

import - MEF: "A Composable Part should contain at least one EXPORT" -

import - MEF: "A Composable Part should contain at least one EXPORT" - from official mef documentation: a composable part should contain @ to the lowest degree 1 export. composable parts either added container explicity or created through utilize of catalogs. default catalogs mef ship identify composable parts through presence of export attribute. does mean snippet form same documentation not work, when using default catalogs, since doesn't export anything? class programme { [import] public imessagesender messagesender { get; set; } } i find hard believe classes participating in mef mix, must 'bring nutrient table', if want 'consume'. program above beingness simple example: there nil class add together mef mix. secondly, how parts beingness added "explicitly container"? documentation of e.g. compositioncontainer doesn't help me further. thanks in advance jan a composable part part can imported pa...

indexing - What should "length" be for this MySQL tinyblob key? -

indexing - What should "length" be for this MySQL tinyblob key? - for table i'm creating include ip ranges, need store 2 128-bit (16-byte) int values in mysql record. since mysql supports 8-byte ints, i've found need utilize binary column (tinyblob), , good. create table `ip_ranges` ( `ip_start` tinyblob not null, `ip_end` tinyblob not null, ... unique key `index_ip_ranges_on_ip_start_and_ip_end` (`ip_start`(16),`ip_end`(16)) ); i'm running problem unique index on these 2 columns. far understand, ipv6's integer representation 128 bits (16 bytes). such, set unique index ip_start , ip_end columns in unique key 16 bytes. unfortunately, end getting duplicate key errors when populating real ipv6 data: > insert `ip_ranges` (`ip_end`, `ip_start`, ...) values ("42540649945883696925221210589465935872", "42540649945883696943667954663175487487", ...); duplicate entry '42540649945883696925221210589465935...

datepicker - currentMonth problem in jQuery -

datepicker - currentMonth problem in jQuery - $(function() { $('#datepicker').datepicker({ beforeshowday: daystomark, onselect: function(date,evt){ if (evt.currentmonth < 10){ evt.currentmonth = "0"+evt.currentmonth; } if (evt.currentday < 10){ evt.currentday = "0"+evt.currentday; } //var month = evt.currentmonth; //console.log(nmonth); homecoming [true, "fancy-hover", ""]; daystomark(evt.currentyear+"-"+evt.currentmonth+"-"+evt.currentday); } }); }); but when i'm checking in console year 2011, day 7 , month has problem, show 06 not 07. guess array problem counting 0 how can prepare it? i tried -> evt.currentmonth = evt.currentmonth + 1 but no result. thanks in advance months in javascript 0 in...

java - HashMap is broken/ performance issues -

java - HashMap is broken/ performance issues - currently have hashmap implemented private static map<string, item> cached = new hashmap<string, item>(); and item object properties date expirationtime , , byte[] data this map used when multiple threads concurrently start hitting this. check 1. class="lang-java prettyprint-override"> public static final byte[] getcacheddata(httpservletrequest request) throws servletexception { string url = getfullurl(request); map<string, item> cache = getcache(request); // chec item item = null; synchronized (cache) { item = cache.get(url); if (null == item) homecoming null; // create sure not on hr old. if (item.expirationtime.gettime() < system.currenttimemillis()) { cache.remove(url); item = null; } } if (null == item) { log.info("expiring item: " + url); ...

keyboard events - Modify Key press action in QTableView (PyQt4) -

keyboard events - Modify Key press action in QTableView (PyQt4) - i'm using qtableview class display table database. want allow user edit table using keyboard only. however, default behavior of class reset focus starting index of table after 2 edits, ie. edit cell, press "down" key, edit cell, 1 time again press "down" key, @ point table loses focus; next time press downwards key, first cell of table gains focus. what methods of class should @ modify behavior? i'm using single item selection mode: self.entryview = qtableview() self.entryview.setmodel(self.logmodel) self.entryview.setitemdelegate(logdelegate(self)) self.entryview.setselectionmode(qtableview.singleselection) self.entryview.setselectionbehavior(qtableview.selectitems) i used treewidget before should similar. how explicitly specifying "active item" calling setcurrentitem() method after modification? in way can have right focus pyqt4 k...

sql server - ExecuteScalar and SqlDataAdapter.Fill Behave different for same query -

sql server - ExecuteScalar and SqlDataAdapter.Fill Behave different for same query - i have big stored procedure run. @ end supposed select singe value if succeeded or not, run query dim command new sqlcommand(sqlstring, conn) homecoming command.executescalar() which works. there error in stored procedure. know causing error because logic in stored procedure rolls transactions, , after execute scalar call, transaction count downwards 0 , info hasn't changed. no sql exception generated. the unusual part is, changed code grab result sets sp see if more information. called same sp this, dim daobj sqldataadapter = new sqldataadapter dim commandobj sqlcommand = new sqlcommand(sqlstring, conn) daobj.selectcommand = commandobj dim ds new dataset() daobj.fill(ds) when run this, exact same sql before, executing exact same stored procedure, time sql exception because 1 of nested sp calls missing required parameters. so cause this? why running 1 ...

java - how to onclick for jsonobject/listview feed item? -

java - how to onclick for jsonobject/listview feed item? - i'm trying follow tutorial http://automateddeveloper.blogspot.com/2011/05/android-rss-reader-20.html i'm using eclipse , developing android 2.0 here problem *i cant figure out how set onclick listener or similar each article *i'm trying create go website article onclick public class utezone extends listactivity { private rsslistadapter adapter; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); list<jsonobject> jobs = new arraylist<jsonobject>(); seek { jobs = rssreader.getlatestrssfeed(); } grab (exception e) { log.e("rss error", "error loading rss feed stream >> " + e.getmessage() + " //" + e.tostring()); } adapter = new rsslistadapter(this,jobs); setlistadapter(adapter); } } public class rsslistadapter extends ...

vector - Transform an upper triangular matrix into a full matrix C++ -

vector - Transform an upper triangular matrix into a full matrix C++ - how code can transform upper triangular matrix total matrix. matrix in vector, not in bidimensional array... so array [ 1 2 3 4 0 5 6 7 0 0 8 9 0 0 0 10 ] would become array like: [ 1 2 3 4 2 5 6 7 3 6 8 9 4 7 9 10 ] could provide ideas, thinking in applying kind of module or something... there 1 restriction, i not using bidimensional arrays usng vector, unidimensional array first, must understand fundemtnal nature of reflected matrix. i , j , next assertion true: m[i][j] ≡ m[j][i] so, need algorithm create true. may suggest: for(int = 0; < height; ++i) for(int j = 0; j < i; ++j) m[i][j] = m[j][i]; note status of 2nd loop. ensuring j less i , restrict our activity bottom-left triangle. next, must understand how have implemented two-dimensional matrix in one-dimensional array. appears have established identity: m[i][j] ≡ v[i*width+j] substit...

javascript - Why isnt this regex picking up my pattern? (works on flash) -

javascript - Why isnt this regex picking up my pattern? (works on flash) - here illustration http://jsfiddle.net/mwdcv/1/ using http://gskinner.com/regexr/ want in javascript not pattern pass(word)?\=\s*(\<[^>]+\>)*\s*([^<]+) aka var myre = new regexp('pass(word)?\=\s*(\<[^>]+\>)*\s*([^<]+)', 'gim'); text <br /> run password= <br /> test <br /> you utilize regexp constructor takes string, backslashes string escapes. utilize regexp literal instead, in other answer. :) javascript regex

zend framework - doctrine 2 remove object from relationship array collection -

zend framework - doctrine 2 remove object from relationship array collection - class lists extends \entities\abstractentity { /** * @id @column(name="id", type="bigint",length=15) * @generatedvalue(strategy="auto") */ protected $id; /** * @manytomany(targetentity="\entities\users\usercomments") * @joincolumn(name="id", referencedcolumnname="id") */ protected $comments; public function getcomments() { homecoming $this->comments; } public function addcomments($comment) { $this->comments->add($comment); } public function deletecomments(\entities\users\comments $comments) { $this->comments->removeelement($comments); } /** @preupdate */ public function updated() { //$this->updated_at = new \datetime("now"); } public function __construct() { $this->entry = new \doctr...

RabbitMQ real world scenario -

RabbitMQ real world scenario - what require usage of rabbitmq is: producer produces messages , receiver receives all messages, published after time has first connected queue. since consumer wants consume messages published. since, if more 1 consumer connected same queue, consumers not receive messages.(also, see here). hence, consumer must create 'exclusive' queue , connected desired exchange. also, wants receive messages published when downwards ( in future). hence queue 'durable'. now, scenario looks : a consumer c1 creates queue q1 exclusive , durable. downwards time , in meantime user c2 tries connect queue q1. c2 successfull since, q1 has no subscriber connected it. so, c2 gets connected exclusive , durable queue. now, if c1 tries connect queue q1 cannot so, since consumer c2 subscribed queue q1. how 1 can prevent such scenario ? i hope, clear time. ahhh!! simple answer... wasnot knowing thing consumer. create consumer exclusive. consumer can...

c++ - Memory usage of WinCE Application -

c++ - Memory usage of WinCE Application - is possible determine memory usage of win ce application? wince device not back upwards activesync debugging on ce5.0 device without activesync debugging ce apps without activesync round of powerfulness toys .net compact framework 3.5: spelunking in .net compact framework c++ windows-ce

BizTalk web service to return a value rather than void + ref -

BizTalk web service to return a value rather than void + ref - is there anyway web service generated biztalk web services wizard orchestration homecoming value, rather have void homecoming , utilize homecoming ref ? i'm trying emulate existing web service simple ... web method takes string , returns string ... public string mytestmethod(string myval) the proxy web service orchestration works, biztalk wizard generates ... public void mytestmethod (ref string myval) i've tried advanced option, forcefulness request response, doesn't seem anything are trying publish orchestration web service or schema service? considerations while using web service wizard : http://technet.microsoft.com/en-us/library/aa559660(bts.20).aspx ... 2006 r2 web-services biztalk biztalk2006r2

javascript - Why does this script start with a blank image? -

javascript - Why does this script start with a blank image? - i'm using script scroll through images in iframe. can't figure out how script start on image 1 rather start blank , go image 1. here script: <script type="text/javascript"> var limit = 8; var = limit - 1; function image_onclick(direction) { = ( + ( (direction == 'prev')?limit-1:1 ) ) % limit; document.getelementbyid('image_box').innerhtml = '<img src=images/gallery/image' + (i+1) + '.jpg>'; } </script> this script in body, <div id="leaf1"><button onclick="image_onclick('prev');"><img src="images/leaf.gif" alt="leaf arrow" border="0"/></button></div> <div id="image_box"></div> <div id="leaf2"><button onclick="image_onclick('next');"><img src="images/leaf2.gif...

security - Adding jQuery and javascript in URI (as null) -

security - Adding jQuery and javascript in URI (as null) - this security question. boss has asked me find (and show prototype) of possible hacks on site , on one. there input box on page , using uri javascript (also know void or null script) , have include javascript file , jquery file (for ease of presentation). next code did not work. javascript:{{ var e=document.createelement("script"); alert("hello world"); e.src = "http://code.jquery.com/jquery-1.6.2.js";e.type="text/javascript"; document.getelementsbytagname("head")[0].appendchild(e); };} (after uri encoding) did "hello world" alert box not able find script while using 'inspect element' in chrome. or otherwise no script ran. if understand right - want include add together new javascript page. solution and inspect element - right click on element , lastly 1 of menu. javascript security uri

c++ - printf using stack? -

c++ - printf using stack? - possible duplicate: confused printf() contains prefix , postfix operators. i came across code next snippet, int main() { int c = 100; printf("\n %d \t %d \n", c, c++); homecoming 0; } i expected output 100 & 101 output 101 100 could help me know why? the c , c++ standards not guarantee order of evaluation of function parameters. compilers evaluate parameters right left because order pushed on stack using cdecl calling convention. c++ programming-languages

java - Situations for multithreading -

java - Situations for multithreading - are there guidelines know whether particular programme benefit multithreading? in single threads, cpu utilization low, higher in cases if unrelated parts of programme made separate threads. maybe when 1 thread waiting i/o, other threads can utilize cpu. things out in programme see whether benefit multithreading? usually, multithreading when can decompose task in several independent subtask , have several processors perform task (optimization), or if need maintain scheme "interactive" (even if blocking task, reading network, beingness performed, other threads can maintain attenging user requests, example). and reason simulate paralelism (even if haven't got many processors threads) execute several "tasks" simultaneously (even if not real optimization achieved). tipically operating systems do, run several programs in paralell, if have give them little portions of time execute alternatively. java m...

asp.net - DotNetNuke module Page_Load fires twice -

asp.net - DotNetNuke module Page_Load fires twice - my module's page_load event firing twice each "actual" load. on initial load both loads' page.ispostback property false. i've renamed page_load module_load verify name wasn't issue. i've made sure method isn't handling both me.load , mybase.load , has been case in past. the thing i'm doing out of ordinary module inheriting intermediate base of operations class. culprit? my module: namespace modules.redactednamespace public class list inherits redactedmodulebase protected sub module_load(byval sender object, byval e system.eventargs) handles me.load if not me.page.ispostback bindlist() end if end sub end class end namespace my base: namespace modules.redactednamespace public mustinherit class redactedmodulebase inherits dotnetnuke.entities.modules.portalmodulebase end class end namespa...

emacs - How can I change a list of plain lines into headlines/TODO items? -

emacs - How can I change a list of plain lines into headlines/TODO items? - if paste in block of text composed of separated lines, there way convert each of lines either headlines or todo list items? so: item item item becomes: * item * item * item without having type [meta][return] @ begging of each line? with default org-mode configuration, select lines , including newline @ end of lastly line, , m-x org-toggle-heading . prefix argument, tells org-mode how many levels in should create heading ( c-u 4 m-x org-toggle-heading ) emacs org-mode

How does Chrome generate thumb views of URLs? -

How does Chrome generate thumb views of URLs? - how chrome browser capture thumbnail image of visited urls , show me on blank page under visited?? i interested in knowing how implement using website or extension.. take take screenshot. lalith if want write extension captures screenshot of current site there chrome.tabs.capturevisibletab() method. url google-chrome thumbnails

javascript - How to add text to form input -

javascript - How to add text to form input - i not sure start this. have form input box , submit button. when submit button pressed, form content submitted , used in javascript. want automatically add together text end of submission. so if user inputs "the dog walked" , pressed submit, form add together "across street." end of submission. thank you!! in event listener form's submit action, alter input. document.getelementbyid('theinputid').value = document.getelementbyid('theinputid').value + "across street." javascript html

visual studio 2010 - when InstallShield 2011 premier integrated in VS2010 .NET dependencies are not added at build time -

visual studio 2010 - when InstallShield 2011 premier integrated in VS2010 .NET dependencies are not added at build time - i have added is2011 project existing vs2010 solution. vs solution contains several projects. have added primary output of main project is2011. when is2011 project builds adds .net dependencies , gives warning cannot find dependencies. produces build warning 6248. spent lot of time searching problem , found next link on flexera software website wasn't helpful @ suggests dlls have been moved or deleted!! not case me. http://kb.flexerasoftware.com/selfservice/viewcontent.do?externalid=q107276 it looks unusual dependencies "a.tmp" or ".dll" , gives warning cannot find them either! don't understand why behaves that? has encountered same problem? solution? adding dependencies manually?!! please bear in mind have vs setup installer project picks dependencies automatically , has no problem. why cannot that? the built-in is2...

java - Special Characters are displayed in the message obtained from DB in Firefox browser -

java - Special Characters are displayed in the message obtained from DB in Firefox browser - i displaying web page, *.jsp file. <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> and <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/> lines in jsp. while retrieving message db in db2 , getting special characters in firefox browser. in ie , displayed fine , without special characters. please help. java javascript html html-parsing

android - Is there any problem with this code? -

android - Is there any problem with this code? - it produce stopped unexpectedly problem when force search button. public class beautiful extends activity { imageview radar; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); this.requestwindowfeature(window.feature_no_title); this.getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); setcontentview(r.layout.beautiful); radar = (imageview) findviewbyid(r.id.radar); button search = (button) findviewbyid(r.id.magnifier); imageview text = (imageview) findviewbyid(r.id.text); mediaplayer siren = mediaplayer.create(this, r.raw.siren); search.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub thread counter = new thread(new runnable(){...

java - Android Sockets - Client side IOException -

java - Android Sockets - Client side IOException - i'm trying connect simple java server on computer (in future true server, i'm learning how programme sockets first. when seek connect, application on phone throws ioexception. however, on emulator, not. i have: < uses-permission android:name="android.permission.internet"/> included in manifest. , here's code block that's executed when nail open: try { responsefield.settext("opening socket..."); socket socket = new socket(getip(),integer.parseint(getport())); responsefield.settext("socket opened. initializing out..."); out = new printwriter(new bufferedwriter(new outputstreamwriter(socket.getoutputstream())), true); responsefield.settext("done. initializing in..."); in = new bufferedreader(new inputstreamreader(socket.getinputstream())); responsefield.settext("done."); } grab (numberformatexception e1) { responsefield.settext(...

c# - Threading test question -

c# - Threading test question - i had interview question in test similar below, not have much experience of development using threads can please help advise me how approach question?: public class stringqueue { private object _lockobject = new object(); private list<string> _items = new list<string>(); public bool isempty() { lock (_lockobject) homecoming _items.count == 0; } public void enqueue(string item) { lock (_lockobject) _items.add(item); } public string dequeue() { lock (_lockobject) { string result = _items[0]; _items.removeat(0); homecoming result; } } } is next method thread safe above implementation , why? public string dequeueornull() { if (isempty()) homecoming null; homecoming dequeue(); } it seems me reply no. while isempty() procedure locks object, released phone ...

.Net Dictionary Hashing for Object type keys -

.Net Dictionary Hashing for Object type keys - i have few questions regarding dictionary below... a> algorithm used generate hash dictionary<t1,t2> if t1 reference or object type. b> collision avoiding techniques used part of algorithm? c> of next techniques more useful have object class ( t1 ) used key 2 different objects same primitive type contents assumed same key? overriding equals() , gethashcode() call? implementing iequatable<t1> interface? iequalitycomparer<t1> interface? d> when utilize linq lambda function .todictionary<>() necessary ienumerable should sorted on field used key in dictionary? never mind ! got reply here.... http://social.msdn.microsoft.com/forums/en-us/netfxbcl/thread/4355bcf8-3f01-4a85-b05e-bb2e829009b6/ thx guys. .net object dictionary types hash

iphone - Timeout doesn't work properly in the NSMutableURLRequest. But, why? -

iphone - Timeout doesn't work properly in the NSMutableURLRequest. But, why? - nsmutabledictionary* headers = [[[nsmutabledictionary alloc] init] autorelease]; [headers setvalue:@"application/x-www-form-urlencoded;charset=utf-8" forkey:@"content-type"]; [headers setvalue:@"text/html" forkey:@"accept"]; [headers setvalue:@"no-cache" forkey:@"cache-control"]; [headers setvalue:@"no-cache" forkey:@"pragma"]; [headers setvalue:@"close" forkey:@"connection"]; nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:url cachepolicy:nsurlrequestuseprotocolcachepolicy timeoutinterval:timeout_request]; [request sethttpmethod:@"post"]; [request setallhttpheaderfields:headers]; [request sethttpbody:body]; [self createconnectionwithrequest:request delegate:delegate]; my timeout_request=30 seconds , i'm waiting 80 seconds before i'll didfailwitherror. but, wh...

Cannot Generate Database from Entity Framework 4.1 Codefirst With SQL Server 2005 -

Cannot Generate Database from Entity Framework 4.1 Codefirst With SQL Server 2005 - i seek create database entity framework code first follow tutorial http://www.asp.net/mvc/tutorials/getting-started-with-mvc3-part4-cs but utilize sql server 2005 instead when sqlexpress when execute solution don't have create. wrong code this code. movie.cs public class film { public int id { get; set; } public string title { get; set; } public datetime releasedate { get; set; } public string genre { get; set; } public decimal cost { get; set; } } public class moviedbcontext : dbcontext { public dbset<movie> movies { get; set; } } and connection string in web.config <add name="moviedbcontext" connectionstring="data source=...;integrated security=sspi;initial catalog=moviedb;user id=...;password=..." providername="system.data.sqlclient" /> what wrong code? why database wasn't created. tha...

api - Fusion Table Google Maps Second Javascript Drop-Down Menu not working -

api - Fusion Table Google Maps Second Javascript Drop-Down Menu not working - right creating map have javascript menu allowing users alter different map views using google fusion table overlays. first dropdown menu works charm. however, sec dropdown menu not work other. 2 work together. example, select "animals" , "opportunity" , show locations cell info "animals" , "opportunity." this google maps html page: <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <!doctype html> <title>met sacramento internship map</title> <!-- style --> <style> body { font-family: arial, sans-serif; } #map_canvas { height: 500px; width:600px; } </style> <script type="text/javascript" src="http://maps.google.com/map...

Unexpected $end in php script? -

Unexpected $end in php script? - i have bit of code looks fine me, maintain getting next error: "parse error: syntax error, unexpected $end in /home/txclanco/public_html/hotmuze/addsong.php on line 21" this script takes in input form, checks duplicates , if there duplicate, not create new row add together 1 'rating' row songname song typed in. if there isn't duplicate, script add together info new row. info types are: id = a_i/int songname = varchar artist = varchar rating = int the script below mysql info blanked out: <? mysql_connect("localhost", "***", "***") or die(mysql_error()); mysql_select_db("***") or die(mysql_error()); $songname = $_post['songname']; $artist = $_post['by']; $ratenum = 1; $chkquery = "select * hotmuze songname='$songname'"; $plusonequery = "select * hotmuze songname='$songname'"; $updatequery =...

algorithm - multithreading - Query to show total time elapsed working on a set of processes -

algorithm - multithreading - Query to show total time elapsed working on a set of processes - i'm trying determine total elapsed time finish set of processes multithreaded application keeps track of start , end times in table. easiest way describe problem example. here's dumbed-down version of table (we'll phone call processes ) i'm working with: | id | start_date | end_date | --------------------------------------------------- | 1 | 07/15/2011 12:00:00 | 07/15/2011 12:01:00 | | 2 | 07/15/2011 12:00:00 | 07/15/2011 12:02:00 | | 3 | 07/15/2011 12:00:00 | 07/15/2011 12:03:00 | | 4 | 07/15/2011 12:01:00 | 07/15/2011 12:05:00 | | 5 | 07/15/2011 12:01:00 | 07/15/2011 12:03:00 | | 6 | 07/15/2011 12:03:00 | 07/15/2011 12:04:00 | | 7 | 07/15/2011 12:03:00 | 07/15/2011 12:07:00 | | 8 | 07/15/2011 12:03:00 | 07/15/2011 12:06:00 | | 9 | 07/15/2011 12:04:00 | 07/15/2011 12:05:00 | | 10 | 07/15/2011 12:05:00 | 07/15/2011 12:07:00 |...

Javascript Find argument passed to a function -

Javascript Find argument passed to a function - i needing find argument passed function function. let suppose have function called foo : function foo() { var = 3; var b = "hello"; var c = [0,4]; bar(a - b / c); bar(c * + b); } function bar(arg) { alert(arg) } as now, of course, bar alert nan . inside of function bar , want obtain argument in form passed. furthermore, want able access values of a , b , , c bar function. in other words, of nature: bar(a - b / c); function bar() { //some magic code here alert(originalarg); //will alert "a - b / c" alert(vars.a + " " + vars.b + " " + vars.c); //will alert "3 hello 0,4" } you may not think possible, know can weird things javascript. example, can display code of calling function this: function bar() { alert(bar.caller); } i willing bet few dollars sort of finagling can original form of argument , values of variables in argument. i can see ...

Android spinner background and default text -

Android spinner background and default text - i want add together spinner android application looks 1 in image. i don't want selector appear , want default text appear on left. thinking can set background image contain text, i'm afraid won't centered alternative choose. i've created functionality design have big problems. i create own data-adapter spinner creating new class implements spinneradapter-interface (an illustration can found here). in own adapter, can modify displayed text (for illustration in getview -method) , create print out "option name", too. android android-layout

alert - How to solve internet check problem in iPhone? -

alert - How to solve internet check problem in iPhone? - i working on application , have check net connectivity. using 2 files reachability.h , reachability.m. have show alert when net not working. but when observer check net shows alert view more 1 time. , times shows alert more 9-10 times. code here: in .h file reachability* internetreachable; reachability* hostreachable; networkstatus internetstatus; in .m file internetreachable = [[reachability reachabilityforinternetconnection] retain]; [internetreachable startnotifier]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(checknetworkstatus:) name:kreachabilitychangednotification object:nil]; hostreachable = [[reachability reachabilitywithhostname: @"www.apple.com"] retain]; [hostreachable startnotifier]; - (void) checknetworkstatus:(nsnotification *)notice { internetstatus = [internetreachable currentreachabili...

mysql - Is sharding simply horizontal partitioning across multiple databases? -

mysql - Is sharding simply horizontal partitioning across multiple databases? - ok i've got bit of confusion between terms horizontal partitioning , sharding. is sharding horizontal partitioning across multiple databases? in short, yes. longer answer: http://en.wikipedia.org/wiki/shard_%28database_architecture%29 mysql sql-server database partitioning sharding

javascript - jQuery iterate over table elements -

javascript - jQuery iterate over table elements - i trying retrieve info img element within html web page using jquery. i know start there 1 image when run next code, 2 alert boxes. contain same information.. does know doing wrong? $("#tablex td").find("img").each(function() { if ($(this).data("apple") == "orange") { alert($(this).attr("src")); } }); thanks. update: dom output.. <td id="tdp4" align="center" style="border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(201, 201, 201); border-right-color: rgb(201, 201, 201); border-bottom-color: rgb(201, 201, 201); border-left-color: rgb(201, 201, 201); "><img id="imgp4" src="/images/t/00.jpg" style=...

asp.net mvc 3 - How to set IE as default browser for mvc3 application -

asp.net mvc 3 - How to set IE as default browser for mvc3 application - i have set ie default browser when run asp.net mvc3 application opens default in mozilla firefox. how can set when run mvc3 application opens in ie default instead? if running application within visual studio can right-click html/aspx file outside of views directory , select 'browse with'. here can alter browser app launch when run app within visual studio. asp.net-mvc-3

c++ - Handles vs Smart pointers. What to use? -

c++ - Handles vs Smart pointers. What to use? - i'm starting develop graphical engine practicing purposes. 1 of first questions arised either utilize handles or smart pointers refer class instances. from point of view: smart pointers pros: created under demand, not have problem of becoming stale pointers; cons: in linked list, searching pointer o(n) operation. handles pros: search o(1), object relocation o(1); cons: can became stale pointers, creating new handle forces scheme check first null entry in handles table. which 1 choose? please explain selection. edited: i want clarify points after comments , answers. i don't mean smart pointers linked list in way of "are represented stl linked list". mean behave, in way linked list (if move 1 object 1 memory block another, need iterate total list of smart pointers update references object -it can done linked list -). and don't mean handles opaque pointers or pointer implementation models. mean...

routing - Change request format based on subdomain in Rails 3 -

routing - Change request format based on subdomain in Rails 3 - on rails 3 site, if user comes in through subdomain (say, mob.example.com ), want alter request format of request ":mobile". what's sensible way this, , should set code? i wound doing in way thought reasonable: module mobilizedcontroller extend activesupport::concern included before_filter :set_mobile_request_format, :if => :mobile_subdomain? end private def set_mobile_request_format request.format = :mobile end def mobile_subdomain? request.subdomains.include? 'm' end end class applicationcontroller include mobilizedcontroller end ruby-on-rails-3 routing

ios - How to deploy phonegap app to ipad/iphone -

ios - How to deploy phonegap app to ipad/iphone - i totally new making ipad/iphone application. totally new using phonegap. downloaded helloworld application , opened xcode. works fine in simulator. tried deploy ipad. when nail build , run in xcode, error: code sign error: identity 'iphone developer' doesn't match valid certificate/private key pair in default keychain. i have no thought means. applied apple developer programme few months ago. got email saying enrolled. need re-create kind of certificate apple business relationship on website ipad enable xcode deploy helloworld programme ipad? i totally confused on how test helloworld application on ipad.... additional notes ok, followed steps on how sign certificate , install in xcode. when seek build , run device, error: code sign error: provisioning profile 'forgelink' specifies application identifier 'forgelink' doesn't match current setting 'r8t3vn6vr7.forgeli...

Consuming a .net web service returning a dataset in an ANDROID application -

Consuming a .net web service returning a dataset in an ANDROID application - we have epod application running on windows mobile platform. trying port same application android platform. application uses web service written in .net communicate server , perform various functions. web service returns dataset, unable parse straight in android application , view details. trying ksoap , json ways. if out there has done before, please help out. have trying find solution week without success. if required, can modify web service returns xml or json object can parse in andorid application. any help / sample code much appreciated. thanks , regards rajendran menon .net services used in interoperable environments (= non .net clients) should not utilize datasets. have find why. best can modifying service expose simple soap or json = utilize custom info objets homecoming values service operations. android web-services

php - GreatCircle and mysql query -

php - GreatCircle and mysql query - i have table lon/lat coordinates need users mysql table in distance given coordinates (it can circle or square) i utilize greatcircle class (great circle distance question) north east west soth coordinates in distance starting point: $distance = 300; $greatcircle = new greatcircle(); // north $new_coordinates = $greatcircle->getpositionbydistance($distance, 0, $lon, $lat); $n_lon = $new_coordinates['lon']; //$n_lat = $new_coordinates['lat']; // east $new_coordinates = $greatcircle->getpositionbydistance($distance, 90, $lon, $lat); //$e_lon = $new_coordinates['lon']; $e_lat = $new_coordinates['lat']; // south $new_coordinates = $greatcircle->getpositionbydistance($distance, 180, $lon, $lat); $s_lon = $new_coordinates['lon']; //$s_lat = $new_coordinates['lat']; // west $new_coordinates = $greatcircle->getpositionbydistance($distance, 270, $lon, $lat); //$w_lon = $new_coordinate...

wcf - guidelines for developing a small Mac OSX project -

wcf - guidelines for developing a small Mac OSX project - i'm .net developer questions little mac project coming up. we going creating little programme mac osx. software need have simple ui (1 screen) , need consume wcf web service. should code on our windows boxes or on mac machines? have couple mac minis, windows development. what ide/dev environment should use? (eclipse, xcode, etc.) how mac software deployment work? ... no 1 has mentioned java/eclipse. isn't option? here 2 options: write in objective-c, using xcode on macs write in c#, using mono on windows or on mac sharpdevelop the advantage of #1 resulting app much easier deploy others, might have problem consuming wcf service. depends on exact interface exposing , types of parameters are. the advantage of #2 can utilize c# skills. don't know state of wcf in mono, , gui may not native. if go #1, main issue using objective-c. since targeting mac, create sure enable garbage col...

java - How to get JTextPane to display ellipsis to signal text overflow? -

java - How to get JTextPane to display ellipsis to signal text overflow? - i using jtextpane table cell renderer display rich text. when text long fit within cell, truncated. mimic jlabel behavior, i.e. show ellipsis (...) alert user part of text not visible. has done before? solution ended adopting, help stanislavl. algorithm works chopping off 1 character @ time off end of styleddocument , appending "..." , comparing resulting preferred width table cell width. inefficient, in case of long strings, not problem in case. can optimized. next goes renderer's gettablecellrenderercomponent m_dummytextpane.setdocument(doc); m_dummytextpane.setsize(short.max_value, table.getrowheight()); int width = m_dummytextpane.getpreferredsize().width; int start = doc.getlength() - 1; while(width >= table.getcolumnmodel().getcolumn(col).getwidth() && start>0) { seek { doc.remove(math.min(start, doc.getlength()), ...

mongokit remove all items from collection -

mongokit remove all items from collection - i remove items test collection. setup is connection = connection(app.config['mongodb_host'], app.config['mongodb_port']) db = connection.test_database.tutorial i have document model class test maps tests collection. i've tried deleting collection both connection.test_database.drop_collection('tutorial.tests') db.tests.remove() however querying like list(db.test.find()) still gives me old data. like list(db.tests.find()) returns empty list. if add together new entries tests previous query doesn't reflect changes, don't think thats accurate either. problem line: db = connection.test_database.tutorial since saying test database , tutorial collection removing worked when changed db = connection.tutorial mongokit

objective c - NSOperationQueue operation priority -

objective c - NSOperationQueue operation priority - i have problem operations. when add together operations nsoperationqueue , it's had executed have method add together array result. method: - (void)loadpostimagewithdictionary:(nsdictionary*)dict { nsdata *tmpimagedata = [[nsdata alloc] initwithcontentsofurl: [nsurl urlwithstring: [dict objectforkey:@"picture"]]]; uiimage *image=[[uiimage alloc] initwithdata:tmpimagedata]; [userpostimage addobject:image]; [image release]; } and if operation have executed - result adding array. need operations performed in order of added them. please help.. use [nsoperationqueue setmaxconcurrentoperationcount:1] method allow 1 operation run @ time, making serial queue on thread. if code depends on operations running in specific order (which, in multithreading, isn't design in first place), when why don't pass array of dictionaries single operation, downloads images , returns a...

jquery - How to fire a anchor to a fancybox? -

jquery - How to fire a anchor to a fancybox? - i have function used checked item , bring together separated "," info table. function funcselect(x){ var selecteditems = new array(); var selecteditemsname = new array(); $("table tbody input[@name]:checked").each(function(){ selecteditemsname.push($(this).attr('id')); selecteditems.push($(this).attr('id')+"/"+$(this).attr('value')); }); if (selecteditems.length == 0){ alert("no item selected!"); } else { var getjoindata = selecteditems.join(','); //alert('archive.htm?d='+selecteditemsname+'&f='+getjoindata); $('.xlink').fancybox({ // no thought }); .... } } and want fire link (archive.htm?d='+selecteditemsname+'&f='+getjoindata) fancybox open. have iframe type setting fancybox. how can this? please help..=( if underst...

Two class files created in Apache for 1 Java File -

Two class files created in Apache for 1 Java File - when compiled visataxdetailsdaohibernate java file in tomcat there 2 class files created named 1)visataxdetailsdaohibernate.class 2)visataxdetailsdaohibernate$3.class why 2 files created can tell me the $3 1 compiled anonymous inner class. java apache

Get infomation from Compressed XML file in Android application -

Get infomation from Compressed XML file in Android application - i have compressed(.gz) xml file on server. need read file , info store in sqlite db have access server via https. "https://server_address/path/employee.gz" normally when log in server folder these xml files stored, asks me user name , password. in code how handle this. i searched didn't exact 1 need. great if can help me in this. thanks. depending on how reading https, gzipinputstream might work. http://developer.android.com/reference/java/util/zip/gzipinputstream.html also, @ http://developer.android.com/reference/org/apache/http/auth/usernamepasswordcredentials.html accessing password protected directories http. android xml https gzip gz

java - IntelliJ tooltip shows JavaDocs -

java - IntelliJ tooltip shows JavaDocs - in eclipse, hovering on method, variable, etc displays tooltip corresponding javadocs. there such feature in intellij? for intellij 13, there checkbox in editor's page in ide settings edit: intellij 14, alternative has been moved editor > general page: lastly alternative in "other" group. (for mac alternative under menu "intellij idea" > "preferences") java eclipse ide intellij-idea

javascript - Check DOM element in Google Chrome Extension -

javascript - Check DOM element in Google Chrome Extension - i trying create simple google chrome extension - finding specific element on page , display alert. my problem specific page loads relatively slow (having ajax behind). how can create check when page loaded? i tried "run_at" : "document_idle" in manifest file, no success. shows me message, before whole page loads. i thinking check every sec (or something) whole dom elements, feasible solution? think slow downwards page... thanks. if element not exist on page when click "view source", 1 way of catching listening domsubtreemodified event, fires each time dom modified: document.addeventlistener("domsubtreemodified", function(event){ if(document.getelementbyid("my_element")) { //element added } }); javascript dom google-chrome google-chrome-extension

perl - Applescript, iTunes, and 'date' -

perl - Applescript, iTunes, and 'date' - i've got applescript phone call song set play count , set lastly played date. these called perl script fetching info last.fm. unfortunately, whenever phone call lastly played date script, error message setituneslastplayed.scpt: execution error: itunes got error: descriptor type mismatch occurred. (-10001) . i'm calling this: osascript /users/gms8994/setituneslastplayed.scpt "<artist>" "<title>" "wednesday, july 05, 2011 07:14:11 am" i did notice if request value of lastly play itunes, comes without zero-padding days , hours, tried removing those, no avail. here's script. on run argv tell application "itunes" set theartist (item 1 of argv) set thetitle (item 2 of argv) set thelastplay (item 3 of argv) set thelastplay date thelastplay set results (every file track of playlist "library" artist cont...

javascript - getJSON returning data -

javascript - getJSON returning data - i have looked through here , realize doesn't getjson returns object unusable. problem having trying edit else's code pull image flickr. trying create function homecoming description of pictures. know doesn't homecoming info there has way update global variable or somehow pass off info need variable homecoming function. jist of have far. function add_description(n){ var img_id = string(n); var textinfo =""; $.getjson('http://api.flickr.com/services/rest/?method=flickr.photos.getinfo&api_key=36c8b00c47e8934ff302dcad7775d0a2&photo_id='+img_id+'&format=json&jsoncallback=?', function(data ){ textinfo = string(data.photo.description._content); alert(textinfo); homecoming textinfo; }) } this code tried after updates george. thanks! var testobj=$.getjson('http://api.flickr.com/services/re...

android - Multiple lines on a button -

android - Multiple lines on a button - list item i want create button 1 image , more 2 lines of text. possible in xml? (eclipse) i`m trying code: android:id="@+id/itm1" android:text="item1" android:typeface="sans" android:textsize="20sp" android:textcolor="#ffffff" android:width="250dip" android:height="150dp" android:drawableleft="@drawable/image1" android:background="@android:color/transparent" android:layout_marginleft="80dp"/> to insert multiple lines in button, might utilize string.xml insert end of line. 1 create new variable character endofline "\n" in res/values/strings.xml. example: <string name="multiplelines">line1 \n line2</string> 2 refer in layout file. example, button: <button android:id="@+id/start" android:text="@string/multiplelines...

ASP.NET SQL Server Sessions and deployment -

ASP.NET SQL Server Sessions and deployment - i deployed first asp.net app server , fine if not problems database... have sessions stored in sql server 2 tables. tables operated thru stored procedures. when deploying app have moved database making backup re-create of local db , uploading production server. caused names mixed , stored procedures not working. is there way deploy database witch changed names ?! or every time deploy application server need run asp's create-session-in-db app ?! it's improve deploy database using sql scripts backup/restore or copy. can tailor scripts specific need @ time, eg. alter, drop/create. record of info structures can filed app. simon asp.net sql-server sql-server-2008 deployment

ajax - Why doesn't my sorting method get called? -

ajax - Why doesn't my sorting method get called? - this code: <table border="1" id="champs"> <tbody id="item-list-body"> <tr class="champ" id="view-item-<%= champ.id %>"> <td class="drag_handle">[déplacer]</td> </tbody> </table> <%= sortable_element('item-list-body',:url => sort_update_path, :tag =>:tr, :handle => :drag_handle) %> i able sort, method sort_update never call. i utilize rails 3.0.7 , ruby 1.9.2 it's particular elements' id's. has in format of string_integer . try changing to: <tr class="champ" id="view_<%= champ.id %>"> and mentioned, close tr ajax ruby-on-rails-3 sortable-tables

web applications - Where do I put image files, css, js, etc. in Codeigniter? -

web applications - Where do I put image files, css, js, etc. in Codeigniter? - where acceptable set css folders , image file folders? thinking within view folder? controller reroutes path base of operations url have specify path in .html file sits, redundant. i have setup this: application system assets js imgs css i have helper function returns total path depending on setup.. similar to: application/helpers/utility_helper.php: function asset_url(){ homecoming base_url().'assets/'; } i maintain mutual routines similar in same file , autoload codeigniters autoload configuration. note: autoload url helper base_url() access. application/config/autoload.php: $autoload['helper'] = array('url','utility'); you have access asset_url() throughout code. codeigniter web-applications frameworks codeigniter-2

Android: java.lang.IllegalArgumentException: Bad conversation thread id: 15555215554 -

Android: java.lang.IllegalArgumentException: Bad conversation thread id: 15555215554 - i trying delete sms messages android emulator , receiving next error: java.lang.illegalargumentexception: bad conversation thread id: 15555215554 does have same problem , can help me resolve problem? code delete message next: seek { final long thread_id = transactioncursor.getlong(1); uri thread = uri.parse("content://sms/conversations/" + thread_id); getcontentresolver().delete(thread, null, null); } grab (exception e) { system.out.println(e.getmessage()); } in manifest file have added next permissions: <uses-permission android:name="android.permission.read_sms" /> <uses-permission android:name="android.permission.write_sms" /> yes, ahmet, right , understand error message, changing code try { final long thread_id = transactioncursor.getlong(transactioncursor.getcolumnindex(...

microsoft xml excel - row formatting -

microsoft xml excel - row formatting - i using microsoft xml excel coldfusion display query results on excel sheet. using multiple worksheets. see there border style property available. there way can set background color rows , other styles. don't see documentation on how these. thanks see xml in excel , spreadsheet component total documentation. helps create spreadsheet, save *.xml , review output. example: ... <styles> <style ss:id="s23"> <interior ss:color="#800080" ss:pattern="solid"/> </style> <style ss:id="s24"> <interior ss:color="#0000ff" ss:pattern="solid"/> </style> </styles> <worksheet ss:name="sheet1"> <table ss:expandedcolumncount="1" ss:expandedrowcount="3" x:fullcolumns="1" x:fullrows="1"> <row> <cell ss:styleid="s23"><data ss:ty...