Posts

Showing posts from August, 2014

jquery - How to change date format in jqgrid -

i have 1 issue related jqgrid. have date shown in jqgrid table "fri may 17 00:00:00 ist 2013" .i want change format "17/5/2013".how can it? {name:'checkin', index:'checkin', width:60, searchoptions:{sopt:['eq']}}, this code. try these: formatter: 'date', formatoptions: { srcformat: 'd/m/y', newformat: 'd/m/y'} given here: jqgrid json date format

ios - UITextView showing text in Modal View -

how can show new text in uitextview in modal? so, here text, , have 2 views, main , modal. need display text, set in main view, in modal. textview in modal created. textview.text = @"test"; [self.view addsubview:textview]; it's not idea, cause don't display text in modal :( normally have uiviewcontroller subclass text view in it, present vc modally. initial text string property of vc. if not work you, write small demo app , post dropbox.

Opening UTF16 URL with urllib in Python -

i'm trying use google translate api translate text in kannada (and hence encoded utf-16) english. manually entering url, after pluggin in google api key, https://www.googleapis.com/language/translate/v2?key=key#&q =ಚಿಂಚೋಳಿ&source=kn&target=en, i'm able translation want. the problem is, however, url utf16 encoded. when try open url using urllib, error message below. advice how proceed or alternative way proceed appreciated. edit: believe problem can solved calling urllib.parse.quote_plus(text) text utf16 text, , replacing utf16 text return value function. traceback (most recent call last): file "<pyshell#19>", line 1, in <module> urllib.request.urlopen(url) file "/library/frameworks/python.framework/versions/3.3/lib/python3.3/urllib/request.py", line 156, in urlopen return opener.open(url, data, timeout) file "/library/frameworks/python.framework/versions/3.3/lib/python3.3/urllib/request.py", line 469,...

java - Framework like ATG Dynamo Application Framework -

i atg developer, developing application own venture, know atg pretty expensive. want know if there java framework atg. of if way use atg daf free of cost or min. expense. want use basic of daf, nucleus(component model), repository , dsp taglibs. i don't work oracle can't comment on commercial aspects of question. said, components referring available in shape or form in other java based technologies which, knowledge of atg should able pick quite quickly. for example nucleus provides ioc in similar way spring does. repository layer precursor hibernate while of dsp tags (useful ones @ least) mimicked jstl. you refer this discussion elsewhere on stackoverflow opensource alternatives atg being discussed.

Visual Studio 2012 - MSBuild incremental build not detecting changes -

i have customised msbuild project default target new target named 'buildwithexternalreference'. new target calls 2 other targets; first custom target called 'buildexternalreference' builds dll using external tool. dll built reference main project, built using normal 'build' target. have setup inputs , outputs attributes 'buildexternalreference' target inputs reference source files , outputs reference resulting dll. in both visual studio 2012 , visual studio 2010 build works correctly first time invoked. however, on subsequent builds if change external source files (referenced 'buildexternalreference' target inputs attribute) visual studio 2012 reports 'build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped'. visual studio 2010 continues work perfectly. in addition, building command line msbuild.exe works perfectly. i'm aware build system in visual studio 2012 has changed, can't find information changes way incremental build...

c# - Cannot send a content-body with this verb-type -

ftpwebrequest request = (ftpwebrequest)webrequest.create("ftp://www.mysite.com/public_html/text.txt"); request.method = webrequestmethods.ftp.downloadfile; request.credentials = new networkcredential(" ", " "); streamreader sourcestream = new streamreader(environment.currentdirectory + "/text.txt"); byte[] filecontents = encoding.utf8.getbytes(sourcestream.readtoend()); sourcestream.close(); request.contentlength = filecontents.length; stream requeststream = request.getrequeststream(); requeststream.write(filecontents, 0, filecontents.length); requeststream.close(); ftpwebresponse response = (ftpwebresponse)request.getresponse(); response.close(); stream requeststream = request.getrequeststream(); giving me error "cannot send content-body verb-type.". any on how fix great. you have told use downloadfile, ftp retr method - , not take body - in same way http not take bod...

c - ProcessID confusion -

Image
i'm confused. why notepad.exe have 3 different process id's? 1)spy++ says 000000a48 (eh?) 2)taskmanager says: 2632 3)getwindowthreadprocessid says: 1744 i guess 2632 right 1 use in setwindowshookex (as dwthreadid parameter), if getwindowthreadprocessid returns else, how find right one? there 1 single unique process id process. spy++ reporting value hexadecimal, , task manager reports decimal. now, a48 (hexadecimal) equal 2632 (decimal). the other value, 1744, thread id. id of different object. threads , processes not same things. process contains 1 or more threads. when call getwindowthreadprocessid returns window's thread id return value of function. second parameter can used return process id of process owns thread. call this: dword pid; dword tid = getwindowthreadprocessid(wnd, &pid); after function returns, pid contains process id. you trying install hook , need thread id that. in code use variable npthreadid .

facebook - heroku Could not generate key in Windows XP -

i trying program first facebook app using heroku, can't started. following instructions heroku provides ( https://devcenter.heroku.com/articles/facebook ), cannot generate ssh public key. here i'm seeing/doing: heroku login (enter credentials) not find existing public key. generate one? (press enter) generating new ssh public key. ! not generate key: bryan t anderson@bryan ~ i have looked on several other forums , tried following: tried above commands in cmd.exe , in git bash created .ssh directory (~/.ssh) tried "ssh-keygen -t rsa" , "ssh-keygen -t rsa -c myemail@hotmail.com one other strange thing noticed when "cd ~", , type pwd, says in /c/program files/java. not sure why isn't /c/program files/git. change directory to c:\program files\git\bin , run command

collectionview - Play audio when uicollectionviewcell is clicked in iOS -

i want play mp3 file file when user select collection view custom cell. not playing . here code have written purpose -(void)collectionview:(uicollectionview *)collectionview didselectitematindexpath:(nsindexpath *)indexpath { nslog(@"cell selected "); avaudioplayer * audioplayer; nsstring *path = [[nsbundle mainbundle] pathforresource:@"bismillah" oftype:@"mp3"]; nsurl *audiourl=[nsurl fileurlwithpath:path]; audioplayer=[[avaudioplayer alloc] initwithcontentsofurl:audiourl error:nil]; //audioplayer.delegate=self; [audioplayer play]; // cell.backgroundcolor = [uicolor bluecolor]; } once try this, , once check present in bundle resources or not. nsstring *audio=[[nsbundle mainbundle]pathforresource:@"ranz des vaches" oftype:@"mp3"]; nsurl *url=[[nsurl alloc]initfileurlwithpath:audio]; avplayer = [[avaudioplayer alloc]initwithcontentsofurl:url error:nil]; avplayer.delegate = self; [avplay...

arrays - PHP traverse txt, once string is found, insert text -

i have file, test.txt, , traverse it. once hind "here" string, i'd place 'test' in following line. $lines = array(); $match = 'here'; foreach(file('test.txt') $line) { if((string)$match == (string)$line) { array_push($lines, 'this');; } array_push($lines, $line); unfortunately, if statement never resolves true, though there 'here' in txt file. thanks credits goes vedran Å ego comment . the problem $line contains new line, remove we'll using trim() edit: code may have several problems stated below in comments jon , seems misunderstood wanted (instead of "adding" replaced matched string) foreach(file('test.txt') $line){ if($match === trim($line)){ array_push($lines, 'this'); } array_push($lines, trim($line)); }

linux - How to determine the IRQ number for a USB device? -

i new driver development. however, purchased osr usb fx2 learning kit, comes sample codes windows kernel/user mode driver. however, writing driver in linux (ubuntu 12). have been able send control commands , receive return of control commands device. have been able send , read data on bulk out/in endpoints device supports. there 1 more experiment have yet complete. device has following endpoints: 1. bulk (out) --> address 0x06 2. bulk (in) --> address 0x88 3. interrupt (in) --> address 0x81 i unable figure out how find irq number interrupt (in) endpoint. understand how install irq handler using: int request_irq (unsigned int irq, irq_handler_t handler, unsigned long irqflags, const char * devname, void * dev_id); and write handler correct function prototype. however, wondering how find irq line (irq number) device interrupting on? is, how determine value of argument unsigned int irq in reques...

Can I use Shell or Python realize calling a C programe and give all the parameter it requires? -

i have met problem , have no knowledge whether can realized in shell bash or python. i need run c programe several times, programe "atompot" tem image simulation. if run programe ./atompot its output this: atompot version dated 8-oct-2012 ejk copyright (c) 1998-2010 earl j. kirkland program provided as-is absolutely no warranty under gnu general public license calculate projected atomic potentials (to use in multislice) using fftw name of file input crystal data : then need give input crtstal data file like: stra.dat then can get: name of file binary output of atomic potential : then give name: straa.tif then get: real space dimensions in pixels nx, ny : your answer : 512 512 then output like: replicate unit cell ncellx,ncelly,ncellz : answer: 8 8 8 ask: want add thermal displacements atomic coord.? (y/n) : answer: n the proceduess this. can use shell or python realize calling c programe , give parameter requires m...

android - Custom compound control - unbound prefix, failed to instantiate -

i'm trying make compound control, , set custom attributes it. the class control: package hu.ppke.itk.kozcs.android.activities; import hu.ppke.itk.kozcs.android.project.r; import android.content.context; import android.content.res.typedarray; import android.util.attributeset; import android.view.layoutinflater; import android.widget.relativelayout; import android.widget.textview; public class settingbox extends relativelayout { public settingbox(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); string service = context.layout_inflater_service; layoutinflater li = (layoutinflater) getcontext().getsystemservice(service); relativelayout layout = (relativelayout) li.inflate(r.layout.setting_box, this, true); typedarray = context.obtainstyledattributes(attrs, r.styleable.settingbox); string title = a.getstring(r.styleable.settingbox_title); string description = a.getstring(r.styleab...

mysql select where count more than x -

how can create mysql query requires count of total same query on x? eg $result=mysql_query("select * db bananas='1' , oranges='2' , [count of query more 5]"); thanks! m edit to more clear... , im looking is: $result=mysql_query("select * db bananas='1' , oranges='2' group pineapples order sum(sugar) desc limit 1 , [[[count of pineaples bananas='1' more 5]]]"); hope helped... and (select count(*) foo bar) > 5 or group baz having count(*) > 5

vb.net - Visual Basic: run specific codes from exe file -

how can run specific codes exe file? for example; target shortcut runs mp3 file; "c:/thing/something.exe -music" target shortcut runs bmp file; "c:/thing/something.exe -picture" what can read command line arguments inside program when starts parse inputs make decision. for example: private sub form1_load(sender object, e eventargs) handles mybase.load dim commandlineargs system.collections.objectmodel.readonlycollection(of string) = my.application.commandlineargs if (string.compare(commandlineargs(0), "-picture") = 0) 'desired code picture here elseif (string.compare(commandlineargs(0), "-music") = 0) 'desired code music here end if end sub if gave input -music c:\filepath\filename.mp3 commandlineargs(0) -music , commandlineargs(1) c:\filepath\filename.mp3. pass commandlineargs(1) program of choice play file (or use built in method play it).

validation - Javascript, check for identical characters -

i got make script checking input box (password) same characters occuring twice. should used alongside regex validation (that's working). succeed know need use (for?) loop somehow, checks if 1 character appear twice. kind of odd thing ask for. know. i'm not entirely sure conditions function. if have suggestions around how made, great. example: "abad12" - pass, whilst "abac12" return false. in advance. function checkform(form) { var re = /^\w{6,10}$/; if(!re.test(form.pwd1.value)) { alert("error: password has in-between 6-10 characters!"); form.inputfield.focus(); return false; } } above goes example of script i'd combine (among more regex validations). that's how this: var str = "abad12", valid = str.split("").filter(function(e, i, a) { return a.indexof(e) !== i; }).length === 0; if (!valid) { // ... } but note array filter() method not available in old brows...

Ambiguous column name in Ruby on Rails with SQLite database? -

i getting error in rails app: activerecord::statementinvalid in paymentscontroller#index sqlite3::sqlexception: ambiguous column name: date: select count(*) "payments" inner join "invoices" on "payments"."invoice_id" = "invoices"."id" "invoices"."user_id" = 1 , (date >= '2013-01-01' , date <= '2013-12-31') the problem seems have date field in invoices payments table. yet still don't know how fix error. class user < activerecord::base def number_of_payments_in(year) payments.where("payments.date >= ? , payments.date <= ?", "#{year}-01-01", "#{year}-12-31").count end end class payment < activerecord::base def self.search(year) if year where("date >= ? , date <= ?", "#{year}-01-01", "#{year}-12-31") end end end can help? this answer may bit vague ...

java - Is the toString Method Unnecessary? -

i watching tutorial on tostrings recently, since still haven't used them much, , occurred me there might easier way of accomplishing same thing less code. surely enough, code below produced exact same result less code. if case, point of tostring? there advantage using tostrings on way did it? public class daughter{ private static string name; private static int age; public daughter(string name, int age){ this.name = name; this.age = age; system.out.println(name + ", " + age); } public static void main(string args[]){ new daughter("elizabeth", 7); } } according java doc tostring() returns string representation of object[...] in fact, many native java methods , methods of libs call method string representation. for example arrays.tostring(object[] a) calls tostring every object in array a. or print methods of printstream takes object argument calls indirectly through st...

rotation - How can i rotate a shape in a matrix by 90 degrees in C? -

i have write rotate function tetris game. have bricks in txt file in 10x10 dimensioned matrix , need catch brick location (l-shape) , rotate 90áµ’ in clockwise. input: 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 and output must this: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 i rotate whole matrix 90 degrees not output. how can rotate l-shape? or how can make output this? thanks. edit; here's question: in homework going write rotate function of tetris game. have bricks in txt file in 10x10 dimensioned matrix. catch brick location , rotate 90áµ’ in clockwise. simplicity 2 kinds of bricks going rotate algorithm. “l” character , inverse of “l”. input file can take 4...

BITCOUNT macro in C -

how can count how many 0 bits in variable? must use macro thist bitcount(x,c) x variable , c count of 0 bits in x example: x = 00101001 , c = 5 a simple solution: #include <limits.h> #define bitcount(x,c) \ { \ int i; \ (c) = 0; \ ( = 0; < char_bit * sizeof(x); i++ ) \ (c) += ( (x) & ( 1 << ) ) == 0; \ }

java - JTable Clickable Header in swing -

Image
this question has answer here: jtable clickable column header 1 answer how can put control in jtableheader of jtable? 3 answers hello have hard time solving puzzle. professor gave code , told change make column head clickable.can change me.? wasted 4 hours :( not great in java swings below code... below code : package academic.emailclient.view; import java.awt.color; import java.awt.dimension; import java.awt.font; import java.util.arraylist; import java.util.date; import java.util.vector; import javax.swing.*; import javax.swing.table.*; import academic.emailclient.model.message; import academic.emailclient.view.entities.messageview; public class mailbox extends jframe { jtable tableinbox; private final int mailbox_frame_width = 1080; private final int mailbox_frame...

alignment - Vertically aligning a node joining subgraphs in Graphviz -

Image
i give following input dot: digraph g { subgraph cluster1 { fontsize = 20; label = "group 1"; -> b -> c -> d; style = "dashed"; } subgraph { o [shape=box]; } subgraph cluster2 { fontsize = 20; label = "group 2"; z -> y -> x -> w [dir=back]; style = "dashed"; } d -> o [constraint=false]; w -> o [constraint=false, dir=back]; } and produces: how can align node o has same rank d , w ? is, graph looks like: a z | | b y | | c x | | d-o-w adding { rank=same; d; o; w; } yields error warning: d in rankset, ignored in cluster g warning: w in rankset, ignored in cluster g i'm thinking can hack adding invisible nodes , edges subgraph of o , wondering if missing dot magic. you use approach rankdir=lr , use constraint=false edges inside clusters: digraph g { rankdir=lr; subgraph cluster1 { fontsize = 20; label = ...

jquery - javascript to create an array with the repeating phrases in a text -

the idea simple: put text in textarea press "send" , return list of repeating phrases. phrases mean 2 or more word repeating. problem have no idea how detect these (i can whit single words). $(function() { $("#but").click(function() { var = $("#inc").val(); $("#res").html(get); return false; }); }); and html: <form action="" method="post"> <textarea name="inc" id="inc" spellcheck="false"></textarea> <br> <input type="submit" id="but" value="send"> </form> <div id="res"></div> the problem of course dont know start. ides? example: paris s capital , populous city of france . paris , paris region account more 30% of gross domestic product of france , have 1 of largest city gdps in world. checkout http://brettterpstra.com/2011/11/02/word-repetiti...

debugging - Understanding a recurring android logcat error -

after compiling rom, i'm getting constant recurring systemui crash notification, right after booting os. i'm kinda hazy on log generated, & not able trace cause of error. can please me understand it? d/systemuiservice( 5810): loading: class com.android.systemui.statusbar.phone.phonestatusbar d/systemuiservice( 5810): running: com.android.systemui.statusbar.phone.phonestatusbar@41cd3358 i/statusbarmanagerservice( 2314): registerstatusbar bar=com.android.internal.statusbar.istatusbar$stub$proxy@41cedcd8 w/resourcetype( 5810): failure getting entry 0x7f0d0068 (t=12 e=104) in package 0 (error -75) d/androidruntime( 5810): shutting down vm w/dalvikvm( 5810): threadid=1: thread exiting uncaught exception (group=0x41993a08) e/androidruntime( 5810): fatal exception: main e/androidruntime( 5810): java.lang.runtimeexception: unable create service com.android.systemui.systemuiservice: android.view.inflateexception: binary xml file line #99: error inflating class <unknown...

vb.net - borderless button in visual basic.net? -

hey there asking how make borderless button in vb.net can set style flat , make background color transparent always button focused , shows in shape of button ruins button style want here class used earlier didn't work public class buttonex inherits button private _shouldshowfocus boolean = false public property shouldshowfocus() boolean return _shouldshowfocus end set(byval value boolean) _shouldshowfocus = value end set end property protected overrides readonly property showfocuscues() boolean return _shouldshowfocus end end property end class you subclass standard button , override onpaint method achieve borderless button. class borderlessbutton inherits button protected overrides sub onpaint(byval pe painteventargs) mybase.onpaint(pe) pe.graphics.drawrectangle(new pen(backcolor, 5), clientrectangle) end sub end class i'm assuming you've ...

jquery - Change ul style on scroll to div -

i have menu 4 <ul> s , in container of page have 4 boxes. first ul first box, second ul second box, third ul .... , goes on when scroll first box first ul 's style change different style, when scroll second box second ul 's style change same different style , first ul 's style return original style.. , that. the problem when scroll last box, fourth ul style change different style, when pause box , goes space without boxes fourth ul 's style still same style , not return it's original style can see here: http://ge.tt/6ycyz1h/v/0 i tried ( http://ge.tt/6peky1h/v/0 ) didn't work 100% can see. explained things , where's problem in codes. codes here: http://jsfiddle.net/yzvkx/ not sure if still looking answer problem here fiddle. you can use jquery add , remove classes change style of button. $(".scroll").click(function (event) { $('#menu li').addclass('menutext'); event.preventdefault(); $...

symfony - FOSOAuthServerBundle access_token life time -

if looking how change access_token life time (expires_in) fosoauthserverbundle here how it: fos_oauth_server: service: user_provider: fos_user.user_manager options: access_token_lifetime: 20 #will set token life time 20 seconds this way have possibility change other options of oauth2.0 library used fosoauthserverbundle. hope post saves someone's time ;) have nice time other important tasks , improvements ;) enjoy is in official documentation: https://github.com/friendsofsymfony/fosoauthserverbundle/blob/master/resources/doc/configuration_reference.md

c# - Remove a character in a string, provided it is enclosed by brackets -

in advance, haven't learned regex yet (though i'm happy use 1 if supply it). i have strings this: "zum abschluss kommen (nachdrücklich; abgeschlossen werden)". what want replace character ; : whenever occurs somewhere in brackets(). ie: want string end "zum abschluss kommen (nachdrücklich: abgeschlossen werden)". the thing causing me trouble there amount of text within brackets usual (clumsy) string manip not helping me. extra example: "alle mann deck! (seemannsspr.; ein kommando)" -> "alle mann deck! (seemannsspr.: ein kommando)" i can't replace() because full strings contain ; want keep. eg: "das deck reinigen, scheuern; auf deck sein; unter, von deck gehen; alle mann deck! (seemannsspr.; ein kommando);" got suggestions? with restriction parenthesis/brackets not nested or unbalanced, consider regular expression uses positive look-behind . this behind ensures ...

time - Python: Hardware Timer or Software Timing Only? -

i wish know if there exist hardware timer library in python timer expires after given period , cause interrupt instead of time.time method polls time. #check timer(time) #timed out -> cause interrupt #isr code: return value

php - When To Use Object arrays over traditional arrays? -

in case more applicable use: $obj_array = new arrayobject(array(), arrayobject::std_prop_list); $obj_array->key = "value"; rather: $array = array(); $array['key'] = "value"; now, these both different. can tell far, know after performing research see no real reason have preference on object arrays on traditional arrays.. so show me active example on how object arrays provide more benefit on normal array in addition, i'm aware these object arrays new php.. database functions example, returns either array or single variables: $query = $db->prepare("select * tbl col=?"); $query->bind_param('s',$variable); $query->execute(); $query->bind_result($col1, $col2, $col3); $query->fetch(); $query->close(); the above example returns contents singe variables. so create object array using while loop: $obj_array = new arrayobject(array(), arrayobject::std_prop_list); $key_creation = 0; $query = ...

ruby on rails - I just can't get my valid password test to pass -

i'm trying valid password test pass. when run it seems password_digest hash different. don't know them match. i using book "ruby on rails tutorial: learn rails example" michael hartl , seems gets pass. additionally, application code works expected. can create user , authenticate them in console breaking in tests. i'm new testing may missing obvious here. thanks help! i using bcrypt has_secure_password , here's part relavent user spec code: describe user before { @user = user.new(name: "example user", email: "user@example.com", password: "foobar", password_confirmation: "foobar") } subject { @user } { should respond_to(:name) } { should respond_to(:email) } { should respond_to(:password_digest) } { should respond_to(:password) } { should respond_to(:password_confirmation) } { should respond_to(:authenticate) } { should be_valid } describe "return value of authenticate method...

How is Java Timer implemented by the computer? -

the articles on site related timer talk how use timer program. i ask different question. how java perform timer method? since said avoid time-consuming work not use while loop check whether current time required time point, think timer not implemented using while loop continuously checking , comparing current time desired time point. thank you! i think timer not implemented using while loop continuously checking , comparing current time desired time point. yes, is. optimization is; using priority queue based on nextexecutiontime tasks. javadoc states timer object single background thread used execute of timer's tasks, sequentially. timer tasks should complete quickly. if timer task takes excessive time complete, "hogs" timer's task execution thread. can, in turn, delay execution of subsequent tasks timer class contains taskqueue priority queue of timertasks, ordered on nextexecutiontime. timerthread(queue) timer...

ember.js - Getting an Ember controller's function property from inside an Ember Handlebars template -

in ember handlebars template, possible access controller's (string/boolean/number based) property using {{someproperty}} <somehtmltag {{bindattr somehtmltagattribute="someproperty" /> constructs. this doesn't seem work function-based controller properties. example the following works //handlebars <script type="text/x-handlebars" id="index"> property: {{someproperty}}<br/> </script> //javascript app.indexcontroller = ember.objectcontroller.extend({ someproperty: "yolo", }); the following doesn't work //handlebars <script type="text/x-handlebars" id="index"> property: {{someproperty}}<br/> </script> //javascript app.indexcontroller = ember.objectcontroller.extend({ someproperty: function() { return "yolo"; }, }); here jsfiddle using {{bindattr ...}} gives little insight problem: uncaught error: assert...

vhdl - Warning: Design contains 1 high-fanout nets. A fanout number of 1000 will be used for delay calculations involving these nets. (TIM-134) -

i'm having warning while syn. vhdl code synopsys design compiler. how can eliminate warning ? it's useful warning : , it's warning not error : why want eliminate it? 1) high fanout expected? if not, find out why it's occurring, , if turns out come mistake, (i wanted 1 register, not 32!) fix it. 2) if high fanout real , can tolerate slow timings result, increase fanout limit in synthesis tool. 3) if high fanout real , can not tolerate slow timings, check tool replicating signal enough times reduce fanout , improve timings. report duplicated signals somewhere. 4) if process requires remove every synthesis warning (and have never worked anywhere case) replicate signals (and add synthesis attributes prevent removal!) reduce fanout enough eliminate warning. leads messy, hard maintain designs.

php - I try to query a mysql column which has the name "5". This outputs the wrong column which has the name "22" -

i try query mysql column has name "5". outputs wrong column has name "22". this php code, $pid variable getting android app , number. when search $pid = 5 , instead of getting column "5" artist1, getting column "22" eternal1. basically confuses column name # in first print screen. if # doesn't exist, searches correctly; if search 16 column 16. how fix this? $pid = $_get["pid"]; $result=mysql_query("select * tablecomments `$pid` not null "); http://imgur.com/wfsfetb http://imgur.com/rza27xc this design in sql dialects can think of offhand. know several people who, out of habit, add order 0 desc or order 1 ad hoc queries, first pick typically id column , second "name" column or similar. they're querying based on ordinal position of field in query (or schema, in case of *) in order column named 5, need use appropriate sql quoting mechanism dialect , configuration. example, microsof...

list - Cakephp 2.0 Dropdown Select -

after reading , applying suggested answer dropdown, still got no results in dropdown. im newbie , gives me headache solving problem. have client table associated belongsto client_group table. whatever code modifications made naming convention, cant still display client group' data dropdown list. please help! please help! in advance create table `clients` ( `id` int unsigned auto_increment primary key, `client_group_id` int , `client_package_id` int , `client_account_id` int , `name` varchar(40), create table `client_groups` ( `id` integer not null auto_increment primary key, `name` varchar(50), insert `client_groups` (`id`,`name`) values (1,'top company holdings'); insert `client_groups` (`id`,`name`) values (2,'cadiz group of companies'); in client model: public $belongsto = array( 'clientgroup' => array( 'classname' => 'clientgroup', 'foreignkey' =...

parsing - Jsoup Android Fetching Info -

hello guys have been having issues jsoup, trying fetch(parse) info site app http://websemantics.co.uk/tutorials/accessibility_workshop/sessions/session2/03.data_tables/01.simple_data_tables/ i want fetch number of candidates colum separte strings of biology math, science etc. value parsed , attached string. how can it, can give example code? my take on be: //get site , parse document doc = jsoup.connect("http://websemantics.co.uk/tutorials/accessibility_workshop/sessions/session2/03.data_tables/01.simple_data_tables/").get(); //select table element table = doc.select("table").first(); iterator<element> iterator = table.select("td").iterator(); while(iterator.hasnext()){ system.out.println("text : "+iterator.next().text()); string math = text(); i tried different way not giving anything element table = doc.select("table").first(); iterator<element> iterator = table.s...

jquery - Using Javascript/PhoneGap to access a txt file on server -

this question has answer here: put text .txt file <p> tags using javascript 1 answer i trying access text file (stored on server) storing coordinates in order parse , store in phonegap application. i'm new javascript, possible do? i've searched around while , can't seem figure out on own. appreciated. thanks, molly you can use xmlhttprequest fetch text, assuming text file publicly accessible. use like: var req=new xmlhttprequest(); req.open("get", "txt_file_url", true); req.onreadystatechange=function () { if (req.readystate==4) { var txt=req.responsetext; // text } }; req.send(); unfortunately, asynchronous; if need synchronous way, try using async .

jquery - How can I make the horizontal scrolling smooth when using a Mac trackpad? -

i've made website horizontal scroll, there problem acceleration of mac trackpad makes not smooth. the website can viewed here: www.runeneesgaard.dk this code use make page go right when user scroll down on or mousewheel: $(function() { $("body").mousewheel(function(event, delta) { this.scrollleft -= (delta * 30); event.preventdefault(); }); does have idea how can make smooth , work acceleration of mac trackpad? or maybe "ignore" acceleration? i hope makes sense! :) thanks!

c - Global variable vs macro expansion for string literal -

i'm trying understand of intricacies preprocessor , of c compiler (specifically, gnu gcc) , string literals. more efficient assign global variable string literal occupies 1 place in memory vs using #define preprocessor directive? as in example, string literal on place in memory , accessed several times: #include <stdio.h> #include <string.h> char output[20] = "hello, world!!!"; int main (){ printf("%s %d characters long.\n", output, strlen(output)); return 0; } vs doing preprocessor: #include <stdio.h> #include <string.h> #define output "hello, world!!!" int main (){ printf("%s %d characters long.\n", output, (int) strlen(output)); return 0; } which translates as: #include <stdio.h> #include <string.h> #define output "hello, world!!!" int main (){ printf("%s %d characters long.\n", "hello, world!!!", (int) strlen("hello, world!!!...

Binary Tree Insert Algorithm -

i finished implementing binary search tree project working on. went , learned lot. however, need implement regular binary tree... reason has me stumped. i'm looking way insertnode function.. normally in bst check if data < root insert left , vice versa. however, in normal binary tree, filled left right, 1 level @ time.. could me implement function adds new node binary tree left right in no specific order? here's insert bst: void insert(node *& root, int data) { if(root == nullptr) { node * nn = new node; root = nn; } else { if(data < root->data) { insert(root->left, data); } else { insert(root->right, data); } } } thanks appreciated! i aware of fact question posted time ago, still wanted share thoughts on it. what (since indeed not documented) use breadth-first-search (using queue) , insert child first null encounter. ensure tree fill levels first before goes level. right numb...

android - Buttons not working with listview -

i have buttons across top of listview. buttons not function until select item list. according other posts, should add following line xml file: android:focusable="false". however, no change occurred after adding line. here xml file: <linearlayout android:layout_weight="2" android:layout_height="fill_parent" android:layout_width="match_parent" > <videoview android:id="@+id/video_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" /> </linearlayout> <linearlayout android:layout_weight="1" android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content...

Why does creating Media Player object crash my android code? -

i'm creating little program plays mario jump sound when jumps. can use z acceleration make program display message when reaches value 10 m/s^2. want play sound media player object, when create media player object, crashes code. i'll post code on pastebin. public class mainactivity extends activity implements sensoreventlistener { sensor accelerometer; sensormanager sm; textview acceleration; mediaplayer mp = mediaplayer.create(getbasecontext(),r.raw.jump); //line 17 @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); sm= (sensormanager)getsystemservice(sensor_service); accelerometer = sm.getdefaultsensor(sensor.type_accelerometer); sm.registerlistener(this, accelerometer, sensormanager.sensor_delay_normal); acceleration = (textview) fin...

datetime - Rails form: auto-set a future date based on date set -

my rails form asks users input start date event, , end date same event. setting default start date time.now is possible user can ever choose end date occurs on or after start date? (so when change start date, end date auto-updates)? my events controller: def new @event = event.new(params[:event]) # set date_start field today's date @event.date_start = time.now @event.date_end = @event.date_start end form (shortened...) <%= form_for(@event) |f| %> <%= f.label :date_start, "start date" %> <%= f.date_select(:date_start, :prompt => { :day => 'day', :month => 'month', :year => 'year' }) %> <%= f.label :time_start, "start time" %> <%= f.time_select :time_start, { :minute_step => 5 } %> <%= f.label :date_end, "end date" %> <%= f.date_select(:date_end, :prompt => { :day =>...

Declare multiple module.exports in Node.js -

what i'm trying achieve create 1 module contains multiple functions in it. module.js: module.exports = function(firstparam) { console.log("you did it"); }, module.exports = function(secondparam) { console.log("yes did it"); }, // may contain more functions main.js: var foo = require('module.js')(firstparam); var bar = require('module.js')(secondparam); the problem have firstparam object type , secondparam url string, when have complains type wrong. how can declare multiple module.exports in case? you can like: module.exports = { method: function() {}, othermethod: function() {} } or just: exports.method = function() {}; exports.othermethod = function() {}; then in calling program: var mymethods = require('./mymodule.js'); var method = mymethods.method; var othermethod = mymethods.othermethod;

iphone - Questions while using presentModalViewController -

in application, tried use function [self.navigationcotroller presentmodalviewcontroller:nextvc animated:yes]; however, when goes next view, subview fulfill whole screen(of course did) , question , how add bar button lead view back? i have tried use self.navigationitem.leftbarbuttonitem = [[uibarbuttonitem alloc]initwithtitle:@"back" style:uibarbuttonitemstyledone target:self action:@selector(go)]; in function viewdidload, did not work, there's no bar or button showed uinavigationbar *bb = [[uinavigationbar alloc]initwithframe:cgrectmake(0, 0, [uiscreen mainscreen].bounds.size.width, 44)]; self.nvbar = bb; [self.view addsubview:bb]; however, have no idea how add barbutton new navigationbar ---nvbar would give me solution? you need pop new view controller in order navigation bar automatically included. in view controller code above in, //*** hook 4 buttons these actions , play around //*** better sense of going on. //*** jsbviewcontr...

pasting an excel grid into an HTML form and pasting it back into an excel document -

Image
a friend of mine asked me 2 weeks ago , still trying think best way solve problem. apparently users ended system excel file have manually fill column (i expecting lot of data). the user have grid html form have pasted excel rows create rows in db is there clean way handle problem? should write client side format pasted text or should handle on front end? worry mistakes made user pasting wrong number of cells. if can't rid of excel step, write program reads excel file , store values in db. did excel processing apache poi in java.

c# - Importing Excel Data using Oledb -

i using following code display excel data datagrid using oledb. getting error fill: selectcommand.connection property has not been initialized. can tell me did go wrong? thanks code: using system; using system.data; using system.configuration; using system.web; using system.web.security; using system.web.ui; using system.web.ui.webcontrols; using system.web.ui.webcontrols.webparts; using system.web.ui.htmlcontrols; using system.data.sqlclient; using system.data.oledb; public partial class _default : system.web.ui.page { protected void page_load(object sender, eventargs e) { oledbconnection conn = new oledbconnection(@"provider=microsoft.ace.oledb.12.0;data source=d:\testing.xlsx;extended properties='excel 12.0 xml;hdr=yes;imex=1;'"); oledbcommand cmd = new oledbcommand("select * [sheet1$]"); if (conn.state == system.data.connectionstate.open) { conn.close(); } conn.open(); ...

javascript - Styling TripAdvisor widget -

Image
i've been asked attach travel advisor widget existing project. problem can't find way of styling it. searching google has proved negative , i've tried various ways change style myself each time i'm getting nowhere. it seem (by using developer tools) script adding other div tags within below code when it's called , it's these newly added div need style. any ideas? <div id="ta_linkingwidgetwar281" class="ta_linkingwidgetwar"> <ul id="7veu3ebbe54" class="ta_links i3ekq4as"> <li id="p1w6bwtqjemy" class="m0qrzat"> write review of <a target="_blank" href="http://www.tripadvisor.co.uk/restaurant_review-g1217951-d2315832-reviews-peking_chinese_takeaway-bradley_stoke_gloucestershire_england.html">peking chinese takeaway</a> </li> </ul> </div> <script src="http://www.jscache.com/wejs?wtype=linkingwidgetwar...