Posts

Showing posts from July, 2010

java - my openConnection() is giving connection refused error -

i writing 1 application needs connect url specified.i getting ip address url http://gmail.com when call openconnection on url giving connection refused error.i connected internet , ran program.still getting connection refused error.when type url in browser giving me connection url. can give me reason.since giving ip address not getting connected.i tried similar google.com ip address getting not connected google still getting connection refused. please me thank you. try use same user-agent browser. system.setproperty("http.agent", "mozilla/5.0 (windows nt 6.1) applewebkit/535.1 (khtml, gecko) chrome/14.0.835.186 safari/535.1");

c# - How to load XML items to List of items -

i'd need load items xml list<t> .could please give me advice how in c# class? have list<item> litems = new list<item>(); , xml file looks this: <items> <item> <id>1</id> <title>aaa</title>> <imageurl>"images/aaa.gif"</imageurl> </item> <item> <id>2</id> <title>bbb</title> <imageurl>"images/bbb.jpg"</imageurl> </item> <item> <id>3</id> <title>ccc</title> <imageurl>"images/ccc.jpg"</imageurl> </item> </items> var items = xdocument.load(filename) .descendants("item") .select(i => new item { id = (int)i.element("id"), title = (string)i.element("title"), imageurl = (string)i.element

iphone - When we create Button frame within for loop then now we want to remove or clean button frame then how can do this? -

when create button frame within loop want remove or clean button frame how can ? for(int i=0 ;i<(self.webservice->ptr1).count ;i++) { test1=[[uibutton alloc]initwithframe:cgrectmake(x,y,w,h)]; [test1 addtarget:self action:@selector(testdescription1:)forcontrolevents:uicontroleventtouchupinside]; test1.tag=i; nslog(@"test =%d",test1.tag); nsstring *s1 =[nsstring stringwithformat:@"%@",[[self.webservice->ptr1 objectatindex:i]valueforkey:@"description"]]; nslog(@"s1 =%@",s1); nsstring *s2 =[nsstring stringwithformat:@"%@",[[self.webservice->ptr1 objectatindex:i]valueforkey:@"testid"]]; nslog(@"s2 =%@",s2); [testid addobject:s2]; nslog(@"test id=%@",testid); [test1 settitle:s1 forstate:uicontrolstatenormal]; [scrollview addsubview:test1]; uitapgesturerecognizer *tap=[[uitapgesturerecognizer alloc]initwithtarget:self action:@selector(testde

asp.net - update value only when changed -

i had around couldn't quite find answer one: got stored procedure updates around 30 fields on sql server 2008 table. it's important me 1 of fields getting updated, if value changed. the stored procedure snippet @ moment: alter procedure test @p_roomno int, [roomno] = @p_roomno, i tried changing particular column coalesce / isnull in set-clause of procedure, still updates column [roomno] = coalesce(@p_roomno,roomno), [roomno] = isnull(@p_roomno,roomno), both give me same output ... do have ideas how not update value on server side or have put on .asp-forum change application not pass on values unchanged? thanks input! i think proper place check whether values changed prior storing new value in asp side of solution, not in database. , can pass parameter stored procedure. in procedure, base on parameter, decide whether should change value or not. edit: suppose have server control of hiddenfield type . page_load(object sender, eventargs e) { if

verification - Present State of Random Number Generator in System Verilog -

how can present state or present seed of random number generator in system verilog?? use get_randstate() , defined as function string get_randstate(); from systemverilog 2012 language spec: the get_randstate() method returns copy of internal state of rng associated given object. rng state string of unspecified length , format. length , contents of string implementation dependent. note systemverilog create separate rng each thread , object, you'll see different results different objects. example: t1 = new; t2 = new; $display(t1.get_randstate()); $display(t2.get_randstate()); sample output incisive: svseed=1 ; 5864a323c57f14c ; svseed=1 ; bbfc1b9e8eb663ae ;

objective c - Force item icon refresh in Finder 10.8.2 -

can lead me useful link forcing file icon refresh in new 10.8.2 version of finder? i'm working on problem last few days , have tried solution can found on internet, old samples compatible old versions of finder , not work on newer versions of finder (which rebuilt on cocoa framework). i tried use few commands apple script tool update files in finder ('update item necessity'), tried few plugins internet (nudge, finder-refresh...), tried support communication external mac application through scriptingbridge framework (although useful) nothing gave me desired result. i have noticed nsworkspace class contains 2 methods: iconforfile , seticon:forfile, , although integrate 2 functions in application, iconforfile function returning image of reduced quality, i'm stuck in direction also. any idea or suggestion highly appreciated. create visible file , delete it. refresh finder window.

multithreading - Logging frameworks and synchronization in multi-threaded apps -

i want use logging framework log4cxx in multi-threaded application. if output of log file, correct serialization of messages needed. asking myself how (and if) these frameworks correct serialization of output without using sort of synchronization object. i guess if using synchronization objects (for example access queue log messages), cause changes in behaviour of involved threads, changing behaviour (and bugs...) of whole logged application. log4cxx indeed synchronized, other log4xxx frameworks. synchronization done in appenders , necessary guarantee content of log entries not mixed together. does not change behavior of threads, threads encounter small performance hit. performance hit small compared performance hit of i/o when logging file. if still worried performance can consider using asynchronous logging (using asyncappender handles logging in separate thread. using async approach cannot guaranteed messages logged (e.g. if application crashes before logging th

c# - File sharing not working as expected -

i have file sharing issue process trying read log file whilst still open nlog. in diagnosing issue, found surprising. following fails: using (var filestream1 = new filestream("test.file", filemode.append, fileaccess.write, fileshare.read)) using (var filestream2 = new filestream("test.file", filemode.open, fileaccess.read, fileshare.read)) { } the second filestream constructor call fails with: system.io.ioexception unhandled message=the process cannot access file 'c:\...\test.file' because being used process. source=mscorlib stacktrace: @ system.io.__error.winioerror(int32 errorcode, string maybefullpath) @ system.io.filestream.init(string path, filemode mode, fileaccess access, int32 rights, boolean userights, fileshare share, int32 buffersize, fileoptions options, security_attributes secattrs, string msgpath, boolean bfromproxy, boolean uselongpath) @ system.io.filestream..ctor(string path, filemode mode, fileaccess ac

javascript - How does code call function(s) of objects when that/those function(s) is/are undefined in the object definition? -

i have code image var img = { id: id++, link: m.attr("index"), x: m.offsetx(), y: m.offsety(), width: m.width(), height: m.height() }; now call function img.setcordinates(x,y) , img.setdimention(w,h) , dont want add them img object have many img object , saved , loaded in file. not mater function do, i'm wondering how implemented? i should mention this, reason need these function becouse of code example problem: (not good) arr.getbyid(index).x = 100; arr.getbyid(index).y = 200; .getbyid() direct prototype of array loops true arr , id specified. you should start new prototype chain this: function myimage(data) { // copy data instance (var key in data) { this[key] = data[key]; // assume data anonymous object } } myimage.prototype.setcoordinates = function(x, y) { this.x = x; this.y = y; } myimage.prototype.setdimensions = function(width, height) { this.width = width; this.height = hei

php - Lazy loading variables in templates -

currently doing this: function load_template($script, $args){ extract($args); require __dir__ . '/templates/' . $script; } in controller code: // if home page requested load_template('home.php', array( 'title' => get_title(), 'content' => get_content(), ... )); the template php script like <!doctype html> <html> <head> <title> <?php echo $title; ?> </titlee> ... i wondering if it's possible lazy load these variables somehow, don't run get_title() or get_content() until template requests variable. could possible, without creating template parser thingy? i'd stick simple .php scripts , html templates. in short, i'm asking if it's possible auto-assign value variable when it's first requested. $var = func(); // should not run if($var){ // code above should run:) echo $var; // <- value assigned (don't run func() again) } in op

android - activity stops unexpactedly when using Intent -

hello stackoverflowers m new bee android. 1 me out run away fatal error followed. 05-14 19:32:49.552: e/androidruntime(1657): fatal exception: main 05-14 19:32:49.552: e/androidruntime(1657): java.lang.runtimeexception: unable start activity componentinfo{com.dj.holyherb/com.dj.holyherb.prd_list}: android.view.inflateexception: binary xml file line #2: error inflating class <unknown> 05-14 19:32:49.552: e/androidruntime(1657): @ android.app.activitythread.performlaunchactivity(activitythread.java:1622) 05-14 19:32:49.552: e/androidruntime(1657): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1638) 05-14 19:32:49.552: e/androidruntime(1657): @ android.app.activitythread.access$1500(activitythread.java:117) 05-14 19:32:49.552: e/androidruntime(1657): @ android.app.activitythread$h.handlemessage(activitythread.java:928) 05-14 19:32:49.552: e/androidruntime(1657): @ android.os.handler.dispatchmessage(handler.java:99) 05-14 19:32:49.552

c++ - Sorting strings by characters first -

i using std::map in c++ , it's sorting keys in alphabetical way, this: aaa, aa0, aa1, aab, ac1 = aa0->aa1->aaa->aab->ac1 but sort in different way: aaa, aa0, aa1, aab, ac1 = aaa->aab->aa0->aa1->ac1 how write comparing class std::map, solve problem? don't know how that. here's definition of comparing class: struct comp { bool operator()(const std::string& lhs, const std::string& rhs) const { //dont know should write here }; }; if understand correctly, want digits sort after alphabetical characters. anytime can resume sorting criteria down ordering of letters, can use std::lexicographical_compare , passing comparison operator need on characters. i combine in single comparision operator: struct comp { bool isdigit( char lhs ) const { return ::isdigit( static_cast<unsigned char>( lhs ) ); } bool operator()( char lhs, char rhs ) const { return isdigit( lhs )

java - Reference "auto detected" bean in Spring's context -

i configured spring auto-detect daos using <context:component-scan base-package="com.mycomp.app" /> <tx:annotation-driven />. @repository("transactiondao") public class transactiondao { ... } now i'm configuring manually in context bean references one. <property name="schedulercontextasmap"> <map> <entry key="transactiondao" value-ref="transactiondao" /> </map> </property> now spring's complaining: caused by: org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named 'transactiondao' defined is possible reference auto detected bean inside context? is possible reference auto detected bean inside context? yes possible. in order see why transactiondao bean not found, can verify following things: transactiondao should in classpath , lies in sub-package of com.mycomp.app if step-1 there, run application logger level

android - layout_gravity is not working for my CirclePagerIndicator -

i want set circlepagerindicator in left side. used code in resource: android:layout_gravity = "left" , knew layout_gravity working when orientation of parent linear_layout vertical, layout circlepagerindicator in center and not left . xml layout: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:paddingleft="10dip" > <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"" > <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" andr

javascript - Saving application user interface options with rails -

i'm using bit of javascript let users collapse , hide 8 different tables on main index page. $(".priority-header").click -> //on click $(this).next().toggle() // hide table $(this).toggleclass('closed') //assign class "closed" i able save user's configuration, when hide or show table, remains hidden or displayed next time navigate home page. best way save user configuration rails. thinking of using session variable or cookie, wasn't sure how this. doesn't have database save, , session or cookie fine. you can use user localstorage store user preference. requieres user use modern, html5 complient, browser. //when user click "hide" button localstorage['hidepreference'] = 'hidden'; ... //when page loads if(localstorage['hidepreference'] === 'hidden') { //hide stuff jquery }

Programmatically login into google account in c# -

is possible programmatically sign in google account through web site in c#? just user manually entering email , password here: https://accounts.google.com/servicelogin by mean, on page load, code check see if user logged in, , if not, log them in. i appreciate has. google uses oauth authentication. need include oauth client in application in order user login google account. there many oauth packages .net, use dotnet openauth related: oauth c# library google, yahoo! twitter

sharepoint 2010 - TFS 2012 Document Hyper-Links -

in tfs 2005, team explorer in visual studio, used able view documents properties , view hyper-link. copy , share in email, intranet etc. have upgraded tfs 2012 using sharepoint 2010 , cannot seem locate document hyper-links. is there easy way obtain these (without knowing hyperlinks) or there easy way share content stored in tfs sharepoint document store? can sharepoint portal easy enough, don't use this, use team explorer , tfs web screens mostly many thanks this question quite bit older, but: maybe i've got idea? in each work item, have register "all links" there can put hyperlink sharepoint document in. (button "link to", link type "hyperlink) we used since tfs 2010 , sumbled on thread, 'cause running issue, these linked documents not checked out after opening. regards jimmy p.s: maybe, misunderstood?

jQuery Event after changing class with toggleClass -

i have problem jquery , toggleclass(). want create div, closes on clicking button. button changes , when click again on button div open again. the problem is: when click on button div closes , class of button changes - thats fine. when click on button new class - nothing happens. here code: <div class="content"> <div class="contentclose"></div> <p>text here</p> </div> and jquery: $( document ).ready(function() { $(".contentclose").click( function() { $(".content").animate({ "height": "45px", "width": "45px", "padding": "0px" }, 1000); $(".content").children("p").animate({ "opacity": "0" }, 1000); $(".contentclose").toggleclass("contentclose contentopen"); } ); $(&qu

symfony - FOSUserBundle 1.3.1 => 2.0 -

i'm using 1.3.1 version of fosuserbundle. has upgraded symfony 2.2 , i'm not sure 1.3.1 compatibility want upgrade bundle well, can't find instructions of have do. there manual or kind of? in own experience there no problem using fosuserbundle v1.3.1 symfony 2.2. can still use it. if need new features (like new events) must upgrade dev-master or v2.0 alias. unfortunately there no tagged release available. change version string in composer to: "friendsofsymfony/user-bundle": "2.0.*@dev"

mysql - Query to delete old records, with an exception -

lets have table keeps history of prices, example: _______________________________________________________ |make | model | year | price | date_of_record | |-------------------------------------------------------- |mazda | 6 | 2008 | 10,000 | 2013-05-13 00:00:00 | |mazda | 6 | 2008 | 11,000 | 2012-05-13 00:00:00 | |mazda | 6 | 2008 | 12,000 | 2011-05-13 00:00:00 | |mazda | 6 | 2008 | 11,750 | 2010-05-13 00:00:00 | |honda | civic | 2000 | 3,000 | 2011-05-13 00:00:00 | |honda | civic | 2000 | 4,000 | 2010-05-13 00:00:00 | |honda | civic | 2000 | 5,000 | 2009-05-13 00:00:00 | |honda | civic | 2000 | 5,050 | 2008-05-13 00:00:00 | |acura | tl | 2009 | 21,000 | 2010-05-13 00:00:00 | |-------------------------------------------------------- i want delete entries more 2 years old unless latest entry more 2 years old. hard put words, want end this: _______________________________________________________ |make | model | year

objective c - NSLog not getting printed in the console area while debugging on device? -

i facing weird issue.nslog statements not getting printed console when debugging application using device.i pulled log files using organizer there not having logs. when debug in simulator getting logged console properly. i tried using both gd debugger , lldb debugger.. did not work any ideas might causing issue??

jquery - How can I dynamically add a browser tab? -

since using iframes house external pages are, accounts "not preferred method" , disallowed sites (flickr, one), want dynamically generate browser tabs. e.g., when user submits form, want dynamically generate tab on browser in response submitted. e.g., might want add new tab url like: http://www.bigsurgarrapata.com/contact how in jquery? you want form target attribute action attribute. http://www.w3schools.com/tags/att_form_target.asp browsers have ultimate control on result of target attribute open new tab value of _blank. <form action="contact_submit.php" target="_blank" method="post">

node.js - how to automatically restart a node server? -

we finishing development of project, client using errors occur - crashing server. i know register service 'upstart' script on linux, in order have node service restart when crashes. but our server running other stuff, can't restart it. well, actually, while writing, realize have 2 questions then: will 'upstart' work without having reboot? whispering yes me :) if not, other option have 'respawn' node server when crashes? yes, upstart restart process without reboot. also, should forever .

High number of faults, low residual memory and high lock % for mongodb -

first off, here pastebin important numbers (mongostat, db.stats, db.serverstatus). the machine running on has plenty of memory free: total used free shared buffers cached mem: 15965 2277 13688 0 89 1630 -/+ buffers/cache: 557 15407 swap: 5119 0 5119 the database files on block device (we had issues due nfs drives) , should working fine. avoid overfilling logs, set --slowms 1000, still lot of queries slow , seems mongodb not interested in using more memory service faster updates. the use case is 95% updates, queries thrown in when pull out data , compile it. has worked fine setup, trying track down reasons might not working. i hoping more familiar mongodb can @ numbers , point me in right direction.

java - How come Flume-NG HDFS sink does not write to file when the number of events equals or exceeds the batchSize? -

i trying configure flume such logs roll hourly or when reach default block size of hdfs (64 mb). below current configuration: imp-agent.channels.imp-ch1.type = memory imp-agent.channels.imp-ch1.capacity = 40000 imp-agent.channels.imp-ch1.transactioncapacity = 1000 imp-agent.sources.avro-imp-source1.channels = imp-ch1 imp-agent.sources.avro-imp-source1.type = avro imp-agent.sources.avro-imp-source1.bind = 0.0.0.0 imp-agent.sources.avro-imp-source1.port = 41414 imp-agent.sources.avro-imp-source1.interceptors = host1 timestamp1 imp-agent.sources.avro-imp-source1.interceptors.host1.type = host imp-agent.sources.avro-imp-source1.interceptors.host1.useip = false imp-agent.sources.avro-imp-source1.interceptors.timestamp1.type = timestamp imp-agent.sinks.hdfs-imp-sink1.channel = imp-ch1 imp-agent.sinks.hdfs-imp-sink1.type = hdfs imp-agent.sinks.hdfs-imp-sink1.hdfs.path = hdfs://mynamenode:8020/flume/impressions/yr=%y/mo=%m/d=%d/logger=%{host}s1/ imp-agent.sinks.hdfs-imp-sink1.hdfs.fi

sql server 2008 - execute stored procedure in classic asp and return values -

i need call asp page stored procedure have in sql 2008 , pass 2 values , @ end return count of 2 variables. this stored procedure have: /****** studatatab******/ create procedure stdntreconciledups @newstdnt int = null, @oldstdnt int = null output --use zldp01rd; --count = 9 rows select count (*) studata.dbo.studatatab stdnt = @newstdnt; -- count = 576 rows select count(*) studata.dbo.studatatab stdnt = @oldstdnt; -- select duplicate keys new student# count = 3 rows select a.stdnt,a.crs,a.crs_vrsn,a.qstn,a.scr studata.dbo.studatataba, studata.dbo.studatatabb a.stdnt = @newstdnt , b.stdnt = @oldstdnt , a.crs = b.crs , a.crs_vrsn=b.crs_vrsn , a.qstn=b.qstn , a.scr=b.scr -- select duplicate keys new student# count = 3 rows select count (*) studata.dbo.studatataba exists (select 1 studata.dbo.studatatabb a.stdnt = @newstdnt , b.stdnt = @oldstdnt

function - Algorithm for determining acceptable variance -

i have application comparing numbers 2 different reports. going alert user when variance between 2 numbers on threshold. going use 10% threshhold, realized when count ex. 10,000 variance of 10% high (meaning if there 999 excessive), when count 10 variance of 10% low (meaning 2-3 / 10 acceptable variance). just can't figure out how it, besides coding out if counta <= 10 acceptablerate = 20% if counta > 10 acceptablerate = 15% does know how explain trying here mathematically, , how implemented? sure simple question better @ math am. besides formulas mentioned in previous answers, consider using power of n (where n reference number 1 report or other) tolerance. here python code , results, illustrating several different powers of n: j=10 in range(6): print '{:8} {:8.1f} {:8.1f} {:8.1f} {:8.1f}'.format(j, j**0.33, j**.35, j**.37, j**.39) j *= 10 10 2.1 2.2 2.3 2.5 100 4.6 5.0 5.5 6.0 1

php sybase Allowed memory size exhausted? -

i'm getting problem while trying run query against sybase php: php 5.4.3 (cgi-fcgi) (built: may 9 2013 17:03:23) built --with-sybase-ct=/path/to/freetds code: <?php $con = sybase_connect('server', 'user', 'pwd'); //connects fine $q = sybase_query("select col=1", $con); //error here, regardless of sql ?> output: fatal error : allowed memory size of 134217728 bytes exhausted (tried allocate 30064771074 bytes) any ideas ? try add code : <?php ini_set("memory_limit","128m"); $con = sybase_connect('server', 'user', 'pwd'); //connects fine $q = sybase_query("select col=1", $con); //error here, regardless of sql ?>

knockout.js - how to data-bind knockout js viewmodel to jquery dynamically created rows -

within page bound viewmodel have section user can add elements page elements filter section comprised of few value fields , select element needs databound viewmodel. running select option inline in html works fine. once pull out , add jquery adds filter control fails bind. realize due in part view model being bound , have tried call apply bindings again fails well. i can't use foreach have in other areas because section optional. users not have add filters if don't want why went jquery route. can provide suggestions on how re-bind select element view model once page has rendered or there better approach using knockout accomplish this? code: html <div id="filtersection" data-bind="with: reportobject"> <select data-bind="options: selectedattributes(), optionstext: function(selectedattributes){ return selectedattributes.namehierarchy() + '.' + selectedattributes.labelname() }, optionscaption:'select fie

c - Unexpected Output Running Semaphore -

this question exact duplicate of: unexpected output running semaphore 1 answer the first process shouldn't start (i)th iteration unless second process has finished (i-1)th iteration.the output not need.i wonder if possible have output 2 semaphores? here code. #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <stdlib.h> #include <errno.h> #include <semaphore.h> sem_t sema, semb,sem,m; int main(void) { int i; pid_t child_a, child_b,pid2,pid3; sem_init(&sema, 0, 1); sem_init(&semb, 0, 0); sem_init(&m, 0, 0); child_a = fork(); //wait(); if (child_a == 0) { // int j; pid2 =getpid(); (i = 0; < 5; ) { sem_wait(&sema); //sem_wait(&m); printf("child1: %d\n", i); i++; //printf("pid1: %d\n", pid2

How to properly initialize variable in Eclipse BPEL designer Apache ODE engine? -

i have simple bpel variable of int datatype. process gets deployed, on execution, ode engine complains “variable counter isn’t initialized”. wrong below initialization code? <bpel:variable name="counter" type="ns1:int"> <bpel:assign validate="no" name="setvariables"> <bpel:copy> <bpel:from><bpel:literal xml:space="preserve">1</bpel:literal> </bpel:from> <bpel:to variable="counter"></bpel:to> </bpel:copy> </bpel:assign> i'll take working solution comments question , provide answer, question can recorded answered. the problem can solved initializing variable on definition , not via later assign during process execution. way, variable guaranteed initialized on first access. default initialization variable @ hand looks this: <bpel:variable name="counter" type="ns1:int"><bpel:from

excel - Remove all rows that don't have #3 as the beginning in primary key -

so basically, need remove records don't have 3 2nd digit in primary key field example can either this #39001 or without #3 what want cells have non #3 start, rows deleted came following code, removes non #3, not all. have on 13000 rows scan sub keep3() ' ' removenum macro dim integer = 2 14000 if instr(cells(i, 2), "3") = 2 else rows(i).entirerow.delete end if next end sub if can point me in right direction, i'd grateful! thanks! when delete row rows below move up, increment "i" skips newly moved row. try following instead... sub keep3() ' ' removenum macro dim integer = 2 while < 14000 if instr(cells(i, 2), "3") = 2 ' nothing = + 1 else rows(i).entirerow.delete ' note - not incrementing here end if wend end sub

c# - null / DBNull conversion -

this question has answer here: c# ado.net: nulls , dbnull — there more efficient syntax? 6 answers i have method void addparam(string name, object value); and object public class foo { public string whatever; } what best way perform (working) call match logic? addparam("foo", foo.whatever == null ? dbnull.value : foo.whatever); i thinking such thing this: object getparamvalue(object value) { if (value == null) return dbnull.value; return value; } addparam("foo", getparamvalue(valuefoo.whatever)); how can achieve behavior? you can use null coalesce operation: addparam("foo", foo.whatever ?? dbnull.value);

network drive - Mapping NTFS and MVFS filesystem in Linux -

i wanted map ntfs , mvfs network drive in linux. possible , if how it? you can use samba map network drives shared windows server: http://www.samba.org/ . http://www.cyberciti.biz/tips/how-to-mount-remote-windows-partition-windows-share-under-linux.html i'm not sure if work mvfs.

Adding html to t() in Drupal 6 template.php? -

hi trying add html "t('older posts')" , "t('newer posts')" possible ? can figure out ???? in drupal 6 template.php file. this code trying add html - <a href="" class="action"><span>newer posts</span></a> <a href="" class="action back"><span>older posts</span></a> i need replace above in these spots located in full function below ? t('older posts') t('newer posts') i want create t('<a href="" class="action back"><span>older posts</span></a>') t('<a href="" class="action"><span>newer posts</span></a>') full function function theme_views_mini_pager($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9) { global $pager_page_array, $pager_total; // calculate various markers within pager

c - malloc and pointer in a struct -

i have following c code: typedef struct dlistnode_ { void *data; struct dlistnode_ *prev; struct dlistnode_ *next; } dlistnode; typedef struct dlist_ { int size; dlistnode *tail; dlistnode *head; } dlist; void insert(dlist * list, dlistnode * element, int data) { dlistnode * new_element = (dlistnode *)malloc(sizeof(dlistnode)); new_element->data = &data; if (list->head==null) { list->head=list->tail=new_element; list->size++; return; } if(element == null) { // handle size==0? new_element->next=list->head; list->head->prev=new_element; list->head=new_element; list->size++; } else { printf("not yet implemented!\n"); } } void printnodes(dlist *list) { dlistnode * pointer = list->head; if (pointer!=null) { int v= *((int*)pointer->data); printf("node has value: %d\n",

jquery - Catching errors on plugin initialization wth QUnit -

i'm using following format creating plugins. $(function () { function pluginname() { /* more code here */ } $.extend(pluginname.prototype, { _attachplugin: function (target, options, value) { target = $(target); if (target.hasclass(this.shortenerclass)) { return; } var instance = { options: $.extend({}, this._defaults) }; if (typeof instance.options.requiredoption === 'undefined') { throw 'you need required option!'; } }, }); var getters = [/* getters */]; function isnotchained(method, otherargs) { if (method === 'option' && (otherargs.length === 0 || (otherargs.length === 1 && typeof otherargs[0] === 'string'))) { return true; } return $.inarray(method, getters) > -1; } $.fn.pluginname = function (options) { var args = array.prototype.slice.call(arguments, 1); if (isnotchained(options, arg

plsql - Oracle Forms 6i Comparing Fields -

i have form 2 fields type char 128 each trying compare contents of these fields. not getting proper comparison done. when both fields have same data still saying both fields not match. begin if(ltrim(rtrim(:field1)) = ltrim(rtrim(:field2)))then show_message('fields match'); else show_message('fields not match'); end if; end; the problem stated in oracle null not equal null. in oracle comparison null false. can work around using nvl in case should prefer instead use null this: begin if (ltrim(rtrim(:field1)) = ltrim(rtrim(:field2))) or (:field1 null , :field2 null) show_message('fields match'); else show_message('fields not match'); end if; end;

c# - Web Development program for Macs -

i have mac running osx 10.8 , question is: what web development program can use create applications in c# , asp.net? or similar visual studio. i use visual studio on windows , xamarin on mac. xamarin suprisingly :) not visual studio, getting there! http://xamarin.com/

keyboard - C++ GetAsyncKeyState alternative -

i using windows.h library's getasynckeystate function define key pushed on keyboard . here program returns int value of pushed key example. #include <iostream> #include <windows.h> using namespace std; int main (){ char i; for(i=8;i<190;i++){ if(getasynckeystate(i)== -32767){ cout<<int (i)<<endl; } } return 0; } but trying make opengl simple game , function appeared slow . there function not need cycle 180 times , if statement . thanks you're trying make opengl game, you're going use glfw. if that's case can away using glfwgetkey() such: if (glfwgetkey(glfw_key_up) == glfw_press) {...} if (glfwgetkey(glfw_key_down) == glfw_press) {...} that method nicely explained in tutorial 6 opengl-tutorial.org . should start first tutorial of beginners tutorials , later intermediate tutorials . if you're going make win32 window can listen wm_keydown or wm_keyup messages , virtua

bitmap - Android postScale not scaling as expected -

i have got load of bitmaps trying scale depending on screen size, way dividing current device screen size test phones size because images made according screensize. the function use below public bitmap resizebitmap(bitmap b){ int width = b.getwidth(); int height = b.getheight(); matrix max = new matrix(); max.postscale(vars.screenwidthmulti, vars.screenheightmulti); bitmap resizedbitmap = bitmap.createbitmap(b, 0, 0, width, height, max, false); return resizedbitmap; } screenwidthmulti , screenheightmulti gotten dividing current screensize float value same test devices screen. part works fine. if use device screensize of 1024/552 , device 960/540 scaling values 1.06666667 width , 1.02222223 height fine. now problem when postscale values doesnt scale them i'd expect. example background image same size test device put in size of bitmap outputted 683 368 doesn't make sense me ever! have tried prescale , setscale doesnt change better

javascript - trigger.IO ajax -> trying to attach file to a Parse model -

i'm trying attach image file model in parse using rest api , triggerio; unsuccessful. i getting error: '{"type":"expected_failure","content":"{\\"code\\":107,\\"error\\":\\"this endpoint supports content-type: application/json requests, not application/x-www-form-urlencoded.\\"}","statuscode":"400","message":"http error code received server: 400"} [71.87s]' this relevant code block: attachimg: (data) -> uploaddata = "picture": { "name": data, "__type": "file" } forge.request.ajax type: "post", url: "https://api.parse.com/1/classes/workoutlog", data: uploaddata, datatype: "json" headers: "x-parse-application-id": 'my-app-id', "x-parse-rest-api-key&q

c++ - Windows style getopt/argp -

is there windows equivalent getopt or argp simplifies writing of windows command line tool? it should contain argument parsing , enforcing windows style of argument syntax , perhaps providing assistance syntax executors. the windows command line tools has style makes me think there such tool. questions have found indicates translations of getopt best bet. you can use boost program options http://www.boost.org/doc/libs/1_53_0/doc/html/program_options.html

ios - Editing argument in objective-c blocks -

i want edit uiimage pointer in block it's not allowed. -(void)downloadimage:(nsurl *)url ofpointer:(uiimage *)imagepointer { __weak typeof(self) weakself = self; [sdwebimagemanager.sharedmanager downloadwithurl:url options:0 progress:^(nsuinteger receivedsize, long long expectedsize) {} completed:^(uiimage *image, nserror *error, sdimagecachetype cachetype, bool finished) { imagepointer = image; [weakself setneedsdisplay]; }]; } i tried pass argument __block it's not allowed too. -(void)downloadimage:(nsurl *)url ofpointer:(__block uiimage *)imagepointer is there way edit pointer passed argument? you need use pointer pointer ( uiimage ** ) image immutable object if change inside bloc

Windows CMD Search and Delete file by name -

i have website dump has half gig worth of images have been converted various file sizes. structure goes like: media/ 1/ 1.original.jpg 1.large.jpg 1.medium.jpg 1.small.jpg 2/ 2.original.jpg 2.large.jpg 2.medium.jpg 2.small.jpg etc... i want command search through folders in media , delete image has original in name. possible? del /s ...\media\*original*.jpg should delete files original in name, extension .jpg ...\media , subdirectories. obviously, use extreme caution...

C++ function dispatch with template parameters -

i'm in process of refactoring large class -- let's call big -- has huge amount of copy-paste code. of copy-paste code exists in switch case s types involved end being different. code switching based on enum member variable of class value known @ runtime. my attempt fix involves having dispatcher class looks appropriately typed functions via static function called lookup() . functions actual work called go() , have defined in wrapper class template (whose sole parameter runtime enum value being switched on). go() functions may or may not template functions themselves. here distilled version of code. apologies length, short without losing important context. #include <cassert> class big { public: enum runtimevalue { a, b }; big(runtimevalue rv) : _rv(rv) { } bool equals(int i1, int i2) { return dispatcher<equals, bool(int, int)>::lookup(_rv)(i1, i2); } template<typename t>

ruby - Can't install nokogiri rubygem on windows 8. -

so i've installed ruby (2.0.0 x32) , devkit-mingw64-32-4.7.2-20130224-1151-sfx.exe , made sure worked on installing json rubygem. i've downloaded ruby.exe in admin account , running command lines admin. i've been googling problem hour haven't fixed it! appreciated. error: error installing nokogiri: error: failed build gem native extension. c:/ruby200/bin/ruby.exe extconf.rb system cannot find path specified. checking libxml/parser.h... no ----- libxml2 missing. please visit http://nokogiri.org/tutorials/installing_nokog iri.html installing dependencies. ----- *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers. check mkmf.log file more details. may need configuration options. provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib