Posts

Showing posts from January, 2012

windows - Spawning multiple copies of a program from C code and redirecting the output to a file -

i working on modifying command-line program written in msdn c , pro*c (oracle pre-compiler write in-line sql , pl/sql statements) multiple copies can spawned , process concurrently. database-heavy program , concurrency issues taken care of on database side, thought easier run multiple copies alter program run multi-threaded. anyway, rely on printf() , output piping write program's output log files debugging purposes. having trouble launching separate copies of exe appropriately write own log files. have played lot exec() , system() functions different copies of exe launch , write logs. closest have gotten work using c line such as: system("start cmd /k call [program commmand , args] > log_file.txt"); this works great - spawns separate command windows , spawns separate copies of program appropriate data-sets. problem command windows stay open after program has finished executing. of our clients run program on scheduler, , having manually close of command windo...

Mysql: How to query with if else condition inside if -

Image
i'm getting trouble query data. not know start query if else condition inside if. problem is: how query if type = cpm , end_date < now() change result value type before , , if type = cpm , end_date > now() change result value type after . have data in table, result below : and want result below : array( [0] => array ( [id] => 1 [type] => free [end_date] => 2013-06-20 ) [1] => array ( [id] => 4 [type] => after [end_date] => 2013-08-29 ) [2] => array ( [id] => 5 [type] => before [end_date] => 2013-06-20 ) ) thanks in advance. something should work: select id, case when (type = 'cpm' , end_date < now()) 'before' when (type = 'cpm' , end_date > now()) 'after' else type end type, end_date my_ta...

javascript - Calling member methods before object declaration is finished -

this question has answer here: self-references in object literal declarations 17 answers sometime ago heard practice wrap code in big object serve namespace in order reduce global namespace cluttering , facilitate library export, tried this. var wrapper = { foo: function(){ return 42; }, bar: this.foo() }; it fails, claiming "foo not defined". calling methods before finishing object declaration bad, moved bar, , worked. var wrapper = { foo: function(){ return 42; }, }; wrapper.bar = wrapper.foo(); i feel can become kind of ugly, nested namespaces , such, there workarounds don't make hard see of wrapper's members @ once? the problem this going equal global context. need access function so: var wrapper = { foo: function(){ return 42; }, bar: null, init : function() { ...

vb6 - Load shortcut then close form automatically -

i want achieve when shortcut link runs ... form closes automatically, btw im new vb coding appreciated, here's code far private sub form_load() set ss = createobject("wscript.shell") ss.run chr(34) & ss.specialfolders("desktop") & "\app\somegame.lnk" & chr(34) end sub assuming you're using vb6 (which code looks like) can close form calling unload me at end of form_load event handler. however, don't need use form launch shortcut - can add module project (right-click project, select add -> module ) , call shellexecute() function launch shortcut so: 'declare shellexecute() api function private declare function shellexecute lib "shell32.dll" alias "shellexecutea" _ (byval hwnd long, byval lpoperation string, byval lpfile string, _ byval lpparameters string, byval lpdirectory string, _ byval nshowcmd long) long private const sw_shownormal long = 1 'entry point of pr...

c - struct intitialization notation not working with heap allocated storage -

with gcc (gcc) 4.4.6 , try compile program - 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main(int argc, char *argv[]) 5 { 6 7 struct b { 8 int i; 9 char ch; 10 }; 11 12 struct b *ptr; 13 14 ptr = (struct b*) calloc(1, sizeof(struct b)); 15 16 *ptr = { 17 .i = 10, 18 .ch = 'c', 19 }; 20 21 printf("%d,%c\n", ptr->i, ptr->ch); 22 23 return 0; 24 } 25 $ make gcc -g -wall -o test test.c test.c: in function ‘main’: test.c:16: error: expected expression before ‘{’ token make: *** [test] error 1 *ptr = { .i = 10, .ch = 'c', }; this usage called designated initializer , name implies, it's used initialize struct or arrays, trying assigning . the correct usage of designated initializer: strcut b foo = {.i = 10, .ch = 'c'}; to assign struct, still need use: ptr->i = 10; ptr->ch = 'c...

javascript - What can I do, client-side, to check if someone is hacking my website? -

for instance, there common fingerprints of xss that, if xss occurring, javascript script detect it? or detect other tampering? i suppose scan every anchor tag , check see if sessionid attached it.

java - Can a regular expression be used for getting a substring? -

i'm writing code java fx code evaluate button being clicked, need compare id of getsource string. i'm getting strings like: button[id=playbutton, styleclass=button] button[id=pausebutton, styleclass=button] button[id=stopbutton, styleclass=button] button[id=nextbutton, styleclass=button] so according button being clicked perform statements. using set of if , else if 's evaluating contains(id) id play, pause, stop , next. i'd better use switch every case play, pause, stop , next. how can substring, getting of either play, pause, stop or next? why need regex, when simple indexof("id="), lastindexof ("button,") , substring of previous 2 calls work fine?

uitableview - Need advice to make a quiz in iPhone? -

i trying make quiz application iphone. there 10 questions in quiz, has question button ( go previous question) , next question (go next question). user must completed in 15 mins. i using uitableview store answer (a, b, c, d) , user answer using "checkmark" however, meet problem: in question 1, selected row 1 (b answer) answer. when press next question, row 1 selected, it's similar other question when press next question or question button although answer question 1? in opinion, should use uitableview or other object? if use uitableview, can fix it? can give me recommend? thanks you, can see project: http://i5.upanh.com/2013/0826/06//57290900.screenshot20130826at11713pm.png yes, ofcourse can uitableview . suggest create nsmutabledictionary below, return questions array count in numberofrowsinsection , parse dictionary , show in uitableview. the selected variable inside answers array can bound checkbox in cell. add member variable keeping curre...

sdk - Error using .so library inside android application -

i trying use .so library ( http://illiri.com/api.html ) inside android application. have copied .so files in libs folder (libs/armeabi, libs/armeabi-v7a, libs/mips, libs/x86), , loading libraries as, system.loadlibrary("crypto"); system.loadlibrary("ssl"); system.loadlibrary("sapi"); but getting error in stack trace. 08-26 11:17:24.677: e/dalvikvm(25747): not find class 'com.illiri.sapi.sapiconnection', referenced method com.ey.illiritest.mainactivity.oncreate 08-26 11:17:24.697: w/dalvikvm(25747): vfy: unable resolve new-instance 474 (lcom/illiri/sapi/sapiconnection;) in lcom/ey/illiritest/mainactivity; 08-26 11:17:24.697: d/dalvikvm(25747): vfy: replacing opcode 0x22 @ 0x000b 08-26 11:17:24.697: d/dalvikvm(25747): vfy: dead code 0x000d-0030 in lcom/ey/illiritest/mainactivity;.oncreate (landroid/os/bundle;)v 08-26 11:17:24.697: i/dalvikvm(25747): not find method com.illiri.sapi.sapiconnection.suspend, referenced metho...

javascript - Parse xml doc on internet explorer -

i want parse xml doc. following code snippet: //following on receiving xml doc self.xmlhttpreq.onreadystatechange = function() { if(self.xmlhttpreq.readystate == 4 && self.xmlhttpreq.status == 200) { if (navigator.appname == 'microsoft internet explorer') { xmldoc = self.xmlhttpreq.responsetext; var reqst = new regexp("<d0>0"); //this binary value //how parse in ie?? } else // moz, chrome { xmldoc = self.xmlhttpreq.responsexml; xmldat1 = xmldoc.getelementsbytagname('d0')[0].firstchild.nodevalue; xmldat2 = xmldoc.getelementsbytagname('d1')[0].firstchild.nodevalue; } } the above parsing works mozilla , chrome, ie how can parsing? note: can't use jquery technique. you need set particular line when parsing ie5 , ie6: xmlhttp=new activexobject("microsoft.xmlhttp"); check link: http://www.w3schools.com/xml/xml_parse...

c# - Taglib sharp not editing rating -

i have encountered strange problem while using taglib sharp. changes rating of video file using code shown below. taglib.file file = taglib.file.create(fullfilepath); taglib.tag tag = file.gettag(tagtypes.id3v2); taglib.id3v2.popularimeterframe frame = taglib.id3v2.popularimeterframe.get((taglib.id3v2.tag)tag, "windowsuser", true); frame.rating = 255; file.save(); after saving file when open detail tab of video file properties, rating seems not change. when again read file programmatically in c# , check rating value, 255. why happening , why rating value not updating ? looking @ answer check music file rating vb.net + winforms , cause tags may getting saved id3v2.4 , windows supports id3v2.3. you can force taglib# save tags id3v2.3 following code: taglib.id3v2.tag.defaultversion = 3; taglib.id3v2.tag.forcedefaultversion = true;

class - Converting String into Object Python -

i've started learning python couple of weeks ago, , started writing text-based adventure game. i'm having trouble finding way convert strings instances of class, other using eval(), i've read isn't safe. reference, here's i'm working with: class room(object): """defines class rooms in game.""" def __init__(self, name, unlocked, items, description, seen): self.name = name self.unlocked = unlocked self.items = items self.description = description self.seen = seen class item(object): """ defines class of items in rooms.""" def __init__(self, name, actions, description): self.name = name self.actions = actions self.description = description def examine(input): if isinstance(eval(input), room): print eval(input).description elif isinstance(eval(input), item): print eval(input).description el...

regex - Using a regular expression with CORS -

i trying use regular expression cors. have read many times not possible cors (*) or exact domains. access-control-allow-origin wildcard subdomains, ports , protocols . seems contradict : http://www.cameronstokes.com/2010/12/26/cross-origin-resource-sharing-and-apache-httpd/ . clarify , if using regular expression possible provide simple example have tried implement link above no success. the regular expression wish use ^http\://\blocal-.*\b\.testing-test:10005$ i have checked regex , matches generated urls. have added setenvif , header set lines suggested apache2.conf (is correct?) follows setenvif origin "^http\://\blocal-.*\b\.mycompany-it:10005$" accesscontrolalloworigin=$0 header add access-control-allow-origin % {accesscontrolalloworigin}e env=accesscontrolalloworigin i lost next.it doesn't work in advance access-control-allow-origin headers can wildcard '*' or exact url. 1 way first value of origin header request (...

ruby - Passing node attributes into chef-apply -

is there way pass attributes chef-apply run of cookbook? the first line of cookbook is: if node[:my_attr][:enabled] which leads to: nomethoderror: undefined method '[]' nil:nilclass when run chef-apply recipes/default.rb adding appropriate attributes attributes/default.rb not fix problem, neither adding initialization node[:my_attr] = {} . how can pass node attributes chef-apply run? in attributes/default.rb declare default['my_attr']['enabled']= "value" then able access them in recipe you can pass value of attribute using chef-client -j option.

android - Best way of handling recreated dialog fragment after activity is destroyed and recreated -

i have activity may show dialogfragments. activity needs response dialogs. use listener. in activity: progressmarkdialog dialog = new progressmarkdialog(); dialog.setonprogressmarkselected(new progressmarkdialog.onprogressmarkselected() { @override public void onselect(final int a) { //some code.. } }); in dialog: public void setonprogressmarkselected(onprogressmarkselected onprogressmarkselected) { this.onprogressmarkselected = onprogressmarkselected; } this code works fine until somehow activity destroyed, dialog still open. program crash nullpointerexception because onprogressmarkselected null. i can use @override public void onattach(final activity activity) { super.onattach(activity); onprogressmarkselected = (onprogressmarkselected) activity; } and implement interface in activity. if have few dialogfragments, means should implement few interface in activity , code messy. android best practice case? in opinion best way s...

iphone - View psd file in objective-c -

is there way view psd file in objective-c (iphone/ipad)? view image, no edit or change anything, view file. searched still not find out positive solution. anyone know pls me, in advance. you can view following link same question make , edit .psd file in iphone file system

c++ - std::queue should I shrink to fit? -

i considering use std::queue (with std::deque ) fifo structure. in queue data structure, data pushed in , popped in front. therefore, memory in front after popping element never used. i remember std::vector not release memory until explicitly call shrink_to_fit method. std::deque ? so, should consider releasing memory in front never used again? you don't need shrink_to_fit queue, if used normally. std::vector 's shrink_to_fit meant situations vector content has diminished huge amount, has benefit call (rather costly) reallocation in order free huge amount of memory. in general not needed if vector has short lifetime or if size not vary much. having said that, std::deque different kind of beast. typically consists of fixed-size chunks of memory. if erase lots of elements deque, chunks no longer contain elements can/will deallocated. biggest memory overhead can have @ time bit under twice chunk size, e.g. if queue contains 2 elements, 1 @ end of chunk, ...

iphone - iOS stream audio from authenticated URL -

i want stream audio file source needs oauth2 authentication, code, not working. nsmutableurlrequest *req = [nsmutableurlrequest requestwithurl:url]; [req setvalue:[nsstring stringwithformat:@"bearer %@", accesstoken] forhttpheaderfield:@"authorization"]; player = [avplayer playerwithurl:req.url]; [player play]; can please help? the issue you're adding authentication token http header, making request using url (and headers not included in url). i need similar thing in app, doesn't it's possible interfere avplayer's network request (at least, not public api). i'm looking @ either requesting file myself using nsurlsession (which means no streaming - gotta wait whole file, or else complicated processing hand off audio player in chunks), or else fudge web service accept parameter query parameter instead of http header. this question has potential work-arounds: send headers avplayer request in ios

c++ - Get proper IP and MAC addres in Winsock -

i'm trying external ip , mac address using winsock. on computer have installed virtualbox. when trying ip , mac address of computer 2 addresses. 1 computer , 1 virtualbox. here function ip , mac addresses: long netutils::getlocalipaddress() { if( localipaddress == -1) { wsadata wsadata; if (wsastartup(makeword(1, 1), &wsadata) != 0) { std::cout << "wsastartup error " << "wsagetlasterror" <<std::endl; localipaddress = -1; wsacleanup(); return localipaddress; } char ac[80]; if (gethostname(ac, sizeof(ac)) == socket_error) { std::cout << "error " << wsagetlasterror() <<" when getting local host name." << std::endl; localipaddress = -1; wsacleanup(); return localipaddress; } struct hostent *phe = gethostbyname(ac); if (phe == 0)...

Header php Get method from list -

in test.php have following code: <php? header ('location: $link '); $link = $_get["id"] ss1 = 'http://drrd.com'; ss2 = 'http://drrd2.com'; ss3 = 'http://drrd3.com'; ss4 = 'http://drrd4.com'; ss5 = 'http://drrd5.com'; ss6 = 'http://drrd6.com'; ss7 = 'http://drrd7.com'; ?> when go test.php?id=ss3 page should redirect me http://drrd3.com/ how that? try one: <?php ob_start(); $links = array( 'ss1' => 'http://drrd.com', 'ss2' => 'http://drrd2.com', 'ss3' => 'http://drrd3.com', 'ss4' => 'http://drrd4.com', 'ss5' => 'http://drrd5.com', 'ss6' => 'http://drrd6.com', 'ss7' => 'http://drrd7.com' ); $id = $_get['id'] ? ($links[$_get['id']] ? $_get['id']: 'ss1') : 'ss1'; header ('locatio...

sql server - How to select all the records even if there is no data in sql -

Image
i have query like select 'education' purpose,ate_sex, age_range, count(*) total ( select dbo.clientmain.ate_sex, dbo.clientmain.ate_id, case when ate_age between 15 , 19 '15-19' when ate_age between 20 , 24 '20-24' when ate_age between 25 , 34 '25-34' when ate_age between 35 , 44 '35-44' when ate_age between 45 , 54 '45-54' when ate_age between 55 , 64 '55-64' else '80+' end age_range dbo.clientmain inner join dbo.clientsub on dbo.clientmain.ate_id = dbo.clientsub.ate_id (dbo.clientsub.chk_name = n'assistance') ) t group ate_sex,age_range which returns data as: but want result when there no record age range in 15-19, have return zero. education male 15-19 0 these tables can please modify query zeros no records. use left join instead of...

Wrong store ID generates errors in Magento backend -

when going system>config.>developer stack, seems have store id 4. once had store id 4, it's deleted , have store id 1 now. cannot figure out calling store id4, called since " mage_core_model_url->setstore('4')" in th stack. how can tell, extension, module or part of magento calling this? #0 /var/www/site.com/public_html/app/code/local/mage/core/model/app.php(831): mage_core_model_app->throwstoreexception() #1 /var/www/site.com/public_html/app/code/core/mage/core/model/url.php(342): mage_core_model_app->getstore('4') #2 /var/www/site.com/public_html/app/code/core/mage/core/model/url.php(616): mage_core_model_url->setstore('4') #3 /var/www/site.com/public_html/app/code/core/mage/core/model/url.php(734): mage_core_model_url->setrouteparams(array, false) #4 /var/www/site.com/public_html/app/code/core/mage/core/model/url.php(977): mage_core_model_url->getrouteurl('', array) #5 /var/www/site.com/public_html/app/m...

Finding maximum value in a group using proc means in SAS? -

suppose have data in table match_day name goals 1 higuain 4 1 messi 1 1 ozil 4 1 villa 3 1 xavi 4 2 benzema 4 2 messi 4 2 ronaldo 3 2 villa 4 2 xavi 4 now want find out player scored maximum goals in each match. tried using doing- proc means data=b nway max; class match_day name; var goals; output out=c(drop=_type_ _freq_) max=goals; run; but not work. correct way of doing this? this isn't can in proc means. it's easier in sql or data step. direct solution: proc sort data=b; match_day descending goals; *so highest goal number @ top; run; data c; set b; match_day; if first.match_day; *the first record per match_day; run; that give record largest number of goals. if there tie, not more 1 record, instead arbitrarily first. if want keep records number, can do: data c; set b; retain keep; match_day descending goals; if ...

c# - Regular expression find and replace to wrap tags -

does know how use regex find , replace word with <b>[keyword]</b> i tried use regex.replace() seems support direct replacement instead of appending <b></b> @ begin , last of keyword. example: hello world! keyword: hello output: <b>hello</b> world! you may try this: using system; using system.text.regularexpressions; class program { static void main(string[] args) { string input = "hello world!", keyword = "hello"; var result = regex .replace(input, keyword, m => string.format("<b>{0}</b>", m.value)); console.writeline(result); } }

How to create a new project/module in IntelliJ from CVS? -

in eclipse, new project may created cvs project in way: file > new > project..., select wizard cvs > projects cvs. it possible select tag/branch new project. how can same in intellij idea? i'm not sure if there quicker way it, (2 ways), either: create project root in svn via other method (e.g. tool similar tortoisesvn), , check out in intellij via vcs -> checkout version control create new intellij project (use proper format, e.g. maven module), , check in via vcs -> import version control now have asked question, realize 'clunky' 2-step process in otherwise usable ide. and can screw checking out or importing out / wrong point (ever ended c:\myproject\trunk\trunk ?) there's every chance missed something, otherwise think create new project in vcs wizard fine feature request jetbrains people.! so asking question, upvoted.

java - I can't insert into MsAccess database -

Image
i have following ui but then, can't insert data ms access database . first row generated manually through ms access database i don't know what's matter code, seems they're doing fine private void dosimpan(string idnya, string namanya,string alamatnya,string teleponnya,string emailnya,string passwordnya,string rolesnya) { try { string query = "insert msemployee (employeeid, employeename, employeeaddress, employeephone, employeeemail, employeepassword, employeerole)values ('"+idnya+"','"+namanya+"','"+alamatnya+"','"+teleponnya+"','"+emailnya+"','"+passwordnya+"','"+rolesnya+"')"; connect.executequery(query); filltable(); cmd.printsuccess("master employee", namanya+" saved successfully"); } catch (exception e) { } } here execquery method private state...

java - Application stop suddenly when trying to login -

after creating inserting username , password signup.java, app stop when login (in emulator), , move signup page in (bluestack). not sure if data being entered in database when signing up. dbmanager.java package com.example.student_project; import com.example.student_project.*; import android.content.contentvalues; import android.content.context; import android.database.cursor; import android.database.sqlexception; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteexception; import android.database.sqlite.sqliteopenhelper; public class dbmanager { public static final string key_rowid = "_id"; public static final string key_username = "username"; public static final string key_password = "password"; private static final string database_name= "login.db"; private static final int database_version = 4; private static final string database_table = "login_table"; p...

sql - Performance impact due to Join -

i have 2 tables product , account. product table columns product_id (pk) subscription_id account table columns account_nbr subscription_id (account_nbr , subscription_id primary key columns in account table) ... other columns i have find account_nbr , subscription_id product_id . i product_id input. using can subscription_id product table , using subscription_id can account_nbr value account table. instead of getting info in 2 queries, can done in 1 query? something below: select distinct a.acct_nbr,p.subscription_id account a,product p v.product_id = ' val 1' , v.subscription_id = p.subscription_id will performance of above query low compared 2 separate queries? i have find account_nbr , subscription_id product_id. so, you're correct in approach need join 2 result-sets together: select p.account_nbr, p.subscription_id account join product p on a.subscription_id = p.subscription_i...

Re-execute command by :history option in VIM -

how can execute command again listed in the :history option in vim. there numbers shown. way copy command hand, re-enter it? or there in shell script. :history there @ it. to re-execute previous command, have 2 options: use <up> , <down> @ command prompt: :m10 (do stuff) :<up> use "command-line window": you can call q: , navigate search , use beautiful normal mode commands love. position cursor on line , hit <cr> re-execute command. edit command , hit <cr> execute new command. you can quit command-line window :q . see :help cmdline-window .

sql - subtract values in different columns and different rows -

i have 1 table following values: job name start_dt end_dt gggggg 4/5/2013 5/5/2013 iiiii 6/5/13 7/8/13 i want subract start_dt of gggggg end_dt of iiiii . i using query: select a.job_nm,(b.end_dt-a.start_dt) difference job a,b a.job_nm='ggggg' , b.job_nm='iiiii'. this giving me no output. if sql server can use datediff() : select a.job_nm, datediff(day, a.start_dt, b.end_dt) [difference] job a,b a.job_nm='ggggg' , b.job_nm='iiiii'

php - Cakephp input prompt text -

i have following input field in form: echo $this->form->input('website_name'); now want display prompt text when user starts type disapears i have tried following: echo $this->form->input('website_name'),array('namespace'=>'hello world'); echo $this->form->input('website_name'),array('title'=>'hello world'); echo $this->form->input('website_name'),array('placeholder' =>'hello world'); but no luck. know how prompt text on these text fields? you can use placeholder instead of name , title. echo $this->form->input('website_name',array('placeholder'=>'hello world'));

html - Text overflow out of a panel in bootstrap -

the text inside div panel overflowing out of boundary unpredictably. can't seem find problem. can tell me why happening or how can permanently solve this? here's screenshot ! try using following css property. the word-wrap css property used specify whether or not browser may break lines within words in order prevent overflow when otherwise unbreakable string long fit in containing box. word-wrap:break-word; break-word indicates unbreakable words may broken @ arbitrary points if there no otherwise acceptable break points in line.

ios - Send image to .NET web service -

i developing ios application using .net web service. in 1 of web services, have send image httppostedfilebase in parameter called " file ", return image url , status parameters response. not sure httppostedfilebase. trying send bytes. getting image url null ws. guess ws call works fine, problem in way send image. using following code append image data http body. nsdata *imagedata = uiimagejpegrepresentation(image, 1); [postdata appenddata:[[nsstring stringwithformat:@"--%@\r--\n",boundary] datausingencoding:nsutf8stringencoding]]; [postdata appenddata:[@"content-disposition: form-data; name=\"file\"; filename=\"file.jpeg\"\r\n" datausingencoding:nsutf8stringencoding]]; [postdata appenddata:[@"content-type: image/jpeg\r\n\r\n" datausingencoding:nsutf8stringencoding]]; [postdata appenddata:imagedata]; [request addvalue:@"application/octet-stream" forhttpheaderfield:@"content-type"]; [request addvalue:[...

android - Listview not filling its parent -

Image
i have faced following problem: i'm trying implement navigation drawer subheadings 1 in gmail app , 1 app: as can see, have higlighted there no dividers @ end of each list so have taken implementation subheadings stack overlfow , have ended this: know, navigation drawer uses listview , reason why divider there because subheading list item setting option footerdividerenabled false doesn't solve problem. so next implementaiton put view contatin subheading , listview , added navigation-drawer's listview. here source code of mainactivity: package com.myphun.radio; import java.util.arraylist; import java.util.list; import android.content.context; import android.os.bundle; import android.support.v7.app.actionbar; import android.support.v7.app.actionbaractivity; import android.view.view; import android.view.viewgroup; import android.widget.abslistview; import android.widget.arrayadapter; import android.widget.linearlayout; import android.widget.listview; ...

css - How to center divs on page -

in fiddle : http://jsfiddle.net/h4f8h/16/ i'm attempting center 2 divs wrapping outer div , centering : <div style="margin-left:auto;margin-right:auto;"> but divs remaining left aligned. how can center these divs on page ? fiddle code : html : <div style="margin-left:auto;margin-right:auto;"> <div id="block"> <img height="50" style="max-width: 50px;background-position: top left;" src="http://socialmediababe.com/wp-content/uploads/2010/12/administrator.jpg" /> <div style="font-size:20px;font-weight:bold;"> test </div> <div> <a href="http://www.google.com">google</a> </div> </div> <div id="block"> <img height="50" style="max-width: 50px;background-position: top left;" src="http://socialmediababe.com/wp-content/uploads/2010/12/administrator.jpg" /> <div style="...

R: Bootstrapped binary mixed-model logistic regression using bootMer() of the new lme4 package -

i want use new bootmer() feature of new lme4 package (the developer version currently). new r , don't know function should write fun argument. says needs numerical vector, have no idea function perform. have mixed-model formula cast bootmer(), , have number of replicates. don't know external function does? supposed template bootstrapping methods? aren't bootstrapping methods implemented in bootmer? why need external "statistic of interest"? , statistic of interest should use? is following syntax proper work on? r keeps on error generating fun must numerical vector. don't know how separate estimates "fit" , should in first place? can lost "fun" argument. don't know should pass mixed-model glmer() formula using variable "mixed5" or should pass pointers , references? see in examples x (the first argument of bootmer() *lmer() object. wanted write *mixed5 rendered error. many thanks. my code is: library(lme4) library(bo...

c# - Display data in crystal report when more than one table in DataSet -

i using crystal report vs 10, i have added dataset. now if there's 1 table in dataset data being displayed, while if add 2 tables link, data not being display. and taking fields table of dataset(xsd). how overcome problem. thanks in advance. khilen you need bind datatable(s) intend use instead of binding entire dataset. answer shows example: https://stackoverflow.com/a/8341474/283895 (code copied article) reportdocument rpt = new reportdocument(); rpt.load(); rpt.database.tables[0].setdatasource(ds.tables[0]); this.crystalreportviewer1.reportsource = rpt;

testing - How to rerun a test and keep history on TFS? -

everyone. i reading this page describes how run tests in team foundation service. page doesn't describe happens test ran again. how keep history of times test ran? maybe using "copy test" feature? can explain better proccess of testing in team foundation service? thank guys much.

Typo3: remove Email attachment size limit -

i have contact form on website possibility add attachment email. it's normal form configured this: position* | *position=input name* | *name=input vorname* | *vorname=input firma | firma=input strasse | strasse=input plz / ort | plz_ort=input land | land=input telefon g | telefon_g=input telefon p | telefon_p=input mobile | mobile=input email* | *email=input website | homepage=input ihre nachricht | ihre_nachricht=textarea,,5 cv | attachment1=file, 4096000 | formtype_mail=submit | html_enabled=hidden | 1 | subject=hidden | kontaktformular internet the problem is, files aren't attached email, if bigger 2mb. upload doesn't have problem, if add 2 or more attachments, smaller 2 mb. formmailmaxattachmentsize shouldn't problem, because it's set 25000000. i've searched solutions on internet didn't find me solve issue. the version of typo3 4.4.2 some operating systems (like debian) come default upload size of 2 mb php uploads. please check...

how to display data that is related to a specific cell in excel 2010? -

Image
i have created 2 columns, first has category of system using data validation, , second has description , failures of system. purpose of open malfunction on parts. in different sheet wish same time want choose system , description automatically appear in next column showing me malfunctions have written on system. not @ functions of excel. still searched 1 might me. have tried using dget function got me nowhere. perhaps try solution here - it's bit tricky explain without copy-pasting whole thing: https://superuser.com/questions/536234/excel-how-to-vlookup-to-return-multiple-values also take @ vlookup() if you're working across spreadsheets.

metadata - How to get the PC object's table name with Datanucleus v3.2? -

edit-this answer code mistakenly used editing metadata. reading it, use following: pmf.getmetadata(machineclass.getname()).gettable() i've been doing long time using previous datanucleus versions i'm not sure why isn't working anymore v3.2 this code doesn't work because getmetadataforclass method returns null ! nucleusjdohelper.getmetadataforclass(pmf, clazz).gettable() where pmf persistencemanagerfactory , clazz class<?> object representing class type of pc (i.e. persistence capable) object need retrieve table name for. i'm using annotations define mappings. to create persistencemanagerfactory , i'm using following code: jdohelper.getpersistencemanagerfactory(new fileinputstream(filepath)); where filepath path properties file enough data has been used long time without change. edit: neil 's answer, switched using following code sequence: jdometadata md = pmf.newmetadata(); packagemetadata pmd = md.newpackagemetada...

gem - Error in set up Rails -

i trying learn ruby on rails. have installed ubuntu in virtualbox under host system windows 7 64 bit. have set ruby , next step want set rails. after entering command: sudo gem install rails i got following messages: fetching: minitest-4.7.5.gem (100%) fetching: atomic-1.1.13.gem (100%) building native extensions. take while... error: error installing rails: error: failed build gem native extension. /usr/bin/ruby1.9.1 extconf.rb /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- mkmf (loaderror) /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require' extconf.rb:13:in `' gem files remain installed in /var/lib/gems/1.9.1/gems/atomic-1.1.13 inspection. results logged /var/lib/gems/1.9.1/gems/atomic-1.1.13/ext/gem_make.out what should solve situation? ready give additional info need. thank help. when error, it's because forgot install ruby1.9.1-dev , make.

checkbox - Expandable listview like tree view in android -

Image
i want create tree view in android. tried implement expandable listview checkboxes. want when list group checkbox checked, list items under group selected. user might able select particular items in listview. please @ images: how should in android? issue facing that, if add checkbox group of expandable listview, list can not expanded more. source code : activity_main.xml : <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="#f4f4f4" > <expandablelistview android:id="@+id/lvexp" android:layout_height="match_parent" android:layout_width="match_parent" android:cachecolorhint="#00000000"/> </linearlayout> list_group.xml : ...