Posts

Showing posts from July, 2010

C++ Class Specification, Implementation problem -

i'm having problem getting separate compilation done. it's simple, can't figure out error. i'm getting these exceptions: > 36 c:\cpp\p6\employee.cpp expected `)' before ',' token 36 > c:\cpp\p6\employee.cpp expectedinit-declarator before ')' token 36 > c:\cpp\p6\employee.cpp expected `,' or `;' before ')' token 42 > c:\cpp\p6\employee.cpp expected `)' before ',' token 42 > c:\cpp\p6\employee.cpp expected init-declarator before ')' token 42 > c:\cpp\p6\employee.cpp expected `,' or `;' before ')' token for code: /*line 36*/ employee::employee(n, id) { //constructor name , id setname(n); setid(id); }; /*line 42*/ employee::employee(id, d, p, n) {//constructor member variables setid(id); setdept(d); setpos(p); ...

Spring Security Custom Authentication and Password Encoding -

is there tutorial out there or have pointers on how following spring-security? task: i need salt database authenticating username , use encrypt provided password (from login page) compare stored encrypted password (a.k.a. authenticate user). additional information: i use custom database structure. userdetails object created via custom userdetailsservice in turn uses custom daoprovider information database. my security.xml file far: <authentication-manager> <authentication-provider user-service-ref="userdetailsservice"> </authentication-provider> </authentication-manager> now guess i'll need <password-encoder hash="sha" /> but else? how tell spring security use databaseprovided salt in order encode password? edit : i found this so post informatative not sufficient: if define salt source in xml used password encoder, so: <password-encoder ref="passwordencoder"> ...

iphone - callout bubble MKMapView move problem -

im developping app uses mkmapview. wenn map moved perform server request new annotations based on coordinates. wenn annotation clicked sometines moves map. in case don't want perform request. has solution how know if callout buble moved map ? i tried - (void)mapview:(mkmapview *)mapview didselectannotationview:(mkannotationview *)view{ without success ! look @ this answer explain several methods track mkmapview has moved. that answers different problem, think might you.

.net - Is socket communication reliable protocol for Inter-process communication? -

i'm designing communication protocol used communicate between 2 pc applications using socket connection. common case when both application work on same machine, possible run 1 application on remote machine. application can exchange data 2mb/s. question is: shall use confirmation packets ensure packet sent 1 application received other one? know socket uses tcp connection confirmation/retransmission implemented need feedback used in practice. the technologies used: - socket server: .net application uses following library: http://www.codeproject.com/kb/ip/asyncsocketserverandclien.aspx - socket client: .net or delphi application this fine, traffic short-circuited in tcp/ip driver stack. there no great difference other ipc mechanism, takes memory-to-memory copy operates @ bus speeds. 5 gigabytes/sec typ microsecond or overhead. plus whatever context switching needs happen, far largest cost. named pipe operate same. falls off cliff of course once need go through ni...

flickr - Tutorial for uploading a photo from android -

hi there i'm looking tutorials upload photo android device service such flickr or photobucket etc. im not fussy! (i mean code tutorials, not how use android device ;) ) thanks, rich for flickr, start exploring flickr api @ http://www.flickr.com/services/api/ . there dedicated wrapper android, called flickrj-android . built upon flickrj , has extensive documentation , example implementing calls java code. for photobucket, start exploring public photobucket api documentation. good luck!

sql server - T-SQL and transaction flow - from first to last -

let's have table taba columns: col1 - primary key (but not identity) col2 - foreign key col3 - unique constraint col4 - check constraint col5 - not null constraint also, taba has 2 triggers: instead of insert - 1 cancel insert taba (of course), in it's own code insert new row taba . values column in new row guaranteed correct after insert - 1 print string now, ready insert new row taba (insert taba values(...)). obviously, have expect events: value col1 must checked uniqueness , not null(primary key) value col2 must checked conformity parental table(foreign key) value col3 must checked uniqueness value col4 must checked against check constraint value col5 must checked not null instead of trigger must executed after trigger must executed what want reorder list(1-7) number 1 on event happen first, 2=event happen second, ..., , 7 last event. also, if event x produce error (col5=null, example) - mean events x+1,x+2.. not happen? thanks hel...

documentation - Self documenting SQL -

i have used doxygen self document code in languages such php. not support sql. there equilivant program produce documentation sql? did take @ izzysofts hypersql ?

android - Delete a custom item when the button in it get clicked -

i have listview custom list items having following layout: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:id="@+id/itemnumbertext" android:text="1." android:textsize="16sp" android:textstyle="bold" android:layout_height="match_parent" android:layout_width="33dp" android:gravity="center_vertical|center_horizontal"/> <imageview android:src="@drawable/item" android:id="@+id/imageview1" android:layout_height="match_parent" android:layout_width="47d...

Cannot set default emacs color theme in .emacs file -

i searched everywhere , people suggest following code setting default color theme: (require 'color-theme) (color-theme-name) however, doesn't work. when start emacs error: warning (initialization): error occurred while loading `/home/epsilonvector/.emacs': symbol's function definition void: color-theme-name to ensure normal operation, should investigate , remove cause of error in initialization file. start emacs `--debug-init' option view complete error backtrace. this happens every theme name, ones correctness i'm sure of. what missing? try insert (color-theme-initialize) in between require , call theme name.

ios - How to make gamekit connection without needing both peers to press the same button -

i'm trying develop app send details of contact device. can connect 2 devices if same button on both devices pressed. my question is: can use gamekit make app listen devices in background listening device doesn't have press button allow searching device find it. basically: searching device(x): presses button -> finds other device listening device(y): device x connect you. (without needing press button make visible) well, i'm not sure i'm understanding question completely, can make app visible setting 'available' property of gksession object true. gksession *session = [[gksession alloc] initwithsessionid:@"myapp" displayname:@"name" sessionmode:gksessionmodepeer]; session.delegate = self; [session setdatareceivehandler:self withcontext:null]; session.available = yes; or maybe you're using gkpicker set connections, , referring modal window says "xx wants connect"? it possible silently auto-accept incomin...

tf.exe folderdiff diffing files in specific folders -

i want able diff app.config files resides in folders called messagingservice. have read documentation on tf.exe 50 times now, , can't understand syntax should different than: tf.exe treediff $/myproject/main $/myproject/prod /filter:"app.config;messagingservice\" /r but leaves no results. far can understand folder inclusion mask not behave expected, because following line works fine: tf.exe treediff $/myproject/main $/myproject/prod /filter:"app.config;!messagingservice\" /r but of course displays app.configs i'm not interested in :) any enlightening comments highly appreciated. try 1 ... tf.exe treediff $/myproject/main $/myproject/prod /filter:"app.config;*messagingservice*\" /r i believe stars needed after , before messagingservice word because "app.config" entire filename messagingservice word not entire path value, part of actual file path.

sql server - Putting Result sets into a temp table -

i have procedure called insert , code looks like: create procedure gen_insert begin create table #temp ( insert_stmt varchar(max) ) insert #temp exec generate_insert @table = 'admin' insert #temp exec generate_insert @table = 'impas' insert #temp exec generate_insert @table = 'asui' insert #temp exec generate_insert @table = 'alstd' select * #temp end when execute getting following error: msg 8164, level 16, state 1, procedure gen_insert, line 73 insert exec statement cannot nested. can me. an insert exec statement cannot nested. error message quite clear. nesting insert ... exec. statements. either procedures call ( generate_insert ) use again insert ... exec or caller of insert procedure uses in insert ... exec. can find case. rule of thumb, insert ... exec should avoided, because of this , other problems .

javascript - How to keep track of actions called by a jQuery dialog box? -

i have bit of dillema :) i have link users vote on item. click on link generated jquery ajax call checking if person logged in. if not, dialog box displays form login. but problem jquery call log in , whole bit popup box in different place. what need check if user got logged in successfully, , update vote count. i doing on site: http://www.problemio.com here jquery code far: <script type="text/javascript"> $(document).ready(function() { var $dialog = $('#loginpopup') .dialog({ autoopen: false, title: 'login dialog' }); $("#newprofile").click(function () { $("#login_div").hide(); $("#newprofileform").show(); }); $('.vote_up').click(function() { problem_id = $(this).attr("data-problem_id"); var datastring = 'problem_id='+ problem_id + '&vote=+'; $.ajax...

display a list differently Haskell? -

hey wandering if possible show list: ["one", "two", "three"] to shown as "one", "two", "three" need done file thanks you can intercalate data.list showlist :: show => [a] -> string showlist = intercalate ", " . map show the map show converts each element it's string representation quotes (and internal quotes escaped), while intercalate ", " inserts commas , spaces between pieces , glues them together.

android - How to get right landscape(90° or 270°) Rotation? -

i´m trying right landscape rotation. have done until now: androidmanifest.xml android:configchanges="keyboardhidden|orientation" code handle @override public void onconfigurationchanged(configuration newconfig) { super.onconfigurationchanged(newconfig); if (newconfig.orientation == configuration.orientation_landscape) { log.i("remodroid", "landscape"); } else if (newconfig.orientation == configuration.orientation_portrait) { log.i("remodroid", "portrait"); // 0 } } so portrait clear = 0° landscape can 90° or 270°. how find out. im looking smart solution if possible. not want use orientation-/rotationmatrix , oriantation of axis. do 1 have solution? you can use display.getorientation() returns 1 of following: surface.rotation_0 surface.rotation_90 surface.rotation_180 surface.rotation_270 for me information see android display docs .

jboss7.x - jboss7 + same log4j configuration for different apps -

i want deploy different applications using 1 jboss (jboss 7). can make clear me if possible set 1 log4j configuration (log4j.xml) multiple wars , ears or i'll have put copy of configuration each archive? or maybe can suggest differeng logging engine, more native jboss7? log4j configuration global runtime. ie. jboss instance can't have multiple log4j configuration. log4j can initialized or reinitialized single config file. can simple properties file or xml incompliance log4j.dtd packaged log4j*.jar. start jboss instance -dlog4j.configuration=/anypath/log4jconfig.xml

php - Is it possible to apply a mask on an image using jquery/javascript/html5? -

i looking way cat part of image, using image mask. i don't know if @ possible using web technologies. willing of using libraries (jquery, php, javascript) or available on market that. in general, want create themes use resources don't have cut in order make them in different shapes (rectangles, circles etc). onlywant able apply mask them on fly. i aware of imagemagick® cant figure out way on how use have such results without making code ugly. if don't have clue on masking is, here's link . if understand you're talking juxtaposing images. if so, can encapsulate div another, this: <div id="div1"> <div id="<div2"> </div> </div> and put image css background div2 , mask div1.

tags - Is there Liferay API access to the tagsentries_tagsassets table? -

i'm working on portlet 1 of our users want migrate load of data 1 liferay instance (and lar files failing generate). 1 of items of data needs moved tags associated journal articles. so can access tags through tagsentrylocalserviceutil class, can't access tagsassets_tagsentries table through method or class (that can find far). there service accesses table directly, or information have built in other way? my solution have far directly access database through jdbc driver (rather using api) , join on tagsasset , tagsentry tables (which in effect tagsassets_tagsentries is). there better way doing this? many thanks. edit i'm using liferay 5.2.3. sorry not responding or updating until now, recieved no notifications responses! :) i bet there no such api because tagsentries_tagsassets junction table. represented in api lists of tags of article and list of articles of tag. generating lar should solution, although not. better solution imho generate dump of ...

delphi - iterate over IHTMLElementCollection -

is there way iterate on ihtmlelementcollection? such var e : ihtmllinkelement; elementcollection:ihtmlelementcollection; begin e in elementcollection showmessage(e.caption); end; i know there property named _newenum, not supported in delphi as understand. update: apperently links ihtmlelement , not ihtmllinkelement for := 0 pred(elementcollection.length) begin e := elementcollection.item(i, emptyparam) ihtmlelement; //... end;

javascript - Can a backbone view have more than one collection? -

i starting out backbone , trying set view has question list. left of list have 4 filters, filter list language, country, status, , study. list , each of filters loaded own collections. my idea make 1 view multiple collections, wonder if best practice in backbone since examples have seen have 1 collection per view. another idea break in 2 views 1 being responsible filters , child view being responsible list of questions. or, more backbone style drop of collections model , pass model view mentions here: http://documentcloud.github.com/backbone/#faq-nested thanks ideas. yes. theoretically view can encompass number of inner objects/collections. makes sense have views discrete possible, there reasons wrap more 1 thing in single view. this matter of design. don't see creating container model bucket collections buys you. don't concerned absolute best way. takes walking little down wrong path figure out better ways particular project.

c# - Update ObservableCollection from BackgroundWorker/ProgressChanged Event -

i'm writing simple tool troubleshooting computers. wpf window listbox bound observablecollection<computerentry> computerentry simple class containing computer host name, , status. tool ping each compute name in list, , if response received computerentry.status updated indicate computer connected network somewhere... pinging can take time, couple seconds per computer depending on if has timeout or not. i'm running actual ping in backgroundworker , using reportprogress method update ui. unfortunately observablecollection not seem raise propertychanged event after objects updated. collection update new information, status never changes in listbox . presumably because not know collection has changed. [edit] per fantasticfix, key here is: "the observablecollection fires when list gets changed (added, exchanged, removed)." since setting properties of object instead of modifying it, observablecollection not notifying list of change -- didn't know ...

javascript - What is the order of precedence for boolean operators in JS? -

e.pagex = e.clientx + (html && html.scrollleft || body && body.scrollleft || 0) - (html.clientleft || 0) how expression evaluate? you can find precedence table javascript operators on mdn: https://developer.mozilla.org/en/javascript/reference/operators/operator_precedence . great source javascript documentation in general. anyway, && has higher precedence || a && b || c || d equivalent (((a && b) || c) || d) . similar many other language c-inspired syntax.

windows - How to effectively use git repositories / submodules for a C++ product that has many dependencies? -

i'm new git , still figuring things out... think i'm understanding whole branching/merging aspects. i'm still not sure best solution handling project dependencies are. best practice? has got common problem , yet can't find tutorial or best practice on doing this. suppose have c++ product depends on several other c++ libraries, making complicated dependency graph. libraries like: other internally developed c++ libraries, public open source libraries, off-the-shelf closed source libraries the final c++ product's source code relies on output of dependencies in order compile. these outputs composed of: a series of c++ header files (notice c++ implementation files absent) a set of compiled binaries (lib files, dll files, exe files, etc) my understanding should put each library own repository. sounds git's submodules looking for. write-up @ http://chrisjean.com/2009/04/20/git-submodules-adding-using-removing-and-updating/ in particular seems in...

Find if class has border in css -

find if class has border in css only, using attribute selector or other means.if not having apply border.intention not fall on either jquery. possible acheive? edited include response @nag (op): in ie8 there no border select . i'm trying css reset this: select, input[type="file"], textarea { border: solid 1px #7f9db9; } the problem is overriding preexisiting style because of specificity. tried use expression filter doctype in ie8 not seem work. css has no concept, or implementation, of if/else statements, not possible in css only. however, if define border element, , later redefine border second statement override first (assuming equally specific selector), i'm unsure why need apply border if element doesn't have border defined: div { border: none; /* removes border */ } /* other stuff */ div { border: 1px solid #f90; /* defines border */ } similarly: div { border: 5px solid #0f0; /* defines border */ } /...

python - Understanding intermediary SQL statements in SQLAlchemy -

so have table, , want have users able view table in whichever order they'd like. here's example: class thing(base): __tablename__ = 'thing' id = column(integer, primary_key=true) amount = column(integer) date = column(datetime, default=datetime.now()) def __init__(self, amount): self.amount = amount so i'd make following query: if sort == 'amount': orderby = thing.amount.desc() elif sort == 'date': orderby = thing.date.desc() things = dbsession.query(thing).order_by(orderby).all() main questions: when set orderby statement, calling or statement being set? am doing correctly , efficiently? can filters? filterby = thing.amount == 5 things = dbsession.query(thing).filter_by(filterby).all() thanks! ans 1: when giving syntax return can check type of syntax like when write in [5]: thing.amount.desc() out[5]: <sqlalchemy.sql.expression._unaryexpression object @ 0x199a5d0>...

linux - Cron job calling bash script and python scripts -

okay have bash script downloads web page, , use python pulls data out of downloaded page. bash script along lines of #!/bin/bash html_file="web_page.html" wget -o /home/michael/documents/cs288/homework7/web_page.html http://markets.usatoday.com/custom/usatoday-com/html-mktscreener.asp?exchange=13\&screen=1 python hw_7_2.py $html_file now, when execute bash script command line runs fine, wget runs , python script executes, when set cron job wget run python script never executes. have not set cron jobs think may issue. crontab file looks like shell=/bin/bash path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin * * * * * michael /home/michael/documents/cs288/homework7/usatoday_runner.sh try replace cron line : * * * * * michael /home/michael/documents/cs288/homework7/usatoday_runner.sh > /tmp/why_is_this_failing.log 2>&1 the answer may in /tmp/why_is_this_failing.log

Dynamic ID's for HTML ELements -

lets in aspx page have loop , within loop want create elements. how can generate id 's dynamically them. for instance if have : <div> <% foreach (item in itemcollection) { %> { <table> <tr> here want create td elements id recontext1 recontext2...the numbers @ end incrementing index. </tr> </table> } </div> you use for loop index or separate index variable foreach : <% int = 1; %> <% foreach (item in itemcollection) { %> <tr> <td id="recontext<%= %>">...</td> </tr> <% i++; %> <% } %>

html - Encoding videos in HTML4 -

i'm developing webapp client requires compatibility across modern browsers (chrome, safari, firefox), plus ie 7 , up. html5 not option. webapp needs display videos @ times, , videos must embedded (the user cannot download them , use external player). can ask client provide these videos in whatever format best. regarding access, videos may local files or may hosted on server somewhere; we're not sure yet. with html5 gaining support, haven't been able find information best way embed videos in html4. there particular encoding format best? i've seen information using flv, (or best) option? i'd prefer stick 1 format works browsers if possible. the <video> tag introduced in html5. if looking best compatibility older browsers, best off using flash/flv.

asp.net - How do I apply XsltSettings AND XmlReaderSettings in loading a transformation? -

i'm trying load xslt transformation in .net 2.0 . i'm taking in xml document in memory, it's dynamically generated before hand. when use xmlreader option prohibitdtd=false , error saying need enable scripts in xsltsettings. if use load method xsltsettings (trusted), dtd error. thoughts on how apply both prohibitdtd=false , enablescript=true ? public static string convertxml(xmldocument inputxmldocument, string xsltfilepath, xsltargumentlist xsltargs) { stringwriter sw = new system.io.stringwriter(); xslcompiledtransform xsltrans = new xslcompiledtransform(); xmlreadersettings settings = new xmlreadersettings(); settings.prohibitdtd = false; xmlreader reader = xmlreader.create(xsltfilepath, settings); try { //xsltrans.load(reader); xsltrans.load(xsltfilepath, xsltsettings.trustedxslt, new xmlurlresolver()); xsltrans.transform(inputxmldocument.createnavigator(), xsltargs, sw); return sw.tostring();...

node.js - How do I pass data from the client-side to my nodejs server using socketio? -

using socketio on client side , nodejs socketio on server side, how go passing data client side server? use emit function socketio on client side? yes. client side or server side emit events , handle events. client side: var socket = io.connect('http://localhost'); socket.emit('my other event', { my: 'data' }); server side: io.sockets.on('connection', function (socket) { socket.on('my other event', function (data) { console.log(data); }); });

entity framework 4 - EF4: Creating a 0..1 to Many Association -

i trying add association didn't have originally. realized 2 tables technically related, , navigation properties might simplify have otherwise had manually. tables , keys this: import primary key: number : int32 date : datetime hour primary key: departmentid : int32 usernumber : int32 date : datetime the association named importhour. import.number maps hour.usernumber, , import.date maps hour.date. trying add association 0..1 on import, , * on hour navigation properties , no additional foreign keys. when this, designer tells me association not mapped. if generate ddl, creates new fields hours.import_date , hours.import_number (hours actual database table name hour entity). if manually map fields, end following error: error 3021: problem in mapping fragments starting @ line 332: each of following columns in table hours mapped multiple conceptual side properties: hours.date mapped <importhour.hour.date, importhour.import.date> hours.usernumber mapped ...

c++ - Calling member function of an object inside a vector -

this continuation on previous question here regarding retrieving , editing private members of objects in vector . i have vector full of objects have private members need access. i have created accessor functions returning each private member , looking best way iterate through vector of objects, returning specific private member , comparing given variable until match found. i have considered using find_if have had no luck using member functions return value, each object in vector, criteria. neither have been able use for_each job. the reason creating additional question i've been dwelling longer should , it's getting become quite urgent find solution problem. nudge in right direction appreciated! create functor: struct compareto{ compareto(const anotherobject& avalue) : thevalue(avalue){} bool operator()(const object& anobject) const{ return anobject.getmembervar() == thevalue; } const anotherobject& thevalue; }; t...

Matlab dwt across specified dimension -

i have dataset sig of size 65536 x 192 in matlab. if want take one-dimensional fft along second dimension, either loop: %pre-allocate ect.. i=1:65536 f(i,:) = fft(sig(i,:)); end or specify dimension , without loop: f = fft(sig,[],2); which 20 times faster dataset. i have looked similar discrete wavelet transform (dwt), been unable find it. wondering if knows way dwt across specified dimension in matlab? or have use loops? i presume you're using function wavelet toolbox: http://www.mathworks.co.uk/help/toolbox/wavelet/ref/dwt.html the documentation doesn't seem describe acting on array, it's not supported. if allow input array, operate on first non-singleton dimension or ignore shape , treat vector.

C# Database Insert (ASP.NET) - ExecuteNonQuery: CommandText property has not been initialized -

first time i'm doing insert asp.net/c# , i'm having little issue. keep getting following error every time code runs: " executenonquery: commandtext property has not been initialized" know means , how fix it? thanks in advance! string sqlquery = "insert ati_log_io (date, connect_time, disconnect_time, ati_rep, reason_for_access, property_contact, case_number, comments, property_id)"; sqlquery += "values (@today, @connect, @disconnect, @rep, @reason, @contact, @casenum, @comments, @propertyid)"; using (sqlconnection dataconnection = new sqlconnection(connectionstring)) { using (sqlcommand datacommand = dataconnection.createcommand()) { dataconnection.open(); datacommand.commandtype = commandtype.text; datacommand.commandtext = sqlquery; datacommand.parameters.add("@today", datetime.today.tostring()); datacommand.parameters.add("@connect", txtindate.text + " " + from...

python - Adding a library to C -

i'm working python, have basic understanding of packaging c. don't know how build c 'path.' also, google searches seem failing me returning results on c++. or solution? the objective include qrencode.h, can surly put in same folder i'd know how link instead. thanks! ps. always, addition read material relevant appreciated! you use include directive include *.h file in c/c++ code: #include "qrencode.h" as @ignacio vazquez-abrams says, though, that's header, declares functions; need actual functions, , they'll in *.dylib or *.so file, needs linked executable. compiling turning 1 *.c file *.o file; linking when put *.o files , libraries application. -l option on linker command line tells libraries; -l option tells include library.

php - Save and download PDF -

i need 2 things & @ same time dompdf. i need following - possible? //print pdf file screen saving $dompdf->stream("pdf_filename_".rand(10,1000).".pdf", array("attachment" => false)); //save pdf file on server file_put_contents('/home/stsnew/public_html/pdf/file.pdf', $dompdf->output()); the above works fine if $dompdf->stream , $dompdf->output() done separately/individually , when try run them shown above, crashes. any help/advice appreciated. why dont swap them round create pdf first file , stream created file ? $file_to_save = '/home/stsnew/public_html/pdf/file.pdf'; //save pdf file on server file_put_contents($file_to_save, $dompdf->output()); //print pdf file screen saving header('content-type: application/pdf'); header('content-disposition: inline; filename="file.pdf"'); header('content-transfer-encoding: binary'); header('content-length: ' . fil...

Instantiating Groovy class within Java class -

i have groovy class @immutable class statuscode { final int statuscode } i want create object of class in java class say, test.java. when use, public class test{ statuscode statuscode; public void setstatuscode(int statuscode) { this.statuscode = new statuscode(statuscode); } } it says constructor missing. how instantiate object ? groovy code can compiled java bytecode using groovyc . give valid java class can reference other java class. still need have groovy runtime jar on claspath. it's possible groovy compiler generate desired constructor you, i'm not sure. if not, you'd need explicitly code in groovy class.

php - database post: pagination -

so trying page paginate after 10 posts on forum. pagination buttons appear , function , variable url working correctly, page 1 displays posts in database instead of 10 , page 2 displays same thing (all posts). i'm sure simple not seeing... the code main forum page this: $conn = mysql_connect("$host", "$username", "$password"); if(!$conn) die("failed connect database!"); $status = mysql_select_db("$db_name", $conn); if(!$status) die("failed select database!"); $sql="select * $tbl_name order id desc"; // oreder id desc order result descending $result=mysql_query($sql); include ('pagination.php'); ?> <?php $pager = new ps_pagination($conn, $sql, 10, 5, "param1=valu1&param2=value2"); /* * enable debugging if want o view query errors */ $pager->setdebug(true); /* ...

javascript - JQuery Mobile #Home link reload page -

i have internal link in jquery mobile code: <a href="#home" data-role="button">start again</a> the problem it's not restarting page when link it. anyone know way this? update: using ajax navigate pages , have hashes in url it's not returning start url (minus hashes) cannot work. you can add data-ajax="false" <a> tag. force jquery full reload.

Passing in an anonymous method/function as a parameter in C# -

i have method needs conditionally execute method, this: int mymethod(func<int> somefunction) { if (_someconditionistrue) { return somefunction; } return 0; } i want able pass linq query in mymethod somefunction: int = mymethod(_respository.where(u => u.id == 1).select(u => u.otherid)); how do this? int = mymethod(() => _respository.where(u => u.id == 1).select(u => u.otherid)); as can see, i've made query lambda. have because otherwise, query executed before calling mymethod (...and introduce compile-time errors ;) ) , not while executes. a side note: this return somefunction; should return somefunction(); .

decompiling - .exe MATLAB file decompilation -

i trying decompile 32kb .exe matlab file. tried boomerang software, extracts project m-files , figures. figures ok , matlab can show them. when open m-files, contains unmeaning characters. how can see m-files codes? know other suitable software? thank much. if .exe file has been produced matlab compiler, not possible. matlab code encrypted part of deployment process.

maven - How to configure a single Jenkins job to make the release process from trunk or branches? -

i enhancing release process of our projects on jenkins (1.430). current release jobs today, 1 specific project, have 1 job dedicated release process. complete procedure following: the developer in charge of release changes manually version of pom.xml files (in fact using mvn versions:set -dnewversion=2.0 ) rid of -snapshot . then, creates tag in svn ( http://my-svn-repo/project/tags/v_2_0 example). once tag has been created, logs on our jenkins server, , starts release build. this build ask him tag wants use build. job configured parameterized build , parameter list subversion tags . jenkins build artifacts tag, , deploy them on our nexus instance. once done, developer set pom.xml versions new development version (i.e. 2.1-snapshot ). the advantage of method have jenkins job, build rely on tag. however, procedure involves many human interventiosns (changes of pom.xml, commits, tags, etc.). new release jobs now, use maven release plugin. i've created job as...

c# - get extension of file(edit) -

i want extension file of url . for example extension http://www.iranfairco.com/download-file/02912bb889cb24 . if extension file gif. edit: for example url "http://www.online-convert.com/result/d8b423c3cbc05000cc52ce7015873e72" please me how can extension of url? why path.getextension not work you? edit ah, url doesn't specify extension after. means anything behind it. just inspecting string value of url, can't see behind it. (second) example point (ultimately) .gif file, have been .jpg, .doc (or .exe). you need webrequest see back. try head headers (and inspect content type), don't think work here. try fiddler see back, can refine question.

iphone - Is it possible/sensible to use an in-memory persistent store as a staging area, and if so how do I clear it? -

we've got data coming our app. saved, we've made entity , nsmanagedobject subclass it. usually, though, objects instantiated , never saved. i'm thinking of using persistent store, nsinmemorystoretype, staging area, moving ones want save sqlite store. possible/sensible? if is, i'd clear out staging area every often. there way clear out objects assigned memory store? you should read lengthy blog post on temporary core data objects. it's insightful. http://www.cimgf.com/2011/08/08/transient-entities-and-core-data/

plugins - Zend cookie issue -

i'm working on zend 1.11 webapp. built language-selector plugin switching language (it & en) depending on user input. this have: class ls_controller_plugin_langselector extends zend_controller_plugin_abstract { public function predispatch(zend_controller_request_abstract $request) { if($request->getparam('lang')) { $lang=$request->getparam('lang'); setcookie('lang', $lang, time() + (3600)); echo "we set cookie"; } else if (isset($_cookie['lang'])) { $lang=$_cookie['lang']; echo $lang; } else { echo 'we here.but can't understand why'; $lang='en'; var_dump($_cookie); } switch(strtolower($lang)) { case 'en': $locale="en_us"; break; case 'it': $locale="it_it"; break; default: $...

ruby - Rails 3 - 'Couldn't parse Yaml' -

i don't know did wrong. try run 'rails c,' gives me error. working 10 minutes ago. :\ c:/ruby192/lib/ruby/1.9.1/psych.rb:148:in `parse': couldn't parse yaml @ line 2 column 12 (psych::syntaxerror) c:/ruby192/lib/ruby/1.9.1/psych.rb:148:in `parse_stream' c:/ruby192/lib/ruby/1.9.1/psych.rb:119:in `parse' c:/ruby192/lib/ruby/1.9.1/psych.rb:106:in `load' c:/ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/applic ation/configuration.rb:88:in `database_configuration' c:/ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.7/lib/active_r ecord/railtie.rb:58:in `block (2 levels) in <class:railtie>' c:/ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_ support/lazy_load_hooks.rb:36:in `instance_eval' c:/ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_ support/lazy_load_hooks.rb:36:in `execute_hook' c:/ruby192/lib/ruby/gems/1.9.1/gems/ac...

sql server - Avoiding a two step insert in SQL -

let's have table defined follows: create table sometable ( p_id int primary key identity, compoundkey varchar(255) not null, ) compoundkey string primary key p_id concatenated end, foo00000001 comes "foo" + 00000001. @ moment, entries insertions table happen in 2 steps. insert dummy record place holder string compoundkey. update compoundkey column generated compound key. i'm looking way avoid 2nd update entirely , 1 insert statement. possible? i'm using ms sql server 2005. p.s. agree not sensible schema in world, , schema refactored (and normalized) i'm unable make changes schema now. your use computed column; change schema read: create table sometable ( p_id int primary key identity, compoundkeyprefix varchar(255) not null, compoundkey compoundkeyprefix + cast(p_id varchar(10)) ) this way, sql server automagically give compound key in new column, , automatically maintain you. may want persist keyword computed columns cause sql s...

linq to sql - MVC2 and mySQL database -

i'm following example asp.net mvc 2 framework book (steven sanderson), except instead of using sqlserver, i'm using mysql. public class productscontroller : controller { private iproductsrepository productsrepository; public productscontroller() { // temporary hard-coded connection string until set dependency injection string connstring = "server=xx.xx.xxx.xxx;database=db_sportsstore;user id=dbuser;pwd=xxxxxxxxx;persist security info=true;"; productsrepository = new sportsstore.domain.concrete.sqlproductsrepository(connstring); } public viewresult list() { return view(productsrepository.products.tolist()); } } when run project following error: a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: named pipes provider, error: 40 - not...

jquery - How do I modify this code to allow a different element to trigger the event? -

html <div id="sidebar"> <ul> <li> <h2> header </h2> <ul> <li><a href="#">li3</a></li> <li><a href="#">li2</a></li> <li><a href="#">li3</a></li> </ul> </li> </ul> </div> jquery $(document).ready(function () { $('li').click(function () { if ($('ul', this).is(":hidden")) { $('ul', this).slidedown("slow"); } else { $('ul', this).slideup("slow"); } } ); }); i want slideup() , slidedown() reached if <h2> clicked. currently, both called if <li> clicked. how can fix this? $(document).ready(function () { $('h2').click(function () { $(this).next('ul'...

html - jQuery prevent default issues in firefox and IE -

trying debug page http://goo.gl/z7xaa seems work fine in google chrome, both firefox , internet explorer throw errors. ie & ff both don't prevent default action i've put on 'a' elements prevent skipping top of page when clicked. as said, works fine , no errors in chrome, various errors , faults in ie , firefox. ie doesn't calculate rate x price totals either.. if can me debug errors can improve me js skills great. cheers you not accessing event correctly. in jquery, callbacks pass normalized event first parameter. change anchor click handler this: $("a").click(function(ev) { ev.preventdefault(); });

php - Retrieving a column from mySQL database and passing to array -

i have constructed array manually, e.g.: <?php $noupload = array('nick', 'cliff'); ?> but trying populate array automatically users in mysql database. far have this: <?php // make mysql connection $debug=false; $conn = mysql_connect("host","user","password"); // mysql connection data $db = mysql_select_db("database"); $query = "select * users access '%listen%'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $listen = "'". $row['login']. "', "; } ?> $listen constructs user list in way entered manually (i tested using echo), not sure how pass $noupload . tried: $noupload = array($listen); but didn't work. think i'm close , grateful on final hurdle, thanks, nick you can declare $listen array $listen = array(); while ($row = mysql_fetch_array($result)) { $listen[] = ...

java me - What is the difference between httpconnection on J2ME and HttpUrlConnection on Android (http error 401) -

i connect 2 servers (prod https, test server http) on applicaitons. on j2me: can connect 2 servers without problem. on android can't connect test-server. when connection http, if dont use setchunkedstreamingmode , cant responsecode(stringindexoutofboundsexception); if use setchunkedstreamingmode , response code 401 . should do, fault?? here android code, if want see j2me code, can add it, too. url url = new url(geturl()); urlconnection conn = url.openconnection(); httpurlconnection httpconn = (httpurlconnection) conn; httpconn.setallowuserinteraction(false); httpconn.setinstancefollowredirects(true); httpconn.setconnecttimeout(10000); httpconn.setrequestproperty("user-agent", util.getdevicefullmodel() + " " + util.getsoftwareversion()); httpconn.setrequestproperty("accept-charset", "utf-8"); httpconn.setrequestprope...